/* Generated by Cython 0.20.1post0 (Debian 0.20.1+git90-g0e6e38e-1) on Tue May 27 08:27:45 2014 */

#define PY_SSIZE_T_CLEAN
#ifndef CYTHON_USE_PYLONG_INTERNALS
#ifdef PYLONG_BITS_IN_DIGIT
#define CYTHON_USE_PYLONG_INTERNALS 0
#else
#include "pyconfig.h"
#ifdef PYLONG_BITS_IN_DIGIT
#define CYTHON_USE_PYLONG_INTERNALS 1
#else
#define CYTHON_USE_PYLONG_INTERNALS 0
#endif
#endif
#endif
#include "Python.h"
#ifndef Py_PYTHON_H
    #error Python headers needed to compile C extensions, please install development version of Python.
#elif PY_VERSION_HEX < 0x02040000
    #error Cython requires Python 2.4+.
#else
#define CYTHON_ABI "0_20_1post0"
#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
#ifndef Py_HUGE_VAL
  #define Py_HUGE_VAL HUGE_VAL
#endif
#ifdef PYPY_VERSION
#define CYTHON_COMPILING_IN_PYPY 1
#define CYTHON_COMPILING_IN_CPYTHON 0
#else
#define CYTHON_COMPILING_IN_PYPY 0
#define CYTHON_COMPILING_IN_CPYTHON 1
#endif
#if CYTHON_COMPILING_IN_PYPY
#define Py_OptimizeFlag 0
#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 CYTHON_FORMAT_SSIZE_T ""
  #define PyInt_FromSsize_t(z) PyInt_FromLong(z)
  #define PyInt_AsSsize_t(o)   __Pyx_PyInt_As_int(o)
  #define PyNumber_Index(o)    ((PyNumber_Check(o) && !PyFloat_Check(o)) ? PyNumber_Int(o) : \
                                (PyErr_Format(PyExc_TypeError, \
                                              "expected index value, got %.200s", Py_TYPE(o)->tp_name), \
                                 (PyObject*)0))
  #define __Pyx_PyIndex_Check(o) (PyNumber_Check(o) && !PyFloat_Check(o) && \
                                  !PyComplex_Check(o))
  #define PyIndex_Check __Pyx_PyIndex_Check
  #define PyErr_WarnEx(category, message, stacklevel) PyErr_Warn(category, message)
  #define __PYX_BUILD_PY_SSIZE_T "i"
#else
  #define __PYX_BUILD_PY_SSIZE_T "n"
  #define CYTHON_FORMAT_SSIZE_T "z"
  #define __Pyx_PyIndex_Check PyIndex_Check
#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)
  #define PyBUF_RECORDS (PyBUF_STRIDES | PyBUF_FORMAT | PyBUF_WRITABLE)
  #define PyBUF_FULL (PyBUF_INDIRECT | PyBUF_FORMAT | PyBUF_WRITABLE)
  typedef int (*getbufferproc)(PyObject *, Py_buffer *, int);
  typedef void (*releasebufferproc)(PyObject *, Py_buffer *);
#endif
#if PY_MAJOR_VERSION < 3
  #define __Pyx_BUILTIN_MODULE_NAME "__builtin__"
  #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) \
          PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
  #define __Pyx_DefaultClassType PyClass_Type
#else
  #define __Pyx_BUILTIN_MODULE_NAME "builtins"
  #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) \
          PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
  #define __Pyx_DefaultClassType PyType_Type
#endif
#if PY_VERSION_HEX < 0x02060000
  #define PyUnicode_FromString(s) PyUnicode_Decode(s, strlen(s), "UTF-8", "strict")
#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_VERSION_HEX < 0x02060000
  #define Py_TPFLAGS_HAVE_VERSION_TAG 0
#endif
#if PY_VERSION_HEX < 0x02060000 && !defined(Py_TPFLAGS_IS_ABSTRACT)
  #define Py_TPFLAGS_IS_ABSTRACT 0
#endif
#if PY_VERSION_HEX < 0x030400a1 && !defined(Py_TPFLAGS_HAVE_FINALIZE)
  #define Py_TPFLAGS_HAVE_FINALIZE 0
#endif
#if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND)
  #define CYTHON_PEP393_ENABLED 1
  #define __Pyx_PyUnicode_READY(op)       (likely(PyUnicode_IS_READY(op)) ? \
                                              0 : _PyUnicode_Ready((PyObject *)(op)))
  #define __Pyx_PyUnicode_GET_LENGTH(u)   PyUnicode_GET_LENGTH(u)
  #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i)
  #define __Pyx_PyUnicode_KIND(u)         PyUnicode_KIND(u)
  #define __Pyx_PyUnicode_DATA(u)         PyUnicode_DATA(u)
  #define __Pyx_PyUnicode_READ(k, d, i)   PyUnicode_READ(k, d, i)
#else
  #define CYTHON_PEP393_ENABLED 0
  #define __Pyx_PyUnicode_READY(op)       (0)
  #define __Pyx_PyUnicode_GET_LENGTH(u)   PyUnicode_GET_SIZE(u)
  #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i]))
  #define __Pyx_PyUnicode_KIND(u)         (sizeof(Py_UNICODE))
  #define __Pyx_PyUnicode_DATA(u)         ((void*)PyUnicode_AS_UNICODE(u))
  #define __Pyx_PyUnicode_READ(k, d, i)   ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i]))
#endif
#if CYTHON_COMPILING_IN_PYPY
  #define __Pyx_PyUnicode_Concat(a, b)      PyNumber_Add(a, b)
  #define __Pyx_PyUnicode_ConcatSafe(a, b)  PyNumber_Add(a, b)
#else
  #define __Pyx_PyUnicode_Concat(a, b)      PyUnicode_Concat(a, b)
  #define __Pyx_PyUnicode_ConcatSafe(a, b)  ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ? \
      PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b))
#endif
#define __Pyx_PyString_FormatSafe(a, b)  ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b))
#define __Pyx_PyUnicode_FormatSafe(a, b)  ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b))
#if PY_MAJOR_VERSION >= 3
  #define __Pyx_PyString_Format(a, b)  PyUnicode_Format(a, b)
#else
  #define __Pyx_PyString_Format(a, b)  PyString_Format(a, b)
#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_MAJOR_VERSION >= 3
  #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj)
  #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj)
#else
  #define __Pyx_PyBaseString_Check(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj) || \
                                         PyString_Check(obj) || PyUnicode_Check(obj))
  #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj))
#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
  #define PyNumber_Int                 PyNumber_Long
#endif
#if PY_MAJOR_VERSION >= 3
  #define PyBoolObject                 PyLongObject
#endif
#if PY_VERSION_HEX < 0x030200A4
  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) || (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 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
#ifndef CYTHON_RESTRICT
  #if defined(__GNUC__)
    #define CYTHON_RESTRICT __restrict__
  #elif defined(_MSC_VER) && _MSC_VER >= 1400
    #define CYTHON_RESTRICT __restrict
  #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
    #define CYTHON_RESTRICT restrict
  #else
    #define CYTHON_RESTRICT
  #endif
#endif
#ifdef NAN
#define __PYX_NAN() ((float) NAN)
#else
static CYTHON_INLINE float __PYX_NAN() {
  /* Initialize NaN. The sign is irrelevant, an exponent with all bits 1 and
   a nonzero mantissa means NaN. If the first bit in the mantissa is 1, it is
   a quiet NaN. */
  float value;
  memset(&value, 0xFF, sizeof(value));
  return value;
}
#endif
#ifdef __cplusplus
template<typename T>
void __Pyx_call_destructor(T* x) {
    x->~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

#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__algos
#define __PYX_HAVE_API__pandas__algos
#include "string.h"
#include "stdio.h"
#include "stdlib.h"
#include "numpy/arrayobject.h"
#include "numpy/ufuncobject.h"
#include "pythread.h"
#include "numpy_helper.h"
#include "src/headers/math.h"
#include "math.h"
#include "skiplist.h"
#include "headers/stdint.h"
#include "datetime.h"
#include "datetime_helper.h"
#include "numpy/ndarrayobject.h"
#include "numpy/npy_common.h"
#include "datetime/np_datetime.h"
#include "datetime/np_datetime_strings.h"
#include "khash_python.h"
#include "pystate.h"
#ifdef _OPENMP
#include <omp.h>
#endif /* _OPENMP */

#ifdef PYREX_WITHOUT_ASSERTIONS
#define CYTHON_WITHOUT_ASSERTIONS
#endif

#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) && !defined(_MSC_VER))
#   define CYTHON_UNUSED __attribute__ ((__unused__))
# else
#   define CYTHON_UNUSED
# endif
#endif
typedef struct {PyObject **p; char *s; const Py_ssize_t n; const char* encoding;
                const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry; /*proto*/

#define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0
#define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT 0
#define __PYX_DEFAULT_STRING_ENCODING ""
#define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString
#define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
#define __Pyx_fits_Py_ssize_t(v, type, is_signed)  (    \
    (sizeof(type) < sizeof(Py_ssize_t))  ||             \
    (sizeof(type) > sizeof(Py_ssize_t) &&               \
          likely(v < (type)PY_SSIZE_T_MAX ||            \
                 v == (type)PY_SSIZE_T_MAX)  &&         \
          (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||       \
                                v == (type)PY_SSIZE_T_MIN)))  ||  \
    (sizeof(type) == sizeof(Py_ssize_t) &&              \
          (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||        \
                               v == (type)PY_SSIZE_T_MAX)))  )
static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject*);
static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length);
#define __Pyx_PyByteArray_FromString(s) PyByteArray_FromStringAndSize((const char*)s, strlen((const char*)s))
#define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l)
#define __Pyx_PyBytes_FromString        PyBytes_FromString
#define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize
static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*);
#if PY_MAJOR_VERSION < 3
    #define __Pyx_PyStr_FromString        __Pyx_PyBytes_FromString
    #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
#else
    #define __Pyx_PyStr_FromString        __Pyx_PyUnicode_FromString
    #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize
#endif
#define __Pyx_PyObject_AsSString(s)    ((signed char*) __Pyx_PyObject_AsString(s))
#define __Pyx_PyObject_AsUString(s)    ((unsigned char*) __Pyx_PyObject_AsString(s))
#define __Pyx_PyObject_FromUString(s)  __Pyx_PyObject_FromString((const char*)s)
#define __Pyx_PyBytes_FromUString(s)   __Pyx_PyBytes_FromString((const char*)s)
#define __Pyx_PyByteArray_FromUString(s)   __Pyx_PyByteArray_FromString((const char*)s)
#define __Pyx_PyStr_FromUString(s)     __Pyx_PyStr_FromString((const char*)s)
#define __Pyx_PyUnicode_FromUString(s) __Pyx_PyUnicode_FromString((const char*)s)
#if PY_MAJOR_VERSION < 3
static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u)
{
    const Py_UNICODE *u_end = u;
    while (*u_end++) ;
    return u_end - u - 1;
}
#else
#define __Pyx_Py_UNICODE_strlen Py_UNICODE_strlen
#endif
#define __Pyx_PyUnicode_FromUnicode(u)       PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u))
#define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode
#define __Pyx_PyUnicode_AsUnicode            PyUnicode_AsUnicode
#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);
#if CYTHON_COMPILING_IN_CPYTHON
#define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x))
#else
#define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x)
#endif
#define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x))
#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
static int __Pyx_sys_getdefaultencoding_not_ascii;
static int __Pyx_init_sys_getdefaultencoding_params(void) {
    PyObject* sys = NULL;
    PyObject* default_encoding = NULL;
    PyObject* ascii_chars_u = NULL;
    PyObject* ascii_chars_b = NULL;
    sys = PyImport_ImportModule("sys");
    if (sys == NULL) goto bad;
    default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL);
    if (default_encoding == NULL) goto bad;
    if (strcmp(PyBytes_AsString(default_encoding), "ascii") == 0) {
        __Pyx_sys_getdefaultencoding_not_ascii = 0;
    } else {
        const char* default_encoding_c = PyBytes_AS_STRING(default_encoding);
        char ascii_chars[128];
        int c;
        for (c = 0; c < 128; c++) {
            ascii_chars[c] = c;
        }
        __Pyx_sys_getdefaultencoding_not_ascii = 1;
        ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL);
        if (ascii_chars_u == NULL) goto bad;
        ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL);
        if (ascii_chars_b == NULL || strncmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) {
            PyErr_Format(
                PyExc_ValueError,
                "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.",
                default_encoding_c);
            goto bad;
        }
    }
    Py_XDECREF(sys);
    Py_XDECREF(default_encoding);
    Py_XDECREF(ascii_chars_u);
    Py_XDECREF(ascii_chars_b);
    return 0;
bad:
    Py_XDECREF(sys);
    Py_XDECREF(default_encoding);
    Py_XDECREF(ascii_chars_u);
    Py_XDECREF(ascii_chars_b);
    return -1;
}
#endif
#if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3
#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL)
#else
#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL)
#if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
static char* __PYX_DEFAULT_STRING_ENCODING;
static int __Pyx_init_sys_getdefaultencoding_params(void) {
    PyObject* sys = NULL;
    PyObject* default_encoding = NULL;
    char* default_encoding_c;
    sys = PyImport_ImportModule("sys");
    if (sys == NULL) goto bad;
    default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL);
    if (default_encoding == NULL) goto bad;
    default_encoding_c = PyBytes_AS_STRING(default_encoding);
    __PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c));
    strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c);
    Py_DECREF(sys);
    Py_DECREF(default_encoding);
    return 0;
bad:
    Py_XDECREF(sys);
    Py_XDECREF(default_encoding);
    return -1;
}
#endif
#endif


/* Test for GCC > 2.95 */
#if defined(__GNUC__)     && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95)))
  #define likely(x)   __builtin_expect(!!(x), 1)
  #define unlikely(x) __builtin_expect(!!(x), 0)
#else /* !__GNUC__ or GCC < 2.95 */
  #define likely(x)   (x)
  #define unlikely(x) (x)
#endif /* __GNUC__ */

static PyObject *__pyx_m;
static PyObject *__pyx_d;
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[] = {
  "algos.pyx",
  "skiplist.pyx",
  "generated.pyx",
  "join.pyx",
  "datetime.pxd",
  "numpy.pxd",
  "util.pxd",
  "stringsource",
  "type.pxd",
  "bool.pxd",
  "complex.pxd",
};
#define IS_UNSIGNED(type) (((type) -1) > 0)
struct __Pyx_StructField_;
#define __PYX_BUF_FLAGS_PACKED_STRUCT (1 << 0)
typedef struct {
  const char* name; /* for error messages only */
  struct __Pyx_StructField_* fields;
  size_t size;     /* sizeof(type) */
  size_t arraysize[8]; /* length of array in each dimension */
  int ndim;
  char typegroup; /* _R_eal, _C_omplex, Signed _I_nt, _U_nsigned int, _S_truct, _P_ointer, _O_bject, c_H_ar */
  char is_unsigned;
  int flags;
} __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;
typedef struct {
  __Pyx_StructField root;
  __Pyx_BufFmt_StackElem* head;
  size_t fmt_offset;
  size_t new_count, enc_count;
  size_t struct_alignment;
  int is_complex;
  char enc_type;
  char new_packmode;
  char enc_packmode;
  char is_valid_array;
} __Pyx_BufFmt_Context;

struct __pyx_memoryview_obj;
typedef struct {
  struct __pyx_memoryview_obj *memview;
  char *data;
  Py_ssize_t shape[8];
  Py_ssize_t strides[8];
  Py_ssize_t suboffsets[8];
} __Pyx_memviewslice;

#include <pythread.h>
#ifndef CYTHON_ATOMICS
    #define CYTHON_ATOMICS 1
#endif
#define __pyx_atomic_int_type int
#if CYTHON_ATOMICS && __GNUC__ >= 4 && (__GNUC_MINOR__ > 1 ||           \
                    (__GNUC_MINOR__ == 1 && __GNUC_PATCHLEVEL >= 2)) && \
                    !defined(__i386__)
    #define __pyx_atomic_incr_aligned(value, lock) __sync_fetch_and_add(value, 1)
    #define __pyx_atomic_decr_aligned(value, lock) __sync_fetch_and_sub(value, 1)
    #ifdef __PYX_DEBUG_ATOMICS
        #warning "Using GNU atomics"
    #endif
#elif CYTHON_ATOMICS && MSC_VER
    #include <Windows.h>
    #define __pyx_atomic_int_type LONG
    #define __pyx_atomic_incr_aligned(value, lock) InterlockedIncrement(value)
    #define __pyx_atomic_decr_aligned(value, lock) InterlockedDecrement(value)
    #ifdef __PYX_DEBUG_ATOMICS
        #warning "Using MSVC atomics"
    #endif
#elif CYTHON_ATOMICS && (defined(__ICC) || defined(__INTEL_COMPILER)) && 0
    #define __pyx_atomic_incr_aligned(value, lock) _InterlockedIncrement(value)
    #define __pyx_atomic_decr_aligned(value, lock) _InterlockedDecrement(value)
    #ifdef __PYX_DEBUG_ATOMICS
        #warning "Using Intel atomics"
    #endif
#else
    #undef CYTHON_ATOMICS
    #define CYTHON_ATOMICS 0
    #ifdef __PYX_DEBUG_ATOMICS
        #warning "Not using atomics"
    #endif
#endif
typedef volatile __pyx_atomic_int_type __pyx_atomic_int;
#if CYTHON_ATOMICS
    #define __pyx_add_acquisition_count(memview) \
             __pyx_atomic_incr_aligned(__pyx_get_slice_count_pointer(memview), memview->lock)
    #define __pyx_sub_acquisition_count(memview) \
            __pyx_atomic_decr_aligned(__pyx_get_slice_count_pointer(memview), memview->lock)
#else
    #define __pyx_add_acquisition_count(memview) \
            __pyx_add_acquisition_count_locked(__pyx_get_slice_count_pointer(memview), memview->lock)
    #define __pyx_sub_acquisition_count(memview) \
            __pyx_sub_acquisition_count_locked(__pyx_get_slice_count_pointer(memview), memview->lock)
#endif


/* "numpy.pxd":726
 * # 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":727
 * 
 * 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":728
 * 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":729
 * 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":733
 * #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":734
 * 
 * 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":735
 * 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":736
 * 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":740
 * #ctypedef npy_uint128    uint128_t
 * 
 * ctypedef npy_float16    float16_t             # <<<<<<<<<<<<<<
 * ctypedef npy_float32    float32_t
 * ctypedef npy_float64    float64_t
 */
typedef npy_float16 __pyx_t_5numpy_float16_t;

/* "numpy.pxd":741
 * 
 * ctypedef npy_float16    float16_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":742
 * ctypedef npy_float16    float16_t
 * 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":751
 * # 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":752
 * # 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":753
 * 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":755
 * 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":756
 * 
 * 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":757
 * 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":759
 * 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":760
 * 
 * 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":762
 * 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":763
 * 
 * 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":764
 * 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/generated.pyx":27
 * from khash cimport *
 * 
 * ctypedef unsigned char UChar             # <<<<<<<<<<<<<<
 * 
 * cimport util
 */
typedef unsigned char __pyx_t_6pandas_5algos_UChar;
#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

#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


/*--- Type declarations ---*/
struct __pyx_obj_6pandas_5algos_Node;
struct __pyx_obj_6pandas_5algos_IndexableSkiplist;
struct __pyx_array_obj;
struct __pyx_MemviewEnum_obj;
struct __pyx_memoryview_obj;
struct __pyx_memoryviewslice_obj;

/* "numpy.pxd":766
 * 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":767
 * 
 * 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":768
 * 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":770
 * 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_t_6pandas_5algos_pairs;

/* "pandas/algos.pyx":1383
 * # 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_5algos_skiplist_f)(PyObject *, int, int);

/* "pandas/algos.pyx":1511
 * # https://github.com/kwgoodman/bottleneck
 * 
 * cdef struct pairs:             # <<<<<<<<<<<<<<
 *     double value
 *     int death
 */
struct __pyx_t_6pandas_5algos_pairs {
  double value;
  int death;
};

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


/* "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_5algos_IndexableSkiplist {
  PyObject_HEAD
  struct __pyx_vtabstruct_6pandas_5algos_IndexableSkiplist *__pyx_vtab;
  Py_ssize_t size;
  Py_ssize_t maxlevels;
  struct __pyx_obj_6pandas_5algos_Node *head;
};


/* "View.MemoryView":99
 * 
 * @cname("__pyx_array")
 * cdef class array:             # <<<<<<<<<<<<<<
 * 
 *     cdef:
 */
struct __pyx_array_obj {
  PyObject_HEAD
  char *data;
  Py_ssize_t len;
  char *format;
  int ndim;
  Py_ssize_t *_shape;
  Py_ssize_t *_strides;
  Py_ssize_t itemsize;
  PyObject *mode;
  PyObject *_format;
  void (*callback_free_data)(void *);
  int free_data;
  int dtype_is_object;
};


/* "View.MemoryView":269
 * 
 * @cname('__pyx_MemviewEnum')
 * cdef class Enum(object):             # <<<<<<<<<<<<<<
 *     cdef object name
 *     def __init__(self, name):
 */
struct __pyx_MemviewEnum_obj {
  PyObject_HEAD
  PyObject *name;
};


/* "View.MemoryView":302
 * 
 * @cname('__pyx_memoryview')
 * cdef class memoryview(object):             # <<<<<<<<<<<<<<
 * 
 *     cdef object obj
 */
struct __pyx_memoryview_obj {
  PyObject_HEAD
  struct __pyx_vtabstruct_memoryview *__pyx_vtab;
  PyObject *obj;
  PyObject *_size;
  PyObject *_array_interface;
  PyThread_type_lock lock;
  __pyx_atomic_int acquisition_count[2];
  __pyx_atomic_int *acquisition_count_aligned_p;
  Py_buffer view;
  int flags;
  int dtype_is_object;
  __Pyx_TypeInfo *typeinfo;
};


/* "View.MemoryView":922
 * 
 * @cname('__pyx_memoryviewslice')
 * cdef class _memoryviewslice(memoryview):             # <<<<<<<<<<<<<<
 *     "Internal class for passing memoryview slices to Python"
 * 
 */
struct __pyx_memoryviewslice_obj {
  struct __pyx_memoryview_obj __pyx_base;
  __Pyx_memviewslice from_slice;
  PyObject *from_object;
  PyObject *(*to_object_func)(char *);
  int (*to_dtype_func)(char *, PyObject *);
};



/* "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_5algos_IndexableSkiplist {
  PyObject *(*get)(struct __pyx_obj_6pandas_5algos_IndexableSkiplist *, Py_ssize_t, int __pyx_skip_dispatch);
  PyObject *(*insert)(struct __pyx_obj_6pandas_5algos_IndexableSkiplist *, double, int __pyx_skip_dispatch);
  PyObject *(*remove)(struct __pyx_obj_6pandas_5algos_IndexableSkiplist *, double, int __pyx_skip_dispatch);
};
static struct __pyx_vtabstruct_6pandas_5algos_IndexableSkiplist *__pyx_vtabptr_6pandas_5algos_IndexableSkiplist;


/* "View.MemoryView":302
 * 
 * @cname('__pyx_memoryview')
 * cdef class memoryview(object):             # <<<<<<<<<<<<<<
 * 
 *     cdef object obj
 */

struct __pyx_vtabstruct_memoryview {
  char *(*get_item_pointer)(struct __pyx_memoryview_obj *, PyObject *);
  PyObject *(*is_slice)(struct __pyx_memoryview_obj *, PyObject *);
  PyObject *(*setitem_slice_assignment)(struct __pyx_memoryview_obj *, PyObject *, PyObject *);
  PyObject *(*setitem_slice_assign_scalar)(struct __pyx_memoryview_obj *, struct __pyx_memoryview_obj *, PyObject *);
  PyObject *(*setitem_indexed)(struct __pyx_memoryview_obj *, PyObject *, PyObject *);
  PyObject *(*convert_item_to_object)(struct __pyx_memoryview_obj *, char *);
  PyObject *(*assign_item_from_object)(struct __pyx_memoryview_obj *, char *, PyObject *);
};
static struct __pyx_vtabstruct_memoryview *__pyx_vtabptr_memoryview;


/* "View.MemoryView":922
 * 
 * @cname('__pyx_memoryviewslice')
 * cdef class _memoryviewslice(memoryview):             # <<<<<<<<<<<<<<
 *     "Internal class for passing memoryview slices to Python"
 * 
 */

struct __pyx_vtabstruct__memoryviewslice {
  struct __pyx_vtabstruct_memoryview __pyx_base;
};
static struct __pyx_vtabstruct__memoryviewslice *__pyx_vtabptr__memoryviewslice;
#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;
#ifdef WITH_THREAD
  #define __Pyx_RefNannySetupContext(name, acquire_gil) \
          if (acquire_gil) { \
              PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); \
              __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__); \
              PyGILState_Release(__pyx_gilstate_save); \
          } else { \
              __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__); \
          }
#else
  #define __Pyx_RefNannySetupContext(name, acquire_gil) \
          __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__)
#endif
  #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, acquire_gil)
  #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 */
#define __Pyx_XDECREF_SET(r, v) do {                            \
        PyObject *tmp = (PyObject *) r;                         \
        r = v; __Pyx_XDECREF(tmp);                              \
    } while (0)
#define __Pyx_DECREF_SET(r, v) do {                             \
        PyObject *tmp = (PyObject *) r;                         \
        r = v; __Pyx_DECREF(tmp);                               \
    } while (0)
#define __Pyx_CLEAR(r)    do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0)
#define __Pyx_XCLEAR(r)   do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0)

#if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) {
    PyTypeObject* tp = Py_TYPE(obj);
    if (likely(tp->tp_getattro))
        return tp->tp_getattro(obj, attr_name);
#if PY_MAJOR_VERSION < 3
    if (likely(tp->tp_getattr))
        return tp->tp_getattr(obj, PyString_AS_STRING(attr_name));
#endif
    return PyObject_GetAttr(obj, attr_name);
}
#else
#define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n)
#endif

static PyObject *__Pyx_GetBuiltinName(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*/

#ifndef __PYX_FORCE_INIT_THREADS
  #define __PYX_FORCE_INIT_THREADS 0
#endif

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 void __Pyx_WriteUnraisable(const char *name, int clineno,
                                  int lineno, const char *filename,
                                  int full_traceback); /*proto*/

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

static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name); /*proto*/

#if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw); /*proto*/
#else
#define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw)
#endif

#define __Pyx_GetItemInt(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck) \
    (__Pyx_fits_Py_ssize_t(i, type, is_signed) ? \
    __Pyx_GetItemInt_Fast(o, (Py_ssize_t)i, is_list, wraparound, boundscheck) : \
    (is_list ? (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL) : \
               __Pyx_GetItemInt_Generic(o, to_py_func(i))))
#define __Pyx_GetItemInt_List(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck) \
    (__Pyx_fits_Py_ssize_t(i, type, is_signed) ? \
    __Pyx_GetItemInt_List_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) : \
    (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL))
static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i,
                                                              int wraparound, int boundscheck);
#define __Pyx_GetItemInt_Tuple(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck) \
    (__Pyx_fits_Py_ssize_t(i, type, is_signed) ? \
    __Pyx_GetItemInt_Tuple_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) : \
    (PyErr_SetString(PyExc_IndexError, "tuple index out of range"), (PyObject*)NULL))
static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i,
                                                              int wraparound, int boundscheck);
static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j);
static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i,
                                                     int is_list, int wraparound, int boundscheck);

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

#define __Pyx_SetItemInt(o, i, v, type, is_signed, to_py_func, is_list, wraparound, boundscheck) \
    (__Pyx_fits_Py_ssize_t(i, type, is_signed) ? \
    __Pyx_SetItemInt_Fast(o, (Py_ssize_t)i, v, is_list, wraparound, boundscheck) : \
    (is_list ? (PyErr_SetString(PyExc_IndexError, "list assignment index out of range"), -1) : \
               __Pyx_SetItemInt_Generic(o, to_py_func(i), v)))
static CYTHON_INLINE int __Pyx_SetItemInt_Generic(PyObject *o, PyObject *j, PyObject *v);
static CYTHON_INLINE int __Pyx_SetItemInt_Fast(PyObject *o, Py_ssize_t i, PyObject *v,
                                               int is_list, int wraparound, int boundscheck);

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

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 CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected);

static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index);

static CYTHON_INLINE int __Pyx_IterFinish(void); /*proto*/

static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected); /*proto*/

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

static void __Pyx_RaiseBufferIndexError(int axis); /*proto*/

#define __Pyx_BufPtrStrided2d(type, buf, i0, s0, i1, s1) (type)((char*)buf + i0 * s0 + i1 * s1)
#define __Pyx_BufPtrStrided1d(type, buf, i0, s0) (type)((char*)buf + i0 * s0)
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 int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb); /*proto*/

static CYTHON_INLINE int __Pyx_PySequence_Contains(PyObject* item, PyObject* seq, int eq) {
    int result = PySequence_Contains(seq, item);
    return unlikely(result < 0) ? result : (result == (eq == Py_EQ));
}

#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

#if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE int __Pyx_PyList_Append(PyObject* list, PyObject* x) {
    PyListObject* L = (PyListObject*) list;
    Py_ssize_t len = Py_SIZE(list);
    if (likely(L->allocated > len) & likely(len > (L->allocated >> 1))) {
        Py_INCREF(x);
        PyList_SET_ITEM(list, len, x);
        Py_SIZE(list) = len+1;
        return 0;
    }
    return PyList_Append(list, x);
}
#else
#define __Pyx_PyList_Append(L,x) PyList_Append(L,x)
#endif

static CYTHON_INLINE void __Pyx_RaiseUnboundLocalError(const char *varname);

#define __Pyx_BUF_MAX_NDIMS %(BUF_MAX_NDIMS)d
#define __Pyx_MEMVIEW_DIRECT   1
#define __Pyx_MEMVIEW_PTR      2
#define __Pyx_MEMVIEW_FULL     4
#define __Pyx_MEMVIEW_CONTIG   8
#define __Pyx_MEMVIEW_STRIDED  16
#define __Pyx_MEMVIEW_FOLLOW   32
#define __Pyx_IS_C_CONTIG 1
#define __Pyx_IS_F_CONTIG 2
static int __Pyx_init_memviewslice(
                struct __pyx_memoryview_obj *memview,
                int ndim,
                __Pyx_memviewslice *memviewslice,
                int memview_is_new_reference);
static CYTHON_INLINE int __pyx_add_acquisition_count_locked(
    __pyx_atomic_int *acquisition_count, PyThread_type_lock lock);
static CYTHON_INLINE int __pyx_sub_acquisition_count_locked(
    __pyx_atomic_int *acquisition_count, PyThread_type_lock lock);
#define __pyx_get_slice_count_pointer(memview) (memview->acquisition_count_aligned_p)
#define __pyx_get_slice_count(memview) (*__pyx_get_slice_count_pointer(memview))
#define __PYX_INC_MEMVIEW(slice, have_gil) __Pyx_INC_MEMVIEW(slice, have_gil, __LINE__)
#define __PYX_XDEC_MEMVIEW(slice, have_gil) __Pyx_XDEC_MEMVIEW(slice, have_gil, __LINE__)
static CYTHON_INLINE void __Pyx_INC_MEMVIEW(__Pyx_memviewslice *, int, int);
static CYTHON_INLINE void __Pyx_XDEC_MEMVIEW(__Pyx_memviewslice *, int, int);

static CYTHON_INLINE Py_ssize_t __Pyx_mod_Py_ssize_t(Py_ssize_t, Py_ssize_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_div_long(long, long); /* proto */

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

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

static CYTHON_INLINE PyObject* __Pyx_PyObject_GetSlice(
        PyObject* obj, Py_ssize_t cstart, Py_ssize_t cstop,
        PyObject** py_start, PyObject** py_stop, PyObject** py_slice,
        int has_cstart, int has_cstop, int wraparound);

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

static CYTHON_INLINE int __Pyx_PyDict_Contains(PyObject* item, PyObject* dict, int eq) {
    int result = PyDict_Contains(dict, item);
    return unlikely(result < 0) ? result : (result == (eq == Py_EQ));
}

#define __Pyx_PyObject_DelSlice(obj, cstart, cstop, py_start, py_stop, py_slice, has_cstart, has_cstop, wraparound) \
    __Pyx_PyObject_SetSlice(obj, (PyObject*)NULL, cstart, cstop, py_start, py_stop, py_slice, has_cstart, has_cstop, wraparound)
static CYTHON_INLINE int __Pyx_PyObject_SetSlice(
        PyObject* obj, PyObject* value, Py_ssize_t cstart, Py_ssize_t cstop,
        PyObject** py_start, PyObject** py_stop, PyObject** py_slice,
        int has_cstart, int has_cstop, int wraparound);

static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name); /*proto*/

static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void);

#define UNARY_NEG_WOULD_OVERFLOW(x)            (((x) < 0) & ((unsigned long)(x) == 0-(unsigned long)(x)))

static CYTHON_UNUSED int __pyx_array_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/
static PyObject *get_memview(PyObject *__pyx_v_self); /*proto*/
static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *, PyObject *); /*proto*/

static CYTHON_INLINE PyObject* __Pyx_decode_c_string(
         const char* cstring, Py_ssize_t start, Py_ssize_t stop,
         const char* encoding, const char* errors,
         PyObject* (*decode_func)(const char *s, Py_ssize_t size, const char *errors));

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

static CYTHON_UNUSED int __pyx_memoryview_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/
static PyObject *__pyx_memoryview_transpose(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_memoryview__get__base(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_memoryview_get_shape(PyObject *__pyx_v_self); /*proto*/
#if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE int __Pyx_ListComp_Append(PyObject* list, PyObject* x) {
    PyListObject* L = (PyListObject*) list;
    Py_ssize_t len = Py_SIZE(list);
    if (likely(L->allocated > len)) {
        Py_INCREF(x);
        PyList_SET_ITEM(list, len, x);
        Py_SIZE(list) = len+1;
        return 0;
    }
    return PyList_Append(list, x);
}
#else
#define __Pyx_ListComp_Append(L,x) PyList_Append(L,x)
#endif

static PyObject *__pyx_memoryview_get_strides(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_memoryview_get_suboffsets(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_memoryview_get_ndim(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_memoryview_get_itemsize(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_memoryview_get_nbytes(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_memoryview_get_size(PyObject *__pyx_v_self); /*proto*/
static CYTHON_INLINE int __Pyx_PyList_Extend(PyObject* L, PyObject* v) {
#if CYTHON_COMPILING_IN_CPYTHON
    PyObject* none = _PyList_Extend((PyListObject*)L, v);
    if (unlikely(!none))
        return -1;
    Py_DECREF(none);
    return 0;
#else
    return PyList_SetSlice(L, PY_SSIZE_T_MAX, PY_SSIZE_T_MAX, v);
#endif
}

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

static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type);

#define __Pyx_CyFunction_USED 1
#include <structmember.h>
#define __Pyx_CYFUNCTION_STATICMETHOD  0x01
#define __Pyx_CYFUNCTION_CLASSMETHOD   0x02
#define __Pyx_CYFUNCTION_CCLASS        0x04
#define __Pyx_CyFunction_GetClosure(f) \
    (((__pyx_CyFunctionObject *) (f))->func_closure)
#define __Pyx_CyFunction_GetClassObj(f) \
    (((__pyx_CyFunctionObject *) (f))->func_classobj)
#define __Pyx_CyFunction_Defaults(type, f) \
    ((type *)(((__pyx_CyFunctionObject *) (f))->defaults))
#define __Pyx_CyFunction_SetDefaultsGetter(f, g) \
    ((__pyx_CyFunctionObject *) (f))->defaults_getter = (g)
typedef struct {
    PyCFunctionObject func;
    PyObject *func_dict;
    PyObject *func_weakreflist;
    PyObject *func_name;
    PyObject *func_qualname;
    PyObject *func_doc;
    PyObject *func_globals;
    PyObject *func_code;
    PyObject *func_closure;
    PyObject *func_classobj; /* No-args super() class cell */
    void *defaults;
    int defaults_pyobjects;
    int flags;
    PyObject *defaults_tuple;   /* Const defaults tuple */
    PyObject *defaults_kwdict;  /* Const kwonly defaults dict */
    PyObject *(*defaults_getter)(PyObject *);
    PyObject *func_annotations; /* function annotations dict */
} __pyx_CyFunctionObject;
static PyTypeObject *__pyx_CyFunctionType = 0;
#define __Pyx_CyFunction_NewEx(ml, flags, qualname, self, module, globals, code) \
    __Pyx_CyFunction_New(__pyx_CyFunctionType, ml, flags, qualname, self, module, globals, code)
static PyObject *__Pyx_CyFunction_New(PyTypeObject *, PyMethodDef *ml,
                                      int flags, PyObject* qualname,
                                      PyObject *self,
                                      PyObject *module, PyObject *globals,
                                      PyObject* code);
static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *m,
                                                         size_t size,
                                                         int pyobjects);
static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *m,
                                                            PyObject *tuple);
static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *m,
                                                             PyObject *dict);
static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *m,
                                                              PyObject *dict);
static int __Pyx_CyFunction_init(void);

static PyObject *__Pyx_CalculateMetaclass(PyTypeObject *metaclass, PyObject *bases);

static PyObject *__Pyx_Py3MetaclassPrepare(PyObject *metaclass, PyObject *bases, PyObject *name, PyObject *qualname,
                                           PyObject *mkw, PyObject *modname, PyObject *doc); /*proto*/
static PyObject *__Pyx_Py3ClassCreate(PyObject *metaclass, PyObject *name, PyObject *bases, PyObject *dict,
                                      PyObject *mkw, int calculate_metaclass, int allow_py2_metaclass); /*proto*/

typedef struct {
    __pyx_CyFunctionObject func;
    PyObject *__signatures__;
    PyObject *type;
    PyObject *self;
} __pyx_FusedFunctionObject;
#define __pyx_FusedFunction_NewEx(ml, flags, qualname, self, module, globals, code)         \
        __pyx_FusedFunction_New(__pyx_FusedFunctionType, ml, flags, qualname, self, module, globals, code)
static PyObject *__pyx_FusedFunction_New(PyTypeObject *type,
                                         PyMethodDef *ml, int flags,
                                         PyObject *qualname, PyObject *self,
                                         PyObject *module, PyObject *globals,
                                         PyObject *code);
static int __pyx_FusedFunction_clear(__pyx_FusedFunctionObject *self);
static PyTypeObject *__pyx_FusedFunctionType = NULL;
static int __pyx_FusedFunction_init(void);
#define __Pyx_FusedFunction_USED

static int __pyx_typeinfo_cmp(__Pyx_TypeInfo *a, __Pyx_TypeInfo *b);

static int __Pyx_ValidateAndInit_memviewslice(
                int *axes_specs,
                int c_or_f_flag,
                int buf_flags,
                int ndim,
                __Pyx_TypeInfo *dtype,
                __Pyx_BufFmt_StackElem stack[],
                __Pyx_memviewslice *memviewslice,
                PyObject *original_obj);

static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int8_t(PyObject *);

static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int16_t(PyObject *);

static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int32_t(PyObject *);

static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int64_t(PyObject *);

static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_uint8_t(PyObject *);

static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_uint16_t(PyObject *);

static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_uint32_t(PyObject *);

static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_uint64_t(PyObject *);

static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float32_t(PyObject *);

static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float64_t(PyObject *);

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

typedef struct {
  Py_ssize_t shape, strides, suboffsets;
} __Pyx_Buf_DimInfo;
typedef struct {
  size_t refcount;
  Py_buffer pybuffer;
} __Pyx_Buffer;
typedef struct {
  __Pyx_Buffer *rcbuffer;
  char *data;
  __Pyx_Buf_DimInfo diminfo[8];
} __Pyx_LocalBuf_ND;

#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


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

static CYTHON_INLINE npy_int8 __Pyx_PyInt_As_npy_int8(PyObject *);

static CYTHON_INLINE npy_int16 __Pyx_PyInt_As_npy_int16(PyObject *);

static CYTHON_INLINE npy_int32 __Pyx_PyInt_As_npy_int32(PyObject *);

static CYTHON_INLINE npy_int64 __Pyx_PyInt_As_npy_int64(PyObject *);

static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value);

static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *);

static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_uint8_t(PyObject *);

static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_dsds_object(PyObject *);

static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_int8_t(PyObject *);

static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_int32_t(PyObject *);

static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_int64_t(PyObject *);

static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_float64_t(PyObject *);

static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_int16_t(PyObject *);

static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_float32_t(PyObject *);

static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value);

static CYTHON_INLINE char __Pyx_PyInt_As_char(PyObject *);

static CYTHON_INLINE PyObject* __Pyx_PyInt_From_char(char value);

static CYTHON_INLINE PyObject* __Pyx_PyInt_From_npy_int8(npy_int8 value);

static PyObject *__pyx_memview_get_nn___pyx_t_5numpy_int8_t(const char *itemp); /* proto */
static int __pyx_memview_set_nn___pyx_t_5numpy_int8_t(const char *itemp, PyObject *obj); /* proto */

static CYTHON_INLINE PyObject* __Pyx_PyInt_From_npy_int16(npy_int16 value);

static PyObject *__pyx_memview_get_nn___pyx_t_5numpy_int16_t(const char *itemp); /* proto */
static int __pyx_memview_set_nn___pyx_t_5numpy_int16_t(const char *itemp, PyObject *obj); /* proto */

static CYTHON_INLINE PyObject* __Pyx_PyInt_From_npy_int32(npy_int32 value);

static PyObject *__pyx_memview_get_nn___pyx_t_5numpy_int32_t(const char *itemp); /* proto */
static int __pyx_memview_set_nn___pyx_t_5numpy_int32_t(const char *itemp, PyObject *obj); /* proto */

static CYTHON_INLINE PyObject* __Pyx_PyInt_From_npy_int64(npy_int64 value);

static PyObject *__pyx_memview_get_nn___pyx_t_5numpy_int64_t(const char *itemp); /* proto */
static int __pyx_memview_set_nn___pyx_t_5numpy_int64_t(const char *itemp, PyObject *obj); /* proto */

static CYTHON_INLINE PyObject* __Pyx_PyInt_From_npy_uint8(npy_uint8 value);

static CYTHON_INLINE npy_uint8 __Pyx_PyInt_As_npy_uint8(PyObject *);

static PyObject *__pyx_memview_get_nn___pyx_t_5numpy_uint8_t(const char *itemp); /* proto */
static int __pyx_memview_set_nn___pyx_t_5numpy_uint8_t(const char *itemp, PyObject *obj); /* proto */

static CYTHON_INLINE PyObject* __Pyx_PyInt_From_npy_uint16(npy_uint16 value);

static CYTHON_INLINE npy_uint16 __Pyx_PyInt_As_npy_uint16(PyObject *);

static PyObject *__pyx_memview_get_nn___pyx_t_5numpy_uint16_t(const char *itemp); /* proto */
static int __pyx_memview_set_nn___pyx_t_5numpy_uint16_t(const char *itemp, PyObject *obj); /* proto */

static CYTHON_INLINE PyObject* __Pyx_PyInt_From_npy_uint32(npy_uint32 value);

static CYTHON_INLINE npy_uint32 __Pyx_PyInt_As_npy_uint32(PyObject *);

static PyObject *__pyx_memview_get_nn___pyx_t_5numpy_uint32_t(const char *itemp); /* proto */
static int __pyx_memview_set_nn___pyx_t_5numpy_uint32_t(const char *itemp, PyObject *obj); /* proto */

static CYTHON_INLINE PyObject* __Pyx_PyInt_From_npy_uint64(npy_uint64 value);

static CYTHON_INLINE npy_uint64 __Pyx_PyInt_As_npy_uint64(PyObject *);

static PyObject *__pyx_memview_get_nn___pyx_t_5numpy_uint64_t(const char *itemp); /* proto */
static int __pyx_memview_set_nn___pyx_t_5numpy_uint64_t(const char *itemp, PyObject *obj); /* proto */

static PyObject *__pyx_memview_get_nn___pyx_t_5numpy_float32_t(const char *itemp); /* proto */
static int __pyx_memview_set_nn___pyx_t_5numpy_float32_t(const char *itemp, PyObject *obj); /* proto */

static PyObject *__pyx_memview_get_nn___pyx_t_5numpy_float64_t(const char *itemp); /* proto */
static int __pyx_memview_set_nn___pyx_t_5numpy_float64_t(const char *itemp, PyObject *obj); /* proto */

static __Pyx_memviewslice
__pyx_memoryview_copy_new_contig(const __Pyx_memviewslice *from_mvs,
                                 const char *mode, int ndim,
                                 size_t sizeof_dtype, int contig_flag,
                                 int dtype_is_object);

#define __pyx_memoryview_copy_slice_dc_nn___pyx_t_5numpy_int8_t_c(slice) \
        __pyx_memoryview_copy_new_contig(&slice, "c", 1,            \
                                         sizeof(__pyx_t_5numpy_int8_t), (PyBUF_C_CONTIGUOUS | PyBUF_FORMAT | PyBUF_WRITABLE), \
                                         0)

#define __pyx_memoryview_copy_slice_dc_nn___pyx_t_5numpy_int16_t_c(slice) \
        __pyx_memoryview_copy_new_contig(&slice, "c", 1,            \
                                         sizeof(__pyx_t_5numpy_int16_t), (PyBUF_C_CONTIGUOUS | PyBUF_FORMAT | PyBUF_WRITABLE), \
                                         0)

#define __pyx_memoryview_copy_slice_dc_nn___pyx_t_5numpy_int32_t_c(slice) \
        __pyx_memoryview_copy_new_contig(&slice, "c", 1,            \
                                         sizeof(__pyx_t_5numpy_int32_t), (PyBUF_C_CONTIGUOUS | PyBUF_FORMAT | PyBUF_WRITABLE), \
                                         0)

#define __pyx_memoryview_copy_slice_dc_nn___pyx_t_5numpy_int64_t_c(slice) \
        __pyx_memoryview_copy_new_contig(&slice, "c", 1,            \
                                         sizeof(__pyx_t_5numpy_int64_t), (PyBUF_C_CONTIGUOUS | PyBUF_FORMAT | PyBUF_WRITABLE), \
                                         0)

#define __pyx_memoryview_copy_slice_dc_nn___pyx_t_5numpy_uint8_t_c(slice) \
        __pyx_memoryview_copy_new_contig(&slice, "c", 1,            \
                                         sizeof(__pyx_t_5numpy_uint8_t), (PyBUF_C_CONTIGUOUS | PyBUF_FORMAT | PyBUF_WRITABLE), \
                                         0)

#define __pyx_memoryview_copy_slice_dc_nn___pyx_t_5numpy_uint16_t_c(slice) \
        __pyx_memoryview_copy_new_contig(&slice, "c", 1,            \
                                         sizeof(__pyx_t_5numpy_uint16_t), (PyBUF_C_CONTIGUOUS | PyBUF_FORMAT | PyBUF_WRITABLE), \
                                         0)

#define __pyx_memoryview_copy_slice_dc_nn___pyx_t_5numpy_uint32_t_c(slice) \
        __pyx_memoryview_copy_new_contig(&slice, "c", 1,            \
                                         sizeof(__pyx_t_5numpy_uint32_t), (PyBUF_C_CONTIGUOUS | PyBUF_FORMAT | PyBUF_WRITABLE), \
                                         0)

#define __pyx_memoryview_copy_slice_dc_nn___pyx_t_5numpy_uint64_t_c(slice) \
        __pyx_memoryview_copy_new_contig(&slice, "c", 1,            \
                                         sizeof(__pyx_t_5numpy_uint64_t), (PyBUF_C_CONTIGUOUS | PyBUF_FORMAT | PyBUF_WRITABLE), \
                                         0)

#define __pyx_memoryview_copy_slice_dc_nn___pyx_t_5numpy_float32_t_c(slice) \
        __pyx_memoryview_copy_new_contig(&slice, "c", 1,            \
                                         sizeof(__pyx_t_5numpy_float32_t), (PyBUF_C_CONTIGUOUS | PyBUF_FORMAT | PyBUF_WRITABLE), \
                                         0)

#define __pyx_memoryview_copy_slice_dc_nn___pyx_t_5numpy_float64_t_c(slice) \
        __pyx_memoryview_copy_new_contig(&slice, "c", 1,            \
                                         sizeof(__pyx_t_5numpy_float64_t), (PyBUF_C_CONTIGUOUS | PyBUF_FORMAT | PyBUF_WRITABLE), \
                                         0)

static PyObject *__pyx_memview_get_object(const char *itemp); /* proto */
static int __pyx_memview_set_object(const char *itemp, PyObject *obj); /* proto */

static CYTHON_INLINE PyObject* __Pyx_PyInt_From_Py_intptr_t(Py_intptr_t value);

#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(__clang__)) && 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

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 __pyx_t_double_complex __pyx_t_double_complex_from_parts(double, double);

#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 PyObject* __Pyx_PyInt_From_ptrdiff_t(ptrdiff_t value);

static int __pyx_memviewslice_is_contig(const __Pyx_memviewslice *mvs,
                                        char order, int ndim);

static int __pyx_slices_overlap(__Pyx_memviewslice *slice1,
                                __Pyx_memviewslice *slice2,
                                int ndim, size_t itemsize);

static CYTHON_INLINE PyObject *__pyx_capsule_create(void *p, const char *sig);

static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *);

static int __Pyx_check_binary_version(void);

#if !defined(__Pyx_PyIdentifier_FromString)
#if PY_MAJOR_VERSION < 3
  #define __Pyx_PyIdentifier_FromString(s) PyString_FromString(s)
#else
  #define __Pyx_PyIdentifier_FromString(s) PyUnicode_FromString(s)
#endif
#endif

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

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

typedef struct {
    int code_line;
    PyCodeObject* code_object;
} __Pyx_CodeObjectCacheEntry;
struct __Pyx_CodeObjectCache {
    int count;
    int max_count;
    __Pyx_CodeObjectCacheEntry* entries;
};
static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL};
static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line);
static PyCodeObject *__pyx_find_code_object(int code_line);
static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object);

static void __Pyx_AddTraceback(const char *funcname, int c_line,
                               int py_line, const char *filename); /*proto*/

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


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

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

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

/* 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 char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *, char *, char *, int *); /*proto*/

/* Module declarations from 'cython.view' */
static struct __pyx_array_obj *__pyx_array_new(PyObject *, Py_ssize_t, char *, char *, char *); /*proto*/

/* 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 '__builtin__' */

/* Module declarations from 'cpython.type' */
static PyTypeObject *__pyx_ptype_7cpython_4type_type = 0;

/* 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 'util' */
static CYTHON_INLINE PyObject *__pyx_f_4util_get_value_at(PyArrayObject *, PyObject *); /*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 '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;
static CYTHON_INLINE int __pyx_f_8datetime__cstring_to_dts(char *, int, pandas_datetimestruct *); /*proto*/
static CYTHON_INLINE PyObject *__pyx_f_8datetime__dts_to_pydatetime(pandas_datetimestruct *); /*proto*/

/* Module declarations from 'khash' */

/* Module declarations from 'pandas.algos' */
static PyTypeObject *__pyx_ptype_6pandas_5algos_Node = 0;
static PyTypeObject *__pyx_ptype_6pandas_5algos_IndexableSkiplist = 0;
static PyTypeObject *__pyx_array_type = 0;
static PyTypeObject *__pyx_MemviewEnum_type = 0;
static PyTypeObject *__pyx_memoryview_type = 0;
static PyTypeObject *__pyx_memoryviewslice_type = 0;
static __pyx_t_5numpy_float64_t __pyx_v_6pandas_5algos_FP_ERR;
static __pyx_t_5numpy_float64_t __pyx_v_6pandas_5algos_REL_TOL;
static __pyx_t_5numpy_int8_t __pyx_v_6pandas_5algos_MINint8;
static __pyx_t_5numpy_int16_t __pyx_v_6pandas_5algos_MINint16;
static __pyx_t_5numpy_int32_t __pyx_v_6pandas_5algos_MINint32;
static __pyx_t_5numpy_int64_t __pyx_v_6pandas_5algos_MINint64;
static __pyx_t_5numpy_float16_t __pyx_v_6pandas_5algos_MINfloat16;
static __pyx_t_5numpy_float32_t __pyx_v_6pandas_5algos_MINfloat32;
static __pyx_t_5numpy_float64_t __pyx_v_6pandas_5algos_MINfloat64;
static __pyx_t_5numpy_int8_t __pyx_v_6pandas_5algos_MAXint8;
static __pyx_t_5numpy_int16_t __pyx_v_6pandas_5algos_MAXint16;
static __pyx_t_5numpy_int32_t __pyx_v_6pandas_5algos_MAXint32;
static __pyx_t_5numpy_int64_t __pyx_v_6pandas_5algos_MAXint64;
static __pyx_t_5numpy_float16_t __pyx_v_6pandas_5algos_MAXfloat16;
static __pyx_t_5numpy_float32_t __pyx_v_6pandas_5algos_MAXfloat32;
static __pyx_t_5numpy_float64_t __pyx_v_6pandas_5algos_MAXfloat64;
static double __pyx_v_6pandas_5algos_NaN;
static double __pyx_v_6pandas_5algos_nan;
static int __pyx_v_6pandas_5algos_TIEBREAK_AVERAGE;
static int __pyx_v_6pandas_5algos_TIEBREAK_MIN;
static int __pyx_v_6pandas_5algos_TIEBREAK_MAX;
static int __pyx_v_6pandas_5algos_TIEBREAK_FIRST;
static int __pyx_v_6pandas_5algos_TIEBREAK_FIRST_DESCENDING;
static int __pyx_v_6pandas_5algos_TIEBREAK_DENSE;
static __pyx_t_5numpy_int64_t __pyx_v_6pandas_5algos_iNaT;
static int __pyx_v_6pandas_5algos_PLATFORM_INT;
static PyObject *generic = 0;
static PyObject *strided = 0;
static PyObject *indirect = 0;
static PyObject *contiguous = 0;
static PyObject *indirect_contiguous = 0;
static CYTHON_INLINE int __pyx_f_6pandas_5algos_int_max(int, int); /*proto*/
static CYTHON_INLINE int __pyx_f_6pandas_5algos_int_min(int, int); /*proto*/
static double __pyx_f_6pandas_5algos_Log2(double); /*proto*/
static PyObject *__pyx_f_6pandas_5algos__take_2d_float64(PyArrayObject *, PyObject *); /*proto*/
static PyObject *__pyx_f_6pandas_5algos__take_2d_int64(PyArrayObject *, PyObject *); /*proto*/
static PyObject *__pyx_f_6pandas_5algos__take_2d_object(PyArrayObject *, PyObject *); /*proto*/
static CYTHON_INLINE int __pyx_f_6pandas_5algos_float64_are_diff(__pyx_t_5numpy_float64_t, __pyx_t_5numpy_float64_t); /*proto*/
static CYTHON_INLINE PyObject *__pyx_f_6pandas_5algos_are_diff(PyObject *, PyObject *); /*proto*/
static CYTHON_INLINE PyObject *__pyx_f_6pandas_5algos_kth_smallest_c(__pyx_t_5numpy_float64_t *, Py_ssize_t, Py_ssize_t); /*proto*/
static PyObject *__pyx_f_6pandas_5algos__roll_skiplist_op(PyArrayObject *, int, int, __pyx_t_6pandas_5algos_skiplist_f); /*proto*/
static __pyx_t_5numpy_double_t __pyx_f_6pandas_5algos__get_median(PyObject *, int, int); /*proto*/
static __pyx_t_5numpy_double_t __pyx_f_6pandas_5algos__get_max(PyObject *, int, int); /*proto*/
static __pyx_t_5numpy_double_t __pyx_f_6pandas_5algos__get_min(PyObject *, int, int); /*proto*/
static CYTHON_INLINE __pyx_t_5numpy_float64_t __pyx_f_6pandas_5algos__median_linear(__pyx_t_5numpy_float64_t *, int); /*proto*/
static PyObject *__pyx_f_6pandas_5algos_ensure_platform_int(PyObject *, int __pyx_skip_dispatch); /*proto*/
static PyObject *__pyx_f_6pandas_5algos_ensure_float64(PyObject *, int __pyx_skip_dispatch); /*proto*/
static PyObject *__pyx_f_6pandas_5algos_ensure_float32(PyObject *, int __pyx_skip_dispatch); /*proto*/
static PyObject *__pyx_f_6pandas_5algos_ensure_int8(PyObject *, int __pyx_skip_dispatch); /*proto*/
static PyObject *__pyx_f_6pandas_5algos_ensure_int16(PyObject *, int __pyx_skip_dispatch); /*proto*/
static PyObject *__pyx_f_6pandas_5algos_ensure_int32(PyObject *, int __pyx_skip_dispatch); /*proto*/
static PyObject *__pyx_f_6pandas_5algos_ensure_int64(PyObject *, int __pyx_skip_dispatch); /*proto*/
static PyObject *__pyx_f_6pandas_5algos_ensure_object(PyObject *, int __pyx_skip_dispatch); /*proto*/
static PyObject *__pyx_f_6pandas_5algos_map_indices_float64(PyArrayObject *, int __pyx_skip_dispatch); /*proto*/
static PyObject *__pyx_f_6pandas_5algos_map_indices_float32(PyArrayObject *, int __pyx_skip_dispatch); /*proto*/
static PyObject *__pyx_f_6pandas_5algos_map_indices_object(PyArrayObject *, int __pyx_skip_dispatch); /*proto*/
static PyObject *__pyx_f_6pandas_5algos_map_indices_int32(PyArrayObject *, int __pyx_skip_dispatch); /*proto*/
static PyObject *__pyx_f_6pandas_5algos_map_indices_int64(PyArrayObject *, int __pyx_skip_dispatch); /*proto*/
static PyObject *__pyx_f_6pandas_5algos_map_indices_bool(PyArrayObject *, int __pyx_skip_dispatch); /*proto*/
static CYTHON_INLINE Py_ssize_t __pyx_fuse_0__pyx_f_6pandas_5algos_swap(__pyx_t_5numpy_int8_t *, __pyx_t_5numpy_int8_t *); /*proto*/
static CYTHON_INLINE Py_ssize_t __pyx_fuse_1__pyx_f_6pandas_5algos_swap(__pyx_t_5numpy_int16_t *, __pyx_t_5numpy_int16_t *); /*proto*/
static CYTHON_INLINE Py_ssize_t __pyx_fuse_2__pyx_f_6pandas_5algos_swap(__pyx_t_5numpy_int32_t *, __pyx_t_5numpy_int32_t *); /*proto*/
static CYTHON_INLINE Py_ssize_t __pyx_fuse_3__pyx_f_6pandas_5algos_swap(__pyx_t_5numpy_int64_t *, __pyx_t_5numpy_int64_t *); /*proto*/
static CYTHON_INLINE Py_ssize_t __pyx_fuse_4__pyx_f_6pandas_5algos_swap(__pyx_t_5numpy_uint8_t *, __pyx_t_5numpy_uint8_t *); /*proto*/
static CYTHON_INLINE Py_ssize_t __pyx_fuse_5__pyx_f_6pandas_5algos_swap(__pyx_t_5numpy_uint16_t *, __pyx_t_5numpy_uint16_t *); /*proto*/
static CYTHON_INLINE Py_ssize_t __pyx_fuse_6__pyx_f_6pandas_5algos_swap(__pyx_t_5numpy_uint32_t *, __pyx_t_5numpy_uint32_t *); /*proto*/
static CYTHON_INLINE Py_ssize_t __pyx_fuse_7__pyx_f_6pandas_5algos_swap(__pyx_t_5numpy_uint64_t *, __pyx_t_5numpy_uint64_t *); /*proto*/
static CYTHON_INLINE Py_ssize_t __pyx_fuse_8__pyx_f_6pandas_5algos_swap(__pyx_t_5numpy_float32_t *, __pyx_t_5numpy_float32_t *); /*proto*/
static CYTHON_INLINE Py_ssize_t __pyx_fuse_9__pyx_f_6pandas_5algos_swap(__pyx_t_5numpy_float64_t *, __pyx_t_5numpy_float64_t *); /*proto*/
static __pyx_t_5numpy_int8_t __pyx_fuse_0__pyx_f_6pandas_5algos_kth_smallest(__Pyx_memviewslice, Py_ssize_t, int __pyx_skip_dispatch); /*proto*/
static __pyx_t_5numpy_int16_t __pyx_fuse_1__pyx_f_6pandas_5algos_kth_smallest(__Pyx_memviewslice, Py_ssize_t, int __pyx_skip_dispatch); /*proto*/
static __pyx_t_5numpy_int32_t __pyx_fuse_2__pyx_f_6pandas_5algos_kth_smallest(__Pyx_memviewslice, Py_ssize_t, int __pyx_skip_dispatch); /*proto*/
static __pyx_t_5numpy_int64_t __pyx_fuse_3__pyx_f_6pandas_5algos_kth_smallest(__Pyx_memviewslice, Py_ssize_t, int __pyx_skip_dispatch); /*proto*/
static __pyx_t_5numpy_uint8_t __pyx_fuse_4__pyx_f_6pandas_5algos_kth_smallest(__Pyx_memviewslice, Py_ssize_t, int __pyx_skip_dispatch); /*proto*/
static __pyx_t_5numpy_uint16_t __pyx_fuse_5__pyx_f_6pandas_5algos_kth_smallest(__Pyx_memviewslice, Py_ssize_t, int __pyx_skip_dispatch); /*proto*/
static __pyx_t_5numpy_uint32_t __pyx_fuse_6__pyx_f_6pandas_5algos_kth_smallest(__Pyx_memviewslice, Py_ssize_t, int __pyx_skip_dispatch); /*proto*/
static __pyx_t_5numpy_uint64_t __pyx_fuse_7__pyx_f_6pandas_5algos_kth_smallest(__Pyx_memviewslice, Py_ssize_t, int __pyx_skip_dispatch); /*proto*/
static __pyx_t_5numpy_float32_t __pyx_fuse_8__pyx_f_6pandas_5algos_kth_smallest(__Pyx_memviewslice, Py_ssize_t, int __pyx_skip_dispatch); /*proto*/
static __pyx_t_5numpy_float64_t __pyx_fuse_9__pyx_f_6pandas_5algos_kth_smallest(__Pyx_memviewslice, Py_ssize_t, int __pyx_skip_dispatch); /*proto*/
static __pyx_t_5numpy_int8_t __pyx_fuse_0__pyx_f_6pandas_5algos_median(__Pyx_memviewslice, int __pyx_skip_dispatch); /*proto*/
static __pyx_t_5numpy_int16_t __pyx_fuse_1__pyx_f_6pandas_5algos_median(__Pyx_memviewslice, int __pyx_skip_dispatch); /*proto*/
static __pyx_t_5numpy_int32_t __pyx_fuse_2__pyx_f_6pandas_5algos_median(__Pyx_memviewslice, int __pyx_skip_dispatch); /*proto*/
static __pyx_t_5numpy_int64_t __pyx_fuse_3__pyx_f_6pandas_5algos_median(__Pyx_memviewslice, int __pyx_skip_dispatch); /*proto*/
static __pyx_t_5numpy_uint8_t __pyx_fuse_4__pyx_f_6pandas_5algos_median(__Pyx_memviewslice, int __pyx_skip_dispatch); /*proto*/
static __pyx_t_5numpy_uint16_t __pyx_fuse_5__pyx_f_6pandas_5algos_median(__Pyx_memviewslice, int __pyx_skip_dispatch); /*proto*/
static __pyx_t_5numpy_uint32_t __pyx_fuse_6__pyx_f_6pandas_5algos_median(__Pyx_memviewslice, int __pyx_skip_dispatch); /*proto*/
static __pyx_t_5numpy_uint64_t __pyx_fuse_7__pyx_f_6pandas_5algos_median(__Pyx_memviewslice, int __pyx_skip_dispatch); /*proto*/
static __pyx_t_5numpy_float32_t __pyx_fuse_8__pyx_f_6pandas_5algos_median(__Pyx_memviewslice, int __pyx_skip_dispatch); /*proto*/
static __pyx_t_5numpy_float64_t __pyx_fuse_9__pyx_f_6pandas_5algos_median(__Pyx_memviewslice, int __pyx_skip_dispatch); /*proto*/
static struct __pyx_array_obj *__pyx_array_new(PyObject *, Py_ssize_t, char *, char *, char *); /*proto*/
static void *__pyx_align_pointer(void *, size_t); /*proto*/
static PyObject *__pyx_memoryview_new(PyObject *, int, int, __Pyx_TypeInfo *); /*proto*/
static CYTHON_INLINE int __pyx_memoryview_check(PyObject *); /*proto*/
static PyObject *_unellipsify(PyObject *, int); /*proto*/
static PyObject *assert_direct_dimensions(Py_ssize_t *, int); /*proto*/
static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_obj *, PyObject *); /*proto*/
static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *, Py_ssize_t, Py_ssize_t, Py_ssize_t, int, int, int *, Py_ssize_t, Py_ssize_t, Py_ssize_t, int, int, int, int); /*proto*/
static char *__pyx_pybuffer_index(Py_buffer *, char *, Py_ssize_t, Py_ssize_t); /*proto*/
static int __pyx_memslice_transpose(__Pyx_memviewslice *); /*proto*/
static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice, int, PyObject *(*)(char *), int (*)(char *, PyObject *), int); /*proto*/
static __Pyx_memviewslice *__pyx_memoryview_get_slice_from_memoryview(struct __pyx_memoryview_obj *, __Pyx_memviewslice *); /*proto*/
static void __pyx_memoryview_slice_copy(struct __pyx_memoryview_obj *, __Pyx_memviewslice *); /*proto*/
static PyObject *__pyx_memoryview_copy_object(struct __pyx_memoryview_obj *); /*proto*/
static PyObject *__pyx_memoryview_copy_object_from_slice(struct __pyx_memoryview_obj *, __Pyx_memviewslice *); /*proto*/
static Py_ssize_t abs_py_ssize_t(Py_ssize_t); /*proto*/
static char __pyx_get_best_slice_order(__Pyx_memviewslice *, int); /*proto*/
static void _copy_strided_to_strided(char *, Py_ssize_t *, char *, Py_ssize_t *, Py_ssize_t *, Py_ssize_t *, int, size_t); /*proto*/
static void copy_strided_to_strided(__Pyx_memviewslice *, __Pyx_memviewslice *, int, size_t); /*proto*/
static Py_ssize_t __pyx_memoryview_slice_get_size(__Pyx_memviewslice *, int); /*proto*/
static Py_ssize_t __pyx_fill_contig_strides_array(Py_ssize_t *, Py_ssize_t *, Py_ssize_t, int, char); /*proto*/
static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *, __Pyx_memviewslice *, char, int); /*proto*/
static int __pyx_memoryview_err_extents(int, Py_ssize_t, Py_ssize_t); /*proto*/
static int __pyx_memoryview_err_dim(PyObject *, char *, int); /*proto*/
static int __pyx_memoryview_err(PyObject *, char *); /*proto*/
static int __pyx_memoryview_copy_contents(__Pyx_memviewslice, __Pyx_memviewslice, int, int, int); /*proto*/
static void __pyx_memoryview_broadcast_leading(__Pyx_memviewslice *, int, int); /*proto*/
static void __pyx_memoryview_refcount_copying(__Pyx_memviewslice *, int, int, int); /*proto*/
static void __pyx_memoryview_refcount_objects_in_slice_with_gil(char *, Py_ssize_t *, Py_ssize_t *, int, int); /*proto*/
static void __pyx_memoryview_refcount_objects_in_slice(char *, Py_ssize_t *, Py_ssize_t *, int, int); /*proto*/
static void __pyx_memoryview_slice_assign_scalar(__Pyx_memviewslice *, int, size_t, void *, int); /*proto*/
static void __pyx_memoryview__slice_assign_scalar(char *, Py_ssize_t *, Py_ssize_t *, int, size_t, void *); /*proto*/
static __Pyx_TypeInfo __Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t = { "float64_t", NULL, sizeof(__pyx_t_5numpy_float64_t), { 0 }, 0, 'R', 0, 0 };
static __Pyx_TypeInfo __Pyx_TypeInfo_Py_ssize_t = { "Py_ssize_t", NULL, sizeof(Py_ssize_t), { 0 }, 0, IS_UNSIGNED(Py_ssize_t) ? 'U' : 'I', IS_UNSIGNED(Py_ssize_t), 0 };
static __Pyx_TypeInfo __Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t = { "int64_t", NULL, sizeof(__pyx_t_5numpy_int64_t), { 0 }, 0, IS_UNSIGNED(__pyx_t_5numpy_int64_t) ? 'U' : 'I', IS_UNSIGNED(__pyx_t_5numpy_int64_t), 0 };
static __Pyx_TypeInfo __Pyx_TypeInfo_object = { "Python object", NULL, sizeof(PyObject *), { 0 }, 0, 'O', 0, 0 };
static __Pyx_TypeInfo __Pyx_TypeInfo_nn___pyx_t_5numpy_double_t = { "double_t", NULL, sizeof(__pyx_t_5numpy_double_t), { 0 }, 0, 'R', 0, 0 };
static __Pyx_TypeInfo __Pyx_TypeInfo_nn___pyx_t_5numpy_uint8_t = { "uint8_t", NULL, sizeof(__pyx_t_5numpy_uint8_t), { 0 }, 0, IS_UNSIGNED(__pyx_t_5numpy_uint8_t) ? 'U' : 'I', IS_UNSIGNED(__pyx_t_5numpy_uint8_t), 0 };
static __Pyx_TypeInfo __Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t = { "float32_t", NULL, sizeof(__pyx_t_5numpy_float32_t), { 0 }, 0, 'R', 0, 0 };
static __Pyx_TypeInfo __Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t = { "int32_t", NULL, sizeof(__pyx_t_5numpy_int32_t), { 0 }, 0, IS_UNSIGNED(__pyx_t_5numpy_int32_t) ? 'U' : 'I', IS_UNSIGNED(__pyx_t_5numpy_int32_t), 0 };
static __Pyx_TypeInfo __Pyx_TypeInfo_nn___pyx_t_5numpy_int8_t = { "int8_t", NULL, sizeof(__pyx_t_5numpy_int8_t), { 0 }, 0, IS_UNSIGNED(__pyx_t_5numpy_int8_t) ? 'U' : 'I', IS_UNSIGNED(__pyx_t_5numpy_int8_t), 0 };
static __Pyx_TypeInfo __Pyx_TypeInfo_nn___pyx_t_5numpy_int16_t = { "int16_t", NULL, sizeof(__pyx_t_5numpy_int16_t), { 0 }, 0, IS_UNSIGNED(__pyx_t_5numpy_int16_t) ? 'U' : 'I', IS_UNSIGNED(__pyx_t_5numpy_int16_t), 0 };
static __Pyx_TypeInfo __Pyx_TypeInfo_nn___pyx_t_5numpy_uint16_t = { "uint16_t", NULL, sizeof(__pyx_t_5numpy_uint16_t), { 0 }, 0, IS_UNSIGNED(__pyx_t_5numpy_uint16_t) ? 'U' : 'I', IS_UNSIGNED(__pyx_t_5numpy_uint16_t), 0 };
static __Pyx_TypeInfo __Pyx_TypeInfo_nn___pyx_t_5numpy_uint32_t = { "uint32_t", NULL, sizeof(__pyx_t_5numpy_uint32_t), { 0 }, 0, IS_UNSIGNED(__pyx_t_5numpy_uint32_t) ? 'U' : 'I', IS_UNSIGNED(__pyx_t_5numpy_uint32_t), 0 };
static __Pyx_TypeInfo __Pyx_TypeInfo_nn___pyx_t_5numpy_uint64_t = { "uint64_t", NULL, sizeof(__pyx_t_5numpy_uint64_t), { 0 }, 0, IS_UNSIGNED(__pyx_t_5numpy_uint64_t) ? 'U' : 'I', IS_UNSIGNED(__pyx_t_5numpy_uint64_t), 0 };
#define __Pyx_MODULE_NAME "pandas.algos"
int __pyx_module_is_main_pandas__algos = 0;

/* Implementation of 'pandas.algos' */
static PyObject *__pyx_builtin_object;
static PyObject *__pyx_builtin_range;
static PyObject *__pyx_builtin_KeyError;
static PyObject *__pyx_builtin_TypeError;
static PyObject *__pyx_builtin_ValueError;
static PyObject *__pyx_builtin_ImportError;
static PyObject *__pyx_builtin_ord;
static PyObject *__pyx_builtin_zip;
static PyObject *__pyx_builtin_AssertionError;
static PyObject *__pyx_builtin_NotImplementedError;
static PyObject *__pyx_builtin_RuntimeError;
static PyObject *__pyx_builtin_IndexError;
static PyObject *__pyx_builtin_MemoryError;
static PyObject *__pyx_builtin_enumerate;
static PyObject *__pyx_builtin_Ellipsis;
static PyObject *__pyx_builtin_xrange;
static PyObject *__pyx_builtin_id;
static PyObject *__pyx_lambda_funcdef_6pandas_5algos_lambda1(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_other); /* proto */
static PyObject *__pyx_lambda_funcdef_6pandas_5algos_lambda2(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_other); /* proto */
static int __pyx_pf_6pandas_5algos_4Node___init__(struct __pyx_obj_6pandas_5algos_Node *__pyx_v_self, __pyx_t_5numpy_double_t __pyx_v_value, PyObject *__pyx_v_next, PyObject *__pyx_v_width); /* proto */
static PyObject *__pyx_pf_6pandas_5algos_4Node_5value___get__(struct __pyx_obj_6pandas_5algos_Node *__pyx_v_self); /* proto */
static int __pyx_pf_6pandas_5algos_4Node_5value_2__set__(struct __pyx_obj_6pandas_5algos_Node *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_6pandas_5algos_4Node_4next___get__(struct __pyx_obj_6pandas_5algos_Node *__pyx_v_self); /* proto */
static int __pyx_pf_6pandas_5algos_4Node_4next_2__set__(struct __pyx_obj_6pandas_5algos_Node *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static int __pyx_pf_6pandas_5algos_4Node_4next_4__del__(struct __pyx_obj_6pandas_5algos_Node *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6pandas_5algos_4Node_5width___get__(struct __pyx_obj_6pandas_5algos_Node *__pyx_v_self); /* proto */
static int __pyx_pf_6pandas_5algos_4Node_5width_2__set__(struct __pyx_obj_6pandas_5algos_Node *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static int __pyx_pf_6pandas_5algos_4Node_5width_4__del__(struct __pyx_obj_6pandas_5algos_Node *__pyx_v_self); /* proto */
static int __pyx_pf_6pandas_5algos_17IndexableSkiplist___init__(struct __pyx_obj_6pandas_5algos_IndexableSkiplist *__pyx_v_self, PyObject *__pyx_v_expected_size); /* proto */
static Py_ssize_t __pyx_pf_6pandas_5algos_17IndexableSkiplist_2__len__(struct __pyx_obj_6pandas_5algos_IndexableSkiplist *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6pandas_5algos_17IndexableSkiplist_4__getitem__(struct __pyx_obj_6pandas_5algos_IndexableSkiplist *__pyx_v_self, PyObject *__pyx_v_i); /* proto */
static PyObject *__pyx_pf_6pandas_5algos_17IndexableSkiplist_6get(struct __pyx_obj_6pandas_5algos_IndexableSkiplist *__pyx_v_self, Py_ssize_t __pyx_v_i); /* proto */
static PyObject *__pyx_pf_6pandas_5algos_17IndexableSkiplist_8insert(struct __pyx_obj_6pandas_5algos_IndexableSkiplist *__pyx_v_self, double __pyx_v_value); /* proto */
static PyObject *__pyx_pf_6pandas_5algos_17IndexableSkiplist_10remove(struct __pyx_obj_6pandas_5algos_IndexableSkiplist *__pyx_v_self, double __pyx_v_value); /* proto */
static PyObject *__pyx_pf_6pandas_5algos_rank_1d_float64(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_in_arr, PyObject *__pyx_v_ties_method, PyObject *__pyx_v_ascending, PyObject *__pyx_v_na_option, PyObject *__pyx_v_pct); /* proto */
static PyObject *__pyx_pf_6pandas_5algos_2rank_1d_int64(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_in_arr, PyObject *__pyx_v_ties_method, PyObject *__pyx_v_ascending, CYTHON_UNUSED PyObject *__pyx_v_na_option, PyObject *__pyx_v_pct); /* proto */
static PyObject *__pyx_pf_6pandas_5algos_4rank_2d_float64(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_in_arr, PyObject *__pyx_v_axis, PyObject *__pyx_v_ties_method, PyObject *__pyx_v_ascending, PyObject *__pyx_v_na_option, PyObject *__pyx_v_pct); /* proto */
static PyObject *__pyx_pf_6pandas_5algos_6rank_2d_int64(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_in_arr, PyObject *__pyx_v_axis, PyObject *__pyx_v_ties_method, PyObject *__pyx_v_ascending, CYTHON_UNUSED PyObject *__pyx_v_na_option, PyObject *__pyx_v_pct); /* proto */
static PyObject *__pyx_pf_6pandas_5algos_8rank_1d_generic(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_in_arr, int __pyx_v_retry, PyObject *__pyx_v_ties_method, PyObject *__pyx_v_ascending, PyObject *__pyx_v_na_option, PyObject *__pyx_v_pct); /* proto */
static PyObject *__pyx_pf_6pandas_5algos_10rank_2d_generic(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_in_arr, PyObject *__pyx_v_axis, PyObject *__pyx_v_ties_method, PyObject *__pyx_v_ascending, PyObject *__pyx_v_na_option, PyObject *__pyx_v_pct); /* proto */
static PyObject *__pyx_pf_6pandas_5algos_12_check_minp(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_win, PyObject *__pyx_v_minp, PyObject *__pyx_v_N); /* proto */
static PyObject *__pyx_pf_6pandas_5algos_14kth_smallest(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_signatures, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs, CYTHON_UNUSED PyObject *__pyx_v_defaults); /* proto */
static PyObject *__pyx_pf_6pandas_5algos_512__pyx_fuse_0kth_smallest(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_a, Py_ssize_t __pyx_v_k); /* proto */
static PyObject *__pyx_pf_6pandas_5algos_514__pyx_fuse_1kth_smallest(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_a, Py_ssize_t __pyx_v_k); /* proto */
static PyObject *__pyx_pf_6pandas_5algos_516__pyx_fuse_2kth_smallest(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_a, Py_ssize_t __pyx_v_k); /* proto */
static PyObject *__pyx_pf_6pandas_5algos_518__pyx_fuse_3kth_smallest(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_a, Py_ssize_t __pyx_v_k); /* proto */
static PyObject *__pyx_pf_6pandas_5algos_520__pyx_fuse_4kth_smallest(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_a, Py_ssize_t __pyx_v_k); /* proto */
static PyObject *__pyx_pf_6pandas_5algos_522__pyx_fuse_5kth_smallest(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_a, Py_ssize_t __pyx_v_k); /* proto */
static PyObject *__pyx_pf_6pandas_5algos_524__pyx_fuse_6kth_smallest(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_a, Py_ssize_t __pyx_v_k); /* proto */
static PyObject *__pyx_pf_6pandas_5algos_526__pyx_fuse_7kth_smallest(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_a, Py_ssize_t __pyx_v_k); /* proto */
static PyObject *__pyx_pf_6pandas_5algos_528__pyx_fuse_8kth_smallest(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_a, Py_ssize_t __pyx_v_k); /* proto */
static PyObject *__pyx_pf_6pandas_5algos_530__pyx_fuse_9kth_smallest(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_a, Py_ssize_t __pyx_v_k); /* proto */
static PyObject *__pyx_pf_6pandas_5algos_16median(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_signatures, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs, CYTHON_UNUSED PyObject *__pyx_v_defaults); /* proto */
static PyObject *__pyx_pf_6pandas_5algos_534__pyx_fuse_0median(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_arr); /* proto */
static PyObject *__pyx_pf_6pandas_5algos_536__pyx_fuse_1median(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_arr); /* proto */
static PyObject *__pyx_pf_6pandas_5algos_538__pyx_fuse_2median(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_arr); /* proto */
static PyObject *__pyx_pf_6pandas_5algos_540__pyx_fuse_3median(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_arr); /* proto */
static PyObject *__pyx_pf_6pandas_5algos_542__pyx_fuse_4median(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_arr); /* proto */
static PyObject *__pyx_pf_6pandas_5algos_544__pyx_fuse_5median(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_arr); /* proto */
static PyObject *__pyx_pf_6pandas_5algos_546__pyx_fuse_6median(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_arr); /* proto */
static PyObject *__pyx_pf_6pandas_5algos_548__pyx_fuse_7median(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_arr); /* proto */
static PyObject *__pyx_pf_6pandas_5algos_550__pyx_fuse_8median(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_arr); /* proto */
static PyObject *__pyx_pf_6pandas_5algos_552__pyx_fuse_9median(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_arr); /* proto */
static PyObject *__pyx_pf_6pandas_5algos_18max_subseq(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_arr); /* proto */
static PyObject *__pyx_pf_6pandas_5algos_20min_subseq(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_arr); /* proto */
static PyObject *__pyx_pf_6pandas_5algos_22roll_sum(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_input, int __pyx_v_win, int __pyx_v_minp); /* proto */
static PyObject *__pyx_pf_6pandas_5algos_24roll_mean(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_input, int __pyx_v_win, int __pyx_v_minp); /* proto */
static PyObject *__pyx_pf_6pandas_5algos_26ewma(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_input, __pyx_t_5numpy_double_t __pyx_v_com, int __pyx_v_adjust); /* proto */
static PyObject *__pyx_pf_6pandas_5algos_28nancorr(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_mat, PyObject *__pyx_v_cov, PyObject *__pyx_v_minp); /* proto */
static PyObject *__pyx_pf_6pandas_5algos_30nancorr_spearman(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_mat, Py_ssize_t __pyx_v_minp); /* proto */
static PyObject *__pyx_pf_6pandas_5algos_32roll_var(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_input, int __pyx_v_win, int __pyx_v_minp, int __pyx_v_ddof); /* proto */
static PyObject *__pyx_pf_6pandas_5algos_34roll_skew(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_input, int __pyx_v_win, int __pyx_v_minp); /* proto */
static PyObject *__pyx_pf_6pandas_5algos_36roll_kurt(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_input, int __pyx_v_win, int __pyx_v_minp); /* proto */
static PyObject *__pyx_pf_6pandas_5algos_38roll_median_c(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_arg, int __pyx_v_win, int __pyx_v_minp); /* proto */
static PyObject *__pyx_pf_6pandas_5algos_40roll_median_cython(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_input, int __pyx_v_win, int __pyx_v_minp); /* proto */
static PyObject *__pyx_pf_6pandas_5algos_42roll_max2(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_a, int __pyx_v_window, int __pyx_v_minp); /* proto */
static PyObject *__pyx_pf_6pandas_5algos_44roll_max(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_input, int __pyx_v_win, int __pyx_v_minp); /* proto */
static PyObject *__pyx_pf_6pandas_5algos_46roll_min(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_input, int __pyx_v_win, int __pyx_v_minp); /* proto */
static PyObject *__pyx_pf_6pandas_5algos_48roll_min2(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_a, int __pyx_v_window, int __pyx_v_minp); /* proto */
static PyObject *__pyx_pf_6pandas_5algos_50roll_quantile(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_input, int __pyx_v_win, int __pyx_v_minp, double __pyx_v_quantile); /* proto */
static PyObject *__pyx_pf_6pandas_5algos_52roll_generic(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_input, int __pyx_v_win, int __pyx_v_minp, PyObject *__pyx_v_func, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs); /* proto */
static PyObject *__pyx_pf_6pandas_5algos_54roll_window(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_input, PyArrayObject *__pyx_v_weights, int __pyx_v_minp, int __pyx_v_avg, int __pyx_v_avg_wgt); /* proto */
static PyObject *__pyx_pf_6pandas_5algos_56is_lexsorted(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_list_of_arrays); /* proto */
static PyObject *__pyx_pf_6pandas_5algos_58groupby_indices(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values); /* proto */
static PyObject *__pyx_pf_6pandas_5algos_60group_labels(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values); /* proto */
static PyObject *__pyx_pf_6pandas_5algos_62groupsort_indexer(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_index, Py_ssize_t __pyx_v_ngroups); /* proto */
static PyObject *__pyx_pf_6pandas_5algos_64group_nth_object(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_out, PyArrayObject *__pyx_v_counts, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_labels, __pyx_t_5numpy_int64_t __pyx_v_rank); /* proto */
static PyObject *__pyx_pf_6pandas_5algos_66group_nth_bin_object(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_out, PyArrayObject *__pyx_v_counts, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_bins, __pyx_t_5numpy_int64_t __pyx_v_rank); /* proto */
static PyObject *__pyx_pf_6pandas_5algos_68group_last_object(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_out, PyArrayObject *__pyx_v_counts, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_labels); /* proto */
static PyObject *__pyx_pf_6pandas_5algos_70group_last_bin_object(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_out, PyArrayObject *__pyx_v_counts, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_bins); /* proto */
static PyObject *__pyx_pf_6pandas_5algos_72group_median(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_out, PyArrayObject *__pyx_v_counts, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_labels); /* proto */
static PyObject *__pyx_pf_6pandas_5algos_74inner_join(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_left, PyArrayObject *__pyx_v_right, Py_ssize_t __pyx_v_max_groups); /* proto */
static PyObject *__pyx_pf_6pandas_5algos_76left_outer_join(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_left, PyArrayObject *__pyx_v_right, Py_ssize_t __pyx_v_max_groups, PyObject *__pyx_v_sort); /* proto */
static PyObject *__pyx_pf_6pandas_5algos_78full_outer_join(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_left, PyArrayObject *__pyx_v_right, Py_ssize_t __pyx_v_max_groups); /* proto */
static PyObject *__pyx_pf_6pandas_5algos_80_get_result_indexer(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_sorter, PyObject *__pyx_v_indexer); /* proto */
static PyObject *__pyx_pf_6pandas_5algos_82ffill_indexer(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_indexer); /* proto */
static PyObject *__pyx_pf_6pandas_5algos_84ffill_by_group(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_indexer, PyArrayObject *__pyx_v_group_ids, __pyx_t_5numpy_int64_t __pyx_v_max_group); /* proto */
static PyObject *__pyx_pf_6pandas_5algos_86ensure_platform_int(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_arr); /* proto */
static PyObject *__pyx_pf_6pandas_5algos_88ensure_float64(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_arr); /* proto */
static PyObject *__pyx_pf_6pandas_5algos_90ensure_float32(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_arr); /* proto */
static PyObject *__pyx_pf_6pandas_5algos_92ensure_int8(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_arr); /* proto */
static PyObject *__pyx_pf_6pandas_5algos_94ensure_int16(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_arr); /* proto */
static PyObject *__pyx_pf_6pandas_5algos_96ensure_int32(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_arr); /* proto */
static PyObject *__pyx_pf_6pandas_5algos_98ensure_int64(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_arr); /* proto */
static PyObject *__pyx_pf_6pandas_5algos_100ensure_object(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_arr); /* proto */
static PyObject *__pyx_pf_6pandas_5algos_102map_indices_float64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_index); /* proto */
static PyObject *__pyx_pf_6pandas_5algos_104map_indices_float32(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_index); /* proto */
static PyObject *__pyx_pf_6pandas_5algos_106map_indices_object(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_index); /* proto */
static PyObject *__pyx_pf_6pandas_5algos_108map_indices_int32(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_index); /* proto */
static PyObject *__pyx_pf_6pandas_5algos_110map_indices_int64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_index); /* proto */
static PyObject *__pyx_pf_6pandas_5algos_112map_indices_bool(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_index); /* proto */
static PyObject *__pyx_pf_6pandas_5algos_114pad_float64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_old, PyArrayObject *__pyx_v_new, PyObject *__pyx_v_limit); /* proto */
static PyObject *__pyx_pf_6pandas_5algos_116pad_float32(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_old, PyArrayObject *__pyx_v_new, PyObject *__pyx_v_limit); /* proto */
static PyObject *__pyx_pf_6pandas_5algos_118pad_object(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_old, PyArrayObject *__pyx_v_new, PyObject *__pyx_v_limit); /* proto */
static PyObject *__pyx_pf_6pandas_5algos_120pad_int32(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_old, PyArrayObject *__pyx_v_new, PyObject *__pyx_v_limit); /* proto */
static PyObject *__pyx_pf_6pandas_5algos_122pad_int64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_old, PyArrayObject *__pyx_v_new, PyObject *__pyx_v_limit); /* proto */
static PyObject *__pyx_pf_6pandas_5algos_124pad_bool(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_old, PyArrayObject *__pyx_v_new, PyObject *__pyx_v_limit); /* proto */
static PyObject *__pyx_pf_6pandas_5algos_126backfill_float64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_old, PyArrayObject *__pyx_v_new, PyObject *__pyx_v_limit); /* proto */
static PyObject *__pyx_pf_6pandas_5algos_128backfill_float32(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_old, PyArrayObject *__pyx_v_new, PyObject *__pyx_v_limit); /* proto */
static PyObject *__pyx_pf_6pandas_5algos_130backfill_object(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_old, PyArrayObject *__pyx_v_new, PyObject *__pyx_v_limit); /* proto */
static PyObject *__pyx_pf_6pandas_5algos_132backfill_int32(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_old, PyArrayObject *__pyx_v_new, PyObject *__pyx_v_limit); /* proto */
static PyObject *__pyx_pf_6pandas_5algos_134backfill_int64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_old, PyArrayObject *__pyx_v_new, PyObject *__pyx_v_limit); /* proto */
static PyObject *__pyx_pf_6pandas_5algos_136backfill_bool(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_old, PyArrayObject *__pyx_v_new, PyObject *__pyx_v_limit); /* proto */
static PyObject *__pyx_pf_6pandas_5algos_138pad_inplace_float64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_mask, PyObject *__pyx_v_limit); /* proto */
static PyObject *__pyx_pf_6pandas_5algos_140pad_inplace_float32(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_mask, PyObject *__pyx_v_limit); /* proto */
static PyObject *__pyx_pf_6pandas_5algos_142pad_inplace_object(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_mask, PyObject *__pyx_v_limit); /* proto */
static PyObject *__pyx_pf_6pandas_5algos_144pad_inplace_int32(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_mask, PyObject *__pyx_v_limit); /* proto */
static PyObject *__pyx_pf_6pandas_5algos_146pad_inplace_int64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_mask, PyObject *__pyx_v_limit); /* proto */
static PyObject *__pyx_pf_6pandas_5algos_148pad_inplace_bool(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_mask, PyObject *__pyx_v_limit); /* proto */
static PyObject *__pyx_pf_6pandas_5algos_150backfill_inplace_float64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_mask, PyObject *__pyx_v_limit); /* proto */
static PyObject *__pyx_pf_6pandas_5algos_152backfill_inplace_float32(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_mask, PyObject *__pyx_v_limit); /* proto */
static PyObject *__pyx_pf_6pandas_5algos_154backfill_inplace_object(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_mask, PyObject *__pyx_v_limit); /* proto */
static PyObject *__pyx_pf_6pandas_5algos_156backfill_inplace_int32(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_mask, PyObject *__pyx_v_limit); /* proto */
static PyObject *__pyx_pf_6pandas_5algos_158backfill_inplace_int64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_mask, PyObject *__pyx_v_limit); /* proto */
static PyObject *__pyx_pf_6pandas_5algos_160backfill_inplace_bool(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_mask, PyObject *__pyx_v_limit); /* proto */
static PyObject *__pyx_pf_6pandas_5algos_162pad_2d_inplace_float64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_mask, PyObject *__pyx_v_limit); /* proto */
static PyObject *__pyx_pf_6pandas_5algos_164pad_2d_inplace_float32(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_mask, PyObject *__pyx_v_limit); /* proto */
static PyObject *__pyx_pf_6pandas_5algos_166pad_2d_inplace_object(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_mask, PyObject *__pyx_v_limit); /* proto */
static PyObject *__pyx_pf_6pandas_5algos_168pad_2d_inplace_int32(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_mask, PyObject *__pyx_v_limit); /* proto */
static PyObject *__pyx_pf_6pandas_5algos_170pad_2d_inplace_int64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_mask, PyObject *__pyx_v_limit); /* proto */
static PyObject *__pyx_pf_6pandas_5algos_172pad_2d_inplace_bool(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_mask, PyObject *__pyx_v_limit); /* proto */
static PyObject *__pyx_pf_6pandas_5algos_174backfill_2d_inplace_float64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_mask, PyObject *__pyx_v_limit); /* proto */
static PyObject *__pyx_pf_6pandas_5algos_176backfill_2d_inplace_float32(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_mask, PyObject *__pyx_v_limit); /* proto */
static PyObject *__pyx_pf_6pandas_5algos_178backfill_2d_inplace_object(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_mask, PyObject *__pyx_v_limit); /* proto */
static PyObject *__pyx_pf_6pandas_5algos_180backfill_2d_inplace_int32(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_mask, PyObject *__pyx_v_limit); /* proto */
static PyObject *__pyx_pf_6pandas_5algos_182backfill_2d_inplace_int64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_mask, PyObject *__pyx_v_limit); /* proto */
static PyObject *__pyx_pf_6pandas_5algos_184backfill_2d_inplace_bool(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_mask, PyObject *__pyx_v_limit); /* proto */
static PyObject *__pyx_pf_6pandas_5algos_186is_monotonic_float64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_arr); /* proto */
static PyObject *__pyx_pf_6pandas_5algos_188is_monotonic_float32(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_arr); /* proto */
static PyObject *__pyx_pf_6pandas_5algos_190is_monotonic_object(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_arr); /* proto */
static PyObject *__pyx_pf_6pandas_5algos_192is_monotonic_int32(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_arr); /* proto */
static PyObject *__pyx_pf_6pandas_5algos_194is_monotonic_int64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_arr); /* proto */
static PyObject *__pyx_pf_6pandas_5algos_196is_monotonic_bool(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_arr); /* proto */
static PyObject *__pyx_pf_6pandas_5algos_198groupby_float64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_index, PyArrayObject *__pyx_v_labels); /* proto */
static PyObject *__pyx_pf_6pandas_5algos_200groupby_float32(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_index, PyArrayObject *__pyx_v_labels); /* proto */
static PyObject *__pyx_pf_6pandas_5algos_202groupby_object(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_index, PyArrayObject *__pyx_v_labels); /* proto */
static PyObject *__pyx_pf_6pandas_5algos_204groupby_int32(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_index, PyArrayObject *__pyx_v_labels); /* proto */
static PyObject *__pyx_pf_6pandas_5algos_206groupby_int64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_index, PyArrayObject *__pyx_v_labels); /* proto */
static PyObject *__pyx_pf_6pandas_5algos_208groupby_bool(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_index, PyArrayObject *__pyx_v_labels); /* proto */
static PyObject *__pyx_pf_6pandas_5algos_210arrmap_float64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_index, PyObject *__pyx_v_func); /* proto */
static PyObject *__pyx_pf_6pandas_5algos_212arrmap_float32(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_index, PyObject *__pyx_v_func); /* proto */
static PyObject *__pyx_pf_6pandas_5algos_214arrmap_object(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_index, PyObject *__pyx_v_func); /* proto */
static PyObject *__pyx_pf_6pandas_5algos_216arrmap_int32(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_index, PyObject *__pyx_v_func); /* proto */
static PyObject *__pyx_pf_6pandas_5algos_218arrmap_int64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_index, PyObject *__pyx_v_func); /* proto */
static PyObject *__pyx_pf_6pandas_5algos_220arrmap_bool(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_index, PyObject *__pyx_v_func); /* proto */
static PyObject *__pyx_pf_6pandas_5algos_222take_1d_bool_bool(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_indexer, PyArrayObject *__pyx_v_out, PyObject *__pyx_v_fill_value); /* proto */
static PyObject *__pyx_pf_6pandas_5algos_224take_1d_bool_object(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_indexer, PyArrayObject *__pyx_v_out, PyObject *__pyx_v_fill_value); /* proto */
static PyObject *__pyx_pf_6pandas_5algos_226take_1d_int8_int8(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_indexer, PyArrayObject *__pyx_v_out, PyObject *__pyx_v_fill_value); /* proto */
static PyObject *__pyx_pf_6pandas_5algos_228take_1d_int8_int32(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_indexer, PyArrayObject *__pyx_v_out, PyObject *__pyx_v_fill_value); /* proto */
static PyObject *__pyx_pf_6pandas_5algos_230take_1d_int8_int64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_indexer, PyArrayObject *__pyx_v_out, PyObject *__pyx_v_fill_value); /* proto */
static PyObject *__pyx_pf_6pandas_5algos_232take_1d_int8_float64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_indexer, PyArrayObject *__pyx_v_out, PyObject *__pyx_v_fill_value); /* proto */
static PyObject *__pyx_pf_6pandas_5algos_234take_1d_int16_int16(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_indexer, PyArrayObject *__pyx_v_out, PyObject *__pyx_v_fill_value); /* proto */
static PyObject *__pyx_pf_6pandas_5algos_236take_1d_int16_int32(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_indexer, PyArrayObject *__pyx_v_out, PyObject *__pyx_v_fill_value); /* proto */
static PyObject *__pyx_pf_6pandas_5algos_238take_1d_int16_int64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_indexer, PyArrayObject *__pyx_v_out, PyObject *__pyx_v_fill_value); /* proto */
static PyObject *__pyx_pf_6pandas_5algos_240take_1d_int16_float64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_indexer, PyArrayObject *__pyx_v_out, PyObject *__pyx_v_fill_value); /* proto */
static PyObject *__pyx_pf_6pandas_5algos_242take_1d_int32_int32(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_indexer, PyArrayObject *__pyx_v_out, PyObject *__pyx_v_fill_value); /* proto */
static PyObject *__pyx_pf_6pandas_5algos_244take_1d_int32_int64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_indexer, PyArrayObject *__pyx_v_out, PyObject *__pyx_v_fill_value); /* proto */
static PyObject *__pyx_pf_6pandas_5algos_246take_1d_int32_float64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_indexer, PyArrayObject *__pyx_v_out, PyObject *__pyx_v_fill_value); /* proto */
static PyObject *__pyx_pf_6pandas_5algos_248take_1d_int64_int64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_indexer, PyArrayObject *__pyx_v_out, PyObject *__pyx_v_fill_value); /* proto */
static PyObject *__pyx_pf_6pandas_5algos_250take_1d_int64_float64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_indexer, PyArrayObject *__pyx_v_out, PyObject *__pyx_v_fill_value); /* proto */
static PyObject *__pyx_pf_6pandas_5algos_252take_1d_float32_float32(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_indexer, PyArrayObject *__pyx_v_out, PyObject *__pyx_v_fill_value); /* proto */
static PyObject *__pyx_pf_6pandas_5algos_254take_1d_float32_float64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_indexer, PyArrayObject *__pyx_v_out, PyObject *__pyx_v_fill_value); /* proto */
static PyObject *__pyx_pf_6pandas_5algos_256take_1d_float64_float64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_indexer, PyArrayObject *__pyx_v_out, PyObject *__pyx_v_fill_value); /* proto */
static PyObject *__pyx_pf_6pandas_5algos_258take_1d_object_object(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_indexer, PyArrayObject *__pyx_v_out, PyObject *__pyx_v_fill_value); /* proto */
static PyObject *__pyx_pf_6pandas_5algos_260take_2d_axis0_bool_bool(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_values, PyArrayObject *__pyx_v_indexer, __Pyx_memviewslice __pyx_v_out, PyObject *__pyx_v_fill_value); /* proto */
static PyObject *__pyx_pf_6pandas_5algos_262take_2d_axis0_bool_object(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_values, PyArrayObject *__pyx_v_indexer, __Pyx_memviewslice __pyx_v_out, PyObject *__pyx_v_fill_value); /* proto */
static PyObject *__pyx_pf_6pandas_5algos_264take_2d_axis0_int8_int8(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_values, PyArrayObject *__pyx_v_indexer, __Pyx_memviewslice __pyx_v_out, PyObject *__pyx_v_fill_value); /* proto */
static PyObject *__pyx_pf_6pandas_5algos_266take_2d_axis0_int8_int32(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_values, PyArrayObject *__pyx_v_indexer, __Pyx_memviewslice __pyx_v_out, PyObject *__pyx_v_fill_value); /* proto */
static PyObject *__pyx_pf_6pandas_5algos_268take_2d_axis0_int8_int64(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_values, PyArrayObject *__pyx_v_indexer, __Pyx_memviewslice __pyx_v_out, PyObject *__pyx_v_fill_value); /* proto */
static PyObject *__pyx_pf_6pandas_5algos_270take_2d_axis0_int8_float64(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_values, PyArrayObject *__pyx_v_indexer, __Pyx_memviewslice __pyx_v_out, PyObject *__pyx_v_fill_value); /* proto */
static PyObject *__pyx_pf_6pandas_5algos_272take_2d_axis0_int16_int16(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_values, PyArrayObject *__pyx_v_indexer, __Pyx_memviewslice __pyx_v_out, PyObject *__pyx_v_fill_value); /* proto */
static PyObject *__pyx_pf_6pandas_5algos_274take_2d_axis0_int16_int32(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_values, PyArrayObject *__pyx_v_indexer, __Pyx_memviewslice __pyx_v_out, PyObject *__pyx_v_fill_value); /* proto */
static PyObject *__pyx_pf_6pandas_5algos_276take_2d_axis0_int16_int64(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_values, PyArrayObject *__pyx_v_indexer, __Pyx_memviewslice __pyx_v_out, PyObject *__pyx_v_fill_value); /* proto */
static PyObject *__pyx_pf_6pandas_5algos_278take_2d_axis0_int16_float64(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_values, PyArrayObject *__pyx_v_indexer, __Pyx_memviewslice __pyx_v_out, PyObject *__pyx_v_fill_value); /* proto */
static PyObject *__pyx_pf_6pandas_5algos_280take_2d_axis0_int32_int32(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_values, PyArrayObject *__pyx_v_indexer, __Pyx_memviewslice __pyx_v_out, PyObject *__pyx_v_fill_value); /* proto */
static PyObject *__pyx_pf_6pandas_5algos_282take_2d_axis0_int32_int64(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_values, PyArrayObject *__pyx_v_indexer, __Pyx_memviewslice __pyx_v_out, PyObject *__pyx_v_fill_value); /* proto */
static PyObject *__pyx_pf_6pandas_5algos_284take_2d_axis0_int32_float64(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_values, PyArrayObject *__pyx_v_indexer, __Pyx_memviewslice __pyx_v_out, PyObject *__pyx_v_fill_value); /* proto */
static PyObject *__pyx_pf_6pandas_5algos_286take_2d_axis0_int64_int64(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_values, PyArrayObject *__pyx_v_indexer, __Pyx_memviewslice __pyx_v_out, PyObject *__pyx_v_fill_value); /* proto */
static PyObject *__pyx_pf_6pandas_5algos_288take_2d_axis0_int64_float64(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_values, PyArrayObject *__pyx_v_indexer, __Pyx_memviewslice __pyx_v_out, PyObject *__pyx_v_fill_value); /* proto */
static PyObject *__pyx_pf_6pandas_5algos_290take_2d_axis0_float32_float32(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_values, PyArrayObject *__pyx_v_indexer, __Pyx_memviewslice __pyx_v_out, PyObject *__pyx_v_fill_value); /* proto */
static PyObject *__pyx_pf_6pandas_5algos_292take_2d_axis0_float32_float64(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_values, PyArrayObject *__pyx_v_indexer, __Pyx_memviewslice __pyx_v_out, PyObject *__pyx_v_fill_value); /* proto */
static PyObject *__pyx_pf_6pandas_5algos_294take_2d_axis0_float64_float64(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_values, PyArrayObject *__pyx_v_indexer, __Pyx_memviewslice __pyx_v_out, PyObject *__pyx_v_fill_value); /* proto */
static PyObject *__pyx_pf_6pandas_5algos_296take_2d_axis0_object_object(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_values, PyArrayObject *__pyx_v_indexer, __Pyx_memviewslice __pyx_v_out, PyObject *__pyx_v_fill_value); /* proto */
static PyObject *__pyx_pf_6pandas_5algos_298take_2d_axis1_bool_bool(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_values, PyArrayObject *__pyx_v_indexer, __Pyx_memviewslice __pyx_v_out, PyObject *__pyx_v_fill_value); /* proto */
static PyObject *__pyx_pf_6pandas_5algos_300take_2d_axis1_bool_object(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_values, PyArrayObject *__pyx_v_indexer, __Pyx_memviewslice __pyx_v_out, PyObject *__pyx_v_fill_value); /* proto */
static PyObject *__pyx_pf_6pandas_5algos_302take_2d_axis1_int8_int8(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_values, PyArrayObject *__pyx_v_indexer, __Pyx_memviewslice __pyx_v_out, PyObject *__pyx_v_fill_value); /* proto */
static PyObject *__pyx_pf_6pandas_5algos_304take_2d_axis1_int8_int32(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_values, PyArrayObject *__pyx_v_indexer, __Pyx_memviewslice __pyx_v_out, PyObject *__pyx_v_fill_value); /* proto */
static PyObject *__pyx_pf_6pandas_5algos_306take_2d_axis1_int8_int64(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_values, PyArrayObject *__pyx_v_indexer, __Pyx_memviewslice __pyx_v_out, PyObject *__pyx_v_fill_value); /* proto */
static PyObject *__pyx_pf_6pandas_5algos_308take_2d_axis1_int8_float64(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_values, PyArrayObject *__pyx_v_indexer, __Pyx_memviewslice __pyx_v_out, PyObject *__pyx_v_fill_value); /* proto */
static PyObject *__pyx_pf_6pandas_5algos_310take_2d_axis1_int16_int16(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_values, PyArrayObject *__pyx_v_indexer, __Pyx_memviewslice __pyx_v_out, PyObject *__pyx_v_fill_value); /* proto */
static PyObject *__pyx_pf_6pandas_5algos_312take_2d_axis1_int16_int32(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_values, PyArrayObject *__pyx_v_indexer, __Pyx_memviewslice __pyx_v_out, PyObject *__pyx_v_fill_value); /* proto */
static PyObject *__pyx_pf_6pandas_5algos_314take_2d_axis1_int16_int64(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_values, PyArrayObject *__pyx_v_indexer, __Pyx_memviewslice __pyx_v_out, PyObject *__pyx_v_fill_value); /* proto */
static PyObject *__pyx_pf_6pandas_5algos_316take_2d_axis1_int16_float64(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_values, PyArrayObject *__pyx_v_indexer, __Pyx_memviewslice __pyx_v_out, PyObject *__pyx_v_fill_value); /* proto */
static PyObject *__pyx_pf_6pandas_5algos_318take_2d_axis1_int32_int32(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_values, PyArrayObject *__pyx_v_indexer, __Pyx_memviewslice __pyx_v_out, PyObject *__pyx_v_fill_value); /* proto */
static PyObject *__pyx_pf_6pandas_5algos_320take_2d_axis1_int32_int64(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_values, PyArrayObject *__pyx_v_indexer, __Pyx_memviewslice __pyx_v_out, PyObject *__pyx_v_fill_value); /* proto */
static PyObject *__pyx_pf_6pandas_5algos_322take_2d_axis1_int32_float64(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_values, PyArrayObject *__pyx_v_indexer, __Pyx_memviewslice __pyx_v_out, PyObject *__pyx_v_fill_value); /* proto */
static PyObject *__pyx_pf_6pandas_5algos_324take_2d_axis1_int64_int64(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_values, PyArrayObject *__pyx_v_indexer, __Pyx_memviewslice __pyx_v_out, PyObject *__pyx_v_fill_value); /* proto */
static PyObject *__pyx_pf_6pandas_5algos_326take_2d_axis1_int64_float64(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_values, PyArrayObject *__pyx_v_indexer, __Pyx_memviewslice __pyx_v_out, PyObject *__pyx_v_fill_value); /* proto */
static PyObject *__pyx_pf_6pandas_5algos_328take_2d_axis1_float32_float32(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_values, PyArrayObject *__pyx_v_indexer, __Pyx_memviewslice __pyx_v_out, PyObject *__pyx_v_fill_value); /* proto */
static PyObject *__pyx_pf_6pandas_5algos_330take_2d_axis1_float32_float64(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_values, PyArrayObject *__pyx_v_indexer, __Pyx_memviewslice __pyx_v_out, PyObject *__pyx_v_fill_value); /* proto */
static PyObject *__pyx_pf_6pandas_5algos_332take_2d_axis1_float64_float64(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_values, PyArrayObject *__pyx_v_indexer, __Pyx_memviewslice __pyx_v_out, PyObject *__pyx_v_fill_value); /* proto */
static PyObject *__pyx_pf_6pandas_5algos_334take_2d_axis1_object_object(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_values, PyArrayObject *__pyx_v_indexer, __Pyx_memviewslice __pyx_v_out, PyObject *__pyx_v_fill_value); /* proto */
static PyObject *__pyx_pf_6pandas_5algos_336take_2d_multi_bool_bool(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, PyObject *__pyx_v_indexer, PyArrayObject *__pyx_v_out, PyObject *__pyx_v_fill_value); /* proto */
static PyObject *__pyx_pf_6pandas_5algos_338take_2d_multi_bool_object(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, PyObject *__pyx_v_indexer, PyArrayObject *__pyx_v_out, PyObject *__pyx_v_fill_value); /* proto */
static PyObject *__pyx_pf_6pandas_5algos_340take_2d_multi_int8_int8(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, PyObject *__pyx_v_indexer, PyArrayObject *__pyx_v_out, PyObject *__pyx_v_fill_value); /* proto */
static PyObject *__pyx_pf_6pandas_5algos_342take_2d_multi_int8_int32(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, PyObject *__pyx_v_indexer, PyArrayObject *__pyx_v_out, PyObject *__pyx_v_fill_value); /* proto */
static PyObject *__pyx_pf_6pandas_5algos_344take_2d_multi_int8_int64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, PyObject *__pyx_v_indexer, PyArrayObject *__pyx_v_out, PyObject *__pyx_v_fill_value); /* proto */
static PyObject *__pyx_pf_6pandas_5algos_346take_2d_multi_int8_float64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, PyObject *__pyx_v_indexer, PyArrayObject *__pyx_v_out, PyObject *__pyx_v_fill_value); /* proto */
static PyObject *__pyx_pf_6pandas_5algos_348take_2d_multi_int16_int16(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, PyObject *__pyx_v_indexer, PyArrayObject *__pyx_v_out, PyObject *__pyx_v_fill_value); /* proto */
static PyObject *__pyx_pf_6pandas_5algos_350take_2d_multi_int16_int32(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, PyObject *__pyx_v_indexer, PyArrayObject *__pyx_v_out, PyObject *__pyx_v_fill_value); /* proto */
static PyObject *__pyx_pf_6pandas_5algos_352take_2d_multi_int16_int64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, PyObject *__pyx_v_indexer, PyArrayObject *__pyx_v_out, PyObject *__pyx_v_fill_value); /* proto */
static PyObject *__pyx_pf_6pandas_5algos_354take_2d_multi_int16_float64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, PyObject *__pyx_v_indexer, PyArrayObject *__pyx_v_out, PyObject *__pyx_v_fill_value); /* proto */
static PyObject *__pyx_pf_6pandas_5algos_356take_2d_multi_int32_int32(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, PyObject *__pyx_v_indexer, PyArrayObject *__pyx_v_out, PyObject *__pyx_v_fill_value); /* proto */
static PyObject *__pyx_pf_6pandas_5algos_358take_2d_multi_int32_int64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, PyObject *__pyx_v_indexer, PyArrayObject *__pyx_v_out, PyObject *__pyx_v_fill_value); /* proto */
static PyObject *__pyx_pf_6pandas_5algos_360take_2d_multi_int32_float64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, PyObject *__pyx_v_indexer, PyArrayObject *__pyx_v_out, PyObject *__pyx_v_fill_value); /* proto */
static PyObject *__pyx_pf_6pandas_5algos_362take_2d_multi_int64_int64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, PyObject *__pyx_v_indexer, PyArrayObject *__pyx_v_out, PyObject *__pyx_v_fill_value); /* proto */
static PyObject *__pyx_pf_6pandas_5algos_364take_2d_multi_int64_float64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, PyObject *__pyx_v_indexer, PyArrayObject *__pyx_v_out, PyObject *__pyx_v_fill_value); /* proto */
static PyObject *__pyx_pf_6pandas_5algos_366take_2d_multi_float32_float32(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, PyObject *__pyx_v_indexer, PyArrayObject *__pyx_v_out, PyObject *__pyx_v_fill_value); /* proto */
static PyObject *__pyx_pf_6pandas_5algos_368take_2d_multi_float32_float64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, PyObject *__pyx_v_indexer, PyArrayObject *__pyx_v_out, PyObject *__pyx_v_fill_value); /* proto */
static PyObject *__pyx_pf_6pandas_5algos_370take_2d_multi_float64_float64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, PyObject *__pyx_v_indexer, PyArrayObject *__pyx_v_out, PyObject *__pyx_v_fill_value); /* proto */
static PyObject *__pyx_pf_6pandas_5algos_372take_2d_multi_object_object(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, PyObject *__pyx_v_indexer, PyArrayObject *__pyx_v_out, PyObject *__pyx_v_fill_value); /* proto */
static PyObject *__pyx_pf_6pandas_5algos_374diff_2d_float64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_arr, PyArrayObject *__pyx_v_out, Py_ssize_t __pyx_v_periods, int __pyx_v_axis); /* proto */
static PyObject *__pyx_pf_6pandas_5algos_376diff_2d_float32(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_arr, PyArrayObject *__pyx_v_out, Py_ssize_t __pyx_v_periods, int __pyx_v_axis); /* proto */
static PyObject *__pyx_pf_6pandas_5algos_378diff_2d_int8(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_arr, PyArrayObject *__pyx_v_out, Py_ssize_t __pyx_v_periods, int __pyx_v_axis); /* proto */
static PyObject *__pyx_pf_6pandas_5algos_380diff_2d_int16(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_arr, PyArrayObject *__pyx_v_out, Py_ssize_t __pyx_v_periods, int __pyx_v_axis); /* proto */
static PyObject *__pyx_pf_6pandas_5algos_382diff_2d_int32(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_arr, PyArrayObject *__pyx_v_out, Py_ssize_t __pyx_v_periods, int __pyx_v_axis); /* proto */
static PyObject *__pyx_pf_6pandas_5algos_384diff_2d_int64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_arr, PyArrayObject *__pyx_v_out, Py_ssize_t __pyx_v_periods, int __pyx_v_axis); /* proto */
static PyObject *__pyx_pf_6pandas_5algos_386group_last_float64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_out, PyArrayObject *__pyx_v_counts, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_labels); /* proto */
static PyObject *__pyx_pf_6pandas_5algos_388group_last_float32(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_out, PyArrayObject *__pyx_v_counts, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_labels); /* proto */
static PyObject *__pyx_pf_6pandas_5algos_390group_last_bin_float64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_out, PyArrayObject *__pyx_v_counts, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_bins); /* proto */
static PyObject *__pyx_pf_6pandas_5algos_392group_last_bin_float32(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_out, PyArrayObject *__pyx_v_counts, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_bins); /* proto */
static PyObject *__pyx_pf_6pandas_5algos_394group_nth_float64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_out, PyArrayObject *__pyx_v_counts, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_labels, __pyx_t_5numpy_int64_t __pyx_v_rank); /* proto */
static PyObject *__pyx_pf_6pandas_5algos_396group_nth_float32(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_out, PyArrayObject *__pyx_v_counts, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_labels, __pyx_t_5numpy_int64_t __pyx_v_rank); /* proto */
static PyObject *__pyx_pf_6pandas_5algos_398group_nth_bin_float64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_out, PyArrayObject *__pyx_v_counts, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_bins, __pyx_t_5numpy_int64_t __pyx_v_rank); /* proto */
static PyObject *__pyx_pf_6pandas_5algos_400group_nth_bin_float32(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_out, PyArrayObject *__pyx_v_counts, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_bins, __pyx_t_5numpy_int64_t __pyx_v_rank); /* proto */
static PyObject *__pyx_pf_6pandas_5algos_402group_add_float64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_out, PyArrayObject *__pyx_v_counts, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_labels); /* proto */
static PyObject *__pyx_pf_6pandas_5algos_404group_add_float32(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_out, PyArrayObject *__pyx_v_counts, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_labels); /* proto */
static PyObject *__pyx_pf_6pandas_5algos_406group_add_bin_float64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_out, PyArrayObject *__pyx_v_counts, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_bins); /* proto */
static PyObject *__pyx_pf_6pandas_5algos_408group_add_bin_float32(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_out, PyArrayObject *__pyx_v_counts, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_bins); /* proto */
static PyObject *__pyx_pf_6pandas_5algos_410group_prod_float64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_out, PyArrayObject *__pyx_v_counts, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_labels); /* proto */
static PyObject *__pyx_pf_6pandas_5algos_412group_prod_float32(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_out, PyArrayObject *__pyx_v_counts, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_labels); /* proto */
static PyObject *__pyx_pf_6pandas_5algos_414group_prod_bin_float64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_out, PyArrayObject *__pyx_v_counts, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_bins); /* proto */
static PyObject *__pyx_pf_6pandas_5algos_416group_prod_bin_float32(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_out, PyArrayObject *__pyx_v_counts, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_bins); /* proto */
static PyObject *__pyx_pf_6pandas_5algos_418group_var_float64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_out, PyArrayObject *__pyx_v_counts, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_labels); /* proto */
static PyObject *__pyx_pf_6pandas_5algos_420group_var_float32(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_out, PyArrayObject *__pyx_v_counts, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_labels); /* proto */
static PyObject *__pyx_pf_6pandas_5algos_422group_var_bin_float64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_out, PyArrayObject *__pyx_v_counts, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_bins); /* proto */
static PyObject *__pyx_pf_6pandas_5algos_424group_var_bin_float32(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_out, PyArrayObject *__pyx_v_counts, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_bins); /* proto */
static PyObject *__pyx_pf_6pandas_5algos_426group_mean_float64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_out, PyArrayObject *__pyx_v_counts, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_labels); /* proto */
static PyObject *__pyx_pf_6pandas_5algos_428group_mean_float32(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_out, PyArrayObject *__pyx_v_counts, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_labels); /* proto */
static PyObject *__pyx_pf_6pandas_5algos_430group_mean_bin_float64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_out, PyArrayObject *__pyx_v_counts, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_bins); /* proto */
static PyObject *__pyx_pf_6pandas_5algos_432group_mean_bin_float32(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_out, PyArrayObject *__pyx_v_counts, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_bins); /* proto */
static PyObject *__pyx_pf_6pandas_5algos_434group_min_float64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_out, PyArrayObject *__pyx_v_counts, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_labels); /* proto */
static PyObject *__pyx_pf_6pandas_5algos_436group_min_float32(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_out, PyArrayObject *__pyx_v_counts, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_labels); /* proto */
static PyObject *__pyx_pf_6pandas_5algos_438group_min_bin_float64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_out, PyArrayObject *__pyx_v_counts, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_bins); /* proto */
static PyObject *__pyx_pf_6pandas_5algos_440group_min_bin_float32(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_out, PyArrayObject *__pyx_v_counts, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_bins); /* proto */
static PyObject *__pyx_pf_6pandas_5algos_442group_max_float64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_out, PyArrayObject *__pyx_v_counts, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_labels); /* proto */
static PyObject *__pyx_pf_6pandas_5algos_444group_max_float32(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_out, PyArrayObject *__pyx_v_counts, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_labels); /* proto */
static PyObject *__pyx_pf_6pandas_5algos_446group_max_bin_float64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_out, PyArrayObject *__pyx_v_counts, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_bins); /* proto */
static PyObject *__pyx_pf_6pandas_5algos_448group_max_bin_float32(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_out, PyArrayObject *__pyx_v_counts, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_bins); /* proto */
static PyObject *__pyx_pf_6pandas_5algos_450group_ohlc_float64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_out, PyArrayObject *__pyx_v_counts, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_bins); /* proto */
static PyObject *__pyx_pf_6pandas_5algos_452group_ohlc_float32(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_out, PyArrayObject *__pyx_v_counts, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_bins); /* proto */
static PyObject *__pyx_pf_6pandas_5algos_454group_count_float64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_out, PyArrayObject *__pyx_v_counts, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_labels); /* proto */
static PyObject *__pyx_pf_6pandas_5algos_456group_count_float32(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_out, PyArrayObject *__pyx_v_counts, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_labels); /* proto */
static PyObject *__pyx_pf_6pandas_5algos_458group_count_object(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_out, PyArrayObject *__pyx_v_counts, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_labels); /* proto */
static PyObject *__pyx_pf_6pandas_5algos_460group_count_int64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_out, PyArrayObject *__pyx_v_counts, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_labels); /* proto */
static PyObject *__pyx_pf_6pandas_5algos_462group_count_bin_float64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_out, PyArrayObject *__pyx_v_counts, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_bins); /* proto */
static PyObject *__pyx_pf_6pandas_5algos_464group_count_bin_float32(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_out, PyArrayObject *__pyx_v_counts, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_bins); /* proto */
static PyObject *__pyx_pf_6pandas_5algos_466group_count_bin_object(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_out, PyArrayObject *__pyx_v_counts, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_bins); /* proto */
static PyObject *__pyx_pf_6pandas_5algos_468group_count_bin_int64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_out, PyArrayObject *__pyx_v_counts, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_bins); /* proto */
static PyObject *__pyx_pf_6pandas_5algos_470left_join_indexer_unique_float64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_left, PyArrayObject *__pyx_v_right); /* proto */
static PyObject *__pyx_pf_6pandas_5algos_472left_join_indexer_unique_float32(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_left, PyArrayObject *__pyx_v_right); /* proto */
static PyObject *__pyx_pf_6pandas_5algos_474left_join_indexer_unique_object(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_left, PyArrayObject *__pyx_v_right); /* proto */
static PyObject *__pyx_pf_6pandas_5algos_476left_join_indexer_unique_int32(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_left, PyArrayObject *__pyx_v_right); /* proto */
static PyObject *__pyx_pf_6pandas_5algos_478left_join_indexer_unique_int64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_left, PyArrayObject *__pyx_v_right); /* proto */
static PyObject *__pyx_pf_6pandas_5algos_480left_join_indexer_float64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_left, PyArrayObject *__pyx_v_right); /* proto */
static PyObject *__pyx_pf_6pandas_5algos_482left_join_indexer_float32(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_left, PyArrayObject *__pyx_v_right); /* proto */
static PyObject *__pyx_pf_6pandas_5algos_484left_join_indexer_object(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_left, PyArrayObject *__pyx_v_right); /* proto */
static PyObject *__pyx_pf_6pandas_5algos_486left_join_indexer_int32(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_left, PyArrayObject *__pyx_v_right); /* proto */
static PyObject *__pyx_pf_6pandas_5algos_488left_join_indexer_int64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_left, PyArrayObject *__pyx_v_right); /* proto */
static PyObject *__pyx_pf_6pandas_5algos_490outer_join_indexer_float64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_left, PyArrayObject *__pyx_v_right); /* proto */
static PyObject *__pyx_pf_6pandas_5algos_492outer_join_indexer_float32(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_left, PyArrayObject *__pyx_v_right); /* proto */
static PyObject *__pyx_pf_6pandas_5algos_494outer_join_indexer_object(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_left, PyArrayObject *__pyx_v_right); /* proto */
static PyObject *__pyx_pf_6pandas_5algos_496outer_join_indexer_int32(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_left, PyArrayObject *__pyx_v_right); /* proto */
static PyObject *__pyx_pf_6pandas_5algos_498outer_join_indexer_int64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_left, PyArrayObject *__pyx_v_right); /* proto */
static PyObject *__pyx_pf_6pandas_5algos_500inner_join_indexer_float64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_left, PyArrayObject *__pyx_v_right); /* proto */
static PyObject *__pyx_pf_6pandas_5algos_502inner_join_indexer_float32(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_left, PyArrayObject *__pyx_v_right); /* proto */
static PyObject *__pyx_pf_6pandas_5algos_504inner_join_indexer_object(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_left, PyArrayObject *__pyx_v_right); /* proto */
static PyObject *__pyx_pf_6pandas_5algos_506inner_join_indexer_int32(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_left, PyArrayObject *__pyx_v_right); /* proto */
static PyObject *__pyx_pf_6pandas_5algos_508inner_join_indexer_int64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_left, PyArrayObject *__pyx_v_right); /* proto */
static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /* proto */
static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info); /* proto */
static int __pyx_array_MemoryView_5array___cinit__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_shape, Py_ssize_t __pyx_v_itemsize, PyObject *__pyx_v_format, PyObject *__pyx_v_mode, int __pyx_v_allocate_buffer); /* proto */
static int __pyx_array_getbuffer_MemoryView_5array_2__getbuffer__(struct __pyx_array_obj *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /* proto */
static void __pyx_array_MemoryView_5array_4__dealloc__(struct __pyx_array_obj *__pyx_v_self); /* proto */
static PyObject *get_memview_MemoryView_5array_7memview___get__(struct __pyx_array_obj *__pyx_v_self); /* proto */
static PyObject *__pyx_array_MemoryView_5array_6__getattr__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_attr); /* proto */
static PyObject *__pyx_array_MemoryView_5array_8__getitem__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item); /* proto */
static int __pyx_array_MemoryView_5array_10__setitem__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value); /* proto */
static int __pyx_MemviewEnum_MemoryView_4Enum___init__(struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v_name); /* proto */
static PyObject *__pyx_MemviewEnum_MemoryView_4Enum_2__repr__(struct __pyx_MemviewEnum_obj *__pyx_v_self); /* proto */
static int __pyx_memoryview_MemoryView_10memoryview___cinit__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_obj, int __pyx_v_flags, int __pyx_v_dtype_is_object); /* proto */
static void __pyx_memoryview_MemoryView_10memoryview_2__dealloc__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
static PyObject *__pyx_memoryview_MemoryView_10memoryview_4__getitem__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index); /* proto */
static int __pyx_memoryview_MemoryView_10memoryview_6__setitem__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value); /* proto */
static int __pyx_memoryview_getbuffer_MemoryView_10memoryview_8__getbuffer__(struct __pyx_memoryview_obj *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /* proto */
static PyObject *__pyx_memoryview_transpose_MemoryView_10memoryview_1T___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
static PyObject *__pyx_memoryview__get__base_MemoryView_10memoryview_4base___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
static PyObject *__pyx_memoryview_get_shape_MemoryView_10memoryview_5shape___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
static PyObject *__pyx_memoryview_get_strides_MemoryView_10memoryview_7strides___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
static PyObject *__pyx_memoryview_get_suboffsets_MemoryView_10memoryview_10suboffsets___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
static PyObject *__pyx_memoryview_get_ndim_MemoryView_10memoryview_4ndim___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
static PyObject *__pyx_memoryview_get_itemsize_MemoryView_10memoryview_8itemsize___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
static PyObject *__pyx_memoryview_get_nbytes_MemoryView_10memoryview_6nbytes___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
static PyObject *__pyx_memoryview_get_size_MemoryView_10memoryview_4size___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
static Py_ssize_t __pyx_memoryview_MemoryView_10memoryview_10__len__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
static PyObject *__pyx_memoryview_MemoryView_10memoryview_12__repr__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
static PyObject *__pyx_memoryview_MemoryView_10memoryview_14__str__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
static PyObject *__pyx_memoryview_MemoryView_10memoryview_16is_c_contig(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
static PyObject *__pyx_memoryview_MemoryView_10memoryview_18is_f_contig(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
static PyObject *__pyx_memoryview_MemoryView_10memoryview_20copy(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
static PyObject *__pyx_memoryview_MemoryView_10memoryview_22copy_fortran(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
static void __pyx_memoryviewslice_MemoryView_16_memoryviewslice___dealloc__(struct __pyx_memoryviewslice_obj *__pyx_v_self); /* proto */
static PyObject *__pyx_memoryviewslice__get__base_MemoryView_16_memoryviewslice_4base___get__(struct __pyx_memoryviewslice_obj *__pyx_v_self); /* proto */
static PyObject *__pyx_tp_new_6pandas_5algos_Node(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_6pandas_5algos_IndexableSkiplist(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_array(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_Enum(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_memoryview(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new__memoryviewslice(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static char __pyx_k_A[] = "A";
static char __pyx_k_B[] = "B";
static char __pyx_k_C[] = "C";
static char __pyx_k_D[] = "D";
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_N[] = "N";
static char __pyx_k_O[] = "O";
static char __pyx_k_Q[] = "Q";
static char __pyx_k_R[] = "R";
static char __pyx_k_S[] = "S";
static char __pyx_k_T[] = "T";
static char __pyx_k_a[] = "a";
static char __pyx_k_b[] = "b";
static char __pyx_k_c[] = "c";
static char __pyx_k_d[] = "d";
static char __pyx_k_e[] = "e";
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_j[] = "j";
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_o[] = "o";
static char __pyx_k_q[] = "q";
static char __pyx_k_s[] = "s";
static char __pyx_k_u[] = "u";
static char __pyx_k_v[] = "v";
static char __pyx_k_w[] = "w";
static char __pyx_k_x[] = "x";
static char __pyx_k_y[] = "y";
static char __pyx_k_z[] = "z";
static char __pyx_k_NA[] = "NA";
static char __pyx_k_Zd[] = "Zd";
static char __pyx_k_Zf[] = "Zf";
static char __pyx_k_Zg[] = "Zg";
static char __pyx_k_ai[] = "ai";
static char __pyx_k_as[] = "_as";
static char __pyx_k_ct[] = "ct";
static char __pyx_k_eq[] = "__eq__";
static char __pyx_k_f8[] = "f8";
static char __pyx_k_fv[] = "fv";
static char __pyx_k_ge[] = "__ge__";
static char __pyx_k_gt[] = "__gt__";
static char __pyx_k_i0[] = "i0";
static char __pyx_k_i8[] = "i8";
static char __pyx_k_id[] = "id";
static char __pyx_k_lc[] = "lc";
static char __pyx_k_le[] = "__le__";
static char __pyx_k_lt[] = "__lt__";
static char __pyx_k_n0[] = "n0";
static char __pyx_k_ne[] = "__ne__";
static char __pyx_k_np[] = "np";
static char __pyx_k_rc[] = "rc";
static char __pyx_k_sl[] = "sl";
static char __pyx_k_sx[] = "sx";
static char __pyx_k_sy[] = "sy";
static char __pyx_k_vx[] = "vx";
static char __pyx_k_vy[] = "vy";
static char __pyx_k_xi[] = "xi";
static char __pyx_k_xx[] = "xx";
static char __pyx_k_yi[] = "yi";
static char __pyx_k_NIL[] = "NIL";
static char __pyx_k_NaN[] = "NaN";
static char __pyx_k__32[] = "()";
static char __pyx_k__34[] = "|";
static char __pyx_k_adj[] = "adj";
static char __pyx_k_arg[] = "arg";
static char __pyx_k_arr[] = "arr";
static char __pyx_k_avg[] = "avg";
static char __pyx_k_buf[] = "buf";
static char __pyx_k_cmp[] = "__cmp__";
static char __pyx_k_com[] = "com";
static char __pyx_k_cov[] = "cov";
static char __pyx_k_cur[] = "cur";
static char __pyx_k_day[] = "day";
static char __pyx_k_dim[] = "dim";
static char __pyx_k_doc[] = "__doc__";
static char __pyx_k_end[] = "end";
static char __pyx_k_get[] = "get";
static char __pyx_k_gid[] = "gid";
static char __pyx_k_ids[] = "ids";
static char __pyx_k_idx[] = "idx";
static char __pyx_k_inf[] = "inf";
static char __pyx_k_int[] = "int_";
static char __pyx_k_key[] = "key";
static char __pyx_k_lab[] = "lab";
static char __pyx_k_lib[] = "lib";
static char __pyx_k_lim[] = "lim";
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_new[] = "new";
static char __pyx_k_obj[] = "obj";
static char __pyx_k_old[] = "old";
static char __pyx_k_ord[] = "ord";
static char __pyx_k_out[] = "out";
static char __pyx_k_pct[] = "pct";
static char __pyx_k_pre[] = "pre";
static char __pyx_k_ptr[] = "ptr";
static char __pyx_k_put[] = "put";
static char __pyx_k_res[] = "res";
static char __pyx_k_ret[] = "ret";
static char __pyx_k_rev[] = "rev";
static char __pyx_k_top[] = "top";
static char __pyx_k_val[] = "val";
static char __pyx_k_win[] = "win";
static char __pyx_k_xxx[] = "xxx";
static char __pyx_k_zip[] = "zip";
static char __pyx_k_NINF[] = "NINF";
static char __pyx_k_aold[] = "aold";
static char __pyx_k_args[] = "args";
static char __pyx_k_axis[] = "axis";
static char __pyx_k_base[] = "base";
static char __pyx_k_bins[] = "bins";
static char __pyx_k_copy[] = "copy";
static char __pyx_k_data[] = "data";
static char __pyx_k_ddof[] = "ddof";
static char __pyx_k_dims[] = "dims";
static char __pyx_k_dups[] = "dups";
static char __pyx_k_ewma[] = "ewma";
static char __pyx_k_fill[] = "fill";
static char __pyx_k_func[] = "func";
static char __pyx_k_hour[] = "hour";
static char __pyx_k_idx0[] = "idx0";
static char __pyx_k_idx1[] = "idx1";
static char __pyx_k_in_i[] = "in_i";
static char __pyx_k_in_k[] = "in_k";
static char __pyx_k_in_n[] = "in_n";
static char __pyx_k_infs[] = "infs";
static char __pyx_k_int8[] = "int8";
static char __pyx_k_keep[] = "keep";
static char __pyx_k_kind[] = "kind";
static char __pyx_k_last[] = "last";
static char __pyx_k_left[] = "left";
static char __pyx_k_lval[] = "lval";
static char __pyx_k_main[] = "__main__";
static char __pyx_k_mask[] = "mask";
static char __pyx_k_maxx[] = "maxx";
static char __pyx_k_mean[] = "mean";
static char __pyx_k_minp[] = "minp";
static char __pyx_k_minx[] = "minx";
static char __pyx_k_mode[] = "mode";
static char __pyx_k_name[] = "name";
static char __pyx_k_ndim[] = "ndim";
static char __pyx_k_neww[] = "neww";
static char __pyx_k_next[] = "next";
static char __pyx_k_nobs[] = "nobs";
static char __pyx_k_oldw[] = "oldw";
static char __pyx_k_pack[] = "pack";
static char __pyx_k_prev[] = "prev";
static char __pyx_k_rank[] = "rank";
static char __pyx_k_resx[] = "resx";
static char __pyx_k_ring[] = "ring";
static char __pyx_k_rval[] = "rval";
static char __pyx_k_seen[] = "seen";
static char __pyx_k_self[] = "self";
static char __pyx_k_size[] = "size";
static char __pyx_k_sort[] = "sort";
static char __pyx_k_step[] = "step";
static char __pyx_k_stop[] = "stop";
static char __pyx_k_sumx[] = "sumx";
static char __pyx_k_sumy[] = "sumy";
static char __pyx_k_take[] = "take";
static char __pyx_k_test[] = "__test__";
static char __pyx_k_vecs[] = "vecs";
static char __pyx_k_view[] = "view";
static char __pyx_k_vlow[] = "vlow";
static char __pyx_k_xxxx[] = "xxxx";
static char __pyx_k_year[] = "year";
static char __pyx_k_array[] = "array";
static char __pyx_k_class[] = "__class__";
static char __pyx_k_count[] = "count";
static char __pyx_k_delta[] = "delta";
static char __pyx_k_dense[] = "dense";
static char __pyx_k_dtype[] = "dtype";
static char __pyx_k_empty[] = "empty";
static char __pyx_k_error[] = "error";
static char __pyx_k_first[] = "first";
static char __pyx_k_flags[] = "flags";
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_label[] = "label";
static char __pyx_k_limit[] = "limit";
static char __pyx_k_meanx[] = "meanx";
static char __pyx_k_meany[] = "meany";
static char __pyx_k_month[] = "month";
static char __pyx_k_nbins[] = "nbins";
static char __pyx_k_nleft[] = "nleft";
static char __pyx_k_numpy[] = "numpy";
static char __pyx_k_other[] = "other";
static char __pyx_k_prodx[] = "prodx";
static char __pyx_k_range[] = "range";
static char __pyx_k_ranks[] = "ranks";
static char __pyx_k_retry[] = "retry";
static char __pyx_k_right[] = "right";
static char __pyx_k_shape[] = "shape";
static char __pyx_k_split[] = "split";
static char __pyx_k_start[] = "start";
static char __pyx_k_strip[] = "strip";
static char __pyx_k_sum_x[] = "sum_x";
static char __pyx_k_sumxx[] = "sumxx";
static char __pyx_k_sumyy[] = "sumyy";
static char __pyx_k_uint8[] = "uint8";
static char __pyx_k_value[] = "value";
static char __pyx_k_vhigh[] = "vhigh";
static char __pyx_k_vopen[] = "vopen";
static char __pyx_k_where[] = "where";
static char __pyx_k_width[] = "width";
static char __pyx_k_win_i[] = "win_i";
static char __pyx_k_win_k[] = "win_k";
static char __pyx_k_win_n[] = "win_n";
static char __pyx_k_zeros[] = "zeros";
static char __pyx_k_adjust[] = "adjust";
static char __pyx_k_arange[] = "arange";
static char __pyx_k_astype[] = "astype";
static char __pyx_k_bufarr[] = "bufarr";
static char __pyx_k_counts[] = "counts";
static char __pyx_k_format[] = "format";
static char __pyx_k_import[] = "__import__";
static char __pyx_k_in_arr[] = "in_arr";
static char __pyx_k_insert[] = "insert";
static char __pyx_k_int8_t[] = "int8_t";
static char __pyx_k_kwargs[] = "kwargs";
static char __pyx_k_labels[] = "labels";
static char __pyx_k_lambda[] = "<lambda>";
static char __pyx_k_length[] = "length";
static char __pyx_k_mean_x[] = "mean_x";
static char __pyx_k_median[] = "median";
static char __pyx_k_minute[] = "minute";
static char __pyx_k_module[] = "__module__";
static char __pyx_k_name_2[] = "__name__";
static char __pyx_k_neg_ct[] = "neg_ct";
static char __pyx_k_nright[] = "nright";
static char __pyx_k_object[] = "object";
static char __pyx_k_offset[] = "offset";
static char __pyx_k_oldbuf[] = "oldbuf";
static char __pyx_k_output[] = "output";
static char __pyx_k_pandas[] = "pandas";
static char __pyx_k_random[] = "random";
static char __pyx_k_remove[] = "remove";
static char __pyx_k_result[] = "result";
static char __pyx_k_second[] = "second";
static char __pyx_k_sorter[] = "sorter";
static char __pyx_k_struct[] = "struct";
static char __pyx_k_unpack[] = "unpack";
static char __pyx_k_val_in[] = "val_in";
static char __pyx_k_values[] = "values";
static char __pyx_k_vclose[] = "vclose";
static char __pyx_k_window[] = "window";
static char __pyx_k_xrange[] = "xrange";
static char __pyx_k_argsort[] = "argsort";
static char __pyx_k_asarray[] = "asarray";
static char __pyx_k_average[] = "average";
static char __pyx_k_avg_wgt[] = "avg_wgt";
static char __pyx_k_divisor[] = "divisor";
static char __pyx_k_float16[] = "float16";
static char __pyx_k_float32[] = "float32";
static char __pyx_k_float64[] = "float64";
static char __pyx_k_fortran[] = "fortran";
static char __pyx_k_indexer[] = "indexer";
static char __pyx_k_int16_t[] = "int16_t";
static char __pyx_k_int32_t[] = "int32_t";
static char __pyx_k_int64_t[] = "int64_t";
static char __pyx_k_keep_na[] = "keep_na";
static char __pyx_k_maskedx[] = "maskedx";
static char __pyx_k_maskedy[] = "maskedy";
static char __pyx_k_members[] = "members";
static char __pyx_k_memview[] = "memview";
static char __pyx_k_minpair[] = "minpair";
static char __pyx_k_nancorr[] = "nancorr";
static char __pyx_k_ndarray[] = "ndarray";
static char __pyx_k_ngroups[] = "ngroups";
static char __pyx_k_nlevels[] = "nlevels";
static char __pyx_k_nonzero[] = "nonzero";
static char __pyx_k_periods[] = "periods";
static char __pyx_k_prepare[] = "__prepare__";
static char __pyx_k_putmask[] = "putmask";
static char __pyx_k_reverse[] = "reverse";
static char __pyx_k_ssqdm_x[] = "ssqdm_x";
static char __pyx_k_tot_wgt[] = "tot_wgt";
static char __pyx_k_uint8_t[] = "uint8_t";
static char __pyx_k_val_win[] = "val_win";
static char __pyx_k_weights[] = "weights";
static char __pyx_k_Ellipsis[] = "Ellipsis";
static char __pyx_k_Infinity[] = "Infinity";
static char __pyx_k_KeyError[] = "KeyError";
static char __pyx_k_counts_2[] = "_counts";
static char __pyx_k_datetime[] = "datetime";
static char __pyx_k_defaults[] = "defaults";
static char __pyx_k_isfinite[] = "isfinite";
static char __pyx_k_itemsize[] = "itemsize";
static char __pyx_k_last_obs[] = "last_obs";
static char __pyx_k_left_pos[] = "left_pos";
static char __pyx_k_lindexer[] = "lindexer";
static char __pyx_k_midpoint[] = "midpoint";
static char __pyx_k_object_2[] = "object_";
static char __pyx_k_pad_bool[] = "pad_bool";
static char __pyx_k_position[] = "position";
static char __pyx_k_qualname[] = "__qualname__";
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_skiplist[] = "skiplist";
static char __pyx_k_tiebreak[] = "tiebreak";
static char __pyx_k_uint16_t[] = "uint16_t";
static char __pyx_k_uint32_t[] = "uint32_t";
static char __pyx_k_uint64_t[] = "uint64_t";
static char __pyx_k_Not_Found[] = "Not Found";
static char __pyx_k_TypeError[] = "TypeError";
static char __pyx_k_argsorted[] = "argsorted";
static char __pyx_k_ascending[] = "ascending";
static char __pyx_k_enumerate[] = "enumerate";
static char __pyx_k_float32_t[] = "float32_t";
static char __pyx_k_float64_t[] = "float64_t";
static char __pyx_k_got_first[] = "got_first";
static char __pyx_k_group_ids[] = "group_ids";
static char __pyx_k_is_unique[] = "is_unique";
static char __pyx_k_isnullobj[] = "isnullobj";
static char __pyx_k_max_group[] = "max_group";
static char __pyx_k_mergesort[] = "mergesort";
static char __pyx_k_metaclass[] = "__metaclass__";
static char __pyx_k_na_option[] = "na_option";
static char __pyx_k_nan_value[] = "nan_value";
static char __pyx_k_ones_like[] = "ones_like";
static char __pyx_k_pad_int32[] = "pad_int32";
static char __pyx_k_pad_int64[] = "pad_int64";
static char __pyx_k_right_pos[] = "right_pos";
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_sum_ranks[] = "sum_ranks";
static char __pyx_k_IndexError[] = "IndexError";
static char __pyx_k_ValueError[] = "ValueError";
static char __pyx_k_check_minp[] = "_check_minp";
static char __pyx_k_empty_like[] = "empty_like";
static char __pyx_k_fill_count[] = "fill_count";
static char __pyx_k_fill_value[] = "fill_value";
static char __pyx_k_inner_join[] = "inner_join";
static char __pyx_k_left_count[] = "left_count";
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_pad_object[] = "pad_object";
static char __pyx_k_pandas_lib[] = "pandas.lib";
static char __pyx_k_pydatetime[] = "pydatetime";
static char __pyx_k_pyx_vtable[] = "__pyx_vtable__";
static char __pyx_k_signatures[] = "signatures";
static char __pyx_k_valid_locs[] = "valid_locs";
static char __pyx_k_zeros_like[] = "zeros_like";
static char __pyx_k_ImportError[] = "ImportError";
static char __pyx_k_MemoryError[] = "MemoryError";
static char __pyx_k_NegInfinity[] = "NegInfinity";
static char __pyx_k_arrmap_bool[] = "arrmap_bool";
static char __pyx_k_isnullobj2d[] = "isnullobj2d";
static char __pyx_k_left_sorter[] = "left_sorter";
static char __pyx_k_microsecond[] = "microsecond";
static char __pyx_k_pad_float32[] = "pad_float32";
static char __pyx_k_pad_float64[] = "pad_float64";
static char __pyx_k_return_true[] = "_return_true";
static char __pyx_k_right_count[] = "right_count";
static char __pyx_k_roll_window[] = "roll_window";
static char __pyx_k_sorted_data[] = "sorted_data";
static char __pyx_k_tiebreakers[] = "tiebreakers";
static char __pyx_k_ties_method[] = "ties_method";
static char __pyx_k_RuntimeError[] = "RuntimeError";
static char __pyx_k_arrmap_int32[] = "arrmap_int32";
static char __pyx_k_arrmap_int64[] = "arrmap_int64";
static char __pyx_k_c_contiguous[] = "c_contiguous";
static char __pyx_k_diff_2d_int8[] = "diff_2d_int8";
static char __pyx_k_f_contiguous[] = "f_contiguous";
static char __pyx_k_group_labels[] = "group_labels";
static char __pyx_k_group_median[] = "group_median";
static char __pyx_k_groupby_bool[] = "groupby_bool";
static char __pyx_k_is_lexsorted[] = "is_lexsorted";
static char __pyx_k_kth_smallest[] = "kth_smallest";
static char __pyx_k_left_indexer[] = "left_indexer";
static char __pyx_k_pandas_algos[] = "pandas.algos";
static char __pyx_k_return_false[] = "_return_false";
static char __pyx_k_right_sorter[] = "right_sorter";
static char __pyx_k_roll_generic[] = "roll_generic";
static char __pyx_k_arrmap_object[] = "arrmap_object";
static char __pyx_k_backfill_bool[] = "backfill_bool";
static char __pyx_k_diff_2d_int16[] = "diff_2d_int16";
static char __pyx_k_diff_2d_int32[] = "diff_2d_int32";
static char __pyx_k_diff_2d_int64[] = "diff_2d_int64";
static char __pyx_k_expected_size[] = "expected_size";
static char __pyx_k_ffill_indexer[] = "ffill_indexer";
static char __pyx_k_groupby_int32[] = "groupby_int32";
static char __pyx_k_groupby_int64[] = "groupby_int64";
static char __pyx_k_pyx_getbuffer[] = "__pyx_getbuffer";
static char __pyx_k_rank_1d_int64[] = "rank_1d_int64";
static char __pyx_k_rank_2d_int64[] = "rank_2d_int64";
static char __pyx_k_right_indexer[] = "right_indexer";
static char __pyx_k_roll_median_c[] = "roll_median_c";
static char __pyx_k_roll_quantile[] = "roll_quantile";
static char __pyx_k_AssertionError[] = "AssertionError";
static char __pyx_k_arrmap_float32[] = "arrmap_float32";
static char __pyx_k_arrmap_float64[] = "arrmap_float64";
static char __pyx_k_backfill_int32[] = "backfill_int32";
static char __pyx_k_backfill_int64[] = "backfill_int64";
static char __pyx_k_ffill_by_group[] = "ffill_by_group";
static char __pyx_k_groupby_object[] = "groupby_object";
static char __pyx_k_list_of_arrays[] = "list_of_arrays";
static char __pyx_k_allocate_buffer[] = "allocate_buffer";
static char __pyx_k_backfill_object[] = "backfill_object";
static char __pyx_k_diff_2d_float32[] = "diff_2d_float32";
static char __pyx_k_diff_2d_float64[] = "diff_2d_float64";
static char __pyx_k_dtype_is_object[] = "dtype_is_object";
static char __pyx_k_full_outer_join[] = "full_outer_join";
static char __pyx_k_groupby_float32[] = "groupby_float32";
static char __pyx_k_groupby_float64[] = "groupby_float64";
static char __pyx_k_groupby_indices[] = "groupby_indices";
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_total_tie_count[] = "total_tie_count";
static char __pyx_k_backfill_float32[] = "backfill_float32";
static char __pyx_k_backfill_float64[] = "backfill_float64";
static char __pyx_k_group_nth_object[] = "group_nth_object";
static char __pyx_k_nancorr_spearman[] = "nancorr_spearman";
static char __pyx_k_pad_inplace_bool[] = "pad_inplace_bool";
static char __pyx_k_pyx_fuse_0median[] = "__pyx_fuse_0median";
static char __pyx_k_pyx_fuse_1median[] = "__pyx_fuse_1median";
static char __pyx_k_pyx_fuse_2median[] = "__pyx_fuse_2median";
static char __pyx_k_pyx_fuse_3median[] = "__pyx_fuse_3median";
static char __pyx_k_pyx_fuse_4median[] = "__pyx_fuse_4median";
static char __pyx_k_pyx_fuse_5median[] = "__pyx_fuse_5median";
static char __pyx_k_pyx_fuse_6median[] = "__pyx_fuse_6median";
static char __pyx_k_pyx_fuse_7median[] = "__pyx_fuse_7median";
static char __pyx_k_pyx_fuse_8median[] = "__pyx_fuse_8median";
static char __pyx_k_pyx_fuse_9median[] = "__pyx_fuse_9median";
static char __pyx_k_Unable_to_parse_s[] = "Unable to parse %s";
static char __pyx_k_group_add_float32[] = "group_add_float32";
static char __pyx_k_group_add_float64[] = "group_add_float64";
static char __pyx_k_group_count_int64[] = "group_count_int64";
static char __pyx_k_group_last_object[] = "group_last_object";
static char __pyx_k_group_max_float32[] = "group_max_float32";
static char __pyx_k_group_max_float64[] = "group_max_float64";
static char __pyx_k_group_min_float32[] = "group_min_float32";
static char __pyx_k_group_min_float64[] = "group_min_float64";
static char __pyx_k_group_nth_float32[] = "group_nth_float32";
static char __pyx_k_group_nth_float64[] = "group_nth_float64";
static char __pyx_k_group_var_float32[] = "group_var_float32";
static char __pyx_k_group_var_float64[] = "group_var_float64";
static char __pyx_k_groupsort_indexer[] = "groupsort_indexer";
static char __pyx_k_is_monotonic_bool[] = "is_monotonic_bool";
static char __pyx_k_pad_inplace_int32[] = "pad_inplace_int32";
static char __pyx_k_pad_inplace_int64[] = "pad_inplace_int64";
static char __pyx_k_pyx_releasebuffer[] = "__pyx_releasebuffer";
static char __pyx_k_take_1d_bool_bool[] = "take_1d_bool_bool";
static char __pyx_k_take_1d_int8_int8[] = "take_1d_int8_int8";
static char __pyx_k_get_result_indexer[] = "_get_result_indexer";
static char __pyx_k_group_count_object[] = "group_count_object";
static char __pyx_k_group_last_float32[] = "group_last_float32";
static char __pyx_k_group_last_float64[] = "group_last_float64";
static char __pyx_k_group_mean_float32[] = "group_mean_float32";
static char __pyx_k_group_mean_float64[] = "group_mean_float64";
static char __pyx_k_group_ohlc_float32[] = "group_ohlc_float32";
static char __pyx_k_group_ohlc_float64[] = "group_ohlc_float64";
static char __pyx_k_group_prod_float32[] = "group_prod_float32";
static char __pyx_k_group_prod_float64[] = "group_prod_float64";
static char __pyx_k_is_monotonic_int32[] = "is_monotonic_int32";
static char __pyx_k_is_monotonic_int64[] = "is_monotonic_int64";
static char __pyx_k_pad_inplace_object[] = "pad_inplace_object";
static char __pyx_k_roll_median_cython[] = "roll_median_cython";
static char __pyx_k_strided_and_direct[] = "<strided and direct>";
static char __pyx_k_take_1d_int8_int32[] = "take_1d_int8_int32";
static char __pyx_k_take_1d_int8_int64[] = "take_1d_int8_int64";
static char __pyx_k_NotImplementedError[] = "NotImplementedError";
static char __pyx_k_group_count_float32[] = "group_count_float32";
static char __pyx_k_group_count_float64[] = "group_count_float64";
static char __pyx_k_index_out_of_bounds[] = "index out of bounds";
static char __pyx_k_is_monotonic_object[] = "is_monotonic_object";
static char __pyx_k_pad_2d_inplace_bool[] = "pad_2d_inplace_bool";
static char __pyx_k_pad_inplace_float32[] = "pad_inplace_float32";
static char __pyx_k_pad_inplace_float64[] = "pad_inplace_float64";
static char __pyx_k_pandas_src_join_pyx[] = "pandas/src/join.pyx";
static char __pyx_k_take_1d_bool_object[] = "take_1d_bool_object";
static char __pyx_k_take_1d_int16_int16[] = "take_1d_int16_int16";
static char __pyx_k_take_1d_int16_int32[] = "take_1d_int16_int32";
static char __pyx_k_take_1d_int16_int64[] = "take_1d_int16_int64";
static char __pyx_k_take_1d_int32_int32[] = "take_1d_int32_int32";
static char __pyx_k_take_1d_int32_int64[] = "take_1d_int32_int64";
static char __pyx_k_take_1d_int64_int64[] = "take_1d_int64_int64";
static char __pyx_k_group_nth_bin_object[] = "group_nth_bin_object";
static char __pyx_k_is_monotonic_float32[] = "is_monotonic_float32";
static char __pyx_k_is_monotonic_float64[] = "is_monotonic_float64";
static char __pyx_k_len_index_len_labels[] = "len(index) != len(labels)";
static char __pyx_k_pad_2d_inplace_int32[] = "pad_2d_inplace_int32";
static char __pyx_k_pad_2d_inplace_int64[] = "pad_2d_inplace_int64";
static char __pyx_k_strided_and_indirect[] = "<strided and indirect>";
static char __pyx_k_take_1d_int8_float64[] = "take_1d_int8_float64";
static char __pyx_k_Invalid_window_size_d[] = "Invalid window size %d";
static char __pyx_k_backfill_inplace_bool[] = "backfill_inplace_bool";
static char __pyx_k_contiguous_and_direct[] = "<contiguous and direct>";
static char __pyx_k_group_add_bin_float32[] = "group_add_bin_float32";
static char __pyx_k_group_add_bin_float64[] = "group_add_bin_float64";
static char __pyx_k_group_count_bin_int64[] = "group_count_bin_int64";
static char __pyx_k_group_last_bin_object[] = "group_last_bin_object";
static char __pyx_k_group_max_bin_float32[] = "group_max_bin_float32";
static char __pyx_k_group_max_bin_float64[] = "group_max_bin_float64";
static char __pyx_k_group_min_bin_float32[] = "group_min_bin_float32";
static char __pyx_k_group_min_bin_float64[] = "group_min_bin_float64";
static char __pyx_k_group_nth_bin_float32[] = "group_nth_bin_float32";
static char __pyx_k_group_nth_bin_float64[] = "group_nth_bin_float64";
static char __pyx_k_group_var_bin_float32[] = "group_var_bin_float32";
static char __pyx_k_group_var_bin_float64[] = "group_var_bin_float64";
static char __pyx_k_maybe_convert_objects[] = "maybe_convert_objects";
static char __pyx_k_min_periods_must_be_0[] = "min_periods must be >= 0";
static char __pyx_k_pad_2d_inplace_object[] = "pad_2d_inplace_object";
static char __pyx_k_take_1d_int16_float64[] = "take_1d_int16_float64";
static char __pyx_k_take_1d_int32_float64[] = "take_1d_int32_float64";
static char __pyx_k_take_1d_int64_float64[] = "take_1d_int64_float64";
static char __pyx_k_take_1d_object_object[] = "take_1d_object_object";
static char __pyx_k_MemoryView_of_r_object[] = "<MemoryView of %r object>";
static char __pyx_k_backfill_inplace_int32[] = "backfill_inplace_int32";
static char __pyx_k_backfill_inplace_int64[] = "backfill_inplace_int64";
static char __pyx_k_group_count_bin_object[] = "group_count_bin_object";
static char __pyx_k_group_last_bin_float32[] = "group_last_bin_float32";
static char __pyx_k_group_last_bin_float64[] = "group_last_bin_float64";
static char __pyx_k_group_mean_bin_float32[] = "group_mean_bin_float32";
static char __pyx_k_group_mean_bin_float64[] = "group_mean_bin_float64";
static char __pyx_k_group_prod_bin_float32[] = "group_prod_bin_float32";
static char __pyx_k_group_prod_bin_float64[] = "group_prod_bin_float64";
static char __pyx_k_pad_2d_inplace_float32[] = "pad_2d_inplace_float32";
static char __pyx_k_pad_2d_inplace_float64[] = "pad_2d_inplace_float64";
static char __pyx_k_pyx_fuse_0kth_smallest[] = "__pyx_fuse_0kth_smallest";
static char __pyx_k_pyx_fuse_1kth_smallest[] = "__pyx_fuse_1kth_smallest";
static char __pyx_k_pyx_fuse_2kth_smallest[] = "__pyx_fuse_2kth_smallest";
static char __pyx_k_pyx_fuse_3kth_smallest[] = "__pyx_fuse_3kth_smallest";
static char __pyx_k_pyx_fuse_4kth_smallest[] = "__pyx_fuse_4kth_smallest";
static char __pyx_k_pyx_fuse_5kth_smallest[] = "__pyx_fuse_5kth_smallest";
static char __pyx_k_pyx_fuse_6kth_smallest[] = "__pyx_fuse_6kth_smallest";
static char __pyx_k_pyx_fuse_7kth_smallest[] = "__pyx_fuse_7kth_smallest";
static char __pyx_k_pyx_fuse_8kth_smallest[] = "__pyx_fuse_8kth_smallest";
static char __pyx_k_pyx_fuse_9kth_smallest[] = "__pyx_fuse_9kth_smallest";
static char __pyx_k_MemoryView_of_r_at_0x_x[] = "<MemoryView of %r at 0x%x>";
static char __pyx_k_backfill_inplace_object[] = "backfill_inplace_object";
static char __pyx_k_contiguous_and_indirect[] = "<contiguous and indirect>";
static char __pyx_k_group_count_bin_float32[] = "group_count_bin_float32";
static char __pyx_k_group_count_bin_float64[] = "group_count_bin_float64";
static char __pyx_k_left_join_indexer_int32[] = "left_join_indexer_int32";
static char __pyx_k_left_join_indexer_int64[] = "left_join_indexer_int64";
static char __pyx_k_take_1d_float32_float32[] = "take_1d_float32_float32";
static char __pyx_k_take_1d_float32_float64[] = "take_1d_float32_float64";
static char __pyx_k_take_1d_float64_float64[] = "take_1d_float64_float64";
static char __pyx_k_take_2d_axis0_bool_bool[] = "take_2d_axis0_bool_bool";
static char __pyx_k_take_2d_axis0_int8_int8[] = "take_2d_axis0_int8_int8";
static char __pyx_k_take_2d_axis1_bool_bool[] = "take_2d_axis1_bool_bool";
static char __pyx_k_take_2d_axis1_int8_int8[] = "take_2d_axis1_int8_int8";
static char __pyx_k_take_2d_multi_bool_bool[] = "take_2d_multi_bool_bool";
static char __pyx_k_take_2d_multi_int8_int8[] = "take_2d_multi_int8_int8";
static char __pyx_k_Cannot_index_with_type_s[] = "Cannot index with type '%s'";
static char __pyx_k_backfill_2d_inplace_bool[] = "backfill_2d_inplace_bool";
static char __pyx_k_backfill_inplace_float32[] = "backfill_inplace_float32";
static char __pyx_k_backfill_inplace_float64[] = "backfill_inplace_float64";
static char __pyx_k_getbuffer_obj_view_flags[] = "getbuffer(obj, view, flags)";
static char __pyx_k_inner_join_indexer_int32[] = "inner_join_indexer_int32";
static char __pyx_k_inner_join_indexer_int64[] = "inner_join_indexer_int64";
static char __pyx_k_left_join_indexer_object[] = "left_join_indexer_object";
static char __pyx_k_outer_join_indexer_int32[] = "outer_join_indexer_int32";
static char __pyx_k_outer_join_indexer_int64[] = "outer_join_indexer_int64";
static char __pyx_k_pandas_src_generated_pyx[] = "pandas/src/generated.pyx";
static char __pyx_k_take_2d_axis0_int8_int32[] = "take_2d_axis0_int8_int32";
static char __pyx_k_take_2d_axis0_int8_int64[] = "take_2d_axis0_int8_int64";
static char __pyx_k_take_2d_axis1_int8_int32[] = "take_2d_axis1_int8_int32";
static char __pyx_k_take_2d_axis1_int8_int64[] = "take_2d_axis1_int8_int64";
static char __pyx_k_take_2d_multi_int8_int32[] = "take_2d_multi_int8_int32";
static char __pyx_k_take_2d_multi_int8_int64[] = "take_2d_multi_int8_int64";
static char __pyx_k_Dimension_d_is_not_direct[] = "Dimension %d is not direct";
static char __pyx_k_Invalid_shape_in_axis_d_d[] = "Invalid shape in axis %d: %d.";
static char __pyx_k_backfill_2d_inplace_int32[] = "backfill_2d_inplace_int32";
static char __pyx_k_backfill_2d_inplace_int64[] = "backfill_2d_inplace_int64";
static char __pyx_k_inner_join_indexer_object[] = "inner_join_indexer_object";
static char __pyx_k_left_join_indexer_float32[] = "left_join_indexer_float32";
static char __pyx_k_left_join_indexer_float64[] = "left_join_indexer_float64";
static char __pyx_k_outer_join_indexer_object[] = "outer_join_indexer_object";
static char __pyx_k_take_2d_axis0_bool_object[] = "take_2d_axis0_bool_object";
static char __pyx_k_take_2d_axis0_int16_int16[] = "take_2d_axis0_int16_int16";
static char __pyx_k_take_2d_axis0_int16_int32[] = "take_2d_axis0_int16_int32";
static char __pyx_k_take_2d_axis0_int16_int64[] = "take_2d_axis0_int16_int64";
static char __pyx_k_take_2d_axis0_int32_int32[] = "take_2d_axis0_int32_int32";
static char __pyx_k_take_2d_axis0_int32_int64[] = "take_2d_axis0_int32_int64";
static char __pyx_k_take_2d_axis0_int64_int64[] = "take_2d_axis0_int64_int64";
static char __pyx_k_take_2d_axis1_bool_object[] = "take_2d_axis1_bool_object";
static char __pyx_k_take_2d_axis1_int16_int16[] = "take_2d_axis1_int16_int16";
static char __pyx_k_take_2d_axis1_int16_int32[] = "take_2d_axis1_int16_int32";
static char __pyx_k_take_2d_axis1_int16_int64[] = "take_2d_axis1_int16_int64";
static char __pyx_k_take_2d_axis1_int32_int32[] = "take_2d_axis1_int32_int32";
static char __pyx_k_take_2d_axis1_int32_int64[] = "take_2d_axis1_int32_int64";
static char __pyx_k_take_2d_axis1_int64_int64[] = "take_2d_axis1_int64_int64";
static char __pyx_k_take_2d_multi_bool_object[] = "take_2d_multi_bool_object";
static char __pyx_k_take_2d_multi_int16_int16[] = "take_2d_multi_int16_int16";
static char __pyx_k_take_2d_multi_int16_int32[] = "take_2d_multi_int16_int32";
static char __pyx_k_take_2d_multi_int16_int64[] = "take_2d_multi_int16_int64";
static char __pyx_k_take_2d_multi_int32_int32[] = "take_2d_multi_int32_int32";
static char __pyx_k_take_2d_multi_int32_int64[] = "take_2d_multi_int32_int64";
static char __pyx_k_take_2d_multi_int64_int64[] = "take_2d_multi_int64_int64";
static char __pyx_k_Index_out_of_bounds_axis_d[] = "Index out of bounds (axis %d)";
static char __pyx_k_Limit_must_be_non_negative[] = "Limit must be non-negative";
static char __pyx_k_backfill_2d_inplace_object[] = "backfill_2d_inplace_object";
static char __pyx_k_inner_join_indexer_float32[] = "inner_join_indexer_float32";
static char __pyx_k_inner_join_indexer_float64[] = "inner_join_indexer_float64";
static char __pyx_k_outer_join_indexer_float32[] = "outer_join_indexer_float32";
static char __pyx_k_outer_join_indexer_float64[] = "outer_join_indexer_float64";
static char __pyx_k_take_2d_axis0_int8_float64[] = "take_2d_axis0_int8_float64";
static char __pyx_k_take_2d_axis1_int8_float64[] = "take_2d_axis1_int8_float64";
static char __pyx_k_take_2d_multi_int8_float64[] = "take_2d_multi_int8_float64";
static char __pyx_k_No_matching_signature_found[] = "No matching signature found";
static char __pyx_k_Step_may_not_be_zero_axis_d[] = "Step may not be zero (axis %d)";
static char __pyx_k_backfill_2d_inplace_float32[] = "backfill_2d_inplace_float32";
static char __pyx_k_backfill_2d_inplace_float64[] = "backfill_2d_inplace_float64";
static char __pyx_k_itemsize_0_for_cython_array[] = "itemsize <= 0 for cython.array";
static char __pyx_k_ndarray_is_not_C_contiguous[] = "ndarray is not C contiguous";
static char __pyx_k_take_2d_axis0_int16_float64[] = "take_2d_axis0_int16_float64";
static char __pyx_k_take_2d_axis0_int32_float64[] = "take_2d_axis0_int32_float64";
static char __pyx_k_take_2d_axis0_int64_float64[] = "take_2d_axis0_int64_float64";
static char __pyx_k_take_2d_axis0_object_object[] = "take_2d_axis0_object_object";
static char __pyx_k_take_2d_axis1_int16_float64[] = "take_2d_axis1_int16_float64";
static char __pyx_k_take_2d_axis1_int32_float64[] = "take_2d_axis1_int32_float64";
static char __pyx_k_take_2d_axis1_int64_float64[] = "take_2d_axis1_int64_float64";
static char __pyx_k_take_2d_axis1_object_object[] = "take_2d_axis1_object_object";
static char __pyx_k_take_2d_multi_int16_float64[] = "take_2d_multi_int16_float64";
static char __pyx_k_take_2d_multi_int32_float64[] = "take_2d_multi_int32_float64";
static char __pyx_k_take_2d_multi_int64_float64[] = "take_2d_multi_int64_float64";
static char __pyx_k_take_2d_multi_object_object[] = "take_2d_multi_object_object";
static char __pyx_k_Expected_at_least_d_arguments[] = "Expected at least %d arguments";
static char __pyx_k_take_2d_axis0_float32_float32[] = "take_2d_axis0_float32_float32";
static char __pyx_k_take_2d_axis0_float32_float64[] = "take_2d_axis0_float32_float64";
static char __pyx_k_take_2d_axis0_float64_float64[] = "take_2d_axis0_float64_float64";
static char __pyx_k_take_2d_axis1_float32_float32[] = "take_2d_axis1_float32_float32";
static char __pyx_k_take_2d_axis1_float32_float64[] = "take_2d_axis1_float32_float64";
static char __pyx_k_take_2d_axis1_float64_float64[] = "take_2d_axis1_float64_float64";
static char __pyx_k_take_2d_multi_float32_float32[] = "take_2d_multi_float32_float32";
static char __pyx_k_take_2d_multi_float32_float64[] = "take_2d_multi_float32_float64";
static char __pyx_k_take_2d_multi_float64_float64[] = "take_2d_multi_float64_float64";
static char __pyx_k_unable_to_allocate_array_data[] = "unable to allocate array data.";
static char __pyx_k_left_join_indexer_unique_int32[] = "left_join_indexer_unique_int32";
static char __pyx_k_left_join_indexer_unique_int64[] = "left_join_indexer_unique_int64";
static char __pyx_k_min_periods_d_must_be_window_d[] = "min_periods (%d) must be <= window (%d)";
static char __pyx_k_strided_and_direct_or_indirect[] = "<strided and direct or indirect>";
static char __pyx_k_home_yoh_deb_gits_pkg_exppsy_pa[] = "/home/yoh/deb/gits/pkg-exppsy/pandas/pandas/algos.pyx";
static char __pyx_k_left_join_indexer_unique_object[] = "left_join_indexer_unique_object";
static char __pyx_k_unknown_dtype_code_in_numpy_pxd[] = "unknown dtype code in numpy.pxd (%d)";
static char __pyx_k_All_dimensions_preceding_dimensi[] = "All dimensions preceding dimension %d must be indexed and not sliced";
static char __pyx_k_Buffer_view_does_not_expose_stri[] = "Buffer view does not expose strides";
static char __pyx_k_Can_only_create_a_buffer_that_is[] = "Can only create a buffer that is contiguous in memory.";
static char __pyx_k_Cannot_transpose_memoryview_with[] = "Cannot transpose memoryview with indirect dimensions";
static char __pyx_k_Empty_shape_tuple_for_cython_arr[] = "Empty shape tuple for cython.array";
static char __pyx_k_Format_string_allocated_too_shor[] = "Format string allocated too short, see comment in numpy.pxd";
static char __pyx_k_Function_call_with_ambiguous_arg[] = "Function call with ambiguous argument types";
static char __pyx_k_Indirect_dimensions_not_supporte[] = "Indirect dimensions not supported";
static char __pyx_k_Invalid_min_periods_size_d_great[] = "Invalid min_periods size %d greater than window %d";
static char __pyx_k_Invalid_mode_expected_c_or_fortr[] = "Invalid mode, expected 'c' or 'fortran', got %s";
static char __pyx_k_Non_native_byte_order_not_suppor[] = "Non-native byte order not supported";
static char __pyx_k_Out_of_bounds_on_buffer_access_a[] = "Out of bounds on buffer access (axis %d)";
static char __pyx_k_Output_array_must_have_4_columns[] = "Output array must have 4 columns";
static char __pyx_k_Unable_to_convert_item_to_object[] = "Unable to convert item to object";
static char __pyx_k_first_not_supported_for_non_nume[] = "first not supported for non-numeric data";
static char __pyx_k_got_differing_extents_in_dimensi[] = "got differing extents in dimension %d (got %d and %d)";
static char __pyx_k_left_join_indexer_unique_float32[] = "left_join_indexer_unique_float32";
static char __pyx_k_left_join_indexer_unique_float64[] = "left_join_indexer_unique_float64";
static char __pyx_k_ndarray_is_not_Fortran_contiguou[] = "ndarray is not Fortran contiguous";
static char __pyx_k_unable_to_allocate_shape_and_str[] = "unable to allocate shape and strides.";
static char __pyx_k_Format_string_allocated_too_shor_2[] = "Format string allocated too short.";
static PyObject *__pyx_n_s_A;
static PyObject *__pyx_n_s_AssertionError;
static PyObject *__pyx_n_s_B;
static PyObject *__pyx_kp_s_Buffer_view_does_not_expose_stri;
static PyObject *__pyx_n_s_C;
static PyObject *__pyx_kp_s_Can_only_create_a_buffer_that_is;
static PyObject *__pyx_kp_s_Cannot_index_with_type_s;
static PyObject *__pyx_n_s_D;
static PyObject *__pyx_n_s_Ellipsis;
static PyObject *__pyx_kp_s_Empty_shape_tuple_for_cython_arr;
static PyObject *__pyx_kp_s_Expected_at_least_d_arguments;
static PyObject *__pyx_kp_u_Format_string_allocated_too_shor;
static PyObject *__pyx_kp_u_Format_string_allocated_too_shor_2;
static PyObject *__pyx_kp_s_Function_call_with_ambiguous_arg;
static PyObject *__pyx_n_s_ImportError;
static PyObject *__pyx_n_s_IndexError;
static PyObject *__pyx_kp_s_Indirect_dimensions_not_supporte;
static PyObject *__pyx_n_s_Infinity;
static PyObject *__pyx_kp_s_Invalid_min_periods_size_d_great;
static PyObject *__pyx_kp_s_Invalid_mode_expected_c_or_fortr;
static PyObject *__pyx_kp_s_Invalid_shape_in_axis_d_d;
static PyObject *__pyx_kp_s_Invalid_window_size_d;
static PyObject *__pyx_n_s_K;
static PyObject *__pyx_n_s_KeyError;
static PyObject *__pyx_kp_s_Limit_must_be_non_negative;
static PyObject *__pyx_n_s_MemoryError;
static PyObject *__pyx_kp_s_MemoryView_of_r_at_0x_x;
static PyObject *__pyx_kp_s_MemoryView_of_r_object;
static PyObject *__pyx_n_s_N;
static PyObject *__pyx_n_s_NA;
static PyObject *__pyx_n_s_NIL;
static PyObject *__pyx_n_s_NINF;
static PyObject *__pyx_n_s_NaN;
static PyObject *__pyx_n_s_NegInfinity;
static PyObject *__pyx_kp_s_No_matching_signature_found;
static PyObject *__pyx_kp_u_Non_native_byte_order_not_suppor;
static PyObject *__pyx_n_s_NotImplementedError;
static PyObject *__pyx_kp_s_Not_Found;
static PyObject *__pyx_n_b_O;
static PyObject *__pyx_n_s_O;
static PyObject *__pyx_kp_s_Out_of_bounds_on_buffer_access_a;
static PyObject *__pyx_kp_s_Output_array_must_have_4_columns;
static PyObject *__pyx_n_s_R;
static PyObject *__pyx_n_s_RuntimeError;
static PyObject *__pyx_n_s_S;
static PyObject *__pyx_n_s_T;
static PyObject *__pyx_n_s_TypeError;
static PyObject *__pyx_kp_s_Unable_to_convert_item_to_object;
static PyObject *__pyx_kp_s_Unable_to_parse_s;
static PyObject *__pyx_n_s_ValueError;
static PyObject *__pyx_kp_s__32;
static PyObject *__pyx_kp_s__34;
static PyObject *__pyx_n_s_a;
static PyObject *__pyx_n_s_adj;
static PyObject *__pyx_n_s_adjust;
static PyObject *__pyx_n_s_ai;
static PyObject *__pyx_n_s_allocate_buffer;
static PyObject *__pyx_n_s_aold;
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_argsorted;
static PyObject *__pyx_n_s_arr;
static PyObject *__pyx_n_s_array;
static PyObject *__pyx_n_s_arrmap_bool;
static PyObject *__pyx_n_s_arrmap_float32;
static PyObject *__pyx_n_s_arrmap_float64;
static PyObject *__pyx_n_s_arrmap_int32;
static PyObject *__pyx_n_s_arrmap_int64;
static PyObject *__pyx_n_s_arrmap_object;
static PyObject *__pyx_n_s_as;
static PyObject *__pyx_n_s_asarray;
static PyObject *__pyx_n_s_ascending;
static PyObject *__pyx_n_s_astype;
static PyObject *__pyx_n_s_average;
static PyObject *__pyx_n_s_avg;
static PyObject *__pyx_n_s_avg_wgt;
static PyObject *__pyx_n_s_axis;
static PyObject *__pyx_n_s_b;
static PyObject *__pyx_n_s_backfill_2d_inplace_bool;
static PyObject *__pyx_n_s_backfill_2d_inplace_float32;
static PyObject *__pyx_n_s_backfill_2d_inplace_float64;
static PyObject *__pyx_n_s_backfill_2d_inplace_int32;
static PyObject *__pyx_n_s_backfill_2d_inplace_int64;
static PyObject *__pyx_n_s_backfill_2d_inplace_object;
static PyObject *__pyx_n_s_backfill_bool;
static PyObject *__pyx_n_s_backfill_float32;
static PyObject *__pyx_n_s_backfill_float64;
static PyObject *__pyx_n_s_backfill_inplace_bool;
static PyObject *__pyx_n_s_backfill_inplace_float32;
static PyObject *__pyx_n_s_backfill_inplace_float64;
static PyObject *__pyx_n_s_backfill_inplace_int32;
static PyObject *__pyx_n_s_backfill_inplace_int64;
static PyObject *__pyx_n_s_backfill_inplace_object;
static PyObject *__pyx_n_s_backfill_int32;
static PyObject *__pyx_n_s_backfill_int64;
static PyObject *__pyx_n_s_backfill_object;
static PyObject *__pyx_n_s_base;
static PyObject *__pyx_n_s_bins;
static PyObject *__pyx_n_s_buf;
static PyObject *__pyx_n_s_bufarr;
static PyObject *__pyx_n_s_c;
static PyObject *__pyx_n_u_c;
static PyObject *__pyx_n_s_c_contiguous;
static PyObject *__pyx_n_s_check_minp;
static PyObject *__pyx_n_s_class;
static PyObject *__pyx_n_s_cmp;
static PyObject *__pyx_n_s_com;
static PyObject *__pyx_kp_s_contiguous_and_direct;
static PyObject *__pyx_kp_s_contiguous_and_indirect;
static PyObject *__pyx_n_s_copy;
static PyObject *__pyx_n_s_count;
static PyObject *__pyx_n_s_counts;
static PyObject *__pyx_n_s_counts_2;
static PyObject *__pyx_n_s_cov;
static PyObject *__pyx_n_s_ct;
static PyObject *__pyx_n_s_cur;
static PyObject *__pyx_n_s_data;
static PyObject *__pyx_n_s_datetime;
static PyObject *__pyx_n_s_day;
static PyObject *__pyx_n_s_ddof;
static PyObject *__pyx_n_s_defaults;
static PyObject *__pyx_n_s_delta;
static PyObject *__pyx_n_s_dense;
static PyObject *__pyx_n_s_diff_2d_float32;
static PyObject *__pyx_n_s_diff_2d_float64;
static PyObject *__pyx_n_s_diff_2d_int16;
static PyObject *__pyx_n_s_diff_2d_int32;
static PyObject *__pyx_n_s_diff_2d_int64;
static PyObject *__pyx_n_s_diff_2d_int8;
static PyObject *__pyx_n_s_dim;
static PyObject *__pyx_n_s_dims;
static PyObject *__pyx_n_s_divisor;
static PyObject *__pyx_n_s_doc;
static PyObject *__pyx_n_s_dtype;
static PyObject *__pyx_n_s_dtype_is_object;
static PyObject *__pyx_n_s_dups;
static PyObject *__pyx_n_s_e;
static PyObject *__pyx_n_s_empty;
static PyObject *__pyx_n_s_empty_like;
static PyObject *__pyx_n_s_end;
static PyObject *__pyx_n_s_enumerate;
static PyObject *__pyx_n_s_eq;
static PyObject *__pyx_n_s_error;
static PyObject *__pyx_n_s_ewma;
static PyObject *__pyx_n_s_expected_size;
static PyObject *__pyx_n_s_f;
static PyObject *__pyx_n_s_f8;
static PyObject *__pyx_n_s_f_contiguous;
static PyObject *__pyx_n_s_ffill_by_group;
static PyObject *__pyx_n_s_ffill_indexer;
static PyObject *__pyx_n_s_fill;
static PyObject *__pyx_n_s_fill_count;
static PyObject *__pyx_n_s_fill_value;
static PyObject *__pyx_n_s_first;
static PyObject *__pyx_kp_s_first_not_supported_for_non_nume;
static PyObject *__pyx_n_s_flags;
static PyObject *__pyx_n_s_float16;
static PyObject *__pyx_n_s_float32;
static PyObject *__pyx_n_s_float32_t;
static PyObject *__pyx_n_s_float64;
static PyObject *__pyx_n_s_float64_t;
static PyObject *__pyx_n_s_format;
static PyObject *__pyx_n_s_fortran;
static PyObject *__pyx_n_u_fortran;
static PyObject *__pyx_n_s_full_outer_join;
static PyObject *__pyx_n_s_func;
static PyObject *__pyx_n_s_fv;
static PyObject *__pyx_n_s_ge;
static PyObject *__pyx_n_s_get;
static PyObject *__pyx_n_s_get_result_indexer;
static PyObject *__pyx_n_s_gid;
static PyObject *__pyx_kp_s_got_differing_extents_in_dimensi;
static PyObject *__pyx_n_s_got_first;
static PyObject *__pyx_n_s_group_add_bin_float32;
static PyObject *__pyx_n_s_group_add_bin_float64;
static PyObject *__pyx_n_s_group_add_float32;
static PyObject *__pyx_n_s_group_add_float64;
static PyObject *__pyx_n_s_group_count_bin_float32;
static PyObject *__pyx_n_s_group_count_bin_float64;
static PyObject *__pyx_n_s_group_count_bin_int64;
static PyObject *__pyx_n_s_group_count_bin_object;
static PyObject *__pyx_n_s_group_count_float32;
static PyObject *__pyx_n_s_group_count_float64;
static PyObject *__pyx_n_s_group_count_int64;
static PyObject *__pyx_n_s_group_count_object;
static PyObject *__pyx_n_s_group_ids;
static PyObject *__pyx_n_s_group_labels;
static PyObject *__pyx_n_s_group_last_bin_float32;
static PyObject *__pyx_n_s_group_last_bin_float64;
static PyObject *__pyx_n_s_group_last_bin_object;
static PyObject *__pyx_n_s_group_last_float32;
static PyObject *__pyx_n_s_group_last_float64;
static PyObject *__pyx_n_s_group_last_object;
static PyObject *__pyx_n_s_group_max_bin_float32;
static PyObject *__pyx_n_s_group_max_bin_float64;
static PyObject *__pyx_n_s_group_max_float32;
static PyObject *__pyx_n_s_group_max_float64;
static PyObject *__pyx_n_s_group_mean_bin_float32;
static PyObject *__pyx_n_s_group_mean_bin_float64;
static PyObject *__pyx_n_s_group_mean_float32;
static PyObject *__pyx_n_s_group_mean_float64;
static PyObject *__pyx_n_s_group_median;
static PyObject *__pyx_n_s_group_min_bin_float32;
static PyObject *__pyx_n_s_group_min_bin_float64;
static PyObject *__pyx_n_s_group_min_float32;
static PyObject *__pyx_n_s_group_min_float64;
static PyObject *__pyx_n_s_group_nth_bin_float32;
static PyObject *__pyx_n_s_group_nth_bin_float64;
static PyObject *__pyx_n_s_group_nth_bin_object;
static PyObject *__pyx_n_s_group_nth_float32;
static PyObject *__pyx_n_s_group_nth_float64;
static PyObject *__pyx_n_s_group_nth_object;
static PyObject *__pyx_n_s_group_ohlc_float32;
static PyObject *__pyx_n_s_group_ohlc_float64;
static PyObject *__pyx_n_s_group_prod_bin_float32;
static PyObject *__pyx_n_s_group_prod_bin_float64;
static PyObject *__pyx_n_s_group_prod_float32;
static PyObject *__pyx_n_s_group_prod_float64;
static PyObject *__pyx_n_s_group_var_bin_float32;
static PyObject *__pyx_n_s_group_var_bin_float64;
static PyObject *__pyx_n_s_group_var_float32;
static PyObject *__pyx_n_s_group_var_float64;
static PyObject *__pyx_n_s_groupby_bool;
static PyObject *__pyx_n_s_groupby_float32;
static PyObject *__pyx_n_s_groupby_float64;
static PyObject *__pyx_n_s_groupby_indices;
static PyObject *__pyx_n_s_groupby_int32;
static PyObject *__pyx_n_s_groupby_int64;
static PyObject *__pyx_n_s_groupby_object;
static PyObject *__pyx_n_s_groupsort_indexer;
static PyObject *__pyx_n_s_gt;
static PyObject *__pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa;
static PyObject *__pyx_n_s_hour;
static PyObject *__pyx_n_s_i;
static PyObject *__pyx_n_s_i0;
static PyObject *__pyx_n_s_i8;
static PyObject *__pyx_n_s_id;
static PyObject *__pyx_n_s_ids;
static PyObject *__pyx_n_s_idx;
static PyObject *__pyx_n_s_idx0;
static PyObject *__pyx_n_s_idx1;
static PyObject *__pyx_n_s_iinfo;
static PyObject *__pyx_n_s_import;
static PyObject *__pyx_n_s_in_arr;
static PyObject *__pyx_n_s_in_i;
static PyObject *__pyx_n_s_in_k;
static PyObject *__pyx_n_s_in_n;
static PyObject *__pyx_n_s_index;
static PyObject *__pyx_kp_s_index_out_of_bounds;
static PyObject *__pyx_n_s_indexer;
static PyObject *__pyx_n_s_inf;
static PyObject *__pyx_n_s_infs;
static PyObject *__pyx_n_s_inner_join;
static PyObject *__pyx_n_s_inner_join_indexer_float32;
static PyObject *__pyx_n_s_inner_join_indexer_float64;
static PyObject *__pyx_n_s_inner_join_indexer_int32;
static PyObject *__pyx_n_s_inner_join_indexer_int64;
static PyObject *__pyx_n_s_inner_join_indexer_object;
static PyObject *__pyx_n_s_input;
static PyObject *__pyx_n_s_insert;
static PyObject *__pyx_n_s_int;
static PyObject *__pyx_n_s_int16;
static PyObject *__pyx_n_s_int16_t;
static PyObject *__pyx_n_s_int32;
static PyObject *__pyx_n_s_int32_t;
static PyObject *__pyx_n_s_int64;
static PyObject *__pyx_n_s_int64_t;
static PyObject *__pyx_n_s_int8;
static PyObject *__pyx_n_s_int8_t;
static PyObject *__pyx_n_s_is_lexsorted;
static PyObject *__pyx_n_s_is_monotonic_bool;
static PyObject *__pyx_n_s_is_monotonic_float32;
static PyObject *__pyx_n_s_is_monotonic_float64;
static PyObject *__pyx_n_s_is_monotonic_int32;
static PyObject *__pyx_n_s_is_monotonic_int64;
static PyObject *__pyx_n_s_is_monotonic_object;
static PyObject *__pyx_n_s_is_unique;
static PyObject *__pyx_n_s_isfinite;
static PyObject *__pyx_n_s_isnan;
static PyObject *__pyx_n_s_isnullobj;
static PyObject *__pyx_n_s_isnullobj2d;
static PyObject *__pyx_n_s_itemsize;
static PyObject *__pyx_kp_s_itemsize_0_for_cython_array;
static PyObject *__pyx_n_s_j;
static PyObject *__pyx_n_s_k;
static PyObject *__pyx_n_s_keep;
static PyObject *__pyx_n_s_keep_na;
static PyObject *__pyx_n_s_key;
static PyObject *__pyx_n_s_kind;
static PyObject *__pyx_n_s_kth_smallest;
static PyObject *__pyx_n_s_kwargs;
static PyObject *__pyx_n_s_lab;
static PyObject *__pyx_n_s_label;
static PyObject *__pyx_n_s_labels;
static PyObject *__pyx_n_s_lambda;
static PyObject *__pyx_n_s_last;
static PyObject *__pyx_n_s_last_obs;
static PyObject *__pyx_n_s_lc;
static PyObject *__pyx_n_s_le;
static PyObject *__pyx_n_s_left;
static PyObject *__pyx_n_s_left_count;
static PyObject *__pyx_n_s_left_indexer;
static PyObject *__pyx_n_s_left_join_indexer_float32;
static PyObject *__pyx_n_s_left_join_indexer_float64;
static PyObject *__pyx_n_s_left_join_indexer_int32;
static PyObject *__pyx_n_s_left_join_indexer_int64;
static PyObject *__pyx_n_s_left_join_indexer_object;
static PyObject *__pyx_n_s_left_join_indexer_unique_float32;
static PyObject *__pyx_n_s_left_join_indexer_unique_float64;
static PyObject *__pyx_n_s_left_join_indexer_unique_int32;
static PyObject *__pyx_n_s_left_join_indexer_unique_int64;
static PyObject *__pyx_n_s_left_join_indexer_unique_object;
static PyObject *__pyx_n_s_left_outer_join;
static PyObject *__pyx_n_s_left_pos;
static PyObject *__pyx_n_s_left_sorter;
static PyObject *__pyx_kp_s_len_index_len_labels;
static PyObject *__pyx_n_s_length;
static PyObject *__pyx_n_s_lib;
static PyObject *__pyx_n_s_lim;
static PyObject *__pyx_n_s_limit;
static PyObject *__pyx_n_s_lindexer;
static PyObject *__pyx_n_s_list_of_arrays;
static PyObject *__pyx_n_s_loc;
static PyObject *__pyx_n_s_lt;
static PyObject *__pyx_n_s_lval;
static PyObject *__pyx_n_s_m;
static PyObject *__pyx_n_s_main;
static PyObject *__pyx_n_s_mask;
static PyObject *__pyx_n_s_maskedx;
static PyObject *__pyx_n_s_maskedy;
static PyObject *__pyx_n_s_mat;
static PyObject *__pyx_n_s_max;
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_maxx;
static PyObject *__pyx_n_s_maybe_convert_objects;
static PyObject *__pyx_n_s_mean;
static PyObject *__pyx_n_s_mean_x;
static PyObject *__pyx_n_s_meanx;
static PyObject *__pyx_n_s_meany;
static PyObject *__pyx_n_s_median;
static PyObject *__pyx_n_s_members;
static PyObject *__pyx_n_s_memview;
static PyObject *__pyx_n_s_mergesort;
static PyObject *__pyx_n_s_metaclass;
static PyObject *__pyx_n_s_microsecond;
static PyObject *__pyx_n_s_midpoint;
static PyObject *__pyx_n_s_min;
static PyObject *__pyx_kp_s_min_periods_d_must_be_window_d;
static PyObject *__pyx_kp_s_min_periods_must_be_0;
static PyObject *__pyx_n_s_min_subseq;
static PyObject *__pyx_n_s_minp;
static PyObject *__pyx_n_s_minpair;
static PyObject *__pyx_n_s_minute;
static PyObject *__pyx_n_s_minx;
static PyObject *__pyx_n_s_mode;
static PyObject *__pyx_n_s_module;
static PyObject *__pyx_n_s_month;
static PyObject *__pyx_n_s_n;
static PyObject *__pyx_n_s_n0;
static PyObject *__pyx_n_s_na_option;
static PyObject *__pyx_n_s_name;
static PyObject *__pyx_n_s_name_2;
static PyObject *__pyx_n_s_nan;
static PyObject *__pyx_n_s_nan_value;
static PyObject *__pyx_n_s_nancorr;
static PyObject *__pyx_n_s_nancorr_spearman;
static PyObject *__pyx_n_s_nbins;
static PyObject *__pyx_n_s_ndarray;
static PyObject *__pyx_kp_u_ndarray_is_not_C_contiguous;
static PyObject *__pyx_kp_u_ndarray_is_not_Fortran_contiguou;
static PyObject *__pyx_n_s_ndim;
static PyObject *__pyx_n_s_ne;
static PyObject *__pyx_n_s_neg_ct;
static PyObject *__pyx_n_s_new;
static PyObject *__pyx_n_s_neww;
static PyObject *__pyx_n_s_next;
static PyObject *__pyx_n_s_ngroups;
static PyObject *__pyx_n_s_nleft;
static PyObject *__pyx_n_s_nlevels;
static PyObject *__pyx_n_s_nobs;
static PyObject *__pyx_n_s_nonzero;
static PyObject *__pyx_n_s_np;
static PyObject *__pyx_n_s_nright;
static PyObject *__pyx_n_s_numpy;
static PyObject *__pyx_n_s_o;
static PyObject *__pyx_n_s_obj;
static PyObject *__pyx_n_s_object;
static PyObject *__pyx_n_s_object_2;
static PyObject *__pyx_n_s_offset;
static PyObject *__pyx_n_s_old;
static PyObject *__pyx_n_s_oldbuf;
static PyObject *__pyx_n_s_oldw;
static PyObject *__pyx_n_s_ones_like;
static PyObject *__pyx_n_s_ord;
static PyObject *__pyx_n_s_other;
static PyObject *__pyx_n_s_out;
static PyObject *__pyx_n_s_outer_join_indexer_float32;
static PyObject *__pyx_n_s_outer_join_indexer_float64;
static PyObject *__pyx_n_s_outer_join_indexer_int32;
static PyObject *__pyx_n_s_outer_join_indexer_int64;
static PyObject *__pyx_n_s_outer_join_indexer_object;
static PyObject *__pyx_n_s_output;
static PyObject *__pyx_n_s_pack;
static PyObject *__pyx_n_s_pad_2d_inplace_bool;
static PyObject *__pyx_n_s_pad_2d_inplace_float32;
static PyObject *__pyx_n_s_pad_2d_inplace_float64;
static PyObject *__pyx_n_s_pad_2d_inplace_int32;
static PyObject *__pyx_n_s_pad_2d_inplace_int64;
static PyObject *__pyx_n_s_pad_2d_inplace_object;
static PyObject *__pyx_n_s_pad_bool;
static PyObject *__pyx_n_s_pad_float32;
static PyObject *__pyx_n_s_pad_float64;
static PyObject *__pyx_n_s_pad_inplace_bool;
static PyObject *__pyx_n_s_pad_inplace_float32;
static PyObject *__pyx_n_s_pad_inplace_float64;
static PyObject *__pyx_n_s_pad_inplace_int32;
static PyObject *__pyx_n_s_pad_inplace_int64;
static PyObject *__pyx_n_s_pad_inplace_object;
static PyObject *__pyx_n_s_pad_int32;
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_algos;
static PyObject *__pyx_n_s_pandas_lib;
static PyObject *__pyx_kp_s_pandas_src_generated_pyx;
static PyObject *__pyx_kp_s_pandas_src_join_pyx;
static PyObject *__pyx_n_s_pct;
static PyObject *__pyx_n_s_periods;
static PyObject *__pyx_n_s_position;
static PyObject *__pyx_n_s_pre;
static PyObject *__pyx_n_s_prepare;
static PyObject *__pyx_n_s_prev;
static PyObject *__pyx_n_s_prodx;
static PyObject *__pyx_n_s_ptr;
static PyObject *__pyx_n_s_put;
static PyObject *__pyx_n_s_putmask;
static PyObject *__pyx_n_s_pydatetime;
static PyObject *__pyx_n_s_pyx_fuse_0kth_smallest;
static PyObject *__pyx_n_s_pyx_fuse_0median;
static PyObject *__pyx_n_s_pyx_fuse_1kth_smallest;
static PyObject *__pyx_n_s_pyx_fuse_1median;
static PyObject *__pyx_n_s_pyx_fuse_2kth_smallest;
static PyObject *__pyx_n_s_pyx_fuse_2median;
static PyObject *__pyx_n_s_pyx_fuse_3kth_smallest;
static PyObject *__pyx_n_s_pyx_fuse_3median;
static PyObject *__pyx_n_s_pyx_fuse_4kth_smallest;
static PyObject *__pyx_n_s_pyx_fuse_4median;
static PyObject *__pyx_n_s_pyx_fuse_5kth_smallest;
static PyObject *__pyx_n_s_pyx_fuse_5median;
static PyObject *__pyx_n_s_pyx_fuse_6kth_smallest;
static PyObject *__pyx_n_s_pyx_fuse_6median;
static PyObject *__pyx_n_s_pyx_fuse_7kth_smallest;
static PyObject *__pyx_n_s_pyx_fuse_7median;
static PyObject *__pyx_n_s_pyx_fuse_8kth_smallest;
static PyObject *__pyx_n_s_pyx_fuse_8median;
static PyObject *__pyx_n_s_pyx_fuse_9kth_smallest;
static PyObject *__pyx_n_s_pyx_fuse_9median;
static PyObject *__pyx_n_s_pyx_getbuffer;
static PyObject *__pyx_n_s_pyx_releasebuffer;
static PyObject *__pyx_n_s_pyx_vtable;
static PyObject *__pyx_n_s_qualname;
static PyObject *__pyx_n_s_quantile;
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_ranks;
static PyObject *__pyx_n_s_rc;
static PyObject *__pyx_n_s_remove;
static PyObject *__pyx_n_s_res;
static PyObject *__pyx_n_s_result;
static PyObject *__pyx_n_s_resx;
static PyObject *__pyx_n_s_ret;
static PyObject *__pyx_n_s_retry;
static PyObject *__pyx_n_s_return_false;
static PyObject *__pyx_n_s_return_true;
static PyObject *__pyx_n_s_rev;
static PyObject *__pyx_n_s_reverse;
static PyObject *__pyx_n_s_right;
static PyObject *__pyx_n_s_right_count;
static PyObject *__pyx_n_s_right_indexer;
static PyObject *__pyx_n_s_right_pos;
static PyObject *__pyx_n_s_right_sorter;
static PyObject *__pyx_n_s_rindexer;
static PyObject *__pyx_n_s_ring;
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_roll_window;
static PyObject *__pyx_n_s_rval;
static PyObject *__pyx_n_s_s;
static PyObject *__pyx_n_s_second;
static PyObject *__pyx_n_s_seen;
static PyObject *__pyx_n_s_self;
static PyObject *__pyx_n_s_shape;
static PyObject *__pyx_n_s_signatures;
static PyObject *__pyx_n_s_size;
static PyObject *__pyx_n_s_skiplist;
static PyObject *__pyx_n_s_sl;
static PyObject *__pyx_n_s_sort;
static PyObject *__pyx_n_s_sorted_data;
static PyObject *__pyx_n_s_sorter;
static PyObject *__pyx_n_s_split;
static PyObject *__pyx_n_s_ssqdm_x;
static PyObject *__pyx_n_s_start;
static PyObject *__pyx_n_s_step;
static PyObject *__pyx_n_s_stop;
static PyObject *__pyx_kp_s_strided_and_direct;
static PyObject *__pyx_kp_s_strided_and_direct_or_indirect;
static PyObject *__pyx_kp_s_strided_and_indirect;
static PyObject *__pyx_n_s_strip;
static PyObject *__pyx_n_s_struct;
static PyObject *__pyx_n_s_sum_ranks;
static PyObject *__pyx_n_s_sum_x;
static PyObject *__pyx_n_s_sumx;
static PyObject *__pyx_n_s_sumxx;
static PyObject *__pyx_n_s_sumy;
static PyObject *__pyx_n_s_sumyy;
static PyObject *__pyx_n_s_sx;
static PyObject *__pyx_n_s_sy;
static PyObject *__pyx_n_s_take;
static PyObject *__pyx_n_s_take_1d_bool_bool;
static PyObject *__pyx_n_s_take_1d_bool_object;
static PyObject *__pyx_n_s_take_1d_float32_float32;
static PyObject *__pyx_n_s_take_1d_float32_float64;
static PyObject *__pyx_n_s_take_1d_float64_float64;
static PyObject *__pyx_n_s_take_1d_int16_float64;
static PyObject *__pyx_n_s_take_1d_int16_int16;
static PyObject *__pyx_n_s_take_1d_int16_int32;
static PyObject *__pyx_n_s_take_1d_int16_int64;
static PyObject *__pyx_n_s_take_1d_int32_float64;
static PyObject *__pyx_n_s_take_1d_int32_int32;
static PyObject *__pyx_n_s_take_1d_int32_int64;
static PyObject *__pyx_n_s_take_1d_int64_float64;
static PyObject *__pyx_n_s_take_1d_int64_int64;
static PyObject *__pyx_n_s_take_1d_int8_float64;
static PyObject *__pyx_n_s_take_1d_int8_int32;
static PyObject *__pyx_n_s_take_1d_int8_int64;
static PyObject *__pyx_n_s_take_1d_int8_int8;
static PyObject *__pyx_n_s_take_1d_object_object;
static PyObject *__pyx_n_s_take_2d_axis0_bool_bool;
static PyObject *__pyx_n_s_take_2d_axis0_bool_object;
static PyObject *__pyx_n_s_take_2d_axis0_float32_float32;
static PyObject *__pyx_n_s_take_2d_axis0_float32_float64;
static PyObject *__pyx_n_s_take_2d_axis0_float64_float64;
static PyObject *__pyx_n_s_take_2d_axis0_int16_float64;
static PyObject *__pyx_n_s_take_2d_axis0_int16_int16;
static PyObject *__pyx_n_s_take_2d_axis0_int16_int32;
static PyObject *__pyx_n_s_take_2d_axis0_int16_int64;
static PyObject *__pyx_n_s_take_2d_axis0_int32_float64;
static PyObject *__pyx_n_s_take_2d_axis0_int32_int32;
static PyObject *__pyx_n_s_take_2d_axis0_int32_int64;
static PyObject *__pyx_n_s_take_2d_axis0_int64_float64;
static PyObject *__pyx_n_s_take_2d_axis0_int64_int64;
static PyObject *__pyx_n_s_take_2d_axis0_int8_float64;
static PyObject *__pyx_n_s_take_2d_axis0_int8_int32;
static PyObject *__pyx_n_s_take_2d_axis0_int8_int64;
static PyObject *__pyx_n_s_take_2d_axis0_int8_int8;
static PyObject *__pyx_n_s_take_2d_axis0_object_object;
static PyObject *__pyx_n_s_take_2d_axis1_bool_bool;
static PyObject *__pyx_n_s_take_2d_axis1_bool_object;
static PyObject *__pyx_n_s_take_2d_axis1_float32_float32;
static PyObject *__pyx_n_s_take_2d_axis1_float32_float64;
static PyObject *__pyx_n_s_take_2d_axis1_float64_float64;
static PyObject *__pyx_n_s_take_2d_axis1_int16_float64;
static PyObject *__pyx_n_s_take_2d_axis1_int16_int16;
static PyObject *__pyx_n_s_take_2d_axis1_int16_int32;
static PyObject *__pyx_n_s_take_2d_axis1_int16_int64;
static PyObject *__pyx_n_s_take_2d_axis1_int32_float64;
static PyObject *__pyx_n_s_take_2d_axis1_int32_int32;
static PyObject *__pyx_n_s_take_2d_axis1_int32_int64;
static PyObject *__pyx_n_s_take_2d_axis1_int64_float64;
static PyObject *__pyx_n_s_take_2d_axis1_int64_int64;
static PyObject *__pyx_n_s_take_2d_axis1_int8_float64;
static PyObject *__pyx_n_s_take_2d_axis1_int8_int32;
static PyObject *__pyx_n_s_take_2d_axis1_int8_int64;
static PyObject *__pyx_n_s_take_2d_axis1_int8_int8;
static PyObject *__pyx_n_s_take_2d_axis1_object_object;
static PyObject *__pyx_n_s_take_2d_multi_bool_bool;
static PyObject *__pyx_n_s_take_2d_multi_bool_object;
static PyObject *__pyx_n_s_take_2d_multi_float32_float32;
static PyObject *__pyx_n_s_take_2d_multi_float32_float64;
static PyObject *__pyx_n_s_take_2d_multi_float64_float64;
static PyObject *__pyx_n_s_take_2d_multi_int16_float64;
static PyObject *__pyx_n_s_take_2d_multi_int16_int16;
static PyObject *__pyx_n_s_take_2d_multi_int16_int32;
static PyObject *__pyx_n_s_take_2d_multi_int16_int64;
static PyObject *__pyx_n_s_take_2d_multi_int32_float64;
static PyObject *__pyx_n_s_take_2d_multi_int32_int32;
static PyObject *__pyx_n_s_take_2d_multi_int32_int64;
static PyObject *__pyx_n_s_take_2d_multi_int64_float64;
static PyObject *__pyx_n_s_take_2d_multi_int64_int64;
static PyObject *__pyx_n_s_take_2d_multi_int8_float64;
static PyObject *__pyx_n_s_take_2d_multi_int8_int32;
static PyObject *__pyx_n_s_take_2d_multi_int8_int64;
static PyObject *__pyx_n_s_take_2d_multi_int8_int8;
static PyObject *__pyx_n_s_take_2d_multi_object_object;
static PyObject *__pyx_n_s_test;
static PyObject *__pyx_n_s_tiebreak;
static PyObject *__pyx_n_s_tiebreakers;
static PyObject *__pyx_n_s_ties_method;
static PyObject *__pyx_n_s_top;
static PyObject *__pyx_n_s_tot_wgt;
static PyObject *__pyx_n_s_total_tie_count;
static PyObject *__pyx_n_s_u;
static PyObject *__pyx_n_s_uint16_t;
static PyObject *__pyx_n_s_uint32_t;
static PyObject *__pyx_n_s_uint64_t;
static PyObject *__pyx_n_s_uint8;
static PyObject *__pyx_n_s_uint8_t;
static PyObject *__pyx_kp_s_unable_to_allocate_array_data;
static PyObject *__pyx_kp_s_unable_to_allocate_shape_and_str;
static PyObject *__pyx_kp_u_unknown_dtype_code_in_numpy_pxd;
static PyObject *__pyx_n_s_unpack;
static PyObject *__pyx_n_s_v;
static PyObject *__pyx_n_s_val;
static PyObject *__pyx_n_s_val_in;
static PyObject *__pyx_n_s_val_win;
static PyObject *__pyx_n_s_valid_locs;
static PyObject *__pyx_n_s_value;
static PyObject *__pyx_n_s_values;
static PyObject *__pyx_n_s_vclose;
static PyObject *__pyx_n_s_vecs;
static PyObject *__pyx_n_s_vhigh;
static PyObject *__pyx_n_s_view;
static PyObject *__pyx_n_s_vlow;
static PyObject *__pyx_n_s_vopen;
static PyObject *__pyx_n_s_vx;
static PyObject *__pyx_n_s_vy;
static PyObject *__pyx_n_s_w;
static PyObject *__pyx_n_s_weights;
static PyObject *__pyx_n_s_where;
static PyObject *__pyx_n_s_width;
static PyObject *__pyx_n_s_win;
static PyObject *__pyx_n_s_win_i;
static PyObject *__pyx_n_s_win_k;
static PyObject *__pyx_n_s_win_n;
static PyObject *__pyx_n_s_window;
static PyObject *__pyx_n_s_x;
static PyObject *__pyx_n_s_xi;
static PyObject *__pyx_n_s_xrange;
static PyObject *__pyx_n_s_xx;
static PyObject *__pyx_n_s_xxx;
static PyObject *__pyx_n_s_xxxx;
static PyObject *__pyx_n_s_y;
static PyObject *__pyx_n_s_year;
static PyObject *__pyx_n_s_yi;
static PyObject *__pyx_n_s_z;
static PyObject *__pyx_n_s_zeros;
static PyObject *__pyx_n_s_zeros_like;
static PyObject *__pyx_n_s_zip;
static PyObject *__pyx_int_0;
static PyObject *__pyx_int_1;
static PyObject *__pyx_int_2;
static PyObject *__pyx_int_15;
static PyObject *__pyx_int_100;
static PyObject *__pyx_int_105;
static PyObject *__pyx_int_neg_1;
static PyObject *__pyx_k__116;
static PyObject *__pyx_k__117;
static PyObject *__pyx_k__118;
static PyObject *__pyx_k__119;
static PyObject *__pyx_k__120;
static PyObject *__pyx_k__121;
static PyObject *__pyx_k__122;
static PyObject *__pyx_k__123;
static PyObject *__pyx_k__124;
static PyObject *__pyx_k__125;
static PyObject *__pyx_k__126;
static PyObject *__pyx_k__127;
static PyObject *__pyx_k__128;
static PyObject *__pyx_k__129;
static PyObject *__pyx_k__130;
static PyObject *__pyx_k__131;
static PyObject *__pyx_k__132;
static PyObject *__pyx_k__133;
static PyObject *__pyx_k__134;
static PyObject *__pyx_k__135;
static PyObject *__pyx_k__136;
static PyObject *__pyx_k__137;
static PyObject *__pyx_k__138;
static PyObject *__pyx_k__139;
static PyObject *__pyx_k__140;
static PyObject *__pyx_k__141;
static PyObject *__pyx_k__142;
static PyObject *__pyx_k__143;
static PyObject *__pyx_k__144;
static PyObject *__pyx_k__145;
static PyObject *__pyx_k__146;
static PyObject *__pyx_k__147;
static PyObject *__pyx_k__148;
static PyObject *__pyx_k__149;
static PyObject *__pyx_k__150;
static PyObject *__pyx_k__151;
static PyObject *__pyx_k__152;
static PyObject *__pyx_k__153;
static PyObject *__pyx_k__154;
static PyObject *__pyx_k__155;
static PyObject *__pyx_k__156;
static PyObject *__pyx_k__157;
static PyObject *__pyx_k__158;
static PyObject *__pyx_k__159;
static PyObject *__pyx_k__160;
static PyObject *__pyx_k__161;
static PyObject *__pyx_k__162;
static PyObject *__pyx_k__163;
static PyObject *__pyx_k__164;
static PyObject *__pyx_k__165;
static PyObject *__pyx_k__166;
static PyObject *__pyx_k__167;
static PyObject *__pyx_k__168;
static PyObject *__pyx_k__169;
static PyObject *__pyx_k__170;
static PyObject *__pyx_k__171;
static PyObject *__pyx_k__172;
static PyObject *__pyx_k__173;
static PyObject *__pyx_k__174;
static PyObject *__pyx_k__175;
static PyObject *__pyx_k__176;
static PyObject *__pyx_k__177;
static PyObject *__pyx_k__178;
static PyObject *__pyx_k__179;
static PyObject *__pyx_k__180;
static PyObject *__pyx_k__181;
static PyObject *__pyx_k__182;
static PyObject *__pyx_k__183;
static PyObject *__pyx_k__184;
static PyObject *__pyx_k__185;
static PyObject *__pyx_k__186;
static PyObject *__pyx_k__187;
static PyObject *__pyx_k__188;
static PyObject *__pyx_k__189;
static PyObject *__pyx_k__190;
static PyObject *__pyx_k__191;
static PyObject *__pyx_tuple_;
static PyObject *__pyx_slice__2;
static PyObject *__pyx_slice__4;
static PyObject *__pyx_slice__7;
static PyObject *__pyx_slice__8;
static PyObject *__pyx_tuple__3;
static PyObject *__pyx_tuple__5;
static PyObject *__pyx_tuple__6;
static PyObject *__pyx_tuple__9;
static PyObject *__pyx_slice__11;
static PyObject *__pyx_slice__13;
static PyObject *__pyx_slice__14;
static PyObject *__pyx_slice__17;
static PyObject *__pyx_slice__19;
static PyObject *__pyx_slice__24;
static PyObject *__pyx_slice__25;
static PyObject *__pyx_slice__29;
static PyObject *__pyx_slice__46;
static PyObject *__pyx_slice__47;
static PyObject *__pyx_tuple__10;
static PyObject *__pyx_tuple__12;
static PyObject *__pyx_tuple__15;
static PyObject *__pyx_tuple__16;
static PyObject *__pyx_tuple__18;
static PyObject *__pyx_tuple__20;
static PyObject *__pyx_tuple__21;
static PyObject *__pyx_tuple__22;
static PyObject *__pyx_tuple__23;
static PyObject *__pyx_tuple__26;
static PyObject *__pyx_tuple__27;
static PyObject *__pyx_tuple__28;
static PyObject *__pyx_tuple__30;
static PyObject *__pyx_tuple__31;
static PyObject *__pyx_tuple__33;
static PyObject *__pyx_tuple__35;
static PyObject *__pyx_tuple__36;
static PyObject *__pyx_tuple__37;
static PyObject *__pyx_tuple__38;
static PyObject *__pyx_tuple__39;
static PyObject *__pyx_tuple__40;
static PyObject *__pyx_tuple__41;
static PyObject *__pyx_tuple__42;
static PyObject *__pyx_tuple__43;
static PyObject *__pyx_tuple__44;
static PyObject *__pyx_tuple__45;
static PyObject *__pyx_tuple__48;
static PyObject *__pyx_tuple__49;
static PyObject *__pyx_tuple__50;
static PyObject *__pyx_tuple__51;
static PyObject *__pyx_tuple__52;
static PyObject *__pyx_tuple__53;
static PyObject *__pyx_tuple__54;
static PyObject *__pyx_tuple__55;
static PyObject *__pyx_tuple__56;
static PyObject *__pyx_tuple__57;
static PyObject *__pyx_tuple__58;
static PyObject *__pyx_tuple__59;
static PyObject *__pyx_tuple__60;
static PyObject *__pyx_tuple__61;
static PyObject *__pyx_tuple__62;
static PyObject *__pyx_tuple__63;
static PyObject *__pyx_tuple__64;
static PyObject *__pyx_tuple__65;
static PyObject *__pyx_tuple__66;
static PyObject *__pyx_tuple__67;
static PyObject *__pyx_tuple__68;
static PyObject *__pyx_tuple__69;
static PyObject *__pyx_tuple__70;
static PyObject *__pyx_tuple__71;
static PyObject *__pyx_tuple__72;
static PyObject *__pyx_tuple__73;
static PyObject *__pyx_tuple__74;
static PyObject *__pyx_tuple__75;
static PyObject *__pyx_tuple__76;
static PyObject *__pyx_tuple__77;
static PyObject *__pyx_tuple__78;
static PyObject *__pyx_tuple__79;
static PyObject *__pyx_tuple__80;
static PyObject *__pyx_tuple__81;
static PyObject *__pyx_tuple__82;
static PyObject *__pyx_tuple__83;
static PyObject *__pyx_tuple__84;
static PyObject *__pyx_tuple__85;
static PyObject *__pyx_tuple__86;
static PyObject *__pyx_tuple__87;
static PyObject *__pyx_tuple__88;
static PyObject *__pyx_tuple__89;
static PyObject *__pyx_tuple__90;
static PyObject *__pyx_tuple__91;
static PyObject *__pyx_tuple__92;
static PyObject *__pyx_tuple__93;
static PyObject *__pyx_tuple__94;
static PyObject *__pyx_tuple__95;
static PyObject *__pyx_tuple__96;
static PyObject *__pyx_tuple__97;
static PyObject *__pyx_tuple__98;
static PyObject *__pyx_tuple__99;
static PyObject *__pyx_tuple__100;
static PyObject *__pyx_tuple__101;
static PyObject *__pyx_tuple__102;
static PyObject *__pyx_tuple__103;
static PyObject *__pyx_tuple__104;
static PyObject *__pyx_tuple__105;
static PyObject *__pyx_tuple__106;
static PyObject *__pyx_tuple__107;
static PyObject *__pyx_tuple__108;
static PyObject *__pyx_tuple__109;
static PyObject *__pyx_tuple__110;
static PyObject *__pyx_tuple__111;
static PyObject *__pyx_tuple__112;
static PyObject *__pyx_tuple__113;
static PyObject *__pyx_tuple__114;
static PyObject *__pyx_tuple__115;
static PyObject *__pyx_tuple__192;
static PyObject *__pyx_tuple__193;
static PyObject *__pyx_tuple__194;
static PyObject *__pyx_tuple__195;
static PyObject *__pyx_tuple__196;
static PyObject *__pyx_tuple__197;
static PyObject *__pyx_tuple__198;
static PyObject *__pyx_tuple__199;
static PyObject *__pyx_tuple__200;
static PyObject *__pyx_tuple__201;
static PyObject *__pyx_tuple__202;
static PyObject *__pyx_tuple__203;
static PyObject *__pyx_tuple__204;
static PyObject *__pyx_tuple__205;
static PyObject *__pyx_tuple__206;
static PyObject *__pyx_tuple__207;
static PyObject *__pyx_tuple__208;
static PyObject *__pyx_tuple__209;
static PyObject *__pyx_tuple__210;
static PyObject *__pyx_tuple__211;
static PyObject *__pyx_tuple__212;
static PyObject *__pyx_tuple__213;
static PyObject *__pyx_tuple__214;
static PyObject *__pyx_tuple__215;
static PyObject *__pyx_tuple__216;
static PyObject *__pyx_tuple__217;
static PyObject *__pyx_tuple__218;
static PyObject *__pyx_tuple__219;
static PyObject *__pyx_tuple__220;
static PyObject *__pyx_tuple__221;
static PyObject *__pyx_tuple__222;
static PyObject *__pyx_tuple__223;
static PyObject *__pyx_tuple__224;
static PyObject *__pyx_tuple__225;
static PyObject *__pyx_tuple__226;
static PyObject *__pyx_tuple__227;
static PyObject *__pyx_tuple__228;
static PyObject *__pyx_tuple__229;
static PyObject *__pyx_tuple__230;
static PyObject *__pyx_tuple__231;
static PyObject *__pyx_tuple__232;
static PyObject *__pyx_tuple__233;
static PyObject *__pyx_tuple__235;
static PyObject *__pyx_tuple__237;
static PyObject *__pyx_tuple__239;
static PyObject *__pyx_tuple__241;
static PyObject *__pyx_tuple__243;
static PyObject *__pyx_tuple__245;
static PyObject *__pyx_tuple__247;
static PyObject *__pyx_tuple__249;
static PyObject *__pyx_tuple__251;
static PyObject *__pyx_tuple__253;
static PyObject *__pyx_tuple__255;
static PyObject *__pyx_tuple__257;
static PyObject *__pyx_tuple__259;
static PyObject *__pyx_tuple__261;
static PyObject *__pyx_tuple__263;
static PyObject *__pyx_tuple__265;
static PyObject *__pyx_tuple__267;
static PyObject *__pyx_tuple__269;
static PyObject *__pyx_tuple__271;
static PyObject *__pyx_tuple__273;
static PyObject *__pyx_tuple__275;
static PyObject *__pyx_tuple__277;
static PyObject *__pyx_tuple__279;
static PyObject *__pyx_tuple__281;
static PyObject *__pyx_tuple__283;
static PyObject *__pyx_tuple__285;
static PyObject *__pyx_tuple__287;
static PyObject *__pyx_tuple__289;
static PyObject *__pyx_tuple__291;
static PyObject *__pyx_tuple__293;
static PyObject *__pyx_tuple__295;
static PyObject *__pyx_tuple__297;
static PyObject *__pyx_tuple__299;
static PyObject *__pyx_tuple__301;
static PyObject *__pyx_tuple__303;
static PyObject *__pyx_tuple__305;
static PyObject *__pyx_tuple__307;
static PyObject *__pyx_tuple__309;
static PyObject *__pyx_tuple__311;
static PyObject *__pyx_tuple__313;
static PyObject *__pyx_tuple__315;
static PyObject *__pyx_tuple__317;
static PyObject *__pyx_tuple__319;
static PyObject *__pyx_tuple__320;
static PyObject *__pyx_tuple__322;
static PyObject *__pyx_tuple__324;
static PyObject *__pyx_tuple__326;
static PyObject *__pyx_tuple__328;
static PyObject *__pyx_tuple__330;
static PyObject *__pyx_tuple__332;
static PyObject *__pyx_tuple__334;
static PyObject *__pyx_tuple__336;
static PyObject *__pyx_tuple__338;
static PyObject *__pyx_tuple__340;
static PyObject *__pyx_tuple__342;
static PyObject *__pyx_tuple__344;
static PyObject *__pyx_tuple__346;
static PyObject *__pyx_tuple__348;
static PyObject *__pyx_tuple__350;
static PyObject *__pyx_tuple__352;
static PyObject *__pyx_tuple__354;
static PyObject *__pyx_tuple__356;
static PyObject *__pyx_tuple__358;
static PyObject *__pyx_tuple__360;
static PyObject *__pyx_tuple__362;
static PyObject *__pyx_tuple__364;
static PyObject *__pyx_tuple__366;
static PyObject *__pyx_tuple__368;
static PyObject *__pyx_tuple__370;
static PyObject *__pyx_tuple__372;
static PyObject *__pyx_tuple__374;
static PyObject *__pyx_tuple__376;
static PyObject *__pyx_tuple__378;
static PyObject *__pyx_tuple__380;
static PyObject *__pyx_tuple__382;
static PyObject *__pyx_tuple__384;
static PyObject *__pyx_tuple__386;
static PyObject *__pyx_tuple__388;
static PyObject *__pyx_tuple__390;
static PyObject *__pyx_tuple__392;
static PyObject *__pyx_tuple__394;
static PyObject *__pyx_tuple__396;
static PyObject *__pyx_tuple__398;
static PyObject *__pyx_tuple__400;
static PyObject *__pyx_tuple__402;
static PyObject *__pyx_tuple__404;
static PyObject *__pyx_tuple__406;
static PyObject *__pyx_tuple__408;
static PyObject *__pyx_tuple__410;
static PyObject *__pyx_tuple__412;
static PyObject *__pyx_tuple__414;
static PyObject *__pyx_tuple__416;
static PyObject *__pyx_tuple__418;
static PyObject *__pyx_tuple__420;
static PyObject *__pyx_tuple__422;
static PyObject *__pyx_tuple__424;
static PyObject *__pyx_tuple__426;
static PyObject *__pyx_tuple__428;
static PyObject *__pyx_tuple__430;
static PyObject *__pyx_tuple__432;
static PyObject *__pyx_tuple__434;
static PyObject *__pyx_tuple__436;
static PyObject *__pyx_tuple__438;
static PyObject *__pyx_tuple__440;
static PyObject *__pyx_tuple__442;
static PyObject *__pyx_tuple__444;
static PyObject *__pyx_tuple__446;
static PyObject *__pyx_tuple__448;
static PyObject *__pyx_tuple__450;
static PyObject *__pyx_tuple__452;
static PyObject *__pyx_tuple__454;
static PyObject *__pyx_tuple__456;
static PyObject *__pyx_tuple__458;
static PyObject *__pyx_tuple__460;
static PyObject *__pyx_tuple__462;
static PyObject *__pyx_tuple__464;
static PyObject *__pyx_tuple__466;
static PyObject *__pyx_tuple__468;
static PyObject *__pyx_tuple__470;
static PyObject *__pyx_tuple__472;
static PyObject *__pyx_tuple__474;
static PyObject *__pyx_tuple__476;
static PyObject *__pyx_tuple__478;
static PyObject *__pyx_tuple__480;
static PyObject *__pyx_tuple__482;
static PyObject *__pyx_tuple__484;
static PyObject *__pyx_tuple__486;
static PyObject *__pyx_tuple__488;
static PyObject *__pyx_tuple__490;
static PyObject *__pyx_tuple__492;
static PyObject *__pyx_tuple__494;
static PyObject *__pyx_tuple__496;
static PyObject *__pyx_tuple__498;
static PyObject *__pyx_tuple__500;
static PyObject *__pyx_tuple__502;
static PyObject *__pyx_tuple__504;
static PyObject *__pyx_tuple__506;
static PyObject *__pyx_tuple__508;
static PyObject *__pyx_tuple__510;
static PyObject *__pyx_tuple__512;
static PyObject *__pyx_tuple__514;
static PyObject *__pyx_tuple__516;
static PyObject *__pyx_tuple__518;
static PyObject *__pyx_tuple__520;
static PyObject *__pyx_tuple__522;
static PyObject *__pyx_tuple__524;
static PyObject *__pyx_tuple__526;
static PyObject *__pyx_tuple__528;
static PyObject *__pyx_tuple__530;
static PyObject *__pyx_tuple__532;
static PyObject *__pyx_tuple__534;
static PyObject *__pyx_tuple__536;
static PyObject *__pyx_tuple__538;
static PyObject *__pyx_tuple__540;
static PyObject *__pyx_tuple__542;
static PyObject *__pyx_tuple__544;
static PyObject *__pyx_tuple__546;
static PyObject *__pyx_tuple__548;
static PyObject *__pyx_tuple__550;
static PyObject *__pyx_tuple__552;
static PyObject *__pyx_tuple__554;
static PyObject *__pyx_tuple__556;
static PyObject *__pyx_tuple__558;
static PyObject *__pyx_tuple__560;
static PyObject *__pyx_tuple__562;
static PyObject *__pyx_tuple__564;
static PyObject *__pyx_tuple__566;
static PyObject *__pyx_tuple__568;
static PyObject *__pyx_tuple__570;
static PyObject *__pyx_tuple__572;
static PyObject *__pyx_tuple__574;
static PyObject *__pyx_tuple__576;
static PyObject *__pyx_tuple__578;
static PyObject *__pyx_tuple__580;
static PyObject *__pyx_tuple__582;
static PyObject *__pyx_tuple__584;
static PyObject *__pyx_tuple__586;
static PyObject *__pyx_tuple__588;
static PyObject *__pyx_tuple__590;
static PyObject *__pyx_tuple__592;
static PyObject *__pyx_tuple__594;
static PyObject *__pyx_tuple__596;
static PyObject *__pyx_tuple__598;
static PyObject *__pyx_tuple__600;
static PyObject *__pyx_tuple__602;
static PyObject *__pyx_tuple__604;
static PyObject *__pyx_tuple__606;
static PyObject *__pyx_tuple__608;
static PyObject *__pyx_tuple__610;
static PyObject *__pyx_tuple__612;
static PyObject *__pyx_tuple__614;
static PyObject *__pyx_tuple__616;
static PyObject *__pyx_tuple__618;
static PyObject *__pyx_tuple__620;
static PyObject *__pyx_tuple__622;
static PyObject *__pyx_tuple__624;
static PyObject *__pyx_tuple__626;
static PyObject *__pyx_tuple__628;
static PyObject *__pyx_tuple__630;
static PyObject *__pyx_tuple__632;
static PyObject *__pyx_tuple__634;
static PyObject *__pyx_tuple__636;
static PyObject *__pyx_tuple__638;
static PyObject *__pyx_tuple__640;
static PyObject *__pyx_tuple__642;
static PyObject *__pyx_tuple__644;
static PyObject *__pyx_tuple__646;
static PyObject *__pyx_tuple__648;
static PyObject *__pyx_tuple__650;
static PyObject *__pyx_tuple__652;
static PyObject *__pyx_tuple__654;
static PyObject *__pyx_tuple__656;
static PyObject *__pyx_tuple__658;
static PyObject *__pyx_tuple__660;
static PyObject *__pyx_tuple__662;
static PyObject *__pyx_tuple__664;
static PyObject *__pyx_tuple__666;
static PyObject *__pyx_tuple__668;
static PyObject *__pyx_tuple__670;
static PyObject *__pyx_tuple__672;
static PyObject *__pyx_tuple__674;
static PyObject *__pyx_tuple__676;
static PyObject *__pyx_tuple__678;
static PyObject *__pyx_tuple__680;
static PyObject *__pyx_tuple__682;
static PyObject *__pyx_tuple__684;
static PyObject *__pyx_tuple__686;
static PyObject *__pyx_tuple__688;
static PyObject *__pyx_tuple__690;
static PyObject *__pyx_tuple__692;
static PyObject *__pyx_tuple__694;
static PyObject *__pyx_tuple__696;
static PyObject *__pyx_tuple__698;
static PyObject *__pyx_tuple__700;
static PyObject *__pyx_tuple__702;
static PyObject *__pyx_tuple__704;
static PyObject *__pyx_tuple__706;
static PyObject *__pyx_tuple__708;
static PyObject *__pyx_tuple__710;
static PyObject *__pyx_tuple__712;
static PyObject *__pyx_tuple__714;
static PyObject *__pyx_tuple__716;
static PyObject *__pyx_tuple__717;
static PyObject *__pyx_tuple__718;
static PyObject *__pyx_tuple__719;
static PyObject *__pyx_tuple__720;
static PyObject *__pyx_codeobj__234;
static PyObject *__pyx_codeobj__236;
static PyObject *__pyx_codeobj__238;
static PyObject *__pyx_codeobj__240;
static PyObject *__pyx_codeobj__242;
static PyObject *__pyx_codeobj__244;
static PyObject *__pyx_codeobj__246;
static PyObject *__pyx_codeobj__248;
static PyObject *__pyx_codeobj__250;
static PyObject *__pyx_codeobj__252;
static PyObject *__pyx_codeobj__254;
static PyObject *__pyx_codeobj__256;
static PyObject *__pyx_codeobj__258;
static PyObject *__pyx_codeobj__260;
static PyObject *__pyx_codeobj__262;
static PyObject *__pyx_codeobj__264;
static PyObject *__pyx_codeobj__266;
static PyObject *__pyx_codeobj__268;
static PyObject *__pyx_codeobj__270;
static PyObject *__pyx_codeobj__272;
static PyObject *__pyx_codeobj__274;
static PyObject *__pyx_codeobj__276;
static PyObject *__pyx_codeobj__278;
static PyObject *__pyx_codeobj__280;
static PyObject *__pyx_codeobj__282;
static PyObject *__pyx_codeobj__284;
static PyObject *__pyx_codeobj__286;
static PyObject *__pyx_codeobj__288;
static PyObject *__pyx_codeobj__290;
static PyObject *__pyx_codeobj__292;
static PyObject *__pyx_codeobj__294;
static PyObject *__pyx_codeobj__296;
static PyObject *__pyx_codeobj__298;
static PyObject *__pyx_codeobj__300;
static PyObject *__pyx_codeobj__302;
static PyObject *__pyx_codeobj__304;
static PyObject *__pyx_codeobj__306;
static PyObject *__pyx_codeobj__308;
static PyObject *__pyx_codeobj__310;
static PyObject *__pyx_codeobj__312;
static PyObject *__pyx_codeobj__314;
static PyObject *__pyx_codeobj__316;
static PyObject *__pyx_codeobj__318;
static PyObject *__pyx_codeobj__321;
static PyObject *__pyx_codeobj__323;
static PyObject *__pyx_codeobj__325;
static PyObject *__pyx_codeobj__327;
static PyObject *__pyx_codeobj__329;
static PyObject *__pyx_codeobj__331;
static PyObject *__pyx_codeobj__333;
static PyObject *__pyx_codeobj__335;
static PyObject *__pyx_codeobj__337;
static PyObject *__pyx_codeobj__339;
static PyObject *__pyx_codeobj__341;
static PyObject *__pyx_codeobj__343;
static PyObject *__pyx_codeobj__345;
static PyObject *__pyx_codeobj__347;
static PyObject *__pyx_codeobj__349;
static PyObject *__pyx_codeobj__351;
static PyObject *__pyx_codeobj__353;
static PyObject *__pyx_codeobj__355;
static PyObject *__pyx_codeobj__357;
static PyObject *__pyx_codeobj__359;
static PyObject *__pyx_codeobj__361;
static PyObject *__pyx_codeobj__363;
static PyObject *__pyx_codeobj__365;
static PyObject *__pyx_codeobj__367;
static PyObject *__pyx_codeobj__369;
static PyObject *__pyx_codeobj__371;
static PyObject *__pyx_codeobj__373;
static PyObject *__pyx_codeobj__375;
static PyObject *__pyx_codeobj__377;
static PyObject *__pyx_codeobj__379;
static PyObject *__pyx_codeobj__381;
static PyObject *__pyx_codeobj__383;
static PyObject *__pyx_codeobj__385;
static PyObject *__pyx_codeobj__387;
static PyObject *__pyx_codeobj__389;
static PyObject *__pyx_codeobj__391;
static PyObject *__pyx_codeobj__393;
static PyObject *__pyx_codeobj__395;
static PyObject *__pyx_codeobj__397;
static PyObject *__pyx_codeobj__399;
static PyObject *__pyx_codeobj__401;
static PyObject *__pyx_codeobj__403;
static PyObject *__pyx_codeobj__405;
static PyObject *__pyx_codeobj__407;
static PyObject *__pyx_codeobj__409;
static PyObject *__pyx_codeobj__411;
static PyObject *__pyx_codeobj__413;
static PyObject *__pyx_codeobj__415;
static PyObject *__pyx_codeobj__417;
static PyObject *__pyx_codeobj__419;
static PyObject *__pyx_codeobj__421;
static PyObject *__pyx_codeobj__423;
static PyObject *__pyx_codeobj__425;
static PyObject *__pyx_codeobj__427;
static PyObject *__pyx_codeobj__429;
static PyObject *__pyx_codeobj__431;
static PyObject *__pyx_codeobj__433;
static PyObject *__pyx_codeobj__435;
static PyObject *__pyx_codeobj__437;
static PyObject *__pyx_codeobj__439;
static PyObject *__pyx_codeobj__441;
static PyObject *__pyx_codeobj__443;
static PyObject *__pyx_codeobj__445;
static PyObject *__pyx_codeobj__447;
static PyObject *__pyx_codeobj__449;
static PyObject *__pyx_codeobj__451;
static PyObject *__pyx_codeobj__453;
static PyObject *__pyx_codeobj__455;
static PyObject *__pyx_codeobj__457;
static PyObject *__pyx_codeobj__459;
static PyObject *__pyx_codeobj__461;
static PyObject *__pyx_codeobj__463;
static PyObject *__pyx_codeobj__465;
static PyObject *__pyx_codeobj__467;
static PyObject *__pyx_codeobj__469;
static PyObject *__pyx_codeobj__471;
static PyObject *__pyx_codeobj__473;
static PyObject *__pyx_codeobj__475;
static PyObject *__pyx_codeobj__477;
static PyObject *__pyx_codeobj__479;
static PyObject *__pyx_codeobj__481;
static PyObject *__pyx_codeobj__483;
static PyObject *__pyx_codeobj__485;
static PyObject *__pyx_codeobj__487;
static PyObject *__pyx_codeobj__489;
static PyObject *__pyx_codeobj__491;
static PyObject *__pyx_codeobj__493;
static PyObject *__pyx_codeobj__495;
static PyObject *__pyx_codeobj__497;
static PyObject *__pyx_codeobj__499;
static PyObject *__pyx_codeobj__501;
static PyObject *__pyx_codeobj__503;
static PyObject *__pyx_codeobj__505;
static PyObject *__pyx_codeobj__507;
static PyObject *__pyx_codeobj__509;
static PyObject *__pyx_codeobj__511;
static PyObject *__pyx_codeobj__513;
static PyObject *__pyx_codeobj__515;
static PyObject *__pyx_codeobj__517;
static PyObject *__pyx_codeobj__519;
static PyObject *__pyx_codeobj__521;
static PyObject *__pyx_codeobj__523;
static PyObject *__pyx_codeobj__525;
static PyObject *__pyx_codeobj__527;
static PyObject *__pyx_codeobj__529;
static PyObject *__pyx_codeobj__531;
static PyObject *__pyx_codeobj__533;
static PyObject *__pyx_codeobj__535;
static PyObject *__pyx_codeobj__537;
static PyObject *__pyx_codeobj__539;
static PyObject *__pyx_codeobj__541;
static PyObject *__pyx_codeobj__543;
static PyObject *__pyx_codeobj__545;
static PyObject *__pyx_codeobj__547;
static PyObject *__pyx_codeobj__549;
static PyObject *__pyx_codeobj__551;
static PyObject *__pyx_codeobj__553;
static PyObject *__pyx_codeobj__555;
static PyObject *__pyx_codeobj__557;
static PyObject *__pyx_codeobj__559;
static PyObject *__pyx_codeobj__561;
static PyObject *__pyx_codeobj__563;
static PyObject *__pyx_codeobj__565;
static PyObject *__pyx_codeobj__567;
static PyObject *__pyx_codeobj__569;
static PyObject *__pyx_codeobj__571;
static PyObject *__pyx_codeobj__573;
static PyObject *__pyx_codeobj__575;
static PyObject *__pyx_codeobj__577;
static PyObject *__pyx_codeobj__579;
static PyObject *__pyx_codeobj__581;
static PyObject *__pyx_codeobj__583;
static PyObject *__pyx_codeobj__585;
static PyObject *__pyx_codeobj__587;
static PyObject *__pyx_codeobj__589;
static PyObject *__pyx_codeobj__591;
static PyObject *__pyx_codeobj__593;
static PyObject *__pyx_codeobj__595;
static PyObject *__pyx_codeobj__597;
static PyObject *__pyx_codeobj__599;
static PyObject *__pyx_codeobj__601;
static PyObject *__pyx_codeobj__603;
static PyObject *__pyx_codeobj__605;
static PyObject *__pyx_codeobj__607;
static PyObject *__pyx_codeobj__609;
static PyObject *__pyx_codeobj__611;
static PyObject *__pyx_codeobj__613;
static PyObject *__pyx_codeobj__615;
static PyObject *__pyx_codeobj__617;
static PyObject *__pyx_codeobj__619;
static PyObject *__pyx_codeobj__621;
static PyObject *__pyx_codeobj__623;
static PyObject *__pyx_codeobj__625;
static PyObject *__pyx_codeobj__627;
static PyObject *__pyx_codeobj__629;
static PyObject *__pyx_codeobj__631;
static PyObject *__pyx_codeobj__633;
static PyObject *__pyx_codeobj__635;
static PyObject *__pyx_codeobj__637;
static PyObject *__pyx_codeobj__639;
static PyObject *__pyx_codeobj__641;
static PyObject *__pyx_codeobj__643;
static PyObject *__pyx_codeobj__645;
static PyObject *__pyx_codeobj__647;
static PyObject *__pyx_codeobj__649;
static PyObject *__pyx_codeobj__651;
static PyObject *__pyx_codeobj__653;
static PyObject *__pyx_codeobj__655;
static PyObject *__pyx_codeobj__657;
static PyObject *__pyx_codeobj__659;
static PyObject *__pyx_codeobj__661;
static PyObject *__pyx_codeobj__663;
static PyObject *__pyx_codeobj__665;
static PyObject *__pyx_codeobj__667;
static PyObject *__pyx_codeobj__669;
static PyObject *__pyx_codeobj__671;
static PyObject *__pyx_codeobj__673;
static PyObject *__pyx_codeobj__675;
static PyObject *__pyx_codeobj__677;
static PyObject *__pyx_codeobj__679;
static PyObject *__pyx_codeobj__681;
static PyObject *__pyx_codeobj__683;
static PyObject *__pyx_codeobj__685;
static PyObject *__pyx_codeobj__687;
static PyObject *__pyx_codeobj__689;
static PyObject *__pyx_codeobj__691;
static PyObject *__pyx_codeobj__693;
static PyObject *__pyx_codeobj__695;
static PyObject *__pyx_codeobj__697;
static PyObject *__pyx_codeobj__699;
static PyObject *__pyx_codeobj__701;
static PyObject *__pyx_codeobj__703;
static PyObject *__pyx_codeobj__705;
static PyObject *__pyx_codeobj__707;
static PyObject *__pyx_codeobj__709;
static PyObject *__pyx_codeobj__711;
static PyObject *__pyx_codeobj__713;
static PyObject *__pyx_codeobj__715;

/* "pandas/algos.pyx":565
 *         return left != right
 * 
 * _return_false = lambda self, other: False             # <<<<<<<<<<<<<<
 * _return_true = lambda self, other: True
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pandas_5algos_510lambda1(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_5algos_510lambda1 = {__Pyx_NAMESTR("lambda1"), (PyCFunction)__pyx_pw_6pandas_5algos_510lambda1, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pw_6pandas_5algos_510lambda1(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  CYTHON_UNUSED PyObject *__pyx_v_self = 0;
  CYTHON_UNUSED PyObject *__pyx_v_other = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("lambda1 (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_other,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_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 (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_other)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("lambda1", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 565; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "lambda1") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 565; __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("lambda1", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 565; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas.algos.lambda1", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_lambda_funcdef_6pandas_5algos_lambda1(__pyx_self, __pyx_v_self, __pyx_v_other);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_lambda_funcdef_6pandas_5algos_lambda1(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_other) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("lambda1", 0);
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(Py_False);
  __pyx_r = Py_False;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/algos.pyx":566
 * 
 * _return_false = lambda self, other: False
 * _return_true = lambda self, other: True             # <<<<<<<<<<<<<<
 * 
 * class Infinity(object):
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pandas_5algos_511lambda2(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_5algos_511lambda2 = {__Pyx_NAMESTR("lambda2"), (PyCFunction)__pyx_pw_6pandas_5algos_511lambda2, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pw_6pandas_5algos_511lambda2(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  CYTHON_UNUSED PyObject *__pyx_v_self = 0;
  CYTHON_UNUSED PyObject *__pyx_v_other = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("lambda2 (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_other,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_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 (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_other)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("lambda2", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 566; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "lambda2") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 566; __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("lambda2", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 566; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas.algos.lambda2", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_lambda_funcdef_6pandas_5algos_lambda2(__pyx_self, __pyx_v_self, __pyx_v_other);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_lambda_funcdef_6pandas_5algos_lambda2(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_other) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("lambda2", 0);
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(Py_True);
  __pyx_r = Py_True;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/algos.pyx":55
 * 
 * 
 * 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_5algos_int_max(int __pyx_v_a, int __pyx_v_b) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  __Pyx_RefNannySetupContext("int_max", 0);
  if (((__pyx_v_a >= __pyx_v_b) != 0)) {
    __pyx_t_1 = __pyx_v_a;
  } else {
    __pyx_t_1 = __pyx_v_b;
  }
  __pyx_r = __pyx_t_1;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/algos.pyx":56
 * 
 * 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_5algos_int_min(int __pyx_v_a, int __pyx_v_b) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  __Pyx_RefNannySetupContext("int_min", 0);
  if (((__pyx_v_a <= __pyx_v_b) != 0)) {
    __pyx_t_1 = __pyx_v_a;
  } else {
    __pyx_t_1 = __pyx_v_b;
  }
  __pyx_r = __pyx_t_1;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "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_5algos_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", 0);

  /* "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)) {
    #ifdef WITH_THREAD
    PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
    #endif
    PyErr_SetString(PyExc_ZeroDivisionError, "float division");
    #ifdef WITH_THREAD
    PyGILState_Release(__pyx_gilstate_save);
    #endif
    {__pyx_filename = __pyx_f[1]; __pyx_lineno = 19; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_r = (__pyx_t_1 / __pyx_t_2);
  goto __pyx_L0;

  /* "pandas/src/skiplist.pyx":18
 * # MSVC does not have log2!
 * 
 * cdef double Log2(double x):             # <<<<<<<<<<<<<<
 *     return log(x) / log(2.)
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_WriteUnraisable("pandas.algos.Log2", __pyx_clineno, __pyx_lineno, __pyx_filename, 0);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/src/skiplist.pyx":38
 *         list width
 * 
 *     def __init__(self, double_t value, list next, list width):             # <<<<<<<<<<<<<<
 *         self.value = value
 *         self.next = next
 */

/* Python wrapper */
static int __pyx_pw_6pandas_5algos_4Node_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_6pandas_5algos_4Node_1__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_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_value,&__pyx_n_s_next,&__pyx_n_s_width,0};
    PyObject* values[3] = {0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_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 (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_value)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_next)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__init__", 1, 3, 3, 1); {__pyx_filename = __pyx_f[1]; __pyx_lineno = 38; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_width)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__init__", 1, 3, 3, 2); {__pyx_filename = __pyx_f[1]; __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, pos_args, "__init__") < 0)) {__pyx_filename = __pyx_f[1]; __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[1]; __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[1]; __pyx_lineno = 38; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas.algos.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[1]; __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[1]; __pyx_lineno = 38; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_4Node___init__(((struct __pyx_obj_6pandas_5algos_Node *)__pyx_v_self), __pyx_v_value, __pyx_v_next, __pyx_v_width);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_6pandas_5algos_4Node___init__(struct __pyx_obj_6pandas_5algos_Node *__pyx_v_self, __pyx_t_5numpy_double_t __pyx_v_value, PyObject *__pyx_v_next, PyObject *__pyx_v_width) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__", 0);

  /* "pandas/src/skiplist.pyx":39
 * 
 *     def __init__(self, double_t value, list next, list width):
 *         self.value = value             # <<<<<<<<<<<<<<
 *         self.next = next
 *         self.width = width
 */
  __pyx_v_self->value = __pyx_v_value;

  /* "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(__pyx_v_next);
  __Pyx_GIVEREF(__pyx_v_next);
  __Pyx_GOTREF(__pyx_v_self->next);
  __Pyx_DECREF(__pyx_v_self->next);
  __pyx_v_self->next = __pyx_v_next;

  /* "pandas/src/skiplist.pyx":41
 *         self.value = value
 *         self.next = next
 *         self.width = width             # <<<<<<<<<<<<<<
 * 
 * # Singleton terminator node
 */
  __Pyx_INCREF(__pyx_v_width);
  __Pyx_GIVEREF(__pyx_v_width);
  __Pyx_GOTREF(__pyx_v_self->width);
  __Pyx_DECREF(__pyx_v_self->width);
  __pyx_v_self->width = __pyx_v_width;

  /* "pandas/src/skiplist.pyx":38
 *         list width
 * 
 *     def __init__(self, double_t value, list next, list width):             # <<<<<<<<<<<<<<
 *         self.value = value
 *         self.next = next
 */

  /* function exit code */
  __pyx_r = 0;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/src/skiplist.pyx":34
 * cdef class Node:
 *     cdef public:
 *         double_t value             # <<<<<<<<<<<<<<
 *         list next
 *         list width
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pandas_5algos_4Node_5value_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6pandas_5algos_4Node_5value_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6pandas_5algos_4Node_5value___get__(((struct __pyx_obj_6pandas_5algos_Node *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pandas_5algos_4Node_5value___get__(struct __pyx_obj_6pandas_5algos_Node *__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__", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyFloat_FromDouble(__pyx_v_self->value); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __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;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pandas.algos.Node.value.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_6pandas_5algos_4Node_5value_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_6pandas_5algos_4Node_5value_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6pandas_5algos_4Node_5value_2__set__(((struct __pyx_obj_6pandas_5algos_Node *)__pyx_v_self), ((PyObject *)__pyx_v_value));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_6pandas_5algos_4Node_5value_2__set__(struct __pyx_obj_6pandas_5algos_Node *__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__", 0);
  __pyx_t_1 = __pyx_PyFloat_AsDouble(__pyx_v_value); if (unlikely((__pyx_t_1 == (npy_double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 34; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_self->value = __pyx_t_1;

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("pandas.algos.Node.value.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/src/skiplist.pyx":35
 *     cdef public:
 *         double_t value
 *         list next             # <<<<<<<<<<<<<<
 *         list width
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pandas_5algos_4Node_4next_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6pandas_5algos_4Node_4next_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6pandas_5algos_4Node_4next___get__(((struct __pyx_obj_6pandas_5algos_Node *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pandas_5algos_4Node_4next___get__(struct __pyx_obj_6pandas_5algos_Node *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->next);
  __pyx_r = __pyx_v_self->next;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_6pandas_5algos_4Node_4next_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_6pandas_5algos_4Node_4next_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6pandas_5algos_4Node_4next_2__set__(((struct __pyx_obj_6pandas_5algos_Node *)__pyx_v_self), ((PyObject *)__pyx_v_value));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_6pandas_5algos_4Node_4next_2__set__(struct __pyx_obj_6pandas_5algos_Node *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__set__", 0);
  if (!(likely(PyList_CheckExact(__pyx_v_value))||((__pyx_v_value) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "list", Py_TYPE(__pyx_v_value)->tp_name), 0))) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_1 = __pyx_v_value;
  __Pyx_INCREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_self->next);
  __Pyx_DECREF(__pyx_v_self->next);
  __pyx_v_self->next = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pandas.algos.Node.next.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_6pandas_5algos_4Node_4next_5__del__(PyObject *__pyx_v_self); /*proto*/
static int __pyx_pw_6pandas_5algos_4Node_4next_5__del__(PyObject *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6pandas_5algos_4Node_4next_4__del__(((struct __pyx_obj_6pandas_5algos_Node *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_6pandas_5algos_4Node_4next_4__del__(struct __pyx_obj_6pandas_5algos_Node *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__", 0);
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_self->next);
  __Pyx_DECREF(__pyx_v_self->next);
  __pyx_v_self->next = ((PyObject*)Py_None);

  /* function exit code */
  __pyx_r = 0;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/src/skiplist.pyx":36
 *         double_t value
 *         list next
 *         list width             # <<<<<<<<<<<<<<
 * 
 *     def __init__(self, double_t value, list next, list width):
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pandas_5algos_4Node_5width_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6pandas_5algos_4Node_5width_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6pandas_5algos_4Node_5width___get__(((struct __pyx_obj_6pandas_5algos_Node *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pandas_5algos_4Node_5width___get__(struct __pyx_obj_6pandas_5algos_Node *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->width);
  __pyx_r = __pyx_v_self->width;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_6pandas_5algos_4Node_5width_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_6pandas_5algos_4Node_5width_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6pandas_5algos_4Node_5width_2__set__(((struct __pyx_obj_6pandas_5algos_Node *)__pyx_v_self), ((PyObject *)__pyx_v_value));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_6pandas_5algos_4Node_5width_2__set__(struct __pyx_obj_6pandas_5algos_Node *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__set__", 0);
  if (!(likely(PyList_CheckExact(__pyx_v_value))||((__pyx_v_value) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "list", Py_TYPE(__pyx_v_value)->tp_name), 0))) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 36; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_1 = __pyx_v_value;
  __Pyx_INCREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_self->width);
  __Pyx_DECREF(__pyx_v_self->width);
  __pyx_v_self->width = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pandas.algos.Node.width.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_6pandas_5algos_4Node_5width_5__del__(PyObject *__pyx_v_self); /*proto*/
static int __pyx_pw_6pandas_5algos_4Node_5width_5__del__(PyObject *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6pandas_5algos_4Node_5width_4__del__(((struct __pyx_obj_6pandas_5algos_Node *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_6pandas_5algos_4Node_5width_4__del__(struct __pyx_obj_6pandas_5algos_Node *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__", 0);
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_self->width);
  __Pyx_DECREF(__pyx_v_self->width);
  __pyx_v_self->width = ((PyObject*)Py_None);

  /* function exit code */
  __pyx_r = 0;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/src/skiplist.pyx":55
 *         Node head
 * 
 *     def __init__(self, expected_size=100):             # <<<<<<<<<<<<<<
 *         self.size = 0
 *         self.maxlevels = int(1 + Log2(expected_size))
 */

/* Python wrapper */
static int __pyx_pw_6pandas_5algos_17IndexableSkiplist_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_6pandas_5algos_17IndexableSkiplist_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_expected_size = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_expected_size,0};
    PyObject* values[1] = {0};
    values[0] = ((PyObject *)__pyx_int_100);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_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 (pos_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, pos_args, "__init__") < 0)) {__pyx_filename = __pyx_f[1]; __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[1]; __pyx_lineno = 55; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas.algos.IndexableSkiplist.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6pandas_5algos_17IndexableSkiplist___init__(((struct __pyx_obj_6pandas_5algos_IndexableSkiplist *)__pyx_v_self), __pyx_v_expected_size);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_6pandas_5algos_17IndexableSkiplist___init__(struct __pyx_obj_6pandas_5algos_IndexableSkiplist *__pyx_v_self, PyObject *__pyx_v_expected_size) {
  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;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__init__", 0);

  /* "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)
 */
  __pyx_v_self->size = 0;

  /* "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[1]; __pyx_lineno = 57; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_self->maxlevels = ((Py_ssize_t)(1.0 + __pyx_f_6pandas_5algos_Log2(__pyx_t_1)));

  /* "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_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 58; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_NaN); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __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_GetModuleGlobalName(__pyx_n_s_NIL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 58; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = PyList_New(1 * ((__pyx_v_self->maxlevels<0) ? 0:__pyx_v_self->maxlevels)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 58; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  { Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < __pyx_v_self->maxlevels; __pyx_temp++) {
      __Pyx_INCREF(__pyx_t_2);
      PyList_SET_ITEM(__pyx_t_4, __pyx_temp, __pyx_t_2);
      __Pyx_GIVEREF(__pyx_t_2);
    }
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyList_New(1 * ((__pyx_v_self->maxlevels<0) ? 0:__pyx_v_self->maxlevels)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 58; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  { Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < __pyx_v_self->maxlevels; __pyx_temp++) {
      __Pyx_INCREF(__pyx_int_1);
      PyList_SET_ITEM(__pyx_t_2, __pyx_temp, __pyx_int_1);
      __Pyx_GIVEREF(__pyx_int_1);
    }
  }
  __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 58; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__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);
  PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_3 = 0;
  __pyx_t_4 = 0;
  __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_6pandas_5algos_Node)), __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 58; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_GIVEREF(__pyx_t_2);
  __Pyx_GOTREF(__pyx_v_self->head);
  __Pyx_DECREF(((PyObject *)__pyx_v_self->head));
  __pyx_v_self->head = ((struct __pyx_obj_6pandas_5algos_Node *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "pandas/src/skiplist.pyx":55
 *         Node head
 * 
 *     def __init__(self, expected_size=100):             # <<<<<<<<<<<<<<
 *         self.size = 0
 *         self.maxlevels = int(1 + Log2(expected_size))
 */

  /* function exit code */
  __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_AddTraceback("pandas.algos.IndexableSkiplist.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/src/skiplist.pyx":60
 *         self.head = Node(np.NaN, [NIL] * self.maxlevels, [1] * self.maxlevels)
 * 
 *     def __len__(self):             # <<<<<<<<<<<<<<
 *         return self.size
 * 
 */

/* Python wrapper */
static Py_ssize_t __pyx_pw_6pandas_5algos_17IndexableSkiplist_3__len__(PyObject *__pyx_v_self); /*proto*/
static Py_ssize_t __pyx_pw_6pandas_5algos_17IndexableSkiplist_3__len__(PyObject *__pyx_v_self) {
  Py_ssize_t __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__len__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6pandas_5algos_17IndexableSkiplist_2__len__(((struct __pyx_obj_6pandas_5algos_IndexableSkiplist *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static Py_ssize_t __pyx_pf_6pandas_5algos_17IndexableSkiplist_2__len__(struct __pyx_obj_6pandas_5algos_IndexableSkiplist *__pyx_v_self) {
  Py_ssize_t __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__len__", 0);

  /* "pandas/src/skiplist.pyx":61
 * 
 *     def __len__(self):
 *         return self.size             # <<<<<<<<<<<<<<
 * 
 *     def __getitem__(self, i):
 */
  __pyx_r = __pyx_v_self->size;
  goto __pyx_L0;

  /* "pandas/src/skiplist.pyx":60
 *         self.head = Node(np.NaN, [NIL] * self.maxlevels, [1] * self.maxlevels)
 * 
 *     def __len__(self):             # <<<<<<<<<<<<<<
 *         return self.size
 * 
 */

  /* function exit code */
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/src/skiplist.pyx":63
 *         return self.size
 * 
 *     def __getitem__(self, i):             # <<<<<<<<<<<<<<
 *         return self.get(i)
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pandas_5algos_17IndexableSkiplist_5__getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_i); /*proto*/
static PyObject *__pyx_pw_6pandas_5algos_17IndexableSkiplist_5__getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_i) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__getitem__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6pandas_5algos_17IndexableSkiplist_4__getitem__(((struct __pyx_obj_6pandas_5algos_IndexableSkiplist *)__pyx_v_self), ((PyObject *)__pyx_v_i));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pandas_5algos_17IndexableSkiplist_4__getitem__(struct __pyx_obj_6pandas_5algos_IndexableSkiplist *__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__", 0);

  /* "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[1]; __pyx_lineno = 64; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_2 = ((struct __pyx_vtabstruct_6pandas_5algos_IndexableSkiplist *)__pyx_v_self->__pyx_vtab)->get(__pyx_v_self, __pyx_t_1, 0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __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;

  /* "pandas/src/skiplist.pyx":63
 *         return self.size
 * 
 *     def __getitem__(self, i):             # <<<<<<<<<<<<<<
 *         return self.get(i)
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pandas.algos.IndexableSkiplist.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "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_pw_6pandas_5algos_17IndexableSkiplist_7get(PyObject *__pyx_v_self, PyObject *__pyx_arg_i); /*proto*/
static PyObject *__pyx_f_6pandas_5algos_17IndexableSkiplist_get(struct __pyx_obj_6pandas_5algos_IndexableSkiplist *__pyx_v_self, Py_ssize_t __pyx_v_i, int __pyx_skip_dispatch) {
  Py_ssize_t __pyx_v_level;
  struct __pyx_obj_6pandas_5algos_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", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_get); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __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) != (PyCFunction)__pyx_pw_6pandas_5algos_17IndexableSkiplist_7get)) {
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_i); 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_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 66; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__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 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, NULL); 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_DECREF(__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;
  }

  /* "pandas/src/skiplist.pyx":70
 *         cdef Node node
 * 
 *         node = self.head             # <<<<<<<<<<<<<<
 *         i += 1
 * 
 */
  __pyx_t_1 = ((PyObject *)__pyx_v_self->head);
  __Pyx_INCREF(__pyx_t_1);
  __pyx_v_node = ((struct __pyx_obj_6pandas_5algos_Node *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "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);

  /* "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;

    /* "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) {
      if (unlikely(__pyx_v_node->width == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        {__pyx_filename = __pyx_f[1]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_t_1 = __Pyx_GetItemInt_List(__pyx_v_node->width, __pyx_v_level, Py_ssize_t, 1, PyInt_FromSsize_t, 1, 1, 1); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[1]; __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[1]; __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); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 74; __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;
      __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (!__pyx_t_5) break;

      /* "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[1]; __pyx_lineno = 75; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      if (unlikely(__pyx_v_node->width == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        {__pyx_filename = __pyx_f[1]; __pyx_lineno = 75; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_t_2 = __Pyx_GetItemInt_List(__pyx_v_node->width, __pyx_v_level, Py_ssize_t, 1, PyInt_FromSsize_t, 1, 1, 1); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[1]; __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[1]; __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[1]; __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;

      /* "pandas/src/skiplist.pyx":76
 *             while node.width[level] <= i:
 *                 i -= node.width[level]
 *                 node = node.next[level]             # <<<<<<<<<<<<<<
 * 
 * 
 */
      if (unlikely(__pyx_v_node->next == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        {__pyx_filename = __pyx_f[1]; __pyx_lineno = 76; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_t_1 = __Pyx_GetItemInt_List(__pyx_v_node->next, __pyx_v_level, Py_ssize_t, 1, PyInt_FromSsize_t, 1, 1, 1); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[1]; __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_5algos_Node))))) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 76; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF_SET(__pyx_v_node, ((struct __pyx_obj_6pandas_5algos_Node *)__pyx_t_1));
      __pyx_t_1 = 0;
    }
  }

  /* "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[1]; __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;

  /* "pandas/src/skiplist.pyx":66
 *         return self.get(i)
 * 
 *     cpdef get(self, Py_ssize_t i):             # <<<<<<<<<<<<<<
 *         cdef Py_ssize_t level
 *         cdef Node node
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pandas.algos.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;
}

/* Python wrapper */
static PyObject *__pyx_pw_6pandas_5algos_17IndexableSkiplist_7get(PyObject *__pyx_v_self, PyObject *__pyx_arg_i); /*proto*/
static PyObject *__pyx_pw_6pandas_5algos_17IndexableSkiplist_7get(PyObject *__pyx_v_self, PyObject *__pyx_arg_i) {
  Py_ssize_t __pyx_v_i;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get (wrapper)", 0);
  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[1]; __pyx_lineno = 66; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas.algos.IndexableSkiplist.get", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6pandas_5algos_17IndexableSkiplist_6get(((struct __pyx_obj_6pandas_5algos_IndexableSkiplist *)__pyx_v_self), ((Py_ssize_t)__pyx_v_i));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pandas_5algos_17IndexableSkiplist_6get(struct __pyx_obj_6pandas_5algos_IndexableSkiplist *__pyx_v_self, 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", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((struct __pyx_vtabstruct_6pandas_5algos_IndexableSkiplist *)__pyx_v_self->__pyx_vtab)->get(__pyx_v_self, __pyx_v_i, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __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;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pandas.algos.IndexableSkiplist.get", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "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_pw_6pandas_5algos_17IndexableSkiplist_9insert(PyObject *__pyx_v_self, PyObject *__pyx_arg_value); /*proto*/
static PyObject *__pyx_f_6pandas_5algos_17IndexableSkiplist_insert(struct __pyx_obj_6pandas_5algos_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_5algos_Node *__pyx_v_node = 0;
  struct __pyx_obj_6pandas_5algos_Node *__pyx_v_prevnode = 0;
  struct __pyx_obj_6pandas_5algos_Node *__pyx_v_newnode = 0;
  struct __pyx_obj_6pandas_5algos_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;
  Py_ssize_t __pyx_t_8;
  Py_ssize_t __pyx_t_9;
  PyObject *__pyx_t_10 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("insert", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_insert); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __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) != (PyCFunction)__pyx_pw_6pandas_5algos_17IndexableSkiplist_9insert)) {
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_2 = PyFloat_FromDouble(__pyx_v_value); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __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[1]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__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 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 81; __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;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "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 * ((__pyx_v_self->maxlevels<0) ? 0:__pyx_v_self->maxlevels)); 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);
  { Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < __pyx_v_self->maxlevels; __pyx_temp++) {
      __Pyx_INCREF(Py_None);
      PyList_SET_ITEM(__pyx_t_1, __pyx_temp, Py_None);
      __Pyx_GIVEREF(Py_None);
    }
  }
  __pyx_v_chain = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "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_1 = PyList_New(1 * ((__pyx_v_self->maxlevels<0) ? 0:__pyx_v_self->maxlevels)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 88; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  { Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < __pyx_v_self->maxlevels; __pyx_temp++) {
      __Pyx_INCREF(__pyx_int_0);
      PyList_SET_ITEM(__pyx_t_1, __pyx_temp, __pyx_int_0);
      __Pyx_GIVEREF(__pyx_int_0);
    }
  }
  __pyx_v_steps_at_level = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "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_t_1 = ((PyObject *)__pyx_v_self->head);
  __Pyx_INCREF(__pyx_t_1);
  __pyx_v_node = ((struct __pyx_obj_6pandas_5algos_Node *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "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;

    /* "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:
 */
    if (unlikely(__pyx_v_node->next == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      {__pyx_filename = __pyx_f[1]; __pyx_lineno = 92; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_1 = __Pyx_GetItemInt_List(__pyx_v_node->next, __pyx_v_level, Py_ssize_t, 1, PyInt_FromSsize_t, 1, 1, 1); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[1]; __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_5algos_Node))))) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 92; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_XDECREF_SET(__pyx_v_next_at_level, ((struct __pyx_obj_6pandas_5algos_Node *)__pyx_t_1));
    __pyx_t_1 = 0;

    /* "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) != 0);
      if (!__pyx_t_5) break;

      /* "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(__pyx_v_steps_at_level, __pyx_v_level, Py_ssize_t, 1, PyInt_FromSsize_t, 1, 1, 1); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 95; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
      __Pyx_GOTREF(__pyx_t_1);

      /* "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]
 */
      if (unlikely(__pyx_v_node->width == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        {__pyx_filename = __pyx_f[1]; __pyx_lineno = 96; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_t_2 = __Pyx_GetItemInt_List(__pyx_v_node->width, __pyx_v_level, Py_ssize_t, 1, PyInt_FromSsize_t, 1, 1, 1); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 96; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
      __Pyx_GOTREF(__pyx_t_2);

      /* "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_3 = PyNumber_Add(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __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;
      if (unlikely(__Pyx_SetItemInt(__pyx_v_steps_at_level, __pyx_v_level, __pyx_t_3, Py_ssize_t, 1, PyInt_FromSsize_t, 1, 1, 1) < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 95; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

      /* "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_SET(__pyx_v_node, __pyx_v_next_at_level);

      /* "pandas/src/skiplist.pyx":98
 *                                          node.width[level])
 *                 node = next_at_level
 *                 next_at_level = node.next[level]             # <<<<<<<<<<<<<<
 * 
 *             chain[level] = node
 */
      if (unlikely(__pyx_v_node->next == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        {__pyx_filename = __pyx_f[1]; __pyx_lineno = 98; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_t_3 = __Pyx_GetItemInt_List(__pyx_v_node->next, __pyx_v_level, Py_ssize_t, 1, PyInt_FromSsize_t, 1, 1, 1); if (unlikely(__pyx_t_3 == NULL)) {__pyx_filename = __pyx_f[1]; __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_5algos_Node))))) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 98; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF_SET(__pyx_v_next_at_level, ((struct __pyx_obj_6pandas_5algos_Node *)__pyx_t_3));
      __pyx_t_3 = 0;
    }

    /* "pandas/src/skiplist.pyx":100
 *                 next_at_level = node.next[level]
 * 
 *             chain[level] = node             # <<<<<<<<<<<<<<
 * 
 *         # insert a link to the newnode at each level
 */
    if (unlikely(__Pyx_SetItemInt(__pyx_v_chain, __pyx_v_level, ((PyObject *)__pyx_v_node), Py_ssize_t, 1, PyInt_FromSsize_t, 1, 1, 1) < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 100; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }

  /* "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_GetModuleGlobalName(__pyx_n_s_random); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 103; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __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[1]; __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_5algos_Log2(__pyx_t_6)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __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[1]; __pyx_lineno = 103; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__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 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyInt_Type))), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __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_3 = PyNumber_Subtract(__pyx_int_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __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[1]; __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); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 103; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __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[1]; __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[1]; __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[1]; __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;

  /* "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[1]; __pyx_lineno = 104; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyList_New(1 * ((__pyx_v_d<0) ? 0:__pyx_v_d)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 104; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  { Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < __pyx_v_d; __pyx_temp++) {
      __Pyx_INCREF(Py_None);
      PyList_SET_ITEM(__pyx_t_3, __pyx_temp, Py_None);
      __Pyx_GIVEREF(Py_None);
    }
  }
  __pyx_t_7 = PyList_New(1 * ((__pyx_v_d<0) ? 0:__pyx_v_d)); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 104; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_7);
  { Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < __pyx_v_d; __pyx_temp++) {
      __Pyx_INCREF(Py_None);
      PyList_SET_ITEM(__pyx_t_7, __pyx_temp, Py_None);
      __Pyx_GIVEREF(Py_None);
    }
  }
  __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 104; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_3);
  PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_t_7);
  __Pyx_GIVEREF(__pyx_t_7);
  __pyx_t_2 = 0;
  __pyx_t_3 = 0;
  __pyx_t_7 = 0;
  __pyx_t_7 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_6pandas_5algos_Node)), __pyx_t_1, NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 104; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_newnode = ((struct __pyx_obj_6pandas_5algos_Node *)__pyx_t_7);
  __pyx_t_7 = 0;

  /* "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;

  /* "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_8 = 0; __pyx_t_8 < __pyx_t_4; __pyx_t_8+=1) {
    __pyx_v_level = __pyx_t_8;

    /* "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_7 = __Pyx_GetItemInt_List(__pyx_v_chain, __pyx_v_level, Py_ssize_t, 1, PyInt_FromSsize_t, 1, 1, 1); if (unlikely(__pyx_t_7 == NULL)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 108; __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_5algos_Node))))) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 108; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_XDECREF_SET(__pyx_v_prevnode, ((struct __pyx_obj_6pandas_5algos_Node *)__pyx_t_7));
    __pyx_t_7 = 0;

    /* "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)
 */
    if (unlikely(__pyx_v_prevnode->next == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      {__pyx_filename = __pyx_f[1]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_7 = __Pyx_GetItemInt_List(__pyx_v_prevnode->next, __pyx_v_level, Py_ssize_t, 1, PyInt_FromSsize_t, 1, 1, 1); if (unlikely(__pyx_t_7 == NULL)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
    __Pyx_GOTREF(__pyx_t_7);
    if (unlikely(__pyx_v_newnode->next == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      {__pyx_filename = __pyx_f[1]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    if (unlikely(__Pyx_SetItemInt(__pyx_v_newnode->next, __pyx_v_level, __pyx_t_7, Py_ssize_t, 1, PyInt_FromSsize_t, 1, 1, 1) < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

    /* "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 (unlikely(__pyx_v_prevnode->next == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      {__pyx_filename = __pyx_f[1]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    if (unlikely(__Pyx_SetItemInt(__pyx_v_prevnode->next, __pyx_v_level, ((PyObject *)__pyx_v_newnode), Py_ssize_t, 1, PyInt_FromSsize_t, 1, 1, 1) < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

    /* "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]
 */
    if (unlikely(__pyx_v_prevnode->width == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      {__pyx_filename = __pyx_f[1]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_7 = __Pyx_GetItemInt_List(__pyx_v_prevnode->width, __pyx_v_level, Py_ssize_t, 1, PyInt_FromSsize_t, 1, 1, 1); if (unlikely(__pyx_t_7 == NULL)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_steps); 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_3 = PyNumber_Subtract(__pyx_t_7, __pyx_t_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (unlikely(__pyx_v_newnode->width == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      {__pyx_filename = __pyx_f[1]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    if (unlikely(__Pyx_SetItemInt(__pyx_v_newnode->width, __pyx_v_level, __pyx_t_3, Py_ssize_t, 1, PyInt_FromSsize_t, 1, 1, 1) < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "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_3 = PyInt_FromSsize_t((__pyx_v_steps + 1)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 112; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    if (unlikely(__pyx_v_prevnode->width == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      {__pyx_filename = __pyx_f[1]; __pyx_lineno = 112; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    if (unlikely(__Pyx_SetItemInt(__pyx_v_prevnode->width, __pyx_v_level, __pyx_t_3, Py_ssize_t, 1, PyInt_FromSsize_t, 1, 1, 1) < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 112; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "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_3 = PyInt_FromSsize_t(__pyx_v_steps); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 113; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_1 = __Pyx_GetItemInt_List(__pyx_v_steps_at_level, __pyx_v_level, Py_ssize_t, 1, PyInt_FromSsize_t, 1, 1, 1); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 113; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_7 = PyNumber_InPlaceAdd(__pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 113; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_t_7); if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 113; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __pyx_v_steps = __pyx_t_9;
  }

  /* "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_8 = __pyx_v_d; __pyx_t_8 < __pyx_t_4; __pyx_t_8+=1) {
    __pyx_v_level = __pyx_t_8;

    /* "pandas/src/skiplist.pyx":116
 * 
 *         for level in range(d, self.maxlevels):
 *             (<Node> chain[level]).width[level] += 1             # <<<<<<<<<<<<<<
 * 
 *         self.size += 1
 */
    __pyx_t_7 = __Pyx_GetItemInt_List(__pyx_v_chain, __pyx_v_level, Py_ssize_t, 1, PyInt_FromSsize_t, 1, 1, 1); if (unlikely(__pyx_t_7 == NULL)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
    __Pyx_GOTREF(__pyx_t_7);
    if (unlikely(((struct __pyx_obj_6pandas_5algos_Node *)__pyx_t_7)->width == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      {__pyx_filename = __pyx_f[1]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __Pyx_INCREF(((struct __pyx_obj_6pandas_5algos_Node *)__pyx_t_7)->width);
    __pyx_t_10 = ((struct __pyx_obj_6pandas_5algos_Node *)__pyx_t_7)->width;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __pyx_t_9 = __pyx_v_level;
    if (unlikely(__pyx_t_10 == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      {__pyx_filename = __pyx_f[1]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_7 = __Pyx_GetItemInt_List(__pyx_t_10, __pyx_t_9, Py_ssize_t, 1, PyInt_FromSsize_t, 1, 1, 1); if (unlikely(__pyx_t_7 == NULL)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_1 = PyNumber_InPlaceAdd(__pyx_t_7, __pyx_int_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    if (unlikely(__pyx_t_10 == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      {__pyx_filename = __pyx_f[1]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    if (unlikely(__Pyx_SetItemInt(__pyx_t_10, __pyx_t_9, __pyx_t_1, Py_ssize_t, 1, PyInt_FromSsize_t, 1, 1, 1) < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  }

  /* "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);

  /* "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
 */

  /* function exit code */
  __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_10);
  __Pyx_AddTraceback("pandas.algos.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;
}

/* Python wrapper */
static PyObject *__pyx_pw_6pandas_5algos_17IndexableSkiplist_9insert(PyObject *__pyx_v_self, PyObject *__pyx_arg_value); /*proto*/
static PyObject *__pyx_pw_6pandas_5algos_17IndexableSkiplist_9insert(PyObject *__pyx_v_self, PyObject *__pyx_arg_value) {
  double __pyx_v_value;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("insert (wrapper)", 0);
  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[1]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas.algos.IndexableSkiplist.insert", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6pandas_5algos_17IndexableSkiplist_8insert(((struct __pyx_obj_6pandas_5algos_IndexableSkiplist *)__pyx_v_self), ((double)__pyx_v_value));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pandas_5algos_17IndexableSkiplist_8insert(struct __pyx_obj_6pandas_5algos_IndexableSkiplist *__pyx_v_self, 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", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((struct __pyx_vtabstruct_6pandas_5algos_IndexableSkiplist *)__pyx_v_self->__pyx_vtab)->insert(__pyx_v_self, __pyx_v_value, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __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;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pandas.algos.IndexableSkiplist.insert", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "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_pw_6pandas_5algos_17IndexableSkiplist_11remove(PyObject *__pyx_v_self, PyObject *__pyx_arg_value); /*proto*/
static PyObject *__pyx_f_6pandas_5algos_17IndexableSkiplist_remove(struct __pyx_obj_6pandas_5algos_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_5algos_Node *__pyx_v_node = 0;
  struct __pyx_obj_6pandas_5algos_Node *__pyx_v_prevnode = 0;
  struct __pyx_obj_6pandas_5algos_Node *__pyx_v_tmpnode = 0;
  struct __pyx_obj_6pandas_5algos_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", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_remove); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __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) != (PyCFunction)__pyx_pw_6pandas_5algos_17IndexableSkiplist_11remove)) {
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_2 = PyFloat_FromDouble(__pyx_v_value); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __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[1]; __pyx_lineno = 120; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__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 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 120; __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;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "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 * ((__pyx_v_self->maxlevels<0) ? 0:__pyx_v_self->maxlevels)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 126; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  { Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < __pyx_v_self->maxlevels; __pyx_temp++) {
      __Pyx_INCREF(Py_None);
      PyList_SET_ITEM(__pyx_t_1, __pyx_temp, Py_None);
      __Pyx_GIVEREF(Py_None);
    }
  }
  __pyx_v_chain = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "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_t_1 = ((PyObject *)__pyx_v_self->head);
  __Pyx_INCREF(__pyx_t_1);
  __pyx_v_node = ((struct __pyx_obj_6pandas_5algos_Node *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "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;

    /* "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
 */
    if (unlikely(__pyx_v_node->next == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      {__pyx_filename = __pyx_f[1]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_1 = __Pyx_GetItemInt_List(__pyx_v_node->next, __pyx_v_level, Py_ssize_t, 1, PyInt_FromSsize_t, 1, 1, 1); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 130; __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_5algos_Node))))) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_XDECREF_SET(__pyx_v_next_at_level, ((struct __pyx_obj_6pandas_5algos_Node *)__pyx_t_1));
    __pyx_t_1 = 0;

    /* "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) != 0);
      if (!__pyx_t_5) break;

      /* "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_SET(__pyx_v_node, __pyx_v_next_at_level);

      /* "pandas/src/skiplist.pyx":133
 *             while next_at_level.value < value:
 *                 node = next_at_level
 *                 next_at_level = node.next[level]             # <<<<<<<<<<<<<<
 * 
 *             chain[level] = node
 */
      if (unlikely(__pyx_v_node->next == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        {__pyx_filename = __pyx_f[1]; __pyx_lineno = 133; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_t_1 = __Pyx_GetItemInt_List(__pyx_v_node->next, __pyx_v_level, Py_ssize_t, 1, PyInt_FromSsize_t, 1, 1, 1); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 133; __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_5algos_Node))))) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 133; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF_SET(__pyx_v_next_at_level, ((struct __pyx_obj_6pandas_5algos_Node *)__pyx_t_1));
      __pyx_t_1 = 0;
    }

    /* "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 (unlikely(__Pyx_SetItemInt(__pyx_v_chain, __pyx_v_level, ((PyObject *)__pyx_v_node), Py_ssize_t, 1, PyInt_FromSsize_t, 1, 1, 1) < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 135; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }

  /* "pandas/src/skiplist.pyx":137
 *             chain[level] = node
 * 
 *         if value != (<Node> (<Node> (<Node> chain[0]).next)[0]).value:             # <<<<<<<<<<<<<<
 *             raise KeyError('Not Found')
 * 
 */
  __pyx_t_1 = __Pyx_GetItemInt_List(__pyx_v_chain, 0, long, 1, __Pyx_PyInt_From_long, 1, 0, 1); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 137; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_GetItemInt(((struct __pyx_obj_6pandas_5algos_Node *)__pyx_t_1)->next, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 137; __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_v_value != ((struct __pyx_obj_6pandas_5algos_Node *)__pyx_t_2)->value) != 0);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__pyx_t_5) {

    /* "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 = __Pyx_PyObject_Call(__pyx_builtin_KeyError, __pyx_tuple_, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __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[1]; __pyx_lineno = 138; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }

  /* "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(__pyx_v_chain, 0, long, 1, __Pyx_PyInt_From_long, 1, 0, 1); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 141; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = __Pyx_GetItemInt(((struct __pyx_obj_6pandas_5algos_Node *)__pyx_t_2)->next, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 141; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = ((struct __pyx_obj_6pandas_5algos_Node *)__pyx_t_1)->next;
  __Pyx_INCREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (unlikely(__pyx_t_2 == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
    {__pyx_filename = __pyx_f[1]; __pyx_lineno = 141; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_4 = PyList_GET_SIZE(__pyx_t_2); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 141; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_d = __pyx_t_4;

  /* "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;

    /* "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(__pyx_v_chain, __pyx_v_level, Py_ssize_t, 1, PyInt_FromSsize_t, 1, 1, 1); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[1]; __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_5algos_Node))))) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 144; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_XDECREF_SET(__pyx_v_prevnode, ((struct __pyx_obj_6pandas_5algos_Node *)__pyx_t_2));
    __pyx_t_2 = 0;

    /* "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]
 */
    if (unlikely(__pyx_v_prevnode->next == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      {__pyx_filename = __pyx_f[1]; __pyx_lineno = 145; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_2 = __Pyx_GetItemInt_List(__pyx_v_prevnode->next, __pyx_v_level, Py_ssize_t, 1, PyInt_FromSsize_t, 1, 1, 1); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[1]; __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_5algos_Node))))) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 145; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_XDECREF_SET(__pyx_v_tmpnode, ((struct __pyx_obj_6pandas_5algos_Node *)__pyx_t_2));
    __pyx_t_2 = 0;

    /* "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]
 * 
 */
    if (unlikely(__pyx_v_prevnode->width == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      {__pyx_filename = __pyx_f[1]; __pyx_lineno = 146; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __Pyx_INCREF(__pyx_v_prevnode->width);
    __pyx_t_7 = __pyx_v_prevnode->width;
    __pyx_t_8 = __pyx_v_level;
    if (unlikely(__pyx_t_7 == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      {__pyx_filename = __pyx_f[1]; __pyx_lineno = 146; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_2 = __Pyx_GetItemInt_List(__pyx_t_7, __pyx_t_8, Py_ssize_t, 1, PyInt_FromSsize_t, 1, 1, 1); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 146; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
    __Pyx_GOTREF(__pyx_t_2);
    if (unlikely(__pyx_v_tmpnode->width == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      {__pyx_filename = __pyx_f[1]; __pyx_lineno = 146; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_1 = __Pyx_GetItemInt_List(__pyx_v_tmpnode->width, __pyx_v_level, Py_ssize_t, 1, PyInt_FromSsize_t, 1, 1, 1); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 146; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = PyNumber_Subtract(__pyx_t_1, __pyx_int_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 146; __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_InPlaceAdd(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 146; __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;
    if (unlikely(__pyx_t_7 == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      {__pyx_filename = __pyx_f[1]; __pyx_lineno = 146; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    if (unlikely(__Pyx_SetItemInt(__pyx_t_7, __pyx_t_8, __pyx_t_1, Py_ssize_t, 1, PyInt_FromSsize_t, 1, 1, 1) < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 146; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

    /* "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):
 */
    if (unlikely(__pyx_v_tmpnode->next == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      {__pyx_filename = __pyx_f[1]; __pyx_lineno = 147; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_1 = __Pyx_GetItemInt_List(__pyx_v_tmpnode->next, __pyx_v_level, Py_ssize_t, 1, PyInt_FromSsize_t, 1, 1, 1); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 147; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
    __Pyx_GOTREF(__pyx_t_1);
    if (unlikely(__pyx_v_prevnode->next == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      {__pyx_filename = __pyx_f[1]; __pyx_lineno = 147; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    if (unlikely(__Pyx_SetItemInt(__pyx_v_prevnode->next, __pyx_v_level, __pyx_t_1, Py_ssize_t, 1, PyInt_FromSsize_t, 1, 1, 1) < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 147; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "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;

    /* "pandas/src/skiplist.pyx":150
 * 
 *         for level in range(d, self.maxlevels):
 *             tmpnode = chain[level]             # <<<<<<<<<<<<<<
 *             tmpnode.width[level] -= 1
 * 
 */
    __pyx_t_1 = __Pyx_GetItemInt_List(__pyx_v_chain, __pyx_v_level, Py_ssize_t, 1, PyInt_FromSsize_t, 1, 1, 1); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 150; __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_5algos_Node))))) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 150; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_XDECREF_SET(__pyx_v_tmpnode, ((struct __pyx_obj_6pandas_5algos_Node *)__pyx_t_1));
    __pyx_t_1 = 0;

    /* "pandas/src/skiplist.pyx":151
 *         for level in range(d, self.maxlevels):
 *             tmpnode = chain[level]
 *             tmpnode.width[level] -= 1             # <<<<<<<<<<<<<<
 * 
 *         self.size -= 1
 */
    if (unlikely(__pyx_v_tmpnode->width == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      {__pyx_filename = __pyx_f[1]; __pyx_lineno = 151; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __Pyx_INCREF(__pyx_v_tmpnode->width);
    __pyx_t_7 = __pyx_v_tmpnode->width;
    __pyx_t_8 = __pyx_v_level;
    if (unlikely(__pyx_t_7 == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      {__pyx_filename = __pyx_f[1]; __pyx_lineno = 151; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_1 = __Pyx_GetItemInt_List(__pyx_t_7, __pyx_t_8, Py_ssize_t, 1, PyInt_FromSsize_t, 1, 1, 1); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 151; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = PyNumber_InPlaceSubtract(__pyx_t_1, __pyx_int_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 151; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (unlikely(__pyx_t_7 == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      {__pyx_filename = __pyx_f[1]; __pyx_lineno = 151; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    if (unlikely(__Pyx_SetItemInt(__pyx_t_7, __pyx_t_8, __pyx_t_3, Py_ssize_t, 1, PyInt_FromSsize_t, 1, 1, 1) < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 151; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  }

  /* "pandas/src/skiplist.pyx":153
 *             tmpnode.width[level] -= 1
 * 
 *         self.size -= 1             # <<<<<<<<<<<<<<
 */
  __pyx_v_self->size = (__pyx_v_self->size - 1);

  /* "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
 */

  /* function exit code */
  __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_AddTraceback("pandas.algos.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;
}

/* Python wrapper */
static PyObject *__pyx_pw_6pandas_5algos_17IndexableSkiplist_11remove(PyObject *__pyx_v_self, PyObject *__pyx_arg_value); /*proto*/
static PyObject *__pyx_pw_6pandas_5algos_17IndexableSkiplist_11remove(PyObject *__pyx_v_self, PyObject *__pyx_arg_value) {
  double __pyx_v_value;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("remove (wrapper)", 0);
  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[1]; __pyx_lineno = 120; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas.algos.IndexableSkiplist.remove", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6pandas_5algos_17IndexableSkiplist_10remove(((struct __pyx_obj_6pandas_5algos_IndexableSkiplist *)__pyx_v_self), ((double)__pyx_v_value));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pandas_5algos_17IndexableSkiplist_10remove(struct __pyx_obj_6pandas_5algos_IndexableSkiplist *__pyx_v_self, 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", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((struct __pyx_vtabstruct_6pandas_5algos_IndexableSkiplist *)__pyx_v_self->__pyx_vtab)->remove(__pyx_v_self, __pyx_v_value, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __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;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pandas.algos.IndexableSkiplist.remove", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/algos.pyx":93
 * # from cython cimport floating, integral
 * 
 * cdef _take_2d_float64(ndarray[float64_t, ndim=2] values,             # <<<<<<<<<<<<<<
 *                       object idx):
 *     cdef:
 */

static PyObject *__pyx_f_6pandas_5algos__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;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_indexer;
  __Pyx_Buffer __pyx_pybuffer_indexer;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_result;
  __Pyx_Buffer __pyx_pybuffer_result;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_values;
  __Pyx_Buffer __pyx_pybuffer_values;
  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;
  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;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_take_2d_float64", 0);
  __pyx_pybuffer_indexer.pybuffer.buf = NULL;
  __pyx_pybuffer_indexer.refcount = 0;
  __pyx_pybuffernd_indexer.data = NULL;
  __pyx_pybuffernd_indexer.rcbuffer = &__pyx_pybuffer_indexer;
  __pyx_pybuffer_result.pybuffer.buf = NULL;
  __pyx_pybuffer_result.refcount = 0;
  __pyx_pybuffernd_result.data = NULL;
  __pyx_pybuffernd_result.rcbuffer = &__pyx_pybuffer_result;
  __pyx_pybuffer_values.pybuffer.buf = NULL;
  __pyx_pybuffer_values.refcount = 0;
  __pyx_pybuffernd_values.data = NULL;
  __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values;
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (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[0]; __pyx_lineno = 93; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_values.diminfo[1].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_values.diminfo[1].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[1];

  /* "pandas/algos.pyx":97
 *     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[0]; __pyx_lineno = 97; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_1 = __pyx_v_idx;
  __Pyx_INCREF(__pyx_t_1);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer, (PyObject*)((PyArrayObject *)__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_pybuffernd_indexer.rcbuffer->pybuffer.buf = NULL;
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 97; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    } else {__pyx_pybuffernd_indexer.diminfo[0].strides = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_indexer.diminfo[0].shape = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_indexer.diminfo[1].strides = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_indexer.diminfo[1].shape = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.shape[1];
    }
  }
  __pyx_v_indexer = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pandas/algos.pyx":101
 *         object val
 * 
 *     N, K = (<object> values).shape             # <<<<<<<<<<<<<<
 *     result = np.empty_like(values)
 *     for i in range(N):
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_values), __pyx_n_s_shape); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 101; __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 CYTHON_COMPILING_IN_CPYTHON
    Py_ssize_t size = Py_SIZE(sequence);
    #else
    Py_ssize_t size = PySequence_Size(sequence);
    #endif
    if (unlikely(size != 2)) {
      if (size > 2) __Pyx_RaiseTooManyValuesError(2);
      else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 101; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    #if CYTHON_COMPILING_IN_CPYTHON
    if (likely(PyTuple_CheckExact(sequence))) {
      __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); 
      __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1); 
    } else {
      __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);
    #else
    __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 101; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 101; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    #endif
    __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[0]; __pyx_lineno = 101; __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_L3_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_L3_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_3);
    if (__Pyx_IternextUnpackEndCheck(__pyx_t_5(__pyx_t_4), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 101; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_5 = NULL;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    goto __pyx_L4_unpacking_done;
    __pyx_L3_unpacking_failed:;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_5 = NULL;
    if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 101; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_L4_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[0]; __pyx_lineno = 101; __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[0]; __pyx_lineno = 101; __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;

  /* "pandas/algos.pyx":102
 * 
 *     N, K = (<object> values).shape
 *     result = np.empty_like(values)             # <<<<<<<<<<<<<<
 *     for i in range(N):
 *         for j in range(K):
 */
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 102; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_empty_like); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 102; __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[0]; __pyx_lineno = 102; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__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_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 102; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__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[0]; __pyx_lineno = 102; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_8 = ((PyArrayObject *)__pyx_t_2);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer);
    __pyx_t_9 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_result.rcbuffer->pybuffer, (PyObject*)__pyx_t_8, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_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_pybuffernd_result.rcbuffer->pybuffer, (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_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_pybuffernd_result.diminfo[0].strides = __pyx_pybuffernd_result.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_result.diminfo[0].shape = __pyx_pybuffernd_result.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_result.diminfo[1].strides = __pyx_pybuffernd_result.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_result.diminfo[1].shape = __pyx_pybuffernd_result.rcbuffer->pybuffer.shape[1];
    if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 102; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_8 = 0;
  __pyx_v_result = ((PyArrayObject *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "pandas/algos.pyx":103
 *     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_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;

    /* "pandas/algos.pyx":104
 *     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_13 = __pyx_v_K;
    for (__pyx_t_14 = 0; __pyx_t_14 < __pyx_t_13; __pyx_t_14+=1) {
      __pyx_v_j = __pyx_t_14;

      /* "pandas/algos.pyx":105
 *     for i in range(N):
 *         for j in range(K):
 *             result[i, j] = values[i, indexer[i, j]]             # <<<<<<<<<<<<<<
 *     return result
 * 
 */
      __pyx_t_15 = __pyx_v_i;
      __pyx_t_16 = __pyx_v_j;
      __pyx_t_9 = -1;
      if (__pyx_t_15 < 0) {
        __pyx_t_15 += __pyx_pybuffernd_indexer.diminfo[0].shape;
        if (unlikely(__pyx_t_15 < 0)) __pyx_t_9 = 0;
      } else if (unlikely(__pyx_t_15 >= __pyx_pybuffernd_indexer.diminfo[0].shape)) __pyx_t_9 = 0;
      if (__pyx_t_16 < 0) {
        __pyx_t_16 += __pyx_pybuffernd_indexer.diminfo[1].shape;
        if (unlikely(__pyx_t_16 < 0)) __pyx_t_9 = 1;
      } else if (unlikely(__pyx_t_16 >= __pyx_pybuffernd_indexer.diminfo[1].shape)) __pyx_t_9 = 1;
      if (unlikely(__pyx_t_9 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_9);
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 105; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_t_17 = __pyx_v_i;
      __pyx_t_18 = (*__Pyx_BufPtrStrided2d(Py_ssize_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_indexer.diminfo[0].strides, __pyx_t_16, __pyx_pybuffernd_indexer.diminfo[1].strides));
      __pyx_t_9 = -1;
      if (__pyx_t_17 < 0) {
        __pyx_t_17 += __pyx_pybuffernd_values.diminfo[0].shape;
        if (unlikely(__pyx_t_17 < 0)) __pyx_t_9 = 0;
      } else if (unlikely(__pyx_t_17 >= __pyx_pybuffernd_values.diminfo[0].shape)) __pyx_t_9 = 0;
      if (__pyx_t_18 < 0) {
        __pyx_t_18 += __pyx_pybuffernd_values.diminfo[1].shape;
        if (unlikely(__pyx_t_18 < 0)) __pyx_t_9 = 1;
      } else if (unlikely(__pyx_t_18 >= __pyx_pybuffernd_values.diminfo[1].shape)) __pyx_t_9 = 1;
      if (unlikely(__pyx_t_9 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_9);
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 105; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_t_19 = __pyx_v_i;
      __pyx_t_20 = __pyx_v_j;
      __pyx_t_9 = -1;
      if (__pyx_t_19 < 0) {
        __pyx_t_19 += __pyx_pybuffernd_result.diminfo[0].shape;
        if (unlikely(__pyx_t_19 < 0)) __pyx_t_9 = 0;
      } else if (unlikely(__pyx_t_19 >= __pyx_pybuffernd_result.diminfo[0].shape)) __pyx_t_9 = 0;
      if (__pyx_t_20 < 0) {
        __pyx_t_20 += __pyx_pybuffernd_result.diminfo[1].shape;
        if (unlikely(__pyx_t_20 < 0)) __pyx_t_9 = 1;
      } else if (unlikely(__pyx_t_20 >= __pyx_pybuffernd_result.diminfo[1].shape)) __pyx_t_9 = 1;
      if (unlikely(__pyx_t_9 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_9);
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 105; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_19, __pyx_pybuffernd_result.diminfo[0].strides, __pyx_t_20, __pyx_pybuffernd_result.diminfo[1].strides) = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_values.diminfo[0].strides, __pyx_t_18, __pyx_pybuffernd_values.diminfo[1].strides));
    }
  }

  /* "pandas/algos.pyx":106
 *         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;

  /* "pandas/algos.pyx":93
 * # from cython cimport floating, integral
 * 
 * cdef _take_2d_float64(ndarray[float64_t, ndim=2] values,             # <<<<<<<<<<<<<<
 *                       object idx):
 *     cdef:
 */

  /* function exit code */
  __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_pybuffernd_indexer.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas.algos._take_2d_float64", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer);
  __pyx_L2:;
  __Pyx_XDECREF((PyObject *)__pyx_v_indexer);
  __Pyx_XDECREF((PyObject *)__pyx_v_result);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/algos.pyx":108
 *     return result
 * 
 * cdef _take_2d_int64(ndarray[int64_t, ndim=2] values,             # <<<<<<<<<<<<<<
 *                       object idx):
 *     cdef:
 */

static PyObject *__pyx_f_6pandas_5algos__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;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_indexer;
  __Pyx_Buffer __pyx_pybuffer_indexer;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_result;
  __Pyx_Buffer __pyx_pybuffer_result;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_values;
  __Pyx_Buffer __pyx_pybuffer_values;
  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;
  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;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_take_2d_int64", 0);
  __pyx_pybuffer_indexer.pybuffer.buf = NULL;
  __pyx_pybuffer_indexer.refcount = 0;
  __pyx_pybuffernd_indexer.data = NULL;
  __pyx_pybuffernd_indexer.rcbuffer = &__pyx_pybuffer_indexer;
  __pyx_pybuffer_result.pybuffer.buf = NULL;
  __pyx_pybuffer_result.refcount = 0;
  __pyx_pybuffernd_result.data = NULL;
  __pyx_pybuffernd_result.rcbuffer = &__pyx_pybuffer_result;
  __pyx_pybuffer_values.pybuffer.buf = NULL;
  __pyx_pybuffer_values.refcount = 0;
  __pyx_pybuffernd_values.data = NULL;
  __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values;
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (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[0]; __pyx_lineno = 108; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_values.diminfo[1].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_values.diminfo[1].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[1];

  /* "pandas/algos.pyx":112
 *     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[0]; __pyx_lineno = 112; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_1 = __pyx_v_idx;
  __Pyx_INCREF(__pyx_t_1);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer, (PyObject*)((PyArrayObject *)__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_pybuffernd_indexer.rcbuffer->pybuffer.buf = NULL;
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 112; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    } else {__pyx_pybuffernd_indexer.diminfo[0].strides = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_indexer.diminfo[0].shape = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_indexer.diminfo[1].strides = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_indexer.diminfo[1].shape = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.shape[1];
    }
  }
  __pyx_v_indexer = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pandas/algos.pyx":116
 *         object val
 * 
 *     N, K = (<object> values).shape             # <<<<<<<<<<<<<<
 *     result = np.empty_like(values)
 *     for i in range(N):
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_values), __pyx_n_s_shape); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 116; __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 CYTHON_COMPILING_IN_CPYTHON
    Py_ssize_t size = Py_SIZE(sequence);
    #else
    Py_ssize_t size = PySequence_Size(sequence);
    #endif
    if (unlikely(size != 2)) {
      if (size > 2) __Pyx_RaiseTooManyValuesError(2);
      else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    #if CYTHON_COMPILING_IN_CPYTHON
    if (likely(PyTuple_CheckExact(sequence))) {
      __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); 
      __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1); 
    } else {
      __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);
    #else
    __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    #endif
    __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[0]; __pyx_lineno = 116; __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_L3_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_L3_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_3);
    if (__Pyx_IternextUnpackEndCheck(__pyx_t_5(__pyx_t_4), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_5 = NULL;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    goto __pyx_L4_unpacking_done;
    __pyx_L3_unpacking_failed:;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_5 = NULL;
    if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_L4_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[0]; __pyx_lineno = 116; __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[0]; __pyx_lineno = 116; __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;

  /* "pandas/algos.pyx":117
 * 
 *     N, K = (<object> values).shape
 *     result = np.empty_like(values)             # <<<<<<<<<<<<<<
 *     for i in range(N):
 *         for j in range(K):
 */
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 117; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_empty_like); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 117; __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[0]; __pyx_lineno = 117; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__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_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 117; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__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[0]; __pyx_lineno = 117; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_8 = ((PyArrayObject *)__pyx_t_2);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer);
    __pyx_t_9 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_result.rcbuffer->pybuffer, (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_pybuffernd_result.rcbuffer->pybuffer, (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_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_pybuffernd_result.diminfo[0].strides = __pyx_pybuffernd_result.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_result.diminfo[0].shape = __pyx_pybuffernd_result.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_result.diminfo[1].strides = __pyx_pybuffernd_result.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_result.diminfo[1].shape = __pyx_pybuffernd_result.rcbuffer->pybuffer.shape[1];
    if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 117; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_8 = 0;
  __pyx_v_result = ((PyArrayObject *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "pandas/algos.pyx":118
 *     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_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;

    /* "pandas/algos.pyx":119
 *     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_13 = __pyx_v_K;
    for (__pyx_t_14 = 0; __pyx_t_14 < __pyx_t_13; __pyx_t_14+=1) {
      __pyx_v_j = __pyx_t_14;

      /* "pandas/algos.pyx":120
 *     for i in range(N):
 *         for j in range(K):
 *             result[i, j] = values[i, indexer[i, j]]             # <<<<<<<<<<<<<<
 *     return result
 * 
 */
      __pyx_t_15 = __pyx_v_i;
      __pyx_t_16 = __pyx_v_j;
      __pyx_t_9 = -1;
      if (__pyx_t_15 < 0) {
        __pyx_t_15 += __pyx_pybuffernd_indexer.diminfo[0].shape;
        if (unlikely(__pyx_t_15 < 0)) __pyx_t_9 = 0;
      } else if (unlikely(__pyx_t_15 >= __pyx_pybuffernd_indexer.diminfo[0].shape)) __pyx_t_9 = 0;
      if (__pyx_t_16 < 0) {
        __pyx_t_16 += __pyx_pybuffernd_indexer.diminfo[1].shape;
        if (unlikely(__pyx_t_16 < 0)) __pyx_t_9 = 1;
      } else if (unlikely(__pyx_t_16 >= __pyx_pybuffernd_indexer.diminfo[1].shape)) __pyx_t_9 = 1;
      if (unlikely(__pyx_t_9 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_9);
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 120; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_t_17 = __pyx_v_i;
      __pyx_t_18 = (*__Pyx_BufPtrStrided2d(Py_ssize_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_indexer.diminfo[0].strides, __pyx_t_16, __pyx_pybuffernd_indexer.diminfo[1].strides));
      __pyx_t_9 = -1;
      if (__pyx_t_17 < 0) {
        __pyx_t_17 += __pyx_pybuffernd_values.diminfo[0].shape;
        if (unlikely(__pyx_t_17 < 0)) __pyx_t_9 = 0;
      } else if (unlikely(__pyx_t_17 >= __pyx_pybuffernd_values.diminfo[0].shape)) __pyx_t_9 = 0;
      if (__pyx_t_18 < 0) {
        __pyx_t_18 += __pyx_pybuffernd_values.diminfo[1].shape;
        if (unlikely(__pyx_t_18 < 0)) __pyx_t_9 = 1;
      } else if (unlikely(__pyx_t_18 >= __pyx_pybuffernd_values.diminfo[1].shape)) __pyx_t_9 = 1;
      if (unlikely(__pyx_t_9 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_9);
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 120; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_t_19 = __pyx_v_i;
      __pyx_t_20 = __pyx_v_j;
      __pyx_t_9 = -1;
      if (__pyx_t_19 < 0) {
        __pyx_t_19 += __pyx_pybuffernd_result.diminfo[0].shape;
        if (unlikely(__pyx_t_19 < 0)) __pyx_t_9 = 0;
      } else if (unlikely(__pyx_t_19 >= __pyx_pybuffernd_result.diminfo[0].shape)) __pyx_t_9 = 0;
      if (__pyx_t_20 < 0) {
        __pyx_t_20 += __pyx_pybuffernd_result.diminfo[1].shape;
        if (unlikely(__pyx_t_20 < 0)) __pyx_t_9 = 1;
      } else if (unlikely(__pyx_t_20 >= __pyx_pybuffernd_result.diminfo[1].shape)) __pyx_t_9 = 1;
      if (unlikely(__pyx_t_9 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_9);
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 120; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_19, __pyx_pybuffernd_result.diminfo[0].strides, __pyx_t_20, __pyx_pybuffernd_result.diminfo[1].strides) = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_values.diminfo[0].strides, __pyx_t_18, __pyx_pybuffernd_values.diminfo[1].strides));
    }
  }

  /* "pandas/algos.pyx":121
 *         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;

  /* "pandas/algos.pyx":108
 *     return result
 * 
 * cdef _take_2d_int64(ndarray[int64_t, ndim=2] values,             # <<<<<<<<<<<<<<
 *                       object idx):
 *     cdef:
 */

  /* function exit code */
  __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_pybuffernd_indexer.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas.algos._take_2d_int64", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer);
  __pyx_L2:;
  __Pyx_XDECREF((PyObject *)__pyx_v_indexer);
  __Pyx_XDECREF((PyObject *)__pyx_v_result);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/algos.pyx":123
 *     return result
 * 
 * cdef _take_2d_object(ndarray[object, ndim=2] values,             # <<<<<<<<<<<<<<
 *                      object idx):
 *     cdef:
 */

static PyObject *__pyx_f_6pandas_5algos__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;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_indexer;
  __Pyx_Buffer __pyx_pybuffer_indexer;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_result;
  __Pyx_Buffer __pyx_pybuffer_result;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_values;
  __Pyx_Buffer __pyx_pybuffer_values;
  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;
  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;
  PyObject **__pyx_t_21;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_take_2d_object", 0);
  __pyx_pybuffer_indexer.pybuffer.buf = NULL;
  __pyx_pybuffer_indexer.refcount = 0;
  __pyx_pybuffernd_indexer.data = NULL;
  __pyx_pybuffernd_indexer.rcbuffer = &__pyx_pybuffer_indexer;
  __pyx_pybuffer_result.pybuffer.buf = NULL;
  __pyx_pybuffer_result.refcount = 0;
  __pyx_pybuffernd_result.data = NULL;
  __pyx_pybuffernd_result.rcbuffer = &__pyx_pybuffer_result;
  __pyx_pybuffer_values.pybuffer.buf = NULL;
  __pyx_pybuffer_values.refcount = 0;
  __pyx_pybuffernd_values.data = NULL;
  __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values;
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 123; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_values.diminfo[1].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_values.diminfo[1].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[1];

  /* "pandas/algos.pyx":127
 *     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[0]; __pyx_lineno = 127; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_1 = __pyx_v_idx;
  __Pyx_INCREF(__pyx_t_1);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer, (PyObject*)((PyArrayObject *)__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_pybuffernd_indexer.rcbuffer->pybuffer.buf = NULL;
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 127; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    } else {__pyx_pybuffernd_indexer.diminfo[0].strides = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_indexer.diminfo[0].shape = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_indexer.diminfo[1].strides = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_indexer.diminfo[1].shape = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.shape[1];
    }
  }
  __pyx_v_indexer = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pandas/algos.pyx":131
 *         object val
 * 
 *     N, K = (<object> values).shape             # <<<<<<<<<<<<<<
 *     result = values.copy()
 *     for i in range(N):
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_values), __pyx_n_s_shape); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 131; __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 CYTHON_COMPILING_IN_CPYTHON
    Py_ssize_t size = Py_SIZE(sequence);
    #else
    Py_ssize_t size = PySequence_Size(sequence);
    #endif
    if (unlikely(size != 2)) {
      if (size > 2) __Pyx_RaiseTooManyValuesError(2);
      else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 131; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    #if CYTHON_COMPILING_IN_CPYTHON
    if (likely(PyTuple_CheckExact(sequence))) {
      __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); 
      __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1); 
    } else {
      __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);
    #else
    __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 131; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 131; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    #endif
    __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[0]; __pyx_lineno = 131; __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_L3_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_L3_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_3);
    if (__Pyx_IternextUnpackEndCheck(__pyx_t_5(__pyx_t_4), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 131; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_5 = NULL;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    goto __pyx_L4_unpacking_done;
    __pyx_L3_unpacking_failed:;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_5 = NULL;
    if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 131; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_L4_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[0]; __pyx_lineno = 131; __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[0]; __pyx_lineno = 131; __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;

  /* "pandas/algos.pyx":132
 * 
 *     N, K = (<object> values).shape
 *     result = values.copy()             # <<<<<<<<<<<<<<
 *     for i in range(N):
 *         for j in range(K):
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_values), __pyx_n_s_copy); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 132; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 132; __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_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 132; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_8 = ((PyArrayObject *)__pyx_t_3);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer);
    __pyx_t_9 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_result.rcbuffer->pybuffer, (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_pybuffernd_result.rcbuffer->pybuffer, (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_pybuffernd_result.diminfo[0].strides = __pyx_pybuffernd_result.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_result.diminfo[0].shape = __pyx_pybuffernd_result.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_result.diminfo[1].strides = __pyx_pybuffernd_result.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_result.diminfo[1].shape = __pyx_pybuffernd_result.rcbuffer->pybuffer.shape[1];
    if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 132; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_8 = 0;
  __pyx_v_result = ((PyArrayObject *)__pyx_t_3);
  __pyx_t_3 = 0;

  /* "pandas/algos.pyx":133
 *     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_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;

    /* "pandas/algos.pyx":134
 *     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_13 = __pyx_v_K;
    for (__pyx_t_14 = 0; __pyx_t_14 < __pyx_t_13; __pyx_t_14+=1) {
      __pyx_v_j = __pyx_t_14;

      /* "pandas/algos.pyx":135
 *     for i in range(N):
 *         for j in range(K):
 *             result[i, j] = values[i, indexer[i, j]]             # <<<<<<<<<<<<<<
 *     return result
 * 
 */
      __pyx_t_15 = __pyx_v_i;
      __pyx_t_16 = __pyx_v_j;
      __pyx_t_9 = -1;
      if (__pyx_t_15 < 0) {
        __pyx_t_15 += __pyx_pybuffernd_indexer.diminfo[0].shape;
        if (unlikely(__pyx_t_15 < 0)) __pyx_t_9 = 0;
      } else if (unlikely(__pyx_t_15 >= __pyx_pybuffernd_indexer.diminfo[0].shape)) __pyx_t_9 = 0;
      if (__pyx_t_16 < 0) {
        __pyx_t_16 += __pyx_pybuffernd_indexer.diminfo[1].shape;
        if (unlikely(__pyx_t_16 < 0)) __pyx_t_9 = 1;
      } else if (unlikely(__pyx_t_16 >= __pyx_pybuffernd_indexer.diminfo[1].shape)) __pyx_t_9 = 1;
      if (unlikely(__pyx_t_9 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_9);
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 135; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_t_17 = __pyx_v_i;
      __pyx_t_18 = (*__Pyx_BufPtrStrided2d(Py_ssize_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_indexer.diminfo[0].strides, __pyx_t_16, __pyx_pybuffernd_indexer.diminfo[1].strides));
      __pyx_t_9 = -1;
      if (__pyx_t_17 < 0) {
        __pyx_t_17 += __pyx_pybuffernd_values.diminfo[0].shape;
        if (unlikely(__pyx_t_17 < 0)) __pyx_t_9 = 0;
      } else if (unlikely(__pyx_t_17 >= __pyx_pybuffernd_values.diminfo[0].shape)) __pyx_t_9 = 0;
      if (__pyx_t_18 < 0) {
        __pyx_t_18 += __pyx_pybuffernd_values.diminfo[1].shape;
        if (unlikely(__pyx_t_18 < 0)) __pyx_t_9 = 1;
      } else if (unlikely(__pyx_t_18 >= __pyx_pybuffernd_values.diminfo[1].shape)) __pyx_t_9 = 1;
      if (unlikely(__pyx_t_9 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_9);
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 135; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_t_3 = (PyObject *) *__Pyx_BufPtrStrided2d(PyObject **, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_values.diminfo[0].strides, __pyx_t_18, __pyx_pybuffernd_values.diminfo[1].strides);
      __Pyx_INCREF((PyObject*)__pyx_t_3);
      __pyx_t_19 = __pyx_v_i;
      __pyx_t_20 = __pyx_v_j;
      __pyx_t_9 = -1;
      if (__pyx_t_19 < 0) {
        __pyx_t_19 += __pyx_pybuffernd_result.diminfo[0].shape;
        if (unlikely(__pyx_t_19 < 0)) __pyx_t_9 = 0;
      } else if (unlikely(__pyx_t_19 >= __pyx_pybuffernd_result.diminfo[0].shape)) __pyx_t_9 = 0;
      if (__pyx_t_20 < 0) {
        __pyx_t_20 += __pyx_pybuffernd_result.diminfo[1].shape;
        if (unlikely(__pyx_t_20 < 0)) __pyx_t_9 = 1;
      } else if (unlikely(__pyx_t_20 >= __pyx_pybuffernd_result.diminfo[1].shape)) __pyx_t_9 = 1;
      if (unlikely(__pyx_t_9 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_9);
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 135; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_t_21 = __Pyx_BufPtrStrided2d(PyObject **, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_19, __pyx_pybuffernd_result.diminfo[0].strides, __pyx_t_20, __pyx_pybuffernd_result.diminfo[1].strides);
      __Pyx_GOTREF(*__pyx_t_21);
      __Pyx_INCREF(__pyx_t_3); __Pyx_DECREF(*__pyx_t_21);
      *__pyx_t_21 = __pyx_t_3;
      __Pyx_GIVEREF(*__pyx_t_21);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    }
  }

  /* "pandas/algos.pyx":136
 *         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;

  /* "pandas/algos.pyx":123
 *     return result
 * 
 * cdef _take_2d_object(ndarray[object, ndim=2] values,             # <<<<<<<<<<<<<<
 *                      object idx):
 *     cdef:
 */

  /* function exit code */
  __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_pybuffernd_indexer.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas.algos._take_2d_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer);
  __pyx_L2:;
  __Pyx_XDECREF((PyObject *)__pyx_v_indexer);
  __Pyx_XDECREF((PyObject *)__pyx_v_result);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/algos.pyx":139
 * 
 * 
 * cdef inline bint float64_are_diff(float64_t left, float64_t right):             # <<<<<<<<<<<<<<
 *     cdef double abs_diff, allowed
 *     if right == MAXfloat64 or right == -MAXfloat64:
 */

static CYTHON_INLINE int __pyx_f_6pandas_5algos_float64_are_diff(__pyx_t_5numpy_float64_t __pyx_v_left, __pyx_t_5numpy_float64_t __pyx_v_right) {
  double __pyx_v_abs_diff;
  double __pyx_v_allowed;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  int __pyx_t_3;
  __Pyx_RefNannySetupContext("float64_are_diff", 0);

  /* "pandas/algos.pyx":141
 * cdef inline bint float64_are_diff(float64_t left, float64_t right):
 *     cdef double abs_diff, allowed
 *     if right == MAXfloat64 or right == -MAXfloat64:             # <<<<<<<<<<<<<<
 *         if left == right:
 *             return False
 */
  __pyx_t_1 = ((__pyx_v_right == __pyx_v_6pandas_5algos_MAXfloat64) != 0);
  if (!__pyx_t_1) {
    __pyx_t_2 = ((__pyx_v_right == (-__pyx_v_6pandas_5algos_MAXfloat64)) != 0);
    __pyx_t_3 = __pyx_t_2;
  } else {
    __pyx_t_3 = __pyx_t_1;
  }
  if (__pyx_t_3) {

    /* "pandas/algos.pyx":142
 *     cdef double abs_diff, allowed
 *     if right == MAXfloat64 or right == -MAXfloat64:
 *         if left == right:             # <<<<<<<<<<<<<<
 *             return False
 *         else:
 */
    __pyx_t_3 = ((__pyx_v_left == __pyx_v_right) != 0);
    if (__pyx_t_3) {

      /* "pandas/algos.pyx":143
 *     if right == MAXfloat64 or right == -MAXfloat64:
 *         if left == right:
 *             return False             # <<<<<<<<<<<<<<
 *         else:
 *             return True
 */
      __pyx_r = 0;
      goto __pyx_L0;
    }
    /*else*/ {

      /* "pandas/algos.pyx":145
 *             return False
 *         else:
 *             return True             # <<<<<<<<<<<<<<
 *     else:
 *         abs_diff = fabs(left - right)
 */
      __pyx_r = 1;
      goto __pyx_L0;
    }
  }
  /*else*/ {

    /* "pandas/algos.pyx":147
 *             return True
 *     else:
 *         abs_diff = fabs(left - right)             # <<<<<<<<<<<<<<
 *         allowed = REL_TOL * fabs(right)
 *         return abs_diff > allowed
 */
    __pyx_v_abs_diff = fabs((__pyx_v_left - __pyx_v_right));

    /* "pandas/algos.pyx":148
 *     else:
 *         abs_diff = fabs(left - right)
 *         allowed = REL_TOL * fabs(right)             # <<<<<<<<<<<<<<
 *         return abs_diff > allowed
 * 
 */
    __pyx_v_allowed = (__pyx_v_6pandas_5algos_REL_TOL * fabs(__pyx_v_right));

    /* "pandas/algos.pyx":149
 *         abs_diff = fabs(left - right)
 *         allowed = REL_TOL * fabs(right)
 *         return abs_diff > allowed             # <<<<<<<<<<<<<<
 * 
 * def rank_1d_float64(object in_arr, ties_method='average', ascending=True,
 */
    __pyx_r = (__pyx_v_abs_diff > __pyx_v_allowed);
    goto __pyx_L0;
  }

  /* "pandas/algos.pyx":139
 * 
 * 
 * cdef inline bint float64_are_diff(float64_t left, float64_t right):             # <<<<<<<<<<<<<<
 *     cdef double abs_diff, allowed
 *     if right == MAXfloat64 or right == -MAXfloat64:
 */

  /* function exit code */
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/algos.pyx":151
 *         return abs_diff > allowed
 * 
 * def rank_1d_float64(object in_arr, ties_method='average', ascending=True,             # <<<<<<<<<<<<<<
 *                     na_option='keep', pct=False):
 *     """
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pandas_5algos_1rank_1d_float64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6pandas_5algos_rank_1d_float64[] = "\n    Fast NaN-friendly version of scipy.stats.rankdata\n    ";
static PyMethodDef __pyx_mdef_6pandas_5algos_1rank_1d_float64 = {__Pyx_NAMESTR("rank_1d_float64"), (PyCFunction)__pyx_pw_6pandas_5algos_1rank_1d_float64, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6pandas_5algos_rank_1d_float64)};
static PyObject *__pyx_pw_6pandas_5algos_1rank_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;
  PyObject *__pyx_v_na_option = 0;
  PyObject *__pyx_v_pct = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("rank_1d_float64 (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_in_arr,&__pyx_n_s_ties_method,&__pyx_n_s_ascending,&__pyx_n_s_na_option,&__pyx_n_s_pct,0};
    PyObject* values[5] = {0,0,0,0,0};
    values[1] = ((PyObject *)__pyx_n_s_average);
    values[2] = ((PyObject *)Py_True);
    values[3] = ((PyObject *)__pyx_n_s_keep);

    /* "pandas/algos.pyx":152
 * 
 * def rank_1d_float64(object in_arr, ties_method='average', ascending=True,
 *                     na_option='keep', pct=False):             # <<<<<<<<<<<<<<
 *     """
 *     Fast NaN-friendly version of scipy.stats.rankdata
 */
    values[4] = ((PyObject *)Py_False);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_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 (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_in_arr)) != 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--; }
        }
        case  3:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_na_option);
          if (value) { values[3] = value; kw_args--; }
        }
        case  4:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_pct);
          if (value) { values[4] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "rank_1d_float64") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 151; __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_in_arr = values[0];
    __pyx_v_ties_method = values[1];
    __pyx_v_ascending = values[2];
    __pyx_v_na_option = values[3];
    __pyx_v_pct = values[4];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("rank_1d_float64", 0, 1, 5, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 151; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas.algos.rank_1d_float64", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6pandas_5algos_rank_1d_float64(__pyx_self, __pyx_v_in_arr, __pyx_v_ties_method, __pyx_v_ascending, __pyx_v_na_option, __pyx_v_pct);

  /* "pandas/algos.pyx":151
 *         return abs_diff > allowed
 * 
 * def rank_1d_float64(object in_arr, ties_method='average', ascending=True,             # <<<<<<<<<<<<<<
 *                     na_option='keep', pct=False):
 *     """
 */

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pandas_5algos_rank_1d_float64(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_in_arr, PyObject *__pyx_v_ties_method, PyObject *__pyx_v_ascending, PyObject *__pyx_v_na_option, PyObject *__pyx_v_pct) {
  Py_ssize_t __pyx_v_i;
  Py_ssize_t __pyx_v_j;
  Py_ssize_t __pyx_v_n;
  Py_ssize_t __pyx_v_dups;
  Py_ssize_t __pyx_v_total_tie_count;
  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;
  int __pyx_v_keep_na;
  float __pyx_v_count;
  PyObject *__pyx_v_mask = NULL;
  PyObject *__pyx_v__as = NULL;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_argsorted;
  __Pyx_Buffer __pyx_pybuffer_argsorted;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_ranks;
  __Pyx_Buffer __pyx_pybuffer_ranks;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_sorted_data;
  __Pyx_Buffer __pyx_pybuffer_sorted_data;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_values;
  __Pyx_Buffer __pyx_pybuffer_values;
  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;
  Py_ssize_t __pyx_t_33;
  __pyx_t_5numpy_int64_t __pyx_t_34;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("rank_1d_float64", 0);
  __pyx_pybuffer_sorted_data.pybuffer.buf = NULL;
  __pyx_pybuffer_sorted_data.refcount = 0;
  __pyx_pybuffernd_sorted_data.data = NULL;
  __pyx_pybuffernd_sorted_data.rcbuffer = &__pyx_pybuffer_sorted_data;
  __pyx_pybuffer_ranks.pybuffer.buf = NULL;
  __pyx_pybuffer_ranks.refcount = 0;
  __pyx_pybuffernd_ranks.data = NULL;
  __pyx_pybuffernd_ranks.rcbuffer = &__pyx_pybuffer_ranks;
  __pyx_pybuffer_values.pybuffer.buf = NULL;
  __pyx_pybuffer_values.refcount = 0;
  __pyx_pybuffernd_values.data = NULL;
  __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values;
  __pyx_pybuffer_argsorted.pybuffer.buf = NULL;
  __pyx_pybuffer_argsorted.refcount = 0;
  __pyx_pybuffernd_argsorted.data = NULL;
  __pyx_pybuffernd_argsorted.rcbuffer = &__pyx_pybuffer_argsorted;

  /* "pandas/algos.pyx":158
 * 
 *     cdef:
 *         Py_ssize_t i, j, n, dups = 0, total_tie_count = 0             # <<<<<<<<<<<<<<
 *         ndarray[float64_t] sorted_data, ranks, values
 *         ndarray[int64_t] argsorted
 */
  __pyx_v_dups = 0;
  __pyx_v_total_tie_count = 0;

  /* "pandas/algos.pyx":162
 *         ndarray[int64_t] argsorted
 *         float64_t val, nan_value
 *         float64_t sum_ranks = 0             # <<<<<<<<<<<<<<
 *         int tiebreak = 0
 *         bint keep_na = 0
 */
  __pyx_v_sum_ranks = 0.0;

  /* "pandas/algos.pyx":163
 *         float64_t val, nan_value
 *         float64_t sum_ranks = 0
 *         int tiebreak = 0             # <<<<<<<<<<<<<<
 *         bint keep_na = 0
 *         float count = 0.0
 */
  __pyx_v_tiebreak = 0;

  /* "pandas/algos.pyx":164
 *         float64_t sum_ranks = 0
 *         int tiebreak = 0
 *         bint keep_na = 0             # <<<<<<<<<<<<<<
 *         float count = 0.0
 *     tiebreak = tiebreakers[ties_method]
 */
  __pyx_v_keep_na = 0;

  /* "pandas/algos.pyx":165
 *         int tiebreak = 0
 *         bint keep_na = 0
 *         float count = 0.0             # <<<<<<<<<<<<<<
 *     tiebreak = tiebreakers[ties_method]
 * 
 */
  __pyx_v_count = 0.0;

  /* "pandas/algos.pyx":166
 *         bint keep_na = 0
 *         float count = 0.0
 *     tiebreak = tiebreakers[ties_method]             # <<<<<<<<<<<<<<
 * 
 *     values = np.asarray(in_arr).copy()
 */
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_tiebreakers); 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_GetItem(__pyx_t_1, __pyx_v_ties_method); if (unlikely(__pyx_t_2 == NULL)) {__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_t_3 = __Pyx_PyInt_As_int(__pyx_t_2); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 166; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_tiebreak = __pyx_t_3;

  /* "pandas/algos.pyx":168
 *     tiebreak = tiebreakers[ties_method]
 * 
 *     values = np.asarray(in_arr).copy()             # <<<<<<<<<<<<<<
 * 
 *     keep_na = na_option == 'keep'
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); 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_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_asarray); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 168; __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[0]; __pyx_lineno = 168; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__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 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __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_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_copy); 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(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 168; __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[0]; __pyx_lineno = 168; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_5 = ((PyArrayObject *)__pyx_t_4);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer);
    __pyx_t_3 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (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_pybuffernd_values.rcbuffer->pybuffer, (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_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0];
    if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 168; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_5 = 0;
  __pyx_v_values = ((PyArrayObject *)__pyx_t_4);
  __pyx_t_4 = 0;

  /* "pandas/algos.pyx":170
 *     values = np.asarray(in_arr).copy()
 * 
 *     keep_na = na_option == 'keep'             # <<<<<<<<<<<<<<
 * 
 *     if ascending ^ (na_option == 'top'):
 */
  __pyx_t_4 = PyObject_RichCompare(__pyx_v_na_option, __pyx_n_s_keep, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 170; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_9 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 170; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_v_keep_na = __pyx_t_9;

  /* "pandas/algos.pyx":172
 *     keep_na = na_option == 'keep'
 * 
 *     if ascending ^ (na_option == 'top'):             # <<<<<<<<<<<<<<
 *         nan_value = np.inf
 *     else:
 */
  __pyx_t_4 = PyObject_RichCompare(__pyx_v_na_option, __pyx_n_s_top, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 172; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_2 = PyNumber_Xor(__pyx_v_ascending, __pyx_t_4); 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(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 172; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__pyx_t_9) {

    /* "pandas/algos.pyx":173
 * 
 *     if ascending ^ (na_option == 'top'):
 *         nan_value = np.inf             # <<<<<<<<<<<<<<
 *     else:
 *         nan_value = -np.inf
 */
    __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); 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_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_inf); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 173; __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[0]; __pyx_lineno = 173; __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_L3;
  }
  /*else*/ {

    /* "pandas/algos.pyx":175
 *         nan_value = np.inf
 *     else:
 *         nan_value = -np.inf             # <<<<<<<<<<<<<<
 *     mask = np.isnan(values)
 *     np.putmask(values, mask, nan_value)
 */
    __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 175; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_inf); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 175; __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[0]; __pyx_lineno = 175; __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[0]; __pyx_lineno = 175; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_v_nan_value = __pyx_t_10;
  }
  __pyx_L3:;

  /* "pandas/algos.pyx":176
 *     else:
 *         nan_value = -np.inf
 *     mask = np.isnan(values)             # <<<<<<<<<<<<<<
 *     np.putmask(values, mask, nan_value)
 * 
 */
  __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 176; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_isnan); 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);
  __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 = 176; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__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_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 176; __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_4); __pyx_t_4 = 0;
  __pyx_v_mask = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "pandas/algos.pyx":177
 *         nan_value = -np.inf
 *     mask = np.isnan(values)
 *     np.putmask(values, mask, nan_value)             # <<<<<<<<<<<<<<
 * 
 *     n = len(values)
 */
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 177; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_putmask); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 177; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __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[0]; __pyx_lineno = 177; __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[0]; __pyx_lineno = 177; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__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);
  PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 177; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pandas/algos.pyx":179
 *     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[0]; __pyx_lineno = 179; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_n = __pyx_t_11;

  /* "pandas/algos.pyx":180
 * 
 *     n = len(values)
 *     ranks = np.empty(n, dtype='f8')             # <<<<<<<<<<<<<<
 * 
 *     # py2.5/win32 hack, can't pass i8
 */
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); 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 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_empty); 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_t_1 = PyInt_FromSsize_t(__pyx_v_n); 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_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 180; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__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 = 180; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_n_s_f8) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 180; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_12 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, __pyx_t_1); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 180; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_12);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__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[0]; __pyx_lineno = 180; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_5 = ((PyArrayObject *)__pyx_t_12);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_ranks.rcbuffer->pybuffer);
    __pyx_t_3 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_ranks.rcbuffer->pybuffer, (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_pybuffernd_ranks.rcbuffer->pybuffer, (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_pybuffernd_ranks.diminfo[0].strides = __pyx_pybuffernd_ranks.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_ranks.diminfo[0].shape = __pyx_pybuffernd_ranks.rcbuffer->pybuffer.shape[0];
    if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 180; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_5 = 0;
  __pyx_v_ranks = ((PyArrayObject *)__pyx_t_12);
  __pyx_t_12 = 0;

  /* "pandas/algos.pyx":183
 * 
 *     # 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_5algos_TIEBREAK_FIRST) != 0);
  if (__pyx_t_9) {

    /* "pandas/algos.pyx":185
 *     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 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_values), __pyx_n_s_argsort); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 185; __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[0]; __pyx_lineno = 185; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_kind, __pyx_n_s_mergesort) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 185; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_empty_tuple, __pyx_t_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 185; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_v__as = __pyx_t_4;
    __pyx_t_4 = 0;

    /* "pandas/algos.pyx":186
 *         # 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[0]; __pyx_lineno = 186; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_13 = ((!__pyx_t_9) != 0);
    if (__pyx_t_13) {

      /* "pandas/algos.pyx":187
 *         _as = values.argsort(kind='mergesort')
 *         if not ascending:
 *             tiebreak = TIEBREAK_FIRST_DESCENDING             # <<<<<<<<<<<<<<
 *     else:
 *         _as = values.argsort()
 */
      __pyx_v_tiebreak = __pyx_v_6pandas_5algos_TIEBREAK_FIRST_DESCENDING;
      goto __pyx_L5;
    }
    __pyx_L5:;
    goto __pyx_L4;
  }
  /*else*/ {

    /* "pandas/algos.pyx":189
 *             tiebreak = TIEBREAK_FIRST_DESCENDING
 *     else:
 *         _as = values.argsort()             # <<<<<<<<<<<<<<
 * 
 *     if not ascending:
 */
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_values), __pyx_n_s_argsort); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 189; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 189; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_v__as = __pyx_t_1;
    __pyx_t_1 = 0;
  }
  __pyx_L4:;

  /* "pandas/algos.pyx":191
 *         _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[0]; __pyx_lineno = 191; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_9 = ((!__pyx_t_13) != 0);
  if (__pyx_t_9) {

    /* "pandas/algos.pyx":192
 * 
 *     if not ascending:
 *         _as = _as[::-1]             # <<<<<<<<<<<<<<
 * 
 *     sorted_data = values.take(_as)
 */
    __pyx_t_1 = PyObject_GetItem(__pyx_v__as, __pyx_slice__2); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 192; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF_SET(__pyx_v__as, __pyx_t_1);
    __pyx_t_1 = 0;
    goto __pyx_L6;
  }
  __pyx_L6:;

  /* "pandas/algos.pyx":194
 *         _as = _as[::-1]
 * 
 *     sorted_data = values.take(_as)             # <<<<<<<<<<<<<<
 *     argsorted = _as.astype('i8')
 * 
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_values), __pyx_n_s_take); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 194; __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 = 194; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_INCREF(__pyx_v__as);
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v__as);
  __Pyx_GIVEREF(__pyx_v__as);
  __pyx_t_12 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_4, NULL); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 194; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_12);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (!(likely(((__pyx_t_12) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_12, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 194; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_5 = ((PyArrayObject *)__pyx_t_12);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_sorted_data.rcbuffer->pybuffer);
    __pyx_t_3 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_sorted_data.rcbuffer->pybuffer, (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_pybuffernd_sorted_data.rcbuffer->pybuffer, (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_pybuffernd_sorted_data.diminfo[0].strides = __pyx_pybuffernd_sorted_data.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_sorted_data.diminfo[0].shape = __pyx_pybuffernd_sorted_data.rcbuffer->pybuffer.shape[0];
    if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 194; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_5 = 0;
  __pyx_v_sorted_data = ((PyArrayObject *)__pyx_t_12);
  __pyx_t_12 = 0;

  /* "pandas/algos.pyx":195
 * 
 *     sorted_data = values.take(_as)
 *     argsorted = _as.astype('i8')             # <<<<<<<<<<<<<<
 * 
 *     for i in range(n):
 */
  __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_v__as, __pyx_n_s_astype); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 195; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_12);
  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_tuple__3, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 195; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 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 = 195; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_14 = ((PyArrayObject *)__pyx_t_4);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_argsorted.rcbuffer->pybuffer);
    __pyx_t_3 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_argsorted.rcbuffer->pybuffer, (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_pybuffernd_argsorted.rcbuffer->pybuffer, (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_pybuffernd_argsorted.diminfo[0].strides = __pyx_pybuffernd_argsorted.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_argsorted.diminfo[0].shape = __pyx_pybuffernd_argsorted.rcbuffer->pybuffer.shape[0];
    if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 195; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_14 = 0;
  __pyx_v_argsorted = ((PyArrayObject *)__pyx_t_4);
  __pyx_t_4 = 0;

  /* "pandas/algos.pyx":197
 *     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;

    /* "pandas/algos.pyx":198
 * 
 *     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));

    /* "pandas/algos.pyx":199
 *     for i in range(n):
 *         sum_ranks += i + 1
 *         dups += 1             # <<<<<<<<<<<<<<
 *         val = sorted_data[i]
 *         if (val == nan_value) and keep_na:
 */
    __pyx_v_dups = (__pyx_v_dups + 1);

    /* "pandas/algos.pyx":200
 *         sum_ranks += i + 1
 *         dups += 1
 *         val = sorted_data[i]             # <<<<<<<<<<<<<<
 *         if (val == nan_value) and keep_na:
 *             ranks[argsorted[i]] = nan
 */
    __pyx_t_16 = __pyx_v_i;
    __pyx_t_3 = -1;
    if (__pyx_t_16 < 0) {
      __pyx_t_16 += __pyx_pybuffernd_sorted_data.diminfo[0].shape;
      if (unlikely(__pyx_t_16 < 0)) __pyx_t_3 = 0;
    } else if (unlikely(__pyx_t_16 >= __pyx_pybuffernd_sorted_data.diminfo[0].shape)) __pyx_t_3 = 0;
    if (unlikely(__pyx_t_3 != -1)) {
      __Pyx_RaiseBufferIndexError(__pyx_t_3);
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 200; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_v_val = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_sorted_data.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_sorted_data.diminfo[0].strides));

    /* "pandas/algos.pyx":201
 *         dups += 1
 *         val = sorted_data[i]
 *         if (val == nan_value) and keep_na:             # <<<<<<<<<<<<<<
 *             ranks[argsorted[i]] = nan
 *             continue
 */
    __pyx_t_9 = ((__pyx_v_val == __pyx_v_nan_value) != 0);
    if (__pyx_t_9) {
      __pyx_t_13 = (__pyx_v_keep_na != 0);
    } else {
      __pyx_t_13 = __pyx_t_9;
    }
    if (__pyx_t_13) {

      /* "pandas/algos.pyx":202
 *         val = sorted_data[i]
 *         if (val == nan_value) and keep_na:
 *             ranks[argsorted[i]] = nan             # <<<<<<<<<<<<<<
 *             continue
 *         count += 1.0
 */
      __pyx_t_17 = __pyx_v_i;
      __pyx_t_3 = -1;
      if (__pyx_t_17 < 0) {
        __pyx_t_17 += __pyx_pybuffernd_argsorted.diminfo[0].shape;
        if (unlikely(__pyx_t_17 < 0)) __pyx_t_3 = 0;
      } else if (unlikely(__pyx_t_17 >= __pyx_pybuffernd_argsorted.diminfo[0].shape)) __pyx_t_3 = 0;
      if (unlikely(__pyx_t_3 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_3);
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 202; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_t_18 = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_argsorted.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_argsorted.diminfo[0].strides));
      __pyx_t_3 = -1;
      if (__pyx_t_18 < 0) {
        __pyx_t_18 += __pyx_pybuffernd_ranks.diminfo[0].shape;
        if (unlikely(__pyx_t_18 < 0)) __pyx_t_3 = 0;
      } else if (unlikely(__pyx_t_18 >= __pyx_pybuffernd_ranks.diminfo[0].shape)) __pyx_t_3 = 0;
      if (unlikely(__pyx_t_3 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_3);
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 202; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_ranks.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_ranks.diminfo[0].strides) = __pyx_v_6pandas_5algos_nan;

      /* "pandas/algos.pyx":203
 *         if (val == nan_value) and keep_na:
 *             ranks[argsorted[i]] = nan
 *             continue             # <<<<<<<<<<<<<<
 *         count += 1.0
 *         if i == n - 1 or float64_are_diff(sorted_data[i + 1], val):
 */
      goto __pyx_L7_continue;
    }

    /* "pandas/algos.pyx":204
 *             ranks[argsorted[i]] = nan
 *             continue
 *         count += 1.0             # <<<<<<<<<<<<<<
 *         if i == n - 1 or float64_are_diff(sorted_data[i + 1], val):
 *             if tiebreak == TIEBREAK_AVERAGE:
 */
    __pyx_v_count = (__pyx_v_count + 1.0);

    /* "pandas/algos.pyx":205
 *             continue
 *         count += 1.0
 *         if i == n - 1 or float64_are_diff(sorted_data[i + 1], val):             # <<<<<<<<<<<<<<
 *             if tiebreak == TIEBREAK_AVERAGE:
 *                 for j in range(i - dups + 1, i + 1):
 */
    __pyx_t_13 = ((__pyx_v_i == (__pyx_v_n - 1)) != 0);
    if (!__pyx_t_13) {
      __pyx_t_19 = (__pyx_v_i + 1);
      __pyx_t_3 = -1;
      if (__pyx_t_19 < 0) {
        __pyx_t_19 += __pyx_pybuffernd_sorted_data.diminfo[0].shape;
        if (unlikely(__pyx_t_19 < 0)) __pyx_t_3 = 0;
      } else if (unlikely(__pyx_t_19 >= __pyx_pybuffernd_sorted_data.diminfo[0].shape)) __pyx_t_3 = 0;
      if (unlikely(__pyx_t_3 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_3);
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 205; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_t_9 = (__pyx_f_6pandas_5algos_float64_are_diff((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_sorted_data.rcbuffer->pybuffer.buf, __pyx_t_19, __pyx_pybuffernd_sorted_data.diminfo[0].strides)), __pyx_v_val) != 0);
      __pyx_t_20 = __pyx_t_9;
    } else {
      __pyx_t_20 = __pyx_t_13;
    }
    if (__pyx_t_20) {

      /* "pandas/algos.pyx":206
 *         count += 1.0
 *         if i == n - 1 or float64_are_diff(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_20 = ((__pyx_v_tiebreak == __pyx_v_6pandas_5algos_TIEBREAK_AVERAGE) != 0);
      if (__pyx_t_20) {

        /* "pandas/algos.pyx":207
 *         if i == n - 1 or float64_are_diff(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_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;

          /* "pandas/algos.pyx":208
 *             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)) {
            #ifdef WITH_THREAD
            PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
            #endif
            PyErr_SetString(PyExc_ZeroDivisionError, "float division");
            #ifdef WITH_THREAD
            PyGILState_Release(__pyx_gilstate_save);
            #endif
            {__pyx_filename = __pyx_f[0]; __pyx_lineno = 208; __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_pybuffernd_argsorted.diminfo[0].shape;
            if (unlikely(__pyx_t_23 < 0)) __pyx_t_3 = 0;
          } else if (unlikely(__pyx_t_23 >= __pyx_pybuffernd_argsorted.diminfo[0].shape)) __pyx_t_3 = 0;
          if (unlikely(__pyx_t_3 != -1)) {
            __Pyx_RaiseBufferIndexError(__pyx_t_3);
            {__pyx_filename = __pyx_f[0]; __pyx_lineno = 208; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          }
          __pyx_t_24 = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_argsorted.rcbuffer->pybuffer.buf, __pyx_t_23, __pyx_pybuffernd_argsorted.diminfo[0].strides));
          __pyx_t_3 = -1;
          if (__pyx_t_24 < 0) {
            __pyx_t_24 += __pyx_pybuffernd_ranks.diminfo[0].shape;
            if (unlikely(__pyx_t_24 < 0)) __pyx_t_3 = 0;
          } else if (unlikely(__pyx_t_24 >= __pyx_pybuffernd_ranks.diminfo[0].shape)) __pyx_t_3 = 0;
          if (unlikely(__pyx_t_3 != -1)) {
            __Pyx_RaiseBufferIndexError(__pyx_t_3);
            {__pyx_filename = __pyx_f[0]; __pyx_lineno = 208; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          }
          *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_ranks.rcbuffer->pybuffer.buf, __pyx_t_24, __pyx_pybuffernd_ranks.diminfo[0].strides) = (__pyx_v_sum_ranks / __pyx_v_dups);
        }
        goto __pyx_L11;
      }

      /* "pandas/algos.pyx":209
 *                 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_5algos_TIEBREAK_MIN) != 0);
      if (__pyx_t_20) {

        /* "pandas/algos.pyx":210
 *                     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;

          /* "pandas/algos.pyx":211
 *             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_pybuffernd_argsorted.diminfo[0].shape;
            if (unlikely(__pyx_t_25 < 0)) __pyx_t_3 = 0;
          } else if (unlikely(__pyx_t_25 >= __pyx_pybuffernd_argsorted.diminfo[0].shape)) __pyx_t_3 = 0;
          if (unlikely(__pyx_t_3 != -1)) {
            __Pyx_RaiseBufferIndexError(__pyx_t_3);
            {__pyx_filename = __pyx_f[0]; __pyx_lineno = 211; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          }
          __pyx_t_26 = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_argsorted.rcbuffer->pybuffer.buf, __pyx_t_25, __pyx_pybuffernd_argsorted.diminfo[0].strides));
          __pyx_t_3 = -1;
          if (__pyx_t_26 < 0) {
            __pyx_t_26 += __pyx_pybuffernd_ranks.diminfo[0].shape;
            if (unlikely(__pyx_t_26 < 0)) __pyx_t_3 = 0;
          } else if (unlikely(__pyx_t_26 >= __pyx_pybuffernd_ranks.diminfo[0].shape)) __pyx_t_3 = 0;
          if (unlikely(__pyx_t_3 != -1)) {
            __Pyx_RaiseBufferIndexError(__pyx_t_3);
            {__pyx_filename = __pyx_f[0]; __pyx_lineno = 211; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          }
          *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_ranks.rcbuffer->pybuffer.buf, __pyx_t_26, __pyx_pybuffernd_ranks.diminfo[0].strides) = ((__pyx_v_i - __pyx_v_dups) + 2);
        }
        goto __pyx_L11;
      }

      /* "pandas/algos.pyx":212
 *                 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_5algos_TIEBREAK_MAX) != 0);
      if (__pyx_t_20) {

        /* "pandas/algos.pyx":213
 *                     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;

          /* "pandas/algos.pyx":214
 *             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_pybuffernd_argsorted.diminfo[0].shape;
            if (unlikely(__pyx_t_27 < 0)) __pyx_t_3 = 0;
          } else if (unlikely(__pyx_t_27 >= __pyx_pybuffernd_argsorted.diminfo[0].shape)) __pyx_t_3 = 0;
          if (unlikely(__pyx_t_3 != -1)) {
            __Pyx_RaiseBufferIndexError(__pyx_t_3);
            {__pyx_filename = __pyx_f[0]; __pyx_lineno = 214; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          }
          __pyx_t_28 = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_argsorted.rcbuffer->pybuffer.buf, __pyx_t_27, __pyx_pybuffernd_argsorted.diminfo[0].strides));
          __pyx_t_3 = -1;
          if (__pyx_t_28 < 0) {
            __pyx_t_28 += __pyx_pybuffernd_ranks.diminfo[0].shape;
            if (unlikely(__pyx_t_28 < 0)) __pyx_t_3 = 0;
          } else if (unlikely(__pyx_t_28 >= __pyx_pybuffernd_ranks.diminfo[0].shape)) __pyx_t_3 = 0;
          if (unlikely(__pyx_t_3 != -1)) {
            __Pyx_RaiseBufferIndexError(__pyx_t_3);
            {__pyx_filename = __pyx_f[0]; __pyx_lineno = 214; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          }
          *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_ranks.rcbuffer->pybuffer.buf, __pyx_t_28, __pyx_pybuffernd_ranks.diminfo[0].strides) = (__pyx_v_i + 1);
        }
        goto __pyx_L11;
      }

      /* "pandas/algos.pyx":215
 *                 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_5algos_TIEBREAK_FIRST) != 0);
      if (__pyx_t_20) {

        /* "pandas/algos.pyx":216
 *                     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;

          /* "pandas/algos.pyx":217
 *             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_pybuffernd_argsorted.diminfo[0].shape;
            if (unlikely(__pyx_t_29 < 0)) __pyx_t_3 = 0;
          } else if (unlikely(__pyx_t_29 >= __pyx_pybuffernd_argsorted.diminfo[0].shape)) __pyx_t_3 = 0;
          if (unlikely(__pyx_t_3 != -1)) {
            __Pyx_RaiseBufferIndexError(__pyx_t_3);
            {__pyx_filename = __pyx_f[0]; __pyx_lineno = 217; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          }
          __pyx_t_30 = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_argsorted.rcbuffer->pybuffer.buf, __pyx_t_29, __pyx_pybuffernd_argsorted.diminfo[0].strides));
          __pyx_t_3 = -1;
          if (__pyx_t_30 < 0) {
            __pyx_t_30 += __pyx_pybuffernd_ranks.diminfo[0].shape;
            if (unlikely(__pyx_t_30 < 0)) __pyx_t_3 = 0;
          } else if (unlikely(__pyx_t_30 >= __pyx_pybuffernd_ranks.diminfo[0].shape)) __pyx_t_3 = 0;
          if (unlikely(__pyx_t_3 != -1)) {
            __Pyx_RaiseBufferIndexError(__pyx_t_3);
            {__pyx_filename = __pyx_f[0]; __pyx_lineno = 217; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          }
          *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_ranks.rcbuffer->pybuffer.buf, __pyx_t_30, __pyx_pybuffernd_ranks.diminfo[0].strides) = (__pyx_v_j + 1);
        }
        goto __pyx_L11;
      }

      /* "pandas/algos.pyx":218
 *                 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_5algos_TIEBREAK_FIRST_DESCENDING) != 0);
      if (__pyx_t_20) {

        /* "pandas/algos.pyx":219
 *                     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
 *             elif tiebreak == TIEBREAK_DENSE:
 */
        __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;

          /* "pandas/algos.pyx":220
 *             elif tiebreak == TIEBREAK_FIRST_DESCENDING:
 *                 for j in range(i - dups + 1, i + 1):
 *                     ranks[argsorted[j]] = 2 * i - j - dups + 2             # <<<<<<<<<<<<<<
 *             elif tiebreak == TIEBREAK_DENSE:
 *                 total_tie_count += 1
 */
          __pyx_t_31 = __pyx_v_j;
          __pyx_t_3 = -1;
          if (__pyx_t_31 < 0) {
            __pyx_t_31 += __pyx_pybuffernd_argsorted.diminfo[0].shape;
            if (unlikely(__pyx_t_31 < 0)) __pyx_t_3 = 0;
          } else if (unlikely(__pyx_t_31 >= __pyx_pybuffernd_argsorted.diminfo[0].shape)) __pyx_t_3 = 0;
          if (unlikely(__pyx_t_3 != -1)) {
            __Pyx_RaiseBufferIndexError(__pyx_t_3);
            {__pyx_filename = __pyx_f[0]; __pyx_lineno = 220; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          }
          __pyx_t_32 = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_argsorted.rcbuffer->pybuffer.buf, __pyx_t_31, __pyx_pybuffernd_argsorted.diminfo[0].strides));
          __pyx_t_3 = -1;
          if (__pyx_t_32 < 0) {
            __pyx_t_32 += __pyx_pybuffernd_ranks.diminfo[0].shape;
            if (unlikely(__pyx_t_32 < 0)) __pyx_t_3 = 0;
          } else if (unlikely(__pyx_t_32 >= __pyx_pybuffernd_ranks.diminfo[0].shape)) __pyx_t_3 = 0;
          if (unlikely(__pyx_t_3 != -1)) {
            __Pyx_RaiseBufferIndexError(__pyx_t_3);
            {__pyx_filename = __pyx_f[0]; __pyx_lineno = 220; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          }
          *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_ranks.rcbuffer->pybuffer.buf, __pyx_t_32, __pyx_pybuffernd_ranks.diminfo[0].strides) = ((((2 * __pyx_v_i) - __pyx_v_j) - __pyx_v_dups) + 2);
        }
        goto __pyx_L11;
      }

      /* "pandas/algos.pyx":221
 *                 for j in range(i - dups + 1, i + 1):
 *                     ranks[argsorted[j]] = 2 * i - j - dups + 2
 *             elif tiebreak == TIEBREAK_DENSE:             # <<<<<<<<<<<<<<
 *                 total_tie_count += 1
 *                 for j in range(i - dups + 1, i + 1):
 */
      __pyx_t_20 = ((__pyx_v_tiebreak == __pyx_v_6pandas_5algos_TIEBREAK_DENSE) != 0);
      if (__pyx_t_20) {

        /* "pandas/algos.pyx":222
 *                     ranks[argsorted[j]] = 2 * i - j - dups + 2
 *             elif tiebreak == TIEBREAK_DENSE:
 *                 total_tie_count += 1             # <<<<<<<<<<<<<<
 *                 for j in range(i - dups + 1, i + 1):
 *                     ranks[argsorted[j]] = total_tie_count
 */
        __pyx_v_total_tie_count = (__pyx_v_total_tie_count + 1);

        /* "pandas/algos.pyx":223
 *             elif tiebreak == TIEBREAK_DENSE:
 *                 total_tie_count += 1
 *                 for j in range(i - dups + 1, i + 1):             # <<<<<<<<<<<<<<
 *                     ranks[argsorted[j]] = total_tie_count
 *             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;

          /* "pandas/algos.pyx":224
 *                 total_tie_count += 1
 *                 for j in range(i - dups + 1, i + 1):
 *                     ranks[argsorted[j]] = total_tie_count             # <<<<<<<<<<<<<<
 *             sum_ranks = dups = 0
 *     if pct:
 */
          __pyx_t_33 = __pyx_v_j;
          __pyx_t_3 = -1;
          if (__pyx_t_33 < 0) {
            __pyx_t_33 += __pyx_pybuffernd_argsorted.diminfo[0].shape;
            if (unlikely(__pyx_t_33 < 0)) __pyx_t_3 = 0;
          } else if (unlikely(__pyx_t_33 >= __pyx_pybuffernd_argsorted.diminfo[0].shape)) __pyx_t_3 = 0;
          if (unlikely(__pyx_t_3 != -1)) {
            __Pyx_RaiseBufferIndexError(__pyx_t_3);
            {__pyx_filename = __pyx_f[0]; __pyx_lineno = 224; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          }
          __pyx_t_34 = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_argsorted.rcbuffer->pybuffer.buf, __pyx_t_33, __pyx_pybuffernd_argsorted.diminfo[0].strides));
          __pyx_t_3 = -1;
          if (__pyx_t_34 < 0) {
            __pyx_t_34 += __pyx_pybuffernd_ranks.diminfo[0].shape;
            if (unlikely(__pyx_t_34 < 0)) __pyx_t_3 = 0;
          } else if (unlikely(__pyx_t_34 >= __pyx_pybuffernd_ranks.diminfo[0].shape)) __pyx_t_3 = 0;
          if (unlikely(__pyx_t_3 != -1)) {
            __Pyx_RaiseBufferIndexError(__pyx_t_3);
            {__pyx_filename = __pyx_f[0]; __pyx_lineno = 224; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          }
          *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_ranks.rcbuffer->pybuffer.buf, __pyx_t_34, __pyx_pybuffernd_ranks.diminfo[0].strides) = __pyx_v_total_tie_count;
        }
        goto __pyx_L11;
      }
      __pyx_L11:;

      /* "pandas/algos.pyx":225
 *                 for j in range(i - dups + 1, i + 1):
 *                     ranks[argsorted[j]] = total_tie_count
 *             sum_ranks = dups = 0             # <<<<<<<<<<<<<<
 *     if pct:
 *         return ranks / count
 */
      __pyx_v_sum_ranks = 0;
      __pyx_v_dups = 0;
      goto __pyx_L10;
    }
    __pyx_L10:;
    __pyx_L7_continue:;
  }

  /* "pandas/algos.pyx":226
 *                     ranks[argsorted[j]] = total_tie_count
 *             sum_ranks = dups = 0
 *     if pct:             # <<<<<<<<<<<<<<
 *         return ranks / count
 *     else:
 */
  __pyx_t_20 = __Pyx_PyObject_IsTrue(__pyx_v_pct); if (unlikely(__pyx_t_20 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 226; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__pyx_t_20) {

    /* "pandas/algos.pyx":227
 *             sum_ranks = dups = 0
 *     if pct:
 *         return ranks / count             # <<<<<<<<<<<<<<
 *     else:
 *         return ranks
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_4 = PyFloat_FromDouble(__pyx_v_count); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 227; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_12 = __Pyx_PyNumber_Divide(((PyObject *)__pyx_v_ranks), __pyx_t_4); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 227; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_12);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_r = __pyx_t_12;
    __pyx_t_12 = 0;
    goto __pyx_L0;
  }
  /*else*/ {

    /* "pandas/algos.pyx":229
 *         return ranks / count
 *     else:
 *         return ranks             # <<<<<<<<<<<<<<
 * 
 * 
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(((PyObject *)__pyx_v_ranks));
    __pyx_r = ((PyObject *)__pyx_v_ranks);
    goto __pyx_L0;
  }

  /* "pandas/algos.pyx":151
 *         return abs_diff > allowed
 * 
 * def rank_1d_float64(object in_arr, ties_method='average', ascending=True,             # <<<<<<<<<<<<<<
 *                     na_option='keep', pct=False):
 *     """
 */

  /* function exit code */
  __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_pybuffernd_argsorted.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_ranks.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_sorted_data.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas.algos.rank_1d_float64", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_argsorted.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_ranks.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_sorted_data.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer);
  __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;
}

/* "pandas/algos.pyx":232
 * 
 * 
 * def rank_1d_int64(object in_arr, ties_method='average', ascending=True,             # <<<<<<<<<<<<<<
 *                   na_option='keep', pct=False):
 *     """
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pandas_5algos_3rank_1d_int64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6pandas_5algos_2rank_1d_int64[] = "\n    Fast NaN-friendly version of scipy.stats.rankdata\n    ";
static PyMethodDef __pyx_mdef_6pandas_5algos_3rank_1d_int64 = {__Pyx_NAMESTR("rank_1d_int64"), (PyCFunction)__pyx_pw_6pandas_5algos_3rank_1d_int64, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6pandas_5algos_2rank_1d_int64)};
static PyObject *__pyx_pw_6pandas_5algos_3rank_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;
  CYTHON_UNUSED PyObject *__pyx_v_na_option = 0;
  PyObject *__pyx_v_pct = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("rank_1d_int64 (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_in_arr,&__pyx_n_s_ties_method,&__pyx_n_s_ascending,&__pyx_n_s_na_option,&__pyx_n_s_pct,0};
    PyObject* values[5] = {0,0,0,0,0};
    values[1] = ((PyObject *)__pyx_n_s_average);
    values[2] = ((PyObject *)Py_True);
    values[3] = ((PyObject *)__pyx_n_s_keep);

    /* "pandas/algos.pyx":233
 * 
 * def rank_1d_int64(object in_arr, ties_method='average', ascending=True,
 *                   na_option='keep', pct=False):             # <<<<<<<<<<<<<<
 *     """
 *     Fast NaN-friendly version of scipy.stats.rankdata
 */
    values[4] = ((PyObject *)Py_False);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_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 (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_in_arr)) != 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--; }
        }
        case  3:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_na_option);
          if (value) { values[3] = value; kw_args--; }
        }
        case  4:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_pct);
          if (value) { values[4] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "rank_1d_int64") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 232; __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_in_arr = values[0];
    __pyx_v_ties_method = values[1];
    __pyx_v_ascending = values[2];
    __pyx_v_na_option = values[3];
    __pyx_v_pct = values[4];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("rank_1d_int64", 0, 1, 5, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 232; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas.algos.rank_1d_int64", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6pandas_5algos_2rank_1d_int64(__pyx_self, __pyx_v_in_arr, __pyx_v_ties_method, __pyx_v_ascending, __pyx_v_na_option, __pyx_v_pct);

  /* "pandas/algos.pyx":232
 * 
 * 
 * def rank_1d_int64(object in_arr, ties_method='average', ascending=True,             # <<<<<<<<<<<<<<
 *                   na_option='keep', pct=False):
 *     """
 */

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pandas_5algos_2rank_1d_int64(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_in_arr, PyObject *__pyx_v_ties_method, PyObject *__pyx_v_ascending, CYTHON_UNUSED PyObject *__pyx_v_na_option, PyObject *__pyx_v_pct) {
  Py_ssize_t __pyx_v_i;
  Py_ssize_t __pyx_v_j;
  Py_ssize_t __pyx_v_n;
  Py_ssize_t __pyx_v_dups;
  Py_ssize_t __pyx_v_total_tie_count;
  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;
  float __pyx_v_count;
  PyObject *__pyx_v__as = NULL;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_argsorted;
  __Pyx_Buffer __pyx_pybuffer_argsorted;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_ranks;
  __Pyx_Buffer __pyx_pybuffer_ranks;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_sorted_data;
  __Pyx_Buffer __pyx_pybuffer_sorted_data;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_values;
  __Pyx_Buffer __pyx_pybuffer_values;
  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;
  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;
  __Pyx_RefNannySetupContext("rank_1d_int64", 0);
  __pyx_pybuffer_sorted_data.pybuffer.buf = NULL;
  __pyx_pybuffer_sorted_data.refcount = 0;
  __pyx_pybuffernd_sorted_data.data = NULL;
  __pyx_pybuffernd_sorted_data.rcbuffer = &__pyx_pybuffer_sorted_data;
  __pyx_pybuffer_values.pybuffer.buf = NULL;
  __pyx_pybuffer_values.refcount = 0;
  __pyx_pybuffernd_values.data = NULL;
  __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values;
  __pyx_pybuffer_ranks.pybuffer.buf = NULL;
  __pyx_pybuffer_ranks.refcount = 0;
  __pyx_pybuffernd_ranks.data = NULL;
  __pyx_pybuffernd_ranks.rcbuffer = &__pyx_pybuffer_ranks;
  __pyx_pybuffer_argsorted.pybuffer.buf = NULL;
  __pyx_pybuffer_argsorted.refcount = 0;
  __pyx_pybuffernd_argsorted.data = NULL;
  __pyx_pybuffernd_argsorted.rcbuffer = &__pyx_pybuffer_argsorted;

  /* "pandas/algos.pyx":239
 * 
 *     cdef:
 *         Py_ssize_t i, j, n, dups = 0, total_tie_count = 0             # <<<<<<<<<<<<<<
 *         ndarray[int64_t] sorted_data, values
 *         ndarray[float64_t] ranks
 */
  __pyx_v_dups = 0;
  __pyx_v_total_tie_count = 0;

  /* "pandas/algos.pyx":244
 *         ndarray[int64_t] argsorted
 *         int64_t val
 *         float64_t sum_ranks = 0             # <<<<<<<<<<<<<<
 *         int tiebreak = 0
 *         float count = 0.0
 */
  __pyx_v_sum_ranks = 0.0;

  /* "pandas/algos.pyx":245
 *         int64_t val
 *         float64_t sum_ranks = 0
 *         int tiebreak = 0             # <<<<<<<<<<<<<<
 *         float count = 0.0
 *     tiebreak = tiebreakers[ties_method]
 */
  __pyx_v_tiebreak = 0;

  /* "pandas/algos.pyx":246
 *         float64_t sum_ranks = 0
 *         int tiebreak = 0
 *         float count = 0.0             # <<<<<<<<<<<<<<
 *     tiebreak = tiebreakers[ties_method]
 * 
 */
  __pyx_v_count = 0.0;

  /* "pandas/algos.pyx":247
 *         int tiebreak = 0
 *         float count = 0.0
 *     tiebreak = tiebreakers[ties_method]             # <<<<<<<<<<<<<<
 * 
 *     values = np.asarray(in_arr)
 */
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_tiebreakers); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 247; __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 (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 247; __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_As_int(__pyx_t_2); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 247; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_tiebreak = __pyx_t_3;

  /* "pandas/algos.pyx":249
 *     tiebreak = tiebreakers[ties_method]
 * 
 *     values = np.asarray(in_arr)             # <<<<<<<<<<<<<<
 * 
 *     n = len(values)
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 249; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_asarray); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 249; __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[0]; __pyx_lineno = 249; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__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 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 249; __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;
  if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 249; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_5 = ((PyArrayObject *)__pyx_t_4);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer);
    __pyx_t_3 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (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_pybuffernd_values.rcbuffer->pybuffer, (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_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0];
    if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 249; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_5 = 0;
  __pyx_v_values = ((PyArrayObject *)__pyx_t_4);
  __pyx_t_4 = 0;

  /* "pandas/algos.pyx":251
 *     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[0]; __pyx_lineno = 251; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_n = __pyx_t_9;

  /* "pandas/algos.pyx":252
 * 
 *     n = len(values)
 *     ranks = np.empty(n, dtype='f8')             # <<<<<<<<<<<<<<
 * 
 *     # py2.5/win32 hack, can't pass i8
 */
  __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 252; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_empty); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 252; __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[0]; __pyx_lineno = 252; __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 = 252; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__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[0]; __pyx_lineno = 252; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_dtype, __pyx_n_s_f8) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 252; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, __pyx_t_4); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 252; __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_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__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[0]; __pyx_lineno = 252; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_11 = ((PyArrayObject *)__pyx_t_10);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_ranks.rcbuffer->pybuffer);
    __pyx_t_3 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_ranks.rcbuffer->pybuffer, (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_pybuffernd_ranks.rcbuffer->pybuffer, (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_pybuffernd_ranks.diminfo[0].strides = __pyx_pybuffernd_ranks.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_ranks.diminfo[0].shape = __pyx_pybuffernd_ranks.rcbuffer->pybuffer.shape[0];
    if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 252; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_11 = 0;
  __pyx_v_ranks = ((PyArrayObject *)__pyx_t_10);
  __pyx_t_10 = 0;

  /* "pandas/algos.pyx":255
 * 
 *     # 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_5algos_TIEBREAK_FIRST) != 0);
  if (__pyx_t_12) {

    /* "pandas/algos.pyx":257
 *     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 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_values), __pyx_n_s_argsort); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 257; __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[0]; __pyx_lineno = 257; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_kind, __pyx_n_s_mergesort) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 257; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_empty_tuple, __pyx_t_4); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 257; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_v__as = __pyx_t_1;
    __pyx_t_1 = 0;

    /* "pandas/algos.pyx":258
 *         # 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[0]; __pyx_lineno = 258; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_13 = ((!__pyx_t_12) != 0);
    if (__pyx_t_13) {

      /* "pandas/algos.pyx":259
 *         _as = values.argsort(kind='mergesort')
 *         if not ascending:
 *             tiebreak = TIEBREAK_FIRST_DESCENDING             # <<<<<<<<<<<<<<
 *     else:
 *         _as = values.argsort()
 */
      __pyx_v_tiebreak = __pyx_v_6pandas_5algos_TIEBREAK_FIRST_DESCENDING;
      goto __pyx_L4;
    }
    __pyx_L4:;
    goto __pyx_L3;
  }
  /*else*/ {

    /* "pandas/algos.pyx":261
 *             tiebreak = TIEBREAK_FIRST_DESCENDING
 *     else:
 *         _as = values.argsort()             # <<<<<<<<<<<<<<
 * 
 *     if not ascending:
 */
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_values), __pyx_n_s_argsort); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 261; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 261; __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_L3:;

  /* "pandas/algos.pyx":263
 *         _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[0]; __pyx_lineno = 263; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_12 = ((!__pyx_t_13) != 0);
  if (__pyx_t_12) {

    /* "pandas/algos.pyx":264
 * 
 *     if not ascending:
 *         _as = _as[::-1]             # <<<<<<<<<<<<<<
 * 
 *     sorted_data = values.take(_as)
 */
    __pyx_t_4 = PyObject_GetItem(__pyx_v__as, __pyx_slice__4); if (unlikely(__pyx_t_4 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 264; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF_SET(__pyx_v__as, __pyx_t_4);
    __pyx_t_4 = 0;
    goto __pyx_L5;
  }
  __pyx_L5:;

  /* "pandas/algos.pyx":266
 *         _as = _as[::-1]
 * 
 *     sorted_data = values.take(_as)             # <<<<<<<<<<<<<<
 *     argsorted = _as.astype('i8')
 * 
 */
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_values), __pyx_n_s_take); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 266; __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 = 266; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__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 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_1, NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 266; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_10);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__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[0]; __pyx_lineno = 266; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_5 = ((PyArrayObject *)__pyx_t_10);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_sorted_data.rcbuffer->pybuffer);
    __pyx_t_3 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_sorted_data.rcbuffer->pybuffer, (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_pybuffernd_sorted_data.rcbuffer->pybuffer, (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_pybuffernd_sorted_data.diminfo[0].strides = __pyx_pybuffernd_sorted_data.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_sorted_data.diminfo[0].shape = __pyx_pybuffernd_sorted_data.rcbuffer->pybuffer.shape[0];
    if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 266; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_5 = 0;
  __pyx_v_sorted_data = ((PyArrayObject *)__pyx_t_10);
  __pyx_t_10 = 0;

  /* "pandas/algos.pyx":267
 * 
 *     sorted_data = values.take(_as)
 *     argsorted = _as.astype('i8')             # <<<<<<<<<<<<<<
 * 
 *     for i in range(n):
 */
  __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_v__as, __pyx_n_s_astype); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 267; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_10);
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_tuple__5, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 267; __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[0]; __pyx_lineno = 267; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_14 = ((PyArrayObject *)__pyx_t_1);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_argsorted.rcbuffer->pybuffer);
    __pyx_t_3 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_argsorted.rcbuffer->pybuffer, (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_pybuffernd_argsorted.rcbuffer->pybuffer, (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_pybuffernd_argsorted.diminfo[0].strides = __pyx_pybuffernd_argsorted.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_argsorted.diminfo[0].shape = __pyx_pybuffernd_argsorted.rcbuffer->pybuffer.shape[0];
    if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 267; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_14 = 0;
  __pyx_v_argsorted = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pandas/algos.pyx":269
 *     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;

    /* "pandas/algos.pyx":270
 * 
 *     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));

    /* "pandas/algos.pyx":271
 *     for i in range(n):
 *         sum_ranks += i + 1
 *         dups += 1             # <<<<<<<<<<<<<<
 *         val = sorted_data[i]
 *         count += 1.0
 */
    __pyx_v_dups = (__pyx_v_dups + 1);

    /* "pandas/algos.pyx":272
 *         sum_ranks += i + 1
 *         dups += 1
 *         val = sorted_data[i]             # <<<<<<<<<<<<<<
 *         count += 1.0
 *         if i == n - 1 or fabs(sorted_data[i + 1] - val) > 0:
 */
    __pyx_t_16 = __pyx_v_i;
    __pyx_t_3 = -1;
    if (__pyx_t_16 < 0) {
      __pyx_t_16 += __pyx_pybuffernd_sorted_data.diminfo[0].shape;
      if (unlikely(__pyx_t_16 < 0)) __pyx_t_3 = 0;
    } else if (unlikely(__pyx_t_16 >= __pyx_pybuffernd_sorted_data.diminfo[0].shape)) __pyx_t_3 = 0;
    if (unlikely(__pyx_t_3 != -1)) {
      __Pyx_RaiseBufferIndexError(__pyx_t_3);
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 272; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_v_val = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_sorted_data.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_sorted_data.diminfo[0].strides));

    /* "pandas/algos.pyx":273
 *         dups += 1
 *         val = sorted_data[i]
 *         count += 1.0             # <<<<<<<<<<<<<<
 *         if i == n - 1 or fabs(sorted_data[i + 1] - val) > 0:
 *             if tiebreak == TIEBREAK_AVERAGE:
 */
    __pyx_v_count = (__pyx_v_count + 1.0);

    /* "pandas/algos.pyx":274
 *         val = sorted_data[i]
 *         count += 1.0
 *         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)) != 0);
    if (!__pyx_t_12) {
      __pyx_t_17 = (__pyx_v_i + 1);
      __pyx_t_3 = -1;
      if (__pyx_t_17 < 0) {
        __pyx_t_17 += __pyx_pybuffernd_sorted_data.diminfo[0].shape;
        if (unlikely(__pyx_t_17 < 0)) __pyx_t_3 = 0;
      } else if (unlikely(__pyx_t_17 >= __pyx_pybuffernd_sorted_data.diminfo[0].shape)) __pyx_t_3 = 0;
      if (unlikely(__pyx_t_3 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_3);
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 274; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_t_13 = ((fabs(((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_sorted_data.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_sorted_data.diminfo[0].strides)) - __pyx_v_val)) > 0.0) != 0);
      __pyx_t_18 = __pyx_t_13;
    } else {
      __pyx_t_18 = __pyx_t_12;
    }
    if (__pyx_t_18) {

      /* "pandas/algos.pyx":275
 *         count += 1.0
 *         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_5algos_TIEBREAK_AVERAGE) != 0);
      if (__pyx_t_18) {

        /* "pandas/algos.pyx":276
 *         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;

          /* "pandas/algos.pyx":277
 *             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)) {
            #ifdef WITH_THREAD
            PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
            #endif
            PyErr_SetString(PyExc_ZeroDivisionError, "float division");
            #ifdef WITH_THREAD
            PyGILState_Release(__pyx_gilstate_save);
            #endif
            {__pyx_filename = __pyx_f[0]; __pyx_lineno = 277; __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_pybuffernd_argsorted.diminfo[0].shape;
            if (unlikely(__pyx_t_21 < 0)) __pyx_t_3 = 0;
          } else if (unlikely(__pyx_t_21 >= __pyx_pybuffernd_argsorted.diminfo[0].shape)) __pyx_t_3 = 0;
          if (unlikely(__pyx_t_3 != -1)) {
            __Pyx_RaiseBufferIndexError(__pyx_t_3);
            {__pyx_filename = __pyx_f[0]; __pyx_lineno = 277; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          }
          __pyx_t_22 = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_argsorted.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_argsorted.diminfo[0].strides));
          __pyx_t_3 = -1;
          if (__pyx_t_22 < 0) {
            __pyx_t_22 += __pyx_pybuffernd_ranks.diminfo[0].shape;
            if (unlikely(__pyx_t_22 < 0)) __pyx_t_3 = 0;
          } else if (unlikely(__pyx_t_22 >= __pyx_pybuffernd_ranks.diminfo[0].shape)) __pyx_t_3 = 0;
          if (unlikely(__pyx_t_3 != -1)) {
            __Pyx_RaiseBufferIndexError(__pyx_t_3);
            {__pyx_filename = __pyx_f[0]; __pyx_lineno = 277; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          }
          *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_ranks.rcbuffer->pybuffer.buf, __pyx_t_22, __pyx_pybuffernd_ranks.diminfo[0].strides) = (__pyx_v_sum_ranks / __pyx_v_dups);
        }
        goto __pyx_L9;
      }

      /* "pandas/algos.pyx":278
 *                 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_5algos_TIEBREAK_MIN) != 0);
      if (__pyx_t_18) {

        /* "pandas/algos.pyx":279
 *                     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;

          /* "pandas/algos.pyx":280
 *             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_pybuffernd_argsorted.diminfo[0].shape;
            if (unlikely(__pyx_t_23 < 0)) __pyx_t_3 = 0;
          } else if (unlikely(__pyx_t_23 >= __pyx_pybuffernd_argsorted.diminfo[0].shape)) __pyx_t_3 = 0;
          if (unlikely(__pyx_t_3 != -1)) {
            __Pyx_RaiseBufferIndexError(__pyx_t_3);
            {__pyx_filename = __pyx_f[0]; __pyx_lineno = 280; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          }
          __pyx_t_24 = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_argsorted.rcbuffer->pybuffer.buf, __pyx_t_23, __pyx_pybuffernd_argsorted.diminfo[0].strides));
          __pyx_t_3 = -1;
          if (__pyx_t_24 < 0) {
            __pyx_t_24 += __pyx_pybuffernd_ranks.diminfo[0].shape;
            if (unlikely(__pyx_t_24 < 0)) __pyx_t_3 = 0;
          } else if (unlikely(__pyx_t_24 >= __pyx_pybuffernd_ranks.diminfo[0].shape)) __pyx_t_3 = 0;
          if (unlikely(__pyx_t_3 != -1)) {
            __Pyx_RaiseBufferIndexError(__pyx_t_3);
            {__pyx_filename = __pyx_f[0]; __pyx_lineno = 280; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          }
          *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_ranks.rcbuffer->pybuffer.buf, __pyx_t_24, __pyx_pybuffernd_ranks.diminfo[0].strides) = ((__pyx_v_i - __pyx_v_dups) + 2);
        }
        goto __pyx_L9;
      }

      /* "pandas/algos.pyx":281
 *                 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_5algos_TIEBREAK_MAX) != 0);
      if (__pyx_t_18) {

        /* "pandas/algos.pyx":282
 *                     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;

          /* "pandas/algos.pyx":283
 *             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_pybuffernd_argsorted.diminfo[0].shape;
            if (unlikely(__pyx_t_25 < 0)) __pyx_t_3 = 0;
          } else if (unlikely(__pyx_t_25 >= __pyx_pybuffernd_argsorted.diminfo[0].shape)) __pyx_t_3 = 0;
          if (unlikely(__pyx_t_3 != -1)) {
            __Pyx_RaiseBufferIndexError(__pyx_t_3);
            {__pyx_filename = __pyx_f[0]; __pyx_lineno = 283; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          }
          __pyx_t_26 = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_argsorted.rcbuffer->pybuffer.buf, __pyx_t_25, __pyx_pybuffernd_argsorted.diminfo[0].strides));
          __pyx_t_3 = -1;
          if (__pyx_t_26 < 0) {
            __pyx_t_26 += __pyx_pybuffernd_ranks.diminfo[0].shape;
            if (unlikely(__pyx_t_26 < 0)) __pyx_t_3 = 0;
          } else if (unlikely(__pyx_t_26 >= __pyx_pybuffernd_ranks.diminfo[0].shape)) __pyx_t_3 = 0;
          if (unlikely(__pyx_t_3 != -1)) {
            __Pyx_RaiseBufferIndexError(__pyx_t_3);
            {__pyx_filename = __pyx_f[0]; __pyx_lineno = 283; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          }
          *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_ranks.rcbuffer->pybuffer.buf, __pyx_t_26, __pyx_pybuffernd_ranks.diminfo[0].strides) = (__pyx_v_i + 1);
        }
        goto __pyx_L9;
      }

      /* "pandas/algos.pyx":284
 *                 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_5algos_TIEBREAK_FIRST) != 0);
      if (__pyx_t_18) {

        /* "pandas/algos.pyx":285
 *                     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;

          /* "pandas/algos.pyx":286
 *             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_pybuffernd_argsorted.diminfo[0].shape;
            if (unlikely(__pyx_t_27 < 0)) __pyx_t_3 = 0;
          } else if (unlikely(__pyx_t_27 >= __pyx_pybuffernd_argsorted.diminfo[0].shape)) __pyx_t_3 = 0;
          if (unlikely(__pyx_t_3 != -1)) {
            __Pyx_RaiseBufferIndexError(__pyx_t_3);
            {__pyx_filename = __pyx_f[0]; __pyx_lineno = 286; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          }
          __pyx_t_28 = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_argsorted.rcbuffer->pybuffer.buf, __pyx_t_27, __pyx_pybuffernd_argsorted.diminfo[0].strides));
          __pyx_t_3 = -1;
          if (__pyx_t_28 < 0) {
            __pyx_t_28 += __pyx_pybuffernd_ranks.diminfo[0].shape;
            if (unlikely(__pyx_t_28 < 0)) __pyx_t_3 = 0;
          } else if (unlikely(__pyx_t_28 >= __pyx_pybuffernd_ranks.diminfo[0].shape)) __pyx_t_3 = 0;
          if (unlikely(__pyx_t_3 != -1)) {
            __Pyx_RaiseBufferIndexError(__pyx_t_3);
            {__pyx_filename = __pyx_f[0]; __pyx_lineno = 286; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          }
          *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_ranks.rcbuffer->pybuffer.buf, __pyx_t_28, __pyx_pybuffernd_ranks.diminfo[0].strides) = (__pyx_v_j + 1);
        }
        goto __pyx_L9;
      }

      /* "pandas/algos.pyx":287
 *                 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_5algos_TIEBREAK_FIRST_DESCENDING) != 0);
      if (__pyx_t_18) {

        /* "pandas/algos.pyx":288
 *                     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
 *             elif tiebreak == TIEBREAK_DENSE:
 */
        __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;

          /* "pandas/algos.pyx":289
 *             elif tiebreak == TIEBREAK_FIRST_DESCENDING:
 *                 for j in range(i - dups + 1, i + 1):
 *                     ranks[argsorted[j]] = 2 * i - j - dups + 2             # <<<<<<<<<<<<<<
 *             elif tiebreak == TIEBREAK_DENSE:
 *                 total_tie_count += 1
 */
          __pyx_t_29 = __pyx_v_j;
          __pyx_t_3 = -1;
          if (__pyx_t_29 < 0) {
            __pyx_t_29 += __pyx_pybuffernd_argsorted.diminfo[0].shape;
            if (unlikely(__pyx_t_29 < 0)) __pyx_t_3 = 0;
          } else if (unlikely(__pyx_t_29 >= __pyx_pybuffernd_argsorted.diminfo[0].shape)) __pyx_t_3 = 0;
          if (unlikely(__pyx_t_3 != -1)) {
            __Pyx_RaiseBufferIndexError(__pyx_t_3);
            {__pyx_filename = __pyx_f[0]; __pyx_lineno = 289; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          }
          __pyx_t_30 = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_argsorted.rcbuffer->pybuffer.buf, __pyx_t_29, __pyx_pybuffernd_argsorted.diminfo[0].strides));
          __pyx_t_3 = -1;
          if (__pyx_t_30 < 0) {
            __pyx_t_30 += __pyx_pybuffernd_ranks.diminfo[0].shape;
            if (unlikely(__pyx_t_30 < 0)) __pyx_t_3 = 0;
          } else if (unlikely(__pyx_t_30 >= __pyx_pybuffernd_ranks.diminfo[0].shape)) __pyx_t_3 = 0;
          if (unlikely(__pyx_t_3 != -1)) {
            __Pyx_RaiseBufferIndexError(__pyx_t_3);
            {__pyx_filename = __pyx_f[0]; __pyx_lineno = 289; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          }
          *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_ranks.rcbuffer->pybuffer.buf, __pyx_t_30, __pyx_pybuffernd_ranks.diminfo[0].strides) = ((((2 * __pyx_v_i) - __pyx_v_j) - __pyx_v_dups) + 2);
        }
        goto __pyx_L9;
      }

      /* "pandas/algos.pyx":290
 *                 for j in range(i - dups + 1, i + 1):
 *                     ranks[argsorted[j]] = 2 * i - j - dups + 2
 *             elif tiebreak == TIEBREAK_DENSE:             # <<<<<<<<<<<<<<
 *                 total_tie_count += 1
 *                 for j in range(i - dups + 1, i + 1):
 */
      __pyx_t_18 = ((__pyx_v_tiebreak == __pyx_v_6pandas_5algos_TIEBREAK_DENSE) != 0);
      if (__pyx_t_18) {

        /* "pandas/algos.pyx":291
 *                     ranks[argsorted[j]] = 2 * i - j - dups + 2
 *             elif tiebreak == TIEBREAK_DENSE:
 *                 total_tie_count += 1             # <<<<<<<<<<<<<<
 *                 for j in range(i - dups + 1, i + 1):
 *                     ranks[argsorted[j]] = total_tie_count
 */
        __pyx_v_total_tie_count = (__pyx_v_total_tie_count + 1);

        /* "pandas/algos.pyx":292
 *             elif tiebreak == TIEBREAK_DENSE:
 *                 total_tie_count += 1
 *                 for j in range(i - dups + 1, i + 1):             # <<<<<<<<<<<<<<
 *                     ranks[argsorted[j]] = total_tie_count
 *             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;

          /* "pandas/algos.pyx":293
 *                 total_tie_count += 1
 *                 for j in range(i - dups + 1, i + 1):
 *                     ranks[argsorted[j]] = total_tie_count             # <<<<<<<<<<<<<<
 *             sum_ranks = dups = 0
 *     if pct:
 */
          __pyx_t_31 = __pyx_v_j;
          __pyx_t_3 = -1;
          if (__pyx_t_31 < 0) {
            __pyx_t_31 += __pyx_pybuffernd_argsorted.diminfo[0].shape;
            if (unlikely(__pyx_t_31 < 0)) __pyx_t_3 = 0;
          } else if (unlikely(__pyx_t_31 >= __pyx_pybuffernd_argsorted.diminfo[0].shape)) __pyx_t_3 = 0;
          if (unlikely(__pyx_t_3 != -1)) {
            __Pyx_RaiseBufferIndexError(__pyx_t_3);
            {__pyx_filename = __pyx_f[0]; __pyx_lineno = 293; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          }
          __pyx_t_32 = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_argsorted.rcbuffer->pybuffer.buf, __pyx_t_31, __pyx_pybuffernd_argsorted.diminfo[0].strides));
          __pyx_t_3 = -1;
          if (__pyx_t_32 < 0) {
            __pyx_t_32 += __pyx_pybuffernd_ranks.diminfo[0].shape;
            if (unlikely(__pyx_t_32 < 0)) __pyx_t_3 = 0;
          } else if (unlikely(__pyx_t_32 >= __pyx_pybuffernd_ranks.diminfo[0].shape)) __pyx_t_3 = 0;
          if (unlikely(__pyx_t_3 != -1)) {
            __Pyx_RaiseBufferIndexError(__pyx_t_3);
            {__pyx_filename = __pyx_f[0]; __pyx_lineno = 293; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          }
          *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_ranks.rcbuffer->pybuffer.buf, __pyx_t_32, __pyx_pybuffernd_ranks.diminfo[0].strides) = __pyx_v_total_tie_count;
        }
        goto __pyx_L9;
      }
      __pyx_L9:;

      /* "pandas/algos.pyx":294
 *                 for j in range(i - dups + 1, i + 1):
 *                     ranks[argsorted[j]] = total_tie_count
 *             sum_ranks = dups = 0             # <<<<<<<<<<<<<<
 *     if pct:
 *         return ranks / count
 */
      __pyx_v_sum_ranks = 0;
      __pyx_v_dups = 0;
      goto __pyx_L8;
    }
    __pyx_L8:;
  }

  /* "pandas/algos.pyx":295
 *                     ranks[argsorted[j]] = total_tie_count
 *             sum_ranks = dups = 0
 *     if pct:             # <<<<<<<<<<<<<<
 *         return ranks / count
 *     else:
 */
  __pyx_t_18 = __Pyx_PyObject_IsTrue(__pyx_v_pct); if (unlikely(__pyx_t_18 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 295; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__pyx_t_18) {

    /* "pandas/algos.pyx":296
 *             sum_ranks = dups = 0
 *     if pct:
 *         return ranks / count             # <<<<<<<<<<<<<<
 *     else:
 *         return ranks
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_1 = PyFloat_FromDouble(__pyx_v_count); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 296; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_10 = __Pyx_PyNumber_Divide(((PyObject *)__pyx_v_ranks), __pyx_t_1); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 296; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_10);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_r = __pyx_t_10;
    __pyx_t_10 = 0;
    goto __pyx_L0;
  }
  /*else*/ {

    /* "pandas/algos.pyx":298
 *         return ranks / count
 *     else:
 *         return ranks             # <<<<<<<<<<<<<<
 * 
 * 
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(((PyObject *)__pyx_v_ranks));
    __pyx_r = ((PyObject *)__pyx_v_ranks);
    goto __pyx_L0;
  }

  /* "pandas/algos.pyx":232
 * 
 * 
 * def rank_1d_int64(object in_arr, ties_method='average', ascending=True,             # <<<<<<<<<<<<<<
 *                   na_option='keep', pct=False):
 *     """
 */

  /* function exit code */
  __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_pybuffernd_argsorted.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_ranks.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_sorted_data.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas.algos.rank_1d_int64", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_argsorted.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_ranks.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_sorted_data.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer);
  __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;
}

/* "pandas/algos.pyx":301
 * 
 * 
 * def rank_2d_float64(object in_arr, axis=0, ties_method='average',             # <<<<<<<<<<<<<<
 *                     ascending=True, na_option='keep', pct=False):
 *     """
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pandas_5algos_5rank_2d_float64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6pandas_5algos_4rank_2d_float64[] = "\n    Fast NaN-friendly version of scipy.stats.rankdata\n    ";
static PyMethodDef __pyx_mdef_6pandas_5algos_5rank_2d_float64 = {__Pyx_NAMESTR("rank_2d_float64"), (PyCFunction)__pyx_pw_6pandas_5algos_5rank_2d_float64, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6pandas_5algos_4rank_2d_float64)};
static PyObject *__pyx_pw_6pandas_5algos_5rank_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;
  PyObject *__pyx_v_na_option = 0;
  PyObject *__pyx_v_pct = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("rank_2d_float64 (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_in_arr,&__pyx_n_s_axis,&__pyx_n_s_ties_method,&__pyx_n_s_ascending,&__pyx_n_s_na_option,&__pyx_n_s_pct,0};
    PyObject* values[6] = {0,0,0,0,0,0};
    values[1] = ((PyObject *)__pyx_int_0);
    values[2] = ((PyObject *)__pyx_n_s_average);

    /* "pandas/algos.pyx":302
 * 
 * def rank_2d_float64(object in_arr, axis=0, ties_method='average',
 *                     ascending=True, na_option='keep', pct=False):             # <<<<<<<<<<<<<<
 *     """
 *     Fast NaN-friendly version of scipy.stats.rankdata
 */
    values[3] = ((PyObject *)Py_True);
    values[4] = ((PyObject *)__pyx_n_s_keep);
    values[5] = ((PyObject *)Py_False);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_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 (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_in_arr)) != 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--; }
        }
        case  4:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_na_option);
          if (value) { values[4] = value; kw_args--; }
        }
        case  5:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_pct);
          if (value) { values[5] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "rank_2d_float64") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 301; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else {
      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);
        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];
    __pyx_v_na_option = values[4];
    __pyx_v_pct = values[5];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("rank_2d_float64", 0, 1, 6, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 301; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas.algos.rank_2d_float64", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6pandas_5algos_4rank_2d_float64(__pyx_self, __pyx_v_in_arr, __pyx_v_axis, __pyx_v_ties_method, __pyx_v_ascending, __pyx_v_na_option, __pyx_v_pct);

  /* "pandas/algos.pyx":301
 * 
 * 
 * def rank_2d_float64(object in_arr, axis=0, ties_method='average',             # <<<<<<<<<<<<<<
 *                     ascending=True, na_option='keep', pct=False):
 *     """
 */

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pandas_5algos_4rank_2d_float64(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_in_arr, PyObject *__pyx_v_axis, PyObject *__pyx_v_ties_method, PyObject *__pyx_v_ascending, PyObject *__pyx_v_na_option, PyObject *__pyx_v_pct) {
  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;
  Py_ssize_t __pyx_v_total_tie_count;
  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;
  int __pyx_v_keep_na;
  float __pyx_v_count;
  PyObject *__pyx_v__as = NULL;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_argsorted;
  __Pyx_Buffer __pyx_pybuffer_argsorted;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_ranks;
  __Pyx_Buffer __pyx_pybuffer_ranks;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_values;
  __Pyx_Buffer __pyx_pybuffer_values;
  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;
  __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;
  Py_ssize_t __pyx_t_50;
  Py_ssize_t __pyx_t_51;
  Py_ssize_t __pyx_t_52;
  __pyx_t_5numpy_int64_t __pyx_t_53;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("rank_2d_float64", 0);
  __Pyx_INCREF(__pyx_v_in_arr);
  __pyx_pybuffer_ranks.pybuffer.buf = NULL;
  __pyx_pybuffer_ranks.refcount = 0;
  __pyx_pybuffernd_ranks.data = NULL;
  __pyx_pybuffernd_ranks.rcbuffer = &__pyx_pybuffer_ranks;
  __pyx_pybuffer_values.pybuffer.buf = NULL;
  __pyx_pybuffer_values.refcount = 0;
  __pyx_pybuffernd_values.data = NULL;
  __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values;
  __pyx_pybuffer_argsorted.pybuffer.buf = NULL;
  __pyx_pybuffer_argsorted.refcount = 0;
  __pyx_pybuffernd_argsorted.data = NULL;
  __pyx_pybuffernd_argsorted.rcbuffer = &__pyx_pybuffer_argsorted;

  /* "pandas/algos.pyx":308
 * 
 *     cdef:
 *         Py_ssize_t i, j, z, k, n, dups = 0, total_tie_count = 0             # <<<<<<<<<<<<<<
 *         ndarray[float64_t, ndim=2] ranks, values
 *         ndarray[int64_t, ndim=2] argsorted
 */
  __pyx_v_dups = 0;
  __pyx_v_total_tie_count = 0;

  /* "pandas/algos.pyx":312
 *         ndarray[int64_t, ndim=2] argsorted
 *         float64_t val, nan_value
 *         float64_t sum_ranks = 0             # <<<<<<<<<<<<<<
 *         int tiebreak = 0
 *         bint keep_na = 0
 */
  __pyx_v_sum_ranks = 0.0;

  /* "pandas/algos.pyx":313
 *         float64_t val, nan_value
 *         float64_t sum_ranks = 0
 *         int tiebreak = 0             # <<<<<<<<<<<<<<
 *         bint keep_na = 0
 *         float count = 0.0
 */
  __pyx_v_tiebreak = 0;

  /* "pandas/algos.pyx":314
 *         float64_t sum_ranks = 0
 *         int tiebreak = 0
 *         bint keep_na = 0             # <<<<<<<<<<<<<<
 *         float count = 0.0
 * 
 */
  __pyx_v_keep_na = 0;

  /* "pandas/algos.pyx":315
 *         int tiebreak = 0
 *         bint keep_na = 0
 *         float count = 0.0             # <<<<<<<<<<<<<<
 * 
 *     tiebreak = tiebreakers[ties_method]
 */
  __pyx_v_count = 0.0;

  /* "pandas/algos.pyx":317
 *         float count = 0.0
 * 
 *     tiebreak = tiebreakers[ties_method]             # <<<<<<<<<<<<<<
 * 
 *     keep_na = na_option == 'keep'
 */
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_tiebreakers); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 317; __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 (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 317; __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_As_int(__pyx_t_2); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 317; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_tiebreak = __pyx_t_3;

  /* "pandas/algos.pyx":319
 *     tiebreak = tiebreakers[ties_method]
 * 
 *     keep_na = na_option == 'keep'             # <<<<<<<<<<<<<<
 * 
 *     in_arr = np.asarray(in_arr)
 */
  __pyx_t_2 = PyObject_RichCompare(__pyx_v_na_option, __pyx_n_s_keep, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 319; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 319; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_keep_na = __pyx_t_4;

  /* "pandas/algos.pyx":321
 *     keep_na = na_option == 'keep'
 * 
 *     in_arr = np.asarray(in_arr)             # <<<<<<<<<<<<<<
 * 
 *     if axis == 0:
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 321; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_asarray); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 321; __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[0]; __pyx_lineno = 321; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__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 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 321; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF_SET(__pyx_v_in_arr, __pyx_t_5);
  __pyx_t_5 = 0;

  /* "pandas/algos.pyx":323
 *     in_arr = np.asarray(in_arr)
 * 
 *     if axis == 0:             # <<<<<<<<<<<<<<
 *         values = in_arr.T.copy()
 *     else:
 */
  __pyx_t_5 = PyObject_RichCompare(__pyx_v_axis, __pyx_int_0, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__pyx_t_4) {

    /* "pandas/algos.pyx":324
 * 
 *     if axis == 0:
 *         values = in_arr.T.copy()             # <<<<<<<<<<<<<<
 *     else:
 *         values = in_arr.copy()
 */
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_in_arr, __pyx_n_s_T); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 324; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_copy); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 324; __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_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 324; __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_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 324; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_6 = ((PyArrayObject *)__pyx_t_5);
    {
      __Pyx_BufFmt_StackElem __pyx_stack[1];
      __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer);
      __pyx_t_3 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (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_pybuffernd_values.rcbuffer->pybuffer, (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_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_values.diminfo[1].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_values.diminfo[1].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[1];
      if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 324; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_6 = 0;
    __pyx_v_values = ((PyArrayObject *)__pyx_t_5);
    __pyx_t_5 = 0;
    goto __pyx_L3;
  }
  /*else*/ {

    /* "pandas/algos.pyx":326
 *         values = in_arr.T.copy()
 *     else:
 *         values = in_arr.copy()             # <<<<<<<<<<<<<<
 * 
 *     if ascending ^ (na_option == 'top'):
 */
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_in_arr, __pyx_n_s_copy); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 326; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 326; __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 = 326; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_6 = ((PyArrayObject *)__pyx_t_2);
    {
      __Pyx_BufFmt_StackElem __pyx_stack[1];
      __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer);
      __pyx_t_3 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (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_pybuffernd_values.rcbuffer->pybuffer, (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_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_values.diminfo[1].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_values.diminfo[1].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[1];
      if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 326; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_6 = 0;
    __pyx_v_values = ((PyArrayObject *)__pyx_t_2);
    __pyx_t_2 = 0;
  }
  __pyx_L3:;

  /* "pandas/algos.pyx":328
 *         values = in_arr.copy()
 * 
 *     if ascending ^ (na_option == 'top'):             # <<<<<<<<<<<<<<
 *         nan_value = np.inf
 *     else:
 */
  __pyx_t_2 = PyObject_RichCompare(__pyx_v_na_option, __pyx_n_s_top, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 328; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_5 = PyNumber_Xor(__pyx_v_ascending, __pyx_t_2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 328; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 328; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__pyx_t_4) {

    /* "pandas/algos.pyx":329
 * 
 *     if ascending ^ (na_option == 'top'):
 *         nan_value = np.inf             # <<<<<<<<<<<<<<
 *     else:
 *         nan_value = -np.inf
 */
    __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 329; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_inf); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 329; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_10 = __pyx_PyFloat_AsDouble(__pyx_t_2); if (unlikely((__pyx_t_10 == (npy_float64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 329; __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_L4;
  }
  /*else*/ {

    /* "pandas/algos.pyx":331
 *         nan_value = np.inf
 *     else:
 *         nan_value = -np.inf             # <<<<<<<<<<<<<<
 * 
 *     np.putmask(values, np.isnan(values), nan_value)
 */
    __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 331; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_inf); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 331; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = PyNumber_Negative(__pyx_t_5); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 331; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_10 = __pyx_PyFloat_AsDouble(__pyx_t_2); if (unlikely((__pyx_t_10 == (npy_float64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 331; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_v_nan_value = __pyx_t_10;
  }
  __pyx_L4:;

  /* "pandas/algos.pyx":333
 *         nan_value = -np.inf
 * 
 *     np.putmask(values, np.isnan(values), nan_value)             # <<<<<<<<<<<<<<
 * 
 *     n, k = (<object> values).shape
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 333; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_putmask); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 333; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 333; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_isnan); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 333; __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[0]; __pyx_lineno = 333; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__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_11 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, NULL); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 333; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_11);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyFloat_FromDouble(__pyx_v_nan_value); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 333; __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[0]; __pyx_lineno = 333; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__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_2);
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_11 = 0;
  __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 333; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pandas/algos.pyx":335
 *     np.putmask(values, np.isnan(values), nan_value)
 * 
 *     n, k = (<object> values).shape             # <<<<<<<<<<<<<<
 *     ranks = np.empty((n, k), dtype='f8')
 * 
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_values), __pyx_n_s_shape); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 335; __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 CYTHON_COMPILING_IN_CPYTHON
    Py_ssize_t size = Py_SIZE(sequence);
    #else
    Py_ssize_t size = PySequence_Size(sequence);
    #endif
    if (unlikely(size != 2)) {
      if (size > 2) __Pyx_RaiseTooManyValuesError(2);
      else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 335; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    #if CYTHON_COMPILING_IN_CPYTHON
    if (likely(PyTuple_CheckExact(sequence))) {
      __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0); 
      __pyx_t_5 = PyTuple_GET_ITEM(sequence, 1); 
    } else {
      __pyx_t_1 = PyList_GET_ITEM(sequence, 0); 
      __pyx_t_5 = PyList_GET_ITEM(sequence, 1); 
    }
    __Pyx_INCREF(__pyx_t_1);
    __Pyx_INCREF(__pyx_t_5);
    #else
    __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 335; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 335; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    #endif
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  } else {
    Py_ssize_t index = -1;
    __pyx_t_11 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 335; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_11);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 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_L5_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_1);
    index = 1; __pyx_t_5 = __pyx_t_12(__pyx_t_11); if (unlikely(!__pyx_t_5)) goto __pyx_L5_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_5);
    if (__Pyx_IternextUnpackEndCheck(__pyx_t_12(__pyx_t_11), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 335; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_12 = NULL;
    __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
    goto __pyx_L6_unpacking_done;
    __pyx_L5_unpacking_failed:;
    __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
    __pyx_t_12 = NULL;
    if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 335; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_L6_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[0]; __pyx_lineno = 335; __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_5); if (unlikely((__pyx_t_14 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 335; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_v_n = __pyx_t_13;
  __pyx_v_k = __pyx_t_14;

  /* "pandas/algos.pyx":336
 * 
 *     n, k = (<object> values).shape
 *     ranks = np.empty((n, k), dtype='f8')             # <<<<<<<<<<<<<<
 * 
 *     if tiebreak == TIEBREAK_FIRST:
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 336; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_empty); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 336; __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 = 336; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_k); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 336; __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[0]; __pyx_lineno = 336; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_11);
  PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_11, 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[0]; __pyx_lineno = 336; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__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[0]; __pyx_lineno = 336; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_11);
  if (PyDict_SetItem(__pyx_t_11, __pyx_n_s_dtype, __pyx_n_s_f8) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 336; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_1, __pyx_t_11); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 336; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__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[0]; __pyx_lineno = 336; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_6 = ((PyArrayObject *)__pyx_t_2);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_ranks.rcbuffer->pybuffer);
    __pyx_t_3 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_ranks.rcbuffer->pybuffer, (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_pybuffernd_ranks.rcbuffer->pybuffer, (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_pybuffernd_ranks.diminfo[0].strides = __pyx_pybuffernd_ranks.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_ranks.diminfo[0].shape = __pyx_pybuffernd_ranks.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_ranks.diminfo[1].strides = __pyx_pybuffernd_ranks.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_ranks.diminfo[1].shape = __pyx_pybuffernd_ranks.rcbuffer->pybuffer.shape[1];
    if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 336; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_6 = 0;
  __pyx_v_ranks = ((PyArrayObject *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "pandas/algos.pyx":338
 *     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_5algos_TIEBREAK_FIRST) != 0);
  if (__pyx_t_4) {

    /* "pandas/algos.pyx":340
 *     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_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_values), __pyx_n_s_argsort); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 340; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_11 = PyDict_New(); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 340; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_11);
    if (PyDict_SetItem(__pyx_t_11, __pyx_n_s_axis, __pyx_int_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 340; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    if (PyDict_SetItem(__pyx_t_11, __pyx_n_s_kind, __pyx_n_s_mergesort) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 340; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, __pyx_t_11); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 340; __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_11); __pyx_t_11 = 0;
    __pyx_v__as = __pyx_t_1;
    __pyx_t_1 = 0;

    /* "pandas/algos.pyx":341
 *         # 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[0]; __pyx_lineno = 341; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_15 = ((!__pyx_t_4) != 0);
    if (__pyx_t_15) {

      /* "pandas/algos.pyx":342
 *         _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_5algos_TIEBREAK_FIRST_DESCENDING;
      goto __pyx_L8;
    }
    __pyx_L8:;
    goto __pyx_L7;
  }
  /*else*/ {

    /* "pandas/algos.pyx":344
 *             tiebreak = TIEBREAK_FIRST_DESCENDING
 *     else:
 *         _as = values.argsort(1)             # <<<<<<<<<<<<<<
 * 
 *     if not ascending:
 */
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_values), __pyx_n_s_argsort); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 344; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_11 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__6, NULL); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 344; __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_L7:;

  /* "pandas/algos.pyx":346
 *         _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[0]; __pyx_lineno = 346; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_4 = ((!__pyx_t_15) != 0);
  if (__pyx_t_4) {

    /* "pandas/algos.pyx":347
 * 
 *     if not ascending:
 *         _as = _as[:, ::-1]             # <<<<<<<<<<<<<<
 * 
 *     values = _take_2d_float64(values, _as)
 */
    __pyx_t_11 = PyObject_GetItem(__pyx_v__as, __pyx_tuple__9); if (unlikely(__pyx_t_11 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 347; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
    __Pyx_GOTREF(__pyx_t_11);
    __Pyx_DECREF_SET(__pyx_v__as, __pyx_t_11);
    __pyx_t_11 = 0;
    goto __pyx_L9;
  }
  __pyx_L9:;

  /* "pandas/algos.pyx":349
 *         _as = _as[:, ::-1]
 * 
 *     values = _take_2d_float64(values, _as)             # <<<<<<<<<<<<<<
 *     argsorted = _as.astype('i8')
 * 
 */
  __pyx_t_11 = __pyx_f_6pandas_5algos__take_2d_float64(((PyArrayObject *)__pyx_v_values), __pyx_v__as); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 349; __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[0]; __pyx_lineno = 349; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_6 = ((PyArrayObject *)__pyx_t_11);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer);
    __pyx_t_3 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (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_pybuffernd_values.rcbuffer->pybuffer, (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_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_values.diminfo[1].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_values.diminfo[1].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[1];
    if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 349; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_6 = 0;
  __Pyx_DECREF_SET(__pyx_v_values, ((PyArrayObject *)__pyx_t_11));
  __pyx_t_11 = 0;

  /* "pandas/algos.pyx":350
 * 
 *     values = _take_2d_float64(values, _as)
 *     argsorted = _as.astype('i8')             # <<<<<<<<<<<<<<
 * 
 *     for i in range(n):
 */
  __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_v__as, __pyx_n_s_astype); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 350; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_11);
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_11, __pyx_tuple__10, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 350; __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[0]; __pyx_lineno = 350; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_16 = ((PyArrayObject *)__pyx_t_1);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_argsorted.rcbuffer->pybuffer);
    __pyx_t_3 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_argsorted.rcbuffer->pybuffer, (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_pybuffernd_argsorted.rcbuffer->pybuffer, (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_pybuffernd_argsorted.diminfo[0].strides = __pyx_pybuffernd_argsorted.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_argsorted.diminfo[0].shape = __pyx_pybuffernd_argsorted.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_argsorted.diminfo[1].strides = __pyx_pybuffernd_argsorted.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_argsorted.diminfo[1].shape = __pyx_pybuffernd_argsorted.rcbuffer->pybuffer.shape[1];
    if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 350; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_16 = 0;
  __pyx_v_argsorted = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pandas/algos.pyx":352
 *     argsorted = _as.astype('i8')
 * 
 *     for i in range(n):             # <<<<<<<<<<<<<<
 *         dups = sum_ranks = 0
 *         total_tie_count = 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;

    /* "pandas/algos.pyx":353
 * 
 *     for i in range(n):
 *         dups = sum_ranks = 0             # <<<<<<<<<<<<<<
 *         total_tie_count = 0
 *         count = 0.0
 */
    __pyx_v_dups = 0;
    __pyx_v_sum_ranks = 0;

    /* "pandas/algos.pyx":354
 *     for i in range(n):
 *         dups = sum_ranks = 0
 *         total_tie_count = 0             # <<<<<<<<<<<<<<
 *         count = 0.0
 *         for j in range(k):
 */
    __pyx_v_total_tie_count = 0;

    /* "pandas/algos.pyx":355
 *         dups = sum_ranks = 0
 *         total_tie_count = 0
 *         count = 0.0             # <<<<<<<<<<<<<<
 *         for j in range(k):
 *             sum_ranks += j + 1
 */
    __pyx_v_count = 0.0;

    /* "pandas/algos.pyx":356
 *         total_tie_count = 0
 *         count = 0.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;

      /* "pandas/algos.pyx":357
 *         count = 0.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));

      /* "pandas/algos.pyx":358
 *         for j in range(k):
 *             sum_ranks += j + 1
 *             dups += 1             # <<<<<<<<<<<<<<
 *             val = values[i, j]
 *             if val == nan_value and keep_na:
 */
      __pyx_v_dups = (__pyx_v_dups + 1);

      /* "pandas/algos.pyx":359
 *             sum_ranks += j + 1
 *             dups += 1
 *             val = values[i, j]             # <<<<<<<<<<<<<<
 *             if val == nan_value and keep_na:
 *                 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_pybuffernd_values.diminfo[0].shape;
        if (unlikely(__pyx_t_19 < 0)) __pyx_t_3 = 0;
      } else if (unlikely(__pyx_t_19 >= __pyx_pybuffernd_values.diminfo[0].shape)) __pyx_t_3 = 0;
      if (__pyx_t_20 < 0) {
        __pyx_t_20 += __pyx_pybuffernd_values.diminfo[1].shape;
        if (unlikely(__pyx_t_20 < 0)) __pyx_t_3 = 1;
      } else if (unlikely(__pyx_t_20 >= __pyx_pybuffernd_values.diminfo[1].shape)) __pyx_t_3 = 1;
      if (unlikely(__pyx_t_3 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_3);
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 359; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_v_val = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_19, __pyx_pybuffernd_values.diminfo[0].strides, __pyx_t_20, __pyx_pybuffernd_values.diminfo[1].strides));

      /* "pandas/algos.pyx":360
 *             dups += 1
 *             val = values[i, j]
 *             if val == nan_value and keep_na:             # <<<<<<<<<<<<<<
 *                 ranks[i, argsorted[i, j]] = nan
 *                 continue
 */
      __pyx_t_4 = ((__pyx_v_val == __pyx_v_nan_value) != 0);
      if (__pyx_t_4) {
        __pyx_t_15 = (__pyx_v_keep_na != 0);
      } else {
        __pyx_t_15 = __pyx_t_4;
      }
      if (__pyx_t_15) {

        /* "pandas/algos.pyx":361
 *             val = values[i, j]
 *             if val == nan_value and keep_na:
 *                 ranks[i, argsorted[i, j]] = nan             # <<<<<<<<<<<<<<
 *                 continue
 *             count += 1.0
 */
        __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_pybuffernd_argsorted.diminfo[0].shape;
          if (unlikely(__pyx_t_21 < 0)) __pyx_t_3 = 0;
        } else if (unlikely(__pyx_t_21 >= __pyx_pybuffernd_argsorted.diminfo[0].shape)) __pyx_t_3 = 0;
        if (__pyx_t_22 < 0) {
          __pyx_t_22 += __pyx_pybuffernd_argsorted.diminfo[1].shape;
          if (unlikely(__pyx_t_22 < 0)) __pyx_t_3 = 1;
        } else if (unlikely(__pyx_t_22 >= __pyx_pybuffernd_argsorted.diminfo[1].shape)) __pyx_t_3 = 1;
        if (unlikely(__pyx_t_3 != -1)) {
          __Pyx_RaiseBufferIndexError(__pyx_t_3);
          {__pyx_filename = __pyx_f[0]; __pyx_lineno = 361; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        __pyx_t_23 = __pyx_v_i;
        __pyx_t_24 = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_argsorted.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_argsorted.diminfo[0].strides, __pyx_t_22, __pyx_pybuffernd_argsorted.diminfo[1].strides));
        __pyx_t_3 = -1;
        if (__pyx_t_23 < 0) {
          __pyx_t_23 += __pyx_pybuffernd_ranks.diminfo[0].shape;
          if (unlikely(__pyx_t_23 < 0)) __pyx_t_3 = 0;
        } else if (unlikely(__pyx_t_23 >= __pyx_pybuffernd_ranks.diminfo[0].shape)) __pyx_t_3 = 0;
        if (__pyx_t_24 < 0) {
          __pyx_t_24 += __pyx_pybuffernd_ranks.diminfo[1].shape;
          if (unlikely(__pyx_t_24 < 0)) __pyx_t_3 = 1;
        } else if (unlikely(__pyx_t_24 >= __pyx_pybuffernd_ranks.diminfo[1].shape)) __pyx_t_3 = 1;
        if (unlikely(__pyx_t_3 != -1)) {
          __Pyx_RaiseBufferIndexError(__pyx_t_3);
          {__pyx_filename = __pyx_f[0]; __pyx_lineno = 361; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_ranks.rcbuffer->pybuffer.buf, __pyx_t_23, __pyx_pybuffernd_ranks.diminfo[0].strides, __pyx_t_24, __pyx_pybuffernd_ranks.diminfo[1].strides) = __pyx_v_6pandas_5algos_nan;

        /* "pandas/algos.pyx":362
 *             if val == nan_value and keep_na:
 *                 ranks[i, argsorted[i, j]] = nan
 *                 continue             # <<<<<<<<<<<<<<
 *             count += 1.0
 *             if j == k - 1 or float64_are_diff(values[i, j + 1], val):
 */
        goto __pyx_L12_continue;
      }

      /* "pandas/algos.pyx":363
 *                 ranks[i, argsorted[i, j]] = nan
 *                 continue
 *             count += 1.0             # <<<<<<<<<<<<<<
 *             if j == k - 1 or float64_are_diff(values[i, j + 1], val):
 *                 if tiebreak == TIEBREAK_AVERAGE:
 */
      __pyx_v_count = (__pyx_v_count + 1.0);

      /* "pandas/algos.pyx":364
 *                 continue
 *             count += 1.0
 *             if j == k - 1 or float64_are_diff(values[i, j + 1], val):             # <<<<<<<<<<<<<<
 *                 if tiebreak == TIEBREAK_AVERAGE:
 *                     for z in range(j - dups + 1, j + 1):
 */
      __pyx_t_15 = ((__pyx_v_j == (__pyx_v_k - 1)) != 0);
      if (!__pyx_t_15) {
        __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_pybuffernd_values.diminfo[0].shape;
          if (unlikely(__pyx_t_25 < 0)) __pyx_t_3 = 0;
        } else if (unlikely(__pyx_t_25 >= __pyx_pybuffernd_values.diminfo[0].shape)) __pyx_t_3 = 0;
        if (__pyx_t_26 < 0) {
          __pyx_t_26 += __pyx_pybuffernd_values.diminfo[1].shape;
          if (unlikely(__pyx_t_26 < 0)) __pyx_t_3 = 1;
        } else if (unlikely(__pyx_t_26 >= __pyx_pybuffernd_values.diminfo[1].shape)) __pyx_t_3 = 1;
        if (unlikely(__pyx_t_3 != -1)) {
          __Pyx_RaiseBufferIndexError(__pyx_t_3);
          {__pyx_filename = __pyx_f[0]; __pyx_lineno = 364; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        __pyx_t_4 = (__pyx_f_6pandas_5algos_float64_are_diff((*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_25, __pyx_pybuffernd_values.diminfo[0].strides, __pyx_t_26, __pyx_pybuffernd_values.diminfo[1].strides)), __pyx_v_val) != 0);
        __pyx_t_27 = __pyx_t_4;
      } else {
        __pyx_t_27 = __pyx_t_15;
      }
      if (__pyx_t_27) {

        /* "pandas/algos.pyx":365
 *             count += 1.0
 *             if j == k - 1 or float64_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_27 = ((__pyx_v_tiebreak == __pyx_v_6pandas_5algos_TIEBREAK_AVERAGE) != 0);
        if (__pyx_t_27) {

          /* "pandas/algos.pyx":366
 *             if j == k - 1 or float64_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_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;

            /* "pandas/algos.pyx":367
 *                 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)) {
              #ifdef WITH_THREAD
              PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
              #endif
              PyErr_SetString(PyExc_ZeroDivisionError, "float division");
              #ifdef WITH_THREAD
              PyGILState_Release(__pyx_gilstate_save);
              #endif
              {__pyx_filename = __pyx_f[0]; __pyx_lineno = 367; __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_pybuffernd_argsorted.diminfo[0].shape;
              if (unlikely(__pyx_t_30 < 0)) __pyx_t_3 = 0;
            } else if (unlikely(__pyx_t_30 >= __pyx_pybuffernd_argsorted.diminfo[0].shape)) __pyx_t_3 = 0;
            if (__pyx_t_31 < 0) {
              __pyx_t_31 += __pyx_pybuffernd_argsorted.diminfo[1].shape;
              if (unlikely(__pyx_t_31 < 0)) __pyx_t_3 = 1;
            } else if (unlikely(__pyx_t_31 >= __pyx_pybuffernd_argsorted.diminfo[1].shape)) __pyx_t_3 = 1;
            if (unlikely(__pyx_t_3 != -1)) {
              __Pyx_RaiseBufferIndexError(__pyx_t_3);
              {__pyx_filename = __pyx_f[0]; __pyx_lineno = 367; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            }
            __pyx_t_32 = __pyx_v_i;
            __pyx_t_33 = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_argsorted.rcbuffer->pybuffer.buf, __pyx_t_30, __pyx_pybuffernd_argsorted.diminfo[0].strides, __pyx_t_31, __pyx_pybuffernd_argsorted.diminfo[1].strides));
            __pyx_t_3 = -1;
            if (__pyx_t_32 < 0) {
              __pyx_t_32 += __pyx_pybuffernd_ranks.diminfo[0].shape;
              if (unlikely(__pyx_t_32 < 0)) __pyx_t_3 = 0;
            } else if (unlikely(__pyx_t_32 >= __pyx_pybuffernd_ranks.diminfo[0].shape)) __pyx_t_3 = 0;
            if (__pyx_t_33 < 0) {
              __pyx_t_33 += __pyx_pybuffernd_ranks.diminfo[1].shape;
              if (unlikely(__pyx_t_33 < 0)) __pyx_t_3 = 1;
            } else if (unlikely(__pyx_t_33 >= __pyx_pybuffernd_ranks.diminfo[1].shape)) __pyx_t_3 = 1;
            if (unlikely(__pyx_t_3 != -1)) {
              __Pyx_RaiseBufferIndexError(__pyx_t_3);
              {__pyx_filename = __pyx_f[0]; __pyx_lineno = 367; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            }
            *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_ranks.rcbuffer->pybuffer.buf, __pyx_t_32, __pyx_pybuffernd_ranks.diminfo[0].strides, __pyx_t_33, __pyx_pybuffernd_ranks.diminfo[1].strides) = (__pyx_v_sum_ranks / __pyx_v_dups);
          }
          goto __pyx_L16;
        }

        /* "pandas/algos.pyx":368
 *                     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_5algos_TIEBREAK_MIN) != 0);
        if (__pyx_t_27) {

          /* "pandas/algos.pyx":369
 *                         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;

            /* "pandas/algos.pyx":370
 *                 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_pybuffernd_argsorted.diminfo[0].shape;
              if (unlikely(__pyx_t_34 < 0)) __pyx_t_3 = 0;
            } else if (unlikely(__pyx_t_34 >= __pyx_pybuffernd_argsorted.diminfo[0].shape)) __pyx_t_3 = 0;
            if (__pyx_t_35 < 0) {
              __pyx_t_35 += __pyx_pybuffernd_argsorted.diminfo[1].shape;
              if (unlikely(__pyx_t_35 < 0)) __pyx_t_3 = 1;
            } else if (unlikely(__pyx_t_35 >= __pyx_pybuffernd_argsorted.diminfo[1].shape)) __pyx_t_3 = 1;
            if (unlikely(__pyx_t_3 != -1)) {
              __Pyx_RaiseBufferIndexError(__pyx_t_3);
              {__pyx_filename = __pyx_f[0]; __pyx_lineno = 370; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            }
            __pyx_t_36 = __pyx_v_i;
            __pyx_t_37 = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_argsorted.rcbuffer->pybuffer.buf, __pyx_t_34, __pyx_pybuffernd_argsorted.diminfo[0].strides, __pyx_t_35, __pyx_pybuffernd_argsorted.diminfo[1].strides));
            __pyx_t_3 = -1;
            if (__pyx_t_36 < 0) {
              __pyx_t_36 += __pyx_pybuffernd_ranks.diminfo[0].shape;
              if (unlikely(__pyx_t_36 < 0)) __pyx_t_3 = 0;
            } else if (unlikely(__pyx_t_36 >= __pyx_pybuffernd_ranks.diminfo[0].shape)) __pyx_t_3 = 0;
            if (__pyx_t_37 < 0) {
              __pyx_t_37 += __pyx_pybuffernd_ranks.diminfo[1].shape;
              if (unlikely(__pyx_t_37 < 0)) __pyx_t_3 = 1;
            } else if (unlikely(__pyx_t_37 >= __pyx_pybuffernd_ranks.diminfo[1].shape)) __pyx_t_3 = 1;
            if (unlikely(__pyx_t_3 != -1)) {
              __Pyx_RaiseBufferIndexError(__pyx_t_3);
              {__pyx_filename = __pyx_f[0]; __pyx_lineno = 370; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            }
            *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_ranks.rcbuffer->pybuffer.buf, __pyx_t_36, __pyx_pybuffernd_ranks.diminfo[0].strides, __pyx_t_37, __pyx_pybuffernd_ranks.diminfo[1].strides) = ((__pyx_v_j - __pyx_v_dups) + 2);
          }
          goto __pyx_L16;
        }

        /* "pandas/algos.pyx":371
 *                     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_5algos_TIEBREAK_MAX) != 0);
        if (__pyx_t_27) {

          /* "pandas/algos.pyx":372
 *                         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;

            /* "pandas/algos.pyx":373
 *                 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_pybuffernd_argsorted.diminfo[0].shape;
              if (unlikely(__pyx_t_38 < 0)) __pyx_t_3 = 0;
            } else if (unlikely(__pyx_t_38 >= __pyx_pybuffernd_argsorted.diminfo[0].shape)) __pyx_t_3 = 0;
            if (__pyx_t_39 < 0) {
              __pyx_t_39 += __pyx_pybuffernd_argsorted.diminfo[1].shape;
              if (unlikely(__pyx_t_39 < 0)) __pyx_t_3 = 1;
            } else if (unlikely(__pyx_t_39 >= __pyx_pybuffernd_argsorted.diminfo[1].shape)) __pyx_t_3 = 1;
            if (unlikely(__pyx_t_3 != -1)) {
              __Pyx_RaiseBufferIndexError(__pyx_t_3);
              {__pyx_filename = __pyx_f[0]; __pyx_lineno = 373; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            }
            __pyx_t_40 = __pyx_v_i;
            __pyx_t_41 = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_argsorted.rcbuffer->pybuffer.buf, __pyx_t_38, __pyx_pybuffernd_argsorted.diminfo[0].strides, __pyx_t_39, __pyx_pybuffernd_argsorted.diminfo[1].strides));
            __pyx_t_3 = -1;
            if (__pyx_t_40 < 0) {
              __pyx_t_40 += __pyx_pybuffernd_ranks.diminfo[0].shape;
              if (unlikely(__pyx_t_40 < 0)) __pyx_t_3 = 0;
            } else if (unlikely(__pyx_t_40 >= __pyx_pybuffernd_ranks.diminfo[0].shape)) __pyx_t_3 = 0;
            if (__pyx_t_41 < 0) {
              __pyx_t_41 += __pyx_pybuffernd_ranks.diminfo[1].shape;
              if (unlikely(__pyx_t_41 < 0)) __pyx_t_3 = 1;
            } else if (unlikely(__pyx_t_41 >= __pyx_pybuffernd_ranks.diminfo[1].shape)) __pyx_t_3 = 1;
            if (unlikely(__pyx_t_3 != -1)) {
              __Pyx_RaiseBufferIndexError(__pyx_t_3);
              {__pyx_filename = __pyx_f[0]; __pyx_lineno = 373; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            }
            *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_ranks.rcbuffer->pybuffer.buf, __pyx_t_40, __pyx_pybuffernd_ranks.diminfo[0].strides, __pyx_t_41, __pyx_pybuffernd_ranks.diminfo[1].strides) = (__pyx_v_j + 1);
          }
          goto __pyx_L16;
        }

        /* "pandas/algos.pyx":374
 *                     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_5algos_TIEBREAK_FIRST) != 0);
        if (__pyx_t_27) {

          /* "pandas/algos.pyx":375
 *                         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;

            /* "pandas/algos.pyx":376
 *                 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_pybuffernd_argsorted.diminfo[0].shape;
              if (unlikely(__pyx_t_42 < 0)) __pyx_t_3 = 0;
            } else if (unlikely(__pyx_t_42 >= __pyx_pybuffernd_argsorted.diminfo[0].shape)) __pyx_t_3 = 0;
            if (__pyx_t_43 < 0) {
              __pyx_t_43 += __pyx_pybuffernd_argsorted.diminfo[1].shape;
              if (unlikely(__pyx_t_43 < 0)) __pyx_t_3 = 1;
            } else if (unlikely(__pyx_t_43 >= __pyx_pybuffernd_argsorted.diminfo[1].shape)) __pyx_t_3 = 1;
            if (unlikely(__pyx_t_3 != -1)) {
              __Pyx_RaiseBufferIndexError(__pyx_t_3);
              {__pyx_filename = __pyx_f[0]; __pyx_lineno = 376; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            }
            __pyx_t_44 = __pyx_v_i;
            __pyx_t_45 = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_argsorted.rcbuffer->pybuffer.buf, __pyx_t_42, __pyx_pybuffernd_argsorted.diminfo[0].strides, __pyx_t_43, __pyx_pybuffernd_argsorted.diminfo[1].strides));
            __pyx_t_3 = -1;
            if (__pyx_t_44 < 0) {
              __pyx_t_44 += __pyx_pybuffernd_ranks.diminfo[0].shape;
              if (unlikely(__pyx_t_44 < 0)) __pyx_t_3 = 0;
            } else if (unlikely(__pyx_t_44 >= __pyx_pybuffernd_ranks.diminfo[0].shape)) __pyx_t_3 = 0;
            if (__pyx_t_45 < 0) {
              __pyx_t_45 += __pyx_pybuffernd_ranks.diminfo[1].shape;
              if (unlikely(__pyx_t_45 < 0)) __pyx_t_3 = 1;
            } else if (unlikely(__pyx_t_45 >= __pyx_pybuffernd_ranks.diminfo[1].shape)) __pyx_t_3 = 1;
            if (unlikely(__pyx_t_3 != -1)) {
              __Pyx_RaiseBufferIndexError(__pyx_t_3);
              {__pyx_filename = __pyx_f[0]; __pyx_lineno = 376; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            }
            *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_ranks.rcbuffer->pybuffer.buf, __pyx_t_44, __pyx_pybuffernd_ranks.diminfo[0].strides, __pyx_t_45, __pyx_pybuffernd_ranks.diminfo[1].strides) = (__pyx_v_z + 1);
          }
          goto __pyx_L16;
        }

        /* "pandas/algos.pyx":377
 *                     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_5algos_TIEBREAK_FIRST_DESCENDING) != 0);
        if (__pyx_t_27) {

          /* "pandas/algos.pyx":378
 *                         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
 *                 elif tiebreak == TIEBREAK_DENSE:
 */
          __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;

            /* "pandas/algos.pyx":379
 *                 elif tiebreak == TIEBREAK_FIRST_DESCENDING:
 *                     for z in range(j - dups + 1, j + 1):
 *                         ranks[i, argsorted[i, z]] = 2 * j - z - dups + 2             # <<<<<<<<<<<<<<
 *                 elif tiebreak == TIEBREAK_DENSE:
 *                     total_tie_count += 1
 */
            __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_pybuffernd_argsorted.diminfo[0].shape;
              if (unlikely(__pyx_t_46 < 0)) __pyx_t_3 = 0;
            } else if (unlikely(__pyx_t_46 >= __pyx_pybuffernd_argsorted.diminfo[0].shape)) __pyx_t_3 = 0;
            if (__pyx_t_47 < 0) {
              __pyx_t_47 += __pyx_pybuffernd_argsorted.diminfo[1].shape;
              if (unlikely(__pyx_t_47 < 0)) __pyx_t_3 = 1;
            } else if (unlikely(__pyx_t_47 >= __pyx_pybuffernd_argsorted.diminfo[1].shape)) __pyx_t_3 = 1;
            if (unlikely(__pyx_t_3 != -1)) {
              __Pyx_RaiseBufferIndexError(__pyx_t_3);
              {__pyx_filename = __pyx_f[0]; __pyx_lineno = 379; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            }
            __pyx_t_48 = __pyx_v_i;
            __pyx_t_49 = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_argsorted.rcbuffer->pybuffer.buf, __pyx_t_46, __pyx_pybuffernd_argsorted.diminfo[0].strides, __pyx_t_47, __pyx_pybuffernd_argsorted.diminfo[1].strides));
            __pyx_t_3 = -1;
            if (__pyx_t_48 < 0) {
              __pyx_t_48 += __pyx_pybuffernd_ranks.diminfo[0].shape;
              if (unlikely(__pyx_t_48 < 0)) __pyx_t_3 = 0;
            } else if (unlikely(__pyx_t_48 >= __pyx_pybuffernd_ranks.diminfo[0].shape)) __pyx_t_3 = 0;
            if (__pyx_t_49 < 0) {
              __pyx_t_49 += __pyx_pybuffernd_ranks.diminfo[1].shape;
              if (unlikely(__pyx_t_49 < 0)) __pyx_t_3 = 1;
            } else if (unlikely(__pyx_t_49 >= __pyx_pybuffernd_ranks.diminfo[1].shape)) __pyx_t_3 = 1;
            if (unlikely(__pyx_t_3 != -1)) {
              __Pyx_RaiseBufferIndexError(__pyx_t_3);
              {__pyx_filename = __pyx_f[0]; __pyx_lineno = 379; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            }
            *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_ranks.rcbuffer->pybuffer.buf, __pyx_t_48, __pyx_pybuffernd_ranks.diminfo[0].strides, __pyx_t_49, __pyx_pybuffernd_ranks.diminfo[1].strides) = ((((2 * __pyx_v_j) - __pyx_v_z) - __pyx_v_dups) + 2);
          }
          goto __pyx_L16;
        }

        /* "pandas/algos.pyx":380
 *                     for z in range(j - dups + 1, j + 1):
 *                         ranks[i, argsorted[i, z]] = 2 * j - z - dups + 2
 *                 elif tiebreak == TIEBREAK_DENSE:             # <<<<<<<<<<<<<<
 *                     total_tie_count += 1
 *                     for z in range(j - dups + 1, j + 1):
 */
        __pyx_t_27 = ((__pyx_v_tiebreak == __pyx_v_6pandas_5algos_TIEBREAK_DENSE) != 0);
        if (__pyx_t_27) {

          /* "pandas/algos.pyx":381
 *                         ranks[i, argsorted[i, z]] = 2 * j - z - dups + 2
 *                 elif tiebreak == TIEBREAK_DENSE:
 *                     total_tie_count += 1             # <<<<<<<<<<<<<<
 *                     for z in range(j - dups + 1, j + 1):
 *                         ranks[i, argsorted[i, z]] = total_tie_count
 */
          __pyx_v_total_tie_count = (__pyx_v_total_tie_count + 1);

          /* "pandas/algos.pyx":382
 *                 elif tiebreak == TIEBREAK_DENSE:
 *                     total_tie_count += 1
 *                     for z in range(j - dups + 1, j + 1):             # <<<<<<<<<<<<<<
 *                         ranks[i, argsorted[i, z]] = total_tie_count
 *                 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;

            /* "pandas/algos.pyx":383
 *                     total_tie_count += 1
 *                     for z in range(j - dups + 1, j + 1):
 *                         ranks[i, argsorted[i, z]] = total_tie_count             # <<<<<<<<<<<<<<
 *                 sum_ranks = dups = 0
 *         if pct:
 */
            __pyx_t_50 = __pyx_v_i;
            __pyx_t_51 = __pyx_v_z;
            __pyx_t_3 = -1;
            if (__pyx_t_50 < 0) {
              __pyx_t_50 += __pyx_pybuffernd_argsorted.diminfo[0].shape;
              if (unlikely(__pyx_t_50 < 0)) __pyx_t_3 = 0;
            } else if (unlikely(__pyx_t_50 >= __pyx_pybuffernd_argsorted.diminfo[0].shape)) __pyx_t_3 = 0;
            if (__pyx_t_51 < 0) {
              __pyx_t_51 += __pyx_pybuffernd_argsorted.diminfo[1].shape;
              if (unlikely(__pyx_t_51 < 0)) __pyx_t_3 = 1;
            } else if (unlikely(__pyx_t_51 >= __pyx_pybuffernd_argsorted.diminfo[1].shape)) __pyx_t_3 = 1;
            if (unlikely(__pyx_t_3 != -1)) {
              __Pyx_RaiseBufferIndexError(__pyx_t_3);
              {__pyx_filename = __pyx_f[0]; __pyx_lineno = 383; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            }
            __pyx_t_52 = __pyx_v_i;
            __pyx_t_53 = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_argsorted.rcbuffer->pybuffer.buf, __pyx_t_50, __pyx_pybuffernd_argsorted.diminfo[0].strides, __pyx_t_51, __pyx_pybuffernd_argsorted.diminfo[1].strides));
            __pyx_t_3 = -1;
            if (__pyx_t_52 < 0) {
              __pyx_t_52 += __pyx_pybuffernd_ranks.diminfo[0].shape;
              if (unlikely(__pyx_t_52 < 0)) __pyx_t_3 = 0;
            } else if (unlikely(__pyx_t_52 >= __pyx_pybuffernd_ranks.diminfo[0].shape)) __pyx_t_3 = 0;
            if (__pyx_t_53 < 0) {
              __pyx_t_53 += __pyx_pybuffernd_ranks.diminfo[1].shape;
              if (unlikely(__pyx_t_53 < 0)) __pyx_t_3 = 1;
            } else if (unlikely(__pyx_t_53 >= __pyx_pybuffernd_ranks.diminfo[1].shape)) __pyx_t_3 = 1;
            if (unlikely(__pyx_t_3 != -1)) {
              __Pyx_RaiseBufferIndexError(__pyx_t_3);
              {__pyx_filename = __pyx_f[0]; __pyx_lineno = 383; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            }
            *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_ranks.rcbuffer->pybuffer.buf, __pyx_t_52, __pyx_pybuffernd_ranks.diminfo[0].strides, __pyx_t_53, __pyx_pybuffernd_ranks.diminfo[1].strides) = __pyx_v_total_tie_count;
          }
          goto __pyx_L16;
        }
        __pyx_L16:;

        /* "pandas/algos.pyx":384
 *                     for z in range(j - dups + 1, j + 1):
 *                         ranks[i, argsorted[i, z]] = total_tie_count
 *                 sum_ranks = dups = 0             # <<<<<<<<<<<<<<
 *         if pct:
 *             ranks[i, :] /= count
 */
        __pyx_v_sum_ranks = 0;
        __pyx_v_dups = 0;
        goto __pyx_L15;
      }
      __pyx_L15:;
      __pyx_L12_continue:;
    }

    /* "pandas/algos.pyx":385
 *                         ranks[i, argsorted[i, z]] = total_tie_count
 *                 sum_ranks = dups = 0
 *         if pct:             # <<<<<<<<<<<<<<
 *             ranks[i, :] /= count
 *     if axis == 0:
 */
    __pyx_t_27 = __Pyx_PyObject_IsTrue(__pyx_v_pct); if (unlikely(__pyx_t_27 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 385; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    if (__pyx_t_27) {

      /* "pandas/algos.pyx":386
 *                 sum_ranks = dups = 0
 *         if pct:
 *             ranks[i, :] /= count             # <<<<<<<<<<<<<<
 *     if axis == 0:
 *         return ranks.T
 */
      __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_i); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 386; __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[0]; __pyx_lineno = 386; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_11);
      PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_1);
      __Pyx_GIVEREF(__pyx_t_1);
      __Pyx_INCREF(__pyx_slice__11);
      PyTuple_SET_ITEM(__pyx_t_11, 1, __pyx_slice__11);
      __Pyx_GIVEREF(__pyx_slice__11);
      __pyx_t_1 = 0;
      __pyx_t_1 = PyObject_GetItem(((PyObject *)__pyx_v_ranks), __pyx_t_11); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 386; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_2 = PyFloat_FromDouble(__pyx_v_count); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 386; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_5 = __Pyx_PyNumber_InPlaceDivide(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 386; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      if (unlikely(PyObject_SetItem(((PyObject *)__pyx_v_ranks), __pyx_t_11, __pyx_t_5) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 386; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
      goto __pyx_L29;
    }
    __pyx_L29:;
  }

  /* "pandas/algos.pyx":387
 *         if pct:
 *             ranks[i, :] /= count
 *     if axis == 0:             # <<<<<<<<<<<<<<
 *         return ranks.T
 *     else:
 */
  __pyx_t_11 = PyObject_RichCompare(__pyx_v_axis, __pyx_int_0, Py_EQ); __Pyx_XGOTREF(__pyx_t_11); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 387; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_27 = __Pyx_PyObject_IsTrue(__pyx_t_11); if (unlikely(__pyx_t_27 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 387; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  if (__pyx_t_27) {

    /* "pandas/algos.pyx":388
 *             ranks[i, :] /= count
 *     if axis == 0:
 *         return ranks.T             # <<<<<<<<<<<<<<
 *     else:
 *         return ranks
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_11 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_ranks), __pyx_n_s_T); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 388; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_11);
    __pyx_r = __pyx_t_11;
    __pyx_t_11 = 0;
    goto __pyx_L0;
  }
  /*else*/ {

    /* "pandas/algos.pyx":390
 *         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;
  }

  /* "pandas/algos.pyx":301
 * 
 * 
 * def rank_2d_float64(object in_arr, axis=0, ties_method='average',             # <<<<<<<<<<<<<<
 *                     ascending=True, na_option='keep', pct=False):
 *     """
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_11);
  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
    __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_argsorted.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_ranks.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas.algos.rank_2d_float64", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_argsorted.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_ranks.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer);
  __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;
}

/* "pandas/algos.pyx":393
 * 
 * 
 * def rank_2d_int64(object in_arr, axis=0, ties_method='average',             # <<<<<<<<<<<<<<
 *                     ascending=True, na_option='keep', pct=False):
 *     """
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pandas_5algos_7rank_2d_int64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6pandas_5algos_6rank_2d_int64[] = "\n    Fast NaN-friendly version of scipy.stats.rankdata\n    ";
static PyMethodDef __pyx_mdef_6pandas_5algos_7rank_2d_int64 = {__Pyx_NAMESTR("rank_2d_int64"), (PyCFunction)__pyx_pw_6pandas_5algos_7rank_2d_int64, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6pandas_5algos_6rank_2d_int64)};
static PyObject *__pyx_pw_6pandas_5algos_7rank_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;
  CYTHON_UNUSED PyObject *__pyx_v_na_option = 0;
  PyObject *__pyx_v_pct = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("rank_2d_int64 (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_in_arr,&__pyx_n_s_axis,&__pyx_n_s_ties_method,&__pyx_n_s_ascending,&__pyx_n_s_na_option,&__pyx_n_s_pct,0};
    PyObject* values[6] = {0,0,0,0,0,0};
    values[1] = ((PyObject *)__pyx_int_0);
    values[2] = ((PyObject *)__pyx_n_s_average);

    /* "pandas/algos.pyx":394
 * 
 * def rank_2d_int64(object in_arr, axis=0, ties_method='average',
 *                     ascending=True, na_option='keep', pct=False):             # <<<<<<<<<<<<<<
 *     """
 *     Fast NaN-friendly version of scipy.stats.rankdata
 */
    values[3] = ((PyObject *)Py_True);
    values[4] = ((PyObject *)__pyx_n_s_keep);
    values[5] = ((PyObject *)Py_False);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_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 (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_in_arr)) != 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--; }
        }
        case  4:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_na_option);
          if (value) { values[4] = value; kw_args--; }
        }
        case  5:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_pct);
          if (value) { values[5] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "rank_2d_int64") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 393; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else {
      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);
        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];
    __pyx_v_na_option = values[4];
    __pyx_v_pct = values[5];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("rank_2d_int64", 0, 1, 6, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 393; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas.algos.rank_2d_int64", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6pandas_5algos_6rank_2d_int64(__pyx_self, __pyx_v_in_arr, __pyx_v_axis, __pyx_v_ties_method, __pyx_v_ascending, __pyx_v_na_option, __pyx_v_pct);

  /* "pandas/algos.pyx":393
 * 
 * 
 * def rank_2d_int64(object in_arr, axis=0, ties_method='average',             # <<<<<<<<<<<<<<
 *                     ascending=True, na_option='keep', pct=False):
 *     """
 */

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pandas_5algos_6rank_2d_int64(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_in_arr, PyObject *__pyx_v_axis, PyObject *__pyx_v_ties_method, PyObject *__pyx_v_ascending, CYTHON_UNUSED PyObject *__pyx_v_na_option, PyObject *__pyx_v_pct) {
  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;
  Py_ssize_t __pyx_v_total_tie_count;
  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;
  float __pyx_v_count;
  PyObject *__pyx_v__as = NULL;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_argsorted;
  __Pyx_Buffer __pyx_pybuffer_argsorted;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_ranks;
  __Pyx_Buffer __pyx_pybuffer_ranks;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_values;
  __Pyx_Buffer __pyx_pybuffer_values;
  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;
  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;
  __Pyx_RefNannySetupContext("rank_2d_int64", 0);
  __pyx_pybuffer_ranks.pybuffer.buf = NULL;
  __pyx_pybuffer_ranks.refcount = 0;
  __pyx_pybuffernd_ranks.data = NULL;
  __pyx_pybuffernd_ranks.rcbuffer = &__pyx_pybuffer_ranks;
  __pyx_pybuffer_argsorted.pybuffer.buf = NULL;
  __pyx_pybuffer_argsorted.refcount = 0;
  __pyx_pybuffernd_argsorted.data = NULL;
  __pyx_pybuffernd_argsorted.rcbuffer = &__pyx_pybuffer_argsorted;
  __pyx_pybuffer_values.pybuffer.buf = NULL;
  __pyx_pybuffer_values.refcount = 0;
  __pyx_pybuffernd_values.data = NULL;
  __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values;

  /* "pandas/algos.pyx":400
 * 
 *     cdef:
 *         Py_ssize_t i, j, z, k, n, dups = 0, total_tie_count = 0             # <<<<<<<<<<<<<<
 *         ndarray[float64_t, ndim=2] ranks
 *         ndarray[int64_t, ndim=2] argsorted
 */
  __pyx_v_dups = 0;
  __pyx_v_total_tie_count = 0;

  /* "pandas/algos.pyx":405
 *         ndarray[int64_t, ndim=2, cast=True] values
 *         int64_t val
 *         float64_t sum_ranks = 0             # <<<<<<<<<<<<<<
 *         int tiebreak = 0
 *         float count = 0.0
 */
  __pyx_v_sum_ranks = 0.0;

  /* "pandas/algos.pyx":406
 *         int64_t val
 *         float64_t sum_ranks = 0
 *         int tiebreak = 0             # <<<<<<<<<<<<<<
 *         float count = 0.0
 *     tiebreak = tiebreakers[ties_method]
 */
  __pyx_v_tiebreak = 0;

  /* "pandas/algos.pyx":407
 *         float64_t sum_ranks = 0
 *         int tiebreak = 0
 *         float count = 0.0             # <<<<<<<<<<<<<<
 *     tiebreak = tiebreakers[ties_method]
 * 
 */
  __pyx_v_count = 0.0;

  /* "pandas/algos.pyx":408
 *         int tiebreak = 0
 *         float count = 0.0
 *     tiebreak = tiebreakers[ties_method]             # <<<<<<<<<<<<<<
 * 
 *     if axis == 0:
 */
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_tiebreakers); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 408; __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 (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[0]; __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_3 = __Pyx_PyInt_As_int(__pyx_t_2); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 408; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_tiebreak = __pyx_t_3;

  /* "pandas/algos.pyx":410
 *     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); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 410; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 410; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__pyx_t_4) {

    /* "pandas/algos.pyx":411
 * 
 *     if axis == 0:
 *         values = np.asarray(in_arr).T             # <<<<<<<<<<<<<<
 *     else:
 *         values = np.asarray(in_arr)
 */
    __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 411; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_asarray); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 411; __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[0]; __pyx_lineno = 411; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__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 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 411; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_T); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 411; __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 = 411; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_6 = ((PyArrayObject *)__pyx_t_2);
    {
      __Pyx_BufFmt_StackElem __pyx_stack[1];
      __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer);
      __pyx_t_3 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (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_pybuffernd_values.rcbuffer->pybuffer, (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_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_values.diminfo[1].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_values.diminfo[1].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[1];
      if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 411; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_6 = 0;
    __pyx_v_values = ((PyArrayObject *)__pyx_t_2);
    __pyx_t_2 = 0;
    goto __pyx_L3;
  }
  /*else*/ {

    /* "pandas/algos.pyx":413
 *         values = np.asarray(in_arr).T
 *     else:
 *         values = np.asarray(in_arr)             # <<<<<<<<<<<<<<
 * 
 *     n, k = (<object> values).shape
 */
    __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 413; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_asarray); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 413; __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 = 413; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__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 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 413; __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_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[0]; __pyx_lineno = 413; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_6 = ((PyArrayObject *)__pyx_t_1);
    {
      __Pyx_BufFmt_StackElem __pyx_stack[1];
      __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer);
      __pyx_t_3 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (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_pybuffernd_values.rcbuffer->pybuffer, (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_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_values.diminfo[1].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_values.diminfo[1].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[1];
      if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 413; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_6 = 0;
    __pyx_v_values = ((PyArrayObject *)__pyx_t_1);
    __pyx_t_1 = 0;
  }
  __pyx_L3:;

  /* "pandas/algos.pyx":415
 *         values = np.asarray(in_arr)
 * 
 *     n, k = (<object> values).shape             # <<<<<<<<<<<<<<
 *     ranks = np.empty((n, k), dtype='f8')
 * 
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_values), __pyx_n_s_shape); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 415; __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 CYTHON_COMPILING_IN_CPYTHON
    Py_ssize_t size = Py_SIZE(sequence);
    #else
    Py_ssize_t size = PySequence_Size(sequence);
    #endif
    if (unlikely(size != 2)) {
      if (size > 2) __Pyx_RaiseTooManyValuesError(2);
      else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 415; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    #if CYTHON_COMPILING_IN_CPYTHON
    if (likely(PyTuple_CheckExact(sequence))) {
      __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); 
      __pyx_t_5 = PyTuple_GET_ITEM(sequence, 1); 
    } else {
      __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);
    #else
    __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 415; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 415; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    #endif
    __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[0]; __pyx_lineno = 415; __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_L4_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_L4_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_5);
    if (__Pyx_IternextUnpackEndCheck(__pyx_t_11(__pyx_t_10), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 415; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_11 = NULL;
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    goto __pyx_L5_unpacking_done;
    __pyx_L4_unpacking_failed:;
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    __pyx_t_11 = NULL;
    if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 415; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_L5_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[0]; __pyx_lineno = 415; __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[0]; __pyx_lineno = 415; __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;

  /* "pandas/algos.pyx":416
 * 
 *     n, k = (<object> values).shape
 *     ranks = np.empty((n, k), dtype='f8')             # <<<<<<<<<<<<<<
 * 
 *     if tiebreak == TIEBREAK_FIRST:
 */
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 416; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_empty); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 416; __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[0]; __pyx_lineno = 416; __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[0]; __pyx_lineno = 416; __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[0]; __pyx_lineno = 416; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__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[0]; __pyx_lineno = 416; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_10);
  __Pyx_GIVEREF(__pyx_t_10);
  __pyx_t_10 = 0;
  __pyx_t_10 = PyDict_New(); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 416; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_10);
  if (PyDict_SetItem(__pyx_t_10, __pyx_n_s_dtype, __pyx_n_s_f8) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 416; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_2, __pyx_t_10); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 416; __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_2); __pyx_t_2 = 0;
  __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[0]; __pyx_lineno = 416; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_14 = ((PyArrayObject *)__pyx_t_1);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_ranks.rcbuffer->pybuffer);
    __pyx_t_3 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_ranks.rcbuffer->pybuffer, (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_pybuffernd_ranks.rcbuffer->pybuffer, (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_pybuffernd_ranks.diminfo[0].strides = __pyx_pybuffernd_ranks.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_ranks.diminfo[0].shape = __pyx_pybuffernd_ranks.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_ranks.diminfo[1].strides = __pyx_pybuffernd_ranks.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_ranks.diminfo[1].shape = __pyx_pybuffernd_ranks.rcbuffer->pybuffer.shape[1];
    if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 416; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_14 = 0;
  __pyx_v_ranks = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pandas/algos.pyx":418
 *     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_5algos_TIEBREAK_FIRST) != 0);
  if (__pyx_t_4) {

    /* "pandas/algos.pyx":420
 *     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 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_values), __pyx_n_s_argsort); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 420; __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[0]; __pyx_lineno = 420; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_10);
    if (PyDict_SetItem(__pyx_t_10, __pyx_n_s_axis, __pyx_int_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 420; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    if (PyDict_SetItem(__pyx_t_10, __pyx_n_s_kind, __pyx_n_s_mergesort) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 420; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, __pyx_t_10); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 420; __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_10); __pyx_t_10 = 0;
    __pyx_v__as = __pyx_t_2;
    __pyx_t_2 = 0;

    /* "pandas/algos.pyx":421
 *         # 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[0]; __pyx_lineno = 421; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_15 = ((!__pyx_t_4) != 0);
    if (__pyx_t_15) {

      /* "pandas/algos.pyx":422
 *         _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_5algos_TIEBREAK_FIRST_DESCENDING;
      goto __pyx_L7;
    }
    __pyx_L7:;
    goto __pyx_L6;
  }
  /*else*/ {

    /* "pandas/algos.pyx":424
 *             tiebreak = TIEBREAK_FIRST_DESCENDING
 *     else:
 *         _as = values.argsort(1)             # <<<<<<<<<<<<<<
 * 
 *     if not ascending:
 */
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_values), __pyx_n_s_argsort); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 424; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__12, NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 424; __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_L6:;

  /* "pandas/algos.pyx":426
 *         _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[0]; __pyx_lineno = 426; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_4 = ((!__pyx_t_15) != 0);
  if (__pyx_t_4) {

    /* "pandas/algos.pyx":427
 * 
 *     if not ascending:
 *         _as = _as[:, ::-1]             # <<<<<<<<<<<<<<
 * 
 *     values = _take_2d_int64(values, _as)
 */
    __pyx_t_10 = PyObject_GetItem(__pyx_v__as, __pyx_tuple__15); if (unlikely(__pyx_t_10 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 427; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
    __Pyx_GOTREF(__pyx_t_10);
    __Pyx_DECREF_SET(__pyx_v__as, __pyx_t_10);
    __pyx_t_10 = 0;
    goto __pyx_L8;
  }
  __pyx_L8:;

  /* "pandas/algos.pyx":429
 *         _as = _as[:, ::-1]
 * 
 *     values = _take_2d_int64(values, _as)             # <<<<<<<<<<<<<<
 *     argsorted = _as.astype('i8')
 * 
 */
  __pyx_t_10 = __pyx_f_6pandas_5algos__take_2d_int64(((PyArrayObject *)__pyx_v_values), __pyx_v__as); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 429; __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[0]; __pyx_lineno = 429; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_6 = ((PyArrayObject *)__pyx_t_10);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer);
    __pyx_t_3 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (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_pybuffernd_values.rcbuffer->pybuffer, (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_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_values.diminfo[1].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_values.diminfo[1].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[1];
    if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 429; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_6 = 0;
  __Pyx_DECREF_SET(__pyx_v_values, ((PyArrayObject *)__pyx_t_10));
  __pyx_t_10 = 0;

  /* "pandas/algos.pyx":430
 * 
 *     values = _take_2d_int64(values, _as)
 *     argsorted = _as.astype('i8')             # <<<<<<<<<<<<<<
 * 
 *     for i in range(n):
 */
  __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_v__as, __pyx_n_s_astype); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 430; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_10);
  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_tuple__16, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 430; __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[0]; __pyx_lineno = 430; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_16 = ((PyArrayObject *)__pyx_t_2);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_argsorted.rcbuffer->pybuffer);
    __pyx_t_3 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_argsorted.rcbuffer->pybuffer, (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_pybuffernd_argsorted.rcbuffer->pybuffer, (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_pybuffernd_argsorted.diminfo[0].strides = __pyx_pybuffernd_argsorted.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_argsorted.diminfo[0].shape = __pyx_pybuffernd_argsorted.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_argsorted.diminfo[1].strides = __pyx_pybuffernd_argsorted.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_argsorted.diminfo[1].shape = __pyx_pybuffernd_argsorted.rcbuffer->pybuffer.shape[1];
    if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 430; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_16 = 0;
  __pyx_v_argsorted = ((PyArrayObject *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "pandas/algos.pyx":432
 *     argsorted = _as.astype('i8')
 * 
 *     for i in range(n):             # <<<<<<<<<<<<<<
 *         dups = sum_ranks = 0
 *         total_tie_count = 0
 */
  __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;

    /* "pandas/algos.pyx":433
 * 
 *     for i in range(n):
 *         dups = sum_ranks = 0             # <<<<<<<<<<<<<<
 *         total_tie_count = 0
 *         count = 0.0
 */
    __pyx_v_dups = 0;
    __pyx_v_sum_ranks = 0;

    /* "pandas/algos.pyx":434
 *     for i in range(n):
 *         dups = sum_ranks = 0
 *         total_tie_count = 0             # <<<<<<<<<<<<<<
 *         count = 0.0
 *         for j in range(k):
 */
    __pyx_v_total_tie_count = 0;

    /* "pandas/algos.pyx":435
 *         dups = sum_ranks = 0
 *         total_tie_count = 0
 *         count = 0.0             # <<<<<<<<<<<<<<
 *         for j in range(k):
 *             sum_ranks += j + 1
 */
    __pyx_v_count = 0.0;

    /* "pandas/algos.pyx":436
 *         total_tie_count = 0
 *         count = 0.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;

      /* "pandas/algos.pyx":437
 *         count = 0.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));

      /* "pandas/algos.pyx":438
 *         for j in range(k):
 *             sum_ranks += j + 1
 *             dups += 1             # <<<<<<<<<<<<<<
 *             val = values[i, j]
 *             count += 1.0
 */
      __pyx_v_dups = (__pyx_v_dups + 1);

      /* "pandas/algos.pyx":439
 *             sum_ranks += j + 1
 *             dups += 1
 *             val = values[i, j]             # <<<<<<<<<<<<<<
 *             count += 1.0
 *             if j == k - 1 or fabs(values[i, j + 1] - val) > FP_ERR:
 */
      __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_pybuffernd_values.diminfo[0].shape;
        if (unlikely(__pyx_t_19 < 0)) __pyx_t_3 = 0;
      } else if (unlikely(__pyx_t_19 >= __pyx_pybuffernd_values.diminfo[0].shape)) __pyx_t_3 = 0;
      if (__pyx_t_20 < 0) {
        __pyx_t_20 += __pyx_pybuffernd_values.diminfo[1].shape;
        if (unlikely(__pyx_t_20 < 0)) __pyx_t_3 = 1;
      } else if (unlikely(__pyx_t_20 >= __pyx_pybuffernd_values.diminfo[1].shape)) __pyx_t_3 = 1;
      if (unlikely(__pyx_t_3 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_3);
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 439; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_v_val = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_19, __pyx_pybuffernd_values.diminfo[0].strides, __pyx_t_20, __pyx_pybuffernd_values.diminfo[1].strides));

      /* "pandas/algos.pyx":440
 *             dups += 1
 *             val = values[i, j]
 *             count += 1.0             # <<<<<<<<<<<<<<
 *             if j == k - 1 or fabs(values[i, j + 1] - val) > FP_ERR:
 *                 if tiebreak == TIEBREAK_AVERAGE:
 */
      __pyx_v_count = (__pyx_v_count + 1.0);

      /* "pandas/algos.pyx":441
 *             val = values[i, j]
 *             count += 1.0
 *             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)) != 0);
      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_pybuffernd_values.diminfo[0].shape;
          if (unlikely(__pyx_t_21 < 0)) __pyx_t_3 = 0;
        } else if (unlikely(__pyx_t_21 >= __pyx_pybuffernd_values.diminfo[0].shape)) __pyx_t_3 = 0;
        if (__pyx_t_22 < 0) {
          __pyx_t_22 += __pyx_pybuffernd_values.diminfo[1].shape;
          if (unlikely(__pyx_t_22 < 0)) __pyx_t_3 = 1;
        } else if (unlikely(__pyx_t_22 >= __pyx_pybuffernd_values.diminfo[1].shape)) __pyx_t_3 = 1;
        if (unlikely(__pyx_t_3 != -1)) {
          __Pyx_RaiseBufferIndexError(__pyx_t_3);
          {__pyx_filename = __pyx_f[0]; __pyx_lineno = 441; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        __pyx_t_15 = ((fabs(((*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_values.diminfo[0].strides, __pyx_t_22, __pyx_pybuffernd_values.diminfo[1].strides)) - __pyx_v_val)) > __pyx_v_6pandas_5algos_FP_ERR) != 0);
        __pyx_t_23 = __pyx_t_15;
      } else {
        __pyx_t_23 = __pyx_t_4;
      }
      if (__pyx_t_23) {

        /* "pandas/algos.pyx":442
 *             count += 1.0
 *             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_5algos_TIEBREAK_AVERAGE) != 0);
        if (__pyx_t_23) {

          /* "pandas/algos.pyx":443
 *             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;

            /* "pandas/algos.pyx":444
 *                 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)) {
              #ifdef WITH_THREAD
              PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
              #endif
              PyErr_SetString(PyExc_ZeroDivisionError, "float division");
              #ifdef WITH_THREAD
              PyGILState_Release(__pyx_gilstate_save);
              #endif
              {__pyx_filename = __pyx_f[0]; __pyx_lineno = 444; __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_pybuffernd_argsorted.diminfo[0].shape;
              if (unlikely(__pyx_t_26 < 0)) __pyx_t_3 = 0;
            } else if (unlikely(__pyx_t_26 >= __pyx_pybuffernd_argsorted.diminfo[0].shape)) __pyx_t_3 = 0;
            if (__pyx_t_27 < 0) {
              __pyx_t_27 += __pyx_pybuffernd_argsorted.diminfo[1].shape;
              if (unlikely(__pyx_t_27 < 0)) __pyx_t_3 = 1;
            } else if (unlikely(__pyx_t_27 >= __pyx_pybuffernd_argsorted.diminfo[1].shape)) __pyx_t_3 = 1;
            if (unlikely(__pyx_t_3 != -1)) {
              __Pyx_RaiseBufferIndexError(__pyx_t_3);
              {__pyx_filename = __pyx_f[0]; __pyx_lineno = 444; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            }
            __pyx_t_28 = __pyx_v_i;
            __pyx_t_29 = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_argsorted.rcbuffer->pybuffer.buf, __pyx_t_26, __pyx_pybuffernd_argsorted.diminfo[0].strides, __pyx_t_27, __pyx_pybuffernd_argsorted.diminfo[1].strides));
            __pyx_t_3 = -1;
            if (__pyx_t_28 < 0) {
              __pyx_t_28 += __pyx_pybuffernd_ranks.diminfo[0].shape;
              if (unlikely(__pyx_t_28 < 0)) __pyx_t_3 = 0;
            } else if (unlikely(__pyx_t_28 >= __pyx_pybuffernd_ranks.diminfo[0].shape)) __pyx_t_3 = 0;
            if (__pyx_t_29 < 0) {
              __pyx_t_29 += __pyx_pybuffernd_ranks.diminfo[1].shape;
              if (unlikely(__pyx_t_29 < 0)) __pyx_t_3 = 1;
            } else if (unlikely(__pyx_t_29 >= __pyx_pybuffernd_ranks.diminfo[1].shape)) __pyx_t_3 = 1;
            if (unlikely(__pyx_t_3 != -1)) {
              __Pyx_RaiseBufferIndexError(__pyx_t_3);
              {__pyx_filename = __pyx_f[0]; __pyx_lineno = 444; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            }
            *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_ranks.rcbuffer->pybuffer.buf, __pyx_t_28, __pyx_pybuffernd_ranks.diminfo[0].strides, __pyx_t_29, __pyx_pybuffernd_ranks.diminfo[1].strides) = (__pyx_v_sum_ranks / __pyx_v_dups);
          }
          goto __pyx_L14;
        }

        /* "pandas/algos.pyx":445
 *                     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_5algos_TIEBREAK_MIN) != 0);
        if (__pyx_t_23) {

          /* "pandas/algos.pyx":446
 *                         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;

            /* "pandas/algos.pyx":447
 *                 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_pybuffernd_argsorted.diminfo[0].shape;
              if (unlikely(__pyx_t_30 < 0)) __pyx_t_3 = 0;
            } else if (unlikely(__pyx_t_30 >= __pyx_pybuffernd_argsorted.diminfo[0].shape)) __pyx_t_3 = 0;
            if (__pyx_t_31 < 0) {
              __pyx_t_31 += __pyx_pybuffernd_argsorted.diminfo[1].shape;
              if (unlikely(__pyx_t_31 < 0)) __pyx_t_3 = 1;
            } else if (unlikely(__pyx_t_31 >= __pyx_pybuffernd_argsorted.diminfo[1].shape)) __pyx_t_3 = 1;
            if (unlikely(__pyx_t_3 != -1)) {
              __Pyx_RaiseBufferIndexError(__pyx_t_3);
              {__pyx_filename = __pyx_f[0]; __pyx_lineno = 447; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            }
            __pyx_t_32 = __pyx_v_i;
            __pyx_t_33 = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_argsorted.rcbuffer->pybuffer.buf, __pyx_t_30, __pyx_pybuffernd_argsorted.diminfo[0].strides, __pyx_t_31, __pyx_pybuffernd_argsorted.diminfo[1].strides));
            __pyx_t_3 = -1;
            if (__pyx_t_32 < 0) {
              __pyx_t_32 += __pyx_pybuffernd_ranks.diminfo[0].shape;
              if (unlikely(__pyx_t_32 < 0)) __pyx_t_3 = 0;
            } else if (unlikely(__pyx_t_32 >= __pyx_pybuffernd_ranks.diminfo[0].shape)) __pyx_t_3 = 0;
            if (__pyx_t_33 < 0) {
              __pyx_t_33 += __pyx_pybuffernd_ranks.diminfo[1].shape;
              if (unlikely(__pyx_t_33 < 0)) __pyx_t_3 = 1;
            } else if (unlikely(__pyx_t_33 >= __pyx_pybuffernd_ranks.diminfo[1].shape)) __pyx_t_3 = 1;
            if (unlikely(__pyx_t_3 != -1)) {
              __Pyx_RaiseBufferIndexError(__pyx_t_3);
              {__pyx_filename = __pyx_f[0]; __pyx_lineno = 447; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            }
            *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_ranks.rcbuffer->pybuffer.buf, __pyx_t_32, __pyx_pybuffernd_ranks.diminfo[0].strides, __pyx_t_33, __pyx_pybuffernd_ranks.diminfo[1].strides) = ((__pyx_v_j - __pyx_v_dups) + 2);
          }
          goto __pyx_L14;
        }

        /* "pandas/algos.pyx":448
 *                     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_5algos_TIEBREAK_MAX) != 0);
        if (__pyx_t_23) {

          /* "pandas/algos.pyx":449
 *                         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;

            /* "pandas/algos.pyx":450
 *                 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_pybuffernd_argsorted.diminfo[0].shape;
              if (unlikely(__pyx_t_34 < 0)) __pyx_t_3 = 0;
            } else if (unlikely(__pyx_t_34 >= __pyx_pybuffernd_argsorted.diminfo[0].shape)) __pyx_t_3 = 0;
            if (__pyx_t_35 < 0) {
              __pyx_t_35 += __pyx_pybuffernd_argsorted.diminfo[1].shape;
              if (unlikely(__pyx_t_35 < 0)) __pyx_t_3 = 1;
            } else if (unlikely(__pyx_t_35 >= __pyx_pybuffernd_argsorted.diminfo[1].shape)) __pyx_t_3 = 1;
            if (unlikely(__pyx_t_3 != -1)) {
              __Pyx_RaiseBufferIndexError(__pyx_t_3);
              {__pyx_filename = __pyx_f[0]; __pyx_lineno = 450; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            }
            __pyx_t_36 = __pyx_v_i;
            __pyx_t_37 = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_argsorted.rcbuffer->pybuffer.buf, __pyx_t_34, __pyx_pybuffernd_argsorted.diminfo[0].strides, __pyx_t_35, __pyx_pybuffernd_argsorted.diminfo[1].strides));
            __pyx_t_3 = -1;
            if (__pyx_t_36 < 0) {
              __pyx_t_36 += __pyx_pybuffernd_ranks.diminfo[0].shape;
              if (unlikely(__pyx_t_36 < 0)) __pyx_t_3 = 0;
            } else if (unlikely(__pyx_t_36 >= __pyx_pybuffernd_ranks.diminfo[0].shape)) __pyx_t_3 = 0;
            if (__pyx_t_37 < 0) {
              __pyx_t_37 += __pyx_pybuffernd_ranks.diminfo[1].shape;
              if (unlikely(__pyx_t_37 < 0)) __pyx_t_3 = 1;
            } else if (unlikely(__pyx_t_37 >= __pyx_pybuffernd_ranks.diminfo[1].shape)) __pyx_t_3 = 1;
            if (unlikely(__pyx_t_3 != -1)) {
              __Pyx_RaiseBufferIndexError(__pyx_t_3);
              {__pyx_filename = __pyx_f[0]; __pyx_lineno = 450; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            }
            *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_ranks.rcbuffer->pybuffer.buf, __pyx_t_36, __pyx_pybuffernd_ranks.diminfo[0].strides, __pyx_t_37, __pyx_pybuffernd_ranks.diminfo[1].strides) = (__pyx_v_j + 1);
          }
          goto __pyx_L14;
        }

        /* "pandas/algos.pyx":451
 *                     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_5algos_TIEBREAK_FIRST) != 0);
        if (__pyx_t_23) {

          /* "pandas/algos.pyx":452
 *                         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;

            /* "pandas/algos.pyx":453
 *                 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_pybuffernd_argsorted.diminfo[0].shape;
              if (unlikely(__pyx_t_38 < 0)) __pyx_t_3 = 0;
            } else if (unlikely(__pyx_t_38 >= __pyx_pybuffernd_argsorted.diminfo[0].shape)) __pyx_t_3 = 0;
            if (__pyx_t_39 < 0) {
              __pyx_t_39 += __pyx_pybuffernd_argsorted.diminfo[1].shape;
              if (unlikely(__pyx_t_39 < 0)) __pyx_t_3 = 1;
            } else if (unlikely(__pyx_t_39 >= __pyx_pybuffernd_argsorted.diminfo[1].shape)) __pyx_t_3 = 1;
            if (unlikely(__pyx_t_3 != -1)) {
              __Pyx_RaiseBufferIndexError(__pyx_t_3);
              {__pyx_filename = __pyx_f[0]; __pyx_lineno = 453; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            }
            __pyx_t_40 = __pyx_v_i;
            __pyx_t_41 = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_argsorted.rcbuffer->pybuffer.buf, __pyx_t_38, __pyx_pybuffernd_argsorted.diminfo[0].strides, __pyx_t_39, __pyx_pybuffernd_argsorted.diminfo[1].strides));
            __pyx_t_3 = -1;
            if (__pyx_t_40 < 0) {
              __pyx_t_40 += __pyx_pybuffernd_ranks.diminfo[0].shape;
              if (unlikely(__pyx_t_40 < 0)) __pyx_t_3 = 0;
            } else if (unlikely(__pyx_t_40 >= __pyx_pybuffernd_ranks.diminfo[0].shape)) __pyx_t_3 = 0;
            if (__pyx_t_41 < 0) {
              __pyx_t_41 += __pyx_pybuffernd_ranks.diminfo[1].shape;
              if (unlikely(__pyx_t_41 < 0)) __pyx_t_3 = 1;
            } else if (unlikely(__pyx_t_41 >= __pyx_pybuffernd_ranks.diminfo[1].shape)) __pyx_t_3 = 1;
            if (unlikely(__pyx_t_3 != -1)) {
              __Pyx_RaiseBufferIndexError(__pyx_t_3);
              {__pyx_filename = __pyx_f[0]; __pyx_lineno = 453; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            }
            *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_ranks.rcbuffer->pybuffer.buf, __pyx_t_40, __pyx_pybuffernd_ranks.diminfo[0].strides, __pyx_t_41, __pyx_pybuffernd_ranks.diminfo[1].strides) = (__pyx_v_z + 1);
          }
          goto __pyx_L14;
        }

        /* "pandas/algos.pyx":454
 *                     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_5algos_TIEBREAK_FIRST_DESCENDING) != 0);
        if (__pyx_t_23) {

          /* "pandas/algos.pyx":455
 *                         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
 *                 elif tiebreak == TIEBREAK_DENSE:
 */
          __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;

            /* "pandas/algos.pyx":456
 *                 elif tiebreak == TIEBREAK_FIRST_DESCENDING:
 *                     for z in range(j - dups + 1, j + 1):
 *                         ranks[i, argsorted[i, z]] = 2 * j - z - dups + 2             # <<<<<<<<<<<<<<
 *                 elif tiebreak == TIEBREAK_DENSE:
 *                     total_tie_count += 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_pybuffernd_argsorted.diminfo[0].shape;
              if (unlikely(__pyx_t_42 < 0)) __pyx_t_3 = 0;
            } else if (unlikely(__pyx_t_42 >= __pyx_pybuffernd_argsorted.diminfo[0].shape)) __pyx_t_3 = 0;
            if (__pyx_t_43 < 0) {
              __pyx_t_43 += __pyx_pybuffernd_argsorted.diminfo[1].shape;
              if (unlikely(__pyx_t_43 < 0)) __pyx_t_3 = 1;
            } else if (unlikely(__pyx_t_43 >= __pyx_pybuffernd_argsorted.diminfo[1].shape)) __pyx_t_3 = 1;
            if (unlikely(__pyx_t_3 != -1)) {
              __Pyx_RaiseBufferIndexError(__pyx_t_3);
              {__pyx_filename = __pyx_f[0]; __pyx_lineno = 456; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            }
            __pyx_t_44 = __pyx_v_i;
            __pyx_t_45 = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_argsorted.rcbuffer->pybuffer.buf, __pyx_t_42, __pyx_pybuffernd_argsorted.diminfo[0].strides, __pyx_t_43, __pyx_pybuffernd_argsorted.diminfo[1].strides));
            __pyx_t_3 = -1;
            if (__pyx_t_44 < 0) {
              __pyx_t_44 += __pyx_pybuffernd_ranks.diminfo[0].shape;
              if (unlikely(__pyx_t_44 < 0)) __pyx_t_3 = 0;
            } else if (unlikely(__pyx_t_44 >= __pyx_pybuffernd_ranks.diminfo[0].shape)) __pyx_t_3 = 0;
            if (__pyx_t_45 < 0) {
              __pyx_t_45 += __pyx_pybuffernd_ranks.diminfo[1].shape;
              if (unlikely(__pyx_t_45 < 0)) __pyx_t_3 = 1;
            } else if (unlikely(__pyx_t_45 >= __pyx_pybuffernd_ranks.diminfo[1].shape)) __pyx_t_3 = 1;
            if (unlikely(__pyx_t_3 != -1)) {
              __Pyx_RaiseBufferIndexError(__pyx_t_3);
              {__pyx_filename = __pyx_f[0]; __pyx_lineno = 456; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            }
            *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_ranks.rcbuffer->pybuffer.buf, __pyx_t_44, __pyx_pybuffernd_ranks.diminfo[0].strides, __pyx_t_45, __pyx_pybuffernd_ranks.diminfo[1].strides) = ((((2 * __pyx_v_j) - __pyx_v_z) - __pyx_v_dups) + 2);
          }
          goto __pyx_L14;
        }

        /* "pandas/algos.pyx":457
 *                     for z in range(j - dups + 1, j + 1):
 *                         ranks[i, argsorted[i, z]] = 2 * j - z - dups + 2
 *                 elif tiebreak == TIEBREAK_DENSE:             # <<<<<<<<<<<<<<
 *                     total_tie_count += 1
 *                     for z in range(j - dups + 1, j + 1):
 */
        __pyx_t_23 = ((__pyx_v_tiebreak == __pyx_v_6pandas_5algos_TIEBREAK_DENSE) != 0);
        if (__pyx_t_23) {

          /* "pandas/algos.pyx":458
 *                         ranks[i, argsorted[i, z]] = 2 * j - z - dups + 2
 *                 elif tiebreak == TIEBREAK_DENSE:
 *                     total_tie_count += 1             # <<<<<<<<<<<<<<
 *                     for z in range(j - dups + 1, j + 1):
 *                         ranks[i, argsorted[i, z]] = total_tie_count
 */
          __pyx_v_total_tie_count = (__pyx_v_total_tie_count + 1);

          /* "pandas/algos.pyx":459
 *                 elif tiebreak == TIEBREAK_DENSE:
 *                     total_tie_count += 1
 *                     for z in range(j - dups + 1, j + 1):             # <<<<<<<<<<<<<<
 *                         ranks[i, argsorted[i, z]] = total_tie_count
 *                 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;

            /* "pandas/algos.pyx":460
 *                     total_tie_count += 1
 *                     for z in range(j - dups + 1, j + 1):
 *                         ranks[i, argsorted[i, z]] = total_tie_count             # <<<<<<<<<<<<<<
 *                 sum_ranks = dups = 0
 *         if pct:
 */
            __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_pybuffernd_argsorted.diminfo[0].shape;
              if (unlikely(__pyx_t_46 < 0)) __pyx_t_3 = 0;
            } else if (unlikely(__pyx_t_46 >= __pyx_pybuffernd_argsorted.diminfo[0].shape)) __pyx_t_3 = 0;
            if (__pyx_t_47 < 0) {
              __pyx_t_47 += __pyx_pybuffernd_argsorted.diminfo[1].shape;
              if (unlikely(__pyx_t_47 < 0)) __pyx_t_3 = 1;
            } else if (unlikely(__pyx_t_47 >= __pyx_pybuffernd_argsorted.diminfo[1].shape)) __pyx_t_3 = 1;
            if (unlikely(__pyx_t_3 != -1)) {
              __Pyx_RaiseBufferIndexError(__pyx_t_3);
              {__pyx_filename = __pyx_f[0]; __pyx_lineno = 460; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            }
            __pyx_t_48 = __pyx_v_i;
            __pyx_t_49 = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_argsorted.rcbuffer->pybuffer.buf, __pyx_t_46, __pyx_pybuffernd_argsorted.diminfo[0].strides, __pyx_t_47, __pyx_pybuffernd_argsorted.diminfo[1].strides));
            __pyx_t_3 = -1;
            if (__pyx_t_48 < 0) {
              __pyx_t_48 += __pyx_pybuffernd_ranks.diminfo[0].shape;
              if (unlikely(__pyx_t_48 < 0)) __pyx_t_3 = 0;
            } else if (unlikely(__pyx_t_48 >= __pyx_pybuffernd_ranks.diminfo[0].shape)) __pyx_t_3 = 0;
            if (__pyx_t_49 < 0) {
              __pyx_t_49 += __pyx_pybuffernd_ranks.diminfo[1].shape;
              if (unlikely(__pyx_t_49 < 0)) __pyx_t_3 = 1;
            } else if (unlikely(__pyx_t_49 >= __pyx_pybuffernd_ranks.diminfo[1].shape)) __pyx_t_3 = 1;
            if (unlikely(__pyx_t_3 != -1)) {
              __Pyx_RaiseBufferIndexError(__pyx_t_3);
              {__pyx_filename = __pyx_f[0]; __pyx_lineno = 460; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            }
            *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_ranks.rcbuffer->pybuffer.buf, __pyx_t_48, __pyx_pybuffernd_ranks.diminfo[0].strides, __pyx_t_49, __pyx_pybuffernd_ranks.diminfo[1].strides) = __pyx_v_total_tie_count;
          }
          goto __pyx_L14;
        }
        __pyx_L14:;

        /* "pandas/algos.pyx":461
 *                     for z in range(j - dups + 1, j + 1):
 *                         ranks[i, argsorted[i, z]] = total_tie_count
 *                 sum_ranks = dups = 0             # <<<<<<<<<<<<<<
 *         if pct:
 *             ranks[i, :] /= count
 */
        __pyx_v_sum_ranks = 0;
        __pyx_v_dups = 0;
        goto __pyx_L13;
      }
      __pyx_L13:;
    }

    /* "pandas/algos.pyx":462
 *                         ranks[i, argsorted[i, z]] = total_tie_count
 *                 sum_ranks = dups = 0
 *         if pct:             # <<<<<<<<<<<<<<
 *             ranks[i, :] /= count
 *     if axis == 0:
 */
    __pyx_t_23 = __Pyx_PyObject_IsTrue(__pyx_v_pct); if (unlikely(__pyx_t_23 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 462; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    if (__pyx_t_23) {

      /* "pandas/algos.pyx":463
 *                 sum_ranks = dups = 0
 *         if pct:
 *             ranks[i, :] /= count             # <<<<<<<<<<<<<<
 *     if axis == 0:
 *         return ranks.T
 */
      __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_i); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 463; __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[0]; __pyx_lineno = 463; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_10);
      PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_2);
      __Pyx_GIVEREF(__pyx_t_2);
      __Pyx_INCREF(__pyx_slice__17);
      PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_slice__17);
      __Pyx_GIVEREF(__pyx_slice__17);
      __pyx_t_2 = 0;
      __pyx_t_2 = PyObject_GetItem(((PyObject *)__pyx_v_ranks), __pyx_t_10); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 463; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_1 = PyFloat_FromDouble(__pyx_v_count); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 463; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_5 = __Pyx_PyNumber_InPlaceDivide(__pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 463; __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;
      if (unlikely(PyObject_SetItem(((PyObject *)__pyx_v_ranks), __pyx_t_10, __pyx_t_5) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 463; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      goto __pyx_L27;
    }
    __pyx_L27:;
  }

  /* "pandas/algos.pyx":464
 *         if pct:
 *             ranks[i, :] /= count
 *     if axis == 0:             # <<<<<<<<<<<<<<
 *         return ranks.T
 *     else:
 */
  __pyx_t_10 = PyObject_RichCompare(__pyx_v_axis, __pyx_int_0, Py_EQ); __Pyx_XGOTREF(__pyx_t_10); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 464; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_23 = __Pyx_PyObject_IsTrue(__pyx_t_10); if (unlikely(__pyx_t_23 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 464; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  if (__pyx_t_23) {

    /* "pandas/algos.pyx":465
 *             ranks[i, :] /= count
 *     if axis == 0:
 *         return ranks.T             # <<<<<<<<<<<<<<
 *     else:
 *         return ranks
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_10 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_ranks), __pyx_n_s_T); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 465; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_10);
    __pyx_r = __pyx_t_10;
    __pyx_t_10 = 0;
    goto __pyx_L0;
  }
  /*else*/ {

    /* "pandas/algos.pyx":467
 *         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;
  }

  /* "pandas/algos.pyx":393
 * 
 * 
 * def rank_2d_int64(object in_arr, axis=0, ties_method='average',             # <<<<<<<<<<<<<<
 *                     ascending=True, na_option='keep', pct=False):
 *     """
 */

  /* function exit code */
  __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_pybuffernd_argsorted.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_ranks.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas.algos.rank_2d_int64", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_argsorted.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_ranks.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer);
  __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;
}

/* "pandas/algos.pyx":470
 * 
 * 
 * def rank_1d_generic(object in_arr, bint retry=1, ties_method='average',             # <<<<<<<<<<<<<<
 *                     ascending=True, na_option='keep', pct=False):
 *     """
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pandas_5algos_9rank_1d_generic(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6pandas_5algos_8rank_1d_generic[] = "\n    Fast NaN-friendly version of scipy.stats.rankdata\n    ";
static PyMethodDef __pyx_mdef_6pandas_5algos_9rank_1d_generic = {__Pyx_NAMESTR("rank_1d_generic"), (PyCFunction)__pyx_pw_6pandas_5algos_9rank_1d_generic, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6pandas_5algos_8rank_1d_generic)};
static PyObject *__pyx_pw_6pandas_5algos_9rank_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;
  PyObject *__pyx_v_na_option = 0;
  PyObject *__pyx_v_pct = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("rank_1d_generic (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_in_arr,&__pyx_n_s_retry,&__pyx_n_s_ties_method,&__pyx_n_s_ascending,&__pyx_n_s_na_option,&__pyx_n_s_pct,0};
    PyObject* values[6] = {0,0,0,0,0,0};
    values[2] = ((PyObject *)__pyx_n_s_average);

    /* "pandas/algos.pyx":471
 * 
 * def rank_1d_generic(object in_arr, bint retry=1, ties_method='average',
 *                     ascending=True, na_option='keep', pct=False):             # <<<<<<<<<<<<<<
 *     """
 *     Fast NaN-friendly version of scipy.stats.rankdata
 */
    values[3] = ((PyObject *)Py_True);
    values[4] = ((PyObject *)__pyx_n_s_keep);
    values[5] = ((PyObject *)Py_False);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_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 (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_in_arr)) != 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--; }
        }
        case  4:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_na_option);
          if (value) { values[4] = value; kw_args--; }
        }
        case  5:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_pct);
          if (value) { values[5] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "rank_1d_generic") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 470; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else {
      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);
        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[0]; __pyx_lineno = 470; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    } else {
      __pyx_v_retry = ((int)1);
    }
    __pyx_v_ties_method = values[2];
    __pyx_v_ascending = values[3];
    __pyx_v_na_option = values[4];
    __pyx_v_pct = values[5];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("rank_1d_generic", 0, 1, 6, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 470; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas.algos.rank_1d_generic", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6pandas_5algos_8rank_1d_generic(__pyx_self, __pyx_v_in_arr, __pyx_v_retry, __pyx_v_ties_method, __pyx_v_ascending, __pyx_v_na_option, __pyx_v_pct);

  /* "pandas/algos.pyx":470
 * 
 * 
 * def rank_1d_generic(object in_arr, bint retry=1, ties_method='average',             # <<<<<<<<<<<<<<
 *                     ascending=True, na_option='keep', pct=False):
 *     """
 */

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pandas_5algos_8rank_1d_generic(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_in_arr, int __pyx_v_retry, PyObject *__pyx_v_ties_method, PyObject *__pyx_v_ascending, PyObject *__pyx_v_na_option, PyObject *__pyx_v_pct) {
  Py_ssize_t __pyx_v_i;
  Py_ssize_t __pyx_v_j;
  Py_ssize_t __pyx_v_n;
  Py_ssize_t __pyx_v_dups;
  Py_ssize_t __pyx_v_total_tie_count;
  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;
  int __pyx_v_keep_na;
  float __pyx_v_count;
  PyObject *__pyx_v_mask = NULL;
  PyObject *__pyx_v__as = NULL;
  PyObject *__pyx_v_valid_locs = NULL;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_argsorted;
  __Pyx_Buffer __pyx_pybuffer_argsorted;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_ranks;
  __Pyx_Buffer __pyx_pybuffer_ranks;
  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;
  PyObject *__pyx_t_6 = NULL;
  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;
  Py_ssize_t __pyx_t_30;
  __pyx_t_5numpy_int64_t __pyx_t_31;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("rank_1d_generic", 0);
  __pyx_pybuffer_ranks.pybuffer.buf = NULL;
  __pyx_pybuffer_ranks.refcount = 0;
  __pyx_pybuffernd_ranks.data = NULL;
  __pyx_pybuffernd_ranks.rcbuffer = &__pyx_pybuffer_ranks;
  __pyx_pybuffer_argsorted.pybuffer.buf = NULL;
  __pyx_pybuffer_argsorted.refcount = 0;
  __pyx_pybuffernd_argsorted.data = NULL;
  __pyx_pybuffernd_argsorted.rcbuffer = &__pyx_pybuffer_argsorted;

  /* "pandas/algos.pyx":477
 * 
 *     cdef:
 *         Py_ssize_t i, j, n, dups = 0, total_tie_count = 0             # <<<<<<<<<<<<<<
 *         ndarray[float64_t] ranks
 *         ndarray sorted_data, values
 */
  __pyx_v_dups = 0;
  __pyx_v_total_tie_count = 0;

  /* "pandas/algos.pyx":482
 *         ndarray[int64_t] argsorted
 *         object val, nan_value
 *         float64_t sum_ranks = 0             # <<<<<<<<<<<<<<
 *         int tiebreak = 0
 *         bint keep_na = 0
 */
  __pyx_v_sum_ranks = 0.0;

  /* "pandas/algos.pyx":483
 *         object val, nan_value
 *         float64_t sum_ranks = 0
 *         int tiebreak = 0             # <<<<<<<<<<<<<<
 *         bint keep_na = 0
 *         float count = 0.0
 */
  __pyx_v_tiebreak = 0;

  /* "pandas/algos.pyx":484
 *         float64_t sum_ranks = 0
 *         int tiebreak = 0
 *         bint keep_na = 0             # <<<<<<<<<<<<<<
 *         float count = 0.0
 * 
 */
  __pyx_v_keep_na = 0;

  /* "pandas/algos.pyx":485
 *         int tiebreak = 0
 *         bint keep_na = 0
 *         float count = 0.0             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_v_count = 0.0;

  /* "pandas/algos.pyx":488
 * 
 * 
 *     tiebreak = tiebreakers[ties_method]             # <<<<<<<<<<<<<<
 * 
 *     keep_na = na_option == 'keep'
 */
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_tiebreakers); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 488; __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 (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 488; __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_As_int(__pyx_t_2); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 488; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_tiebreak = __pyx_t_3;

  /* "pandas/algos.pyx":490
 *     tiebreak = tiebreakers[ties_method]
 * 
 *     keep_na = na_option == 'keep'             # <<<<<<<<<<<<<<
 * 
 *     values = np.array(in_arr, copy=True)
 */
  __pyx_t_2 = PyObject_RichCompare(__pyx_v_na_option, __pyx_n_s_keep, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 490; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 490; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_keep_na = __pyx_t_4;

  /* "pandas/algos.pyx":492
 *     keep_na = na_option == 'keep'
 * 
 *     values = np.array(in_arr, copy=True)             # <<<<<<<<<<<<<<
 * 
 *     if values.dtype != np.object_:
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 492; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_array); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 492; __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[0]; __pyx_lineno = 492; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__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 = PyDict_New(); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 492; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_copy, Py_True) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 492; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, __pyx_t_5); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 492; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__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;
  if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 492; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_values = ((PyArrayObject *)__pyx_t_6);
  __pyx_t_6 = 0;

  /* "pandas/algos.pyx":494
 *     values = np.array(in_arr, copy=True)
 * 
 *     if values.dtype != np.object_:             # <<<<<<<<<<<<<<
 *         values = values.astype('O')
 * 
 */
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_values), __pyx_n_s_dtype); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 494; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 494; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_object_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 494; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = PyObject_RichCompare(__pyx_t_6, __pyx_t_2, Py_NE); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 494; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 494; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__pyx_t_4) {

    /* "pandas/algos.pyx":495
 * 
 *     if values.dtype != np.object_:
 *         values = values.astype('O')             # <<<<<<<<<<<<<<
 * 
 *     if ascending ^ (na_option == 'top'):
 */
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_values), __pyx_n_s_astype); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 495; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_tuple__18, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 495; __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 = 495; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF_SET(__pyx_v_values, ((PyArrayObject *)__pyx_t_2));
    __pyx_t_2 = 0;
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "pandas/algos.pyx":497
 *         values = values.astype('O')
 * 
 *     if ascending ^ (na_option == 'top'):             # <<<<<<<<<<<<<<
 *         # always greater than everything
 *         nan_value = Infinity()
 */
  __pyx_t_2 = PyObject_RichCompare(__pyx_v_na_option, __pyx_n_s_top, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 497; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_5 = PyNumber_Xor(__pyx_v_ascending, __pyx_t_2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 497; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 497; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__pyx_t_4) {

    /* "pandas/algos.pyx":499
 *     if ascending ^ (na_option == 'top'):
 *         # always greater than everything
 *         nan_value = Infinity()             # <<<<<<<<<<<<<<
 *     else:
 *         nan_value = NegInfinity()
 */
    __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_Infinity); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 499; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_empty_tuple, NULL); 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_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_v_nan_value = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L4;
  }
  /*else*/ {

    /* "pandas/algos.pyx":501
 *         nan_value = Infinity()
 *     else:
 *         nan_value = NegInfinity()             # <<<<<<<<<<<<<<
 * 
 *     mask = lib.isnullobj(values)
 */
    __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_NegInfinity); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 501; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 501; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_v_nan_value = __pyx_t_5;
    __pyx_t_5 = 0;
  }
  __pyx_L4:;

  /* "pandas/algos.pyx":503
 *         nan_value = NegInfinity()
 * 
 *     mask = lib.isnullobj(values)             # <<<<<<<<<<<<<<
 *     np.putmask(values, mask, nan_value)
 * 
 */
  __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_lib); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 503; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_isnullobj); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 503; __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[0]; __pyx_lineno = 503; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__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_t_6 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 503; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_v_mask = __pyx_t_6;
  __pyx_t_6 = 0;

  /* "pandas/algos.pyx":504
 * 
 *     mask = lib.isnullobj(values)
 *     np.putmask(values, mask, nan_value)             # <<<<<<<<<<<<<<
 * 
 *     n = len(values)
 */
  __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 504; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_putmask); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 504; __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[0]; __pyx_lineno = 504; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_INCREF(((PyObject *)__pyx_v_values));
  PyTuple_SET_ITEM(__pyx_t_6, 0, ((PyObject *)__pyx_v_values));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_values));
  __Pyx_INCREF(__pyx_v_mask);
  PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_v_mask);
  __Pyx_GIVEREF(__pyx_v_mask);
  __Pyx_INCREF(__pyx_v_nan_value);
  PyTuple_SET_ITEM(__pyx_t_6, 2, __pyx_v_nan_value);
  __Pyx_GIVEREF(__pyx_v_nan_value);
  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 504; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pandas/algos.pyx":506
 *     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[0]; __pyx_lineno = 506; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_n = __pyx_t_7;

  /* "pandas/algos.pyx":507
 * 
 *     n = len(values)
 *     ranks = np.empty(n, dtype='f8')             # <<<<<<<<<<<<<<
 * 
 *     # py2.5/win32 hack, can't pass i8
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 507; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_empty); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 507; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __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 = 507; __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 = 507; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__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[0]; __pyx_lineno = 507; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_n_s_f8) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 507; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_5, __pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 507; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __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;
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 507; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_8 = ((PyArrayObject *)__pyx_t_1);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_ranks.rcbuffer->pybuffer);
    __pyx_t_3 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_ranks.rcbuffer->pybuffer, (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_pybuffernd_ranks.rcbuffer->pybuffer, (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_pybuffernd_ranks.diminfo[0].strides = __pyx_pybuffernd_ranks.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_ranks.diminfo[0].shape = __pyx_pybuffernd_ranks.rcbuffer->pybuffer.shape[0];
    if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 507; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_8 = 0;
  __pyx_v_ranks = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pandas/algos.pyx":510
 * 
 *     # 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:*/ {

      /* "pandas/algos.pyx":511
 *     # py2.5/win32 hack, can't pass i8
 *     try:
 *         _as = values.argsort()             # <<<<<<<<<<<<<<
 *     except TypeError:
 *         if not retry:
 */
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_values), __pyx_n_s_argsort); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 511; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 511; __pyx_clineno = __LINE__; goto __pyx_L5_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_L12_try_end;
    __pyx_L5_error:;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "pandas/algos.pyx":512
 *     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.algos.rank_1d_generic", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_2, &__pyx_t_1, &__pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 512; __pyx_clineno = __LINE__; goto __pyx_L7_except_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_GOTREF(__pyx_t_5);

      /* "pandas/algos.pyx":513
 *         _as = values.argsort()
 *     except TypeError:
 *         if not retry:             # <<<<<<<<<<<<<<
 *             raise
 * 
 */
      __pyx_t_4 = ((!(__pyx_v_retry != 0)) != 0);
      if (__pyx_t_4) {

        /* "pandas/algos.pyx":514
 *     except TypeError:
 *         if not retry:
 *             raise             # <<<<<<<<<<<<<<
 * 
 *         valid_locs = (~mask).nonzero()[0]
 */
        __Pyx_GIVEREF(__pyx_t_2);
        __Pyx_GIVEREF(__pyx_t_1);
        __Pyx_XGIVEREF(__pyx_t_5);
        __Pyx_ErrRestore(__pyx_t_2, __pyx_t_1, __pyx_t_5);
        __pyx_t_2 = 0; __pyx_t_1 = 0; __pyx_t_5 = 0; 
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 514; __pyx_clineno = __LINE__; goto __pyx_L7_except_error;}
      }

      /* "pandas/algos.pyx":516
 *             raise
 * 
 *         valid_locs = (~mask).nonzero()[0]             # <<<<<<<<<<<<<<
 *         ranks.put(valid_locs, rank_1d_generic(values.take(valid_locs), 0,
 *                                               ties_method=ties_method,
 */
      __pyx_t_6 = PyNumber_Invert(__pyx_v_mask); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 516; __pyx_clineno = __LINE__; goto __pyx_L7_except_error;}
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_nonzero); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 516; __pyx_clineno = __LINE__; goto __pyx_L7_except_error;}
      __Pyx_GOTREF(__pyx_t_12);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 516; __pyx_clineno = __LINE__; goto __pyx_L7_except_error;}
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      __pyx_t_12 = __Pyx_GetItemInt(__pyx_t_6, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_12 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 516; __pyx_clineno = __LINE__; goto __pyx_L7_except_error;};
      __Pyx_GOTREF(__pyx_t_12);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_v_valid_locs = __pyx_t_12;
      __pyx_t_12 = 0;

      /* "pandas/algos.pyx":517
 * 
 *         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 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_ranks), __pyx_n_s_put); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 517; __pyx_clineno = __LINE__; goto __pyx_L7_except_error;}
      __Pyx_GOTREF(__pyx_t_12);
      __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_rank_1d_generic); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 517; __pyx_clineno = __LINE__; goto __pyx_L7_except_error;}
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_13 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_values), __pyx_n_s_take); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 517; __pyx_clineno = __LINE__; goto __pyx_L7_except_error;}
      __Pyx_GOTREF(__pyx_t_13);
      __pyx_t_14 = PyTuple_New(1); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 517; __pyx_clineno = __LINE__; goto __pyx_L7_except_error;}
      __Pyx_GOTREF(__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 = __Pyx_PyObject_Call(__pyx_t_13, __pyx_t_14, NULL); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 517; __pyx_clineno = __LINE__; goto __pyx_L7_except_error;}
      __Pyx_GOTREF(__pyx_t_15);
      __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
      __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
      __pyx_t_14 = PyTuple_New(2); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 517; __pyx_clineno = __LINE__; goto __pyx_L7_except_error;}
      __Pyx_GOTREF(__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[0]; __pyx_lineno = 517; __pyx_clineno = __LINE__; goto __pyx_L7_except_error;}
      __Pyx_GOTREF(__pyx_t_15);

      /* "pandas/algos.pyx":518
 *         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, __pyx_n_s_ties_method, __pyx_v_ties_method) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 517; __pyx_clineno = __LINE__; goto __pyx_L7_except_error;}

      /* "pandas/algos.pyx":519
 *         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, __pyx_n_s_ascending, __pyx_v_ascending) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 517; __pyx_clineno = __LINE__; goto __pyx_L7_except_error;}

      /* "pandas/algos.pyx":517
 * 
 *         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_13 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_14, __pyx_t_15); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 517; __pyx_clineno = __LINE__; goto __pyx_L7_except_error;}
      __Pyx_GOTREF(__pyx_t_13);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
      __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
      __pyx_t_15 = PyTuple_New(2); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 517; __pyx_clineno = __LINE__; goto __pyx_L7_except_error;}
      __Pyx_GOTREF(__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 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_t_15, NULL); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 517; __pyx_clineno = __LINE__; goto __pyx_L7_except_error;}
      __Pyx_GOTREF(__pyx_t_13);
      __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
      __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

      /* "pandas/algos.pyx":520
 *                                               ties_method=ties_method,
 *                                               ascending=ascending))
 *         np.putmask(ranks, mask, np.nan)             # <<<<<<<<<<<<<<
 *         return ranks
 * 
 */
      __pyx_t_13 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 520; __pyx_clineno = __LINE__; goto __pyx_L7_except_error;}
      __Pyx_GOTREF(__pyx_t_13);
      __pyx_t_15 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_n_s_putmask); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 520; __pyx_clineno = __LINE__; goto __pyx_L7_except_error;}
      __Pyx_GOTREF(__pyx_t_15);
      __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
      __pyx_t_13 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 520; __pyx_clineno = __LINE__; goto __pyx_L7_except_error;}
      __Pyx_GOTREF(__pyx_t_13);
      __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_n_s_nan); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 520; __pyx_clineno = __LINE__; goto __pyx_L7_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[0]; __pyx_lineno = 520; __pyx_clineno = __LINE__; goto __pyx_L7_except_error;}
      __Pyx_GOTREF(__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 = __Pyx_PyObject_Call(__pyx_t_15, __pyx_t_13, NULL); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 520; __pyx_clineno = __LINE__; goto __pyx_L7_except_error;}
      __Pyx_GOTREF(__pyx_t_12);
      __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
      __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
      __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;

      /* "pandas/algos.pyx":521
 *                                               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_5); __pyx_t_5 = 0;
      goto __pyx_L8_except_return;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      goto __pyx_L6_exception_handled;
    }
    goto __pyx_L7_except_error;
    __pyx_L7_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_L8_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_L6_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_L12_try_end:;
  }

  /* "pandas/algos.pyx":523
 *         return ranks
 * 
 *     if not ascending:             # <<<<<<<<<<<<<<
 *         _as = _as[::-1]
 * 
 */
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_ascending); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 523; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_16 = ((!__pyx_t_4) != 0);
  if (__pyx_t_16) {

    /* "pandas/algos.pyx":524
 * 
 *     if not ascending:
 *         _as = _as[::-1]             # <<<<<<<<<<<<<<
 * 
 *     sorted_data = values.take(_as)
 */
    __pyx_t_5 = PyObject_GetItem(__pyx_v__as, __pyx_slice__19); if (unlikely(__pyx_t_5 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 524; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF_SET(__pyx_v__as, __pyx_t_5);
    __pyx_t_5 = 0;
    goto __pyx_L16;
  }
  __pyx_L16:;

  /* "pandas/algos.pyx":526
 *         _as = _as[::-1]
 * 
 *     sorted_data = values.take(_as)             # <<<<<<<<<<<<<<
 *     argsorted = _as.astype('i8')
 *     for i in range(n):
 */
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_values), __pyx_n_s_take); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 526; __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[0]; __pyx_lineno = 526; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__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 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 526; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__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[0]; __pyx_lineno = 526; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_sorted_data = ((PyArrayObject *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "pandas/algos.pyx":527
 * 
 *     sorted_data = values.take(_as)
 *     argsorted = _as.astype('i8')             # <<<<<<<<<<<<<<
 *     for i in range(n):
 *         sum_ranks += i + 1
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v__as, __pyx_n_s_astype); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 527; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__20, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 527; __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[0]; __pyx_lineno = 527; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_17 = ((PyArrayObject *)__pyx_t_1);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_argsorted.rcbuffer->pybuffer);
    __pyx_t_3 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_argsorted.rcbuffer->pybuffer, (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_pybuffernd_argsorted.rcbuffer->pybuffer, (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_pybuffernd_argsorted.diminfo[0].strides = __pyx_pybuffernd_argsorted.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_argsorted.diminfo[0].shape = __pyx_pybuffernd_argsorted.rcbuffer->pybuffer.shape[0];
    if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 527; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_17 = 0;
  __pyx_v_argsorted = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pandas/algos.pyx":528
 *     sorted_data = values.take(_as)
 *     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;

    /* "pandas/algos.pyx":529
 *     argsorted = _as.astype('i8')
 *     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));

    /* "pandas/algos.pyx":530
 *     for i in range(n):
 *         sum_ranks += i + 1
 *         dups += 1             # <<<<<<<<<<<<<<
 *         val = util.get_value_at(sorted_data, i)
 *         if val is nan_value and keep_na:
 */
    __pyx_v_dups = (__pyx_v_dups + 1);

    /* "pandas/algos.pyx":531
 *         sum_ranks += i + 1
 *         dups += 1
 *         val = util.get_value_at(sorted_data, i)             # <<<<<<<<<<<<<<
 *         if val is nan_value and keep_na:
 *             ranks[argsorted[i]] = nan
 */
    __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_i); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 531; __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[0]; __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_XDECREF_SET(__pyx_v_val, __pyx_t_2);
    __pyx_t_2 = 0;

    /* "pandas/algos.pyx":532
 *         dups += 1
 *         val = util.get_value_at(sorted_data, i)
 *         if val is nan_value and keep_na:             # <<<<<<<<<<<<<<
 *             ranks[argsorted[i]] = nan
 *             continue
 */
    __pyx_t_16 = (__pyx_v_val == __pyx_v_nan_value);
    if ((__pyx_t_16 != 0)) {
      __pyx_t_4 = (__pyx_v_keep_na != 0);
    } else {
      __pyx_t_4 = (__pyx_t_16 != 0);
    }
    if (__pyx_t_4) {

      /* "pandas/algos.pyx":533
 *         val = util.get_value_at(sorted_data, i)
 *         if val is nan_value and keep_na:
 *             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_pybuffernd_argsorted.diminfo[0].shape;
        if (unlikely(__pyx_t_19 < 0)) __pyx_t_3 = 0;
      } else if (unlikely(__pyx_t_19 >= __pyx_pybuffernd_argsorted.diminfo[0].shape)) __pyx_t_3 = 0;
      if (unlikely(__pyx_t_3 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_3);
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 533; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_t_20 = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_argsorted.rcbuffer->pybuffer.buf, __pyx_t_19, __pyx_pybuffernd_argsorted.diminfo[0].strides));
      __pyx_t_3 = -1;
      if (__pyx_t_20 < 0) {
        __pyx_t_20 += __pyx_pybuffernd_ranks.diminfo[0].shape;
        if (unlikely(__pyx_t_20 < 0)) __pyx_t_3 = 0;
      } else if (unlikely(__pyx_t_20 >= __pyx_pybuffernd_ranks.diminfo[0].shape)) __pyx_t_3 = 0;
      if (unlikely(__pyx_t_3 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_3);
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 533; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_ranks.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_ranks.diminfo[0].strides) = __pyx_v_6pandas_5algos_nan;

      /* "pandas/algos.pyx":534
 *         if val is nan_value and keep_na:
 *             ranks[argsorted[i]] = nan
 *             continue             # <<<<<<<<<<<<<<
 *         if (i == n - 1 or
 *             are_diff(util.get_value_at(sorted_data, i + 1), val)):
 */
      goto __pyx_L17_continue;
    }

    /* "pandas/algos.pyx":535
 *             ranks[argsorted[i]] = nan
 *             continue
 *         if (i == n - 1 or             # <<<<<<<<<<<<<<
 *             are_diff(util.get_value_at(sorted_data, i + 1), val)):
 *             count += 1.0
 */
    __pyx_t_4 = (__pyx_v_i == (__pyx_v_n - 1));
    if (!__pyx_t_4) {

      /* "pandas/algos.pyx":536
 *             continue
 *         if (i == n - 1 or
 *             are_diff(util.get_value_at(sorted_data, i + 1), val)):             # <<<<<<<<<<<<<<
 *             count += 1.0
 *             if tiebreak == TIEBREAK_AVERAGE:
 */
      __pyx_t_2 = PyInt_FromSsize_t((__pyx_v_i + 1)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 536; __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[0]; __pyx_lineno = 536; __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_5algos_are_diff(__pyx_t_1, __pyx_v_val); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 536; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_16 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_16 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 536; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_21 = __pyx_t_16;
    } else {
      __pyx_t_21 = __pyx_t_4;
    }
    if (__pyx_t_21) {

      /* "pandas/algos.pyx":537
 *         if (i == n - 1 or
 *             are_diff(util.get_value_at(sorted_data, i + 1), val)):
 *             count += 1.0             # <<<<<<<<<<<<<<
 *             if tiebreak == TIEBREAK_AVERAGE:
 *                 for j in range(i - dups + 1, i + 1):
 */
      __pyx_v_count = (__pyx_v_count + 1.0);

      /* "pandas/algos.pyx":538
 *             are_diff(util.get_value_at(sorted_data, i + 1), val)):
 *             count += 1.0
 *             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_5algos_TIEBREAK_AVERAGE) != 0);
      if (__pyx_t_21) {

        /* "pandas/algos.pyx":539
 *             count += 1.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_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;

          /* "pandas/algos.pyx":540
 *             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)) {
            #ifdef WITH_THREAD
            PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
            #endif
            PyErr_SetString(PyExc_ZeroDivisionError, "float division");
            #ifdef WITH_THREAD
            PyGILState_Release(__pyx_gilstate_save);
            #endif
            {__pyx_filename = __pyx_f[0]; __pyx_lineno = 540; __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_pybuffernd_argsorted.diminfo[0].shape;
            if (unlikely(__pyx_t_24 < 0)) __pyx_t_3 = 0;
          } else if (unlikely(__pyx_t_24 >= __pyx_pybuffernd_argsorted.diminfo[0].shape)) __pyx_t_3 = 0;
          if (unlikely(__pyx_t_3 != -1)) {
            __Pyx_RaiseBufferIndexError(__pyx_t_3);
            {__pyx_filename = __pyx_f[0]; __pyx_lineno = 540; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          }
          __pyx_t_25 = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_argsorted.rcbuffer->pybuffer.buf, __pyx_t_24, __pyx_pybuffernd_argsorted.diminfo[0].strides));
          __pyx_t_3 = -1;
          if (__pyx_t_25 < 0) {
            __pyx_t_25 += __pyx_pybuffernd_ranks.diminfo[0].shape;
            if (unlikely(__pyx_t_25 < 0)) __pyx_t_3 = 0;
          } else if (unlikely(__pyx_t_25 >= __pyx_pybuffernd_ranks.diminfo[0].shape)) __pyx_t_3 = 0;
          if (unlikely(__pyx_t_3 != -1)) {
            __Pyx_RaiseBufferIndexError(__pyx_t_3);
            {__pyx_filename = __pyx_f[0]; __pyx_lineno = 540; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          }
          *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_ranks.rcbuffer->pybuffer.buf, __pyx_t_25, __pyx_pybuffernd_ranks.diminfo[0].strides) = (__pyx_v_sum_ranks / __pyx_v_dups);
        }
        goto __pyx_L21;
      }

      /* "pandas/algos.pyx":541
 *                 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_5algos_TIEBREAK_MIN) != 0);
      if (__pyx_t_21) {

        /* "pandas/algos.pyx":542
 *                     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;

          /* "pandas/algos.pyx":543
 *             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_pybuffernd_argsorted.diminfo[0].shape;
            if (unlikely(__pyx_t_26 < 0)) __pyx_t_3 = 0;
          } else if (unlikely(__pyx_t_26 >= __pyx_pybuffernd_argsorted.diminfo[0].shape)) __pyx_t_3 = 0;
          if (unlikely(__pyx_t_3 != -1)) {
            __Pyx_RaiseBufferIndexError(__pyx_t_3);
            {__pyx_filename = __pyx_f[0]; __pyx_lineno = 543; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          }
          __pyx_t_27 = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_argsorted.rcbuffer->pybuffer.buf, __pyx_t_26, __pyx_pybuffernd_argsorted.diminfo[0].strides));
          __pyx_t_3 = -1;
          if (__pyx_t_27 < 0) {
            __pyx_t_27 += __pyx_pybuffernd_ranks.diminfo[0].shape;
            if (unlikely(__pyx_t_27 < 0)) __pyx_t_3 = 0;
          } else if (unlikely(__pyx_t_27 >= __pyx_pybuffernd_ranks.diminfo[0].shape)) __pyx_t_3 = 0;
          if (unlikely(__pyx_t_3 != -1)) {
            __Pyx_RaiseBufferIndexError(__pyx_t_3);
            {__pyx_filename = __pyx_f[0]; __pyx_lineno = 543; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          }
          *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_ranks.rcbuffer->pybuffer.buf, __pyx_t_27, __pyx_pybuffernd_ranks.diminfo[0].strides) = ((__pyx_v_i - __pyx_v_dups) + 2);
        }
        goto __pyx_L21;
      }

      /* "pandas/algos.pyx":544
 *                 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_5algos_TIEBREAK_MAX) != 0);
      if (__pyx_t_21) {

        /* "pandas/algos.pyx":545
 *                     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;

          /* "pandas/algos.pyx":546
 *             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_pybuffernd_argsorted.diminfo[0].shape;
            if (unlikely(__pyx_t_28 < 0)) __pyx_t_3 = 0;
          } else if (unlikely(__pyx_t_28 >= __pyx_pybuffernd_argsorted.diminfo[0].shape)) __pyx_t_3 = 0;
          if (unlikely(__pyx_t_3 != -1)) {
            __Pyx_RaiseBufferIndexError(__pyx_t_3);
            {__pyx_filename = __pyx_f[0]; __pyx_lineno = 546; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          }
          __pyx_t_29 = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_argsorted.rcbuffer->pybuffer.buf, __pyx_t_28, __pyx_pybuffernd_argsorted.diminfo[0].strides));
          __pyx_t_3 = -1;
          if (__pyx_t_29 < 0) {
            __pyx_t_29 += __pyx_pybuffernd_ranks.diminfo[0].shape;
            if (unlikely(__pyx_t_29 < 0)) __pyx_t_3 = 0;
          } else if (unlikely(__pyx_t_29 >= __pyx_pybuffernd_ranks.diminfo[0].shape)) __pyx_t_3 = 0;
          if (unlikely(__pyx_t_3 != -1)) {
            __Pyx_RaiseBufferIndexError(__pyx_t_3);
            {__pyx_filename = __pyx_f[0]; __pyx_lineno = 546; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          }
          *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_ranks.rcbuffer->pybuffer.buf, __pyx_t_29, __pyx_pybuffernd_ranks.diminfo[0].strides) = (__pyx_v_i + 1);
        }
        goto __pyx_L21;
      }

      /* "pandas/algos.pyx":547
 *                 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')
 *             elif tiebreak == TIEBREAK_DENSE:
 */
      __pyx_t_21 = ((__pyx_v_tiebreak == __pyx_v_6pandas_5algos_TIEBREAK_FIRST) != 0);
      if (__pyx_t_21) {

        /* "pandas/algos.pyx":548
 *                     ranks[argsorted[j]] = i + 1
 *             elif tiebreak == TIEBREAK_FIRST:
 *                 raise ValueError('first not supported for non-numeric data')             # <<<<<<<<<<<<<<
 *             elif tiebreak == TIEBREAK_DENSE:
 *                 total_tie_count += 1
 */
        __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__21, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 548; __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 = 548; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }

      /* "pandas/algos.pyx":549
 *             elif tiebreak == TIEBREAK_FIRST:
 *                 raise ValueError('first not supported for non-numeric data')
 *             elif tiebreak == TIEBREAK_DENSE:             # <<<<<<<<<<<<<<
 *                 total_tie_count += 1
 *                 for j in range(i - dups + 1, i + 1):
 */
      __pyx_t_21 = ((__pyx_v_tiebreak == __pyx_v_6pandas_5algos_TIEBREAK_DENSE) != 0);
      if (__pyx_t_21) {

        /* "pandas/algos.pyx":550
 *                 raise ValueError('first not supported for non-numeric data')
 *             elif tiebreak == TIEBREAK_DENSE:
 *                 total_tie_count += 1             # <<<<<<<<<<<<<<
 *                 for j in range(i - dups + 1, i + 1):
 *                     ranks[argsorted[j]] = total_tie_count
 */
        __pyx_v_total_tie_count = (__pyx_v_total_tie_count + 1);

        /* "pandas/algos.pyx":551
 *             elif tiebreak == TIEBREAK_DENSE:
 *                 total_tie_count += 1
 *                 for j in range(i - dups + 1, i + 1):             # <<<<<<<<<<<<<<
 *                     ranks[argsorted[j]] = total_tie_count
 *             sum_ranks = dups = 0
 */
        __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;

          /* "pandas/algos.pyx":552
 *                 total_tie_count += 1
 *                 for j in range(i - dups + 1, i + 1):
 *                     ranks[argsorted[j]] = total_tie_count             # <<<<<<<<<<<<<<
 *             sum_ranks = dups = 0
 *     if pct:
 */
          __pyx_t_30 = __pyx_v_j;
          __pyx_t_3 = -1;
          if (__pyx_t_30 < 0) {
            __pyx_t_30 += __pyx_pybuffernd_argsorted.diminfo[0].shape;
            if (unlikely(__pyx_t_30 < 0)) __pyx_t_3 = 0;
          } else if (unlikely(__pyx_t_30 >= __pyx_pybuffernd_argsorted.diminfo[0].shape)) __pyx_t_3 = 0;
          if (unlikely(__pyx_t_3 != -1)) {
            __Pyx_RaiseBufferIndexError(__pyx_t_3);
            {__pyx_filename = __pyx_f[0]; __pyx_lineno = 552; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          }
          __pyx_t_31 = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_argsorted.rcbuffer->pybuffer.buf, __pyx_t_30, __pyx_pybuffernd_argsorted.diminfo[0].strides));
          __pyx_t_3 = -1;
          if (__pyx_t_31 < 0) {
            __pyx_t_31 += __pyx_pybuffernd_ranks.diminfo[0].shape;
            if (unlikely(__pyx_t_31 < 0)) __pyx_t_3 = 0;
          } else if (unlikely(__pyx_t_31 >= __pyx_pybuffernd_ranks.diminfo[0].shape)) __pyx_t_3 = 0;
          if (unlikely(__pyx_t_3 != -1)) {
            __Pyx_RaiseBufferIndexError(__pyx_t_3);
            {__pyx_filename = __pyx_f[0]; __pyx_lineno = 552; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          }
          *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_ranks.rcbuffer->pybuffer.buf, __pyx_t_31, __pyx_pybuffernd_ranks.diminfo[0].strides) = __pyx_v_total_tie_count;
        }
        goto __pyx_L21;
      }
      __pyx_L21:;

      /* "pandas/algos.pyx":553
 *                 for j in range(i - dups + 1, i + 1):
 *                     ranks[argsorted[j]] = total_tie_count
 *             sum_ranks = dups = 0             # <<<<<<<<<<<<<<
 *     if pct:
 *         return ranks / count
 */
      __pyx_v_sum_ranks = 0;
      __pyx_v_dups = 0;
      goto __pyx_L20;
    }
    __pyx_L20:;
    __pyx_L17_continue:;
  }

  /* "pandas/algos.pyx":554
 *                     ranks[argsorted[j]] = total_tie_count
 *             sum_ranks = dups = 0
 *     if pct:             # <<<<<<<<<<<<<<
 *         return ranks / count
 *     else:
 */
  __pyx_t_21 = __Pyx_PyObject_IsTrue(__pyx_v_pct); if (unlikely(__pyx_t_21 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 554; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__pyx_t_21) {

    /* "pandas/algos.pyx":555
 *             sum_ranks = dups = 0
 *     if pct:
 *         return ranks / count             # <<<<<<<<<<<<<<
 *     else:
 *         return ranks
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = PyFloat_FromDouble(__pyx_v_count); 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_t_1 = __Pyx_PyNumber_Divide(((PyObject *)__pyx_v_ranks), __pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 555; __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;
  }
  /*else*/ {

    /* "pandas/algos.pyx":557
 *         return ranks / count
 *     else:
 *         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;
  }

  /* "pandas/algos.pyx":470
 * 
 * 
 * def rank_1d_generic(object in_arr, bint retry=1, ties_method='average',             # <<<<<<<<<<<<<<
 *                     ascending=True, na_option='keep', pct=False):
 *     """
 */

  /* function exit code */
  __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_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_pybuffernd_argsorted.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_ranks.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas.algos.rank_1d_generic", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_argsorted.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_ranks.rcbuffer->pybuffer);
  __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;
}

/* "pandas/algos.pyx":559
 *         return ranks
 * 
 * cdef inline are_diff(object left, object right):             # <<<<<<<<<<<<<<
 *     try:
 *         return fabs(left - right) > FP_ERR
 */

static CYTHON_INLINE PyObject *__pyx_f_6pandas_5algos_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", 0);

  /* "pandas/algos.pyx":560
 * 
 * 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:*/ {

      /* "pandas/algos.pyx":561
 * 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[0]; __pyx_lineno = 561; __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[0]; __pyx_lineno = 561; __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_5algos_FP_ERR)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 561; __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_L3_error:;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "pandas/algos.pyx":562
 *     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.algos.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[0]; __pyx_lineno = 562; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_GOTREF(__pyx_t_8);

      /* "pandas/algos.pyx":563
 *         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); __Pyx_XGOTREF(__pyx_t_9); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 563; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
      __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;
    }
    goto __pyx_L5_except_error;
    __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_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_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:;
  }

  /* "pandas/algos.pyx":559
 *         return ranks
 * 
 * cdef inline are_diff(object left, object right):             # <<<<<<<<<<<<<<
 *     try:
 *         return fabs(left - right) > FP_ERR
 */

  /* function exit code */
  __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.algos.are_diff", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/algos.pyx":588
 *     __cmp__ = _return_true
 * 
 * def rank_2d_generic(object in_arr, axis=0, ties_method='average',             # <<<<<<<<<<<<<<
 *                     ascending=True, na_option='keep', pct=False):
 *     """
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pandas_5algos_11rank_2d_generic(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6pandas_5algos_10rank_2d_generic[] = "\n    Fast NaN-friendly version of scipy.stats.rankdata\n    ";
static PyMethodDef __pyx_mdef_6pandas_5algos_11rank_2d_generic = {__Pyx_NAMESTR("rank_2d_generic"), (PyCFunction)__pyx_pw_6pandas_5algos_11rank_2d_generic, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6pandas_5algos_10rank_2d_generic)};
static PyObject *__pyx_pw_6pandas_5algos_11rank_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;
  PyObject *__pyx_v_na_option = 0;
  PyObject *__pyx_v_pct = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("rank_2d_generic (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_in_arr,&__pyx_n_s_axis,&__pyx_n_s_ties_method,&__pyx_n_s_ascending,&__pyx_n_s_na_option,&__pyx_n_s_pct,0};
    PyObject* values[6] = {0,0,0,0,0,0};
    values[1] = ((PyObject *)__pyx_int_0);
    values[2] = ((PyObject *)__pyx_n_s_average);

    /* "pandas/algos.pyx":589
 * 
 * def rank_2d_generic(object in_arr, axis=0, ties_method='average',
 *                     ascending=True, na_option='keep', pct=False):             # <<<<<<<<<<<<<<
 *     """
 *     Fast NaN-friendly version of scipy.stats.rankdata
 */
    values[3] = ((PyObject *)Py_True);
    values[4] = ((PyObject *)__pyx_n_s_keep);
    values[5] = ((PyObject *)Py_False);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_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 (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_in_arr)) != 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--; }
        }
        case  4:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_na_option);
          if (value) { values[4] = value; kw_args--; }
        }
        case  5:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_pct);
          if (value) { values[5] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "rank_2d_generic") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 588; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else {
      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);
        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];
    __pyx_v_na_option = values[4];
    __pyx_v_pct = values[5];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("rank_2d_generic", 0, 1, 6, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 588; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas.algos.rank_2d_generic", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6pandas_5algos_10rank_2d_generic(__pyx_self, __pyx_v_in_arr, __pyx_v_axis, __pyx_v_ties_method, __pyx_v_ascending, __pyx_v_na_option, __pyx_v_pct);

  /* "pandas/algos.pyx":588
 *     __cmp__ = _return_true
 * 
 * def rank_2d_generic(object in_arr, axis=0, ties_method='average',             # <<<<<<<<<<<<<<
 *                     ascending=True, na_option='keep', pct=False):
 *     """
 */

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pandas_5algos_10rank_2d_generic(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_in_arr, PyObject *__pyx_v_axis, PyObject *__pyx_v_ties_method, PyObject *__pyx_v_ascending, PyObject *__pyx_v_na_option, PyObject *__pyx_v_pct) {
  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;
  Py_ssize_t __pyx_v_total_tie_count;
  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;
  int __pyx_v_keep_na;
  float __pyx_v_count;
  PyObject *__pyx_v_mask = NULL;
  PyObject *__pyx_v__as = NULL;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_argsorted;
  __Pyx_Buffer __pyx_pybuffer_argsorted;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_ranks;
  __Pyx_Buffer __pyx_pybuffer_ranks;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_values;
  __Pyx_Buffer __pyx_pybuffer_values;
  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;
  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;
  Py_ssize_t __pyx_t_48;
  Py_ssize_t __pyx_t_49;
  Py_ssize_t __pyx_t_50;
  __pyx_t_5numpy_int64_t __pyx_t_51;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("rank_2d_generic", 0);
  __Pyx_INCREF(__pyx_v_in_arr);
  __pyx_pybuffer_ranks.pybuffer.buf = NULL;
  __pyx_pybuffer_ranks.refcount = 0;
  __pyx_pybuffernd_ranks.data = NULL;
  __pyx_pybuffernd_ranks.rcbuffer = &__pyx_pybuffer_ranks;
  __pyx_pybuffer_values.pybuffer.buf = NULL;
  __pyx_pybuffer_values.refcount = 0;
  __pyx_pybuffernd_values.data = NULL;
  __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values;
  __pyx_pybuffer_argsorted.pybuffer.buf = NULL;
  __pyx_pybuffer_argsorted.refcount = 0;
  __pyx_pybuffernd_argsorted.data = NULL;
  __pyx_pybuffernd_argsorted.rcbuffer = &__pyx_pybuffer_argsorted;

  /* "pandas/algos.pyx":595
 * 
 *     cdef:
 *         Py_ssize_t i, j, z, k, n, infs, dups = 0             # <<<<<<<<<<<<<<
 *         Py_ssize_t total_tie_count = 0
 *         ndarray[float64_t, ndim=2] ranks
 */
  __pyx_v_dups = 0;

  /* "pandas/algos.pyx":596
 *     cdef:
 *         Py_ssize_t i, j, z, k, n, infs, dups = 0
 *         Py_ssize_t total_tie_count = 0             # <<<<<<<<<<<<<<
 *         ndarray[float64_t, ndim=2] ranks
 *         ndarray[object, ndim=2] values
 */
  __pyx_v_total_tie_count = 0;

  /* "pandas/algos.pyx":601
 *         ndarray[int64_t, ndim=2] argsorted
 *         object val, nan_value
 *         float64_t sum_ranks = 0             # <<<<<<<<<<<<<<
 *         int tiebreak = 0
 *         bint keep_na = 0
 */
  __pyx_v_sum_ranks = 0.0;

  /* "pandas/algos.pyx":602
 *         object val, nan_value
 *         float64_t sum_ranks = 0
 *         int tiebreak = 0             # <<<<<<<<<<<<<<
 *         bint keep_na = 0
 *         float count = 0.0
 */
  __pyx_v_tiebreak = 0;

  /* "pandas/algos.pyx":603
 *         float64_t sum_ranks = 0
 *         int tiebreak = 0
 *         bint keep_na = 0             # <<<<<<<<<<<<<<
 *         float count = 0.0
 * 
 */
  __pyx_v_keep_na = 0;

  /* "pandas/algos.pyx":604
 *         int tiebreak = 0
 *         bint keep_na = 0
 *         float count = 0.0             # <<<<<<<<<<<<<<
 * 
 *     tiebreak = tiebreakers[ties_method]
 */
  __pyx_v_count = 0.0;

  /* "pandas/algos.pyx":606
 *         float count = 0.0
 * 
 *     tiebreak = tiebreakers[ties_method]             # <<<<<<<<<<<<<<
 * 
 *     keep_na = na_option == 'keep'
 */
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_tiebreakers); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 606; __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 (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 606; __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_As_int(__pyx_t_2); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 606; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_tiebreak = __pyx_t_3;

  /* "pandas/algos.pyx":608
 *     tiebreak = tiebreakers[ties_method]
 * 
 *     keep_na = na_option == 'keep'             # <<<<<<<<<<<<<<
 * 
 *     in_arr = np.asarray(in_arr)
 */
  __pyx_t_2 = PyObject_RichCompare(__pyx_v_na_option, __pyx_n_s_keep, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 608; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 608; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_keep_na = __pyx_t_4;

  /* "pandas/algos.pyx":610
 *     keep_na = na_option == 'keep'
 * 
 *     in_arr = np.asarray(in_arr)             # <<<<<<<<<<<<<<
 * 
 *     if axis == 0:
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 610; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_asarray); 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_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 = 610; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__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 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 610; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF_SET(__pyx_v_in_arr, __pyx_t_5);
  __pyx_t_5 = 0;

  /* "pandas/algos.pyx":612
 *     in_arr = np.asarray(in_arr)
 * 
 *     if axis == 0:             # <<<<<<<<<<<<<<
 *         values = in_arr.T.copy()
 *     else:
 */
  __pyx_t_5 = PyObject_RichCompare(__pyx_v_axis, __pyx_int_0, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 612; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 612; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__pyx_t_4) {

    /* "pandas/algos.pyx":613
 * 
 *     if axis == 0:
 *         values = in_arr.T.copy()             # <<<<<<<<<<<<<<
 *     else:
 *         values = in_arr.copy()
 */
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_in_arr, __pyx_n_s_T); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 613; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_copy); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 613; __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_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 613; __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_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 613; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_6 = ((PyArrayObject *)__pyx_t_5);
    {
      __Pyx_BufFmt_StackElem __pyx_stack[1];
      __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer);
      __pyx_t_3 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (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_pybuffernd_values.rcbuffer->pybuffer, (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_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_values.diminfo[1].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_values.diminfo[1].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[1];
      if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 613; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_6 = 0;
    __pyx_v_values = ((PyArrayObject *)__pyx_t_5);
    __pyx_t_5 = 0;
    goto __pyx_L3;
  }
  /*else*/ {

    /* "pandas/algos.pyx":615
 *         values = in_arr.T.copy()
 *     else:
 *         values = in_arr.copy()             # <<<<<<<<<<<<<<
 * 
 *     if values.dtype != np.object_:
 */
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_in_arr, __pyx_n_s_copy); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 615; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 615; __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 = 615; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_6 = ((PyArrayObject *)__pyx_t_2);
    {
      __Pyx_BufFmt_StackElem __pyx_stack[1];
      __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer);
      __pyx_t_3 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (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_pybuffernd_values.rcbuffer->pybuffer, (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_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_values.diminfo[1].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_values.diminfo[1].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[1];
      if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 615; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_6 = 0;
    __pyx_v_values = ((PyArrayObject *)__pyx_t_2);
    __pyx_t_2 = 0;
  }
  __pyx_L3:;

  /* "pandas/algos.pyx":617
 *         values = in_arr.copy()
 * 
 *     if values.dtype != np.object_:             # <<<<<<<<<<<<<<
 *         values = values.astype('O')
 * 
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_values), __pyx_n_s_dtype); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 617; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 617; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_object_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 617; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = PyObject_RichCompare(__pyx_t_2, __pyx_t_1, Py_NE); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 617; __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;
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 617; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__pyx_t_4) {

    /* "pandas/algos.pyx":618
 * 
 *     if values.dtype != np.object_:
 *         values = values.astype('O')             # <<<<<<<<<<<<<<
 * 
 *     if ascending ^ (na_option == 'top'):
 */
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_values), __pyx_n_s_astype); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 618; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_tuple__22, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 618; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__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[0]; __pyx_lineno = 618; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_6 = ((PyArrayObject *)__pyx_t_1);
    {
      __Pyx_BufFmt_StackElem __pyx_stack[1];
      __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer);
      __pyx_t_3 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (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_pybuffernd_values.rcbuffer->pybuffer, (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_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_values.diminfo[1].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_values.diminfo[1].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[1];
      if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 618; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_6 = 0;
    __Pyx_DECREF_SET(__pyx_v_values, ((PyArrayObject *)__pyx_t_1));
    __pyx_t_1 = 0;
    goto __pyx_L4;
  }
  __pyx_L4:;

  /* "pandas/algos.pyx":620
 *         values = values.astype('O')
 * 
 *     if ascending ^ (na_option == 'top'):             # <<<<<<<<<<<<<<
 *         # always greater than everything
 *         nan_value = Infinity()
 */
  __pyx_t_1 = PyObject_RichCompare(__pyx_v_na_option, __pyx_n_s_top, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 620; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_5 = PyNumber_Xor(__pyx_v_ascending, __pyx_t_1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 620; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __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[0]; __pyx_lineno = 620; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__pyx_t_4) {

    /* "pandas/algos.pyx":622
 *     if ascending ^ (na_option == 'top'):
 *         # always greater than everything
 *         nan_value = Infinity()             # <<<<<<<<<<<<<<
 *     else:
 *         nan_value = NegInfinity()
 */
    __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_Infinity); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 622; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 622; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_v_nan_value = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L5;
  }
  /*else*/ {

    /* "pandas/algos.pyx":624
 *         nan_value = Infinity()
 *     else:
 *         nan_value = NegInfinity()             # <<<<<<<<<<<<<<
 * 
 *     mask = lib.isnullobj2d(values)
 */
    __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_NegInfinity); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 624; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 624; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_v_nan_value = __pyx_t_5;
    __pyx_t_5 = 0;
  }
  __pyx_L5:;

  /* "pandas/algos.pyx":626
 *         nan_value = NegInfinity()
 * 
 *     mask = lib.isnullobj2d(values)             # <<<<<<<<<<<<<<
 *     np.putmask(values, mask, nan_value)
 * 
 */
  __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_lib); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 626; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_isnullobj2d); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 626; __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[0]; __pyx_lineno = 626; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__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_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 626; __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_5); __pyx_t_5 = 0;
  __pyx_v_mask = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "pandas/algos.pyx":627
 * 
 *     mask = lib.isnullobj2d(values)
 *     np.putmask(values, mask, nan_value)             # <<<<<<<<<<<<<<
 * 
 *     n, k = (<object> values).shape
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 627; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_putmask); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 627; __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(3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 627; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__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 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 627; __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_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pandas/algos.pyx":629
 *     np.putmask(values, mask, nan_value)
 * 
 *     n, k = (<object> values).shape             # <<<<<<<<<<<<<<
 *     ranks = np.empty((n, k), dtype='f8')
 * 
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_values), __pyx_n_s_shape); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 629; __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 CYTHON_COMPILING_IN_CPYTHON
    Py_ssize_t size = Py_SIZE(sequence);
    #else
    Py_ssize_t size = PySequence_Size(sequence);
    #endif
    if (unlikely(size != 2)) {
      if (size > 2) __Pyx_RaiseTooManyValuesError(2);
      else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 629; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    #if CYTHON_COMPILING_IN_CPYTHON
    if (likely(PyTuple_CheckExact(sequence))) {
      __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); 
      __pyx_t_5 = PyTuple_GET_ITEM(sequence, 1); 
    } else {
      __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);
    #else
    __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 629; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 629; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    #endif
    __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[0]; __pyx_lineno = 629; __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_L6_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_L6_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_5);
    if (__Pyx_IternextUnpackEndCheck(__pyx_t_11(__pyx_t_10), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 629; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_11 = NULL;
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    goto __pyx_L7_unpacking_done;
    __pyx_L6_unpacking_failed:;
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    __pyx_t_11 = NULL;
    if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 629; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_L7_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[0]; __pyx_lineno = 629; __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[0]; __pyx_lineno = 629; __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;

  /* "pandas/algos.pyx":630
 * 
 *     n, k = (<object> values).shape
 *     ranks = np.empty((n, k), dtype='f8')             # <<<<<<<<<<<<<<
 * 
 *     try:
 */
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 630; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_empty); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 630; __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[0]; __pyx_lineno = 630; __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[0]; __pyx_lineno = 630; __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[0]; __pyx_lineno = 630; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__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[0]; __pyx_lineno = 630; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_10);
  __Pyx_GIVEREF(__pyx_t_10);
  __pyx_t_10 = 0;
  __pyx_t_10 = PyDict_New(); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 630; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_10);
  if (PyDict_SetItem(__pyx_t_10, __pyx_n_s_dtype, __pyx_n_s_f8) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 630; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_2, __pyx_t_10); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 630; __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_2); __pyx_t_2 = 0;
  __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[0]; __pyx_lineno = 630; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_14 = ((PyArrayObject *)__pyx_t_1);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_ranks.rcbuffer->pybuffer);
    __pyx_t_3 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_ranks.rcbuffer->pybuffer, (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_pybuffernd_ranks.rcbuffer->pybuffer, (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_pybuffernd_ranks.diminfo[0].strides = __pyx_pybuffernd_ranks.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_ranks.diminfo[0].shape = __pyx_pybuffernd_ranks.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_ranks.diminfo[1].strides = __pyx_pybuffernd_ranks.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_ranks.diminfo[1].shape = __pyx_pybuffernd_ranks.rcbuffer->pybuffer.shape[1];
    if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 630; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_14 = 0;
  __pyx_v_ranks = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pandas/algos.pyx":632
 *     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:*/ {

      /* "pandas/algos.pyx":633
 * 
 *     try:
 *         _as = values.argsort(1)             # <<<<<<<<<<<<<<
 *     except TypeError:
 *         values = in_arr
 */
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_values), __pyx_n_s_argsort); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 633; __pyx_clineno = __LINE__; goto __pyx_L8_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__23, NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 633; __pyx_clineno = __LINE__; goto __pyx_L8_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_L15_try_end;
    __pyx_L8_error:;
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 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;

    /* "pandas/algos.pyx":634
 *     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.algos.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[0]; __pyx_lineno = 634; __pyx_clineno = __LINE__; goto __pyx_L10_except_error;}
      __Pyx_GOTREF(__pyx_t_10);
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_GOTREF(__pyx_t_2);

      /* "pandas/algos.pyx":635
 *         _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[0]; __pyx_lineno = 635; __pyx_clineno = __LINE__; goto __pyx_L10_except_error;}
      __pyx_t_5 = __pyx_v_in_arr;
      __Pyx_INCREF(__pyx_t_5);
      {
        __Pyx_BufFmt_StackElem __pyx_stack[1];
        __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer);
        __pyx_t_3 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)((PyArrayObject *)__pyx_t_5), &__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_pybuffernd_values.rcbuffer->pybuffer, (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_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_values.diminfo[1].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_values.diminfo[1].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[1];
        if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 635; __pyx_clineno = __LINE__; goto __pyx_L10_except_error;}
      }
      __Pyx_DECREF_SET(__pyx_v_values, ((PyArrayObject *)__pyx_t_5));
      __pyx_t_5 = 0;

      /* "pandas/algos.pyx":636
 *     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[0]; __pyx_lineno = 636; __pyx_clineno = __LINE__; goto __pyx_L10_except_error;}
      for (__pyx_t_12 = 0; __pyx_t_12 < __pyx_t_13; __pyx_t_12+=1) {
        __pyx_v_i = __pyx_t_12;

        /* "pandas/algos.pyx":637
 *         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_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_rank_1d_generic); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 637; __pyx_clineno = __LINE__; goto __pyx_L10_except_error;}
        __Pyx_GOTREF(__pyx_t_5);
        __pyx_t_18 = __Pyx_GetItemInt(__pyx_v_in_arr, __pyx_v_i, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 1, 1); if (unlikely(__pyx_t_18 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 637; __pyx_clineno = __LINE__; goto __pyx_L10_except_error;};
        __Pyx_GOTREF(__pyx_t_18);
        __pyx_t_19 = PyTuple_New(1); if (unlikely(!__pyx_t_19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 637; __pyx_clineno = __LINE__; goto __pyx_L10_except_error;}
        __Pyx_GOTREF(__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[0]; __pyx_lineno = 637; __pyx_clineno = __LINE__; goto __pyx_L10_except_error;}
        __Pyx_GOTREF(__pyx_t_18);

        /* "pandas/algos.pyx":638
 *         for i in range(len(values)):
 *             ranks[i] = rank_1d_generic(in_arr[i],
 *                                        ties_method=ties_method,             # <<<<<<<<<<<<<<
 *                                        ascending=ascending,
 *                                        pct=pct)
 */
        if (PyDict_SetItem(__pyx_t_18, __pyx_n_s_ties_method, __pyx_v_ties_method) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 637; __pyx_clineno = __LINE__; goto __pyx_L10_except_error;}

        /* "pandas/algos.pyx":639
 *             ranks[i] = rank_1d_generic(in_arr[i],
 *                                        ties_method=ties_method,
 *                                        ascending=ascending,             # <<<<<<<<<<<<<<
 *                                        pct=pct)
 *         if axis == 0:
 */
        if (PyDict_SetItem(__pyx_t_18, __pyx_n_s_ascending, __pyx_v_ascending) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 637; __pyx_clineno = __LINE__; goto __pyx_L10_except_error;}

        /* "pandas/algos.pyx":640
 *                                        ties_method=ties_method,
 *                                        ascending=ascending,
 *                                        pct=pct)             # <<<<<<<<<<<<<<
 *         if axis == 0:
 *             return ranks.T
 */
        if (PyDict_SetItem(__pyx_t_18, __pyx_n_s_pct, __pyx_v_pct) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 637; __pyx_clineno = __LINE__; goto __pyx_L10_except_error;}

        /* "pandas/algos.pyx":637
 *         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_20 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_19, __pyx_t_18); if (unlikely(!__pyx_t_20)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 637; __pyx_clineno = __LINE__; goto __pyx_L10_except_error;}
        __Pyx_GOTREF(__pyx_t_20);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
        __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
        if (unlikely(__Pyx_SetItemInt(((PyObject *)__pyx_v_ranks), __pyx_v_i, __pyx_t_20, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 1, 1) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 637; __pyx_clineno = __LINE__; goto __pyx_L10_except_error;}
        __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
      }

      /* "pandas/algos.pyx":641
 *                                        ascending=ascending,
 *                                        pct=pct)
 *         if axis == 0:             # <<<<<<<<<<<<<<
 *             return ranks.T
 *         else:
 */
      __pyx_t_20 = PyObject_RichCompare(__pyx_v_axis, __pyx_int_0, Py_EQ); __Pyx_XGOTREF(__pyx_t_20); if (unlikely(!__pyx_t_20)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 641; __pyx_clineno = __LINE__; goto __pyx_L10_except_error;}
      __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_20); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 641; __pyx_clineno = __LINE__; goto __pyx_L10_except_error;}
      __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
      if (__pyx_t_4) {

        /* "pandas/algos.pyx":642
 *                                        pct=pct)
 *         if axis == 0:
 *             return ranks.T             # <<<<<<<<<<<<<<
 *         else:
 *             return ranks
 */
        __Pyx_XDECREF(__pyx_r);
        __pyx_t_20 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_ranks), __pyx_n_s_T); if (unlikely(!__pyx_t_20)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 642; __pyx_clineno = __LINE__; goto __pyx_L10_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_L11_except_return;
      }
      /*else*/ {

        /* "pandas/algos.pyx":644
 *             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_L11_except_return;
      }
      __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_L9_exception_handled;
    }
    goto __pyx_L10_except_error;
    __pyx_L10_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_L11_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_L9_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_L15_try_end:;
  }

  /* "pandas/algos.pyx":646
 *             return ranks
 * 
 *     if not ascending:             # <<<<<<<<<<<<<<
 *         _as = _as[:, ::-1]
 * 
 */
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_ascending); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 646; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_21 = ((!__pyx_t_4) != 0);
  if (__pyx_t_21) {

    /* "pandas/algos.pyx":647
 * 
 *     if not ascending:
 *         _as = _as[:, ::-1]             # <<<<<<<<<<<<<<
 * 
 *     values = _take_2d_object(values, _as)
 */
    __pyx_t_2 = PyObject_GetItem(__pyx_v__as, __pyx_tuple__26); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 647; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF_SET(__pyx_v__as, __pyx_t_2);
    __pyx_t_2 = 0;
    goto __pyx_L21;
  }
  __pyx_L21:;

  /* "pandas/algos.pyx":649
 *         _as = _as[:, ::-1]
 * 
 *     values = _take_2d_object(values, _as)             # <<<<<<<<<<<<<<
 *     argsorted = _as.astype('i8')
 * 
 */
  __pyx_t_2 = __pyx_f_6pandas_5algos__take_2d_object(((PyArrayObject *)__pyx_v_values), __pyx_v__as); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 649; __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[0]; __pyx_lineno = 649; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_6 = ((PyArrayObject *)__pyx_t_2);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer);
    __pyx_t_3 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (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_pybuffernd_values.rcbuffer->pybuffer, (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_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_values.diminfo[1].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_values.diminfo[1].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[1];
    if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 649; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_6 = 0;
  __Pyx_DECREF_SET(__pyx_v_values, ((PyArrayObject *)__pyx_t_2));
  __pyx_t_2 = 0;

  /* "pandas/algos.pyx":650
 * 
 *     values = _take_2d_object(values, _as)
 *     argsorted = _as.astype('i8')             # <<<<<<<<<<<<<<
 * 
 *     for i in range(n):
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v__as, __pyx_n_s_astype); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 650; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__27, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 650; __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[0]; __pyx_lineno = 650; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_22 = ((PyArrayObject *)__pyx_t_1);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_argsorted.rcbuffer->pybuffer);
    __pyx_t_3 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_argsorted.rcbuffer->pybuffer, (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_pybuffernd_argsorted.rcbuffer->pybuffer, (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_pybuffernd_argsorted.diminfo[0].strides = __pyx_pybuffernd_argsorted.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_argsorted.diminfo[0].shape = __pyx_pybuffernd_argsorted.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_argsorted.diminfo[1].strides = __pyx_pybuffernd_argsorted.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_argsorted.diminfo[1].shape = __pyx_pybuffernd_argsorted.rcbuffer->pybuffer.shape[1];
    if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 650; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_22 = 0;
  __pyx_v_argsorted = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pandas/algos.pyx":652
 *     argsorted = _as.astype('i8')
 * 
 *     for i in range(n):             # <<<<<<<<<<<<<<
 *         dups = sum_ranks = infs = 0
 *         total_tie_count = 0
 */
  __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;

    /* "pandas/algos.pyx":653
 * 
 *     for i in range(n):
 *         dups = sum_ranks = infs = 0             # <<<<<<<<<<<<<<
 *         total_tie_count = 0
 *         count = 0.0
 */
    __pyx_v_dups = 0;
    __pyx_v_sum_ranks = 0;
    __pyx_v_infs = 0;

    /* "pandas/algos.pyx":654
 *     for i in range(n):
 *         dups = sum_ranks = infs = 0
 *         total_tie_count = 0             # <<<<<<<<<<<<<<
 *         count = 0.0
 *         for j in range(k):
 */
    __pyx_v_total_tie_count = 0;

    /* "pandas/algos.pyx":655
 *         dups = sum_ranks = infs = 0
 *         total_tie_count = 0
 *         count = 0.0             # <<<<<<<<<<<<<<
 *         for j in range(k):
 *             val = values[i, j]
 */
    __pyx_v_count = 0.0;

    /* "pandas/algos.pyx":656
 *         total_tie_count = 0
 *         count = 0.0
 *         for j in range(k):             # <<<<<<<<<<<<<<
 *             val = values[i, j]
 *             if val is nan_value and keep_na:
 */
    __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;

      /* "pandas/algos.pyx":657
 *         count = 0.0
 *         for j in range(k):
 *             val = values[i, j]             # <<<<<<<<<<<<<<
 *             if val is nan_value and keep_na:
 *                 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_pybuffernd_values.diminfo[0].shape;
        if (unlikely(__pyx_t_25 < 0)) __pyx_t_3 = 0;
      } else if (unlikely(__pyx_t_25 >= __pyx_pybuffernd_values.diminfo[0].shape)) __pyx_t_3 = 0;
      if (__pyx_t_26 < 0) {
        __pyx_t_26 += __pyx_pybuffernd_values.diminfo[1].shape;
        if (unlikely(__pyx_t_26 < 0)) __pyx_t_3 = 1;
      } else if (unlikely(__pyx_t_26 >= __pyx_pybuffernd_values.diminfo[1].shape)) __pyx_t_3 = 1;
      if (unlikely(__pyx_t_3 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_3);
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 657; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_t_1 = (PyObject *) *__Pyx_BufPtrStrided2d(PyObject **, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_25, __pyx_pybuffernd_values.diminfo[0].strides, __pyx_t_26, __pyx_pybuffernd_values.diminfo[1].strides);
      __Pyx_INCREF((PyObject*)__pyx_t_1);
      __Pyx_XDECREF_SET(__pyx_v_val, __pyx_t_1);
      __pyx_t_1 = 0;

      /* "pandas/algos.pyx":658
 *         for j in range(k):
 *             val = values[i, j]
 *             if val is nan_value and keep_na:             # <<<<<<<<<<<<<<
 *                 ranks[i, argsorted[i, j]] = nan
 *                 infs += 1
 */
      __pyx_t_21 = (__pyx_v_val == __pyx_v_nan_value);
      if ((__pyx_t_21 != 0)) {
        __pyx_t_4 = (__pyx_v_keep_na != 0);
      } else {
        __pyx_t_4 = (__pyx_t_21 != 0);
      }
      if (__pyx_t_4) {

        /* "pandas/algos.pyx":659
 *             val = values[i, j]
 *             if val is nan_value and keep_na:
 *                 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_pybuffernd_argsorted.diminfo[0].shape;
          if (unlikely(__pyx_t_27 < 0)) __pyx_t_3 = 0;
        } else if (unlikely(__pyx_t_27 >= __pyx_pybuffernd_argsorted.diminfo[0].shape)) __pyx_t_3 = 0;
        if (__pyx_t_28 < 0) {
          __pyx_t_28 += __pyx_pybuffernd_argsorted.diminfo[1].shape;
          if (unlikely(__pyx_t_28 < 0)) __pyx_t_3 = 1;
        } else if (unlikely(__pyx_t_28 >= __pyx_pybuffernd_argsorted.diminfo[1].shape)) __pyx_t_3 = 1;
        if (unlikely(__pyx_t_3 != -1)) {
          __Pyx_RaiseBufferIndexError(__pyx_t_3);
          {__pyx_filename = __pyx_f[0]; __pyx_lineno = 659; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        __pyx_t_29 = __pyx_v_i;
        __pyx_t_30 = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_argsorted.rcbuffer->pybuffer.buf, __pyx_t_27, __pyx_pybuffernd_argsorted.diminfo[0].strides, __pyx_t_28, __pyx_pybuffernd_argsorted.diminfo[1].strides));
        __pyx_t_3 = -1;
        if (__pyx_t_29 < 0) {
          __pyx_t_29 += __pyx_pybuffernd_ranks.diminfo[0].shape;
          if (unlikely(__pyx_t_29 < 0)) __pyx_t_3 = 0;
        } else if (unlikely(__pyx_t_29 >= __pyx_pybuffernd_ranks.diminfo[0].shape)) __pyx_t_3 = 0;
        if (__pyx_t_30 < 0) {
          __pyx_t_30 += __pyx_pybuffernd_ranks.diminfo[1].shape;
          if (unlikely(__pyx_t_30 < 0)) __pyx_t_3 = 1;
        } else if (unlikely(__pyx_t_30 >= __pyx_pybuffernd_ranks.diminfo[1].shape)) __pyx_t_3 = 1;
        if (unlikely(__pyx_t_3 != -1)) {
          __Pyx_RaiseBufferIndexError(__pyx_t_3);
          {__pyx_filename = __pyx_f[0]; __pyx_lineno = 659; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_ranks.rcbuffer->pybuffer.buf, __pyx_t_29, __pyx_pybuffernd_ranks.diminfo[0].strides, __pyx_t_30, __pyx_pybuffernd_ranks.diminfo[1].strides) = __pyx_v_6pandas_5algos_nan;

        /* "pandas/algos.pyx":660
 *             if val is nan_value and keep_na:
 *                 ranks[i, argsorted[i, j]] = nan
 *                 infs += 1             # <<<<<<<<<<<<<<
 *                 continue
 *             count += 1.0
 */
        __pyx_v_infs = (__pyx_v_infs + 1);

        /* "pandas/algos.pyx":661
 *                 ranks[i, argsorted[i, j]] = nan
 *                 infs += 1
 *                 continue             # <<<<<<<<<<<<<<
 *             count += 1.0
 *             sum_ranks += (j - infs) + 1
 */
        goto __pyx_L24_continue;
      }

      /* "pandas/algos.pyx":662
 *                 infs += 1
 *                 continue
 *             count += 1.0             # <<<<<<<<<<<<<<
 *             sum_ranks += (j - infs) + 1
 *             dups += 1
 */
      __pyx_v_count = (__pyx_v_count + 1.0);

      /* "pandas/algos.pyx":663
 *                 continue
 *             count += 1.0
 *             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));

      /* "pandas/algos.pyx":664
 *             count += 1.0
 *             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);

      /* "pandas/algos.pyx":665
 *             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_4 = (__pyx_v_j == (__pyx_v_k - 1));
      if (!__pyx_t_4) {
        __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_pybuffernd_values.diminfo[0].shape;
          if (unlikely(__pyx_t_31 < 0)) __pyx_t_3 = 0;
        } else if (unlikely(__pyx_t_31 >= __pyx_pybuffernd_values.diminfo[0].shape)) __pyx_t_3 = 0;
        if (__pyx_t_32 < 0) {
          __pyx_t_32 += __pyx_pybuffernd_values.diminfo[1].shape;
          if (unlikely(__pyx_t_32 < 0)) __pyx_t_3 = 1;
        } else if (unlikely(__pyx_t_32 >= __pyx_pybuffernd_values.diminfo[1].shape)) __pyx_t_3 = 1;
        if (unlikely(__pyx_t_3 != -1)) {
          __Pyx_RaiseBufferIndexError(__pyx_t_3);
          {__pyx_filename = __pyx_f[0]; __pyx_lineno = 665; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        __pyx_t_1 = (PyObject *) *__Pyx_BufPtrStrided2d(PyObject **, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_31, __pyx_pybuffernd_values.diminfo[0].strides, __pyx_t_32, __pyx_pybuffernd_values.diminfo[1].strides);
        __Pyx_INCREF((PyObject*)__pyx_t_1);
        __pyx_t_2 = __pyx_f_6pandas_5algos_are_diff(__pyx_t_1, __pyx_v_val); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 665; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __pyx_t_21 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_21 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 665; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __pyx_t_33 = __pyx_t_21;
      } else {
        __pyx_t_33 = __pyx_t_4;
      }
      if (__pyx_t_33) {

        /* "pandas/algos.pyx":666
 *             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_5algos_TIEBREAK_AVERAGE) != 0);
        if (__pyx_t_33) {

          /* "pandas/algos.pyx":667
 *             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;

            /* "pandas/algos.pyx":668
 *                 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)) {
              #ifdef WITH_THREAD
              PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
              #endif
              PyErr_SetString(PyExc_ZeroDivisionError, "float division");
              #ifdef WITH_THREAD
              PyGILState_Release(__pyx_gilstate_save);
              #endif
              {__pyx_filename = __pyx_f[0]; __pyx_lineno = 668; __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_pybuffernd_argsorted.diminfo[0].shape;
              if (unlikely(__pyx_t_36 < 0)) __pyx_t_3 = 0;
            } else if (unlikely(__pyx_t_36 >= __pyx_pybuffernd_argsorted.diminfo[0].shape)) __pyx_t_3 = 0;
            if (__pyx_t_37 < 0) {
              __pyx_t_37 += __pyx_pybuffernd_argsorted.diminfo[1].shape;
              if (unlikely(__pyx_t_37 < 0)) __pyx_t_3 = 1;
            } else if (unlikely(__pyx_t_37 >= __pyx_pybuffernd_argsorted.diminfo[1].shape)) __pyx_t_3 = 1;
            if (unlikely(__pyx_t_3 != -1)) {
              __Pyx_RaiseBufferIndexError(__pyx_t_3);
              {__pyx_filename = __pyx_f[0]; __pyx_lineno = 668; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            }
            __pyx_t_38 = __pyx_v_i;
            __pyx_t_39 = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_argsorted.rcbuffer->pybuffer.buf, __pyx_t_36, __pyx_pybuffernd_argsorted.diminfo[0].strides, __pyx_t_37, __pyx_pybuffernd_argsorted.diminfo[1].strides));
            __pyx_t_3 = -1;
            if (__pyx_t_38 < 0) {
              __pyx_t_38 += __pyx_pybuffernd_ranks.diminfo[0].shape;
              if (unlikely(__pyx_t_38 < 0)) __pyx_t_3 = 0;
            } else if (unlikely(__pyx_t_38 >= __pyx_pybuffernd_ranks.diminfo[0].shape)) __pyx_t_3 = 0;
            if (__pyx_t_39 < 0) {
              __pyx_t_39 += __pyx_pybuffernd_ranks.diminfo[1].shape;
              if (unlikely(__pyx_t_39 < 0)) __pyx_t_3 = 1;
            } else if (unlikely(__pyx_t_39 >= __pyx_pybuffernd_ranks.diminfo[1].shape)) __pyx_t_3 = 1;
            if (unlikely(__pyx_t_3 != -1)) {
              __Pyx_RaiseBufferIndexError(__pyx_t_3);
              {__pyx_filename = __pyx_f[0]; __pyx_lineno = 668; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            }
            *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_ranks.rcbuffer->pybuffer.buf, __pyx_t_38, __pyx_pybuffernd_ranks.diminfo[0].strides, __pyx_t_39, __pyx_pybuffernd_ranks.diminfo[1].strides) = (__pyx_v_sum_ranks / __pyx_v_dups);
          }
          goto __pyx_L28;
        }

        /* "pandas/algos.pyx":669
 *                     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_5algos_TIEBREAK_MIN) != 0);
        if (__pyx_t_33) {

          /* "pandas/algos.pyx":670
 *                         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;

            /* "pandas/algos.pyx":671
 *                 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_pybuffernd_argsorted.diminfo[0].shape;
              if (unlikely(__pyx_t_40 < 0)) __pyx_t_3 = 0;
            } else if (unlikely(__pyx_t_40 >= __pyx_pybuffernd_argsorted.diminfo[0].shape)) __pyx_t_3 = 0;
            if (__pyx_t_41 < 0) {
              __pyx_t_41 += __pyx_pybuffernd_argsorted.diminfo[1].shape;
              if (unlikely(__pyx_t_41 < 0)) __pyx_t_3 = 1;
            } else if (unlikely(__pyx_t_41 >= __pyx_pybuffernd_argsorted.diminfo[1].shape)) __pyx_t_3 = 1;
            if (unlikely(__pyx_t_3 != -1)) {
              __Pyx_RaiseBufferIndexError(__pyx_t_3);
              {__pyx_filename = __pyx_f[0]; __pyx_lineno = 671; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            }
            __pyx_t_42 = __pyx_v_i;
            __pyx_t_43 = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_argsorted.rcbuffer->pybuffer.buf, __pyx_t_40, __pyx_pybuffernd_argsorted.diminfo[0].strides, __pyx_t_41, __pyx_pybuffernd_argsorted.diminfo[1].strides));
            __pyx_t_3 = -1;
            if (__pyx_t_42 < 0) {
              __pyx_t_42 += __pyx_pybuffernd_ranks.diminfo[0].shape;
              if (unlikely(__pyx_t_42 < 0)) __pyx_t_3 = 0;
            } else if (unlikely(__pyx_t_42 >= __pyx_pybuffernd_ranks.diminfo[0].shape)) __pyx_t_3 = 0;
            if (__pyx_t_43 < 0) {
              __pyx_t_43 += __pyx_pybuffernd_ranks.diminfo[1].shape;
              if (unlikely(__pyx_t_43 < 0)) __pyx_t_3 = 1;
            } else if (unlikely(__pyx_t_43 >= __pyx_pybuffernd_ranks.diminfo[1].shape)) __pyx_t_3 = 1;
            if (unlikely(__pyx_t_3 != -1)) {
              __Pyx_RaiseBufferIndexError(__pyx_t_3);
              {__pyx_filename = __pyx_f[0]; __pyx_lineno = 671; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            }
            *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_ranks.rcbuffer->pybuffer.buf, __pyx_t_42, __pyx_pybuffernd_ranks.diminfo[0].strides, __pyx_t_43, __pyx_pybuffernd_ranks.diminfo[1].strides) = ((__pyx_v_j - __pyx_v_dups) + 2);
          }
          goto __pyx_L28;
        }

        /* "pandas/algos.pyx":672
 *                     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_5algos_TIEBREAK_MAX) != 0);
        if (__pyx_t_33) {

          /* "pandas/algos.pyx":673
 *                         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;

            /* "pandas/algos.pyx":674
 *                 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_pybuffernd_argsorted.diminfo[0].shape;
              if (unlikely(__pyx_t_44 < 0)) __pyx_t_3 = 0;
            } else if (unlikely(__pyx_t_44 >= __pyx_pybuffernd_argsorted.diminfo[0].shape)) __pyx_t_3 = 0;
            if (__pyx_t_45 < 0) {
              __pyx_t_45 += __pyx_pybuffernd_argsorted.diminfo[1].shape;
              if (unlikely(__pyx_t_45 < 0)) __pyx_t_3 = 1;
            } else if (unlikely(__pyx_t_45 >= __pyx_pybuffernd_argsorted.diminfo[1].shape)) __pyx_t_3 = 1;
            if (unlikely(__pyx_t_3 != -1)) {
              __Pyx_RaiseBufferIndexError(__pyx_t_3);
              {__pyx_filename = __pyx_f[0]; __pyx_lineno = 674; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            }
            __pyx_t_46 = __pyx_v_i;
            __pyx_t_47 = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_argsorted.rcbuffer->pybuffer.buf, __pyx_t_44, __pyx_pybuffernd_argsorted.diminfo[0].strides, __pyx_t_45, __pyx_pybuffernd_argsorted.diminfo[1].strides));
            __pyx_t_3 = -1;
            if (__pyx_t_46 < 0) {
              __pyx_t_46 += __pyx_pybuffernd_ranks.diminfo[0].shape;
              if (unlikely(__pyx_t_46 < 0)) __pyx_t_3 = 0;
            } else if (unlikely(__pyx_t_46 >= __pyx_pybuffernd_ranks.diminfo[0].shape)) __pyx_t_3 = 0;
            if (__pyx_t_47 < 0) {
              __pyx_t_47 += __pyx_pybuffernd_ranks.diminfo[1].shape;
              if (unlikely(__pyx_t_47 < 0)) __pyx_t_3 = 1;
            } else if (unlikely(__pyx_t_47 >= __pyx_pybuffernd_ranks.diminfo[1].shape)) __pyx_t_3 = 1;
            if (unlikely(__pyx_t_3 != -1)) {
              __Pyx_RaiseBufferIndexError(__pyx_t_3);
              {__pyx_filename = __pyx_f[0]; __pyx_lineno = 674; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            }
            *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_ranks.rcbuffer->pybuffer.buf, __pyx_t_46, __pyx_pybuffernd_ranks.diminfo[0].strides, __pyx_t_47, __pyx_pybuffernd_ranks.diminfo[1].strides) = (__pyx_v_j + 1);
          }
          goto __pyx_L28;
        }

        /* "pandas/algos.pyx":675
 *                     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_5algos_TIEBREAK_FIRST) != 0);
        if (__pyx_t_33) {

          /* "pandas/algos.pyx":676
 *                         ranks[i, argsorted[i, z]] = j + 1
 *                 elif tiebreak == TIEBREAK_FIRST:
 *                     raise ValueError('first not supported for '             # <<<<<<<<<<<<<<
 *                                      'non-numeric data')
 *                 elif tiebreak == TIEBREAK_DENSE:
 */
          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__28, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 676; __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 = 676; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }

        /* "pandas/algos.pyx":678
 *                     raise ValueError('first not supported for '
 *                                      'non-numeric data')
 *                 elif tiebreak == TIEBREAK_DENSE:             # <<<<<<<<<<<<<<
 *                     total_tie_count += 1
 *                     for z in range(j - dups + 1, j + 1):
 */
        __pyx_t_33 = ((__pyx_v_tiebreak == __pyx_v_6pandas_5algos_TIEBREAK_DENSE) != 0);
        if (__pyx_t_33) {

          /* "pandas/algos.pyx":679
 *                                      'non-numeric data')
 *                 elif tiebreak == TIEBREAK_DENSE:
 *                     total_tie_count += 1             # <<<<<<<<<<<<<<
 *                     for z in range(j - dups + 1, j + 1):
 *                         ranks[i, argsorted[i, z]] = total_tie_count
 */
          __pyx_v_total_tie_count = (__pyx_v_total_tie_count + 1);

          /* "pandas/algos.pyx":680
 *                 elif tiebreak == TIEBREAK_DENSE:
 *                     total_tie_count += 1
 *                     for z in range(j - dups + 1, j + 1):             # <<<<<<<<<<<<<<
 *                         ranks[i, argsorted[i, z]] = total_tie_count
 *                 sum_ranks = dups = 0
 */
          __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;

            /* "pandas/algos.pyx":681
 *                     total_tie_count += 1
 *                     for z in range(j - dups + 1, j + 1):
 *                         ranks[i, argsorted[i, z]] = total_tie_count             # <<<<<<<<<<<<<<
 *                 sum_ranks = dups = 0
 *         if pct:
 */
            __pyx_t_48 = __pyx_v_i;
            __pyx_t_49 = __pyx_v_z;
            __pyx_t_3 = -1;
            if (__pyx_t_48 < 0) {
              __pyx_t_48 += __pyx_pybuffernd_argsorted.diminfo[0].shape;
              if (unlikely(__pyx_t_48 < 0)) __pyx_t_3 = 0;
            } else if (unlikely(__pyx_t_48 >= __pyx_pybuffernd_argsorted.diminfo[0].shape)) __pyx_t_3 = 0;
            if (__pyx_t_49 < 0) {
              __pyx_t_49 += __pyx_pybuffernd_argsorted.diminfo[1].shape;
              if (unlikely(__pyx_t_49 < 0)) __pyx_t_3 = 1;
            } else if (unlikely(__pyx_t_49 >= __pyx_pybuffernd_argsorted.diminfo[1].shape)) __pyx_t_3 = 1;
            if (unlikely(__pyx_t_3 != -1)) {
              __Pyx_RaiseBufferIndexError(__pyx_t_3);
              {__pyx_filename = __pyx_f[0]; __pyx_lineno = 681; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            }
            __pyx_t_50 = __pyx_v_i;
            __pyx_t_51 = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_argsorted.rcbuffer->pybuffer.buf, __pyx_t_48, __pyx_pybuffernd_argsorted.diminfo[0].strides, __pyx_t_49, __pyx_pybuffernd_argsorted.diminfo[1].strides));
            __pyx_t_3 = -1;
            if (__pyx_t_50 < 0) {
              __pyx_t_50 += __pyx_pybuffernd_ranks.diminfo[0].shape;
              if (unlikely(__pyx_t_50 < 0)) __pyx_t_3 = 0;
            } else if (unlikely(__pyx_t_50 >= __pyx_pybuffernd_ranks.diminfo[0].shape)) __pyx_t_3 = 0;
            if (__pyx_t_51 < 0) {
              __pyx_t_51 += __pyx_pybuffernd_ranks.diminfo[1].shape;
              if (unlikely(__pyx_t_51 < 0)) __pyx_t_3 = 1;
            } else if (unlikely(__pyx_t_51 >= __pyx_pybuffernd_ranks.diminfo[1].shape)) __pyx_t_3 = 1;
            if (unlikely(__pyx_t_3 != -1)) {
              __Pyx_RaiseBufferIndexError(__pyx_t_3);
              {__pyx_filename = __pyx_f[0]; __pyx_lineno = 681; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            }
            *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_ranks.rcbuffer->pybuffer.buf, __pyx_t_50, __pyx_pybuffernd_ranks.diminfo[0].strides, __pyx_t_51, __pyx_pybuffernd_ranks.diminfo[1].strides) = __pyx_v_total_tie_count;
          }
          goto __pyx_L28;
        }
        __pyx_L28:;

        /* "pandas/algos.pyx":682
 *                     for z in range(j - dups + 1, j + 1):
 *                         ranks[i, argsorted[i, z]] = total_tie_count
 *                 sum_ranks = dups = 0             # <<<<<<<<<<<<<<
 *         if pct:
 *             ranks[i, :] /= count
 */
        __pyx_v_sum_ranks = 0;
        __pyx_v_dups = 0;
        goto __pyx_L27;
      }
      __pyx_L27:;
      __pyx_L24_continue:;
    }

    /* "pandas/algos.pyx":683
 *                         ranks[i, argsorted[i, z]] = total_tie_count
 *                 sum_ranks = dups = 0
 *         if pct:             # <<<<<<<<<<<<<<
 *             ranks[i, :] /= count
 *     if axis == 0:
 */
    __pyx_t_33 = __Pyx_PyObject_IsTrue(__pyx_v_pct); if (unlikely(__pyx_t_33 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 683; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    if (__pyx_t_33) {

      /* "pandas/algos.pyx":684
 *                 sum_ranks = dups = 0
 *         if pct:
 *             ranks[i, :] /= count             # <<<<<<<<<<<<<<
 *     if axis == 0:
 *         return ranks.T
 */
      __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_i); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 684; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 684; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2);
      __Pyx_GIVEREF(__pyx_t_2);
      __Pyx_INCREF(__pyx_slice__29);
      PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_slice__29);
      __Pyx_GIVEREF(__pyx_slice__29);
      __pyx_t_2 = 0;
      __pyx_t_2 = PyObject_GetItem(((PyObject *)__pyx_v_ranks), __pyx_t_1); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 684; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_10 = PyFloat_FromDouble(__pyx_v_count); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 684; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_10);
      __pyx_t_20 = __Pyx_PyNumber_InPlaceDivide(__pyx_t_2, __pyx_t_10); if (unlikely(!__pyx_t_20)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 684; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_20);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      if (unlikely(PyObject_SetItem(((PyObject *)__pyx_v_ranks), __pyx_t_1, __pyx_t_20) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 684; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L37;
    }
    __pyx_L37:;
  }

  /* "pandas/algos.pyx":685
 *         if pct:
 *             ranks[i, :] /= count
 *     if axis == 0:             # <<<<<<<<<<<<<<
 *         return ranks.T
 *     else:
 */
  __pyx_t_1 = PyObject_RichCompare(__pyx_v_axis, __pyx_int_0, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 685; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_33 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_33 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 685; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_33) {

    /* "pandas/algos.pyx":686
 *             ranks[i, :] /= count
 *     if axis == 0:
 *         return ranks.T             # <<<<<<<<<<<<<<
 *     else:
 *         return ranks
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_ranks), __pyx_n_s_T); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 686; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;
  }
  /*else*/ {

    /* "pandas/algos.pyx":688
 *         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;
  }

  /* "pandas/algos.pyx":588
 *     __cmp__ = _return_true
 * 
 * def rank_2d_generic(object in_arr, axis=0, ties_method='average',             # <<<<<<<<<<<<<<
 *                     ascending=True, na_option='keep', pct=False):
 *     """
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_5);
  __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_pybuffernd_argsorted.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_ranks.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas.algos.rank_2d_generic", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_argsorted.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_ranks.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer);
  __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;
}

/* "pandas/algos.pyx":715
 * # -
 * 
 * def _check_minp(win, minp, N):             # <<<<<<<<<<<<<<
 *     if minp > win:
 *         raise ValueError('min_periods (%d) must be <= window (%d)'
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pandas_5algos_13_check_minp(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_5algos_13_check_minp = {__Pyx_NAMESTR("_check_minp"), (PyCFunction)__pyx_pw_6pandas_5algos_13_check_minp, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pw_6pandas_5algos_13_check_minp(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_win = 0;
  PyObject *__pyx_v_minp = 0;
  PyObject *__pyx_v_N = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_check_minp (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_win,&__pyx_n_s_minp,&__pyx_n_s_N,0};
    PyObject* values[3] = {0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_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 (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_win)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_minp)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("_check_minp", 1, 3, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 715; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_N)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("_check_minp", 1, 3, 3, 2); {__pyx_filename = __pyx_f[0]; __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, pos_args, "_check_minp") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 715; __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_win = values[0];
    __pyx_v_minp = values[1];
    __pyx_v_N = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("_check_minp", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 715; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas.algos._check_minp", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6pandas_5algos_12_check_minp(__pyx_self, __pyx_v_win, __pyx_v_minp, __pyx_v_N);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pandas_5algos_12_check_minp(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_win, PyObject *__pyx_v_minp, PyObject *__pyx_v_N) {
  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("_check_minp", 0);
  __Pyx_INCREF(__pyx_v_minp);

  /* "pandas/algos.pyx":716
 * 
 * def _check_minp(win, minp, N):
 *     if minp > win:             # <<<<<<<<<<<<<<
 *         raise ValueError('min_periods (%d) must be <= window (%d)'
 *                         % (minp, win))
 */
  __pyx_t_1 = PyObject_RichCompare(__pyx_v_minp, __pyx_v_win, Py_GT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 716; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 716; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_2) {

    /* "pandas/algos.pyx":718
 *     if minp > win:
 *         raise ValueError('min_periods (%d) must be <= window (%d)'
 *                         % (minp, win))             # <<<<<<<<<<<<<<
 *     elif minp > N:
 *         minp = N + 1
 */
    __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 718; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_INCREF(__pyx_v_minp);
    PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_minp);
    __Pyx_GIVEREF(__pyx_v_minp);
    __Pyx_INCREF(__pyx_v_win);
    PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_win);
    __Pyx_GIVEREF(__pyx_v_win);
    __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_min_periods_d_must_be_window_d, __pyx_t_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 718; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "pandas/algos.pyx":717
 * def _check_minp(win, minp, N):
 *     if minp > win:
 *         raise ValueError('min_periods (%d) must be <= window (%d)'             # <<<<<<<<<<<<<<
 *                         % (minp, win))
 *     elif minp > N:
 */
    __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 717; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__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 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 717; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__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[0]; __pyx_lineno = 717; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }

  /* "pandas/algos.pyx":719
 *         raise ValueError('min_periods (%d) must be <= window (%d)'
 *                         % (minp, win))
 *     elif minp > N:             # <<<<<<<<<<<<<<
 *         minp = N + 1
 *     elif minp == 0:
 */
  __pyx_t_3 = PyObject_RichCompare(__pyx_v_minp, __pyx_v_N, Py_GT); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 719; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 719; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (__pyx_t_2) {

    /* "pandas/algos.pyx":720
 *                         % (minp, win))
 *     elif minp > N:
 *         minp = N + 1             # <<<<<<<<<<<<<<
 *     elif minp == 0:
 *         minp = 1
 */
    __pyx_t_3 = PyNumber_Add(__pyx_v_N, __pyx_int_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 720; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF_SET(__pyx_v_minp, __pyx_t_3);
    __pyx_t_3 = 0;
    goto __pyx_L3;
  }

  /* "pandas/algos.pyx":721
 *     elif minp > N:
 *         minp = N + 1
 *     elif minp == 0:             # <<<<<<<<<<<<<<
 *         minp = 1
 *     elif minp < 0:
 */
  __pyx_t_3 = PyObject_RichCompare(__pyx_v_minp, __pyx_int_0, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 721; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 721; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (__pyx_t_2) {

    /* "pandas/algos.pyx":722
 *         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_SET(__pyx_v_minp, __pyx_int_1);
    goto __pyx_L3;
  }

  /* "pandas/algos.pyx":723
 *     elif minp == 0:
 *         minp = 1
 *     elif minp < 0:             # <<<<<<<<<<<<<<
 *         raise ValueError('min_periods must be >= 0')
 *     return minp
 */
  __pyx_t_3 = PyObject_RichCompare(__pyx_v_minp, __pyx_int_0, Py_LT); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 723; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 723; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (__pyx_t_2) {

    /* "pandas/algos.pyx":724
 *         minp = 1
 *     elif minp < 0:
 *         raise ValueError('min_periods must be >= 0')             # <<<<<<<<<<<<<<
 *     return minp
 * 
 */
    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__30, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 724; __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 = 724; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_L3:;

  /* "pandas/algos.pyx":725
 *     elif minp < 0:
 *         raise ValueError('min_periods must be >= 0')
 *     return minp             # <<<<<<<<<<<<<<
 * 
 * # original C implementation by N. Devillard.
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_minp);
  __pyx_r = __pyx_v_minp;
  goto __pyx_L0;

  /* "pandas/algos.pyx":715
 * # -
 * 
 * def _check_minp(win, minp, N):             # <<<<<<<<<<<<<<
 *     if minp > win:
 *         raise ValueError('min_periods (%d) must be <= window (%d)'
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pandas.algos._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;
}

/* "pandas/algos.pyx":758
 * 
 * 
 * cdef inline Py_ssize_t swap(numeric *a, numeric *b) except -1:             # <<<<<<<<<<<<<<
 *     cdef numeric t
 * 
 */

static CYTHON_INLINE Py_ssize_t __pyx_fuse_0__pyx_f_6pandas_5algos_swap(__pyx_t_5numpy_int8_t *__pyx_v_a, __pyx_t_5numpy_int8_t *__pyx_v_b) {
  __pyx_t_5numpy_int8_t __pyx_v_t;
  Py_ssize_t __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__pyx_fuse_0swap", 0);

  /* "pandas/algos.pyx":762
 * 
 *     # cython doesn't allow pointer dereference so use array syntax
 *     t = a[0]             # <<<<<<<<<<<<<<
 *     a[0] = b[0]
 *     b[0] = t
 */
  __pyx_v_t = (__pyx_v_a[0]);

  /* "pandas/algos.pyx":763
 *     # cython doesn't allow pointer dereference so use array syntax
 *     t = a[0]
 *     a[0] = b[0]             # <<<<<<<<<<<<<<
 *     b[0] = t
 *     return 0
 */
  (__pyx_v_a[0]) = (__pyx_v_b[0]);

  /* "pandas/algos.pyx":764
 *     t = a[0]
 *     a[0] = b[0]
 *     b[0] = t             # <<<<<<<<<<<<<<
 *     return 0
 * 
 */
  (__pyx_v_b[0]) = __pyx_v_t;

  /* "pandas/algos.pyx":765
 *     a[0] = b[0]
 *     b[0] = t
 *     return 0             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = 0;
  goto __pyx_L0;

  /* "pandas/algos.pyx":758
 * 
 * 
 * cdef inline Py_ssize_t swap(numeric *a, numeric *b) except -1:             # <<<<<<<<<<<<<<
 *     cdef numeric t
 * 
 */

  /* function exit code */
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static CYTHON_INLINE Py_ssize_t __pyx_fuse_1__pyx_f_6pandas_5algos_swap(__pyx_t_5numpy_int16_t *__pyx_v_a, __pyx_t_5numpy_int16_t *__pyx_v_b) {
  __pyx_t_5numpy_int16_t __pyx_v_t;
  Py_ssize_t __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__pyx_fuse_1swap", 0);

  /* "pandas/algos.pyx":762
 * 
 *     # cython doesn't allow pointer dereference so use array syntax
 *     t = a[0]             # <<<<<<<<<<<<<<
 *     a[0] = b[0]
 *     b[0] = t
 */
  __pyx_v_t = (__pyx_v_a[0]);

  /* "pandas/algos.pyx":763
 *     # cython doesn't allow pointer dereference so use array syntax
 *     t = a[0]
 *     a[0] = b[0]             # <<<<<<<<<<<<<<
 *     b[0] = t
 *     return 0
 */
  (__pyx_v_a[0]) = (__pyx_v_b[0]);

  /* "pandas/algos.pyx":764
 *     t = a[0]
 *     a[0] = b[0]
 *     b[0] = t             # <<<<<<<<<<<<<<
 *     return 0
 * 
 */
  (__pyx_v_b[0]) = __pyx_v_t;

  /* "pandas/algos.pyx":765
 *     a[0] = b[0]
 *     b[0] = t
 *     return 0             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = 0;
  goto __pyx_L0;

  /* "pandas/algos.pyx":758
 * 
 * 
 * cdef inline Py_ssize_t swap(numeric *a, numeric *b) except -1:             # <<<<<<<<<<<<<<
 *     cdef numeric t
 * 
 */

  /* function exit code */
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static CYTHON_INLINE Py_ssize_t __pyx_fuse_2__pyx_f_6pandas_5algos_swap(__pyx_t_5numpy_int32_t *__pyx_v_a, __pyx_t_5numpy_int32_t *__pyx_v_b) {
  __pyx_t_5numpy_int32_t __pyx_v_t;
  Py_ssize_t __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__pyx_fuse_2swap", 0);

  /* "pandas/algos.pyx":762
 * 
 *     # cython doesn't allow pointer dereference so use array syntax
 *     t = a[0]             # <<<<<<<<<<<<<<
 *     a[0] = b[0]
 *     b[0] = t
 */
  __pyx_v_t = (__pyx_v_a[0]);

  /* "pandas/algos.pyx":763
 *     # cython doesn't allow pointer dereference so use array syntax
 *     t = a[0]
 *     a[0] = b[0]             # <<<<<<<<<<<<<<
 *     b[0] = t
 *     return 0
 */
  (__pyx_v_a[0]) = (__pyx_v_b[0]);

  /* "pandas/algos.pyx":764
 *     t = a[0]
 *     a[0] = b[0]
 *     b[0] = t             # <<<<<<<<<<<<<<
 *     return 0
 * 
 */
  (__pyx_v_b[0]) = __pyx_v_t;

  /* "pandas/algos.pyx":765
 *     a[0] = b[0]
 *     b[0] = t
 *     return 0             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = 0;
  goto __pyx_L0;

  /* "pandas/algos.pyx":758
 * 
 * 
 * cdef inline Py_ssize_t swap(numeric *a, numeric *b) except -1:             # <<<<<<<<<<<<<<
 *     cdef numeric t
 * 
 */

  /* function exit code */
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static CYTHON_INLINE Py_ssize_t __pyx_fuse_3__pyx_f_6pandas_5algos_swap(__pyx_t_5numpy_int64_t *__pyx_v_a, __pyx_t_5numpy_int64_t *__pyx_v_b) {
  __pyx_t_5numpy_int64_t __pyx_v_t;
  Py_ssize_t __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__pyx_fuse_3swap", 0);

  /* "pandas/algos.pyx":762
 * 
 *     # cython doesn't allow pointer dereference so use array syntax
 *     t = a[0]             # <<<<<<<<<<<<<<
 *     a[0] = b[0]
 *     b[0] = t
 */
  __pyx_v_t = (__pyx_v_a[0]);

  /* "pandas/algos.pyx":763
 *     # cython doesn't allow pointer dereference so use array syntax
 *     t = a[0]
 *     a[0] = b[0]             # <<<<<<<<<<<<<<
 *     b[0] = t
 *     return 0
 */
  (__pyx_v_a[0]) = (__pyx_v_b[0]);

  /* "pandas/algos.pyx":764
 *     t = a[0]
 *     a[0] = b[0]
 *     b[0] = t             # <<<<<<<<<<<<<<
 *     return 0
 * 
 */
  (__pyx_v_b[0]) = __pyx_v_t;

  /* "pandas/algos.pyx":765
 *     a[0] = b[0]
 *     b[0] = t
 *     return 0             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = 0;
  goto __pyx_L0;

  /* "pandas/algos.pyx":758
 * 
 * 
 * cdef inline Py_ssize_t swap(numeric *a, numeric *b) except -1:             # <<<<<<<<<<<<<<
 *     cdef numeric t
 * 
 */

  /* function exit code */
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static CYTHON_INLINE Py_ssize_t __pyx_fuse_4__pyx_f_6pandas_5algos_swap(__pyx_t_5numpy_uint8_t *__pyx_v_a, __pyx_t_5numpy_uint8_t *__pyx_v_b) {
  __pyx_t_5numpy_uint8_t __pyx_v_t;
  Py_ssize_t __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__pyx_fuse_4swap", 0);

  /* "pandas/algos.pyx":762
 * 
 *     # cython doesn't allow pointer dereference so use array syntax
 *     t = a[0]             # <<<<<<<<<<<<<<
 *     a[0] = b[0]
 *     b[0] = t
 */
  __pyx_v_t = (__pyx_v_a[0]);

  /* "pandas/algos.pyx":763
 *     # cython doesn't allow pointer dereference so use array syntax
 *     t = a[0]
 *     a[0] = b[0]             # <<<<<<<<<<<<<<
 *     b[0] = t
 *     return 0
 */
  (__pyx_v_a[0]) = (__pyx_v_b[0]);

  /* "pandas/algos.pyx":764
 *     t = a[0]
 *     a[0] = b[0]
 *     b[0] = t             # <<<<<<<<<<<<<<
 *     return 0
 * 
 */
  (__pyx_v_b[0]) = __pyx_v_t;

  /* "pandas/algos.pyx":765
 *     a[0] = b[0]
 *     b[0] = t
 *     return 0             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = 0;
  goto __pyx_L0;

  /* "pandas/algos.pyx":758
 * 
 * 
 * cdef inline Py_ssize_t swap(numeric *a, numeric *b) except -1:             # <<<<<<<<<<<<<<
 *     cdef numeric t
 * 
 */

  /* function exit code */
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static CYTHON_INLINE Py_ssize_t __pyx_fuse_5__pyx_f_6pandas_5algos_swap(__pyx_t_5numpy_uint16_t *__pyx_v_a, __pyx_t_5numpy_uint16_t *__pyx_v_b) {
  __pyx_t_5numpy_uint16_t __pyx_v_t;
  Py_ssize_t __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__pyx_fuse_5swap", 0);

  /* "pandas/algos.pyx":762
 * 
 *     # cython doesn't allow pointer dereference so use array syntax
 *     t = a[0]             # <<<<<<<<<<<<<<
 *     a[0] = b[0]
 *     b[0] = t
 */
  __pyx_v_t = (__pyx_v_a[0]);

  /* "pandas/algos.pyx":763
 *     # cython doesn't allow pointer dereference so use array syntax
 *     t = a[0]
 *     a[0] = b[0]             # <<<<<<<<<<<<<<
 *     b[0] = t
 *     return 0
 */
  (__pyx_v_a[0]) = (__pyx_v_b[0]);

  /* "pandas/algos.pyx":764
 *     t = a[0]
 *     a[0] = b[0]
 *     b[0] = t             # <<<<<<<<<<<<<<
 *     return 0
 * 
 */
  (__pyx_v_b[0]) = __pyx_v_t;

  /* "pandas/algos.pyx":765
 *     a[0] = b[0]
 *     b[0] = t
 *     return 0             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = 0;
  goto __pyx_L0;

  /* "pandas/algos.pyx":758
 * 
 * 
 * cdef inline Py_ssize_t swap(numeric *a, numeric *b) except -1:             # <<<<<<<<<<<<<<
 *     cdef numeric t
 * 
 */

  /* function exit code */
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static CYTHON_INLINE Py_ssize_t __pyx_fuse_6__pyx_f_6pandas_5algos_swap(__pyx_t_5numpy_uint32_t *__pyx_v_a, __pyx_t_5numpy_uint32_t *__pyx_v_b) {
  __pyx_t_5numpy_uint32_t __pyx_v_t;
  Py_ssize_t __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__pyx_fuse_6swap", 0);

  /* "pandas/algos.pyx":762
 * 
 *     # cython doesn't allow pointer dereference so use array syntax
 *     t = a[0]             # <<<<<<<<<<<<<<
 *     a[0] = b[0]
 *     b[0] = t
 */
  __pyx_v_t = (__pyx_v_a[0]);

  /* "pandas/algos.pyx":763
 *     # cython doesn't allow pointer dereference so use array syntax
 *     t = a[0]
 *     a[0] = b[0]             # <<<<<<<<<<<<<<
 *     b[0] = t
 *     return 0
 */
  (__pyx_v_a[0]) = (__pyx_v_b[0]);

  /* "pandas/algos.pyx":764
 *     t = a[0]
 *     a[0] = b[0]
 *     b[0] = t             # <<<<<<<<<<<<<<
 *     return 0
 * 
 */
  (__pyx_v_b[0]) = __pyx_v_t;

  /* "pandas/algos.pyx":765
 *     a[0] = b[0]
 *     b[0] = t
 *     return 0             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = 0;
  goto __pyx_L0;

  /* "pandas/algos.pyx":758
 * 
 * 
 * cdef inline Py_ssize_t swap(numeric *a, numeric *b) except -1:             # <<<<<<<<<<<<<<
 *     cdef numeric t
 * 
 */

  /* function exit code */
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static CYTHON_INLINE Py_ssize_t __pyx_fuse_7__pyx_f_6pandas_5algos_swap(__pyx_t_5numpy_uint64_t *__pyx_v_a, __pyx_t_5numpy_uint64_t *__pyx_v_b) {
  __pyx_t_5numpy_uint64_t __pyx_v_t;
  Py_ssize_t __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__pyx_fuse_7swap", 0);

  /* "pandas/algos.pyx":762
 * 
 *     # cython doesn't allow pointer dereference so use array syntax
 *     t = a[0]             # <<<<<<<<<<<<<<
 *     a[0] = b[0]
 *     b[0] = t
 */
  __pyx_v_t = (__pyx_v_a[0]);

  /* "pandas/algos.pyx":763
 *     # cython doesn't allow pointer dereference so use array syntax
 *     t = a[0]
 *     a[0] = b[0]             # <<<<<<<<<<<<<<
 *     b[0] = t
 *     return 0
 */
  (__pyx_v_a[0]) = (__pyx_v_b[0]);

  /* "pandas/algos.pyx":764
 *     t = a[0]
 *     a[0] = b[0]
 *     b[0] = t             # <<<<<<<<<<<<<<
 *     return 0
 * 
 */
  (__pyx_v_b[0]) = __pyx_v_t;

  /* "pandas/algos.pyx":765
 *     a[0] = b[0]
 *     b[0] = t
 *     return 0             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = 0;
  goto __pyx_L0;

  /* "pandas/algos.pyx":758
 * 
 * 
 * cdef inline Py_ssize_t swap(numeric *a, numeric *b) except -1:             # <<<<<<<<<<<<<<
 *     cdef numeric t
 * 
 */

  /* function exit code */
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static CYTHON_INLINE Py_ssize_t __pyx_fuse_8__pyx_f_6pandas_5algos_swap(__pyx_t_5numpy_float32_t *__pyx_v_a, __pyx_t_5numpy_float32_t *__pyx_v_b) {
  __pyx_t_5numpy_float32_t __pyx_v_t;
  Py_ssize_t __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__pyx_fuse_8swap", 0);

  /* "pandas/algos.pyx":762
 * 
 *     # cython doesn't allow pointer dereference so use array syntax
 *     t = a[0]             # <<<<<<<<<<<<<<
 *     a[0] = b[0]
 *     b[0] = t
 */
  __pyx_v_t = (__pyx_v_a[0]);

  /* "pandas/algos.pyx":763
 *     # cython doesn't allow pointer dereference so use array syntax
 *     t = a[0]
 *     a[0] = b[0]             # <<<<<<<<<<<<<<
 *     b[0] = t
 *     return 0
 */
  (__pyx_v_a[0]) = (__pyx_v_b[0]);

  /* "pandas/algos.pyx":764
 *     t = a[0]
 *     a[0] = b[0]
 *     b[0] = t             # <<<<<<<<<<<<<<
 *     return 0
 * 
 */
  (__pyx_v_b[0]) = __pyx_v_t;

  /* "pandas/algos.pyx":765
 *     a[0] = b[0]
 *     b[0] = t
 *     return 0             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = 0;
  goto __pyx_L0;

  /* "pandas/algos.pyx":758
 * 
 * 
 * cdef inline Py_ssize_t swap(numeric *a, numeric *b) except -1:             # <<<<<<<<<<<<<<
 *     cdef numeric t
 * 
 */

  /* function exit code */
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static CYTHON_INLINE Py_ssize_t __pyx_fuse_9__pyx_f_6pandas_5algos_swap(__pyx_t_5numpy_float64_t *__pyx_v_a, __pyx_t_5numpy_float64_t *__pyx_v_b) {
  __pyx_t_5numpy_float64_t __pyx_v_t;
  Py_ssize_t __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__pyx_fuse_9swap", 0);

  /* "pandas/algos.pyx":762
 * 
 *     # cython doesn't allow pointer dereference so use array syntax
 *     t = a[0]             # <<<<<<<<<<<<<<
 *     a[0] = b[0]
 *     b[0] = t
 */
  __pyx_v_t = (__pyx_v_a[0]);

  /* "pandas/algos.pyx":763
 *     # cython doesn't allow pointer dereference so use array syntax
 *     t = a[0]
 *     a[0] = b[0]             # <<<<<<<<<<<<<<
 *     b[0] = t
 *     return 0
 */
  (__pyx_v_a[0]) = (__pyx_v_b[0]);

  /* "pandas/algos.pyx":764
 *     t = a[0]
 *     a[0] = b[0]
 *     b[0] = t             # <<<<<<<<<<<<<<
 *     return 0
 * 
 */
  (__pyx_v_b[0]) = __pyx_v_t;

  /* "pandas/algos.pyx":765
 *     a[0] = b[0]
 *     b[0] = t
 *     return 0             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = 0;
  goto __pyx_L0;

  /* "pandas/algos.pyx":758
 * 
 * 
 * cdef inline Py_ssize_t swap(numeric *a, numeric *b) except -1:             # <<<<<<<<<<<<<<
 *     cdef numeric t
 * 
 */

  /* function exit code */
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/algos.pyx":770
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * cpdef numeric kth_smallest(numeric[:] a, Py_ssize_t k):             # <<<<<<<<<<<<<<
 *     cdef:
 *         Py_ssize_t i, j, l, m, n = a.size
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pandas_5algos_15kth_smallest(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_5algos_15kth_smallest = {__Pyx_NAMESTR("kth_smallest"), (PyCFunction)__pyx_pw_6pandas_5algos_15kth_smallest, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pw_6pandas_5algos_15kth_smallest(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_signatures = 0;
  PyObject *__pyx_v_args = 0;
  PyObject *__pyx_v_kwargs = 0;
  CYTHON_UNUSED PyObject *__pyx_v_defaults = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__pyx_fused_cpdef (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_signatures,&__pyx_n_s_args,&__pyx_n_s_kwargs,&__pyx_n_s_defaults,0};
    PyObject* values[4] = {0,0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_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 (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_signatures)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_args)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__pyx_fused_cpdef", 1, 4, 4, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_kwargs)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__pyx_fused_cpdef", 1, 4, 4, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  3:
        if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_defaults)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__pyx_fused_cpdef", 1, 4, 4, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__pyx_fused_cpdef") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __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_signatures = values[0];
    __pyx_v_args = values[1];
    __pyx_v_kwargs = values[2];
    __pyx_v_defaults = values[3];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__pyx_fused_cpdef", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas.algos.__pyx_fused_cpdef", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6pandas_5algos_14kth_smallest(__pyx_self, __pyx_v_signatures, __pyx_v_args, __pyx_v_kwargs, __pyx_v_defaults);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pandas_5algos_14kth_smallest(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_signatures, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs, CYTHON_UNUSED PyObject *__pyx_v_defaults) {
  PyObject *__pyx_v_dest_sig = NULL;
  PyObject *__pyx_v_numpy = NULL;
  __Pyx_memviewslice __pyx_v_memslice;
  Py_ssize_t __pyx_v_itemsize;
  int __pyx_v_dtype_signed;
  char __pyx_v_kind;
  int __pyx_v____pyx_uint8_t_is_signed;
  int __pyx_v____pyx_uint16_t_is_signed;
  int __pyx_v____pyx_int16_t_is_signed;
  int __pyx_v____pyx_uint64_t_is_signed;
  int __pyx_v____pyx_int8_t_is_signed;
  int __pyx_v____pyx_uint32_t_is_signed;
  int __pyx_v____pyx_int32_t_is_signed;
  int __pyx_v____pyx_int64_t_is_signed;
  PyObject *__pyx_v_arg = NULL;
  PyObject *__pyx_v_dtype = NULL;
  PyObject *__pyx_v_candidates = NULL;
  PyObject *__pyx_v_sig = NULL;
  int __pyx_v_match_found;
  PyObject *__pyx_v_src_type = NULL;
  PyObject *__pyx_v_dst_type = 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;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_t_7;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  Py_ssize_t __pyx_t_10;
  int __pyx_t_11;
  char __pyx_t_12;
  int __pyx_t_13;
  PyObject *(*__pyx_t_14)(PyObject *);
  Py_ssize_t __pyx_t_15;
  PyObject *(*__pyx_t_16)(PyObject *);
  PyObject *__pyx_t_17 = NULL;
  PyObject *__pyx_t_18 = NULL;
  PyObject *__pyx_t_19 = NULL;
  PyObject *(*__pyx_t_20)(PyObject *);
  int __pyx_t_21;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("kth_smallest", 0);
  __Pyx_INCREF(__pyx_v_kwargs);
  __pyx_t_1 = PyList_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(Py_None);
  PyList_SET_ITEM(__pyx_t_1, 0, Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_INCREF(Py_None);
  PyList_SET_ITEM(__pyx_t_1, 1, Py_None);
  __Pyx_GIVEREF(Py_None);
  __pyx_v_dest_sig = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;
  __pyx_t_2 = (__pyx_v_kwargs == Py_None);
  __pyx_t_3 = (__pyx_t_2 != 0);
  if (__pyx_t_3) {
    __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF_SET(__pyx_v_kwargs, __pyx_t_1);
    __pyx_t_1 = 0;
    goto __pyx_L3;
  }
  __pyx_L3:;
  {
    __Pyx_ExceptionSave(&__pyx_t_4, &__pyx_t_5, &__pyx_t_6);
    __Pyx_XGOTREF(__pyx_t_4);
    __Pyx_XGOTREF(__pyx_t_5);
    __Pyx_XGOTREF(__pyx_t_6);
    /*try:*/ {
      __pyx_t_1 = __Pyx_Import(__pyx_n_s_numpy, 0, -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L4_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_v_numpy = __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_6); __pyx_t_6 = 0;
    goto __pyx_L11_try_end;
    __pyx_L4_error:;
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_7 = PyErr_ExceptionMatches(__pyx_builtin_ImportError);
    if (__pyx_t_7) {
      __Pyx_AddTraceback("pandas.algos.__pyx_fused_cpdef", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_8, &__pyx_t_9) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L6_except_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_INCREF(Py_None);
      __Pyx_XDECREF_SET(__pyx_v_numpy, Py_None);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      goto __pyx_L5_exception_handled;
    }
    goto __pyx_L6_except_error;
    __pyx_L6_except_error:;
    __Pyx_XGIVEREF(__pyx_t_4);
    __Pyx_XGIVEREF(__pyx_t_5);
    __Pyx_XGIVEREF(__pyx_t_6);
    __Pyx_ExceptionReset(__pyx_t_4, __pyx_t_5, __pyx_t_6);
    goto __pyx_L1_error;
    __pyx_L5_exception_handled:;
    __Pyx_XGIVEREF(__pyx_t_4);
    __Pyx_XGIVEREF(__pyx_t_5);
    __Pyx_XGIVEREF(__pyx_t_6);
    __Pyx_ExceptionReset(__pyx_t_4, __pyx_t_5, __pyx_t_6);
    __pyx_L11_try_end:;
  }
  __pyx_v_itemsize = -1;
  __pyx_v____pyx_uint8_t_is_signed = (((__pyx_t_5numpy_uint8_t)-1) < 0);
  __pyx_v____pyx_uint16_t_is_signed = (((__pyx_t_5numpy_uint16_t)-1) < 0);
  __pyx_v____pyx_int16_t_is_signed = (((__pyx_t_5numpy_int16_t)-1) < 0);
  __pyx_v____pyx_uint64_t_is_signed = (((__pyx_t_5numpy_uint64_t)-1) < 0);
  __pyx_v____pyx_int8_t_is_signed = (((__pyx_t_5numpy_int8_t)-1) < 0);
  __pyx_v____pyx_uint32_t_is_signed = (((__pyx_t_5numpy_uint32_t)-1) < 0);
  __pyx_v____pyx_int32_t_is_signed = (((__pyx_t_5numpy_int32_t)-1) < 0);
  __pyx_v____pyx_int64_t_is_signed = (((__pyx_t_5numpy_int64_t)-1) < 0);
  __pyx_t_10 = PyObject_Length(__pyx_v_args); if (unlikely(__pyx_t_10 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_3 = ((0 < __pyx_t_10) != 0);
  if (__pyx_t_3) {
    __pyx_t_9 = __Pyx_GetItemInt(__pyx_v_args, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(__pyx_t_9 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
    __Pyx_GOTREF(__pyx_t_9);
    __pyx_v_arg = __pyx_t_9;
    __pyx_t_9 = 0;
    goto __pyx_L14;
  }
  __pyx_t_3 = (__Pyx_PySequence_Contains(__pyx_n_s_a, __pyx_v_kwargs, Py_EQ)); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_2 = (__pyx_t_3 != 0);
  if (__pyx_t_2) {
    __pyx_t_9 = PyObject_GetItem(__pyx_v_kwargs, __pyx_n_s_a); if (unlikely(__pyx_t_9 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
    __Pyx_GOTREF(__pyx_t_9);
    __pyx_v_arg = __pyx_t_9;
    __pyx_t_9 = 0;
    goto __pyx_L14;
  }
  /*else*/ {
    __pyx_t_10 = PyObject_Length(__pyx_v_args); if (unlikely(__pyx_t_10 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_9 = PyInt_FromSsize_t(__pyx_t_10); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_9);
    __pyx_t_8 = __Pyx_PyString_Format(__pyx_kp_s_Expected_at_least_d_arguments, __pyx_t_9); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_8);
    __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 = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_9);
    PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_8);
    __Pyx_GIVEREF(__pyx_t_8);
    __pyx_t_8 = 0;
    __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_t_9, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    __Pyx_Raise(__pyx_t_8, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_L14:;
  if (0) {
    goto __pyx_L15;
  }
  /*else*/ {
    while (1) {
      if (!1) break;
      __pyx_t_2 = (__pyx_v_numpy != Py_None);
      __pyx_t_3 = (__pyx_t_2 != 0);
      if (__pyx_t_3) {
        __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_numpy, __pyx_n_s_ndarray); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_8);
        __pyx_t_3 = PyObject_IsInstance(__pyx_v_arg, __pyx_t_8); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __pyx_t_2 = (__pyx_t_3 != 0);
        if (__pyx_t_2) {
          __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_dtype); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_8);
          __pyx_v_dtype = __pyx_t_8;
          __pyx_t_8 = 0;
          goto __pyx_L19;
        }
        __pyx_t_2 = (__pyx_memoryview_check(__pyx_v_arg) != 0);
        if (__pyx_t_2) {
          __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_base); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_8);
          __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_numpy, __pyx_n_s_ndarray); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_9);
          __pyx_t_3 = PyObject_IsInstance(__pyx_t_8, __pyx_t_9); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __pyx_t_11 = (__pyx_t_3 != 0);
        } else {
          __pyx_t_11 = __pyx_t_2;
        }
        if (__pyx_t_11) {
          __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_base); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_9);
          __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_dtype); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_8);
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __pyx_v_dtype = __pyx_t_8;
          __pyx_t_8 = 0;
          goto __pyx_L19;
        }
        /*else*/ {
          __Pyx_INCREF(Py_None);
          __pyx_v_dtype = Py_None;
        }
        __pyx_L19:;
        __pyx_v_itemsize = -1;
        __pyx_t_11 = (__pyx_v_dtype != Py_None);
        __pyx_t_2 = (__pyx_t_11 != 0);
        if (__pyx_t_2) {
          __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_dtype, __pyx_n_s_itemsize); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_8);
          __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[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
          __pyx_v_itemsize = __pyx_t_10;
          __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_dtype, __pyx_n_s_kind); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_8);
          __pyx_t_9 = PyTuple_New(1); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_9);
          PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_8);
          __Pyx_GIVEREF(__pyx_t_8);
          __pyx_t_8 = 0;
          __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ord, __pyx_t_9, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_8);
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __pyx_t_12 = __Pyx_PyInt_As_char(__pyx_t_8); if (unlikely((__pyx_t_12 == (char)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
          __pyx_v_kind = __pyx_t_12;
          __pyx_t_8 = __Pyx_PyInt_From_char(__pyx_v_kind); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_8);
          __pyx_t_9 = PyObject_RichCompare(__pyx_t_8, __pyx_int_105, Py_EQ); __Pyx_XGOTREF(__pyx_t_9); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
          __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __pyx_v_dtype_signed = __pyx_t_2;
          __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_dtype, __pyx_n_s_kind); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_9);
          __pyx_t_2 = (__Pyx_PySequence_Contains(__pyx_t_9, __pyx_tuple__31, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __pyx_t_11 = (__pyx_t_2 != 0);
          if (__pyx_t_11) {
            __pyx_t_11 = ((sizeof(__pyx_t_5numpy_int8_t)) == __pyx_v_itemsize);
            if (__pyx_t_11) {
              __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
              __Pyx_GOTREF(__pyx_t_9);
              __pyx_t_8 = PyObject_RichCompare(__pyx_t_9, __pyx_int_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_8); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
              __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
              __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
              __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
              if (__pyx_t_2) {
                __pyx_t_3 = (!((__pyx_v____pyx_int8_t_is_signed ^ __pyx_v_dtype_signed) != 0));
                __pyx_t_13 = __pyx_t_3;
              } else {
                __pyx_t_13 = __pyx_t_2;
              }
              __pyx_t_2 = __pyx_t_13;
            } else {
              __pyx_t_2 = __pyx_t_11;
            }
            if (__pyx_t_2) {
              if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_int8_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
              goto __pyx_L17_break;
            }
            __pyx_t_2 = ((sizeof(__pyx_t_5numpy_int16_t)) == __pyx_v_itemsize);
            if (__pyx_t_2) {
              __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
              __Pyx_GOTREF(__pyx_t_8);
              __pyx_t_9 = PyObject_RichCompare(__pyx_t_8, __pyx_int_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_9); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
              __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
              __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_11 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
              __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
              if (__pyx_t_11) {
                __pyx_t_13 = (!((__pyx_v____pyx_int16_t_is_signed ^ __pyx_v_dtype_signed) != 0));
                __pyx_t_3 = __pyx_t_13;
              } else {
                __pyx_t_3 = __pyx_t_11;
              }
              __pyx_t_11 = __pyx_t_3;
            } else {
              __pyx_t_11 = __pyx_t_2;
            }
            if (__pyx_t_11) {
              if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_int16_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
              goto __pyx_L17_break;
            }
            __pyx_t_11 = ((sizeof(__pyx_t_5numpy_int32_t)) == __pyx_v_itemsize);
            if (__pyx_t_11) {
              __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
              __Pyx_GOTREF(__pyx_t_9);
              __pyx_t_8 = PyObject_RichCompare(__pyx_t_9, __pyx_int_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_8); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
              __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
              __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
              __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
              if (__pyx_t_2) {
                __pyx_t_3 = (!((__pyx_v____pyx_int32_t_is_signed ^ __pyx_v_dtype_signed) != 0));
                __pyx_t_13 = __pyx_t_3;
              } else {
                __pyx_t_13 = __pyx_t_2;
              }
              __pyx_t_2 = __pyx_t_13;
            } else {
              __pyx_t_2 = __pyx_t_11;
            }
            if (__pyx_t_2) {
              if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_int32_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
              goto __pyx_L17_break;
            }
            __pyx_t_2 = ((sizeof(__pyx_t_5numpy_int64_t)) == __pyx_v_itemsize);
            if (__pyx_t_2) {
              __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
              __Pyx_GOTREF(__pyx_t_8);
              __pyx_t_9 = PyObject_RichCompare(__pyx_t_8, __pyx_int_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_9); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
              __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
              __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_11 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
              __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
              if (__pyx_t_11) {
                __pyx_t_13 = (!((__pyx_v____pyx_int64_t_is_signed ^ __pyx_v_dtype_signed) != 0));
                __pyx_t_3 = __pyx_t_13;
              } else {
                __pyx_t_3 = __pyx_t_11;
              }
              __pyx_t_11 = __pyx_t_3;
            } else {
              __pyx_t_11 = __pyx_t_2;
            }
            if (__pyx_t_11) {
              if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_int64_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
              goto __pyx_L17_break;
            }
            __pyx_t_11 = ((sizeof(__pyx_t_5numpy_uint8_t)) == __pyx_v_itemsize);
            if (__pyx_t_11) {
              __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
              __Pyx_GOTREF(__pyx_t_9);
              __pyx_t_8 = PyObject_RichCompare(__pyx_t_9, __pyx_int_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_8); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
              __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
              __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
              __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
              if (__pyx_t_2) {
                __pyx_t_3 = (!((__pyx_v____pyx_uint8_t_is_signed ^ __pyx_v_dtype_signed) != 0));
                __pyx_t_13 = __pyx_t_3;
              } else {
                __pyx_t_13 = __pyx_t_2;
              }
              __pyx_t_2 = __pyx_t_13;
            } else {
              __pyx_t_2 = __pyx_t_11;
            }
            if (__pyx_t_2) {
              if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_uint8_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
              goto __pyx_L17_break;
            }
            __pyx_t_2 = ((sizeof(__pyx_t_5numpy_uint16_t)) == __pyx_v_itemsize);
            if (__pyx_t_2) {
              __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
              __Pyx_GOTREF(__pyx_t_8);
              __pyx_t_9 = PyObject_RichCompare(__pyx_t_8, __pyx_int_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_9); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
              __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
              __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_11 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
              __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
              if (__pyx_t_11) {
                __pyx_t_13 = (!((__pyx_v____pyx_uint16_t_is_signed ^ __pyx_v_dtype_signed) != 0));
                __pyx_t_3 = __pyx_t_13;
              } else {
                __pyx_t_3 = __pyx_t_11;
              }
              __pyx_t_11 = __pyx_t_3;
            } else {
              __pyx_t_11 = __pyx_t_2;
            }
            if (__pyx_t_11) {
              if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_uint16_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
              goto __pyx_L17_break;
            }
            __pyx_t_11 = ((sizeof(__pyx_t_5numpy_uint32_t)) == __pyx_v_itemsize);
            if (__pyx_t_11) {
              __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
              __Pyx_GOTREF(__pyx_t_9);
              __pyx_t_8 = PyObject_RichCompare(__pyx_t_9, __pyx_int_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_8); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
              __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
              __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
              __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
              if (__pyx_t_2) {
                __pyx_t_3 = (!((__pyx_v____pyx_uint32_t_is_signed ^ __pyx_v_dtype_signed) != 0));
                __pyx_t_13 = __pyx_t_3;
              } else {
                __pyx_t_13 = __pyx_t_2;
              }
              __pyx_t_2 = __pyx_t_13;
            } else {
              __pyx_t_2 = __pyx_t_11;
            }
            if (__pyx_t_2) {
              if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_uint32_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
              goto __pyx_L17_break;
            }
            __pyx_t_2 = ((sizeof(__pyx_t_5numpy_uint64_t)) == __pyx_v_itemsize);
            if (__pyx_t_2) {
              __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
              __Pyx_GOTREF(__pyx_t_8);
              __pyx_t_9 = PyObject_RichCompare(__pyx_t_8, __pyx_int_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_9); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
              __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
              __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_11 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
              __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
              if (__pyx_t_11) {
                __pyx_t_13 = (!((__pyx_v____pyx_uint64_t_is_signed ^ __pyx_v_dtype_signed) != 0));
                __pyx_t_3 = __pyx_t_13;
              } else {
                __pyx_t_3 = __pyx_t_11;
              }
              __pyx_t_11 = __pyx_t_3;
            } else {
              __pyx_t_11 = __pyx_t_2;
            }
            if (__pyx_t_11) {
              if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_uint64_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
              goto __pyx_L17_break;
            }
            goto __pyx_L21;
          }
          __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_dtype, __pyx_n_s_kind); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_9);
          __pyx_t_11 = (__Pyx_PyString_Equals(__pyx_t_9, __pyx_n_s_f, Py_EQ)); if (unlikely(__pyx_t_11 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          if (__pyx_t_11) {
            __pyx_t_11 = ((sizeof(__pyx_t_5numpy_float32_t)) == __pyx_v_itemsize);
            if (__pyx_t_11) {
              __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
              __Pyx_GOTREF(__pyx_t_9);
              __pyx_t_8 = PyObject_RichCompare(__pyx_t_9, __pyx_int_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_8); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
              __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
              __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
              __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
              __pyx_t_3 = __pyx_t_2;
            } else {
              __pyx_t_3 = __pyx_t_11;
            }
            if (__pyx_t_3) {
              if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_float32_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
              goto __pyx_L17_break;
            }
            __pyx_t_3 = ((sizeof(__pyx_t_5numpy_float64_t)) == __pyx_v_itemsize);
            if (__pyx_t_3) {
              __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
              __Pyx_GOTREF(__pyx_t_8);
              __pyx_t_9 = PyObject_RichCompare(__pyx_t_8, __pyx_int_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_9); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
              __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
              __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_11 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
              __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
              __pyx_t_2 = __pyx_t_11;
            } else {
              __pyx_t_2 = __pyx_t_3;
            }
            if (__pyx_t_2) {
              if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_float64_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
              goto __pyx_L17_break;
            }
            goto __pyx_L21;
          }
          __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_dtype, __pyx_n_s_kind); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_9);
          __pyx_t_2 = (__Pyx_PyString_Equals(__pyx_t_9, __pyx_n_s_c, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          if (__pyx_t_2) {
            goto __pyx_L21;
          }
          __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_dtype, __pyx_n_s_kind); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_9);
          __pyx_t_2 = (__Pyx_PyString_Equals(__pyx_t_9, __pyx_n_s_O, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          if (__pyx_t_2) {
            goto __pyx_L21;
          }
          __pyx_L21:;
          goto __pyx_L20;
        }
        __pyx_L20:;
        goto __pyx_L18;
      }
      __pyx_L18:;
      __pyx_t_2 = ((__pyx_v_itemsize == -1) != 0);
      if (!__pyx_t_2) {
        __pyx_t_3 = ((__pyx_v_itemsize == (sizeof(__pyx_t_5numpy_int8_t))) != 0);
        __pyx_t_11 = __pyx_t_3;
      } else {
        __pyx_t_11 = __pyx_t_2;
      }
      if (__pyx_t_11) {
        __pyx_v_memslice = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int8_t(__pyx_v_arg);
        __pyx_t_11 = (__pyx_v_memslice.memview != 0);
        if (__pyx_t_11) {
          __PYX_XDEC_MEMVIEW((&__pyx_v_memslice), 1);
          if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_int8_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          goto __pyx_L17_break;
        }
        /*else*/ {
          PyErr_Clear();
        }
        goto __pyx_L32;
      }
      __pyx_L32:;
      __pyx_t_11 = ((__pyx_v_itemsize == -1) != 0);
      if (!__pyx_t_11) {
        __pyx_t_2 = ((__pyx_v_itemsize == (sizeof(__pyx_t_5numpy_int16_t))) != 0);
        __pyx_t_3 = __pyx_t_2;
      } else {
        __pyx_t_3 = __pyx_t_11;
      }
      if (__pyx_t_3) {
        __pyx_v_memslice = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int16_t(__pyx_v_arg);
        __pyx_t_3 = (__pyx_v_memslice.memview != 0);
        if (__pyx_t_3) {
          __PYX_XDEC_MEMVIEW((&__pyx_v_memslice), 1);
          if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_int16_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          goto __pyx_L17_break;
        }
        /*else*/ {
          PyErr_Clear();
        }
        goto __pyx_L34;
      }
      __pyx_L34:;
      __pyx_t_3 = ((__pyx_v_itemsize == -1) != 0);
      if (!__pyx_t_3) {
        __pyx_t_11 = ((__pyx_v_itemsize == (sizeof(__pyx_t_5numpy_int32_t))) != 0);
        __pyx_t_2 = __pyx_t_11;
      } else {
        __pyx_t_2 = __pyx_t_3;
      }
      if (__pyx_t_2) {
        __pyx_v_memslice = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int32_t(__pyx_v_arg);
        __pyx_t_2 = (__pyx_v_memslice.memview != 0);
        if (__pyx_t_2) {
          __PYX_XDEC_MEMVIEW((&__pyx_v_memslice), 1);
          if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_int32_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          goto __pyx_L17_break;
        }
        /*else*/ {
          PyErr_Clear();
        }
        goto __pyx_L36;
      }
      __pyx_L36:;
      __pyx_t_2 = ((__pyx_v_itemsize == -1) != 0);
      if (!__pyx_t_2) {
        __pyx_t_3 = ((__pyx_v_itemsize == (sizeof(__pyx_t_5numpy_int64_t))) != 0);
        __pyx_t_11 = __pyx_t_3;
      } else {
        __pyx_t_11 = __pyx_t_2;
      }
      if (__pyx_t_11) {
        __pyx_v_memslice = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int64_t(__pyx_v_arg);
        __pyx_t_11 = (__pyx_v_memslice.memview != 0);
        if (__pyx_t_11) {
          __PYX_XDEC_MEMVIEW((&__pyx_v_memslice), 1);
          if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_int64_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          goto __pyx_L17_break;
        }
        /*else*/ {
          PyErr_Clear();
        }
        goto __pyx_L38;
      }
      __pyx_L38:;
      __pyx_t_11 = ((__pyx_v_itemsize == -1) != 0);
      if (!__pyx_t_11) {
        __pyx_t_2 = ((__pyx_v_itemsize == (sizeof(__pyx_t_5numpy_uint8_t))) != 0);
        __pyx_t_3 = __pyx_t_2;
      } else {
        __pyx_t_3 = __pyx_t_11;
      }
      if (__pyx_t_3) {
        __pyx_v_memslice = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_uint8_t(__pyx_v_arg);
        __pyx_t_3 = (__pyx_v_memslice.memview != 0);
        if (__pyx_t_3) {
          __PYX_XDEC_MEMVIEW((&__pyx_v_memslice), 1);
          if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_uint8_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          goto __pyx_L17_break;
        }
        /*else*/ {
          PyErr_Clear();
        }
        goto __pyx_L40;
      }
      __pyx_L40:;
      __pyx_t_3 = ((__pyx_v_itemsize == -1) != 0);
      if (!__pyx_t_3) {
        __pyx_t_11 = ((__pyx_v_itemsize == (sizeof(__pyx_t_5numpy_uint16_t))) != 0);
        __pyx_t_2 = __pyx_t_11;
      } else {
        __pyx_t_2 = __pyx_t_3;
      }
      if (__pyx_t_2) {
        __pyx_v_memslice = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_uint16_t(__pyx_v_arg);
        __pyx_t_2 = (__pyx_v_memslice.memview != 0);
        if (__pyx_t_2) {
          __PYX_XDEC_MEMVIEW((&__pyx_v_memslice), 1);
          if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_uint16_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          goto __pyx_L17_break;
        }
        /*else*/ {
          PyErr_Clear();
        }
        goto __pyx_L42;
      }
      __pyx_L42:;
      __pyx_t_2 = ((__pyx_v_itemsize == -1) != 0);
      if (!__pyx_t_2) {
        __pyx_t_3 = ((__pyx_v_itemsize == (sizeof(__pyx_t_5numpy_uint32_t))) != 0);
        __pyx_t_11 = __pyx_t_3;
      } else {
        __pyx_t_11 = __pyx_t_2;
      }
      if (__pyx_t_11) {
        __pyx_v_memslice = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_uint32_t(__pyx_v_arg);
        __pyx_t_11 = (__pyx_v_memslice.memview != 0);
        if (__pyx_t_11) {
          __PYX_XDEC_MEMVIEW((&__pyx_v_memslice), 1);
          if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_uint32_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          goto __pyx_L17_break;
        }
        /*else*/ {
          PyErr_Clear();
        }
        goto __pyx_L44;
      }
      __pyx_L44:;
      __pyx_t_11 = ((__pyx_v_itemsize == -1) != 0);
      if (!__pyx_t_11) {
        __pyx_t_2 = ((__pyx_v_itemsize == (sizeof(__pyx_t_5numpy_uint64_t))) != 0);
        __pyx_t_3 = __pyx_t_2;
      } else {
        __pyx_t_3 = __pyx_t_11;
      }
      if (__pyx_t_3) {
        __pyx_v_memslice = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_uint64_t(__pyx_v_arg);
        __pyx_t_3 = (__pyx_v_memslice.memview != 0);
        if (__pyx_t_3) {
          __PYX_XDEC_MEMVIEW((&__pyx_v_memslice), 1);
          if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_uint64_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          goto __pyx_L17_break;
        }
        /*else*/ {
          PyErr_Clear();
        }
        goto __pyx_L46;
      }
      __pyx_L46:;
      __pyx_t_3 = ((__pyx_v_itemsize == -1) != 0);
      if (!__pyx_t_3) {
        __pyx_t_11 = ((__pyx_v_itemsize == (sizeof(__pyx_t_5numpy_float32_t))) != 0);
        __pyx_t_2 = __pyx_t_11;
      } else {
        __pyx_t_2 = __pyx_t_3;
      }
      if (__pyx_t_2) {
        __pyx_v_memslice = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float32_t(__pyx_v_arg);
        __pyx_t_2 = (__pyx_v_memslice.memview != 0);
        if (__pyx_t_2) {
          __PYX_XDEC_MEMVIEW((&__pyx_v_memslice), 1);
          if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_float32_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          goto __pyx_L17_break;
        }
        /*else*/ {
          PyErr_Clear();
        }
        goto __pyx_L48;
      }
      __pyx_L48:;
      __pyx_t_2 = ((__pyx_v_itemsize == -1) != 0);
      if (!__pyx_t_2) {
        __pyx_t_3 = ((__pyx_v_itemsize == (sizeof(__pyx_t_5numpy_float64_t))) != 0);
        __pyx_t_11 = __pyx_t_3;
      } else {
        __pyx_t_11 = __pyx_t_2;
      }
      if (__pyx_t_11) {
        __pyx_v_memslice = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float64_t(__pyx_v_arg);
        __pyx_t_11 = (__pyx_v_memslice.memview != 0);
        if (__pyx_t_11) {
          __PYX_XDEC_MEMVIEW((&__pyx_v_memslice), 1);
          if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_float64_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          goto __pyx_L17_break;
        }
        /*else*/ {
          PyErr_Clear();
        }
        goto __pyx_L50;
      }
      __pyx_L50:;
      if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, Py_None, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      goto __pyx_L17_break;
    }
    __pyx_L17_break:;
  }
  __pyx_L15:;
  __pyx_t_9 = PyList_New(0); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_9);
  __pyx_v_candidates = ((PyObject*)__pyx_t_9);
  __pyx_t_9 = 0;
  if (PyList_CheckExact(__pyx_v_signatures) || PyTuple_CheckExact(__pyx_v_signatures)) {
    __pyx_t_9 = __pyx_v_signatures; __Pyx_INCREF(__pyx_t_9); __pyx_t_10 = 0;
    __pyx_t_14 = NULL;
  } else {
    __pyx_t_10 = -1; __pyx_t_9 = PyObject_GetIter(__pyx_v_signatures); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_9);
    __pyx_t_14 = Py_TYPE(__pyx_t_9)->tp_iternext;
  }
  for (;;) {
    if (!__pyx_t_14 && PyList_CheckExact(__pyx_t_9)) {
      if (__pyx_t_10 >= PyList_GET_SIZE(__pyx_t_9)) break;
      #if CYTHON_COMPILING_IN_CPYTHON
      __pyx_t_8 = PyList_GET_ITEM(__pyx_t_9, __pyx_t_10); __Pyx_INCREF(__pyx_t_8); __pyx_t_10++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #else
      __pyx_t_8 = PySequence_ITEM(__pyx_t_9, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #endif
    } else if (!__pyx_t_14 && PyTuple_CheckExact(__pyx_t_9)) {
      if (__pyx_t_10 >= PyTuple_GET_SIZE(__pyx_t_9)) break;
      #if CYTHON_COMPILING_IN_CPYTHON
      __pyx_t_8 = PyTuple_GET_ITEM(__pyx_t_9, __pyx_t_10); __Pyx_INCREF(__pyx_t_8); __pyx_t_10++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #else
      __pyx_t_8 = PySequence_ITEM(__pyx_t_9, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #endif
    } else {
      __pyx_t_8 = __pyx_t_14(__pyx_t_9);
      if (unlikely(!__pyx_t_8)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_8);
    }
    __Pyx_XDECREF_SET(__pyx_v_sig, __pyx_t_8);
    __pyx_t_8 = 0;
    __pyx_v_match_found = 0;
    __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_sig, __pyx_n_s_strip); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_tuple__33, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_split); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_tuple__35, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_8);
    PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_1);
    __Pyx_GIVEREF(__pyx_t_1);
    __Pyx_INCREF(__pyx_v_dest_sig);
    PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_v_dest_sig);
    __Pyx_GIVEREF(__pyx_v_dest_sig);
    __pyx_t_1 = 0;
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_zip, __pyx_t_8, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    if (PyList_CheckExact(__pyx_t_1) || PyTuple_CheckExact(__pyx_t_1)) {
      __pyx_t_8 = __pyx_t_1; __Pyx_INCREF(__pyx_t_8); __pyx_t_15 = 0;
      __pyx_t_16 = NULL;
    } else {
      __pyx_t_15 = -1; __pyx_t_8 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_8);
      __pyx_t_16 = Py_TYPE(__pyx_t_8)->tp_iternext;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    for (;;) {
      if (!__pyx_t_16 && PyList_CheckExact(__pyx_t_8)) {
        if (__pyx_t_15 >= PyList_GET_SIZE(__pyx_t_8)) break;
        #if CYTHON_COMPILING_IN_CPYTHON
        __pyx_t_1 = PyList_GET_ITEM(__pyx_t_8, __pyx_t_15); __Pyx_INCREF(__pyx_t_1); __pyx_t_15++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #else
        __pyx_t_1 = PySequence_ITEM(__pyx_t_8, __pyx_t_15); __pyx_t_15++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #endif
      } else if (!__pyx_t_16 && PyTuple_CheckExact(__pyx_t_8)) {
        if (__pyx_t_15 >= PyTuple_GET_SIZE(__pyx_t_8)) break;
        #if CYTHON_COMPILING_IN_CPYTHON
        __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_8, __pyx_t_15); __Pyx_INCREF(__pyx_t_1); __pyx_t_15++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #else
        __pyx_t_1 = PySequence_ITEM(__pyx_t_8, __pyx_t_15); __pyx_t_15++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #endif
      } else {
        __pyx_t_1 = __pyx_t_16(__pyx_t_8);
        if (unlikely(!__pyx_t_1)) {
          PyObject* exc_type = PyErr_Occurred();
          if (exc_type) {
            if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
            else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          }
          break;
        }
        __Pyx_GOTREF(__pyx_t_1);
      }
      if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) {
        PyObject* sequence = __pyx_t_1;
        #if CYTHON_COMPILING_IN_CPYTHON
        Py_ssize_t size = Py_SIZE(sequence);
        #else
        Py_ssize_t size = PySequence_Size(sequence);
        #endif
        if (unlikely(size != 2)) {
          if (size > 2) __Pyx_RaiseTooManyValuesError(2);
          else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
          {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        #if CYTHON_COMPILING_IN_CPYTHON
        if (likely(PyTuple_CheckExact(sequence))) {
          __pyx_t_17 = PyTuple_GET_ITEM(sequence, 0); 
          __pyx_t_18 = PyTuple_GET_ITEM(sequence, 1); 
        } else {
          __pyx_t_17 = PyList_GET_ITEM(sequence, 0); 
          __pyx_t_18 = PyList_GET_ITEM(sequence, 1); 
        }
        __Pyx_INCREF(__pyx_t_17);
        __Pyx_INCREF(__pyx_t_18);
        #else
        __pyx_t_17 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_17);
        __pyx_t_18 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_18);
        #endif
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      } else {
        Py_ssize_t index = -1;
        __pyx_t_19 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_19);
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __pyx_t_20 = Py_TYPE(__pyx_t_19)->tp_iternext;
        index = 0; __pyx_t_17 = __pyx_t_20(__pyx_t_19); if (unlikely(!__pyx_t_17)) goto __pyx_L56_unpacking_failed;
        __Pyx_GOTREF(__pyx_t_17);
        index = 1; __pyx_t_18 = __pyx_t_20(__pyx_t_19); if (unlikely(!__pyx_t_18)) goto __pyx_L56_unpacking_failed;
        __Pyx_GOTREF(__pyx_t_18);
        if (__Pyx_IternextUnpackEndCheck(__pyx_t_20(__pyx_t_19), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __pyx_t_20 = NULL;
        __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
        goto __pyx_L57_unpacking_done;
        __pyx_L56_unpacking_failed:;
        __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
        __pyx_t_20 = NULL;
        if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __pyx_L57_unpacking_done:;
      }
      __Pyx_XDECREF_SET(__pyx_v_src_type, __pyx_t_17);
      __pyx_t_17 = 0;
      __Pyx_XDECREF_SET(__pyx_v_dst_type, __pyx_t_18);
      __pyx_t_18 = 0;
      __pyx_t_11 = (__pyx_v_dst_type != Py_None);
      __pyx_t_2 = (__pyx_t_11 != 0);
      if (__pyx_t_2) {
        __pyx_t_1 = PyObject_RichCompare(__pyx_v_src_type, __pyx_v_dst_type, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        if (__pyx_t_2) {
          __pyx_v_match_found = 1;
          goto __pyx_L59;
        }
        /*else*/ {
          __pyx_v_match_found = 0;
          goto __pyx_L55_break;
        }
        __pyx_L59:;
        goto __pyx_L58;
      }
      __pyx_L58:;
    }
    __pyx_L55_break:;
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __pyx_t_2 = (__pyx_v_match_found != 0);
    if (__pyx_t_2) {
      __pyx_t_21 = __Pyx_PyList_Append(__pyx_v_candidates, __pyx_v_sig); if (unlikely(__pyx_t_21 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      goto __pyx_L60;
    }
    __pyx_L60:;
  }
  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  __pyx_t_2 = (__pyx_v_candidates != Py_None) && (PyList_GET_SIZE(__pyx_v_candidates) != 0);
  __pyx_t_11 = ((!__pyx_t_2) != 0);
  if (__pyx_t_11) {
    __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__36, NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_9);
    __Pyx_Raise(__pyx_t_9, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_10 = PyList_GET_SIZE(__pyx_v_candidates); if (unlikely(__pyx_t_10 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_11 = ((__pyx_t_10 > 1) != 0);
  if (__pyx_t_11) {
    __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__37, NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_9);
    __Pyx_Raise(__pyx_t_9, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  /*else*/ {
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_9 = PyObject_GetItem(__pyx_v_signatures, PyList_GET_ITEM(__pyx_v_candidates, 0)); if (unlikely(__pyx_t_9 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
    __Pyx_GOTREF(__pyx_t_9);
    __pyx_r = __pyx_t_9;
    __pyx_t_9 = 0;
    goto __pyx_L0;
  }

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_17);
  __Pyx_XDECREF(__pyx_t_18);
  __Pyx_XDECREF(__pyx_t_19);
  __Pyx_AddTraceback("pandas.algos.__pyx_fused_cpdef", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_dest_sig);
  __Pyx_XDECREF(__pyx_v_numpy);
  __Pyx_XDECREF(__pyx_v_arg);
  __Pyx_XDECREF(__pyx_v_dtype);
  __Pyx_XDECREF(__pyx_v_candidates);
  __Pyx_XDECREF(__pyx_v_sig);
  __Pyx_XDECREF(__pyx_v_src_type);
  __Pyx_XDECREF(__pyx_v_dst_type);
  __Pyx_XDECREF(__pyx_v_kwargs);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pw_6pandas_5algos_513__pyx_fuse_0kth_smallest(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pw_6pandas_5algos_15kth_smallest(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static __pyx_t_5numpy_int8_t __pyx_fuse_0__pyx_f_6pandas_5algos_kth_smallest(__Pyx_memviewslice __pyx_v_a, Py_ssize_t __pyx_v_k, CYTHON_UNUSED int __pyx_skip_dispatch) {
  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_int8_t __pyx_v_x;
  __pyx_t_5numpy_int8_t __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  Py_ssize_t __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;
  Py_ssize_t __pyx_t_8;
  Py_ssize_t __pyx_t_9;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__pyx_fuse_0kth_smallest", 0);

  /* "pandas/algos.pyx":772
 * cpdef numeric kth_smallest(numeric[:] a, Py_ssize_t k):
 *     cdef:
 *         Py_ssize_t i, j, l, m, n = a.size             # <<<<<<<<<<<<<<
 *         numeric x
 * 
 */
  __pyx_t_1 = __pyx_memoryview_fromslice(__pyx_v_a, 1, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_5numpy_int8_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_5numpy_int8_t, 0);; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 772; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_size); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 772; __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_PyIndex_AsSsize_t(__pyx_t_2); if (unlikely((__pyx_t_3 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 772; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_n = __pyx_t_3;

  /* "pandas/algos.pyx":775
 *         numeric x
 * 
 *     l = 0             # <<<<<<<<<<<<<<
 *     m = n - 1
 * 
 */
  __pyx_v_l = 0;

  /* "pandas/algos.pyx":776
 * 
 *     l = 0
 *     m = n - 1             # <<<<<<<<<<<<<<
 * 
 *     while l < m:
 */
  __pyx_v_m = (__pyx_v_n - 1);

  /* "pandas/algos.pyx":778
 *     m = n - 1
 * 
 *     while l < m:             # <<<<<<<<<<<<<<
 *         x = a[k]
 *         i = l
 */
  while (1) {
    __pyx_t_4 = ((__pyx_v_l < __pyx_v_m) != 0);
    if (!__pyx_t_4) break;

    /* "pandas/algos.pyx":779
 * 
 *     while l < m:
 *         x = a[k]             # <<<<<<<<<<<<<<
 *         i = l
 *         j = m
 */
    __pyx_t_3 = __pyx_v_k;
    __pyx_v_x = (*((__pyx_t_5numpy_int8_t *) ( /* dim=0 */ (__pyx_v_a.data + __pyx_t_3 * __pyx_v_a.strides[0]) )));

    /* "pandas/algos.pyx":780
 *     while l < m:
 *         x = a[k]
 *         i = l             # <<<<<<<<<<<<<<
 *         j = m
 * 
 */
    __pyx_v_i = __pyx_v_l;

    /* "pandas/algos.pyx":781
 *         x = a[k]
 *         i = l
 *         j = m             # <<<<<<<<<<<<<<
 * 
 *         while 1:
 */
    __pyx_v_j = __pyx_v_m;

    /* "pandas/algos.pyx":783
 *         j = m
 * 
 *         while 1:             # <<<<<<<<<<<<<<
 *             while a[i] < x: i += 1
 *             while x < a[j]: j -= 1
 */
    while (1) {

      /* "pandas/algos.pyx":784
 * 
 *         while 1:
 *             while a[i] < x: i += 1             # <<<<<<<<<<<<<<
 *             while x < a[j]: j -= 1
 *             if i <= j:
 */
      while (1) {
        __pyx_t_5 = __pyx_v_i;
        __pyx_t_4 = (((*((__pyx_t_5numpy_int8_t *) ( /* dim=0 */ (__pyx_v_a.data + __pyx_t_5 * __pyx_v_a.strides[0]) ))) < __pyx_v_x) != 0);
        if (!__pyx_t_4) break;
        __pyx_v_i = (__pyx_v_i + 1);
      }

      /* "pandas/algos.pyx":785
 *         while 1:
 *             while a[i] < x: i += 1
 *             while x < a[j]: j -= 1             # <<<<<<<<<<<<<<
 *             if i <= j:
 *                 swap(&a[i], &a[j])
 */
      while (1) {
        __pyx_t_6 = __pyx_v_j;
        __pyx_t_4 = ((__pyx_v_x < (*((__pyx_t_5numpy_int8_t *) ( /* dim=0 */ (__pyx_v_a.data + __pyx_t_6 * __pyx_v_a.strides[0]) )))) != 0);
        if (!__pyx_t_4) break;
        __pyx_v_j = (__pyx_v_j - 1);
      }

      /* "pandas/algos.pyx":786
 *             while a[i] < x: i += 1
 *             while x < a[j]: j -= 1
 *             if i <= j:             # <<<<<<<<<<<<<<
 *                 swap(&a[i], &a[j])
 *                 i += 1; j -= 1
 */
      __pyx_t_4 = ((__pyx_v_i <= __pyx_v_j) != 0);
      if (__pyx_t_4) {

        /* "pandas/algos.pyx":787
 *             while x < a[j]: j -= 1
 *             if i <= j:
 *                 swap(&a[i], &a[j])             # <<<<<<<<<<<<<<
 *                 i += 1; j -= 1
 * 
 */
        __pyx_t_7 = __pyx_v_i;
        __pyx_t_8 = __pyx_v_j;
        __pyx_t_9 = __pyx_fuse_0__pyx_f_6pandas_5algos_swap((&(*((__pyx_t_5numpy_int8_t *) ( /* dim=0 */ (__pyx_v_a.data + __pyx_t_7 * __pyx_v_a.strides[0]) )))), (&(*((__pyx_t_5numpy_int8_t *) ( /* dim=0 */ (__pyx_v_a.data + __pyx_t_8 * __pyx_v_a.strides[0]) ))))); if (unlikely(__pyx_t_9 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 787; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

        /* "pandas/algos.pyx":788
 *             if i <= j:
 *                 swap(&a[i], &a[j])
 *                 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:;

      /* "pandas/algos.pyx":790
 *                 i += 1; j -= 1
 * 
 *             if i > j: break             # <<<<<<<<<<<<<<
 * 
 *         if j < k: l = i
 */
      __pyx_t_4 = ((__pyx_v_i > __pyx_v_j) != 0);
      if (__pyx_t_4) {
        goto __pyx_L6_break;
      }
    }
    __pyx_L6_break:;

    /* "pandas/algos.pyx":792
 *             if i > j: break
 * 
 *         if j < k: l = i             # <<<<<<<<<<<<<<
 *         if k < i: m = j
 *     return a[k]
 */
    __pyx_t_4 = ((__pyx_v_j < __pyx_v_k) != 0);
    if (__pyx_t_4) {
      __pyx_v_l = __pyx_v_i;
      goto __pyx_L13;
    }
    __pyx_L13:;

    /* "pandas/algos.pyx":793
 * 
 *         if j < k: l = i
 *         if k < i: m = j             # <<<<<<<<<<<<<<
 *     return a[k]
 * 
 */
    __pyx_t_4 = ((__pyx_v_k < __pyx_v_i) != 0);
    if (__pyx_t_4) {
      __pyx_v_m = __pyx_v_j;
      goto __pyx_L14;
    }
    __pyx_L14:;
  }

  /* "pandas/algos.pyx":794
 *         if j < k: l = i
 *         if k < i: m = j
 *     return a[k]             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_9 = __pyx_v_k;
  __pyx_r = (*((__pyx_t_5numpy_int8_t *) ( /* dim=0 */ (__pyx_v_a.data + __pyx_t_9 * __pyx_v_a.strides[0]) )));
  goto __pyx_L0;

  /* "pandas/algos.pyx":770
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * cpdef numeric kth_smallest(numeric[:] a, Py_ssize_t k):             # <<<<<<<<<<<<<<
 *     cdef:
 *         Py_ssize_t i, j, l, m, n = a.size
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_WriteUnraisable("pandas.algos.kth_smallest", __pyx_clineno, __pyx_lineno, __pyx_filename, 0);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_6pandas_5algos_513__pyx_fuse_0kth_smallest(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_fuse_0__pyx_mdef_6pandas_5algos_513__pyx_fuse_0kth_smallest = {__Pyx_NAMESTR("__pyx_fuse_0kth_smallest"), (PyCFunction)__pyx_pw_6pandas_5algos_513__pyx_fuse_0kth_smallest, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pw_6pandas_5algos_513__pyx_fuse_0kth_smallest(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  __Pyx_memviewslice __pyx_v_a = { 0, 0, { 0 }, { 0 }, { 0 } };
  Py_ssize_t __pyx_v_k;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__pyx_fuse_0kth_smallest (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_a,&__pyx_n_s_k,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_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 (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_a)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_k)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__pyx_fuse_0kth_smallest", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__pyx_fuse_0kth_smallest") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __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 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int8_t(values[0]); if (unlikely(!__pyx_v_a.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_v_k = __Pyx_PyIndex_AsSsize_t(values[1]); if (unlikely((__pyx_v_k == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__pyx_fuse_0kth_smallest", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas.algos.__pyx_fuse_0kth_smallest", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6pandas_5algos_512__pyx_fuse_0kth_smallest(__pyx_self, __pyx_v_a, __pyx_v_k);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pandas_5algos_512__pyx_fuse_0kth_smallest(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_a, 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("__pyx_fuse_0kth_smallest", 0);
  __Pyx_XDECREF(__pyx_r);
  if (unlikely(!__pyx_v_a.memview)) { __Pyx_RaiseUnboundLocalError("a"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
  __pyx_t_1 = __Pyx_PyInt_From_npy_int8(__pyx_fuse_0__pyx_f_6pandas_5algos_kth_smallest(__pyx_v_a, __pyx_v_k, 0)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __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;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pandas.algos.__pyx_fuse_0kth_smallest", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __PYX_XDEC_MEMVIEW(&__pyx_v_a, 1);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pw_6pandas_5algos_515__pyx_fuse_1kth_smallest(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pw_6pandas_5algos_15kth_smallest(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static __pyx_t_5numpy_int16_t __pyx_fuse_1__pyx_f_6pandas_5algos_kth_smallest(__Pyx_memviewslice __pyx_v_a, Py_ssize_t __pyx_v_k, CYTHON_UNUSED int __pyx_skip_dispatch) {
  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_int16_t __pyx_v_x;
  __pyx_t_5numpy_int16_t __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  Py_ssize_t __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;
  Py_ssize_t __pyx_t_8;
  Py_ssize_t __pyx_t_9;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__pyx_fuse_1kth_smallest", 0);

  /* "pandas/algos.pyx":772
 * cpdef numeric kth_smallest(numeric[:] a, Py_ssize_t k):
 *     cdef:
 *         Py_ssize_t i, j, l, m, n = a.size             # <<<<<<<<<<<<<<
 *         numeric x
 * 
 */
  __pyx_t_1 = __pyx_memoryview_fromslice(__pyx_v_a, 1, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_5numpy_int16_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_5numpy_int16_t, 0);; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 772; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_size); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 772; __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_PyIndex_AsSsize_t(__pyx_t_2); if (unlikely((__pyx_t_3 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 772; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_n = __pyx_t_3;

  /* "pandas/algos.pyx":775
 *         numeric x
 * 
 *     l = 0             # <<<<<<<<<<<<<<
 *     m = n - 1
 * 
 */
  __pyx_v_l = 0;

  /* "pandas/algos.pyx":776
 * 
 *     l = 0
 *     m = n - 1             # <<<<<<<<<<<<<<
 * 
 *     while l < m:
 */
  __pyx_v_m = (__pyx_v_n - 1);

  /* "pandas/algos.pyx":778
 *     m = n - 1
 * 
 *     while l < m:             # <<<<<<<<<<<<<<
 *         x = a[k]
 *         i = l
 */
  while (1) {
    __pyx_t_4 = ((__pyx_v_l < __pyx_v_m) != 0);
    if (!__pyx_t_4) break;

    /* "pandas/algos.pyx":779
 * 
 *     while l < m:
 *         x = a[k]             # <<<<<<<<<<<<<<
 *         i = l
 *         j = m
 */
    __pyx_t_3 = __pyx_v_k;
    __pyx_v_x = (*((__pyx_t_5numpy_int16_t *) ( /* dim=0 */ (__pyx_v_a.data + __pyx_t_3 * __pyx_v_a.strides[0]) )));

    /* "pandas/algos.pyx":780
 *     while l < m:
 *         x = a[k]
 *         i = l             # <<<<<<<<<<<<<<
 *         j = m
 * 
 */
    __pyx_v_i = __pyx_v_l;

    /* "pandas/algos.pyx":781
 *         x = a[k]
 *         i = l
 *         j = m             # <<<<<<<<<<<<<<
 * 
 *         while 1:
 */
    __pyx_v_j = __pyx_v_m;

    /* "pandas/algos.pyx":783
 *         j = m
 * 
 *         while 1:             # <<<<<<<<<<<<<<
 *             while a[i] < x: i += 1
 *             while x < a[j]: j -= 1
 */
    while (1) {

      /* "pandas/algos.pyx":784
 * 
 *         while 1:
 *             while a[i] < x: i += 1             # <<<<<<<<<<<<<<
 *             while x < a[j]: j -= 1
 *             if i <= j:
 */
      while (1) {
        __pyx_t_5 = __pyx_v_i;
        __pyx_t_4 = (((*((__pyx_t_5numpy_int16_t *) ( /* dim=0 */ (__pyx_v_a.data + __pyx_t_5 * __pyx_v_a.strides[0]) ))) < __pyx_v_x) != 0);
        if (!__pyx_t_4) break;
        __pyx_v_i = (__pyx_v_i + 1);
      }

      /* "pandas/algos.pyx":785
 *         while 1:
 *             while a[i] < x: i += 1
 *             while x < a[j]: j -= 1             # <<<<<<<<<<<<<<
 *             if i <= j:
 *                 swap(&a[i], &a[j])
 */
      while (1) {
        __pyx_t_6 = __pyx_v_j;
        __pyx_t_4 = ((__pyx_v_x < (*((__pyx_t_5numpy_int16_t *) ( /* dim=0 */ (__pyx_v_a.data + __pyx_t_6 * __pyx_v_a.strides[0]) )))) != 0);
        if (!__pyx_t_4) break;
        __pyx_v_j = (__pyx_v_j - 1);
      }

      /* "pandas/algos.pyx":786
 *             while a[i] < x: i += 1
 *             while x < a[j]: j -= 1
 *             if i <= j:             # <<<<<<<<<<<<<<
 *                 swap(&a[i], &a[j])
 *                 i += 1; j -= 1
 */
      __pyx_t_4 = ((__pyx_v_i <= __pyx_v_j) != 0);
      if (__pyx_t_4) {

        /* "pandas/algos.pyx":787
 *             while x < a[j]: j -= 1
 *             if i <= j:
 *                 swap(&a[i], &a[j])             # <<<<<<<<<<<<<<
 *                 i += 1; j -= 1
 * 
 */
        __pyx_t_7 = __pyx_v_i;
        __pyx_t_8 = __pyx_v_j;
        __pyx_t_9 = __pyx_fuse_1__pyx_f_6pandas_5algos_swap((&(*((__pyx_t_5numpy_int16_t *) ( /* dim=0 */ (__pyx_v_a.data + __pyx_t_7 * __pyx_v_a.strides[0]) )))), (&(*((__pyx_t_5numpy_int16_t *) ( /* dim=0 */ (__pyx_v_a.data + __pyx_t_8 * __pyx_v_a.strides[0]) ))))); if (unlikely(__pyx_t_9 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 787; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

        /* "pandas/algos.pyx":788
 *             if i <= j:
 *                 swap(&a[i], &a[j])
 *                 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:;

      /* "pandas/algos.pyx":790
 *                 i += 1; j -= 1
 * 
 *             if i > j: break             # <<<<<<<<<<<<<<
 * 
 *         if j < k: l = i
 */
      __pyx_t_4 = ((__pyx_v_i > __pyx_v_j) != 0);
      if (__pyx_t_4) {
        goto __pyx_L6_break;
      }
    }
    __pyx_L6_break:;

    /* "pandas/algos.pyx":792
 *             if i > j: break
 * 
 *         if j < k: l = i             # <<<<<<<<<<<<<<
 *         if k < i: m = j
 *     return a[k]
 */
    __pyx_t_4 = ((__pyx_v_j < __pyx_v_k) != 0);
    if (__pyx_t_4) {
      __pyx_v_l = __pyx_v_i;
      goto __pyx_L13;
    }
    __pyx_L13:;

    /* "pandas/algos.pyx":793
 * 
 *         if j < k: l = i
 *         if k < i: m = j             # <<<<<<<<<<<<<<
 *     return a[k]
 * 
 */
    __pyx_t_4 = ((__pyx_v_k < __pyx_v_i) != 0);
    if (__pyx_t_4) {
      __pyx_v_m = __pyx_v_j;
      goto __pyx_L14;
    }
    __pyx_L14:;
  }

  /* "pandas/algos.pyx":794
 *         if j < k: l = i
 *         if k < i: m = j
 *     return a[k]             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_9 = __pyx_v_k;
  __pyx_r = (*((__pyx_t_5numpy_int16_t *) ( /* dim=0 */ (__pyx_v_a.data + __pyx_t_9 * __pyx_v_a.strides[0]) )));
  goto __pyx_L0;

  /* "pandas/algos.pyx":770
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * cpdef numeric kth_smallest(numeric[:] a, Py_ssize_t k):             # <<<<<<<<<<<<<<
 *     cdef:
 *         Py_ssize_t i, j, l, m, n = a.size
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_WriteUnraisable("pandas.algos.kth_smallest", __pyx_clineno, __pyx_lineno, __pyx_filename, 0);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_6pandas_5algos_515__pyx_fuse_1kth_smallest(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_fuse_1__pyx_mdef_6pandas_5algos_515__pyx_fuse_1kth_smallest = {__Pyx_NAMESTR("__pyx_fuse_1kth_smallest"), (PyCFunction)__pyx_pw_6pandas_5algos_515__pyx_fuse_1kth_smallest, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pw_6pandas_5algos_515__pyx_fuse_1kth_smallest(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  __Pyx_memviewslice __pyx_v_a = { 0, 0, { 0 }, { 0 }, { 0 } };
  Py_ssize_t __pyx_v_k;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__pyx_fuse_1kth_smallest (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_a,&__pyx_n_s_k,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_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 (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_a)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_k)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__pyx_fuse_1kth_smallest", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__pyx_fuse_1kth_smallest") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __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 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int16_t(values[0]); if (unlikely(!__pyx_v_a.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_v_k = __Pyx_PyIndex_AsSsize_t(values[1]); if (unlikely((__pyx_v_k == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__pyx_fuse_1kth_smallest", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas.algos.__pyx_fuse_1kth_smallest", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6pandas_5algos_514__pyx_fuse_1kth_smallest(__pyx_self, __pyx_v_a, __pyx_v_k);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pandas_5algos_514__pyx_fuse_1kth_smallest(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_a, 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("__pyx_fuse_1kth_smallest", 0);
  __Pyx_XDECREF(__pyx_r);
  if (unlikely(!__pyx_v_a.memview)) { __Pyx_RaiseUnboundLocalError("a"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
  __pyx_t_1 = __Pyx_PyInt_From_npy_int16(__pyx_fuse_1__pyx_f_6pandas_5algos_kth_smallest(__pyx_v_a, __pyx_v_k, 0)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __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;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pandas.algos.__pyx_fuse_1kth_smallest", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __PYX_XDEC_MEMVIEW(&__pyx_v_a, 1);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pw_6pandas_5algos_517__pyx_fuse_2kth_smallest(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pw_6pandas_5algos_15kth_smallest(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static __pyx_t_5numpy_int32_t __pyx_fuse_2__pyx_f_6pandas_5algos_kth_smallest(__Pyx_memviewslice __pyx_v_a, Py_ssize_t __pyx_v_k, CYTHON_UNUSED int __pyx_skip_dispatch) {
  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_int32_t __pyx_v_x;
  __pyx_t_5numpy_int32_t __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  Py_ssize_t __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;
  Py_ssize_t __pyx_t_8;
  Py_ssize_t __pyx_t_9;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__pyx_fuse_2kth_smallest", 0);

  /* "pandas/algos.pyx":772
 * cpdef numeric kth_smallest(numeric[:] a, Py_ssize_t k):
 *     cdef:
 *         Py_ssize_t i, j, l, m, n = a.size             # <<<<<<<<<<<<<<
 *         numeric x
 * 
 */
  __pyx_t_1 = __pyx_memoryview_fromslice(__pyx_v_a, 1, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_5numpy_int32_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_5numpy_int32_t, 0);; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 772; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_size); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 772; __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_PyIndex_AsSsize_t(__pyx_t_2); if (unlikely((__pyx_t_3 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 772; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_n = __pyx_t_3;

  /* "pandas/algos.pyx":775
 *         numeric x
 * 
 *     l = 0             # <<<<<<<<<<<<<<
 *     m = n - 1
 * 
 */
  __pyx_v_l = 0;

  /* "pandas/algos.pyx":776
 * 
 *     l = 0
 *     m = n - 1             # <<<<<<<<<<<<<<
 * 
 *     while l < m:
 */
  __pyx_v_m = (__pyx_v_n - 1);

  /* "pandas/algos.pyx":778
 *     m = n - 1
 * 
 *     while l < m:             # <<<<<<<<<<<<<<
 *         x = a[k]
 *         i = l
 */
  while (1) {
    __pyx_t_4 = ((__pyx_v_l < __pyx_v_m) != 0);
    if (!__pyx_t_4) break;

    /* "pandas/algos.pyx":779
 * 
 *     while l < m:
 *         x = a[k]             # <<<<<<<<<<<<<<
 *         i = l
 *         j = m
 */
    __pyx_t_3 = __pyx_v_k;
    __pyx_v_x = (*((__pyx_t_5numpy_int32_t *) ( /* dim=0 */ (__pyx_v_a.data + __pyx_t_3 * __pyx_v_a.strides[0]) )));

    /* "pandas/algos.pyx":780
 *     while l < m:
 *         x = a[k]
 *         i = l             # <<<<<<<<<<<<<<
 *         j = m
 * 
 */
    __pyx_v_i = __pyx_v_l;

    /* "pandas/algos.pyx":781
 *         x = a[k]
 *         i = l
 *         j = m             # <<<<<<<<<<<<<<
 * 
 *         while 1:
 */
    __pyx_v_j = __pyx_v_m;

    /* "pandas/algos.pyx":783
 *         j = m
 * 
 *         while 1:             # <<<<<<<<<<<<<<
 *             while a[i] < x: i += 1
 *             while x < a[j]: j -= 1
 */
    while (1) {

      /* "pandas/algos.pyx":784
 * 
 *         while 1:
 *             while a[i] < x: i += 1             # <<<<<<<<<<<<<<
 *             while x < a[j]: j -= 1
 *             if i <= j:
 */
      while (1) {
        __pyx_t_5 = __pyx_v_i;
        __pyx_t_4 = (((*((__pyx_t_5numpy_int32_t *) ( /* dim=0 */ (__pyx_v_a.data + __pyx_t_5 * __pyx_v_a.strides[0]) ))) < __pyx_v_x) != 0);
        if (!__pyx_t_4) break;
        __pyx_v_i = (__pyx_v_i + 1);
      }

      /* "pandas/algos.pyx":785
 *         while 1:
 *             while a[i] < x: i += 1
 *             while x < a[j]: j -= 1             # <<<<<<<<<<<<<<
 *             if i <= j:
 *                 swap(&a[i], &a[j])
 */
      while (1) {
        __pyx_t_6 = __pyx_v_j;
        __pyx_t_4 = ((__pyx_v_x < (*((__pyx_t_5numpy_int32_t *) ( /* dim=0 */ (__pyx_v_a.data + __pyx_t_6 * __pyx_v_a.strides[0]) )))) != 0);
        if (!__pyx_t_4) break;
        __pyx_v_j = (__pyx_v_j - 1);
      }

      /* "pandas/algos.pyx":786
 *             while a[i] < x: i += 1
 *             while x < a[j]: j -= 1
 *             if i <= j:             # <<<<<<<<<<<<<<
 *                 swap(&a[i], &a[j])
 *                 i += 1; j -= 1
 */
      __pyx_t_4 = ((__pyx_v_i <= __pyx_v_j) != 0);
      if (__pyx_t_4) {

        /* "pandas/algos.pyx":787
 *             while x < a[j]: j -= 1
 *             if i <= j:
 *                 swap(&a[i], &a[j])             # <<<<<<<<<<<<<<
 *                 i += 1; j -= 1
 * 
 */
        __pyx_t_7 = __pyx_v_i;
        __pyx_t_8 = __pyx_v_j;
        __pyx_t_9 = __pyx_fuse_2__pyx_f_6pandas_5algos_swap((&(*((__pyx_t_5numpy_int32_t *) ( /* dim=0 */ (__pyx_v_a.data + __pyx_t_7 * __pyx_v_a.strides[0]) )))), (&(*((__pyx_t_5numpy_int32_t *) ( /* dim=0 */ (__pyx_v_a.data + __pyx_t_8 * __pyx_v_a.strides[0]) ))))); if (unlikely(__pyx_t_9 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 787; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

        /* "pandas/algos.pyx":788
 *             if i <= j:
 *                 swap(&a[i], &a[j])
 *                 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:;

      /* "pandas/algos.pyx":790
 *                 i += 1; j -= 1
 * 
 *             if i > j: break             # <<<<<<<<<<<<<<
 * 
 *         if j < k: l = i
 */
      __pyx_t_4 = ((__pyx_v_i > __pyx_v_j) != 0);
      if (__pyx_t_4) {
        goto __pyx_L6_break;
      }
    }
    __pyx_L6_break:;

    /* "pandas/algos.pyx":792
 *             if i > j: break
 * 
 *         if j < k: l = i             # <<<<<<<<<<<<<<
 *         if k < i: m = j
 *     return a[k]
 */
    __pyx_t_4 = ((__pyx_v_j < __pyx_v_k) != 0);
    if (__pyx_t_4) {
      __pyx_v_l = __pyx_v_i;
      goto __pyx_L13;
    }
    __pyx_L13:;

    /* "pandas/algos.pyx":793
 * 
 *         if j < k: l = i
 *         if k < i: m = j             # <<<<<<<<<<<<<<
 *     return a[k]
 * 
 */
    __pyx_t_4 = ((__pyx_v_k < __pyx_v_i) != 0);
    if (__pyx_t_4) {
      __pyx_v_m = __pyx_v_j;
      goto __pyx_L14;
    }
    __pyx_L14:;
  }

  /* "pandas/algos.pyx":794
 *         if j < k: l = i
 *         if k < i: m = j
 *     return a[k]             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_9 = __pyx_v_k;
  __pyx_r = (*((__pyx_t_5numpy_int32_t *) ( /* dim=0 */ (__pyx_v_a.data + __pyx_t_9 * __pyx_v_a.strides[0]) )));
  goto __pyx_L0;

  /* "pandas/algos.pyx":770
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * cpdef numeric kth_smallest(numeric[:] a, Py_ssize_t k):             # <<<<<<<<<<<<<<
 *     cdef:
 *         Py_ssize_t i, j, l, m, n = a.size
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_WriteUnraisable("pandas.algos.kth_smallest", __pyx_clineno, __pyx_lineno, __pyx_filename, 0);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_6pandas_5algos_517__pyx_fuse_2kth_smallest(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_fuse_2__pyx_mdef_6pandas_5algos_517__pyx_fuse_2kth_smallest = {__Pyx_NAMESTR("__pyx_fuse_2kth_smallest"), (PyCFunction)__pyx_pw_6pandas_5algos_517__pyx_fuse_2kth_smallest, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pw_6pandas_5algos_517__pyx_fuse_2kth_smallest(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  __Pyx_memviewslice __pyx_v_a = { 0, 0, { 0 }, { 0 }, { 0 } };
  Py_ssize_t __pyx_v_k;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__pyx_fuse_2kth_smallest (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_a,&__pyx_n_s_k,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_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 (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_a)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_k)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__pyx_fuse_2kth_smallest", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__pyx_fuse_2kth_smallest") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __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 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int32_t(values[0]); if (unlikely(!__pyx_v_a.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_v_k = __Pyx_PyIndex_AsSsize_t(values[1]); if (unlikely((__pyx_v_k == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__pyx_fuse_2kth_smallest", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas.algos.__pyx_fuse_2kth_smallest", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6pandas_5algos_516__pyx_fuse_2kth_smallest(__pyx_self, __pyx_v_a, __pyx_v_k);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pandas_5algos_516__pyx_fuse_2kth_smallest(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_a, 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("__pyx_fuse_2kth_smallest", 0);
  __Pyx_XDECREF(__pyx_r);
  if (unlikely(!__pyx_v_a.memview)) { __Pyx_RaiseUnboundLocalError("a"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
  __pyx_t_1 = __Pyx_PyInt_From_npy_int32(__pyx_fuse_2__pyx_f_6pandas_5algos_kth_smallest(__pyx_v_a, __pyx_v_k, 0)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __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;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pandas.algos.__pyx_fuse_2kth_smallest", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __PYX_XDEC_MEMVIEW(&__pyx_v_a, 1);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pw_6pandas_5algos_519__pyx_fuse_3kth_smallest(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pw_6pandas_5algos_15kth_smallest(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static __pyx_t_5numpy_int64_t __pyx_fuse_3__pyx_f_6pandas_5algos_kth_smallest(__Pyx_memviewslice __pyx_v_a, Py_ssize_t __pyx_v_k, CYTHON_UNUSED int __pyx_skip_dispatch) {
  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_int64_t __pyx_v_x;
  __pyx_t_5numpy_int64_t __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  Py_ssize_t __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;
  Py_ssize_t __pyx_t_8;
  Py_ssize_t __pyx_t_9;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__pyx_fuse_3kth_smallest", 0);

  /* "pandas/algos.pyx":772
 * cpdef numeric kth_smallest(numeric[:] a, Py_ssize_t k):
 *     cdef:
 *         Py_ssize_t i, j, l, m, n = a.size             # <<<<<<<<<<<<<<
 *         numeric x
 * 
 */
  __pyx_t_1 = __pyx_memoryview_fromslice(__pyx_v_a, 1, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_5numpy_int64_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_5numpy_int64_t, 0);; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 772; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_size); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 772; __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_PyIndex_AsSsize_t(__pyx_t_2); if (unlikely((__pyx_t_3 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 772; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_n = __pyx_t_3;

  /* "pandas/algos.pyx":775
 *         numeric x
 * 
 *     l = 0             # <<<<<<<<<<<<<<
 *     m = n - 1
 * 
 */
  __pyx_v_l = 0;

  /* "pandas/algos.pyx":776
 * 
 *     l = 0
 *     m = n - 1             # <<<<<<<<<<<<<<
 * 
 *     while l < m:
 */
  __pyx_v_m = (__pyx_v_n - 1);

  /* "pandas/algos.pyx":778
 *     m = n - 1
 * 
 *     while l < m:             # <<<<<<<<<<<<<<
 *         x = a[k]
 *         i = l
 */
  while (1) {
    __pyx_t_4 = ((__pyx_v_l < __pyx_v_m) != 0);
    if (!__pyx_t_4) break;

    /* "pandas/algos.pyx":779
 * 
 *     while l < m:
 *         x = a[k]             # <<<<<<<<<<<<<<
 *         i = l
 *         j = m
 */
    __pyx_t_3 = __pyx_v_k;
    __pyx_v_x = (*((__pyx_t_5numpy_int64_t *) ( /* dim=0 */ (__pyx_v_a.data + __pyx_t_3 * __pyx_v_a.strides[0]) )));

    /* "pandas/algos.pyx":780
 *     while l < m:
 *         x = a[k]
 *         i = l             # <<<<<<<<<<<<<<
 *         j = m
 * 
 */
    __pyx_v_i = __pyx_v_l;

    /* "pandas/algos.pyx":781
 *         x = a[k]
 *         i = l
 *         j = m             # <<<<<<<<<<<<<<
 * 
 *         while 1:
 */
    __pyx_v_j = __pyx_v_m;

    /* "pandas/algos.pyx":783
 *         j = m
 * 
 *         while 1:             # <<<<<<<<<<<<<<
 *             while a[i] < x: i += 1
 *             while x < a[j]: j -= 1
 */
    while (1) {

      /* "pandas/algos.pyx":784
 * 
 *         while 1:
 *             while a[i] < x: i += 1             # <<<<<<<<<<<<<<
 *             while x < a[j]: j -= 1
 *             if i <= j:
 */
      while (1) {
        __pyx_t_5 = __pyx_v_i;
        __pyx_t_4 = (((*((__pyx_t_5numpy_int64_t *) ( /* dim=0 */ (__pyx_v_a.data + __pyx_t_5 * __pyx_v_a.strides[0]) ))) < __pyx_v_x) != 0);
        if (!__pyx_t_4) break;
        __pyx_v_i = (__pyx_v_i + 1);
      }

      /* "pandas/algos.pyx":785
 *         while 1:
 *             while a[i] < x: i += 1
 *             while x < a[j]: j -= 1             # <<<<<<<<<<<<<<
 *             if i <= j:
 *                 swap(&a[i], &a[j])
 */
      while (1) {
        __pyx_t_6 = __pyx_v_j;
        __pyx_t_4 = ((__pyx_v_x < (*((__pyx_t_5numpy_int64_t *) ( /* dim=0 */ (__pyx_v_a.data + __pyx_t_6 * __pyx_v_a.strides[0]) )))) != 0);
        if (!__pyx_t_4) break;
        __pyx_v_j = (__pyx_v_j - 1);
      }

      /* "pandas/algos.pyx":786
 *             while a[i] < x: i += 1
 *             while x < a[j]: j -= 1
 *             if i <= j:             # <<<<<<<<<<<<<<
 *                 swap(&a[i], &a[j])
 *                 i += 1; j -= 1
 */
      __pyx_t_4 = ((__pyx_v_i <= __pyx_v_j) != 0);
      if (__pyx_t_4) {

        /* "pandas/algos.pyx":787
 *             while x < a[j]: j -= 1
 *             if i <= j:
 *                 swap(&a[i], &a[j])             # <<<<<<<<<<<<<<
 *                 i += 1; j -= 1
 * 
 */
        __pyx_t_7 = __pyx_v_i;
        __pyx_t_8 = __pyx_v_j;
        __pyx_t_9 = __pyx_fuse_3__pyx_f_6pandas_5algos_swap((&(*((__pyx_t_5numpy_int64_t *) ( /* dim=0 */ (__pyx_v_a.data + __pyx_t_7 * __pyx_v_a.strides[0]) )))), (&(*((__pyx_t_5numpy_int64_t *) ( /* dim=0 */ (__pyx_v_a.data + __pyx_t_8 * __pyx_v_a.strides[0]) ))))); if (unlikely(__pyx_t_9 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 787; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

        /* "pandas/algos.pyx":788
 *             if i <= j:
 *                 swap(&a[i], &a[j])
 *                 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:;

      /* "pandas/algos.pyx":790
 *                 i += 1; j -= 1
 * 
 *             if i > j: break             # <<<<<<<<<<<<<<
 * 
 *         if j < k: l = i
 */
      __pyx_t_4 = ((__pyx_v_i > __pyx_v_j) != 0);
      if (__pyx_t_4) {
        goto __pyx_L6_break;
      }
    }
    __pyx_L6_break:;

    /* "pandas/algos.pyx":792
 *             if i > j: break
 * 
 *         if j < k: l = i             # <<<<<<<<<<<<<<
 *         if k < i: m = j
 *     return a[k]
 */
    __pyx_t_4 = ((__pyx_v_j < __pyx_v_k) != 0);
    if (__pyx_t_4) {
      __pyx_v_l = __pyx_v_i;
      goto __pyx_L13;
    }
    __pyx_L13:;

    /* "pandas/algos.pyx":793
 * 
 *         if j < k: l = i
 *         if k < i: m = j             # <<<<<<<<<<<<<<
 *     return a[k]
 * 
 */
    __pyx_t_4 = ((__pyx_v_k < __pyx_v_i) != 0);
    if (__pyx_t_4) {
      __pyx_v_m = __pyx_v_j;
      goto __pyx_L14;
    }
    __pyx_L14:;
  }

  /* "pandas/algos.pyx":794
 *         if j < k: l = i
 *         if k < i: m = j
 *     return a[k]             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_9 = __pyx_v_k;
  __pyx_r = (*((__pyx_t_5numpy_int64_t *) ( /* dim=0 */ (__pyx_v_a.data + __pyx_t_9 * __pyx_v_a.strides[0]) )));
  goto __pyx_L0;

  /* "pandas/algos.pyx":770
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * cpdef numeric kth_smallest(numeric[:] a, Py_ssize_t k):             # <<<<<<<<<<<<<<
 *     cdef:
 *         Py_ssize_t i, j, l, m, n = a.size
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_WriteUnraisable("pandas.algos.kth_smallest", __pyx_clineno, __pyx_lineno, __pyx_filename, 0);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_6pandas_5algos_519__pyx_fuse_3kth_smallest(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_fuse_3__pyx_mdef_6pandas_5algos_519__pyx_fuse_3kth_smallest = {__Pyx_NAMESTR("__pyx_fuse_3kth_smallest"), (PyCFunction)__pyx_pw_6pandas_5algos_519__pyx_fuse_3kth_smallest, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pw_6pandas_5algos_519__pyx_fuse_3kth_smallest(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  __Pyx_memviewslice __pyx_v_a = { 0, 0, { 0 }, { 0 }, { 0 } };
  Py_ssize_t __pyx_v_k;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__pyx_fuse_3kth_smallest (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_a,&__pyx_n_s_k,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_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 (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_a)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_k)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__pyx_fuse_3kth_smallest", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__pyx_fuse_3kth_smallest") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __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 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int64_t(values[0]); if (unlikely(!__pyx_v_a.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_v_k = __Pyx_PyIndex_AsSsize_t(values[1]); if (unlikely((__pyx_v_k == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__pyx_fuse_3kth_smallest", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas.algos.__pyx_fuse_3kth_smallest", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6pandas_5algos_518__pyx_fuse_3kth_smallest(__pyx_self, __pyx_v_a, __pyx_v_k);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pandas_5algos_518__pyx_fuse_3kth_smallest(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_a, 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("__pyx_fuse_3kth_smallest", 0);
  __Pyx_XDECREF(__pyx_r);
  if (unlikely(!__pyx_v_a.memview)) { __Pyx_RaiseUnboundLocalError("a"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
  __pyx_t_1 = __Pyx_PyInt_From_npy_int64(__pyx_fuse_3__pyx_f_6pandas_5algos_kth_smallest(__pyx_v_a, __pyx_v_k, 0)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __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;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pandas.algos.__pyx_fuse_3kth_smallest", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __PYX_XDEC_MEMVIEW(&__pyx_v_a, 1);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pw_6pandas_5algos_521__pyx_fuse_4kth_smallest(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pw_6pandas_5algos_15kth_smallest(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static __pyx_t_5numpy_uint8_t __pyx_fuse_4__pyx_f_6pandas_5algos_kth_smallest(__Pyx_memviewslice __pyx_v_a, Py_ssize_t __pyx_v_k, CYTHON_UNUSED int __pyx_skip_dispatch) {
  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_uint8_t __pyx_v_x;
  __pyx_t_5numpy_uint8_t __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  Py_ssize_t __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;
  Py_ssize_t __pyx_t_8;
  Py_ssize_t __pyx_t_9;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__pyx_fuse_4kth_smallest", 0);

  /* "pandas/algos.pyx":772
 * cpdef numeric kth_smallest(numeric[:] a, Py_ssize_t k):
 *     cdef:
 *         Py_ssize_t i, j, l, m, n = a.size             # <<<<<<<<<<<<<<
 *         numeric x
 * 
 */
  __pyx_t_1 = __pyx_memoryview_fromslice(__pyx_v_a, 1, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_5numpy_uint8_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_5numpy_uint8_t, 0);; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 772; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_size); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 772; __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_PyIndex_AsSsize_t(__pyx_t_2); if (unlikely((__pyx_t_3 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 772; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_n = __pyx_t_3;

  /* "pandas/algos.pyx":775
 *         numeric x
 * 
 *     l = 0             # <<<<<<<<<<<<<<
 *     m = n - 1
 * 
 */
  __pyx_v_l = 0;

  /* "pandas/algos.pyx":776
 * 
 *     l = 0
 *     m = n - 1             # <<<<<<<<<<<<<<
 * 
 *     while l < m:
 */
  __pyx_v_m = (__pyx_v_n - 1);

  /* "pandas/algos.pyx":778
 *     m = n - 1
 * 
 *     while l < m:             # <<<<<<<<<<<<<<
 *         x = a[k]
 *         i = l
 */
  while (1) {
    __pyx_t_4 = ((__pyx_v_l < __pyx_v_m) != 0);
    if (!__pyx_t_4) break;

    /* "pandas/algos.pyx":779
 * 
 *     while l < m:
 *         x = a[k]             # <<<<<<<<<<<<<<
 *         i = l
 *         j = m
 */
    __pyx_t_3 = __pyx_v_k;
    __pyx_v_x = (*((__pyx_t_5numpy_uint8_t *) ( /* dim=0 */ (__pyx_v_a.data + __pyx_t_3 * __pyx_v_a.strides[0]) )));

    /* "pandas/algos.pyx":780
 *     while l < m:
 *         x = a[k]
 *         i = l             # <<<<<<<<<<<<<<
 *         j = m
 * 
 */
    __pyx_v_i = __pyx_v_l;

    /* "pandas/algos.pyx":781
 *         x = a[k]
 *         i = l
 *         j = m             # <<<<<<<<<<<<<<
 * 
 *         while 1:
 */
    __pyx_v_j = __pyx_v_m;

    /* "pandas/algos.pyx":783
 *         j = m
 * 
 *         while 1:             # <<<<<<<<<<<<<<
 *             while a[i] < x: i += 1
 *             while x < a[j]: j -= 1
 */
    while (1) {

      /* "pandas/algos.pyx":784
 * 
 *         while 1:
 *             while a[i] < x: i += 1             # <<<<<<<<<<<<<<
 *             while x < a[j]: j -= 1
 *             if i <= j:
 */
      while (1) {
        __pyx_t_5 = __pyx_v_i;
        __pyx_t_4 = (((*((__pyx_t_5numpy_uint8_t *) ( /* dim=0 */ (__pyx_v_a.data + __pyx_t_5 * __pyx_v_a.strides[0]) ))) < __pyx_v_x) != 0);
        if (!__pyx_t_4) break;
        __pyx_v_i = (__pyx_v_i + 1);
      }

      /* "pandas/algos.pyx":785
 *         while 1:
 *             while a[i] < x: i += 1
 *             while x < a[j]: j -= 1             # <<<<<<<<<<<<<<
 *             if i <= j:
 *                 swap(&a[i], &a[j])
 */
      while (1) {
        __pyx_t_6 = __pyx_v_j;
        __pyx_t_4 = ((__pyx_v_x < (*((__pyx_t_5numpy_uint8_t *) ( /* dim=0 */ (__pyx_v_a.data + __pyx_t_6 * __pyx_v_a.strides[0]) )))) != 0);
        if (!__pyx_t_4) break;
        __pyx_v_j = (__pyx_v_j - 1);
      }

      /* "pandas/algos.pyx":786
 *             while a[i] < x: i += 1
 *             while x < a[j]: j -= 1
 *             if i <= j:             # <<<<<<<<<<<<<<
 *                 swap(&a[i], &a[j])
 *                 i += 1; j -= 1
 */
      __pyx_t_4 = ((__pyx_v_i <= __pyx_v_j) != 0);
      if (__pyx_t_4) {

        /* "pandas/algos.pyx":787
 *             while x < a[j]: j -= 1
 *             if i <= j:
 *                 swap(&a[i], &a[j])             # <<<<<<<<<<<<<<
 *                 i += 1; j -= 1
 * 
 */
        __pyx_t_7 = __pyx_v_i;
        __pyx_t_8 = __pyx_v_j;
        __pyx_t_9 = __pyx_fuse_4__pyx_f_6pandas_5algos_swap((&(*((__pyx_t_5numpy_uint8_t *) ( /* dim=0 */ (__pyx_v_a.data + __pyx_t_7 * __pyx_v_a.strides[0]) )))), (&(*((__pyx_t_5numpy_uint8_t *) ( /* dim=0 */ (__pyx_v_a.data + __pyx_t_8 * __pyx_v_a.strides[0]) ))))); if (unlikely(__pyx_t_9 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 787; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

        /* "pandas/algos.pyx":788
 *             if i <= j:
 *                 swap(&a[i], &a[j])
 *                 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:;

      /* "pandas/algos.pyx":790
 *                 i += 1; j -= 1
 * 
 *             if i > j: break             # <<<<<<<<<<<<<<
 * 
 *         if j < k: l = i
 */
      __pyx_t_4 = ((__pyx_v_i > __pyx_v_j) != 0);
      if (__pyx_t_4) {
        goto __pyx_L6_break;
      }
    }
    __pyx_L6_break:;

    /* "pandas/algos.pyx":792
 *             if i > j: break
 * 
 *         if j < k: l = i             # <<<<<<<<<<<<<<
 *         if k < i: m = j
 *     return a[k]
 */
    __pyx_t_4 = ((__pyx_v_j < __pyx_v_k) != 0);
    if (__pyx_t_4) {
      __pyx_v_l = __pyx_v_i;
      goto __pyx_L13;
    }
    __pyx_L13:;

    /* "pandas/algos.pyx":793
 * 
 *         if j < k: l = i
 *         if k < i: m = j             # <<<<<<<<<<<<<<
 *     return a[k]
 * 
 */
    __pyx_t_4 = ((__pyx_v_k < __pyx_v_i) != 0);
    if (__pyx_t_4) {
      __pyx_v_m = __pyx_v_j;
      goto __pyx_L14;
    }
    __pyx_L14:;
  }

  /* "pandas/algos.pyx":794
 *         if j < k: l = i
 *         if k < i: m = j
 *     return a[k]             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_9 = __pyx_v_k;
  __pyx_r = (*((__pyx_t_5numpy_uint8_t *) ( /* dim=0 */ (__pyx_v_a.data + __pyx_t_9 * __pyx_v_a.strides[0]) )));
  goto __pyx_L0;

  /* "pandas/algos.pyx":770
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * cpdef numeric kth_smallest(numeric[:] a, Py_ssize_t k):             # <<<<<<<<<<<<<<
 *     cdef:
 *         Py_ssize_t i, j, l, m, n = a.size
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_WriteUnraisable("pandas.algos.kth_smallest", __pyx_clineno, __pyx_lineno, __pyx_filename, 0);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_6pandas_5algos_521__pyx_fuse_4kth_smallest(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_fuse_4__pyx_mdef_6pandas_5algos_521__pyx_fuse_4kth_smallest = {__Pyx_NAMESTR("__pyx_fuse_4kth_smallest"), (PyCFunction)__pyx_pw_6pandas_5algos_521__pyx_fuse_4kth_smallest, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pw_6pandas_5algos_521__pyx_fuse_4kth_smallest(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  __Pyx_memviewslice __pyx_v_a = { 0, 0, { 0 }, { 0 }, { 0 } };
  Py_ssize_t __pyx_v_k;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__pyx_fuse_4kth_smallest (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_a,&__pyx_n_s_k,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_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 (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_a)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_k)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__pyx_fuse_4kth_smallest", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__pyx_fuse_4kth_smallest") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __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 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_uint8_t(values[0]); if (unlikely(!__pyx_v_a.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_v_k = __Pyx_PyIndex_AsSsize_t(values[1]); if (unlikely((__pyx_v_k == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__pyx_fuse_4kth_smallest", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas.algos.__pyx_fuse_4kth_smallest", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6pandas_5algos_520__pyx_fuse_4kth_smallest(__pyx_self, __pyx_v_a, __pyx_v_k);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pandas_5algos_520__pyx_fuse_4kth_smallest(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_a, 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("__pyx_fuse_4kth_smallest", 0);
  __Pyx_XDECREF(__pyx_r);
  if (unlikely(!__pyx_v_a.memview)) { __Pyx_RaiseUnboundLocalError("a"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
  __pyx_t_1 = __Pyx_PyInt_From_npy_uint8(__pyx_fuse_4__pyx_f_6pandas_5algos_kth_smallest(__pyx_v_a, __pyx_v_k, 0)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __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;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pandas.algos.__pyx_fuse_4kth_smallest", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __PYX_XDEC_MEMVIEW(&__pyx_v_a, 1);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pw_6pandas_5algos_523__pyx_fuse_5kth_smallest(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pw_6pandas_5algos_15kth_smallest(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static __pyx_t_5numpy_uint16_t __pyx_fuse_5__pyx_f_6pandas_5algos_kth_smallest(__Pyx_memviewslice __pyx_v_a, Py_ssize_t __pyx_v_k, CYTHON_UNUSED int __pyx_skip_dispatch) {
  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_uint16_t __pyx_v_x;
  __pyx_t_5numpy_uint16_t __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  Py_ssize_t __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;
  Py_ssize_t __pyx_t_8;
  Py_ssize_t __pyx_t_9;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__pyx_fuse_5kth_smallest", 0);

  /* "pandas/algos.pyx":772
 * cpdef numeric kth_smallest(numeric[:] a, Py_ssize_t k):
 *     cdef:
 *         Py_ssize_t i, j, l, m, n = a.size             # <<<<<<<<<<<<<<
 *         numeric x
 * 
 */
  __pyx_t_1 = __pyx_memoryview_fromslice(__pyx_v_a, 1, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_5numpy_uint16_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_5numpy_uint16_t, 0);; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 772; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_size); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 772; __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_PyIndex_AsSsize_t(__pyx_t_2); if (unlikely((__pyx_t_3 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 772; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_n = __pyx_t_3;

  /* "pandas/algos.pyx":775
 *         numeric x
 * 
 *     l = 0             # <<<<<<<<<<<<<<
 *     m = n - 1
 * 
 */
  __pyx_v_l = 0;

  /* "pandas/algos.pyx":776
 * 
 *     l = 0
 *     m = n - 1             # <<<<<<<<<<<<<<
 * 
 *     while l < m:
 */
  __pyx_v_m = (__pyx_v_n - 1);

  /* "pandas/algos.pyx":778
 *     m = n - 1
 * 
 *     while l < m:             # <<<<<<<<<<<<<<
 *         x = a[k]
 *         i = l
 */
  while (1) {
    __pyx_t_4 = ((__pyx_v_l < __pyx_v_m) != 0);
    if (!__pyx_t_4) break;

    /* "pandas/algos.pyx":779
 * 
 *     while l < m:
 *         x = a[k]             # <<<<<<<<<<<<<<
 *         i = l
 *         j = m
 */
    __pyx_t_3 = __pyx_v_k;
    __pyx_v_x = (*((__pyx_t_5numpy_uint16_t *) ( /* dim=0 */ (__pyx_v_a.data + __pyx_t_3 * __pyx_v_a.strides[0]) )));

    /* "pandas/algos.pyx":780
 *     while l < m:
 *         x = a[k]
 *         i = l             # <<<<<<<<<<<<<<
 *         j = m
 * 
 */
    __pyx_v_i = __pyx_v_l;

    /* "pandas/algos.pyx":781
 *         x = a[k]
 *         i = l
 *         j = m             # <<<<<<<<<<<<<<
 * 
 *         while 1:
 */
    __pyx_v_j = __pyx_v_m;

    /* "pandas/algos.pyx":783
 *         j = m
 * 
 *         while 1:             # <<<<<<<<<<<<<<
 *             while a[i] < x: i += 1
 *             while x < a[j]: j -= 1
 */
    while (1) {

      /* "pandas/algos.pyx":784
 * 
 *         while 1:
 *             while a[i] < x: i += 1             # <<<<<<<<<<<<<<
 *             while x < a[j]: j -= 1
 *             if i <= j:
 */
      while (1) {
        __pyx_t_5 = __pyx_v_i;
        __pyx_t_4 = (((*((__pyx_t_5numpy_uint16_t *) ( /* dim=0 */ (__pyx_v_a.data + __pyx_t_5 * __pyx_v_a.strides[0]) ))) < __pyx_v_x) != 0);
        if (!__pyx_t_4) break;
        __pyx_v_i = (__pyx_v_i + 1);
      }

      /* "pandas/algos.pyx":785
 *         while 1:
 *             while a[i] < x: i += 1
 *             while x < a[j]: j -= 1             # <<<<<<<<<<<<<<
 *             if i <= j:
 *                 swap(&a[i], &a[j])
 */
      while (1) {
        __pyx_t_6 = __pyx_v_j;
        __pyx_t_4 = ((__pyx_v_x < (*((__pyx_t_5numpy_uint16_t *) ( /* dim=0 */ (__pyx_v_a.data + __pyx_t_6 * __pyx_v_a.strides[0]) )))) != 0);
        if (!__pyx_t_4) break;
        __pyx_v_j = (__pyx_v_j - 1);
      }

      /* "pandas/algos.pyx":786
 *             while a[i] < x: i += 1
 *             while x < a[j]: j -= 1
 *             if i <= j:             # <<<<<<<<<<<<<<
 *                 swap(&a[i], &a[j])
 *                 i += 1; j -= 1
 */
      __pyx_t_4 = ((__pyx_v_i <= __pyx_v_j) != 0);
      if (__pyx_t_4) {

        /* "pandas/algos.pyx":787
 *             while x < a[j]: j -= 1
 *             if i <= j:
 *                 swap(&a[i], &a[j])             # <<<<<<<<<<<<<<
 *                 i += 1; j -= 1
 * 
 */
        __pyx_t_7 = __pyx_v_i;
        __pyx_t_8 = __pyx_v_j;
        __pyx_t_9 = __pyx_fuse_5__pyx_f_6pandas_5algos_swap((&(*((__pyx_t_5numpy_uint16_t *) ( /* dim=0 */ (__pyx_v_a.data + __pyx_t_7 * __pyx_v_a.strides[0]) )))), (&(*((__pyx_t_5numpy_uint16_t *) ( /* dim=0 */ (__pyx_v_a.data + __pyx_t_8 * __pyx_v_a.strides[0]) ))))); if (unlikely(__pyx_t_9 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 787; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

        /* "pandas/algos.pyx":788
 *             if i <= j:
 *                 swap(&a[i], &a[j])
 *                 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:;

      /* "pandas/algos.pyx":790
 *                 i += 1; j -= 1
 * 
 *             if i > j: break             # <<<<<<<<<<<<<<
 * 
 *         if j < k: l = i
 */
      __pyx_t_4 = ((__pyx_v_i > __pyx_v_j) != 0);
      if (__pyx_t_4) {
        goto __pyx_L6_break;
      }
    }
    __pyx_L6_break:;

    /* "pandas/algos.pyx":792
 *             if i > j: break
 * 
 *         if j < k: l = i             # <<<<<<<<<<<<<<
 *         if k < i: m = j
 *     return a[k]
 */
    __pyx_t_4 = ((__pyx_v_j < __pyx_v_k) != 0);
    if (__pyx_t_4) {
      __pyx_v_l = __pyx_v_i;
      goto __pyx_L13;
    }
    __pyx_L13:;

    /* "pandas/algos.pyx":793
 * 
 *         if j < k: l = i
 *         if k < i: m = j             # <<<<<<<<<<<<<<
 *     return a[k]
 * 
 */
    __pyx_t_4 = ((__pyx_v_k < __pyx_v_i) != 0);
    if (__pyx_t_4) {
      __pyx_v_m = __pyx_v_j;
      goto __pyx_L14;
    }
    __pyx_L14:;
  }

  /* "pandas/algos.pyx":794
 *         if j < k: l = i
 *         if k < i: m = j
 *     return a[k]             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_9 = __pyx_v_k;
  __pyx_r = (*((__pyx_t_5numpy_uint16_t *) ( /* dim=0 */ (__pyx_v_a.data + __pyx_t_9 * __pyx_v_a.strides[0]) )));
  goto __pyx_L0;

  /* "pandas/algos.pyx":770
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * cpdef numeric kth_smallest(numeric[:] a, Py_ssize_t k):             # <<<<<<<<<<<<<<
 *     cdef:
 *         Py_ssize_t i, j, l, m, n = a.size
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_WriteUnraisable("pandas.algos.kth_smallest", __pyx_clineno, __pyx_lineno, __pyx_filename, 0);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_6pandas_5algos_523__pyx_fuse_5kth_smallest(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_fuse_5__pyx_mdef_6pandas_5algos_523__pyx_fuse_5kth_smallest = {__Pyx_NAMESTR("__pyx_fuse_5kth_smallest"), (PyCFunction)__pyx_pw_6pandas_5algos_523__pyx_fuse_5kth_smallest, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pw_6pandas_5algos_523__pyx_fuse_5kth_smallest(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  __Pyx_memviewslice __pyx_v_a = { 0, 0, { 0 }, { 0 }, { 0 } };
  Py_ssize_t __pyx_v_k;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__pyx_fuse_5kth_smallest (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_a,&__pyx_n_s_k,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_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 (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_a)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_k)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__pyx_fuse_5kth_smallest", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__pyx_fuse_5kth_smallest") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __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 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_uint16_t(values[0]); if (unlikely(!__pyx_v_a.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_v_k = __Pyx_PyIndex_AsSsize_t(values[1]); if (unlikely((__pyx_v_k == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__pyx_fuse_5kth_smallest", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas.algos.__pyx_fuse_5kth_smallest", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6pandas_5algos_522__pyx_fuse_5kth_smallest(__pyx_self, __pyx_v_a, __pyx_v_k);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pandas_5algos_522__pyx_fuse_5kth_smallest(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_a, 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("__pyx_fuse_5kth_smallest", 0);
  __Pyx_XDECREF(__pyx_r);
  if (unlikely(!__pyx_v_a.memview)) { __Pyx_RaiseUnboundLocalError("a"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
  __pyx_t_1 = __Pyx_PyInt_From_npy_uint16(__pyx_fuse_5__pyx_f_6pandas_5algos_kth_smallest(__pyx_v_a, __pyx_v_k, 0)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __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;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pandas.algos.__pyx_fuse_5kth_smallest", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __PYX_XDEC_MEMVIEW(&__pyx_v_a, 1);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pw_6pandas_5algos_525__pyx_fuse_6kth_smallest(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pw_6pandas_5algos_15kth_smallest(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static __pyx_t_5numpy_uint32_t __pyx_fuse_6__pyx_f_6pandas_5algos_kth_smallest(__Pyx_memviewslice __pyx_v_a, Py_ssize_t __pyx_v_k, CYTHON_UNUSED int __pyx_skip_dispatch) {
  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_uint32_t __pyx_v_x;
  __pyx_t_5numpy_uint32_t __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  Py_ssize_t __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;
  Py_ssize_t __pyx_t_8;
  Py_ssize_t __pyx_t_9;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__pyx_fuse_6kth_smallest", 0);

  /* "pandas/algos.pyx":772
 * cpdef numeric kth_smallest(numeric[:] a, Py_ssize_t k):
 *     cdef:
 *         Py_ssize_t i, j, l, m, n = a.size             # <<<<<<<<<<<<<<
 *         numeric x
 * 
 */
  __pyx_t_1 = __pyx_memoryview_fromslice(__pyx_v_a, 1, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_5numpy_uint32_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_5numpy_uint32_t, 0);; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 772; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_size); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 772; __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_PyIndex_AsSsize_t(__pyx_t_2); if (unlikely((__pyx_t_3 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 772; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_n = __pyx_t_3;

  /* "pandas/algos.pyx":775
 *         numeric x
 * 
 *     l = 0             # <<<<<<<<<<<<<<
 *     m = n - 1
 * 
 */
  __pyx_v_l = 0;

  /* "pandas/algos.pyx":776
 * 
 *     l = 0
 *     m = n - 1             # <<<<<<<<<<<<<<
 * 
 *     while l < m:
 */
  __pyx_v_m = (__pyx_v_n - 1);

  /* "pandas/algos.pyx":778
 *     m = n - 1
 * 
 *     while l < m:             # <<<<<<<<<<<<<<
 *         x = a[k]
 *         i = l
 */
  while (1) {
    __pyx_t_4 = ((__pyx_v_l < __pyx_v_m) != 0);
    if (!__pyx_t_4) break;

    /* "pandas/algos.pyx":779
 * 
 *     while l < m:
 *         x = a[k]             # <<<<<<<<<<<<<<
 *         i = l
 *         j = m
 */
    __pyx_t_3 = __pyx_v_k;
    __pyx_v_x = (*((__pyx_t_5numpy_uint32_t *) ( /* dim=0 */ (__pyx_v_a.data + __pyx_t_3 * __pyx_v_a.strides[0]) )));

    /* "pandas/algos.pyx":780
 *     while l < m:
 *         x = a[k]
 *         i = l             # <<<<<<<<<<<<<<
 *         j = m
 * 
 */
    __pyx_v_i = __pyx_v_l;

    /* "pandas/algos.pyx":781
 *         x = a[k]
 *         i = l
 *         j = m             # <<<<<<<<<<<<<<
 * 
 *         while 1:
 */
    __pyx_v_j = __pyx_v_m;

    /* "pandas/algos.pyx":783
 *         j = m
 * 
 *         while 1:             # <<<<<<<<<<<<<<
 *             while a[i] < x: i += 1
 *             while x < a[j]: j -= 1
 */
    while (1) {

      /* "pandas/algos.pyx":784
 * 
 *         while 1:
 *             while a[i] < x: i += 1             # <<<<<<<<<<<<<<
 *             while x < a[j]: j -= 1
 *             if i <= j:
 */
      while (1) {
        __pyx_t_5 = __pyx_v_i;
        __pyx_t_4 = (((*((__pyx_t_5numpy_uint32_t *) ( /* dim=0 */ (__pyx_v_a.data + __pyx_t_5 * __pyx_v_a.strides[0]) ))) < __pyx_v_x) != 0);
        if (!__pyx_t_4) break;
        __pyx_v_i = (__pyx_v_i + 1);
      }

      /* "pandas/algos.pyx":785
 *         while 1:
 *             while a[i] < x: i += 1
 *             while x < a[j]: j -= 1             # <<<<<<<<<<<<<<
 *             if i <= j:
 *                 swap(&a[i], &a[j])
 */
      while (1) {
        __pyx_t_6 = __pyx_v_j;
        __pyx_t_4 = ((__pyx_v_x < (*((__pyx_t_5numpy_uint32_t *) ( /* dim=0 */ (__pyx_v_a.data + __pyx_t_6 * __pyx_v_a.strides[0]) )))) != 0);
        if (!__pyx_t_4) break;
        __pyx_v_j = (__pyx_v_j - 1);
      }

      /* "pandas/algos.pyx":786
 *             while a[i] < x: i += 1
 *             while x < a[j]: j -= 1
 *             if i <= j:             # <<<<<<<<<<<<<<
 *                 swap(&a[i], &a[j])
 *                 i += 1; j -= 1
 */
      __pyx_t_4 = ((__pyx_v_i <= __pyx_v_j) != 0);
      if (__pyx_t_4) {

        /* "pandas/algos.pyx":787
 *             while x < a[j]: j -= 1
 *             if i <= j:
 *                 swap(&a[i], &a[j])             # <<<<<<<<<<<<<<
 *                 i += 1; j -= 1
 * 
 */
        __pyx_t_7 = __pyx_v_i;
        __pyx_t_8 = __pyx_v_j;
        __pyx_t_9 = __pyx_fuse_6__pyx_f_6pandas_5algos_swap((&(*((__pyx_t_5numpy_uint32_t *) ( /* dim=0 */ (__pyx_v_a.data + __pyx_t_7 * __pyx_v_a.strides[0]) )))), (&(*((__pyx_t_5numpy_uint32_t *) ( /* dim=0 */ (__pyx_v_a.data + __pyx_t_8 * __pyx_v_a.strides[0]) ))))); if (unlikely(__pyx_t_9 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 787; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

        /* "pandas/algos.pyx":788
 *             if i <= j:
 *                 swap(&a[i], &a[j])
 *                 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:;

      /* "pandas/algos.pyx":790
 *                 i += 1; j -= 1
 * 
 *             if i > j: break             # <<<<<<<<<<<<<<
 * 
 *         if j < k: l = i
 */
      __pyx_t_4 = ((__pyx_v_i > __pyx_v_j) != 0);
      if (__pyx_t_4) {
        goto __pyx_L6_break;
      }
    }
    __pyx_L6_break:;

    /* "pandas/algos.pyx":792
 *             if i > j: break
 * 
 *         if j < k: l = i             # <<<<<<<<<<<<<<
 *         if k < i: m = j
 *     return a[k]
 */
    __pyx_t_4 = ((__pyx_v_j < __pyx_v_k) != 0);
    if (__pyx_t_4) {
      __pyx_v_l = __pyx_v_i;
      goto __pyx_L13;
    }
    __pyx_L13:;

    /* "pandas/algos.pyx":793
 * 
 *         if j < k: l = i
 *         if k < i: m = j             # <<<<<<<<<<<<<<
 *     return a[k]
 * 
 */
    __pyx_t_4 = ((__pyx_v_k < __pyx_v_i) != 0);
    if (__pyx_t_4) {
      __pyx_v_m = __pyx_v_j;
      goto __pyx_L14;
    }
    __pyx_L14:;
  }

  /* "pandas/algos.pyx":794
 *         if j < k: l = i
 *         if k < i: m = j
 *     return a[k]             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_9 = __pyx_v_k;
  __pyx_r = (*((__pyx_t_5numpy_uint32_t *) ( /* dim=0 */ (__pyx_v_a.data + __pyx_t_9 * __pyx_v_a.strides[0]) )));
  goto __pyx_L0;

  /* "pandas/algos.pyx":770
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * cpdef numeric kth_smallest(numeric[:] a, Py_ssize_t k):             # <<<<<<<<<<<<<<
 *     cdef:
 *         Py_ssize_t i, j, l, m, n = a.size
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_WriteUnraisable("pandas.algos.kth_smallest", __pyx_clineno, __pyx_lineno, __pyx_filename, 0);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_6pandas_5algos_525__pyx_fuse_6kth_smallest(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_fuse_6__pyx_mdef_6pandas_5algos_525__pyx_fuse_6kth_smallest = {__Pyx_NAMESTR("__pyx_fuse_6kth_smallest"), (PyCFunction)__pyx_pw_6pandas_5algos_525__pyx_fuse_6kth_smallest, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pw_6pandas_5algos_525__pyx_fuse_6kth_smallest(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  __Pyx_memviewslice __pyx_v_a = { 0, 0, { 0 }, { 0 }, { 0 } };
  Py_ssize_t __pyx_v_k;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__pyx_fuse_6kth_smallest (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_a,&__pyx_n_s_k,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_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 (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_a)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_k)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__pyx_fuse_6kth_smallest", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__pyx_fuse_6kth_smallest") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __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 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_uint32_t(values[0]); if (unlikely(!__pyx_v_a.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_v_k = __Pyx_PyIndex_AsSsize_t(values[1]); if (unlikely((__pyx_v_k == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__pyx_fuse_6kth_smallest", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas.algos.__pyx_fuse_6kth_smallest", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6pandas_5algos_524__pyx_fuse_6kth_smallest(__pyx_self, __pyx_v_a, __pyx_v_k);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pandas_5algos_524__pyx_fuse_6kth_smallest(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_a, 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("__pyx_fuse_6kth_smallest", 0);
  __Pyx_XDECREF(__pyx_r);
  if (unlikely(!__pyx_v_a.memview)) { __Pyx_RaiseUnboundLocalError("a"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
  __pyx_t_1 = __Pyx_PyInt_From_npy_uint32(__pyx_fuse_6__pyx_f_6pandas_5algos_kth_smallest(__pyx_v_a, __pyx_v_k, 0)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __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;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pandas.algos.__pyx_fuse_6kth_smallest", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __PYX_XDEC_MEMVIEW(&__pyx_v_a, 1);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pw_6pandas_5algos_527__pyx_fuse_7kth_smallest(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pw_6pandas_5algos_15kth_smallest(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static __pyx_t_5numpy_uint64_t __pyx_fuse_7__pyx_f_6pandas_5algos_kth_smallest(__Pyx_memviewslice __pyx_v_a, Py_ssize_t __pyx_v_k, CYTHON_UNUSED int __pyx_skip_dispatch) {
  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_uint64_t __pyx_v_x;
  __pyx_t_5numpy_uint64_t __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  Py_ssize_t __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;
  Py_ssize_t __pyx_t_8;
  Py_ssize_t __pyx_t_9;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__pyx_fuse_7kth_smallest", 0);

  /* "pandas/algos.pyx":772
 * cpdef numeric kth_smallest(numeric[:] a, Py_ssize_t k):
 *     cdef:
 *         Py_ssize_t i, j, l, m, n = a.size             # <<<<<<<<<<<<<<
 *         numeric x
 * 
 */
  __pyx_t_1 = __pyx_memoryview_fromslice(__pyx_v_a, 1, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_5numpy_uint64_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_5numpy_uint64_t, 0);; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 772; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_size); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 772; __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_PyIndex_AsSsize_t(__pyx_t_2); if (unlikely((__pyx_t_3 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 772; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_n = __pyx_t_3;

  /* "pandas/algos.pyx":775
 *         numeric x
 * 
 *     l = 0             # <<<<<<<<<<<<<<
 *     m = n - 1
 * 
 */
  __pyx_v_l = 0;

  /* "pandas/algos.pyx":776
 * 
 *     l = 0
 *     m = n - 1             # <<<<<<<<<<<<<<
 * 
 *     while l < m:
 */
  __pyx_v_m = (__pyx_v_n - 1);

  /* "pandas/algos.pyx":778
 *     m = n - 1
 * 
 *     while l < m:             # <<<<<<<<<<<<<<
 *         x = a[k]
 *         i = l
 */
  while (1) {
    __pyx_t_4 = ((__pyx_v_l < __pyx_v_m) != 0);
    if (!__pyx_t_4) break;

    /* "pandas/algos.pyx":779
 * 
 *     while l < m:
 *         x = a[k]             # <<<<<<<<<<<<<<
 *         i = l
 *         j = m
 */
    __pyx_t_3 = __pyx_v_k;
    __pyx_v_x = (*((__pyx_t_5numpy_uint64_t *) ( /* dim=0 */ (__pyx_v_a.data + __pyx_t_3 * __pyx_v_a.strides[0]) )));

    /* "pandas/algos.pyx":780
 *     while l < m:
 *         x = a[k]
 *         i = l             # <<<<<<<<<<<<<<
 *         j = m
 * 
 */
    __pyx_v_i = __pyx_v_l;

    /* "pandas/algos.pyx":781
 *         x = a[k]
 *         i = l
 *         j = m             # <<<<<<<<<<<<<<
 * 
 *         while 1:
 */
    __pyx_v_j = __pyx_v_m;

    /* "pandas/algos.pyx":783
 *         j = m
 * 
 *         while 1:             # <<<<<<<<<<<<<<
 *             while a[i] < x: i += 1
 *             while x < a[j]: j -= 1
 */
    while (1) {

      /* "pandas/algos.pyx":784
 * 
 *         while 1:
 *             while a[i] < x: i += 1             # <<<<<<<<<<<<<<
 *             while x < a[j]: j -= 1
 *             if i <= j:
 */
      while (1) {
        __pyx_t_5 = __pyx_v_i;
        __pyx_t_4 = (((*((__pyx_t_5numpy_uint64_t *) ( /* dim=0 */ (__pyx_v_a.data + __pyx_t_5 * __pyx_v_a.strides[0]) ))) < __pyx_v_x) != 0);
        if (!__pyx_t_4) break;
        __pyx_v_i = (__pyx_v_i + 1);
      }

      /* "pandas/algos.pyx":785
 *         while 1:
 *             while a[i] < x: i += 1
 *             while x < a[j]: j -= 1             # <<<<<<<<<<<<<<
 *             if i <= j:
 *                 swap(&a[i], &a[j])
 */
      while (1) {
        __pyx_t_6 = __pyx_v_j;
        __pyx_t_4 = ((__pyx_v_x < (*((__pyx_t_5numpy_uint64_t *) ( /* dim=0 */ (__pyx_v_a.data + __pyx_t_6 * __pyx_v_a.strides[0]) )))) != 0);
        if (!__pyx_t_4) break;
        __pyx_v_j = (__pyx_v_j - 1);
      }

      /* "pandas/algos.pyx":786
 *             while a[i] < x: i += 1
 *             while x < a[j]: j -= 1
 *             if i <= j:             # <<<<<<<<<<<<<<
 *                 swap(&a[i], &a[j])
 *                 i += 1; j -= 1
 */
      __pyx_t_4 = ((__pyx_v_i <= __pyx_v_j) != 0);
      if (__pyx_t_4) {

        /* "pandas/algos.pyx":787
 *             while x < a[j]: j -= 1
 *             if i <= j:
 *                 swap(&a[i], &a[j])             # <<<<<<<<<<<<<<
 *                 i += 1; j -= 1
 * 
 */
        __pyx_t_7 = __pyx_v_i;
        __pyx_t_8 = __pyx_v_j;
        __pyx_t_9 = __pyx_fuse_7__pyx_f_6pandas_5algos_swap((&(*((__pyx_t_5numpy_uint64_t *) ( /* dim=0 */ (__pyx_v_a.data + __pyx_t_7 * __pyx_v_a.strides[0]) )))), (&(*((__pyx_t_5numpy_uint64_t *) ( /* dim=0 */ (__pyx_v_a.data + __pyx_t_8 * __pyx_v_a.strides[0]) ))))); if (unlikely(__pyx_t_9 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 787; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

        /* "pandas/algos.pyx":788
 *             if i <= j:
 *                 swap(&a[i], &a[j])
 *                 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:;

      /* "pandas/algos.pyx":790
 *                 i += 1; j -= 1
 * 
 *             if i > j: break             # <<<<<<<<<<<<<<
 * 
 *         if j < k: l = i
 */
      __pyx_t_4 = ((__pyx_v_i > __pyx_v_j) != 0);
      if (__pyx_t_4) {
        goto __pyx_L6_break;
      }
    }
    __pyx_L6_break:;

    /* "pandas/algos.pyx":792
 *             if i > j: break
 * 
 *         if j < k: l = i             # <<<<<<<<<<<<<<
 *         if k < i: m = j
 *     return a[k]
 */
    __pyx_t_4 = ((__pyx_v_j < __pyx_v_k) != 0);
    if (__pyx_t_4) {
      __pyx_v_l = __pyx_v_i;
      goto __pyx_L13;
    }
    __pyx_L13:;

    /* "pandas/algos.pyx":793
 * 
 *         if j < k: l = i
 *         if k < i: m = j             # <<<<<<<<<<<<<<
 *     return a[k]
 * 
 */
    __pyx_t_4 = ((__pyx_v_k < __pyx_v_i) != 0);
    if (__pyx_t_4) {
      __pyx_v_m = __pyx_v_j;
      goto __pyx_L14;
    }
    __pyx_L14:;
  }

  /* "pandas/algos.pyx":794
 *         if j < k: l = i
 *         if k < i: m = j
 *     return a[k]             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_9 = __pyx_v_k;
  __pyx_r = (*((__pyx_t_5numpy_uint64_t *) ( /* dim=0 */ (__pyx_v_a.data + __pyx_t_9 * __pyx_v_a.strides[0]) )));
  goto __pyx_L0;

  /* "pandas/algos.pyx":770
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * cpdef numeric kth_smallest(numeric[:] a, Py_ssize_t k):             # <<<<<<<<<<<<<<
 *     cdef:
 *         Py_ssize_t i, j, l, m, n = a.size
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_WriteUnraisable("pandas.algos.kth_smallest", __pyx_clineno, __pyx_lineno, __pyx_filename, 0);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_6pandas_5algos_527__pyx_fuse_7kth_smallest(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_fuse_7__pyx_mdef_6pandas_5algos_527__pyx_fuse_7kth_smallest = {__Pyx_NAMESTR("__pyx_fuse_7kth_smallest"), (PyCFunction)__pyx_pw_6pandas_5algos_527__pyx_fuse_7kth_smallest, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pw_6pandas_5algos_527__pyx_fuse_7kth_smallest(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  __Pyx_memviewslice __pyx_v_a = { 0, 0, { 0 }, { 0 }, { 0 } };
  Py_ssize_t __pyx_v_k;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__pyx_fuse_7kth_smallest (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_a,&__pyx_n_s_k,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_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 (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_a)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_k)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__pyx_fuse_7kth_smallest", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__pyx_fuse_7kth_smallest") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __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 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_uint64_t(values[0]); if (unlikely(!__pyx_v_a.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_v_k = __Pyx_PyIndex_AsSsize_t(values[1]); if (unlikely((__pyx_v_k == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__pyx_fuse_7kth_smallest", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas.algos.__pyx_fuse_7kth_smallest", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6pandas_5algos_526__pyx_fuse_7kth_smallest(__pyx_self, __pyx_v_a, __pyx_v_k);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pandas_5algos_526__pyx_fuse_7kth_smallest(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_a, 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("__pyx_fuse_7kth_smallest", 0);
  __Pyx_XDECREF(__pyx_r);
  if (unlikely(!__pyx_v_a.memview)) { __Pyx_RaiseUnboundLocalError("a"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
  __pyx_t_1 = __Pyx_PyInt_From_npy_uint64(__pyx_fuse_7__pyx_f_6pandas_5algos_kth_smallest(__pyx_v_a, __pyx_v_k, 0)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __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;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pandas.algos.__pyx_fuse_7kth_smallest", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __PYX_XDEC_MEMVIEW(&__pyx_v_a, 1);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pw_6pandas_5algos_529__pyx_fuse_8kth_smallest(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pw_6pandas_5algos_15kth_smallest(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static __pyx_t_5numpy_float32_t __pyx_fuse_8__pyx_f_6pandas_5algos_kth_smallest(__Pyx_memviewslice __pyx_v_a, Py_ssize_t __pyx_v_k, CYTHON_UNUSED int __pyx_skip_dispatch) {
  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_float32_t __pyx_v_x;
  __pyx_t_5numpy_float32_t __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  Py_ssize_t __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;
  Py_ssize_t __pyx_t_8;
  Py_ssize_t __pyx_t_9;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__pyx_fuse_8kth_smallest", 0);

  /* "pandas/algos.pyx":772
 * cpdef numeric kth_smallest(numeric[:] a, Py_ssize_t k):
 *     cdef:
 *         Py_ssize_t i, j, l, m, n = a.size             # <<<<<<<<<<<<<<
 *         numeric x
 * 
 */
  __pyx_t_1 = __pyx_memoryview_fromslice(__pyx_v_a, 1, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_5numpy_float32_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_5numpy_float32_t, 0);; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 772; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_size); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 772; __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_PyIndex_AsSsize_t(__pyx_t_2); if (unlikely((__pyx_t_3 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 772; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_n = __pyx_t_3;

  /* "pandas/algos.pyx":775
 *         numeric x
 * 
 *     l = 0             # <<<<<<<<<<<<<<
 *     m = n - 1
 * 
 */
  __pyx_v_l = 0;

  /* "pandas/algos.pyx":776
 * 
 *     l = 0
 *     m = n - 1             # <<<<<<<<<<<<<<
 * 
 *     while l < m:
 */
  __pyx_v_m = (__pyx_v_n - 1);

  /* "pandas/algos.pyx":778
 *     m = n - 1
 * 
 *     while l < m:             # <<<<<<<<<<<<<<
 *         x = a[k]
 *         i = l
 */
  while (1) {
    __pyx_t_4 = ((__pyx_v_l < __pyx_v_m) != 0);
    if (!__pyx_t_4) break;

    /* "pandas/algos.pyx":779
 * 
 *     while l < m:
 *         x = a[k]             # <<<<<<<<<<<<<<
 *         i = l
 *         j = m
 */
    __pyx_t_3 = __pyx_v_k;
    __pyx_v_x = (*((__pyx_t_5numpy_float32_t *) ( /* dim=0 */ (__pyx_v_a.data + __pyx_t_3 * __pyx_v_a.strides[0]) )));

    /* "pandas/algos.pyx":780
 *     while l < m:
 *         x = a[k]
 *         i = l             # <<<<<<<<<<<<<<
 *         j = m
 * 
 */
    __pyx_v_i = __pyx_v_l;

    /* "pandas/algos.pyx":781
 *         x = a[k]
 *         i = l
 *         j = m             # <<<<<<<<<<<<<<
 * 
 *         while 1:
 */
    __pyx_v_j = __pyx_v_m;

    /* "pandas/algos.pyx":783
 *         j = m
 * 
 *         while 1:             # <<<<<<<<<<<<<<
 *             while a[i] < x: i += 1
 *             while x < a[j]: j -= 1
 */
    while (1) {

      /* "pandas/algos.pyx":784
 * 
 *         while 1:
 *             while a[i] < x: i += 1             # <<<<<<<<<<<<<<
 *             while x < a[j]: j -= 1
 *             if i <= j:
 */
      while (1) {
        __pyx_t_5 = __pyx_v_i;
        __pyx_t_4 = (((*((__pyx_t_5numpy_float32_t *) ( /* dim=0 */ (__pyx_v_a.data + __pyx_t_5 * __pyx_v_a.strides[0]) ))) < __pyx_v_x) != 0);
        if (!__pyx_t_4) break;
        __pyx_v_i = (__pyx_v_i + 1);
      }

      /* "pandas/algos.pyx":785
 *         while 1:
 *             while a[i] < x: i += 1
 *             while x < a[j]: j -= 1             # <<<<<<<<<<<<<<
 *             if i <= j:
 *                 swap(&a[i], &a[j])
 */
      while (1) {
        __pyx_t_6 = __pyx_v_j;
        __pyx_t_4 = ((__pyx_v_x < (*((__pyx_t_5numpy_float32_t *) ( /* dim=0 */ (__pyx_v_a.data + __pyx_t_6 * __pyx_v_a.strides[0]) )))) != 0);
        if (!__pyx_t_4) break;
        __pyx_v_j = (__pyx_v_j - 1);
      }

      /* "pandas/algos.pyx":786
 *             while a[i] < x: i += 1
 *             while x < a[j]: j -= 1
 *             if i <= j:             # <<<<<<<<<<<<<<
 *                 swap(&a[i], &a[j])
 *                 i += 1; j -= 1
 */
      __pyx_t_4 = ((__pyx_v_i <= __pyx_v_j) != 0);
      if (__pyx_t_4) {

        /* "pandas/algos.pyx":787
 *             while x < a[j]: j -= 1
 *             if i <= j:
 *                 swap(&a[i], &a[j])             # <<<<<<<<<<<<<<
 *                 i += 1; j -= 1
 * 
 */
        __pyx_t_7 = __pyx_v_i;
        __pyx_t_8 = __pyx_v_j;
        __pyx_t_9 = __pyx_fuse_8__pyx_f_6pandas_5algos_swap((&(*((__pyx_t_5numpy_float32_t *) ( /* dim=0 */ (__pyx_v_a.data + __pyx_t_7 * __pyx_v_a.strides[0]) )))), (&(*((__pyx_t_5numpy_float32_t *) ( /* dim=0 */ (__pyx_v_a.data + __pyx_t_8 * __pyx_v_a.strides[0]) ))))); if (unlikely(__pyx_t_9 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 787; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

        /* "pandas/algos.pyx":788
 *             if i <= j:
 *                 swap(&a[i], &a[j])
 *                 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:;

      /* "pandas/algos.pyx":790
 *                 i += 1; j -= 1
 * 
 *             if i > j: break             # <<<<<<<<<<<<<<
 * 
 *         if j < k: l = i
 */
      __pyx_t_4 = ((__pyx_v_i > __pyx_v_j) != 0);
      if (__pyx_t_4) {
        goto __pyx_L6_break;
      }
    }
    __pyx_L6_break:;

    /* "pandas/algos.pyx":792
 *             if i > j: break
 * 
 *         if j < k: l = i             # <<<<<<<<<<<<<<
 *         if k < i: m = j
 *     return a[k]
 */
    __pyx_t_4 = ((__pyx_v_j < __pyx_v_k) != 0);
    if (__pyx_t_4) {
      __pyx_v_l = __pyx_v_i;
      goto __pyx_L13;
    }
    __pyx_L13:;

    /* "pandas/algos.pyx":793
 * 
 *         if j < k: l = i
 *         if k < i: m = j             # <<<<<<<<<<<<<<
 *     return a[k]
 * 
 */
    __pyx_t_4 = ((__pyx_v_k < __pyx_v_i) != 0);
    if (__pyx_t_4) {
      __pyx_v_m = __pyx_v_j;
      goto __pyx_L14;
    }
    __pyx_L14:;
  }

  /* "pandas/algos.pyx":794
 *         if j < k: l = i
 *         if k < i: m = j
 *     return a[k]             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_9 = __pyx_v_k;
  __pyx_r = (*((__pyx_t_5numpy_float32_t *) ( /* dim=0 */ (__pyx_v_a.data + __pyx_t_9 * __pyx_v_a.strides[0]) )));
  goto __pyx_L0;

  /* "pandas/algos.pyx":770
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * cpdef numeric kth_smallest(numeric[:] a, Py_ssize_t k):             # <<<<<<<<<<<<<<
 *     cdef:
 *         Py_ssize_t i, j, l, m, n = a.size
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_WriteUnraisable("pandas.algos.kth_smallest", __pyx_clineno, __pyx_lineno, __pyx_filename, 0);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_6pandas_5algos_529__pyx_fuse_8kth_smallest(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_fuse_8__pyx_mdef_6pandas_5algos_529__pyx_fuse_8kth_smallest = {__Pyx_NAMESTR("__pyx_fuse_8kth_smallest"), (PyCFunction)__pyx_pw_6pandas_5algos_529__pyx_fuse_8kth_smallest, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pw_6pandas_5algos_529__pyx_fuse_8kth_smallest(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  __Pyx_memviewslice __pyx_v_a = { 0, 0, { 0 }, { 0 }, { 0 } };
  Py_ssize_t __pyx_v_k;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__pyx_fuse_8kth_smallest (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_a,&__pyx_n_s_k,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_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 (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_a)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_k)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__pyx_fuse_8kth_smallest", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__pyx_fuse_8kth_smallest") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __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 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float32_t(values[0]); if (unlikely(!__pyx_v_a.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_v_k = __Pyx_PyIndex_AsSsize_t(values[1]); if (unlikely((__pyx_v_k == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__pyx_fuse_8kth_smallest", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas.algos.__pyx_fuse_8kth_smallest", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6pandas_5algos_528__pyx_fuse_8kth_smallest(__pyx_self, __pyx_v_a, __pyx_v_k);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pandas_5algos_528__pyx_fuse_8kth_smallest(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_a, 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("__pyx_fuse_8kth_smallest", 0);
  __Pyx_XDECREF(__pyx_r);
  if (unlikely(!__pyx_v_a.memview)) { __Pyx_RaiseUnboundLocalError("a"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
  __pyx_t_1 = PyFloat_FromDouble(__pyx_fuse_8__pyx_f_6pandas_5algos_kth_smallest(__pyx_v_a, __pyx_v_k, 0)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __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;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pandas.algos.__pyx_fuse_8kth_smallest", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __PYX_XDEC_MEMVIEW(&__pyx_v_a, 1);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pw_6pandas_5algos_531__pyx_fuse_9kth_smallest(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pw_6pandas_5algos_15kth_smallest(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static __pyx_t_5numpy_float64_t __pyx_fuse_9__pyx_f_6pandas_5algos_kth_smallest(__Pyx_memviewslice __pyx_v_a, Py_ssize_t __pyx_v_k, CYTHON_UNUSED int __pyx_skip_dispatch) {
  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_float64_t __pyx_v_x;
  __pyx_t_5numpy_float64_t __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  Py_ssize_t __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;
  Py_ssize_t __pyx_t_8;
  Py_ssize_t __pyx_t_9;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__pyx_fuse_9kth_smallest", 0);

  /* "pandas/algos.pyx":772
 * cpdef numeric kth_smallest(numeric[:] a, Py_ssize_t k):
 *     cdef:
 *         Py_ssize_t i, j, l, m, n = a.size             # <<<<<<<<<<<<<<
 *         numeric x
 * 
 */
  __pyx_t_1 = __pyx_memoryview_fromslice(__pyx_v_a, 1, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_5numpy_float64_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_5numpy_float64_t, 0);; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 772; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_size); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 772; __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_PyIndex_AsSsize_t(__pyx_t_2); if (unlikely((__pyx_t_3 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 772; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_n = __pyx_t_3;

  /* "pandas/algos.pyx":775
 *         numeric x
 * 
 *     l = 0             # <<<<<<<<<<<<<<
 *     m = n - 1
 * 
 */
  __pyx_v_l = 0;

  /* "pandas/algos.pyx":776
 * 
 *     l = 0
 *     m = n - 1             # <<<<<<<<<<<<<<
 * 
 *     while l < m:
 */
  __pyx_v_m = (__pyx_v_n - 1);

  /* "pandas/algos.pyx":778
 *     m = n - 1
 * 
 *     while l < m:             # <<<<<<<<<<<<<<
 *         x = a[k]
 *         i = l
 */
  while (1) {
    __pyx_t_4 = ((__pyx_v_l < __pyx_v_m) != 0);
    if (!__pyx_t_4) break;

    /* "pandas/algos.pyx":779
 * 
 *     while l < m:
 *         x = a[k]             # <<<<<<<<<<<<<<
 *         i = l
 *         j = m
 */
    __pyx_t_3 = __pyx_v_k;
    __pyx_v_x = (*((__pyx_t_5numpy_float64_t *) ( /* dim=0 */ (__pyx_v_a.data + __pyx_t_3 * __pyx_v_a.strides[0]) )));

    /* "pandas/algos.pyx":780
 *     while l < m:
 *         x = a[k]
 *         i = l             # <<<<<<<<<<<<<<
 *         j = m
 * 
 */
    __pyx_v_i = __pyx_v_l;

    /* "pandas/algos.pyx":781
 *         x = a[k]
 *         i = l
 *         j = m             # <<<<<<<<<<<<<<
 * 
 *         while 1:
 */
    __pyx_v_j = __pyx_v_m;

    /* "pandas/algos.pyx":783
 *         j = m
 * 
 *         while 1:             # <<<<<<<<<<<<<<
 *             while a[i] < x: i += 1
 *             while x < a[j]: j -= 1
 */
    while (1) {

      /* "pandas/algos.pyx":784
 * 
 *         while 1:
 *             while a[i] < x: i += 1             # <<<<<<<<<<<<<<
 *             while x < a[j]: j -= 1
 *             if i <= j:
 */
      while (1) {
        __pyx_t_5 = __pyx_v_i;
        __pyx_t_4 = (((*((__pyx_t_5numpy_float64_t *) ( /* dim=0 */ (__pyx_v_a.data + __pyx_t_5 * __pyx_v_a.strides[0]) ))) < __pyx_v_x) != 0);
        if (!__pyx_t_4) break;
        __pyx_v_i = (__pyx_v_i + 1);
      }

      /* "pandas/algos.pyx":785
 *         while 1:
 *             while a[i] < x: i += 1
 *             while x < a[j]: j -= 1             # <<<<<<<<<<<<<<
 *             if i <= j:
 *                 swap(&a[i], &a[j])
 */
      while (1) {
        __pyx_t_6 = __pyx_v_j;
        __pyx_t_4 = ((__pyx_v_x < (*((__pyx_t_5numpy_float64_t *) ( /* dim=0 */ (__pyx_v_a.data + __pyx_t_6 * __pyx_v_a.strides[0]) )))) != 0);
        if (!__pyx_t_4) break;
        __pyx_v_j = (__pyx_v_j - 1);
      }

      /* "pandas/algos.pyx":786
 *             while a[i] < x: i += 1
 *             while x < a[j]: j -= 1
 *             if i <= j:             # <<<<<<<<<<<<<<
 *                 swap(&a[i], &a[j])
 *                 i += 1; j -= 1
 */
      __pyx_t_4 = ((__pyx_v_i <= __pyx_v_j) != 0);
      if (__pyx_t_4) {

        /* "pandas/algos.pyx":787
 *             while x < a[j]: j -= 1
 *             if i <= j:
 *                 swap(&a[i], &a[j])             # <<<<<<<<<<<<<<
 *                 i += 1; j -= 1
 * 
 */
        __pyx_t_7 = __pyx_v_i;
        __pyx_t_8 = __pyx_v_j;
        __pyx_t_9 = __pyx_fuse_9__pyx_f_6pandas_5algos_swap((&(*((__pyx_t_5numpy_float64_t *) ( /* dim=0 */ (__pyx_v_a.data + __pyx_t_7 * __pyx_v_a.strides[0]) )))), (&(*((__pyx_t_5numpy_float64_t *) ( /* dim=0 */ (__pyx_v_a.data + __pyx_t_8 * __pyx_v_a.strides[0]) ))))); if (unlikely(__pyx_t_9 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 787; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

        /* "pandas/algos.pyx":788
 *             if i <= j:
 *                 swap(&a[i], &a[j])
 *                 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:;

      /* "pandas/algos.pyx":790
 *                 i += 1; j -= 1
 * 
 *             if i > j: break             # <<<<<<<<<<<<<<
 * 
 *         if j < k: l = i
 */
      __pyx_t_4 = ((__pyx_v_i > __pyx_v_j) != 0);
      if (__pyx_t_4) {
        goto __pyx_L6_break;
      }
    }
    __pyx_L6_break:;

    /* "pandas/algos.pyx":792
 *             if i > j: break
 * 
 *         if j < k: l = i             # <<<<<<<<<<<<<<
 *         if k < i: m = j
 *     return a[k]
 */
    __pyx_t_4 = ((__pyx_v_j < __pyx_v_k) != 0);
    if (__pyx_t_4) {
      __pyx_v_l = __pyx_v_i;
      goto __pyx_L13;
    }
    __pyx_L13:;

    /* "pandas/algos.pyx":793
 * 
 *         if j < k: l = i
 *         if k < i: m = j             # <<<<<<<<<<<<<<
 *     return a[k]
 * 
 */
    __pyx_t_4 = ((__pyx_v_k < __pyx_v_i) != 0);
    if (__pyx_t_4) {
      __pyx_v_m = __pyx_v_j;
      goto __pyx_L14;
    }
    __pyx_L14:;
  }

  /* "pandas/algos.pyx":794
 *         if j < k: l = i
 *         if k < i: m = j
 *     return a[k]             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_9 = __pyx_v_k;
  __pyx_r = (*((__pyx_t_5numpy_float64_t *) ( /* dim=0 */ (__pyx_v_a.data + __pyx_t_9 * __pyx_v_a.strides[0]) )));
  goto __pyx_L0;

  /* "pandas/algos.pyx":770
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * cpdef numeric kth_smallest(numeric[:] a, Py_ssize_t k):             # <<<<<<<<<<<<<<
 *     cdef:
 *         Py_ssize_t i, j, l, m, n = a.size
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_WriteUnraisable("pandas.algos.kth_smallest", __pyx_clineno, __pyx_lineno, __pyx_filename, 0);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_6pandas_5algos_531__pyx_fuse_9kth_smallest(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_fuse_9__pyx_mdef_6pandas_5algos_531__pyx_fuse_9kth_smallest = {__Pyx_NAMESTR("__pyx_fuse_9kth_smallest"), (PyCFunction)__pyx_pw_6pandas_5algos_531__pyx_fuse_9kth_smallest, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pw_6pandas_5algos_531__pyx_fuse_9kth_smallest(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  __Pyx_memviewslice __pyx_v_a = { 0, 0, { 0 }, { 0 }, { 0 } };
  Py_ssize_t __pyx_v_k;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__pyx_fuse_9kth_smallest (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_a,&__pyx_n_s_k,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_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 (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_a)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_k)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__pyx_fuse_9kth_smallest", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__pyx_fuse_9kth_smallest") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __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 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float64_t(values[0]); if (unlikely(!__pyx_v_a.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_v_k = __Pyx_PyIndex_AsSsize_t(values[1]); if (unlikely((__pyx_v_k == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__pyx_fuse_9kth_smallest", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas.algos.__pyx_fuse_9kth_smallest", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6pandas_5algos_530__pyx_fuse_9kth_smallest(__pyx_self, __pyx_v_a, __pyx_v_k);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pandas_5algos_530__pyx_fuse_9kth_smallest(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_a, 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("__pyx_fuse_9kth_smallest", 0);
  __Pyx_XDECREF(__pyx_r);
  if (unlikely(!__pyx_v_a.memview)) { __Pyx_RaiseUnboundLocalError("a"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
  __pyx_t_1 = PyFloat_FromDouble(__pyx_fuse_9__pyx_f_6pandas_5algos_kth_smallest(__pyx_v_a, __pyx_v_k, 0)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __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;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pandas.algos.__pyx_fuse_9kth_smallest", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __PYX_XDEC_MEMVIEW(&__pyx_v_a, 1);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/algos.pyx":797
 * 
 * 
 * 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_5algos_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;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  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("kth_smallest_c", 0);

  /* "pandas/algos.pyx":802
 *         double_t x, t
 * 
 *     l = 0             # <<<<<<<<<<<<<<
 *     m = n-1
 *     while (l<m):
 */
  __pyx_v_l = 0;

  /* "pandas/algos.pyx":803
 * 
 *     l = 0
 *     m = n-1             # <<<<<<<<<<<<<<
 *     while (l<m):
 *         x = a[k]
 */
  __pyx_v_m = (__pyx_v_n - 1);

  /* "pandas/algos.pyx":804
 *     l = 0
 *     m = n-1
 *     while (l<m):             # <<<<<<<<<<<<<<
 *         x = a[k]
 *         i = l
 */
  while (1) {
    __pyx_t_1 = ((__pyx_v_l < __pyx_v_m) != 0);
    if (!__pyx_t_1) break;

    /* "pandas/algos.pyx":805
 *     m = n-1
 *     while (l<m):
 *         x = a[k]             # <<<<<<<<<<<<<<
 *         i = l
 *         j = m
 */
    __pyx_v_x = (__pyx_v_a[__pyx_v_k]);

    /* "pandas/algos.pyx":806
 *     while (l<m):
 *         x = a[k]
 *         i = l             # <<<<<<<<<<<<<<
 *         j = m
 * 
 */
    __pyx_v_i = __pyx_v_l;

    /* "pandas/algos.pyx":807
 *         x = a[k]
 *         i = l
 *         j = m             # <<<<<<<<<<<<<<
 * 
 *         while 1:
 */
    __pyx_v_j = __pyx_v_m;

    /* "pandas/algos.pyx":809
 *         j = m
 * 
 *         while 1:             # <<<<<<<<<<<<<<
 *             while a[i] < x: i += 1
 *             while x < a[j]: j -= 1
 */
    while (1) {

      /* "pandas/algos.pyx":810
 * 
 *         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) != 0);
        if (!__pyx_t_1) break;
        __pyx_v_i = (__pyx_v_i + 1);
      }

      /* "pandas/algos.pyx":811
 *         while 1:
 *             while a[i] < x: i += 1
 *             while x < a[j]: j -= 1             # <<<<<<<<<<<<<<
 *             if i <= j:
 *                 swap(&a[i], &a[j])
 */
      while (1) {
        __pyx_t_1 = ((__pyx_v_x < (__pyx_v_a[__pyx_v_j])) != 0);
        if (!__pyx_t_1) break;
        __pyx_v_j = (__pyx_v_j - 1);
      }

      /* "pandas/algos.pyx":812
 *             while a[i] < x: i += 1
 *             while x < a[j]: j -= 1
 *             if i <= j:             # <<<<<<<<<<<<<<
 *                 swap(&a[i], &a[j])
 *                 i += 1; j -= 1
 */
      __pyx_t_1 = ((__pyx_v_i <= __pyx_v_j) != 0);
      if (__pyx_t_1) {

        /* "pandas/algos.pyx":813
 *             while x < a[j]: j -= 1
 *             if i <= j:
 *                 swap(&a[i], &a[j])             # <<<<<<<<<<<<<<
 *                 i += 1; j -= 1
 * 
 */
        __pyx_t_2 = __pyx_fuse_9__pyx_f_6pandas_5algos_swap((&(__pyx_v_a[__pyx_v_i])), (&(__pyx_v_a[__pyx_v_j]))); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 813; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

        /* "pandas/algos.pyx":814
 *             if i <= j:
 *                 swap(&a[i], &a[j])
 *                 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:;

      /* "pandas/algos.pyx":816
 *                 i += 1; j -= 1
 * 
 *             if i > j: break             # <<<<<<<<<<<<<<
 * 
 *         if j < k: l = i
 */
      __pyx_t_1 = ((__pyx_v_i > __pyx_v_j) != 0);
      if (__pyx_t_1) {
        goto __pyx_L6_break;
      }
    }
    __pyx_L6_break:;

    /* "pandas/algos.pyx":818
 *             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) != 0);
    if (__pyx_t_1) {
      __pyx_v_l = __pyx_v_i;
      goto __pyx_L13;
    }
    __pyx_L13:;

    /* "pandas/algos.pyx":819
 * 
 *         if j < k: l = i
 *         if k < i: m = j             # <<<<<<<<<<<<<<
 *     return a[k]
 * 
 */
    __pyx_t_1 = ((__pyx_v_k < __pyx_v_i) != 0);
    if (__pyx_t_1) {
      __pyx_v_m = __pyx_v_j;
      goto __pyx_L14;
    }
    __pyx_L14:;
  }

  /* "pandas/algos.pyx":820
 *         if j < k: l = i
 *         if k < i: m = j
 *     return a[k]             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_3 = PyFloat_FromDouble((__pyx_v_a[__pyx_v_k])); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 820; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "pandas/algos.pyx":797
 * 
 * 
 * cdef inline kth_smallest_c(float64_t* a, Py_ssize_t k, Py_ssize_t n):             # <<<<<<<<<<<<<<
 *     cdef:
 *         Py_ssize_t i,j,l,m
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pandas.algos.kth_smallest_c", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/algos.pyx":823
 * 
 * 
 * cpdef numeric median(numeric[:] arr):             # <<<<<<<<<<<<<<
 *     '''
 *     A faster median
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pandas_5algos_17median(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6pandas_5algos_16median[] = "\n    A faster median\n    ";
static PyMethodDef __pyx_mdef_6pandas_5algos_17median = {__Pyx_NAMESTR("median"), (PyCFunction)__pyx_pw_6pandas_5algos_17median, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6pandas_5algos_16median)};
static PyObject *__pyx_pw_6pandas_5algos_17median(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_signatures = 0;
  PyObject *__pyx_v_args = 0;
  PyObject *__pyx_v_kwargs = 0;
  CYTHON_UNUSED PyObject *__pyx_v_defaults = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__pyx_fused_cpdef (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_signatures,&__pyx_n_s_args,&__pyx_n_s_kwargs,&__pyx_n_s_defaults,0};
    PyObject* values[4] = {0,0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_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 (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_signatures)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_args)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__pyx_fused_cpdef", 1, 4, 4, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_kwargs)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__pyx_fused_cpdef", 1, 4, 4, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  3:
        if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_defaults)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__pyx_fused_cpdef", 1, 4, 4, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__pyx_fused_cpdef") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __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_signatures = values[0];
    __pyx_v_args = values[1];
    __pyx_v_kwargs = values[2];
    __pyx_v_defaults = values[3];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__pyx_fused_cpdef", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas.algos.__pyx_fused_cpdef", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6pandas_5algos_16median(__pyx_self, __pyx_v_signatures, __pyx_v_args, __pyx_v_kwargs, __pyx_v_defaults);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pandas_5algos_16median(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_signatures, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs, CYTHON_UNUSED PyObject *__pyx_v_defaults) {
  PyObject *__pyx_v_dest_sig = NULL;
  PyObject *__pyx_v_numpy = NULL;
  __Pyx_memviewslice __pyx_v_memslice;
  Py_ssize_t __pyx_v_itemsize;
  int __pyx_v_dtype_signed;
  char __pyx_v_kind;
  int __pyx_v____pyx_int8_t_is_signed;
  int __pyx_v____pyx_int32_t_is_signed;
  int __pyx_v____pyx_int64_t_is_signed;
  int __pyx_v____pyx_uint8_t_is_signed;
  int __pyx_v____pyx_uint16_t_is_signed;
  int __pyx_v____pyx_int16_t_is_signed;
  int __pyx_v____pyx_uint64_t_is_signed;
  int __pyx_v____pyx_uint32_t_is_signed;
  PyObject *__pyx_v_arg = NULL;
  PyObject *__pyx_v_dtype = NULL;
  PyObject *__pyx_v_candidates = NULL;
  PyObject *__pyx_v_sig = NULL;
  int __pyx_v_match_found;
  PyObject *__pyx_v_src_type = NULL;
  PyObject *__pyx_v_dst_type = 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;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_t_7;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  Py_ssize_t __pyx_t_10;
  int __pyx_t_11;
  char __pyx_t_12;
  int __pyx_t_13;
  PyObject *(*__pyx_t_14)(PyObject *);
  Py_ssize_t __pyx_t_15;
  PyObject *(*__pyx_t_16)(PyObject *);
  PyObject *__pyx_t_17 = NULL;
  PyObject *__pyx_t_18 = NULL;
  PyObject *__pyx_t_19 = NULL;
  PyObject *(*__pyx_t_20)(PyObject *);
  int __pyx_t_21;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("median", 0);
  __Pyx_INCREF(__pyx_v_kwargs);
  __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(Py_None);
  PyList_SET_ITEM(__pyx_t_1, 0, Py_None);
  __Pyx_GIVEREF(Py_None);
  __pyx_v_dest_sig = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;
  __pyx_t_2 = (__pyx_v_kwargs == Py_None);
  __pyx_t_3 = (__pyx_t_2 != 0);
  if (__pyx_t_3) {
    __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF_SET(__pyx_v_kwargs, __pyx_t_1);
    __pyx_t_1 = 0;
    goto __pyx_L3;
  }
  __pyx_L3:;
  {
    __Pyx_ExceptionSave(&__pyx_t_4, &__pyx_t_5, &__pyx_t_6);
    __Pyx_XGOTREF(__pyx_t_4);
    __Pyx_XGOTREF(__pyx_t_5);
    __Pyx_XGOTREF(__pyx_t_6);
    /*try:*/ {
      __pyx_t_1 = __Pyx_Import(__pyx_n_s_numpy, 0, -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L4_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_v_numpy = __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_6); __pyx_t_6 = 0;
    goto __pyx_L11_try_end;
    __pyx_L4_error:;
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_7 = PyErr_ExceptionMatches(__pyx_builtin_ImportError);
    if (__pyx_t_7) {
      __Pyx_AddTraceback("pandas.algos.__pyx_fused_cpdef", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_8, &__pyx_t_9) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L6_except_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_INCREF(Py_None);
      __Pyx_XDECREF_SET(__pyx_v_numpy, Py_None);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      goto __pyx_L5_exception_handled;
    }
    goto __pyx_L6_except_error;
    __pyx_L6_except_error:;
    __Pyx_XGIVEREF(__pyx_t_4);
    __Pyx_XGIVEREF(__pyx_t_5);
    __Pyx_XGIVEREF(__pyx_t_6);
    __Pyx_ExceptionReset(__pyx_t_4, __pyx_t_5, __pyx_t_6);
    goto __pyx_L1_error;
    __pyx_L5_exception_handled:;
    __Pyx_XGIVEREF(__pyx_t_4);
    __Pyx_XGIVEREF(__pyx_t_5);
    __Pyx_XGIVEREF(__pyx_t_6);
    __Pyx_ExceptionReset(__pyx_t_4, __pyx_t_5, __pyx_t_6);
    __pyx_L11_try_end:;
  }
  __pyx_v_itemsize = -1;
  __pyx_v____pyx_int8_t_is_signed = (((__pyx_t_5numpy_int8_t)-1) < 0);
  __pyx_v____pyx_int32_t_is_signed = (((__pyx_t_5numpy_int32_t)-1) < 0);
  __pyx_v____pyx_int64_t_is_signed = (((__pyx_t_5numpy_int64_t)-1) < 0);
  __pyx_v____pyx_uint8_t_is_signed = (((__pyx_t_5numpy_uint8_t)-1) < 0);
  __pyx_v____pyx_uint16_t_is_signed = (((__pyx_t_5numpy_uint16_t)-1) < 0);
  __pyx_v____pyx_int16_t_is_signed = (((__pyx_t_5numpy_int16_t)-1) < 0);
  __pyx_v____pyx_uint64_t_is_signed = (((__pyx_t_5numpy_uint64_t)-1) < 0);
  __pyx_v____pyx_uint32_t_is_signed = (((__pyx_t_5numpy_uint32_t)-1) < 0);
  __pyx_t_10 = PyObject_Length(__pyx_v_args); if (unlikely(__pyx_t_10 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_3 = ((0 < __pyx_t_10) != 0);
  if (__pyx_t_3) {
    __pyx_t_9 = __Pyx_GetItemInt(__pyx_v_args, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_9 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
    __Pyx_GOTREF(__pyx_t_9);
    __pyx_v_arg = __pyx_t_9;
    __pyx_t_9 = 0;
    goto __pyx_L14;
  }
  __pyx_t_3 = (__Pyx_PySequence_Contains(__pyx_n_s_arr, __pyx_v_kwargs, Py_EQ)); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_2 = (__pyx_t_3 != 0);
  if (__pyx_t_2) {
    __pyx_t_9 = PyObject_GetItem(__pyx_v_kwargs, __pyx_n_s_arr); if (unlikely(__pyx_t_9 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
    __Pyx_GOTREF(__pyx_t_9);
    __pyx_v_arg = __pyx_t_9;
    __pyx_t_9 = 0;
    goto __pyx_L14;
  }
  /*else*/ {
    __pyx_t_10 = PyObject_Length(__pyx_v_args); if (unlikely(__pyx_t_10 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_9 = PyInt_FromSsize_t(__pyx_t_10); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_9);
    __pyx_t_8 = __Pyx_PyString_Format(__pyx_kp_s_Expected_at_least_d_arguments, __pyx_t_9); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_8);
    __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 = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_9);
    PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_8);
    __Pyx_GIVEREF(__pyx_t_8);
    __pyx_t_8 = 0;
    __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_t_9, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    __Pyx_Raise(__pyx_t_8, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_L14:;
  if (0) {
    goto __pyx_L15;
  }
  /*else*/ {
    while (1) {
      if (!1) break;
      __pyx_t_2 = (__pyx_v_numpy != Py_None);
      __pyx_t_3 = (__pyx_t_2 != 0);
      if (__pyx_t_3) {
        __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_numpy, __pyx_n_s_ndarray); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_8);
        __pyx_t_3 = PyObject_IsInstance(__pyx_v_arg, __pyx_t_8); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __pyx_t_2 = (__pyx_t_3 != 0);
        if (__pyx_t_2) {
          __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_dtype); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_8);
          __pyx_v_dtype = __pyx_t_8;
          __pyx_t_8 = 0;
          goto __pyx_L19;
        }
        __pyx_t_2 = (__pyx_memoryview_check(__pyx_v_arg) != 0);
        if (__pyx_t_2) {
          __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_base); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_8);
          __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_numpy, __pyx_n_s_ndarray); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_9);
          __pyx_t_3 = PyObject_IsInstance(__pyx_t_8, __pyx_t_9); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __pyx_t_11 = (__pyx_t_3 != 0);
        } else {
          __pyx_t_11 = __pyx_t_2;
        }
        if (__pyx_t_11) {
          __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_base); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_9);
          __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_dtype); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_8);
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __pyx_v_dtype = __pyx_t_8;
          __pyx_t_8 = 0;
          goto __pyx_L19;
        }
        /*else*/ {
          __Pyx_INCREF(Py_None);
          __pyx_v_dtype = Py_None;
        }
        __pyx_L19:;
        __pyx_v_itemsize = -1;
        __pyx_t_11 = (__pyx_v_dtype != Py_None);
        __pyx_t_2 = (__pyx_t_11 != 0);
        if (__pyx_t_2) {
          __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_dtype, __pyx_n_s_itemsize); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_8);
          __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[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
          __pyx_v_itemsize = __pyx_t_10;
          __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_dtype, __pyx_n_s_kind); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_8);
          __pyx_t_9 = PyTuple_New(1); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_9);
          PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_8);
          __Pyx_GIVEREF(__pyx_t_8);
          __pyx_t_8 = 0;
          __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ord, __pyx_t_9, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_8);
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __pyx_t_12 = __Pyx_PyInt_As_char(__pyx_t_8); if (unlikely((__pyx_t_12 == (char)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
          __pyx_v_kind = __pyx_t_12;
          __pyx_t_8 = __Pyx_PyInt_From_char(__pyx_v_kind); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_8);
          __pyx_t_9 = PyObject_RichCompare(__pyx_t_8, __pyx_int_105, Py_EQ); __Pyx_XGOTREF(__pyx_t_9); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
          __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __pyx_v_dtype_signed = __pyx_t_2;
          __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_dtype, __pyx_n_s_kind); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_9);
          __pyx_t_2 = (__Pyx_PySequence_Contains(__pyx_t_9, __pyx_tuple__38, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __pyx_t_11 = (__pyx_t_2 != 0);
          if (__pyx_t_11) {
            __pyx_t_11 = ((sizeof(__pyx_t_5numpy_int8_t)) == __pyx_v_itemsize);
            if (__pyx_t_11) {
              __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
              __Pyx_GOTREF(__pyx_t_9);
              __pyx_t_8 = PyObject_RichCompare(__pyx_t_9, __pyx_int_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_8); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
              __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
              __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
              __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
              if (__pyx_t_2) {
                __pyx_t_3 = (!((__pyx_v____pyx_int8_t_is_signed ^ __pyx_v_dtype_signed) != 0));
                __pyx_t_13 = __pyx_t_3;
              } else {
                __pyx_t_13 = __pyx_t_2;
              }
              __pyx_t_2 = __pyx_t_13;
            } else {
              __pyx_t_2 = __pyx_t_11;
            }
            if (__pyx_t_2) {
              if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_int8_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 1) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
              goto __pyx_L17_break;
            }
            __pyx_t_2 = ((sizeof(__pyx_t_5numpy_int16_t)) == __pyx_v_itemsize);
            if (__pyx_t_2) {
              __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
              __Pyx_GOTREF(__pyx_t_8);
              __pyx_t_9 = PyObject_RichCompare(__pyx_t_8, __pyx_int_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_9); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
              __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
              __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_11 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
              __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
              if (__pyx_t_11) {
                __pyx_t_13 = (!((__pyx_v____pyx_int16_t_is_signed ^ __pyx_v_dtype_signed) != 0));
                __pyx_t_3 = __pyx_t_13;
              } else {
                __pyx_t_3 = __pyx_t_11;
              }
              __pyx_t_11 = __pyx_t_3;
            } else {
              __pyx_t_11 = __pyx_t_2;
            }
            if (__pyx_t_11) {
              if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_int16_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 1) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
              goto __pyx_L17_break;
            }
            __pyx_t_11 = ((sizeof(__pyx_t_5numpy_int32_t)) == __pyx_v_itemsize);
            if (__pyx_t_11) {
              __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
              __Pyx_GOTREF(__pyx_t_9);
              __pyx_t_8 = PyObject_RichCompare(__pyx_t_9, __pyx_int_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_8); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
              __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
              __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
              __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
              if (__pyx_t_2) {
                __pyx_t_3 = (!((__pyx_v____pyx_int32_t_is_signed ^ __pyx_v_dtype_signed) != 0));
                __pyx_t_13 = __pyx_t_3;
              } else {
                __pyx_t_13 = __pyx_t_2;
              }
              __pyx_t_2 = __pyx_t_13;
            } else {
              __pyx_t_2 = __pyx_t_11;
            }
            if (__pyx_t_2) {
              if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_int32_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 1) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
              goto __pyx_L17_break;
            }
            __pyx_t_2 = ((sizeof(__pyx_t_5numpy_int64_t)) == __pyx_v_itemsize);
            if (__pyx_t_2) {
              __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
              __Pyx_GOTREF(__pyx_t_8);
              __pyx_t_9 = PyObject_RichCompare(__pyx_t_8, __pyx_int_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_9); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
              __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
              __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_11 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
              __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
              if (__pyx_t_11) {
                __pyx_t_13 = (!((__pyx_v____pyx_int64_t_is_signed ^ __pyx_v_dtype_signed) != 0));
                __pyx_t_3 = __pyx_t_13;
              } else {
                __pyx_t_3 = __pyx_t_11;
              }
              __pyx_t_11 = __pyx_t_3;
            } else {
              __pyx_t_11 = __pyx_t_2;
            }
            if (__pyx_t_11) {
              if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_int64_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 1) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
              goto __pyx_L17_break;
            }
            __pyx_t_11 = ((sizeof(__pyx_t_5numpy_uint8_t)) == __pyx_v_itemsize);
            if (__pyx_t_11) {
              __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
              __Pyx_GOTREF(__pyx_t_9);
              __pyx_t_8 = PyObject_RichCompare(__pyx_t_9, __pyx_int_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_8); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
              __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
              __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
              __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
              if (__pyx_t_2) {
                __pyx_t_3 = (!((__pyx_v____pyx_uint8_t_is_signed ^ __pyx_v_dtype_signed) != 0));
                __pyx_t_13 = __pyx_t_3;
              } else {
                __pyx_t_13 = __pyx_t_2;
              }
              __pyx_t_2 = __pyx_t_13;
            } else {
              __pyx_t_2 = __pyx_t_11;
            }
            if (__pyx_t_2) {
              if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_uint8_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 1) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
              goto __pyx_L17_break;
            }
            __pyx_t_2 = ((sizeof(__pyx_t_5numpy_uint16_t)) == __pyx_v_itemsize);
            if (__pyx_t_2) {
              __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
              __Pyx_GOTREF(__pyx_t_8);
              __pyx_t_9 = PyObject_RichCompare(__pyx_t_8, __pyx_int_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_9); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
              __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
              __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_11 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
              __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
              if (__pyx_t_11) {
                __pyx_t_13 = (!((__pyx_v____pyx_uint16_t_is_signed ^ __pyx_v_dtype_signed) != 0));
                __pyx_t_3 = __pyx_t_13;
              } else {
                __pyx_t_3 = __pyx_t_11;
              }
              __pyx_t_11 = __pyx_t_3;
            } else {
              __pyx_t_11 = __pyx_t_2;
            }
            if (__pyx_t_11) {
              if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_uint16_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 1) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
              goto __pyx_L17_break;
            }
            __pyx_t_11 = ((sizeof(__pyx_t_5numpy_uint32_t)) == __pyx_v_itemsize);
            if (__pyx_t_11) {
              __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
              __Pyx_GOTREF(__pyx_t_9);
              __pyx_t_8 = PyObject_RichCompare(__pyx_t_9, __pyx_int_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_8); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
              __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
              __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
              __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
              if (__pyx_t_2) {
                __pyx_t_3 = (!((__pyx_v____pyx_uint32_t_is_signed ^ __pyx_v_dtype_signed) != 0));
                __pyx_t_13 = __pyx_t_3;
              } else {
                __pyx_t_13 = __pyx_t_2;
              }
              __pyx_t_2 = __pyx_t_13;
            } else {
              __pyx_t_2 = __pyx_t_11;
            }
            if (__pyx_t_2) {
              if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_uint32_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 1) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
              goto __pyx_L17_break;
            }
            __pyx_t_2 = ((sizeof(__pyx_t_5numpy_uint64_t)) == __pyx_v_itemsize);
            if (__pyx_t_2) {
              __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
              __Pyx_GOTREF(__pyx_t_8);
              __pyx_t_9 = PyObject_RichCompare(__pyx_t_8, __pyx_int_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_9); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
              __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
              __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_11 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
              __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
              if (__pyx_t_11) {
                __pyx_t_13 = (!((__pyx_v____pyx_uint64_t_is_signed ^ __pyx_v_dtype_signed) != 0));
                __pyx_t_3 = __pyx_t_13;
              } else {
                __pyx_t_3 = __pyx_t_11;
              }
              __pyx_t_11 = __pyx_t_3;
            } else {
              __pyx_t_11 = __pyx_t_2;
            }
            if (__pyx_t_11) {
              if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_uint64_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 1) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
              goto __pyx_L17_break;
            }
            goto __pyx_L21;
          }
          __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_dtype, __pyx_n_s_kind); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_9);
          __pyx_t_11 = (__Pyx_PyString_Equals(__pyx_t_9, __pyx_n_s_f, Py_EQ)); if (unlikely(__pyx_t_11 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          if (__pyx_t_11) {
            __pyx_t_11 = ((sizeof(__pyx_t_5numpy_float32_t)) == __pyx_v_itemsize);
            if (__pyx_t_11) {
              __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
              __Pyx_GOTREF(__pyx_t_9);
              __pyx_t_8 = PyObject_RichCompare(__pyx_t_9, __pyx_int_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_8); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
              __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
              __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
              __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
              __pyx_t_3 = __pyx_t_2;
            } else {
              __pyx_t_3 = __pyx_t_11;
            }
            if (__pyx_t_3) {
              if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_float32_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 1) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
              goto __pyx_L17_break;
            }
            __pyx_t_3 = ((sizeof(__pyx_t_5numpy_float64_t)) == __pyx_v_itemsize);
            if (__pyx_t_3) {
              __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
              __Pyx_GOTREF(__pyx_t_8);
              __pyx_t_9 = PyObject_RichCompare(__pyx_t_8, __pyx_int_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_9); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
              __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
              __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_11 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
              __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
              __pyx_t_2 = __pyx_t_11;
            } else {
              __pyx_t_2 = __pyx_t_3;
            }
            if (__pyx_t_2) {
              if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_float64_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 1) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
              goto __pyx_L17_break;
            }
            goto __pyx_L21;
          }
          __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_dtype, __pyx_n_s_kind); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_9);
          __pyx_t_2 = (__Pyx_PyString_Equals(__pyx_t_9, __pyx_n_s_c, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          if (__pyx_t_2) {
            goto __pyx_L21;
          }
          __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_dtype, __pyx_n_s_kind); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_9);
          __pyx_t_2 = (__Pyx_PyString_Equals(__pyx_t_9, __pyx_n_s_O, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          if (__pyx_t_2) {
            goto __pyx_L21;
          }
          __pyx_L21:;
          goto __pyx_L20;
        }
        __pyx_L20:;
        goto __pyx_L18;
      }
      __pyx_L18:;
      __pyx_t_2 = ((__pyx_v_itemsize == -1) != 0);
      if (!__pyx_t_2) {
        __pyx_t_3 = ((__pyx_v_itemsize == (sizeof(__pyx_t_5numpy_int8_t))) != 0);
        __pyx_t_11 = __pyx_t_3;
      } else {
        __pyx_t_11 = __pyx_t_2;
      }
      if (__pyx_t_11) {
        __pyx_v_memslice = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int8_t(__pyx_v_arg);
        __pyx_t_11 = (__pyx_v_memslice.memview != 0);
        if (__pyx_t_11) {
          __PYX_XDEC_MEMVIEW((&__pyx_v_memslice), 1);
          if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_int8_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 1) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          goto __pyx_L17_break;
        }
        /*else*/ {
          PyErr_Clear();
        }
        goto __pyx_L32;
      }
      __pyx_L32:;
      __pyx_t_11 = ((__pyx_v_itemsize == -1) != 0);
      if (!__pyx_t_11) {
        __pyx_t_2 = ((__pyx_v_itemsize == (sizeof(__pyx_t_5numpy_int16_t))) != 0);
        __pyx_t_3 = __pyx_t_2;
      } else {
        __pyx_t_3 = __pyx_t_11;
      }
      if (__pyx_t_3) {
        __pyx_v_memslice = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int16_t(__pyx_v_arg);
        __pyx_t_3 = (__pyx_v_memslice.memview != 0);
        if (__pyx_t_3) {
          __PYX_XDEC_MEMVIEW((&__pyx_v_memslice), 1);
          if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_int16_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 1) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          goto __pyx_L17_break;
        }
        /*else*/ {
          PyErr_Clear();
        }
        goto __pyx_L34;
      }
      __pyx_L34:;
      __pyx_t_3 = ((__pyx_v_itemsize == -1) != 0);
      if (!__pyx_t_3) {
        __pyx_t_11 = ((__pyx_v_itemsize == (sizeof(__pyx_t_5numpy_int32_t))) != 0);
        __pyx_t_2 = __pyx_t_11;
      } else {
        __pyx_t_2 = __pyx_t_3;
      }
      if (__pyx_t_2) {
        __pyx_v_memslice = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int32_t(__pyx_v_arg);
        __pyx_t_2 = (__pyx_v_memslice.memview != 0);
        if (__pyx_t_2) {
          __PYX_XDEC_MEMVIEW((&__pyx_v_memslice), 1);
          if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_int32_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 1) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          goto __pyx_L17_break;
        }
        /*else*/ {
          PyErr_Clear();
        }
        goto __pyx_L36;
      }
      __pyx_L36:;
      __pyx_t_2 = ((__pyx_v_itemsize == -1) != 0);
      if (!__pyx_t_2) {
        __pyx_t_3 = ((__pyx_v_itemsize == (sizeof(__pyx_t_5numpy_int64_t))) != 0);
        __pyx_t_11 = __pyx_t_3;
      } else {
        __pyx_t_11 = __pyx_t_2;
      }
      if (__pyx_t_11) {
        __pyx_v_memslice = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int64_t(__pyx_v_arg);
        __pyx_t_11 = (__pyx_v_memslice.memview != 0);
        if (__pyx_t_11) {
          __PYX_XDEC_MEMVIEW((&__pyx_v_memslice), 1);
          if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_int64_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 1) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          goto __pyx_L17_break;
        }
        /*else*/ {
          PyErr_Clear();
        }
        goto __pyx_L38;
      }
      __pyx_L38:;
      __pyx_t_11 = ((__pyx_v_itemsize == -1) != 0);
      if (!__pyx_t_11) {
        __pyx_t_2 = ((__pyx_v_itemsize == (sizeof(__pyx_t_5numpy_uint8_t))) != 0);
        __pyx_t_3 = __pyx_t_2;
      } else {
        __pyx_t_3 = __pyx_t_11;
      }
      if (__pyx_t_3) {
        __pyx_v_memslice = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_uint8_t(__pyx_v_arg);
        __pyx_t_3 = (__pyx_v_memslice.memview != 0);
        if (__pyx_t_3) {
          __PYX_XDEC_MEMVIEW((&__pyx_v_memslice), 1);
          if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_uint8_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 1) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          goto __pyx_L17_break;
        }
        /*else*/ {
          PyErr_Clear();
        }
        goto __pyx_L40;
      }
      __pyx_L40:;
      __pyx_t_3 = ((__pyx_v_itemsize == -1) != 0);
      if (!__pyx_t_3) {
        __pyx_t_11 = ((__pyx_v_itemsize == (sizeof(__pyx_t_5numpy_uint16_t))) != 0);
        __pyx_t_2 = __pyx_t_11;
      } else {
        __pyx_t_2 = __pyx_t_3;
      }
      if (__pyx_t_2) {
        __pyx_v_memslice = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_uint16_t(__pyx_v_arg);
        __pyx_t_2 = (__pyx_v_memslice.memview != 0);
        if (__pyx_t_2) {
          __PYX_XDEC_MEMVIEW((&__pyx_v_memslice), 1);
          if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_uint16_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 1) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          goto __pyx_L17_break;
        }
        /*else*/ {
          PyErr_Clear();
        }
        goto __pyx_L42;
      }
      __pyx_L42:;
      __pyx_t_2 = ((__pyx_v_itemsize == -1) != 0);
      if (!__pyx_t_2) {
        __pyx_t_3 = ((__pyx_v_itemsize == (sizeof(__pyx_t_5numpy_uint32_t))) != 0);
        __pyx_t_11 = __pyx_t_3;
      } else {
        __pyx_t_11 = __pyx_t_2;
      }
      if (__pyx_t_11) {
        __pyx_v_memslice = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_uint32_t(__pyx_v_arg);
        __pyx_t_11 = (__pyx_v_memslice.memview != 0);
        if (__pyx_t_11) {
          __PYX_XDEC_MEMVIEW((&__pyx_v_memslice), 1);
          if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_uint32_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 1) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          goto __pyx_L17_break;
        }
        /*else*/ {
          PyErr_Clear();
        }
        goto __pyx_L44;
      }
      __pyx_L44:;
      __pyx_t_11 = ((__pyx_v_itemsize == -1) != 0);
      if (!__pyx_t_11) {
        __pyx_t_2 = ((__pyx_v_itemsize == (sizeof(__pyx_t_5numpy_uint64_t))) != 0);
        __pyx_t_3 = __pyx_t_2;
      } else {
        __pyx_t_3 = __pyx_t_11;
      }
      if (__pyx_t_3) {
        __pyx_v_memslice = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_uint64_t(__pyx_v_arg);
        __pyx_t_3 = (__pyx_v_memslice.memview != 0);
        if (__pyx_t_3) {
          __PYX_XDEC_MEMVIEW((&__pyx_v_memslice), 1);
          if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_uint64_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 1) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          goto __pyx_L17_break;
        }
        /*else*/ {
          PyErr_Clear();
        }
        goto __pyx_L46;
      }
      __pyx_L46:;
      __pyx_t_3 = ((__pyx_v_itemsize == -1) != 0);
      if (!__pyx_t_3) {
        __pyx_t_11 = ((__pyx_v_itemsize == (sizeof(__pyx_t_5numpy_float32_t))) != 0);
        __pyx_t_2 = __pyx_t_11;
      } else {
        __pyx_t_2 = __pyx_t_3;
      }
      if (__pyx_t_2) {
        __pyx_v_memslice = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float32_t(__pyx_v_arg);
        __pyx_t_2 = (__pyx_v_memslice.memview != 0);
        if (__pyx_t_2) {
          __PYX_XDEC_MEMVIEW((&__pyx_v_memslice), 1);
          if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_float32_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 1) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          goto __pyx_L17_break;
        }
        /*else*/ {
          PyErr_Clear();
        }
        goto __pyx_L48;
      }
      __pyx_L48:;
      __pyx_t_2 = ((__pyx_v_itemsize == -1) != 0);
      if (!__pyx_t_2) {
        __pyx_t_3 = ((__pyx_v_itemsize == (sizeof(__pyx_t_5numpy_float64_t))) != 0);
        __pyx_t_11 = __pyx_t_3;
      } else {
        __pyx_t_11 = __pyx_t_2;
      }
      if (__pyx_t_11) {
        __pyx_v_memslice = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float64_t(__pyx_v_arg);
        __pyx_t_11 = (__pyx_v_memslice.memview != 0);
        if (__pyx_t_11) {
          __PYX_XDEC_MEMVIEW((&__pyx_v_memslice), 1);
          if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_float64_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 1) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          goto __pyx_L17_break;
        }
        /*else*/ {
          PyErr_Clear();
        }
        goto __pyx_L50;
      }
      __pyx_L50:;
      if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, Py_None, long, 1, __Pyx_PyInt_From_long, 1, 0, 1) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      goto __pyx_L17_break;
    }
    __pyx_L17_break:;
  }
  __pyx_L15:;
  __pyx_t_9 = PyList_New(0); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_9);
  __pyx_v_candidates = ((PyObject*)__pyx_t_9);
  __pyx_t_9 = 0;
  if (PyList_CheckExact(__pyx_v_signatures) || PyTuple_CheckExact(__pyx_v_signatures)) {
    __pyx_t_9 = __pyx_v_signatures; __Pyx_INCREF(__pyx_t_9); __pyx_t_10 = 0;
    __pyx_t_14 = NULL;
  } else {
    __pyx_t_10 = -1; __pyx_t_9 = PyObject_GetIter(__pyx_v_signatures); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_9);
    __pyx_t_14 = Py_TYPE(__pyx_t_9)->tp_iternext;
  }
  for (;;) {
    if (!__pyx_t_14 && PyList_CheckExact(__pyx_t_9)) {
      if (__pyx_t_10 >= PyList_GET_SIZE(__pyx_t_9)) break;
      #if CYTHON_COMPILING_IN_CPYTHON
      __pyx_t_8 = PyList_GET_ITEM(__pyx_t_9, __pyx_t_10); __Pyx_INCREF(__pyx_t_8); __pyx_t_10++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #else
      __pyx_t_8 = PySequence_ITEM(__pyx_t_9, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #endif
    } else if (!__pyx_t_14 && PyTuple_CheckExact(__pyx_t_9)) {
      if (__pyx_t_10 >= PyTuple_GET_SIZE(__pyx_t_9)) break;
      #if CYTHON_COMPILING_IN_CPYTHON
      __pyx_t_8 = PyTuple_GET_ITEM(__pyx_t_9, __pyx_t_10); __Pyx_INCREF(__pyx_t_8); __pyx_t_10++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #else
      __pyx_t_8 = PySequence_ITEM(__pyx_t_9, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #endif
    } else {
      __pyx_t_8 = __pyx_t_14(__pyx_t_9);
      if (unlikely(!__pyx_t_8)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_8);
    }
    __Pyx_XDECREF_SET(__pyx_v_sig, __pyx_t_8);
    __pyx_t_8 = 0;
    __pyx_v_match_found = 0;
    __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_sig, __pyx_n_s_strip); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_tuple__39, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_split); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_tuple__40, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_8);
    PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_1);
    __Pyx_GIVEREF(__pyx_t_1);
    __Pyx_INCREF(__pyx_v_dest_sig);
    PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_v_dest_sig);
    __Pyx_GIVEREF(__pyx_v_dest_sig);
    __pyx_t_1 = 0;
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_zip, __pyx_t_8, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    if (PyList_CheckExact(__pyx_t_1) || PyTuple_CheckExact(__pyx_t_1)) {
      __pyx_t_8 = __pyx_t_1; __Pyx_INCREF(__pyx_t_8); __pyx_t_15 = 0;
      __pyx_t_16 = NULL;
    } else {
      __pyx_t_15 = -1; __pyx_t_8 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_8);
      __pyx_t_16 = Py_TYPE(__pyx_t_8)->tp_iternext;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    for (;;) {
      if (!__pyx_t_16 && PyList_CheckExact(__pyx_t_8)) {
        if (__pyx_t_15 >= PyList_GET_SIZE(__pyx_t_8)) break;
        #if CYTHON_COMPILING_IN_CPYTHON
        __pyx_t_1 = PyList_GET_ITEM(__pyx_t_8, __pyx_t_15); __Pyx_INCREF(__pyx_t_1); __pyx_t_15++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #else
        __pyx_t_1 = PySequence_ITEM(__pyx_t_8, __pyx_t_15); __pyx_t_15++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #endif
      } else if (!__pyx_t_16 && PyTuple_CheckExact(__pyx_t_8)) {
        if (__pyx_t_15 >= PyTuple_GET_SIZE(__pyx_t_8)) break;
        #if CYTHON_COMPILING_IN_CPYTHON
        __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_8, __pyx_t_15); __Pyx_INCREF(__pyx_t_1); __pyx_t_15++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #else
        __pyx_t_1 = PySequence_ITEM(__pyx_t_8, __pyx_t_15); __pyx_t_15++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #endif
      } else {
        __pyx_t_1 = __pyx_t_16(__pyx_t_8);
        if (unlikely(!__pyx_t_1)) {
          PyObject* exc_type = PyErr_Occurred();
          if (exc_type) {
            if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
            else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          }
          break;
        }
        __Pyx_GOTREF(__pyx_t_1);
      }
      if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) {
        PyObject* sequence = __pyx_t_1;
        #if CYTHON_COMPILING_IN_CPYTHON
        Py_ssize_t size = Py_SIZE(sequence);
        #else
        Py_ssize_t size = PySequence_Size(sequence);
        #endif
        if (unlikely(size != 2)) {
          if (size > 2) __Pyx_RaiseTooManyValuesError(2);
          else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
          {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        #if CYTHON_COMPILING_IN_CPYTHON
        if (likely(PyTuple_CheckExact(sequence))) {
          __pyx_t_17 = PyTuple_GET_ITEM(sequence, 0); 
          __pyx_t_18 = PyTuple_GET_ITEM(sequence, 1); 
        } else {
          __pyx_t_17 = PyList_GET_ITEM(sequence, 0); 
          __pyx_t_18 = PyList_GET_ITEM(sequence, 1); 
        }
        __Pyx_INCREF(__pyx_t_17);
        __Pyx_INCREF(__pyx_t_18);
        #else
        __pyx_t_17 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_17);
        __pyx_t_18 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_18);
        #endif
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      } else {
        Py_ssize_t index = -1;
        __pyx_t_19 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_19);
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __pyx_t_20 = Py_TYPE(__pyx_t_19)->tp_iternext;
        index = 0; __pyx_t_17 = __pyx_t_20(__pyx_t_19); if (unlikely(!__pyx_t_17)) goto __pyx_L56_unpacking_failed;
        __Pyx_GOTREF(__pyx_t_17);
        index = 1; __pyx_t_18 = __pyx_t_20(__pyx_t_19); if (unlikely(!__pyx_t_18)) goto __pyx_L56_unpacking_failed;
        __Pyx_GOTREF(__pyx_t_18);
        if (__Pyx_IternextUnpackEndCheck(__pyx_t_20(__pyx_t_19), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __pyx_t_20 = NULL;
        __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
        goto __pyx_L57_unpacking_done;
        __pyx_L56_unpacking_failed:;
        __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
        __pyx_t_20 = NULL;
        if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __pyx_L57_unpacking_done:;
      }
      __Pyx_XDECREF_SET(__pyx_v_src_type, __pyx_t_17);
      __pyx_t_17 = 0;
      __Pyx_XDECREF_SET(__pyx_v_dst_type, __pyx_t_18);
      __pyx_t_18 = 0;
      __pyx_t_11 = (__pyx_v_dst_type != Py_None);
      __pyx_t_2 = (__pyx_t_11 != 0);
      if (__pyx_t_2) {
        __pyx_t_1 = PyObject_RichCompare(__pyx_v_src_type, __pyx_v_dst_type, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        if (__pyx_t_2) {
          __pyx_v_match_found = 1;
          goto __pyx_L59;
        }
        /*else*/ {
          __pyx_v_match_found = 0;
          goto __pyx_L55_break;
        }
        __pyx_L59:;
        goto __pyx_L58;
      }
      __pyx_L58:;
    }
    __pyx_L55_break:;
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __pyx_t_2 = (__pyx_v_match_found != 0);
    if (__pyx_t_2) {
      __pyx_t_21 = __Pyx_PyList_Append(__pyx_v_candidates, __pyx_v_sig); if (unlikely(__pyx_t_21 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      goto __pyx_L60;
    }
    __pyx_L60:;
  }
  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  __pyx_t_2 = (__pyx_v_candidates != Py_None) && (PyList_GET_SIZE(__pyx_v_candidates) != 0);
  __pyx_t_11 = ((!__pyx_t_2) != 0);
  if (__pyx_t_11) {
    __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__41, NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_9);
    __Pyx_Raise(__pyx_t_9, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_10 = PyList_GET_SIZE(__pyx_v_candidates); if (unlikely(__pyx_t_10 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_11 = ((__pyx_t_10 > 1) != 0);
  if (__pyx_t_11) {
    __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__42, NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_9);
    __Pyx_Raise(__pyx_t_9, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  /*else*/ {
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_9 = __Pyx_GetItemInt_List(__pyx_v_candidates, 0, long, 1, __Pyx_PyInt_From_long, 1, 0, 1); if (unlikely(__pyx_t_9 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
    __Pyx_GOTREF(__pyx_t_9);
    __pyx_t_8 = PyObject_GetItem(__pyx_v_signatures, __pyx_t_9); if (unlikely(__pyx_t_8 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    __pyx_r = __pyx_t_8;
    __pyx_t_8 = 0;
    goto __pyx_L0;
  }

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_17);
  __Pyx_XDECREF(__pyx_t_18);
  __Pyx_XDECREF(__pyx_t_19);
  __Pyx_AddTraceback("pandas.algos.__pyx_fused_cpdef", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_dest_sig);
  __Pyx_XDECREF(__pyx_v_numpy);
  __Pyx_XDECREF(__pyx_v_arg);
  __Pyx_XDECREF(__pyx_v_dtype);
  __Pyx_XDECREF(__pyx_v_candidates);
  __Pyx_XDECREF(__pyx_v_sig);
  __Pyx_XDECREF(__pyx_v_src_type);
  __Pyx_XDECREF(__pyx_v_dst_type);
  __Pyx_XDECREF(__pyx_v_kwargs);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pw_6pandas_5algos_535__pyx_fuse_0median(PyObject *__pyx_self, PyObject *__pyx_arg_arr); /*proto*/
static PyObject *__pyx_pw_6pandas_5algos_17median(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static __pyx_t_5numpy_int8_t __pyx_fuse_0__pyx_f_6pandas_5algos_median(__Pyx_memviewslice __pyx_v_arr, CYTHON_UNUSED int __pyx_skip_dispatch) {
  Py_ssize_t __pyx_v_n;
  __pyx_t_5numpy_int8_t __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  Py_ssize_t __pyx_t_3;
  int __pyx_t_4;
  __pyx_t_5numpy_int8_t __pyx_t_5;
  __Pyx_memviewslice __pyx_t_6 = { 0, 0, { 0 }, { 0 }, { 0 } };
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__pyx_fuse_0median", 0);
  __PYX_INC_MEMVIEW(&__pyx_v_arr, 1);

  /* "pandas/algos.pyx":827
 *     A faster median
 *     '''
 *     cdef Py_ssize_t n = arr.size             # <<<<<<<<<<<<<<
 * 
 *     if n == 0:
 */
  __pyx_t_1 = __pyx_memoryview_fromslice(__pyx_v_arr, 1, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_5numpy_int8_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_5numpy_int8_t, 0);; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 827; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_size); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 827; __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_PyIndex_AsSsize_t(__pyx_t_2); if (unlikely((__pyx_t_3 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 827; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_n = __pyx_t_3;

  /* "pandas/algos.pyx":829
 *     cdef Py_ssize_t n = arr.size
 * 
 *     if n == 0:             # <<<<<<<<<<<<<<
 *         return np.NaN
 * 
 */
  __pyx_t_4 = ((__pyx_v_n == 0) != 0);
  if (__pyx_t_4) {

    /* "pandas/algos.pyx":830
 * 
 *     if n == 0:
 *         return np.NaN             # <<<<<<<<<<<<<<
 * 
 *     arr = arr.copy()
 */
    __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 830; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_NaN); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 830; __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_As_npy_int8(__pyx_t_1); if (unlikely((__pyx_t_5 == (npy_int8)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 830; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_r = __pyx_t_5;
    goto __pyx_L0;
  }

  /* "pandas/algos.pyx":832
 *         return np.NaN
 * 
 *     arr = arr.copy()             # <<<<<<<<<<<<<<
 * 
 *     if n % 2:
 */
  __pyx_t_6 = __pyx_memoryview_copy_slice_dc_nn___pyx_t_5numpy_int8_t_c(__pyx_v_arr); if (unlikely(!__pyx_t_6.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 832; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __PYX_XDEC_MEMVIEW(&__pyx_v_arr, 1);
  __pyx_v_arr = __pyx_t_6;
  __pyx_t_6.memview = NULL;
  __pyx_t_6.data = NULL;

  /* "pandas/algos.pyx":834
 *     arr = arr.copy()
 * 
 *     if n % 2:             # <<<<<<<<<<<<<<
 *         return kth_smallest(arr, n // 2)
 *     else:
 */
  __pyx_t_4 = (__Pyx_mod_Py_ssize_t(__pyx_v_n, 2) != 0);
  if (__pyx_t_4) {

    /* "pandas/algos.pyx":835
 * 
 *     if n % 2:
 *         return kth_smallest(arr, n // 2)             # <<<<<<<<<<<<<<
 *     else:
 *         return (kth_smallest(arr, n // 2) +
 */
    __pyx_r = __pyx_fuse_0__pyx_f_6pandas_5algos_kth_smallest(__pyx_v_arr, __Pyx_div_Py_ssize_t(__pyx_v_n, 2), 0);
    goto __pyx_L0;
  }
  /*else*/ {

    /* "pandas/algos.pyx":838
 *     else:
 *         return (kth_smallest(arr, n // 2) +
 *                 kth_smallest(arr, n // 2 - 1)) / 2             # <<<<<<<<<<<<<<
 * 
 * 
 */
    __pyx_r = __Pyx_div_long((__pyx_fuse_0__pyx_f_6pandas_5algos_kth_smallest(__pyx_v_arr, __Pyx_div_Py_ssize_t(__pyx_v_n, 2), 0) + __pyx_fuse_0__pyx_f_6pandas_5algos_kth_smallest(__pyx_v_arr, (__Pyx_div_Py_ssize_t(__pyx_v_n, 2) - 1), 0)), 2);
    goto __pyx_L0;
  }

  /* "pandas/algos.pyx":823
 * 
 * 
 * cpdef numeric median(numeric[:] arr):             # <<<<<<<<<<<<<<
 *     '''
 *     A faster median
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __PYX_XDEC_MEMVIEW(&__pyx_t_6, 1);
  __Pyx_WriteUnraisable("pandas.algos.median", __pyx_clineno, __pyx_lineno, __pyx_filename, 0);
  __pyx_r = 0;
  __pyx_L0:;
  __PYX_XDEC_MEMVIEW(&__pyx_v_arr, 1);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_6pandas_5algos_535__pyx_fuse_0median(PyObject *__pyx_self, PyObject *__pyx_arg_arr); /*proto*/
static PyMethodDef __pyx_fuse_0__pyx_mdef_6pandas_5algos_535__pyx_fuse_0median = {__Pyx_NAMESTR("__pyx_fuse_0median"), (PyCFunction)__pyx_pw_6pandas_5algos_535__pyx_fuse_0median, METH_O, __Pyx_DOCSTR(__pyx_doc_6pandas_5algos_16median)};
static PyObject *__pyx_pw_6pandas_5algos_535__pyx_fuse_0median(PyObject *__pyx_self, PyObject *__pyx_arg_arr) {
  __Pyx_memviewslice __pyx_v_arr = { 0, 0, { 0 }, { 0 }, { 0 } };
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__pyx_fuse_0median (wrapper)", 0);
  assert(__pyx_arg_arr); {
    __pyx_v_arr = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int8_t(__pyx_arg_arr); if (unlikely(!__pyx_v_arr.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas.algos.__pyx_fuse_0median", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6pandas_5algos_534__pyx_fuse_0median(__pyx_self, __pyx_v_arr);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pandas_5algos_534__pyx_fuse_0median(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_arr) {
  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("__pyx_fuse_0median", 0);
  __Pyx_XDECREF(__pyx_r);
  if (unlikely(!__pyx_v_arr.memview)) { __Pyx_RaiseUnboundLocalError("arr"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
  __pyx_t_1 = __Pyx_PyInt_From_npy_int8(__pyx_fuse_0__pyx_f_6pandas_5algos_median(__pyx_v_arr, 0)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pandas.algos.__pyx_fuse_0median", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __PYX_XDEC_MEMVIEW(&__pyx_v_arr, 1);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pw_6pandas_5algos_537__pyx_fuse_1median(PyObject *__pyx_self, PyObject *__pyx_arg_arr); /*proto*/
static PyObject *__pyx_pw_6pandas_5algos_17median(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static __pyx_t_5numpy_int16_t __pyx_fuse_1__pyx_f_6pandas_5algos_median(__Pyx_memviewslice __pyx_v_arr, CYTHON_UNUSED int __pyx_skip_dispatch) {
  Py_ssize_t __pyx_v_n;
  __pyx_t_5numpy_int16_t __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  Py_ssize_t __pyx_t_3;
  int __pyx_t_4;
  __pyx_t_5numpy_int16_t __pyx_t_5;
  __Pyx_memviewslice __pyx_t_6 = { 0, 0, { 0 }, { 0 }, { 0 } };
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__pyx_fuse_1median", 0);
  __PYX_INC_MEMVIEW(&__pyx_v_arr, 1);

  /* "pandas/algos.pyx":827
 *     A faster median
 *     '''
 *     cdef Py_ssize_t n = arr.size             # <<<<<<<<<<<<<<
 * 
 *     if n == 0:
 */
  __pyx_t_1 = __pyx_memoryview_fromslice(__pyx_v_arr, 1, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_5numpy_int16_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_5numpy_int16_t, 0);; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 827; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_size); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 827; __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_PyIndex_AsSsize_t(__pyx_t_2); if (unlikely((__pyx_t_3 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 827; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_n = __pyx_t_3;

  /* "pandas/algos.pyx":829
 *     cdef Py_ssize_t n = arr.size
 * 
 *     if n == 0:             # <<<<<<<<<<<<<<
 *         return np.NaN
 * 
 */
  __pyx_t_4 = ((__pyx_v_n == 0) != 0);
  if (__pyx_t_4) {

    /* "pandas/algos.pyx":830
 * 
 *     if n == 0:
 *         return np.NaN             # <<<<<<<<<<<<<<
 * 
 *     arr = arr.copy()
 */
    __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 830; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_NaN); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 830; __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_As_npy_int16(__pyx_t_1); if (unlikely((__pyx_t_5 == (npy_int16)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 830; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_r = __pyx_t_5;
    goto __pyx_L0;
  }

  /* "pandas/algos.pyx":832
 *         return np.NaN
 * 
 *     arr = arr.copy()             # <<<<<<<<<<<<<<
 * 
 *     if n % 2:
 */
  __pyx_t_6 = __pyx_memoryview_copy_slice_dc_nn___pyx_t_5numpy_int16_t_c(__pyx_v_arr); if (unlikely(!__pyx_t_6.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 832; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __PYX_XDEC_MEMVIEW(&__pyx_v_arr, 1);
  __pyx_v_arr = __pyx_t_6;
  __pyx_t_6.memview = NULL;
  __pyx_t_6.data = NULL;

  /* "pandas/algos.pyx":834
 *     arr = arr.copy()
 * 
 *     if n % 2:             # <<<<<<<<<<<<<<
 *         return kth_smallest(arr, n // 2)
 *     else:
 */
  __pyx_t_4 = (__Pyx_mod_Py_ssize_t(__pyx_v_n, 2) != 0);
  if (__pyx_t_4) {

    /* "pandas/algos.pyx":835
 * 
 *     if n % 2:
 *         return kth_smallest(arr, n // 2)             # <<<<<<<<<<<<<<
 *     else:
 *         return (kth_smallest(arr, n // 2) +
 */
    __pyx_r = __pyx_fuse_1__pyx_f_6pandas_5algos_kth_smallest(__pyx_v_arr, __Pyx_div_Py_ssize_t(__pyx_v_n, 2), 0);
    goto __pyx_L0;
  }
  /*else*/ {

    /* "pandas/algos.pyx":838
 *     else:
 *         return (kth_smallest(arr, n // 2) +
 *                 kth_smallest(arr, n // 2 - 1)) / 2             # <<<<<<<<<<<<<<
 * 
 * 
 */
    __pyx_r = __Pyx_div_long((__pyx_fuse_1__pyx_f_6pandas_5algos_kth_smallest(__pyx_v_arr, __Pyx_div_Py_ssize_t(__pyx_v_n, 2), 0) + __pyx_fuse_1__pyx_f_6pandas_5algos_kth_smallest(__pyx_v_arr, (__Pyx_div_Py_ssize_t(__pyx_v_n, 2) - 1), 0)), 2);
    goto __pyx_L0;
  }

  /* "pandas/algos.pyx":823
 * 
 * 
 * cpdef numeric median(numeric[:] arr):             # <<<<<<<<<<<<<<
 *     '''
 *     A faster median
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __PYX_XDEC_MEMVIEW(&__pyx_t_6, 1);
  __Pyx_WriteUnraisable("pandas.algos.median", __pyx_clineno, __pyx_lineno, __pyx_filename, 0);
  __pyx_r = 0;
  __pyx_L0:;
  __PYX_XDEC_MEMVIEW(&__pyx_v_arr, 1);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_6pandas_5algos_537__pyx_fuse_1median(PyObject *__pyx_self, PyObject *__pyx_arg_arr); /*proto*/
static PyMethodDef __pyx_fuse_1__pyx_mdef_6pandas_5algos_537__pyx_fuse_1median = {__Pyx_NAMESTR("__pyx_fuse_1median"), (PyCFunction)__pyx_pw_6pandas_5algos_537__pyx_fuse_1median, METH_O, __Pyx_DOCSTR(__pyx_doc_6pandas_5algos_16median)};
static PyObject *__pyx_pw_6pandas_5algos_537__pyx_fuse_1median(PyObject *__pyx_self, PyObject *__pyx_arg_arr) {
  __Pyx_memviewslice __pyx_v_arr = { 0, 0, { 0 }, { 0 }, { 0 } };
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__pyx_fuse_1median (wrapper)", 0);
  assert(__pyx_arg_arr); {
    __pyx_v_arr = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int16_t(__pyx_arg_arr); if (unlikely(!__pyx_v_arr.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas.algos.__pyx_fuse_1median", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6pandas_5algos_536__pyx_fuse_1median(__pyx_self, __pyx_v_arr);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pandas_5algos_536__pyx_fuse_1median(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_arr) {
  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("__pyx_fuse_1median", 0);
  __Pyx_XDECREF(__pyx_r);
  if (unlikely(!__pyx_v_arr.memview)) { __Pyx_RaiseUnboundLocalError("arr"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
  __pyx_t_1 = __Pyx_PyInt_From_npy_int16(__pyx_fuse_1__pyx_f_6pandas_5algos_median(__pyx_v_arr, 0)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pandas.algos.__pyx_fuse_1median", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __PYX_XDEC_MEMVIEW(&__pyx_v_arr, 1);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pw_6pandas_5algos_539__pyx_fuse_2median(PyObject *__pyx_self, PyObject *__pyx_arg_arr); /*proto*/
static PyObject *__pyx_pw_6pandas_5algos_17median(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static __pyx_t_5numpy_int32_t __pyx_fuse_2__pyx_f_6pandas_5algos_median(__Pyx_memviewslice __pyx_v_arr, CYTHON_UNUSED int __pyx_skip_dispatch) {
  Py_ssize_t __pyx_v_n;
  __pyx_t_5numpy_int32_t __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  Py_ssize_t __pyx_t_3;
  int __pyx_t_4;
  __pyx_t_5numpy_int32_t __pyx_t_5;
  __Pyx_memviewslice __pyx_t_6 = { 0, 0, { 0 }, { 0 }, { 0 } };
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__pyx_fuse_2median", 0);
  __PYX_INC_MEMVIEW(&__pyx_v_arr, 1);

  /* "pandas/algos.pyx":827
 *     A faster median
 *     '''
 *     cdef Py_ssize_t n = arr.size             # <<<<<<<<<<<<<<
 * 
 *     if n == 0:
 */
  __pyx_t_1 = __pyx_memoryview_fromslice(__pyx_v_arr, 1, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_5numpy_int32_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_5numpy_int32_t, 0);; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 827; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_size); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 827; __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_PyIndex_AsSsize_t(__pyx_t_2); if (unlikely((__pyx_t_3 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 827; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_n = __pyx_t_3;

  /* "pandas/algos.pyx":829
 *     cdef Py_ssize_t n = arr.size
 * 
 *     if n == 0:             # <<<<<<<<<<<<<<
 *         return np.NaN
 * 
 */
  __pyx_t_4 = ((__pyx_v_n == 0) != 0);
  if (__pyx_t_4) {

    /* "pandas/algos.pyx":830
 * 
 *     if n == 0:
 *         return np.NaN             # <<<<<<<<<<<<<<
 * 
 *     arr = arr.copy()
 */
    __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 830; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_NaN); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 830; __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_As_npy_int32(__pyx_t_1); if (unlikely((__pyx_t_5 == (npy_int32)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 830; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_r = __pyx_t_5;
    goto __pyx_L0;
  }

  /* "pandas/algos.pyx":832
 *         return np.NaN
 * 
 *     arr = arr.copy()             # <<<<<<<<<<<<<<
 * 
 *     if n % 2:
 */
  __pyx_t_6 = __pyx_memoryview_copy_slice_dc_nn___pyx_t_5numpy_int32_t_c(__pyx_v_arr); if (unlikely(!__pyx_t_6.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 832; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __PYX_XDEC_MEMVIEW(&__pyx_v_arr, 1);
  __pyx_v_arr = __pyx_t_6;
  __pyx_t_6.memview = NULL;
  __pyx_t_6.data = NULL;

  /* "pandas/algos.pyx":834
 *     arr = arr.copy()
 * 
 *     if n % 2:             # <<<<<<<<<<<<<<
 *         return kth_smallest(arr, n // 2)
 *     else:
 */
  __pyx_t_4 = (__Pyx_mod_Py_ssize_t(__pyx_v_n, 2) != 0);
  if (__pyx_t_4) {

    /* "pandas/algos.pyx":835
 * 
 *     if n % 2:
 *         return kth_smallest(arr, n // 2)             # <<<<<<<<<<<<<<
 *     else:
 *         return (kth_smallest(arr, n // 2) +
 */
    __pyx_r = __pyx_fuse_2__pyx_f_6pandas_5algos_kth_smallest(__pyx_v_arr, __Pyx_div_Py_ssize_t(__pyx_v_n, 2), 0);
    goto __pyx_L0;
  }
  /*else*/ {

    /* "pandas/algos.pyx":838
 *     else:
 *         return (kth_smallest(arr, n // 2) +
 *                 kth_smallest(arr, n // 2 - 1)) / 2             # <<<<<<<<<<<<<<
 * 
 * 
 */
    __pyx_r = __Pyx_div_long((__pyx_fuse_2__pyx_f_6pandas_5algos_kth_smallest(__pyx_v_arr, __Pyx_div_Py_ssize_t(__pyx_v_n, 2), 0) + __pyx_fuse_2__pyx_f_6pandas_5algos_kth_smallest(__pyx_v_arr, (__Pyx_div_Py_ssize_t(__pyx_v_n, 2) - 1), 0)), 2);
    goto __pyx_L0;
  }

  /* "pandas/algos.pyx":823
 * 
 * 
 * cpdef numeric median(numeric[:] arr):             # <<<<<<<<<<<<<<
 *     '''
 *     A faster median
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __PYX_XDEC_MEMVIEW(&__pyx_t_6, 1);
  __Pyx_WriteUnraisable("pandas.algos.median", __pyx_clineno, __pyx_lineno, __pyx_filename, 0);
  __pyx_r = 0;
  __pyx_L0:;
  __PYX_XDEC_MEMVIEW(&__pyx_v_arr, 1);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_6pandas_5algos_539__pyx_fuse_2median(PyObject *__pyx_self, PyObject *__pyx_arg_arr); /*proto*/
static PyMethodDef __pyx_fuse_2__pyx_mdef_6pandas_5algos_539__pyx_fuse_2median = {__Pyx_NAMESTR("__pyx_fuse_2median"), (PyCFunction)__pyx_pw_6pandas_5algos_539__pyx_fuse_2median, METH_O, __Pyx_DOCSTR(__pyx_doc_6pandas_5algos_16median)};
static PyObject *__pyx_pw_6pandas_5algos_539__pyx_fuse_2median(PyObject *__pyx_self, PyObject *__pyx_arg_arr) {
  __Pyx_memviewslice __pyx_v_arr = { 0, 0, { 0 }, { 0 }, { 0 } };
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__pyx_fuse_2median (wrapper)", 0);
  assert(__pyx_arg_arr); {
    __pyx_v_arr = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int32_t(__pyx_arg_arr); if (unlikely(!__pyx_v_arr.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas.algos.__pyx_fuse_2median", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6pandas_5algos_538__pyx_fuse_2median(__pyx_self, __pyx_v_arr);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pandas_5algos_538__pyx_fuse_2median(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_arr) {
  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("__pyx_fuse_2median", 0);
  __Pyx_XDECREF(__pyx_r);
  if (unlikely(!__pyx_v_arr.memview)) { __Pyx_RaiseUnboundLocalError("arr"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
  __pyx_t_1 = __Pyx_PyInt_From_npy_int32(__pyx_fuse_2__pyx_f_6pandas_5algos_median(__pyx_v_arr, 0)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pandas.algos.__pyx_fuse_2median", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __PYX_XDEC_MEMVIEW(&__pyx_v_arr, 1);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pw_6pandas_5algos_541__pyx_fuse_3median(PyObject *__pyx_self, PyObject *__pyx_arg_arr); /*proto*/
static PyObject *__pyx_pw_6pandas_5algos_17median(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static __pyx_t_5numpy_int64_t __pyx_fuse_3__pyx_f_6pandas_5algos_median(__Pyx_memviewslice __pyx_v_arr, CYTHON_UNUSED int __pyx_skip_dispatch) {
  Py_ssize_t __pyx_v_n;
  __pyx_t_5numpy_int64_t __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  Py_ssize_t __pyx_t_3;
  int __pyx_t_4;
  __pyx_t_5numpy_int64_t __pyx_t_5;
  __Pyx_memviewslice __pyx_t_6 = { 0, 0, { 0 }, { 0 }, { 0 } };
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__pyx_fuse_3median", 0);
  __PYX_INC_MEMVIEW(&__pyx_v_arr, 1);

  /* "pandas/algos.pyx":827
 *     A faster median
 *     '''
 *     cdef Py_ssize_t n = arr.size             # <<<<<<<<<<<<<<
 * 
 *     if n == 0:
 */
  __pyx_t_1 = __pyx_memoryview_fromslice(__pyx_v_arr, 1, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_5numpy_int64_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_5numpy_int64_t, 0);; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 827; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_size); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 827; __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_PyIndex_AsSsize_t(__pyx_t_2); if (unlikely((__pyx_t_3 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 827; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_n = __pyx_t_3;

  /* "pandas/algos.pyx":829
 *     cdef Py_ssize_t n = arr.size
 * 
 *     if n == 0:             # <<<<<<<<<<<<<<
 *         return np.NaN
 * 
 */
  __pyx_t_4 = ((__pyx_v_n == 0) != 0);
  if (__pyx_t_4) {

    /* "pandas/algos.pyx":830
 * 
 *     if n == 0:
 *         return np.NaN             # <<<<<<<<<<<<<<
 * 
 *     arr = arr.copy()
 */
    __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 830; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_NaN); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 830; __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_As_npy_int64(__pyx_t_1); if (unlikely((__pyx_t_5 == (npy_int64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 830; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_r = __pyx_t_5;
    goto __pyx_L0;
  }

  /* "pandas/algos.pyx":832
 *         return np.NaN
 * 
 *     arr = arr.copy()             # <<<<<<<<<<<<<<
 * 
 *     if n % 2:
 */
  __pyx_t_6 = __pyx_memoryview_copy_slice_dc_nn___pyx_t_5numpy_int64_t_c(__pyx_v_arr); if (unlikely(!__pyx_t_6.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 832; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __PYX_XDEC_MEMVIEW(&__pyx_v_arr, 1);
  __pyx_v_arr = __pyx_t_6;
  __pyx_t_6.memview = NULL;
  __pyx_t_6.data = NULL;

  /* "pandas/algos.pyx":834
 *     arr = arr.copy()
 * 
 *     if n % 2:             # <<<<<<<<<<<<<<
 *         return kth_smallest(arr, n // 2)
 *     else:
 */
  __pyx_t_4 = (__Pyx_mod_Py_ssize_t(__pyx_v_n, 2) != 0);
  if (__pyx_t_4) {

    /* "pandas/algos.pyx":835
 * 
 *     if n % 2:
 *         return kth_smallest(arr, n // 2)             # <<<<<<<<<<<<<<
 *     else:
 *         return (kth_smallest(arr, n // 2) +
 */
    __pyx_r = __pyx_fuse_3__pyx_f_6pandas_5algos_kth_smallest(__pyx_v_arr, __Pyx_div_Py_ssize_t(__pyx_v_n, 2), 0);
    goto __pyx_L0;
  }
  /*else*/ {

    /* "pandas/algos.pyx":838
 *     else:
 *         return (kth_smallest(arr, n // 2) +
 *                 kth_smallest(arr, n // 2 - 1)) / 2             # <<<<<<<<<<<<<<
 * 
 * 
 */
    __pyx_r = __Pyx_div___pyx_t_5numpy_int64_t((__pyx_fuse_3__pyx_f_6pandas_5algos_kth_smallest(__pyx_v_arr, __Pyx_div_Py_ssize_t(__pyx_v_n, 2), 0) + __pyx_fuse_3__pyx_f_6pandas_5algos_kth_smallest(__pyx_v_arr, (__Pyx_div_Py_ssize_t(__pyx_v_n, 2) - 1), 0)), 2);
    goto __pyx_L0;
  }

  /* "pandas/algos.pyx":823
 * 
 * 
 * cpdef numeric median(numeric[:] arr):             # <<<<<<<<<<<<<<
 *     '''
 *     A faster median
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __PYX_XDEC_MEMVIEW(&__pyx_t_6, 1);
  __Pyx_WriteUnraisable("pandas.algos.median", __pyx_clineno, __pyx_lineno, __pyx_filename, 0);
  __pyx_r = 0;
  __pyx_L0:;
  __PYX_XDEC_MEMVIEW(&__pyx_v_arr, 1);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_6pandas_5algos_541__pyx_fuse_3median(PyObject *__pyx_self, PyObject *__pyx_arg_arr); /*proto*/
static PyMethodDef __pyx_fuse_3__pyx_mdef_6pandas_5algos_541__pyx_fuse_3median = {__Pyx_NAMESTR("__pyx_fuse_3median"), (PyCFunction)__pyx_pw_6pandas_5algos_541__pyx_fuse_3median, METH_O, __Pyx_DOCSTR(__pyx_doc_6pandas_5algos_16median)};
static PyObject *__pyx_pw_6pandas_5algos_541__pyx_fuse_3median(PyObject *__pyx_self, PyObject *__pyx_arg_arr) {
  __Pyx_memviewslice __pyx_v_arr = { 0, 0, { 0 }, { 0 }, { 0 } };
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__pyx_fuse_3median (wrapper)", 0);
  assert(__pyx_arg_arr); {
    __pyx_v_arr = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int64_t(__pyx_arg_arr); if (unlikely(!__pyx_v_arr.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas.algos.__pyx_fuse_3median", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6pandas_5algos_540__pyx_fuse_3median(__pyx_self, __pyx_v_arr);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pandas_5algos_540__pyx_fuse_3median(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_arr) {
  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("__pyx_fuse_3median", 0);
  __Pyx_XDECREF(__pyx_r);
  if (unlikely(!__pyx_v_arr.memview)) { __Pyx_RaiseUnboundLocalError("arr"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
  __pyx_t_1 = __Pyx_PyInt_From_npy_int64(__pyx_fuse_3__pyx_f_6pandas_5algos_median(__pyx_v_arr, 0)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pandas.algos.__pyx_fuse_3median", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __PYX_XDEC_MEMVIEW(&__pyx_v_arr, 1);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pw_6pandas_5algos_543__pyx_fuse_4median(PyObject *__pyx_self, PyObject *__pyx_arg_arr); /*proto*/
static PyObject *__pyx_pw_6pandas_5algos_17median(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static __pyx_t_5numpy_uint8_t __pyx_fuse_4__pyx_f_6pandas_5algos_median(__Pyx_memviewslice __pyx_v_arr, CYTHON_UNUSED int __pyx_skip_dispatch) {
  Py_ssize_t __pyx_v_n;
  __pyx_t_5numpy_uint8_t __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  Py_ssize_t __pyx_t_3;
  int __pyx_t_4;
  __pyx_t_5numpy_uint8_t __pyx_t_5;
  __Pyx_memviewslice __pyx_t_6 = { 0, 0, { 0 }, { 0 }, { 0 } };
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__pyx_fuse_4median", 0);
  __PYX_INC_MEMVIEW(&__pyx_v_arr, 1);

  /* "pandas/algos.pyx":827
 *     A faster median
 *     '''
 *     cdef Py_ssize_t n = arr.size             # <<<<<<<<<<<<<<
 * 
 *     if n == 0:
 */
  __pyx_t_1 = __pyx_memoryview_fromslice(__pyx_v_arr, 1, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_5numpy_uint8_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_5numpy_uint8_t, 0);; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 827; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_size); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 827; __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_PyIndex_AsSsize_t(__pyx_t_2); if (unlikely((__pyx_t_3 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 827; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_n = __pyx_t_3;

  /* "pandas/algos.pyx":829
 *     cdef Py_ssize_t n = arr.size
 * 
 *     if n == 0:             # <<<<<<<<<<<<<<
 *         return np.NaN
 * 
 */
  __pyx_t_4 = ((__pyx_v_n == 0) != 0);
  if (__pyx_t_4) {

    /* "pandas/algos.pyx":830
 * 
 *     if n == 0:
 *         return np.NaN             # <<<<<<<<<<<<<<
 * 
 *     arr = arr.copy()
 */
    __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 830; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_NaN); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 830; __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_As_npy_uint8(__pyx_t_1); if (unlikely((__pyx_t_5 == (npy_uint8)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 830; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_r = __pyx_t_5;
    goto __pyx_L0;
  }

  /* "pandas/algos.pyx":832
 *         return np.NaN
 * 
 *     arr = arr.copy()             # <<<<<<<<<<<<<<
 * 
 *     if n % 2:
 */
  __pyx_t_6 = __pyx_memoryview_copy_slice_dc_nn___pyx_t_5numpy_uint8_t_c(__pyx_v_arr); if (unlikely(!__pyx_t_6.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 832; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __PYX_XDEC_MEMVIEW(&__pyx_v_arr, 1);
  __pyx_v_arr = __pyx_t_6;
  __pyx_t_6.memview = NULL;
  __pyx_t_6.data = NULL;

  /* "pandas/algos.pyx":834
 *     arr = arr.copy()
 * 
 *     if n % 2:             # <<<<<<<<<<<<<<
 *         return kth_smallest(arr, n // 2)
 *     else:
 */
  __pyx_t_4 = (__Pyx_mod_Py_ssize_t(__pyx_v_n, 2) != 0);
  if (__pyx_t_4) {

    /* "pandas/algos.pyx":835
 * 
 *     if n % 2:
 *         return kth_smallest(arr, n // 2)             # <<<<<<<<<<<<<<
 *     else:
 *         return (kth_smallest(arr, n // 2) +
 */
    __pyx_r = __pyx_fuse_4__pyx_f_6pandas_5algos_kth_smallest(__pyx_v_arr, __Pyx_div_Py_ssize_t(__pyx_v_n, 2), 0);
    goto __pyx_L0;
  }
  /*else*/ {

    /* "pandas/algos.pyx":838
 *     else:
 *         return (kth_smallest(arr, n // 2) +
 *                 kth_smallest(arr, n // 2 - 1)) / 2             # <<<<<<<<<<<<<<
 * 
 * 
 */
    __pyx_r = __Pyx_div_long((__pyx_fuse_4__pyx_f_6pandas_5algos_kth_smallest(__pyx_v_arr, __Pyx_div_Py_ssize_t(__pyx_v_n, 2), 0) + __pyx_fuse_4__pyx_f_6pandas_5algos_kth_smallest(__pyx_v_arr, (__Pyx_div_Py_ssize_t(__pyx_v_n, 2) - 1), 0)), 2);
    goto __pyx_L0;
  }

  /* "pandas/algos.pyx":823
 * 
 * 
 * cpdef numeric median(numeric[:] arr):             # <<<<<<<<<<<<<<
 *     '''
 *     A faster median
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __PYX_XDEC_MEMVIEW(&__pyx_t_6, 1);
  __Pyx_WriteUnraisable("pandas.algos.median", __pyx_clineno, __pyx_lineno, __pyx_filename, 0);
  __pyx_r = 0;
  __pyx_L0:;
  __PYX_XDEC_MEMVIEW(&__pyx_v_arr, 1);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_6pandas_5algos_543__pyx_fuse_4median(PyObject *__pyx_self, PyObject *__pyx_arg_arr); /*proto*/
static PyMethodDef __pyx_fuse_4__pyx_mdef_6pandas_5algos_543__pyx_fuse_4median = {__Pyx_NAMESTR("__pyx_fuse_4median"), (PyCFunction)__pyx_pw_6pandas_5algos_543__pyx_fuse_4median, METH_O, __Pyx_DOCSTR(__pyx_doc_6pandas_5algos_16median)};
static PyObject *__pyx_pw_6pandas_5algos_543__pyx_fuse_4median(PyObject *__pyx_self, PyObject *__pyx_arg_arr) {
  __Pyx_memviewslice __pyx_v_arr = { 0, 0, { 0 }, { 0 }, { 0 } };
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__pyx_fuse_4median (wrapper)", 0);
  assert(__pyx_arg_arr); {
    __pyx_v_arr = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_uint8_t(__pyx_arg_arr); if (unlikely(!__pyx_v_arr.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas.algos.__pyx_fuse_4median", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6pandas_5algos_542__pyx_fuse_4median(__pyx_self, __pyx_v_arr);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pandas_5algos_542__pyx_fuse_4median(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_arr) {
  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("__pyx_fuse_4median", 0);
  __Pyx_XDECREF(__pyx_r);
  if (unlikely(!__pyx_v_arr.memview)) { __Pyx_RaiseUnboundLocalError("arr"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
  __pyx_t_1 = __Pyx_PyInt_From_npy_uint8(__pyx_fuse_4__pyx_f_6pandas_5algos_median(__pyx_v_arr, 0)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pandas.algos.__pyx_fuse_4median", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __PYX_XDEC_MEMVIEW(&__pyx_v_arr, 1);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pw_6pandas_5algos_545__pyx_fuse_5median(PyObject *__pyx_self, PyObject *__pyx_arg_arr); /*proto*/
static PyObject *__pyx_pw_6pandas_5algos_17median(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static __pyx_t_5numpy_uint16_t __pyx_fuse_5__pyx_f_6pandas_5algos_median(__Pyx_memviewslice __pyx_v_arr, CYTHON_UNUSED int __pyx_skip_dispatch) {
  Py_ssize_t __pyx_v_n;
  __pyx_t_5numpy_uint16_t __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  Py_ssize_t __pyx_t_3;
  int __pyx_t_4;
  __pyx_t_5numpy_uint16_t __pyx_t_5;
  __Pyx_memviewslice __pyx_t_6 = { 0, 0, { 0 }, { 0 }, { 0 } };
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__pyx_fuse_5median", 0);
  __PYX_INC_MEMVIEW(&__pyx_v_arr, 1);

  /* "pandas/algos.pyx":827
 *     A faster median
 *     '''
 *     cdef Py_ssize_t n = arr.size             # <<<<<<<<<<<<<<
 * 
 *     if n == 0:
 */
  __pyx_t_1 = __pyx_memoryview_fromslice(__pyx_v_arr, 1, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_5numpy_uint16_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_5numpy_uint16_t, 0);; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 827; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_size); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 827; __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_PyIndex_AsSsize_t(__pyx_t_2); if (unlikely((__pyx_t_3 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 827; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_n = __pyx_t_3;

  /* "pandas/algos.pyx":829
 *     cdef Py_ssize_t n = arr.size
 * 
 *     if n == 0:             # <<<<<<<<<<<<<<
 *         return np.NaN
 * 
 */
  __pyx_t_4 = ((__pyx_v_n == 0) != 0);
  if (__pyx_t_4) {

    /* "pandas/algos.pyx":830
 * 
 *     if n == 0:
 *         return np.NaN             # <<<<<<<<<<<<<<
 * 
 *     arr = arr.copy()
 */
    __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 830; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_NaN); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 830; __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_As_npy_uint16(__pyx_t_1); if (unlikely((__pyx_t_5 == (npy_uint16)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 830; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_r = __pyx_t_5;
    goto __pyx_L0;
  }

  /* "pandas/algos.pyx":832
 *         return np.NaN
 * 
 *     arr = arr.copy()             # <<<<<<<<<<<<<<
 * 
 *     if n % 2:
 */
  __pyx_t_6 = __pyx_memoryview_copy_slice_dc_nn___pyx_t_5numpy_uint16_t_c(__pyx_v_arr); if (unlikely(!__pyx_t_6.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 832; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __PYX_XDEC_MEMVIEW(&__pyx_v_arr, 1);
  __pyx_v_arr = __pyx_t_6;
  __pyx_t_6.memview = NULL;
  __pyx_t_6.data = NULL;

  /* "pandas/algos.pyx":834
 *     arr = arr.copy()
 * 
 *     if n % 2:             # <<<<<<<<<<<<<<
 *         return kth_smallest(arr, n // 2)
 *     else:
 */
  __pyx_t_4 = (__Pyx_mod_Py_ssize_t(__pyx_v_n, 2) != 0);
  if (__pyx_t_4) {

    /* "pandas/algos.pyx":835
 * 
 *     if n % 2:
 *         return kth_smallest(arr, n // 2)             # <<<<<<<<<<<<<<
 *     else:
 *         return (kth_smallest(arr, n // 2) +
 */
    __pyx_r = __pyx_fuse_5__pyx_f_6pandas_5algos_kth_smallest(__pyx_v_arr, __Pyx_div_Py_ssize_t(__pyx_v_n, 2), 0);
    goto __pyx_L0;
  }
  /*else*/ {

    /* "pandas/algos.pyx":838
 *     else:
 *         return (kth_smallest(arr, n // 2) +
 *                 kth_smallest(arr, n // 2 - 1)) / 2             # <<<<<<<<<<<<<<
 * 
 * 
 */
    __pyx_r = __Pyx_div_long((__pyx_fuse_5__pyx_f_6pandas_5algos_kth_smallest(__pyx_v_arr, __Pyx_div_Py_ssize_t(__pyx_v_n, 2), 0) + __pyx_fuse_5__pyx_f_6pandas_5algos_kth_smallest(__pyx_v_arr, (__Pyx_div_Py_ssize_t(__pyx_v_n, 2) - 1), 0)), 2);
    goto __pyx_L0;
  }

  /* "pandas/algos.pyx":823
 * 
 * 
 * cpdef numeric median(numeric[:] arr):             # <<<<<<<<<<<<<<
 *     '''
 *     A faster median
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __PYX_XDEC_MEMVIEW(&__pyx_t_6, 1);
  __Pyx_WriteUnraisable("pandas.algos.median", __pyx_clineno, __pyx_lineno, __pyx_filename, 0);
  __pyx_r = 0;
  __pyx_L0:;
  __PYX_XDEC_MEMVIEW(&__pyx_v_arr, 1);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_6pandas_5algos_545__pyx_fuse_5median(PyObject *__pyx_self, PyObject *__pyx_arg_arr); /*proto*/
static PyMethodDef __pyx_fuse_5__pyx_mdef_6pandas_5algos_545__pyx_fuse_5median = {__Pyx_NAMESTR("__pyx_fuse_5median"), (PyCFunction)__pyx_pw_6pandas_5algos_545__pyx_fuse_5median, METH_O, __Pyx_DOCSTR(__pyx_doc_6pandas_5algos_16median)};
static PyObject *__pyx_pw_6pandas_5algos_545__pyx_fuse_5median(PyObject *__pyx_self, PyObject *__pyx_arg_arr) {
  __Pyx_memviewslice __pyx_v_arr = { 0, 0, { 0 }, { 0 }, { 0 } };
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__pyx_fuse_5median (wrapper)", 0);
  assert(__pyx_arg_arr); {
    __pyx_v_arr = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_uint16_t(__pyx_arg_arr); if (unlikely(!__pyx_v_arr.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas.algos.__pyx_fuse_5median", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6pandas_5algos_544__pyx_fuse_5median(__pyx_self, __pyx_v_arr);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pandas_5algos_544__pyx_fuse_5median(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_arr) {
  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("__pyx_fuse_5median", 0);
  __Pyx_XDECREF(__pyx_r);
  if (unlikely(!__pyx_v_arr.memview)) { __Pyx_RaiseUnboundLocalError("arr"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
  __pyx_t_1 = __Pyx_PyInt_From_npy_uint16(__pyx_fuse_5__pyx_f_6pandas_5algos_median(__pyx_v_arr, 0)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pandas.algos.__pyx_fuse_5median", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __PYX_XDEC_MEMVIEW(&__pyx_v_arr, 1);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pw_6pandas_5algos_547__pyx_fuse_6median(PyObject *__pyx_self, PyObject *__pyx_arg_arr); /*proto*/
static PyObject *__pyx_pw_6pandas_5algos_17median(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static __pyx_t_5numpy_uint32_t __pyx_fuse_6__pyx_f_6pandas_5algos_median(__Pyx_memviewslice __pyx_v_arr, CYTHON_UNUSED int __pyx_skip_dispatch) {
  Py_ssize_t __pyx_v_n;
  __pyx_t_5numpy_uint32_t __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  Py_ssize_t __pyx_t_3;
  int __pyx_t_4;
  __pyx_t_5numpy_uint32_t __pyx_t_5;
  __Pyx_memviewslice __pyx_t_6 = { 0, 0, { 0 }, { 0 }, { 0 } };
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__pyx_fuse_6median", 0);
  __PYX_INC_MEMVIEW(&__pyx_v_arr, 1);

  /* "pandas/algos.pyx":827
 *     A faster median
 *     '''
 *     cdef Py_ssize_t n = arr.size             # <<<<<<<<<<<<<<
 * 
 *     if n == 0:
 */
  __pyx_t_1 = __pyx_memoryview_fromslice(__pyx_v_arr, 1, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_5numpy_uint32_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_5numpy_uint32_t, 0);; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 827; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_size); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 827; __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_PyIndex_AsSsize_t(__pyx_t_2); if (unlikely((__pyx_t_3 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 827; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_n = __pyx_t_3;

  /* "pandas/algos.pyx":829
 *     cdef Py_ssize_t n = arr.size
 * 
 *     if n == 0:             # <<<<<<<<<<<<<<
 *         return np.NaN
 * 
 */
  __pyx_t_4 = ((__pyx_v_n == 0) != 0);
  if (__pyx_t_4) {

    /* "pandas/algos.pyx":830
 * 
 *     if n == 0:
 *         return np.NaN             # <<<<<<<<<<<<<<
 * 
 *     arr = arr.copy()
 */
    __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 830; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_NaN); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 830; __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_As_npy_uint32(__pyx_t_1); if (unlikely((__pyx_t_5 == (npy_uint32)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 830; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_r = __pyx_t_5;
    goto __pyx_L0;
  }

  /* "pandas/algos.pyx":832
 *         return np.NaN
 * 
 *     arr = arr.copy()             # <<<<<<<<<<<<<<
 * 
 *     if n % 2:
 */
  __pyx_t_6 = __pyx_memoryview_copy_slice_dc_nn___pyx_t_5numpy_uint32_t_c(__pyx_v_arr); if (unlikely(!__pyx_t_6.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 832; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __PYX_XDEC_MEMVIEW(&__pyx_v_arr, 1);
  __pyx_v_arr = __pyx_t_6;
  __pyx_t_6.memview = NULL;
  __pyx_t_6.data = NULL;

  /* "pandas/algos.pyx":834
 *     arr = arr.copy()
 * 
 *     if n % 2:             # <<<<<<<<<<<<<<
 *         return kth_smallest(arr, n // 2)
 *     else:
 */
  __pyx_t_4 = (__Pyx_mod_Py_ssize_t(__pyx_v_n, 2) != 0);
  if (__pyx_t_4) {

    /* "pandas/algos.pyx":835
 * 
 *     if n % 2:
 *         return kth_smallest(arr, n // 2)             # <<<<<<<<<<<<<<
 *     else:
 *         return (kth_smallest(arr, n // 2) +
 */
    __pyx_r = __pyx_fuse_6__pyx_f_6pandas_5algos_kth_smallest(__pyx_v_arr, __Pyx_div_Py_ssize_t(__pyx_v_n, 2), 0);
    goto __pyx_L0;
  }
  /*else*/ {

    /* "pandas/algos.pyx":838
 *     else:
 *         return (kth_smallest(arr, n // 2) +
 *                 kth_smallest(arr, n // 2 - 1)) / 2             # <<<<<<<<<<<<<<
 * 
 * 
 */
    __pyx_r = __Pyx_div_long((__pyx_fuse_6__pyx_f_6pandas_5algos_kth_smallest(__pyx_v_arr, __Pyx_div_Py_ssize_t(__pyx_v_n, 2), 0) + __pyx_fuse_6__pyx_f_6pandas_5algos_kth_smallest(__pyx_v_arr, (__Pyx_div_Py_ssize_t(__pyx_v_n, 2) - 1), 0)), 2);
    goto __pyx_L0;
  }

  /* "pandas/algos.pyx":823
 * 
 * 
 * cpdef numeric median(numeric[:] arr):             # <<<<<<<<<<<<<<
 *     '''
 *     A faster median
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __PYX_XDEC_MEMVIEW(&__pyx_t_6, 1);
  __Pyx_WriteUnraisable("pandas.algos.median", __pyx_clineno, __pyx_lineno, __pyx_filename, 0);
  __pyx_r = 0;
  __pyx_L0:;
  __PYX_XDEC_MEMVIEW(&__pyx_v_arr, 1);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_6pandas_5algos_547__pyx_fuse_6median(PyObject *__pyx_self, PyObject *__pyx_arg_arr); /*proto*/
static PyMethodDef __pyx_fuse_6__pyx_mdef_6pandas_5algos_547__pyx_fuse_6median = {__Pyx_NAMESTR("__pyx_fuse_6median"), (PyCFunction)__pyx_pw_6pandas_5algos_547__pyx_fuse_6median, METH_O, __Pyx_DOCSTR(__pyx_doc_6pandas_5algos_16median)};
static PyObject *__pyx_pw_6pandas_5algos_547__pyx_fuse_6median(PyObject *__pyx_self, PyObject *__pyx_arg_arr) {
  __Pyx_memviewslice __pyx_v_arr = { 0, 0, { 0 }, { 0 }, { 0 } };
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__pyx_fuse_6median (wrapper)", 0);
  assert(__pyx_arg_arr); {
    __pyx_v_arr = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_uint32_t(__pyx_arg_arr); if (unlikely(!__pyx_v_arr.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas.algos.__pyx_fuse_6median", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6pandas_5algos_546__pyx_fuse_6median(__pyx_self, __pyx_v_arr);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pandas_5algos_546__pyx_fuse_6median(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_arr) {
  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("__pyx_fuse_6median", 0);
  __Pyx_XDECREF(__pyx_r);
  if (unlikely(!__pyx_v_arr.memview)) { __Pyx_RaiseUnboundLocalError("arr"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
  __pyx_t_1 = __Pyx_PyInt_From_npy_uint32(__pyx_fuse_6__pyx_f_6pandas_5algos_median(__pyx_v_arr, 0)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pandas.algos.__pyx_fuse_6median", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __PYX_XDEC_MEMVIEW(&__pyx_v_arr, 1);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pw_6pandas_5algos_549__pyx_fuse_7median(PyObject *__pyx_self, PyObject *__pyx_arg_arr); /*proto*/
static PyObject *__pyx_pw_6pandas_5algos_17median(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static __pyx_t_5numpy_uint64_t __pyx_fuse_7__pyx_f_6pandas_5algos_median(__Pyx_memviewslice __pyx_v_arr, CYTHON_UNUSED int __pyx_skip_dispatch) {
  Py_ssize_t __pyx_v_n;
  __pyx_t_5numpy_uint64_t __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  Py_ssize_t __pyx_t_3;
  int __pyx_t_4;
  __pyx_t_5numpy_uint64_t __pyx_t_5;
  __Pyx_memviewslice __pyx_t_6 = { 0, 0, { 0 }, { 0 }, { 0 } };
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__pyx_fuse_7median", 0);
  __PYX_INC_MEMVIEW(&__pyx_v_arr, 1);

  /* "pandas/algos.pyx":827
 *     A faster median
 *     '''
 *     cdef Py_ssize_t n = arr.size             # <<<<<<<<<<<<<<
 * 
 *     if n == 0:
 */
  __pyx_t_1 = __pyx_memoryview_fromslice(__pyx_v_arr, 1, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_5numpy_uint64_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_5numpy_uint64_t, 0);; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 827; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_size); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 827; __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_PyIndex_AsSsize_t(__pyx_t_2); if (unlikely((__pyx_t_3 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 827; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_n = __pyx_t_3;

  /* "pandas/algos.pyx":829
 *     cdef Py_ssize_t n = arr.size
 * 
 *     if n == 0:             # <<<<<<<<<<<<<<
 *         return np.NaN
 * 
 */
  __pyx_t_4 = ((__pyx_v_n == 0) != 0);
  if (__pyx_t_4) {

    /* "pandas/algos.pyx":830
 * 
 *     if n == 0:
 *         return np.NaN             # <<<<<<<<<<<<<<
 * 
 *     arr = arr.copy()
 */
    __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 830; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_NaN); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 830; __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_As_npy_uint64(__pyx_t_1); if (unlikely((__pyx_t_5 == (npy_uint64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 830; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_r = __pyx_t_5;
    goto __pyx_L0;
  }

  /* "pandas/algos.pyx":832
 *         return np.NaN
 * 
 *     arr = arr.copy()             # <<<<<<<<<<<<<<
 * 
 *     if n % 2:
 */
  __pyx_t_6 = __pyx_memoryview_copy_slice_dc_nn___pyx_t_5numpy_uint64_t_c(__pyx_v_arr); if (unlikely(!__pyx_t_6.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 832; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __PYX_XDEC_MEMVIEW(&__pyx_v_arr, 1);
  __pyx_v_arr = __pyx_t_6;
  __pyx_t_6.memview = NULL;
  __pyx_t_6.data = NULL;

  /* "pandas/algos.pyx":834
 *     arr = arr.copy()
 * 
 *     if n % 2:             # <<<<<<<<<<<<<<
 *         return kth_smallest(arr, n // 2)
 *     else:
 */
  __pyx_t_4 = (__Pyx_mod_Py_ssize_t(__pyx_v_n, 2) != 0);
  if (__pyx_t_4) {

    /* "pandas/algos.pyx":835
 * 
 *     if n % 2:
 *         return kth_smallest(arr, n // 2)             # <<<<<<<<<<<<<<
 *     else:
 *         return (kth_smallest(arr, n // 2) +
 */
    __pyx_r = __pyx_fuse_7__pyx_f_6pandas_5algos_kth_smallest(__pyx_v_arr, __Pyx_div_Py_ssize_t(__pyx_v_n, 2), 0);
    goto __pyx_L0;
  }
  /*else*/ {

    /* "pandas/algos.pyx":838
 *     else:
 *         return (kth_smallest(arr, n // 2) +
 *                 kth_smallest(arr, n // 2 - 1)) / 2             # <<<<<<<<<<<<<<
 * 
 * 
 */
    __pyx_r = ((__pyx_fuse_7__pyx_f_6pandas_5algos_kth_smallest(__pyx_v_arr, __Pyx_div_Py_ssize_t(__pyx_v_n, 2), 0) + __pyx_fuse_7__pyx_f_6pandas_5algos_kth_smallest(__pyx_v_arr, (__Pyx_div_Py_ssize_t(__pyx_v_n, 2) - 1), 0)) / 2);
    goto __pyx_L0;
  }

  /* "pandas/algos.pyx":823
 * 
 * 
 * cpdef numeric median(numeric[:] arr):             # <<<<<<<<<<<<<<
 *     '''
 *     A faster median
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __PYX_XDEC_MEMVIEW(&__pyx_t_6, 1);
  __Pyx_WriteUnraisable("pandas.algos.median", __pyx_clineno, __pyx_lineno, __pyx_filename, 0);
  __pyx_r = 0;
  __pyx_L0:;
  __PYX_XDEC_MEMVIEW(&__pyx_v_arr, 1);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_6pandas_5algos_549__pyx_fuse_7median(PyObject *__pyx_self, PyObject *__pyx_arg_arr); /*proto*/
static PyMethodDef __pyx_fuse_7__pyx_mdef_6pandas_5algos_549__pyx_fuse_7median = {__Pyx_NAMESTR("__pyx_fuse_7median"), (PyCFunction)__pyx_pw_6pandas_5algos_549__pyx_fuse_7median, METH_O, __Pyx_DOCSTR(__pyx_doc_6pandas_5algos_16median)};
static PyObject *__pyx_pw_6pandas_5algos_549__pyx_fuse_7median(PyObject *__pyx_self, PyObject *__pyx_arg_arr) {
  __Pyx_memviewslice __pyx_v_arr = { 0, 0, { 0 }, { 0 }, { 0 } };
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__pyx_fuse_7median (wrapper)", 0);
  assert(__pyx_arg_arr); {
    __pyx_v_arr = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_uint64_t(__pyx_arg_arr); if (unlikely(!__pyx_v_arr.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas.algos.__pyx_fuse_7median", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6pandas_5algos_548__pyx_fuse_7median(__pyx_self, __pyx_v_arr);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pandas_5algos_548__pyx_fuse_7median(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_arr) {
  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("__pyx_fuse_7median", 0);
  __Pyx_XDECREF(__pyx_r);
  if (unlikely(!__pyx_v_arr.memview)) { __Pyx_RaiseUnboundLocalError("arr"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
  __pyx_t_1 = __Pyx_PyInt_From_npy_uint64(__pyx_fuse_7__pyx_f_6pandas_5algos_median(__pyx_v_arr, 0)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pandas.algos.__pyx_fuse_7median", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __PYX_XDEC_MEMVIEW(&__pyx_v_arr, 1);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pw_6pandas_5algos_551__pyx_fuse_8median(PyObject *__pyx_self, PyObject *__pyx_arg_arr); /*proto*/
static PyObject *__pyx_pw_6pandas_5algos_17median(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static __pyx_t_5numpy_float32_t __pyx_fuse_8__pyx_f_6pandas_5algos_median(__Pyx_memviewslice __pyx_v_arr, CYTHON_UNUSED int __pyx_skip_dispatch) {
  Py_ssize_t __pyx_v_n;
  __pyx_t_5numpy_float32_t __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  Py_ssize_t __pyx_t_3;
  int __pyx_t_4;
  __pyx_t_5numpy_float32_t __pyx_t_5;
  __Pyx_memviewslice __pyx_t_6 = { 0, 0, { 0 }, { 0 }, { 0 } };
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__pyx_fuse_8median", 0);
  __PYX_INC_MEMVIEW(&__pyx_v_arr, 1);

  /* "pandas/algos.pyx":827
 *     A faster median
 *     '''
 *     cdef Py_ssize_t n = arr.size             # <<<<<<<<<<<<<<
 * 
 *     if n == 0:
 */
  __pyx_t_1 = __pyx_memoryview_fromslice(__pyx_v_arr, 1, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_5numpy_float32_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_5numpy_float32_t, 0);; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 827; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_size); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 827; __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_PyIndex_AsSsize_t(__pyx_t_2); if (unlikely((__pyx_t_3 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 827; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_n = __pyx_t_3;

  /* "pandas/algos.pyx":829
 *     cdef Py_ssize_t n = arr.size
 * 
 *     if n == 0:             # <<<<<<<<<<<<<<
 *         return np.NaN
 * 
 */
  __pyx_t_4 = ((__pyx_v_n == 0) != 0);
  if (__pyx_t_4) {

    /* "pandas/algos.pyx":830
 * 
 *     if n == 0:
 *         return np.NaN             # <<<<<<<<<<<<<<
 * 
 *     arr = arr.copy()
 */
    __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 830; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_NaN); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 830; __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_PyFloat_AsFloat(__pyx_t_1); if (unlikely((__pyx_t_5 == (npy_float32)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 830; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_r = __pyx_t_5;
    goto __pyx_L0;
  }

  /* "pandas/algos.pyx":832
 *         return np.NaN
 * 
 *     arr = arr.copy()             # <<<<<<<<<<<<<<
 * 
 *     if n % 2:
 */
  __pyx_t_6 = __pyx_memoryview_copy_slice_dc_nn___pyx_t_5numpy_float32_t_c(__pyx_v_arr); if (unlikely(!__pyx_t_6.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 832; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __PYX_XDEC_MEMVIEW(&__pyx_v_arr, 1);
  __pyx_v_arr = __pyx_t_6;
  __pyx_t_6.memview = NULL;
  __pyx_t_6.data = NULL;

  /* "pandas/algos.pyx":834
 *     arr = arr.copy()
 * 
 *     if n % 2:             # <<<<<<<<<<<<<<
 *         return kth_smallest(arr, n // 2)
 *     else:
 */
  __pyx_t_4 = (__Pyx_mod_Py_ssize_t(__pyx_v_n, 2) != 0);
  if (__pyx_t_4) {

    /* "pandas/algos.pyx":835
 * 
 *     if n % 2:
 *         return kth_smallest(arr, n // 2)             # <<<<<<<<<<<<<<
 *     else:
 *         return (kth_smallest(arr, n // 2) +
 */
    __pyx_r = __pyx_fuse_8__pyx_f_6pandas_5algos_kth_smallest(__pyx_v_arr, __Pyx_div_Py_ssize_t(__pyx_v_n, 2), 0);
    goto __pyx_L0;
  }
  /*else*/ {

    /* "pandas/algos.pyx":838
 *     else:
 *         return (kth_smallest(arr, n // 2) +
 *                 kth_smallest(arr, n // 2 - 1)) / 2             # <<<<<<<<<<<<<<
 * 
 * 
 */
    __pyx_r = ((__pyx_fuse_8__pyx_f_6pandas_5algos_kth_smallest(__pyx_v_arr, __Pyx_div_Py_ssize_t(__pyx_v_n, 2), 0) + __pyx_fuse_8__pyx_f_6pandas_5algos_kth_smallest(__pyx_v_arr, (__Pyx_div_Py_ssize_t(__pyx_v_n, 2) - 1), 0)) / 2.0);
    goto __pyx_L0;
  }

  /* "pandas/algos.pyx":823
 * 
 * 
 * cpdef numeric median(numeric[:] arr):             # <<<<<<<<<<<<<<
 *     '''
 *     A faster median
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __PYX_XDEC_MEMVIEW(&__pyx_t_6, 1);
  __Pyx_WriteUnraisable("pandas.algos.median", __pyx_clineno, __pyx_lineno, __pyx_filename, 0);
  __pyx_r = 0;
  __pyx_L0:;
  __PYX_XDEC_MEMVIEW(&__pyx_v_arr, 1);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_6pandas_5algos_551__pyx_fuse_8median(PyObject *__pyx_self, PyObject *__pyx_arg_arr); /*proto*/
static PyMethodDef __pyx_fuse_8__pyx_mdef_6pandas_5algos_551__pyx_fuse_8median = {__Pyx_NAMESTR("__pyx_fuse_8median"), (PyCFunction)__pyx_pw_6pandas_5algos_551__pyx_fuse_8median, METH_O, __Pyx_DOCSTR(__pyx_doc_6pandas_5algos_16median)};
static PyObject *__pyx_pw_6pandas_5algos_551__pyx_fuse_8median(PyObject *__pyx_self, PyObject *__pyx_arg_arr) {
  __Pyx_memviewslice __pyx_v_arr = { 0, 0, { 0 }, { 0 }, { 0 } };
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__pyx_fuse_8median (wrapper)", 0);
  assert(__pyx_arg_arr); {
    __pyx_v_arr = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float32_t(__pyx_arg_arr); if (unlikely(!__pyx_v_arr.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas.algos.__pyx_fuse_8median", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6pandas_5algos_550__pyx_fuse_8median(__pyx_self, __pyx_v_arr);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pandas_5algos_550__pyx_fuse_8median(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_arr) {
  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("__pyx_fuse_8median", 0);
  __Pyx_XDECREF(__pyx_r);
  if (unlikely(!__pyx_v_arr.memview)) { __Pyx_RaiseUnboundLocalError("arr"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
  __pyx_t_1 = PyFloat_FromDouble(__pyx_fuse_8__pyx_f_6pandas_5algos_median(__pyx_v_arr, 0)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pandas.algos.__pyx_fuse_8median", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __PYX_XDEC_MEMVIEW(&__pyx_v_arr, 1);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pw_6pandas_5algos_553__pyx_fuse_9median(PyObject *__pyx_self, PyObject *__pyx_arg_arr); /*proto*/
static PyObject *__pyx_pw_6pandas_5algos_17median(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static __pyx_t_5numpy_float64_t __pyx_fuse_9__pyx_f_6pandas_5algos_median(__Pyx_memviewslice __pyx_v_arr, CYTHON_UNUSED int __pyx_skip_dispatch) {
  Py_ssize_t __pyx_v_n;
  __pyx_t_5numpy_float64_t __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  Py_ssize_t __pyx_t_3;
  int __pyx_t_4;
  __pyx_t_5numpy_float64_t __pyx_t_5;
  __Pyx_memviewslice __pyx_t_6 = { 0, 0, { 0 }, { 0 }, { 0 } };
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__pyx_fuse_9median", 0);
  __PYX_INC_MEMVIEW(&__pyx_v_arr, 1);

  /* "pandas/algos.pyx":827
 *     A faster median
 *     '''
 *     cdef Py_ssize_t n = arr.size             # <<<<<<<<<<<<<<
 * 
 *     if n == 0:
 */
  __pyx_t_1 = __pyx_memoryview_fromslice(__pyx_v_arr, 1, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_5numpy_float64_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_5numpy_float64_t, 0);; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 827; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_size); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 827; __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_PyIndex_AsSsize_t(__pyx_t_2); if (unlikely((__pyx_t_3 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 827; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_n = __pyx_t_3;

  /* "pandas/algos.pyx":829
 *     cdef Py_ssize_t n = arr.size
 * 
 *     if n == 0:             # <<<<<<<<<<<<<<
 *         return np.NaN
 * 
 */
  __pyx_t_4 = ((__pyx_v_n == 0) != 0);
  if (__pyx_t_4) {

    /* "pandas/algos.pyx":830
 * 
 *     if n == 0:
 *         return np.NaN             # <<<<<<<<<<<<<<
 * 
 *     arr = arr.copy()
 */
    __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 830; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_NaN); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 830; __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_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_5 == (npy_float64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 830; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_r = __pyx_t_5;
    goto __pyx_L0;
  }

  /* "pandas/algos.pyx":832
 *         return np.NaN
 * 
 *     arr = arr.copy()             # <<<<<<<<<<<<<<
 * 
 *     if n % 2:
 */
  __pyx_t_6 = __pyx_memoryview_copy_slice_dc_nn___pyx_t_5numpy_float64_t_c(__pyx_v_arr); if (unlikely(!__pyx_t_6.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 832; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __PYX_XDEC_MEMVIEW(&__pyx_v_arr, 1);
  __pyx_v_arr = __pyx_t_6;
  __pyx_t_6.memview = NULL;
  __pyx_t_6.data = NULL;

  /* "pandas/algos.pyx":834
 *     arr = arr.copy()
 * 
 *     if n % 2:             # <<<<<<<<<<<<<<
 *         return kth_smallest(arr, n // 2)
 *     else:
 */
  __pyx_t_4 = (__Pyx_mod_Py_ssize_t(__pyx_v_n, 2) != 0);
  if (__pyx_t_4) {

    /* "pandas/algos.pyx":835
 * 
 *     if n % 2:
 *         return kth_smallest(arr, n // 2)             # <<<<<<<<<<<<<<
 *     else:
 *         return (kth_smallest(arr, n // 2) +
 */
    __pyx_r = __pyx_fuse_9__pyx_f_6pandas_5algos_kth_smallest(__pyx_v_arr, __Pyx_div_Py_ssize_t(__pyx_v_n, 2), 0);
    goto __pyx_L0;
  }
  /*else*/ {

    /* "pandas/algos.pyx":838
 *     else:
 *         return (kth_smallest(arr, n // 2) +
 *                 kth_smallest(arr, n // 2 - 1)) / 2             # <<<<<<<<<<<<<<
 * 
 * 
 */
    __pyx_r = ((__pyx_fuse_9__pyx_f_6pandas_5algos_kth_smallest(__pyx_v_arr, __Pyx_div_Py_ssize_t(__pyx_v_n, 2), 0) + __pyx_fuse_9__pyx_f_6pandas_5algos_kth_smallest(__pyx_v_arr, (__Pyx_div_Py_ssize_t(__pyx_v_n, 2) - 1), 0)) / 2.0);
    goto __pyx_L0;
  }

  /* "pandas/algos.pyx":823
 * 
 * 
 * cpdef numeric median(numeric[:] arr):             # <<<<<<<<<<<<<<
 *     '''
 *     A faster median
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __PYX_XDEC_MEMVIEW(&__pyx_t_6, 1);
  __Pyx_WriteUnraisable("pandas.algos.median", __pyx_clineno, __pyx_lineno, __pyx_filename, 0);
  __pyx_r = 0;
  __pyx_L0:;
  __PYX_XDEC_MEMVIEW(&__pyx_v_arr, 1);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_6pandas_5algos_553__pyx_fuse_9median(PyObject *__pyx_self, PyObject *__pyx_arg_arr); /*proto*/
static PyMethodDef __pyx_fuse_9__pyx_mdef_6pandas_5algos_553__pyx_fuse_9median = {__Pyx_NAMESTR("__pyx_fuse_9median"), (PyCFunction)__pyx_pw_6pandas_5algos_553__pyx_fuse_9median, METH_O, __Pyx_DOCSTR(__pyx_doc_6pandas_5algos_16median)};
static PyObject *__pyx_pw_6pandas_5algos_553__pyx_fuse_9median(PyObject *__pyx_self, PyObject *__pyx_arg_arr) {
  __Pyx_memviewslice __pyx_v_arr = { 0, 0, { 0 }, { 0 }, { 0 } };
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__pyx_fuse_9median (wrapper)", 0);
  assert(__pyx_arg_arr); {
    __pyx_v_arr = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float64_t(__pyx_arg_arr); if (unlikely(!__pyx_v_arr.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas.algos.__pyx_fuse_9median", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6pandas_5algos_552__pyx_fuse_9median(__pyx_self, __pyx_v_arr);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pandas_5algos_552__pyx_fuse_9median(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_arr) {
  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("__pyx_fuse_9median", 0);
  __Pyx_XDECREF(__pyx_r);
  if (unlikely(!__pyx_v_arr.memview)) { __Pyx_RaiseUnboundLocalError("arr"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
  __pyx_t_1 = PyFloat_FromDouble(__pyx_fuse_9__pyx_f_6pandas_5algos_median(__pyx_v_arr, 0)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pandas.algos.__pyx_fuse_9median", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __PYX_XDEC_MEMVIEW(&__pyx_v_arr, 1);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/algos.pyx":843
 * # -------------- Min, Max subsequence
 * 
 * def max_subseq(ndarray[double_t] arr):             # <<<<<<<<<<<<<<
 *     cdef:
 *         Py_ssize_t i=0,s=0,e=0,T,n
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pandas_5algos_19max_subseq(PyObject *__pyx_self, PyObject *__pyx_v_arr); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_5algos_19max_subseq = {__Pyx_NAMESTR("max_subseq"), (PyCFunction)__pyx_pw_6pandas_5algos_19max_subseq, METH_O, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pw_6pandas_5algos_19max_subseq(PyObject *__pyx_self, PyObject *__pyx_v_arr) {
  CYTHON_UNUSED int __pyx_lineno = 0;
  CYTHON_UNUSED const char *__pyx_filename = NULL;
  CYTHON_UNUSED int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("max_subseq (wrapper)", 0);
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_arr), __pyx_ptype_5numpy_ndarray, 1, "arr", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 843; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_18max_subseq(__pyx_self, ((PyArrayObject *)__pyx_v_arr));

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pandas_5algos_18max_subseq(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__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;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_arr;
  __Pyx_Buffer __pyx_pybuffer_arr;
  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", 0);
  __pyx_pybuffer_arr.pybuffer.buf = NULL;
  __pyx_pybuffer_arr.refcount = 0;
  __pyx_pybuffernd_arr.data = NULL;
  __pyx_pybuffernd_arr.rcbuffer = &__pyx_pybuffer_arr;
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_arr.rcbuffer->pybuffer, (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[0]; __pyx_lineno = 843; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_arr.diminfo[0].strides = __pyx_pybuffernd_arr.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_arr.diminfo[0].shape = __pyx_pybuffernd_arr.rcbuffer->pybuffer.shape[0];

  /* "pandas/algos.pyx":845
 * 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;

  /* "pandas/algos.pyx":848
 *         double m, S
 * 
 *     n = len(arr)             # <<<<<<<<<<<<<<
 * 
 *     if len(arr) == 0:
 */
  __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_arr)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 848; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_n = __pyx_t_1;

  /* "pandas/algos.pyx":850
 *     n = len(arr)
 * 
 *     if len(arr) == 0:             # <<<<<<<<<<<<<<
 *         return (-1,-1,None)
 * 
 */
  __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_arr)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 850; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_2 = ((__pyx_t_1 == 0) != 0);
  if (__pyx_t_2) {

    /* "pandas/algos.pyx":851
 * 
 *     if len(arr) == 0:
 *         return (-1,-1,None)             # <<<<<<<<<<<<<<
 * 
 *     m = arr[0]
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(__pyx_tuple__43);
    __pyx_r = __pyx_tuple__43;
    goto __pyx_L0;
  }

  /* "pandas/algos.pyx":853
 *         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_pybuffernd_arr.diminfo[0].shape;
    if (unlikely(__pyx_t_3 < 0)) __pyx_t_4 = 0;
  } else if (unlikely(__pyx_t_3 >= __pyx_pybuffernd_arr.diminfo[0].shape)) __pyx_t_4 = 0;
  if (unlikely(__pyx_t_4 != -1)) {
    __Pyx_RaiseBufferIndexError(__pyx_t_4);
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 853; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_v_m = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_double_t *, __pyx_pybuffernd_arr.rcbuffer->pybuffer.buf, __pyx_t_3, __pyx_pybuffernd_arr.diminfo[0].strides));

  /* "pandas/algos.pyx":854
 * 
 *     m = arr[0]
 *     S = m             # <<<<<<<<<<<<<<
 *     T = 0
 * 
 */
  __pyx_v_S = __pyx_v_m;

  /* "pandas/algos.pyx":855
 *     m = arr[0]
 *     S = m
 *     T = 0             # <<<<<<<<<<<<<<
 * 
 *     for i in range(1, n):
 */
  __pyx_v_T = 0;

  /* "pandas/algos.pyx":857
 *     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;

    /* "pandas/algos.pyx":859
 *     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) != 0);
    if (__pyx_t_2) {

      /* "pandas/algos.pyx":860
 *         # 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_pybuffernd_arr.diminfo[0].shape;
        if (unlikely(__pyx_t_6 < 0)) __pyx_t_4 = 0;
      } else if (unlikely(__pyx_t_6 >= __pyx_pybuffernd_arr.diminfo[0].shape)) __pyx_t_4 = 0;
      if (unlikely(__pyx_t_4 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_4);
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 860; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_v_S = (__pyx_v_S + (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_double_t *, __pyx_pybuffernd_arr.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_arr.diminfo[0].strides)));
      goto __pyx_L6;
    }
    /*else*/ {

      /* "pandas/algos.pyx":862
 *             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_pybuffernd_arr.diminfo[0].shape;
        if (unlikely(__pyx_t_7 < 0)) __pyx_t_4 = 0;
      } else if (unlikely(__pyx_t_7 >= __pyx_pybuffernd_arr.diminfo[0].shape)) __pyx_t_4 = 0;
      if (unlikely(__pyx_t_4 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_4);
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 862; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_v_S = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_double_t *, __pyx_pybuffernd_arr.rcbuffer->pybuffer.buf, __pyx_t_7, __pyx_pybuffernd_arr.diminfo[0].strides));

      /* "pandas/algos.pyx":863
 *         else:
 *             S = arr[i]
 *             T = i             # <<<<<<<<<<<<<<
 *         if S > m:
 *             s = T
 */
      __pyx_v_T = __pyx_v_i;
    }
    __pyx_L6:;

    /* "pandas/algos.pyx":864
 *             S = arr[i]
 *             T = i
 *         if S > m:             # <<<<<<<<<<<<<<
 *             s = T
 *             e = i
 */
    __pyx_t_2 = ((__pyx_v_S > __pyx_v_m) != 0);
    if (__pyx_t_2) {

      /* "pandas/algos.pyx":865
 *             T = i
 *         if S > m:
 *             s = T             # <<<<<<<<<<<<<<
 *             e = i
 *             m = S
 */
      __pyx_v_s = __pyx_v_T;

      /* "pandas/algos.pyx":866
 *         if S > m:
 *             s = T
 *             e = i             # <<<<<<<<<<<<<<
 *             m = S
 * 
 */
      __pyx_v_e = __pyx_v_i;

      /* "pandas/algos.pyx":867
 *             s = T
 *             e = i
 *             m = S             # <<<<<<<<<<<<<<
 * 
 *     return (s, e, m)
 */
      __pyx_v_m = __pyx_v_S;
      goto __pyx_L7;
    }
    __pyx_L7:;
  }

  /* "pandas/algos.pyx":869
 *             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[0]; __pyx_lineno = 869; __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[0]; __pyx_lineno = 869; __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[0]; __pyx_lineno = 869; __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[0]; __pyx_lineno = 869; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__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 = __pyx_t_11;
  __pyx_t_11 = 0;
  goto __pyx_L0;

  /* "pandas/algos.pyx":843
 * # -------------- Min, Max subsequence
 * 
 * def max_subseq(ndarray[double_t] arr):             # <<<<<<<<<<<<<<
 *     cdef:
 *         Py_ssize_t i=0,s=0,e=0,T,n
 */

  /* function exit code */
  __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_pybuffernd_arr.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas.algos.max_subseq", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_arr.rcbuffer->pybuffer);
  __pyx_L2:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/algos.pyx":871
 *     return (s, e, m)
 * 
 * def min_subseq(ndarray[double_t] arr):             # <<<<<<<<<<<<<<
 *     cdef:
 *         Py_ssize_t s, e
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pandas_5algos_21min_subseq(PyObject *__pyx_self, PyObject *__pyx_v_arr); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_5algos_21min_subseq = {__Pyx_NAMESTR("min_subseq"), (PyCFunction)__pyx_pw_6pandas_5algos_21min_subseq, METH_O, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pw_6pandas_5algos_21min_subseq(PyObject *__pyx_self, PyObject *__pyx_v_arr) {
  CYTHON_UNUSED int __pyx_lineno = 0;
  CYTHON_UNUSED const char *__pyx_filename = NULL;
  CYTHON_UNUSED int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("min_subseq (wrapper)", 0);
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_arr), __pyx_ptype_5numpy_ndarray, 1, "arr", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 871; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_20min_subseq(__pyx_self, ((PyArrayObject *)__pyx_v_arr));

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pandas_5algos_20min_subseq(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_arr) {
  Py_ssize_t __pyx_v_s;
  Py_ssize_t __pyx_v_e;
  double __pyx_v_m;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_arr;
  __Pyx_Buffer __pyx_pybuffer_arr;
  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", 0);
  __pyx_pybuffer_arr.pybuffer.buf = NULL;
  __pyx_pybuffer_arr.refcount = 0;
  __pyx_pybuffernd_arr.data = NULL;
  __pyx_pybuffernd_arr.rcbuffer = &__pyx_pybuffer_arr;
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_arr.rcbuffer->pybuffer, (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[0]; __pyx_lineno = 871; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_arr.diminfo[0].strides = __pyx_pybuffernd_arr.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_arr.diminfo[0].shape = __pyx_pybuffernd_arr.rcbuffer->pybuffer.shape[0];

  /* "pandas/algos.pyx":876
 *         double m
 * 
 *     (s, e, m) = max_subseq(-arr)             # <<<<<<<<<<<<<<
 * 
 *     return (s, e, -m)
 */
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_max_subseq); 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_2 = PyNumber_Negative(((PyObject *)__pyx_v_arr)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 876; __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 = 876; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__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 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 876; __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;
  if ((likely(PyTuple_CheckExact(__pyx_t_2))) || (PyList_CheckExact(__pyx_t_2))) {
    PyObject* sequence = __pyx_t_2;
    #if CYTHON_COMPILING_IN_CPYTHON
    Py_ssize_t size = Py_SIZE(sequence);
    #else
    Py_ssize_t size = PySequence_Size(sequence);
    #endif
    if (unlikely(size != 3)) {
      if (size > 3) __Pyx_RaiseTooManyValuesError(3);
      else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 876; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    #if CYTHON_COMPILING_IN_CPYTHON
    if (likely(PyTuple_CheckExact(sequence))) {
      __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 {
      __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);
    #else
    __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 876; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_1 = PySequence_ITEM(sequence, 1); 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 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 876; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    #endif
    __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[0]; __pyx_lineno = 876; __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_1 = __pyx_t_6(__pyx_t_5); if (unlikely(!__pyx_t_1)) goto __pyx_L3_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_L3_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_4);
    if (__Pyx_IternextUnpackEndCheck(__pyx_t_6(__pyx_t_5), 3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 876; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_6 = NULL;
    __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;
    __pyx_t_6 = NULL;
    if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 876; __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[0]; __pyx_lineno = 876; __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[0]; __pyx_lineno = 876; __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[0]; __pyx_lineno = 876; __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;

  /* "pandas/algos.pyx":878
 *     (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[0]; __pyx_lineno = 878; __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[0]; __pyx_lineno = 878; __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[0]; __pyx_lineno = 878; __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[0]; __pyx_lineno = 878; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__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 = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "pandas/algos.pyx":871
 *     return (s, e, m)
 * 
 * def min_subseq(ndarray[double_t] arr):             # <<<<<<<<<<<<<<
 *     cdef:
 *         Py_ssize_t s, e
 */

  /* function exit code */
  __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_pybuffernd_arr.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas.algos.min_subseq", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_arr.rcbuffer->pybuffer);
  __pyx_L2:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/algos.pyx":883
 * # 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
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pandas_5algos_23roll_sum(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_5algos_23roll_sum = {__Pyx_NAMESTR("roll_sum"), (PyCFunction)__pyx_pw_6pandas_5algos_23roll_sum, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pw_6pandas_5algos_23roll_sum(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyArrayObject *__pyx_v_input = 0;
  int __pyx_v_win;
  int __pyx_v_minp;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("roll_sum (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_input,&__pyx_n_s_win,&__pyx_n_s_minp,0};
    PyObject* values[3] = {0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_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 (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_input)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_win)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("roll_sum", 1, 3, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 883; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_minp)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("roll_sum", 1, 3, 3, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 883; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "roll_sum") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 883; __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_As_int(values[1]); if (unlikely((__pyx_v_win == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 883; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_v_minp = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_minp == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 883; __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[0]; __pyx_lineno = 883; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas.algos.roll_sum", __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[0]; __pyx_lineno = 883; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_22roll_sum(__pyx_self, __pyx_v_input, __pyx_v_win, __pyx_v_minp);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pandas_5algos_22roll_sum(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_input, 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;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_input;
  __Pyx_Buffer __pyx_pybuffer_input;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_output;
  __Pyx_Buffer __pyx_pybuffer_output;
  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;
  PyObject *__pyx_t_7 = NULL;
  int __pyx_t_8;
  long __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_t_17;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("roll_sum", 0);
  __pyx_pybuffer_output.pybuffer.buf = NULL;
  __pyx_pybuffer_output.refcount = 0;
  __pyx_pybuffernd_output.data = NULL;
  __pyx_pybuffernd_output.rcbuffer = &__pyx_pybuffer_output;
  __pyx_pybuffer_input.pybuffer.buf = NULL;
  __pyx_pybuffer_input.refcount = 0;
  __pyx_pybuffernd_input.data = NULL;
  __pyx_pybuffernd_input.rcbuffer = &__pyx_pybuffer_input;
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_input.rcbuffer->pybuffer, (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[0]; __pyx_lineno = 883; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_input.diminfo[0].strides = __pyx_pybuffernd_input.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_input.diminfo[0].shape = __pyx_pybuffernd_input.rcbuffer->pybuffer.shape[0];

  /* "pandas/algos.pyx":884
 * 
 * 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;

  /* "pandas/algos.pyx":885
 * 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;

  /* "pandas/algos.pyx":886
 *     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[0]; __pyx_lineno = 886; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_N = __pyx_t_1;

  /* "pandas/algos.pyx":888
 *     cdef int N = len(input)
 * 
 *     cdef ndarray[double_t] output = np.empty(N, dtype=float)             # <<<<<<<<<<<<<<
 * 
 *     minp = _check_minp(win, minp, N)
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 888; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_empty); 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);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_N); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 888; __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 = 888; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__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 = 888; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, ((PyObject *)((PyObject*)(&PyFloat_Type)))) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 888; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 888; __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_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__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 = 888; __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_pybuffernd_output.rcbuffer->pybuffer, (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_pybuffernd_output.rcbuffer->pybuffer.buf = NULL;
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 888; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    } else {__pyx_pybuffernd_output.diminfo[0].strides = __pyx_pybuffernd_output.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_output.diminfo[0].shape = __pyx_pybuffernd_output.rcbuffer->pybuffer.shape[0];
    }
  }
  __pyx_t_6 = 0;
  __pyx_v_output = ((PyArrayObject *)__pyx_t_5);
  __pyx_t_5 = 0;

  /* "pandas/algos.pyx":890
 *     cdef ndarray[double_t] output = np.empty(N, dtype=float)
 * 
 *     minp = _check_minp(win, minp, N)             # <<<<<<<<<<<<<<
 * 
 *     for i from 0 <= i < minp - 1:
 */
  __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_check_minp); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 890; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_win); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 890; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_minp); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 890; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_N); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 890; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_7 = PyTuple_New(3); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 890; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__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_4);
  __Pyx_GIVEREF(__pyx_t_4);
  PyTuple_SET_ITEM(__pyx_t_7, 2, __pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_3);
  __pyx_t_2 = 0;
  __pyx_t_4 = 0;
  __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_7, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 890; __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_7); __pyx_t_7 = 0;
  __pyx_t_8 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_8 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 890; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_v_minp = __pyx_t_8;

  /* "pandas/algos.pyx":892
 *     minp = _check_minp(win, minp, N)
 * 
 *     for i from 0 <= i < minp - 1:             # <<<<<<<<<<<<<<
 *         val = input[i]
 * 
 */
  __pyx_t_9 = (__pyx_v_minp - 1);
  for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_9; __pyx_v_i++) {

    /* "pandas/algos.pyx":893
 * 
 *     for i from 0 <= i < minp - 1:
 *         val = input[i]             # <<<<<<<<<<<<<<
 * 
 *         # Not NaN
 */
    __pyx_t_8 = __pyx_v_i;
    __pyx_t_10 = -1;
    if (__pyx_t_8 < 0) {
      __pyx_t_8 += __pyx_pybuffernd_input.diminfo[0].shape;
      if (unlikely(__pyx_t_8 < 0)) __pyx_t_10 = 0;
    } else if (unlikely(__pyx_t_8 >= __pyx_pybuffernd_input.diminfo[0].shape)) __pyx_t_10 = 0;
    if (unlikely(__pyx_t_10 != -1)) {
      __Pyx_RaiseBufferIndexError(__pyx_t_10);
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 893; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_v_val = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_double_t *, __pyx_pybuffernd_input.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_input.diminfo[0].strides));

    /* "pandas/algos.pyx":896
 * 
 *         # Not NaN
 *         if val == val:             # <<<<<<<<<<<<<<
 *             nobs += 1
 *             sum_x += val
 */
    __pyx_t_11 = ((__pyx_v_val == __pyx_v_val) != 0);
    if (__pyx_t_11) {

      /* "pandas/algos.pyx":897
 *         # Not NaN
 *         if val == val:
 *             nobs += 1             # <<<<<<<<<<<<<<
 *             sum_x += val
 * 
 */
      __pyx_v_nobs = (__pyx_v_nobs + 1);

      /* "pandas/algos.pyx":898
 *         if val == val:
 *             nobs += 1
 *             sum_x += val             # <<<<<<<<<<<<<<
 * 
 *         output[i] = NaN
 */
      __pyx_v_sum_x = (__pyx_v_sum_x + __pyx_v_val);
      goto __pyx_L5;
    }
    __pyx_L5:;

    /* "pandas/algos.pyx":900
 *             sum_x += val
 * 
 *         output[i] = NaN             # <<<<<<<<<<<<<<
 * 
 *     for i from minp - 1 <= i < N:
 */
    __pyx_t_10 = __pyx_v_i;
    __pyx_t_12 = -1;
    if (__pyx_t_10 < 0) {
      __pyx_t_10 += __pyx_pybuffernd_output.diminfo[0].shape;
      if (unlikely(__pyx_t_10 < 0)) __pyx_t_12 = 0;
    } else if (unlikely(__pyx_t_10 >= __pyx_pybuffernd_output.diminfo[0].shape)) __pyx_t_12 = 0;
    if (unlikely(__pyx_t_12 != -1)) {
      __Pyx_RaiseBufferIndexError(__pyx_t_12);
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 900; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_double_t *, __pyx_pybuffernd_output.rcbuffer->pybuffer.buf, __pyx_t_10, __pyx_pybuffernd_output.diminfo[0].strides) = __pyx_v_6pandas_5algos_NaN;
  }

  /* "pandas/algos.pyx":902
 *         output[i] = NaN
 * 
 *     for i from minp - 1 <= i < N:             # <<<<<<<<<<<<<<
 *         val = input[i]
 * 
 */
  __pyx_t_12 = __pyx_v_N;
  for (__pyx_v_i = (__pyx_v_minp - 1); __pyx_v_i < __pyx_t_12; __pyx_v_i++) {

    /* "pandas/algos.pyx":903
 * 
 *     for i from minp - 1 <= i < N:
 *         val = input[i]             # <<<<<<<<<<<<<<
 * 
 *         if val == val:
 */
    __pyx_t_13 = __pyx_v_i;
    __pyx_t_14 = -1;
    if (__pyx_t_13 < 0) {
      __pyx_t_13 += __pyx_pybuffernd_input.diminfo[0].shape;
      if (unlikely(__pyx_t_13 < 0)) __pyx_t_14 = 0;
    } else if (unlikely(__pyx_t_13 >= __pyx_pybuffernd_input.diminfo[0].shape)) __pyx_t_14 = 0;
    if (unlikely(__pyx_t_14 != -1)) {
      __Pyx_RaiseBufferIndexError(__pyx_t_14);
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 903; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_v_val = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_double_t *, __pyx_pybuffernd_input.rcbuffer->pybuffer.buf, __pyx_t_13, __pyx_pybuffernd_input.diminfo[0].strides));

    /* "pandas/algos.pyx":905
 *         val = input[i]
 * 
 *         if val == val:             # <<<<<<<<<<<<<<
 *             nobs += 1
 *             sum_x += val
 */
    __pyx_t_11 = ((__pyx_v_val == __pyx_v_val) != 0);
    if (__pyx_t_11) {

      /* "pandas/algos.pyx":906
 * 
 *         if val == val:
 *             nobs += 1             # <<<<<<<<<<<<<<
 *             sum_x += val
 * 
 */
      __pyx_v_nobs = (__pyx_v_nobs + 1);

      /* "pandas/algos.pyx":907
 *         if val == val:
 *             nobs += 1
 *             sum_x += val             # <<<<<<<<<<<<<<
 * 
 *         if i > win - 1:
 */
      __pyx_v_sum_x = (__pyx_v_sum_x + __pyx_v_val);
      goto __pyx_L8;
    }
    __pyx_L8:;

    /* "pandas/algos.pyx":909
 *             sum_x += val
 * 
 *         if i > win - 1:             # <<<<<<<<<<<<<<
 *             prev = input[i - win]
 *             if prev == prev:
 */
    __pyx_t_11 = ((__pyx_v_i > (__pyx_v_win - 1)) != 0);
    if (__pyx_t_11) {

      /* "pandas/algos.pyx":910
 * 
 *         if i > win - 1:
 *             prev = input[i - win]             # <<<<<<<<<<<<<<
 *             if prev == prev:
 *                 sum_x -= prev
 */
      __pyx_t_14 = (__pyx_v_i - __pyx_v_win);
      __pyx_t_15 = -1;
      if (__pyx_t_14 < 0) {
        __pyx_t_14 += __pyx_pybuffernd_input.diminfo[0].shape;
        if (unlikely(__pyx_t_14 < 0)) __pyx_t_15 = 0;
      } else if (unlikely(__pyx_t_14 >= __pyx_pybuffernd_input.diminfo[0].shape)) __pyx_t_15 = 0;
      if (unlikely(__pyx_t_15 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_15);
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 910; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_v_prev = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_double_t *, __pyx_pybuffernd_input.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_input.diminfo[0].strides));

      /* "pandas/algos.pyx":911
 *         if i > win - 1:
 *             prev = input[i - win]
 *             if prev == prev:             # <<<<<<<<<<<<<<
 *                 sum_x -= prev
 *                 nobs -= 1
 */
      __pyx_t_11 = ((__pyx_v_prev == __pyx_v_prev) != 0);
      if (__pyx_t_11) {

        /* "pandas/algos.pyx":912
 *             prev = input[i - win]
 *             if prev == prev:
 *                 sum_x -= prev             # <<<<<<<<<<<<<<
 *                 nobs -= 1
 * 
 */
        __pyx_v_sum_x = (__pyx_v_sum_x - __pyx_v_prev);

        /* "pandas/algos.pyx":913
 *             if prev == prev:
 *                 sum_x -= prev
 *                 nobs -= 1             # <<<<<<<<<<<<<<
 * 
 *         if nobs >= minp:
 */
        __pyx_v_nobs = (__pyx_v_nobs - 1);
        goto __pyx_L10;
      }
      __pyx_L10:;
      goto __pyx_L9;
    }
    __pyx_L9:;

    /* "pandas/algos.pyx":915
 *                 nobs -= 1
 * 
 *         if nobs >= minp:             # <<<<<<<<<<<<<<
 *             output[i] = sum_x
 *         else:
 */
    __pyx_t_11 = ((__pyx_v_nobs >= __pyx_v_minp) != 0);
    if (__pyx_t_11) {

      /* "pandas/algos.pyx":916
 * 
 *         if nobs >= minp:
 *             output[i] = sum_x             # <<<<<<<<<<<<<<
 *         else:
 *             output[i] = NaN
 */
      __pyx_t_15 = __pyx_v_i;
      __pyx_t_16 = -1;
      if (__pyx_t_15 < 0) {
        __pyx_t_15 += __pyx_pybuffernd_output.diminfo[0].shape;
        if (unlikely(__pyx_t_15 < 0)) __pyx_t_16 = 0;
      } else if (unlikely(__pyx_t_15 >= __pyx_pybuffernd_output.diminfo[0].shape)) __pyx_t_16 = 0;
      if (unlikely(__pyx_t_16 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_16);
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 916; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_double_t *, __pyx_pybuffernd_output.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_output.diminfo[0].strides) = __pyx_v_sum_x;
      goto __pyx_L11;
    }
    /*else*/ {

      /* "pandas/algos.pyx":918
 *             output[i] = sum_x
 *         else:
 *             output[i] = NaN             # <<<<<<<<<<<<<<
 * 
 *     return output
 */
      __pyx_t_16 = __pyx_v_i;
      __pyx_t_17 = -1;
      if (__pyx_t_16 < 0) {
        __pyx_t_16 += __pyx_pybuffernd_output.diminfo[0].shape;
        if (unlikely(__pyx_t_16 < 0)) __pyx_t_17 = 0;
      } else if (unlikely(__pyx_t_16 >= __pyx_pybuffernd_output.diminfo[0].shape)) __pyx_t_17 = 0;
      if (unlikely(__pyx_t_17 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_17);
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 918; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_double_t *, __pyx_pybuffernd_output.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_output.diminfo[0].strides) = __pyx_v_6pandas_5algos_NaN;
    }
    __pyx_L11:;
  }

  /* "pandas/algos.pyx":920
 *             output[i] = NaN
 * 
 *     return output             # <<<<<<<<<<<<<<
 * 
 * #-------------------------------------------------------------------------------
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_output));
  __pyx_r = ((PyObject *)__pyx_v_output);
  goto __pyx_L0;

  /* "pandas/algos.pyx":883
 * # 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
 */

  /* function exit code */
  __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_7);
  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
    __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_input.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_output.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas.algos.roll_sum", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_input.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_output.rcbuffer->pybuffer);
  __pyx_L2:;
  __Pyx_XDECREF((PyObject *)__pyx_v_output);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/algos.pyx":925
 * # Rolling mean
 * 
 * def roll_mean(ndarray[double_t] input,             # <<<<<<<<<<<<<<
 *                int win, int minp):
 *     cdef:
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pandas_5algos_25roll_mean(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_5algos_25roll_mean = {__Pyx_NAMESTR("roll_mean"), (PyCFunction)__pyx_pw_6pandas_5algos_25roll_mean, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pw_6pandas_5algos_25roll_mean(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyArrayObject *__pyx_v_input = 0;
  int __pyx_v_win;
  int __pyx_v_minp;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("roll_mean (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_input,&__pyx_n_s_win,&__pyx_n_s_minp,0};
    PyObject* values[3] = {0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_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 (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_input)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_win)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("roll_mean", 1, 3, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 925; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_minp)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("roll_mean", 1, 3, 3, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 925; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "roll_mean") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 925; __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_As_int(values[1]); if (unlikely((__pyx_v_win == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 926; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_v_minp = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_minp == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 926; __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[0]; __pyx_lineno = 925; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas.algos.roll_mean", __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[0]; __pyx_lineno = 925; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_24roll_mean(__pyx_self, __pyx_v_input, __pyx_v_win, __pyx_v_minp);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pandas_5algos_24roll_mean(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_input, int __pyx_v_win, int __pyx_v_minp) {
  double __pyx_v_val;
  double __pyx_v_prev;
  double __pyx_v_result;
  double __pyx_v_sum_x;
  Py_ssize_t __pyx_v_nobs;
  Py_ssize_t __pyx_v_i;
  Py_ssize_t __pyx_v_neg_ct;
  Py_ssize_t __pyx_v_N;
  PyArrayObject *__pyx_v_output = 0;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_input;
  __Pyx_Buffer __pyx_pybuffer_input;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_output;
  __Pyx_Buffer __pyx_pybuffer_output;
  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;
  PyObject *__pyx_t_7 = NULL;
  int __pyx_t_8;
  long __pyx_t_9;
  int __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_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;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("roll_mean", 0);
  __pyx_pybuffer_output.pybuffer.buf = NULL;
  __pyx_pybuffer_output.refcount = 0;
  __pyx_pybuffernd_output.data = NULL;
  __pyx_pybuffernd_output.rcbuffer = &__pyx_pybuffer_output;
  __pyx_pybuffer_input.pybuffer.buf = NULL;
  __pyx_pybuffer_input.refcount = 0;
  __pyx_pybuffernd_input.data = NULL;
  __pyx_pybuffernd_input.rcbuffer = &__pyx_pybuffer_input;
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_input.rcbuffer->pybuffer, (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[0]; __pyx_lineno = 925; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_input.diminfo[0].strides = __pyx_pybuffernd_input.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_input.diminfo[0].shape = __pyx_pybuffernd_input.rcbuffer->pybuffer.shape[0];

  /* "pandas/algos.pyx":928
 *                int win, int minp):
 *     cdef:
 *         double val, prev, result, sum_x = 0             # <<<<<<<<<<<<<<
 *         Py_ssize_t nobs = 0, i, neg_ct = 0
 *         Py_ssize_t N = len(input)
 */
  __pyx_v_sum_x = 0.0;

  /* "pandas/algos.pyx":929
 *     cdef:
 *         double val, prev, result, sum_x = 0
 *         Py_ssize_t nobs = 0, i, neg_ct = 0             # <<<<<<<<<<<<<<
 *         Py_ssize_t N = len(input)
 * 
 */
  __pyx_v_nobs = 0;
  __pyx_v_neg_ct = 0;

  /* "pandas/algos.pyx":930
 *         double val, prev, result, sum_x = 0
 *         Py_ssize_t nobs = 0, i, neg_ct = 0
 *         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[0]; __pyx_lineno = 930; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_N = __pyx_t_1;

  /* "pandas/algos.pyx":932
 *         Py_ssize_t N = len(input)
 * 
 *     cdef ndarray[double_t] output = np.empty(N, dtype=float)             # <<<<<<<<<<<<<<
 *     minp = _check_minp(win, minp, N)
 * 
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 932; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_empty); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 932; __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 = 932; __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 = 932; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__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 = 932; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, ((PyObject *)((PyObject*)(&PyFloat_Type)))) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 932; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 932; __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_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__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 = 932; __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_pybuffernd_output.rcbuffer->pybuffer, (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_pybuffernd_output.rcbuffer->pybuffer.buf = NULL;
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 932; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    } else {__pyx_pybuffernd_output.diminfo[0].strides = __pyx_pybuffernd_output.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_output.diminfo[0].shape = __pyx_pybuffernd_output.rcbuffer->pybuffer.shape[0];
    }
  }
  __pyx_t_6 = 0;
  __pyx_v_output = ((PyArrayObject *)__pyx_t_5);
  __pyx_t_5 = 0;

  /* "pandas/algos.pyx":933
 * 
 *     cdef ndarray[double_t] output = np.empty(N, dtype=float)
 *     minp = _check_minp(win, minp, N)             # <<<<<<<<<<<<<<
 * 
 *     for i from 0 <= i < minp - 1:
 */
  __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_check_minp); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 933; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_win); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 933; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_minp); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 933; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_N); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 933; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_7 = PyTuple_New(3); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 933; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__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_4);
  __Pyx_GIVEREF(__pyx_t_4);
  PyTuple_SET_ITEM(__pyx_t_7, 2, __pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_3);
  __pyx_t_2 = 0;
  __pyx_t_4 = 0;
  __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_7, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 933; __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_7); __pyx_t_7 = 0;
  __pyx_t_8 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_8 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 933; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_v_minp = __pyx_t_8;

  /* "pandas/algos.pyx":935
 *     minp = _check_minp(win, minp, N)
 * 
 *     for i from 0 <= i < minp - 1:             # <<<<<<<<<<<<<<
 *         val = input[i]
 * 
 */
  __pyx_t_9 = (__pyx_v_minp - 1);
  for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_9; __pyx_v_i++) {

    /* "pandas/algos.pyx":936
 * 
 *     for i from 0 <= i < minp - 1:
 *         val = input[i]             # <<<<<<<<<<<<<<
 * 
 *         # Not NaN
 */
    __pyx_t_1 = __pyx_v_i;
    __pyx_t_8 = -1;
    if (__pyx_t_1 < 0) {
      __pyx_t_1 += __pyx_pybuffernd_input.diminfo[0].shape;
      if (unlikely(__pyx_t_1 < 0)) __pyx_t_8 = 0;
    } else if (unlikely(__pyx_t_1 >= __pyx_pybuffernd_input.diminfo[0].shape)) __pyx_t_8 = 0;
    if (unlikely(__pyx_t_8 != -1)) {
      __Pyx_RaiseBufferIndexError(__pyx_t_8);
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 936; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_v_val = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_double_t *, __pyx_pybuffernd_input.rcbuffer->pybuffer.buf, __pyx_t_1, __pyx_pybuffernd_input.diminfo[0].strides));

    /* "pandas/algos.pyx":939
 * 
 *         # Not NaN
 *         if val == val:             # <<<<<<<<<<<<<<
 *             nobs += 1
 *             sum_x += val
 */
    __pyx_t_10 = ((__pyx_v_val == __pyx_v_val) != 0);
    if (__pyx_t_10) {

      /* "pandas/algos.pyx":940
 *         # Not NaN
 *         if val == val:
 *             nobs += 1             # <<<<<<<<<<<<<<
 *             sum_x += val
 *             if signbit(val):
 */
      __pyx_v_nobs = (__pyx_v_nobs + 1);

      /* "pandas/algos.pyx":941
 *         if val == val:
 *             nobs += 1
 *             sum_x += val             # <<<<<<<<<<<<<<
 *             if signbit(val):
 *                 neg_ct += 1
 */
      __pyx_v_sum_x = (__pyx_v_sum_x + __pyx_v_val);

      /* "pandas/algos.pyx":942
 *             nobs += 1
 *             sum_x += val
 *             if signbit(val):             # <<<<<<<<<<<<<<
 *                 neg_ct += 1
 * 
 */
      __pyx_t_10 = (signbit(__pyx_v_val) != 0);
      if (__pyx_t_10) {

        /* "pandas/algos.pyx":943
 *             sum_x += val
 *             if signbit(val):
 *                 neg_ct += 1             # <<<<<<<<<<<<<<
 * 
 *         output[i] = NaN
 */
        __pyx_v_neg_ct = (__pyx_v_neg_ct + 1);
        goto __pyx_L6;
      }
      __pyx_L6:;
      goto __pyx_L5;
    }
    __pyx_L5:;

    /* "pandas/algos.pyx":945
 *                 neg_ct += 1
 * 
 *         output[i] = NaN             # <<<<<<<<<<<<<<
 * 
 *     for i from minp - 1 <= i < N:
 */
    __pyx_t_11 = __pyx_v_i;
    __pyx_t_8 = -1;
    if (__pyx_t_11 < 0) {
      __pyx_t_11 += __pyx_pybuffernd_output.diminfo[0].shape;
      if (unlikely(__pyx_t_11 < 0)) __pyx_t_8 = 0;
    } else if (unlikely(__pyx_t_11 >= __pyx_pybuffernd_output.diminfo[0].shape)) __pyx_t_8 = 0;
    if (unlikely(__pyx_t_8 != -1)) {
      __Pyx_RaiseBufferIndexError(__pyx_t_8);
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 945; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_double_t *, __pyx_pybuffernd_output.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_output.diminfo[0].strides) = __pyx_v_6pandas_5algos_NaN;
  }

  /* "pandas/algos.pyx":947
 *         output[i] = NaN
 * 
 *     for i from minp - 1 <= i < N:             # <<<<<<<<<<<<<<
 *         val = input[i]
 * 
 */
  __pyx_t_12 = __pyx_v_N;
  for (__pyx_v_i = (__pyx_v_minp - 1); __pyx_v_i < __pyx_t_12; __pyx_v_i++) {

    /* "pandas/algos.pyx":948
 * 
 *     for i from minp - 1 <= i < N:
 *         val = input[i]             # <<<<<<<<<<<<<<
 * 
 *         if val == val:
 */
    __pyx_t_13 = __pyx_v_i;
    __pyx_t_8 = -1;
    if (__pyx_t_13 < 0) {
      __pyx_t_13 += __pyx_pybuffernd_input.diminfo[0].shape;
      if (unlikely(__pyx_t_13 < 0)) __pyx_t_8 = 0;
    } else if (unlikely(__pyx_t_13 >= __pyx_pybuffernd_input.diminfo[0].shape)) __pyx_t_8 = 0;
    if (unlikely(__pyx_t_8 != -1)) {
      __Pyx_RaiseBufferIndexError(__pyx_t_8);
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 948; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_v_val = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_double_t *, __pyx_pybuffernd_input.rcbuffer->pybuffer.buf, __pyx_t_13, __pyx_pybuffernd_input.diminfo[0].strides));

    /* "pandas/algos.pyx":950
 *         val = input[i]
 * 
 *         if val == val:             # <<<<<<<<<<<<<<
 *             nobs += 1
 *             sum_x += val
 */
    __pyx_t_10 = ((__pyx_v_val == __pyx_v_val) != 0);
    if (__pyx_t_10) {

      /* "pandas/algos.pyx":951
 * 
 *         if val == val:
 *             nobs += 1             # <<<<<<<<<<<<<<
 *             sum_x += val
 *             if signbit(val):
 */
      __pyx_v_nobs = (__pyx_v_nobs + 1);

      /* "pandas/algos.pyx":952
 *         if val == val:
 *             nobs += 1
 *             sum_x += val             # <<<<<<<<<<<<<<
 *             if signbit(val):
 *                 neg_ct += 1
 */
      __pyx_v_sum_x = (__pyx_v_sum_x + __pyx_v_val);

      /* "pandas/algos.pyx":953
 *             nobs += 1
 *             sum_x += val
 *             if signbit(val):             # <<<<<<<<<<<<<<
 *                 neg_ct += 1
 * 
 */
      __pyx_t_10 = (signbit(__pyx_v_val) != 0);
      if (__pyx_t_10) {

        /* "pandas/algos.pyx":954
 *             sum_x += val
 *             if signbit(val):
 *                 neg_ct += 1             # <<<<<<<<<<<<<<
 * 
 *         if i > win - 1:
 */
        __pyx_v_neg_ct = (__pyx_v_neg_ct + 1);
        goto __pyx_L10;
      }
      __pyx_L10:;
      goto __pyx_L9;
    }
    __pyx_L9:;

    /* "pandas/algos.pyx":956
 *                 neg_ct += 1
 * 
 *         if i > win - 1:             # <<<<<<<<<<<<<<
 *             prev = input[i - win]
 *             if prev == prev:
 */
    __pyx_t_10 = ((__pyx_v_i > (__pyx_v_win - 1)) != 0);
    if (__pyx_t_10) {

      /* "pandas/algos.pyx":957
 * 
 *         if i > win - 1:
 *             prev = input[i - win]             # <<<<<<<<<<<<<<
 *             if prev == prev:
 *                 sum_x -= prev
 */
      __pyx_t_14 = (__pyx_v_i - __pyx_v_win);
      __pyx_t_8 = -1;
      if (__pyx_t_14 < 0) {
        __pyx_t_14 += __pyx_pybuffernd_input.diminfo[0].shape;
        if (unlikely(__pyx_t_14 < 0)) __pyx_t_8 = 0;
      } else if (unlikely(__pyx_t_14 >= __pyx_pybuffernd_input.diminfo[0].shape)) __pyx_t_8 = 0;
      if (unlikely(__pyx_t_8 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_8);
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 957; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_v_prev = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_double_t *, __pyx_pybuffernd_input.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_input.diminfo[0].strides));

      /* "pandas/algos.pyx":958
 *         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) != 0);
      if (__pyx_t_10) {

        /* "pandas/algos.pyx":959
 *             prev = input[i - win]
 *             if prev == prev:
 *                 sum_x -= prev             # <<<<<<<<<<<<<<
 *                 nobs -= 1
 *                 if signbit(prev):
 */
        __pyx_v_sum_x = (__pyx_v_sum_x - __pyx_v_prev);

        /* "pandas/algos.pyx":960
 *             if prev == prev:
 *                 sum_x -= prev
 *                 nobs -= 1             # <<<<<<<<<<<<<<
 *                 if signbit(prev):
 *                     neg_ct -= 1
 */
        __pyx_v_nobs = (__pyx_v_nobs - 1);

        /* "pandas/algos.pyx":961
 *                 sum_x -= prev
 *                 nobs -= 1
 *                 if signbit(prev):             # <<<<<<<<<<<<<<
 *                     neg_ct -= 1
 * 
 */
        __pyx_t_10 = (signbit(__pyx_v_prev) != 0);
        if (__pyx_t_10) {

          /* "pandas/algos.pyx":962
 *                 nobs -= 1
 *                 if signbit(prev):
 *                     neg_ct -= 1             # <<<<<<<<<<<<<<
 * 
 *         if nobs >= minp:
 */
          __pyx_v_neg_ct = (__pyx_v_neg_ct - 1);
          goto __pyx_L13;
        }
        __pyx_L13:;
        goto __pyx_L12;
      }
      __pyx_L12:;
      goto __pyx_L11;
    }
    __pyx_L11:;

    /* "pandas/algos.pyx":964
 *                     neg_ct -= 1
 * 
 *         if nobs >= minp:             # <<<<<<<<<<<<<<
 *             result = sum_x / nobs
 *             if neg_ct == 0 and result < 0:
 */
    __pyx_t_10 = ((__pyx_v_nobs >= __pyx_v_minp) != 0);
    if (__pyx_t_10) {

      /* "pandas/algos.pyx":965
 * 
 *         if nobs >= minp:
 *             result = sum_x / nobs             # <<<<<<<<<<<<<<
 *             if neg_ct == 0 and result < 0:
 *                 # all positive
 */
      if (unlikely(__pyx_v_nobs == 0)) {
        #ifdef WITH_THREAD
        PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
        #endif
        PyErr_SetString(PyExc_ZeroDivisionError, "float division");
        #ifdef WITH_THREAD
        PyGILState_Release(__pyx_gilstate_save);
        #endif
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 965; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_v_result = (__pyx_v_sum_x / __pyx_v_nobs);

      /* "pandas/algos.pyx":966
 *         if nobs >= minp:
 *             result = sum_x / nobs
 *             if neg_ct == 0 and result < 0:             # <<<<<<<<<<<<<<
 *                 # all positive
 *                 output[i] = 0
 */
      __pyx_t_10 = ((__pyx_v_neg_ct == 0) != 0);
      if (__pyx_t_10) {
        __pyx_t_15 = ((__pyx_v_result < 0.0) != 0);
        __pyx_t_16 = __pyx_t_15;
      } else {
        __pyx_t_16 = __pyx_t_10;
      }
      if (__pyx_t_16) {

        /* "pandas/algos.pyx":968
 *             if neg_ct == 0 and result < 0:
 *                 # all positive
 *                 output[i] = 0             # <<<<<<<<<<<<<<
 *             elif neg_ct == nobs and result > 0:
 *                 # all negative
 */
        __pyx_t_17 = __pyx_v_i;
        __pyx_t_8 = -1;
        if (__pyx_t_17 < 0) {
          __pyx_t_17 += __pyx_pybuffernd_output.diminfo[0].shape;
          if (unlikely(__pyx_t_17 < 0)) __pyx_t_8 = 0;
        } else if (unlikely(__pyx_t_17 >= __pyx_pybuffernd_output.diminfo[0].shape)) __pyx_t_8 = 0;
        if (unlikely(__pyx_t_8 != -1)) {
          __Pyx_RaiseBufferIndexError(__pyx_t_8);
          {__pyx_filename = __pyx_f[0]; __pyx_lineno = 968; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_double_t *, __pyx_pybuffernd_output.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_output.diminfo[0].strides) = 0.0;
        goto __pyx_L15;
      }

      /* "pandas/algos.pyx":969
 *                 # all positive
 *                 output[i] = 0
 *             elif neg_ct == nobs and result > 0:             # <<<<<<<<<<<<<<
 *                 # all negative
 *                 output[i] = 0
 */
      __pyx_t_16 = ((__pyx_v_neg_ct == __pyx_v_nobs) != 0);
      if (__pyx_t_16) {
        __pyx_t_10 = ((__pyx_v_result > 0.0) != 0);
        __pyx_t_15 = __pyx_t_10;
      } else {
        __pyx_t_15 = __pyx_t_16;
      }
      if (__pyx_t_15) {

        /* "pandas/algos.pyx":971
 *             elif neg_ct == nobs and result > 0:
 *                 # all negative
 *                 output[i] = 0             # <<<<<<<<<<<<<<
 *             else:
 *                 output[i] = result
 */
        __pyx_t_18 = __pyx_v_i;
        __pyx_t_8 = -1;
        if (__pyx_t_18 < 0) {
          __pyx_t_18 += __pyx_pybuffernd_output.diminfo[0].shape;
          if (unlikely(__pyx_t_18 < 0)) __pyx_t_8 = 0;
        } else if (unlikely(__pyx_t_18 >= __pyx_pybuffernd_output.diminfo[0].shape)) __pyx_t_8 = 0;
        if (unlikely(__pyx_t_8 != -1)) {
          __Pyx_RaiseBufferIndexError(__pyx_t_8);
          {__pyx_filename = __pyx_f[0]; __pyx_lineno = 971; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_double_t *, __pyx_pybuffernd_output.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_output.diminfo[0].strides) = 0.0;
        goto __pyx_L15;
      }
      /*else*/ {

        /* "pandas/algos.pyx":973
 *                 output[i] = 0
 *             else:
 *                 output[i] = result             # <<<<<<<<<<<<<<
 *         else:
 *             output[i] = NaN
 */
        __pyx_t_19 = __pyx_v_i;
        __pyx_t_8 = -1;
        if (__pyx_t_19 < 0) {
          __pyx_t_19 += __pyx_pybuffernd_output.diminfo[0].shape;
          if (unlikely(__pyx_t_19 < 0)) __pyx_t_8 = 0;
        } else if (unlikely(__pyx_t_19 >= __pyx_pybuffernd_output.diminfo[0].shape)) __pyx_t_8 = 0;
        if (unlikely(__pyx_t_8 != -1)) {
          __Pyx_RaiseBufferIndexError(__pyx_t_8);
          {__pyx_filename = __pyx_f[0]; __pyx_lineno = 973; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_double_t *, __pyx_pybuffernd_output.rcbuffer->pybuffer.buf, __pyx_t_19, __pyx_pybuffernd_output.diminfo[0].strides) = __pyx_v_result;
      }
      __pyx_L15:;
      goto __pyx_L14;
    }
    /*else*/ {

      /* "pandas/algos.pyx":975
 *                 output[i] = result
 *         else:
 *             output[i] = NaN             # <<<<<<<<<<<<<<
 * 
 *     return output
 */
      __pyx_t_20 = __pyx_v_i;
      __pyx_t_8 = -1;
      if (__pyx_t_20 < 0) {
        __pyx_t_20 += __pyx_pybuffernd_output.diminfo[0].shape;
        if (unlikely(__pyx_t_20 < 0)) __pyx_t_8 = 0;
      } else if (unlikely(__pyx_t_20 >= __pyx_pybuffernd_output.diminfo[0].shape)) __pyx_t_8 = 0;
      if (unlikely(__pyx_t_8 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_8);
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 975; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_double_t *, __pyx_pybuffernd_output.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_output.diminfo[0].strides) = __pyx_v_6pandas_5algos_NaN;
    }
    __pyx_L14:;
  }

  /* "pandas/algos.pyx":977
 *             output[i] = NaN
 * 
 *     return output             # <<<<<<<<<<<<<<
 * 
 * #-------------------------------------------------------------------------------
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_output));
  __pyx_r = ((PyObject *)__pyx_v_output);
  goto __pyx_L0;

  /* "pandas/algos.pyx":925
 * # Rolling mean
 * 
 * def roll_mean(ndarray[double_t] input,             # <<<<<<<<<<<<<<
 *                int win, int minp):
 *     cdef:
 */

  /* function exit code */
  __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_7);
  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
    __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_input.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_output.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas.algos.roll_mean", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_input.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_output.rcbuffer->pybuffer);
  __pyx_L2:;
  __Pyx_XDECREF((PyObject *)__pyx_v_output);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/algos.pyx":982
 * # Exponentially weighted moving average
 * 
 * def ewma(ndarray[double_t] input, double_t com, int adjust):             # <<<<<<<<<<<<<<
 *     '''
 *     Compute exponentially-weighted moving average using center-of-mass.
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pandas_5algos_27ewma(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6pandas_5algos_26ewma[] = "\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_5algos_27ewma = {__Pyx_NAMESTR("ewma"), (PyCFunction)__pyx_pw_6pandas_5algos_27ewma, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6pandas_5algos_26ewma)};
static PyObject *__pyx_pw_6pandas_5algos_27ewma(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;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("ewma (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_input,&__pyx_n_s_com,&__pyx_n_s_adjust,0};
    PyObject* values[3] = {0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_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 (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_input)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_com)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("ewma", 1, 3, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 982; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_adjust)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("ewma", 1, 3, 3, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 982; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "ewma") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 982; __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[0]; __pyx_lineno = 982; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_v_adjust = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_adjust == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 982; __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[0]; __pyx_lineno = 982; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas.algos.ewma", __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[0]; __pyx_lineno = 982; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_26ewma(__pyx_self, __pyx_v_input, __pyx_v_com, __pyx_v_adjust);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pandas_5algos_26ewma(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_input, __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;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_input;
  __Pyx_Buffer __pyx_pybuffer_input;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_output;
  __Pyx_Buffer __pyx_pybuffer_output;
  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;
  __pyx_t_5numpy_double_t __pyx_t_8;
  long __pyx_t_9;
  int __pyx_t_10;
  long __pyx_t_11;
  long __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;
  Py_ssize_t __pyx_t_19;
  Py_ssize_t __pyx_t_20;
  double __pyx_t_21;
  Py_ssize_t __pyx_t_22;
  Py_ssize_t __pyx_t_23;
  Py_ssize_t __pyx_t_24;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("ewma", 0);
  __pyx_pybuffer_output.pybuffer.buf = NULL;
  __pyx_pybuffer_output.refcount = 0;
  __pyx_pybuffernd_output.data = NULL;
  __pyx_pybuffernd_output.rcbuffer = &__pyx_pybuffer_output;
  __pyx_pybuffer_input.pybuffer.buf = NULL;
  __pyx_pybuffer_input.refcount = 0;
  __pyx_pybuffernd_input.data = NULL;
  __pyx_pybuffernd_input.rcbuffer = &__pyx_pybuffer_input;
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_input.rcbuffer->pybuffer, (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[0]; __pyx_lineno = 982; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_input.diminfo[0].strides = __pyx_pybuffernd_input.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_input.diminfo[0].shape = __pyx_pybuffernd_input.rcbuffer->pybuffer.shape[0];

  /* "pandas/algos.pyx":998
 *     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[0]; __pyx_lineno = 998; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_N = __pyx_t_1;

  /* "pandas/algos.pyx":1000
 *     cdef Py_ssize_t N = len(input)
 * 
 *     cdef ndarray[double_t] output = np.empty(N, dtype=float)             # <<<<<<<<<<<<<<
 * 
 *     if N == 0:
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1000; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_empty); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1000; __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 = 1000; __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 = 1000; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__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 = 1000; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, ((PyObject *)((PyObject*)(&PyFloat_Type)))) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1000; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1000; __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_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__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 = 1000; __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_pybuffernd_output.rcbuffer->pybuffer, (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_pybuffernd_output.rcbuffer->pybuffer.buf = NULL;
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1000; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    } else {__pyx_pybuffernd_output.diminfo[0].strides = __pyx_pybuffernd_output.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_output.diminfo[0].shape = __pyx_pybuffernd_output.rcbuffer->pybuffer.shape[0];
    }
  }
  __pyx_t_6 = 0;
  __pyx_v_output = ((PyArrayObject *)__pyx_t_5);
  __pyx_t_5 = 0;

  /* "pandas/algos.pyx":1002
 *     cdef ndarray[double_t] output = np.empty(N, dtype=float)
 * 
 *     if N == 0:             # <<<<<<<<<<<<<<
 *         return output
 * 
 */
  __pyx_t_7 = ((__pyx_v_N == 0) != 0);
  if (__pyx_t_7) {

    /* "pandas/algos.pyx":1003
 * 
 *     if N == 0:
 *         return output             # <<<<<<<<<<<<<<
 * 
 *     neww = 1. / (1. + com)
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(((PyObject *)__pyx_v_output));
    __pyx_r = ((PyObject *)__pyx_v_output);
    goto __pyx_L0;
  }

  /* "pandas/algos.pyx":1005
 *         return output
 * 
 *     neww = 1. / (1. + com)             # <<<<<<<<<<<<<<
 *     oldw = 1. - neww
 *     adj = oldw
 */
  __pyx_t_8 = (1. + __pyx_v_com);
  if (unlikely(__pyx_t_8 == 0)) {
    #ifdef WITH_THREAD
    PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
    #endif
    PyErr_SetString(PyExc_ZeroDivisionError, "float division");
    #ifdef WITH_THREAD
    PyGILState_Release(__pyx_gilstate_save);
    #endif
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1005; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_v_neww = (1. / __pyx_t_8);

  /* "pandas/algos.pyx":1006
 * 
 *     neww = 1. / (1. + com)
 *     oldw = 1. - neww             # <<<<<<<<<<<<<<
 *     adj = oldw
 * 
 */
  __pyx_v_oldw = (1. - __pyx_v_neww);

  /* "pandas/algos.pyx":1007
 *     neww = 1. / (1. + com)
 *     oldw = 1. - neww
 *     adj = oldw             # <<<<<<<<<<<<<<
 * 
 *     if adjust:
 */
  __pyx_v_adj = __pyx_v_oldw;

  /* "pandas/algos.pyx":1009
 *     adj = oldw
 * 
 *     if adjust:             # <<<<<<<<<<<<<<
 *         output[0] = neww * input[0]
 *     else:
 */
  __pyx_t_7 = (__pyx_v_adjust != 0);
  if (__pyx_t_7) {

    /* "pandas/algos.pyx":1010
 * 
 *     if adjust:
 *         output[0] = neww * input[0]             # <<<<<<<<<<<<<<
 *     else:
 *         output[0] = input[0]
 */
    __pyx_t_9 = 0;
    __pyx_t_10 = -1;
    if (__pyx_t_9 < 0) {
      __pyx_t_9 += __pyx_pybuffernd_input.diminfo[0].shape;
      if (unlikely(__pyx_t_9 < 0)) __pyx_t_10 = 0;
    } else if (unlikely(__pyx_t_9 >= __pyx_pybuffernd_input.diminfo[0].shape)) __pyx_t_10 = 0;
    if (unlikely(__pyx_t_10 != -1)) {
      __Pyx_RaiseBufferIndexError(__pyx_t_10);
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1010; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_11 = 0;
    __pyx_t_10 = -1;
    if (__pyx_t_11 < 0) {
      __pyx_t_11 += __pyx_pybuffernd_output.diminfo[0].shape;
      if (unlikely(__pyx_t_11 < 0)) __pyx_t_10 = 0;
    } else if (unlikely(__pyx_t_11 >= __pyx_pybuffernd_output.diminfo[0].shape)) __pyx_t_10 = 0;
    if (unlikely(__pyx_t_10 != -1)) {
      __Pyx_RaiseBufferIndexError(__pyx_t_10);
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1010; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_double_t *, __pyx_pybuffernd_output.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_output.diminfo[0].strides) = (__pyx_v_neww * (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_double_t *, __pyx_pybuffernd_input.rcbuffer->pybuffer.buf, __pyx_t_9, __pyx_pybuffernd_input.diminfo[0].strides)));
    goto __pyx_L4;
  }
  /*else*/ {

    /* "pandas/algos.pyx":1012
 *         output[0] = neww * input[0]
 *     else:
 *         output[0] = input[0]             # <<<<<<<<<<<<<<
 * 
 *     for i from 1 <= i < N:
 */
    __pyx_t_12 = 0;
    __pyx_t_10 = -1;
    if (__pyx_t_12 < 0) {
      __pyx_t_12 += __pyx_pybuffernd_input.diminfo[0].shape;
      if (unlikely(__pyx_t_12 < 0)) __pyx_t_10 = 0;
    } else if (unlikely(__pyx_t_12 >= __pyx_pybuffernd_input.diminfo[0].shape)) __pyx_t_10 = 0;
    if (unlikely(__pyx_t_10 != -1)) {
      __Pyx_RaiseBufferIndexError(__pyx_t_10);
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1012; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_13 = 0;
    __pyx_t_10 = -1;
    if (__pyx_t_13 < 0) {
      __pyx_t_13 += __pyx_pybuffernd_output.diminfo[0].shape;
      if (unlikely(__pyx_t_13 < 0)) __pyx_t_10 = 0;
    } else if (unlikely(__pyx_t_13 >= __pyx_pybuffernd_output.diminfo[0].shape)) __pyx_t_10 = 0;
    if (unlikely(__pyx_t_10 != -1)) {
      __Pyx_RaiseBufferIndexError(__pyx_t_10);
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1012; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_double_t *, __pyx_pybuffernd_output.rcbuffer->pybuffer.buf, __pyx_t_13, __pyx_pybuffernd_output.diminfo[0].strides) = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_double_t *, __pyx_pybuffernd_input.rcbuffer->pybuffer.buf, __pyx_t_12, __pyx_pybuffernd_input.diminfo[0].strides));
  }
  __pyx_L4:;

  /* "pandas/algos.pyx":1014
 *         output[0] = 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++) {

    /* "pandas/algos.pyx":1015
 * 
 *     for i from 1 <= i < N:
 *         cur = input[i]             # <<<<<<<<<<<<<<
 *         prev = output[i - 1]
 * 
 */
    __pyx_t_14 = __pyx_v_i;
    __pyx_t_10 = -1;
    if (__pyx_t_14 < 0) {
      __pyx_t_14 += __pyx_pybuffernd_input.diminfo[0].shape;
      if (unlikely(__pyx_t_14 < 0)) __pyx_t_10 = 0;
    } else if (unlikely(__pyx_t_14 >= __pyx_pybuffernd_input.diminfo[0].shape)) __pyx_t_10 = 0;
    if (unlikely(__pyx_t_10 != -1)) {
      __Pyx_RaiseBufferIndexError(__pyx_t_10);
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1015; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_v_cur = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_double_t *, __pyx_pybuffernd_input.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_input.diminfo[0].strides));

    /* "pandas/algos.pyx":1016
 *     for i from 1 <= i < N:
 *         cur = input[i]
 *         prev = output[i - 1]             # <<<<<<<<<<<<<<
 * 
 *         if cur == cur:
 */
    __pyx_t_15 = (__pyx_v_i - 1);
    __pyx_t_10 = -1;
    if (__pyx_t_15 < 0) {
      __pyx_t_15 += __pyx_pybuffernd_output.diminfo[0].shape;
      if (unlikely(__pyx_t_15 < 0)) __pyx_t_10 = 0;
    } else if (unlikely(__pyx_t_15 >= __pyx_pybuffernd_output.diminfo[0].shape)) __pyx_t_10 = 0;
    if (unlikely(__pyx_t_10 != -1)) {
      __Pyx_RaiseBufferIndexError(__pyx_t_10);
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1016; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_v_prev = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_double_t *, __pyx_pybuffernd_output.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_output.diminfo[0].strides));

    /* "pandas/algos.pyx":1018
 *         prev = output[i - 1]
 * 
 *         if cur == cur:             # <<<<<<<<<<<<<<
 *             if prev == prev:
 *                 output[i] = oldw * prev + neww * cur
 */
    __pyx_t_7 = ((__pyx_v_cur == __pyx_v_cur) != 0);
    if (__pyx_t_7) {

      /* "pandas/algos.pyx":1019
 * 
 *         if cur == cur:
 *             if prev == prev:             # <<<<<<<<<<<<<<
 *                 output[i] = oldw * prev + neww * cur
 *             else:
 */
      __pyx_t_7 = ((__pyx_v_prev == __pyx_v_prev) != 0);
      if (__pyx_t_7) {

        /* "pandas/algos.pyx":1020
 *         if cur == cur:
 *             if prev == prev:
 *                 output[i] = oldw * prev + neww * cur             # <<<<<<<<<<<<<<
 *             else:
 *                 output[i] = neww * cur
 */
        __pyx_t_16 = __pyx_v_i;
        __pyx_t_10 = -1;
        if (__pyx_t_16 < 0) {
          __pyx_t_16 += __pyx_pybuffernd_output.diminfo[0].shape;
          if (unlikely(__pyx_t_16 < 0)) __pyx_t_10 = 0;
        } else if (unlikely(__pyx_t_16 >= __pyx_pybuffernd_output.diminfo[0].shape)) __pyx_t_10 = 0;
        if (unlikely(__pyx_t_10 != -1)) {
          __Pyx_RaiseBufferIndexError(__pyx_t_10);
          {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1020; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_double_t *, __pyx_pybuffernd_output.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_output.diminfo[0].strides) = ((__pyx_v_oldw * __pyx_v_prev) + (__pyx_v_neww * __pyx_v_cur));
        goto __pyx_L8;
      }
      /*else*/ {

        /* "pandas/algos.pyx":1022
 *                 output[i] = oldw * prev + neww * cur
 *             else:
 *                 output[i] = neww * cur             # <<<<<<<<<<<<<<
 *         else:
 *             output[i] = prev
 */
        __pyx_t_17 = __pyx_v_i;
        __pyx_t_10 = -1;
        if (__pyx_t_17 < 0) {
          __pyx_t_17 += __pyx_pybuffernd_output.diminfo[0].shape;
          if (unlikely(__pyx_t_17 < 0)) __pyx_t_10 = 0;
        } else if (unlikely(__pyx_t_17 >= __pyx_pybuffernd_output.diminfo[0].shape)) __pyx_t_10 = 0;
        if (unlikely(__pyx_t_10 != -1)) {
          __Pyx_RaiseBufferIndexError(__pyx_t_10);
          {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1022; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_double_t *, __pyx_pybuffernd_output.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_output.diminfo[0].strides) = (__pyx_v_neww * __pyx_v_cur);
      }
      __pyx_L8:;
      goto __pyx_L7;
    }
    /*else*/ {

      /* "pandas/algos.pyx":1024
 *                 output[i] = neww * cur
 *         else:
 *             output[i] = prev             # <<<<<<<<<<<<<<
 * 
 *     if adjust:
 */
      __pyx_t_18 = __pyx_v_i;
      __pyx_t_10 = -1;
      if (__pyx_t_18 < 0) {
        __pyx_t_18 += __pyx_pybuffernd_output.diminfo[0].shape;
        if (unlikely(__pyx_t_18 < 0)) __pyx_t_10 = 0;
      } else if (unlikely(__pyx_t_18 >= __pyx_pybuffernd_output.diminfo[0].shape)) __pyx_t_10 = 0;
      if (unlikely(__pyx_t_10 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_10);
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1024; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_double_t *, __pyx_pybuffernd_output.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_output.diminfo[0].strides) = __pyx_v_prev;
    }
    __pyx_L7:;
  }

  /* "pandas/algos.pyx":1026
 *             output[i] = prev
 * 
 *     if adjust:             # <<<<<<<<<<<<<<
 *         for i from 0 <= i < N:
 *             cur = input[i]
 */
  __pyx_t_7 = (__pyx_v_adjust != 0);
  if (__pyx_t_7) {

    /* "pandas/algos.pyx":1027
 * 
 *     if adjust:
 *         for i from 0 <= i < N:             # <<<<<<<<<<<<<<
 *             cur = input[i]
 * 
 */
    __pyx_t_1 = __pyx_v_N;
    for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_1; __pyx_v_i++) {

      /* "pandas/algos.pyx":1028
 *     if adjust:
 *         for i from 0 <= i < N:
 *             cur = input[i]             # <<<<<<<<<<<<<<
 * 
 *             if cur == cur:
 */
      __pyx_t_19 = __pyx_v_i;
      __pyx_t_10 = -1;
      if (__pyx_t_19 < 0) {
        __pyx_t_19 += __pyx_pybuffernd_input.diminfo[0].shape;
        if (unlikely(__pyx_t_19 < 0)) __pyx_t_10 = 0;
      } else if (unlikely(__pyx_t_19 >= __pyx_pybuffernd_input.diminfo[0].shape)) __pyx_t_10 = 0;
      if (unlikely(__pyx_t_10 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_10);
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1028; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_v_cur = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_double_t *, __pyx_pybuffernd_input.rcbuffer->pybuffer.buf, __pyx_t_19, __pyx_pybuffernd_input.diminfo[0].strides));

      /* "pandas/algos.pyx":1030
 *             cur = input[i]
 * 
 *             if cur == cur:             # <<<<<<<<<<<<<<
 *                 output[i] = output[i] / (1. - adj)
 *                 adj *= oldw
 */
      __pyx_t_7 = ((__pyx_v_cur == __pyx_v_cur) != 0);
      if (__pyx_t_7) {

        /* "pandas/algos.pyx":1031
 * 
 *             if cur == cur:
 *                 output[i] = output[i] / (1. - adj)             # <<<<<<<<<<<<<<
 *                 adj *= oldw
 *             else:
 */
        __pyx_t_20 = __pyx_v_i;
        __pyx_t_10 = -1;
        if (__pyx_t_20 < 0) {
          __pyx_t_20 += __pyx_pybuffernd_output.diminfo[0].shape;
          if (unlikely(__pyx_t_20 < 0)) __pyx_t_10 = 0;
        } else if (unlikely(__pyx_t_20 >= __pyx_pybuffernd_output.diminfo[0].shape)) __pyx_t_10 = 0;
        if (unlikely(__pyx_t_10 != -1)) {
          __Pyx_RaiseBufferIndexError(__pyx_t_10);
          {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1031; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        __pyx_t_8 = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_double_t *, __pyx_pybuffernd_output.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_output.diminfo[0].strides));
        __pyx_t_21 = (1. - __pyx_v_adj);
        if (unlikely(__pyx_t_21 == 0)) {
          #ifdef WITH_THREAD
          PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
          #endif
          PyErr_SetString(PyExc_ZeroDivisionError, "float division");
          #ifdef WITH_THREAD
          PyGILState_Release(__pyx_gilstate_save);
          #endif
          {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1031; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        __pyx_t_22 = __pyx_v_i;
        __pyx_t_10 = -1;
        if (__pyx_t_22 < 0) {
          __pyx_t_22 += __pyx_pybuffernd_output.diminfo[0].shape;
          if (unlikely(__pyx_t_22 < 0)) __pyx_t_10 = 0;
        } else if (unlikely(__pyx_t_22 >= __pyx_pybuffernd_output.diminfo[0].shape)) __pyx_t_10 = 0;
        if (unlikely(__pyx_t_10 != -1)) {
          __Pyx_RaiseBufferIndexError(__pyx_t_10);
          {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1031; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_double_t *, __pyx_pybuffernd_output.rcbuffer->pybuffer.buf, __pyx_t_22, __pyx_pybuffernd_output.diminfo[0].strides) = (__pyx_t_8 / __pyx_t_21);

        /* "pandas/algos.pyx":1032
 *             if cur == cur:
 *                 output[i] = output[i] / (1. - adj)
 *                 adj *= oldw             # <<<<<<<<<<<<<<
 *             else:
 *                 if i >= 1:
 */
        __pyx_v_adj = (__pyx_v_adj * __pyx_v_oldw);
        goto __pyx_L12;
      }
      /*else*/ {

        /* "pandas/algos.pyx":1034
 *                 adj *= oldw
 *             else:
 *                 if i >= 1:             # <<<<<<<<<<<<<<
 *                     output[i] = output[i - 1]
 * 
 */
        __pyx_t_7 = ((__pyx_v_i >= 1) != 0);
        if (__pyx_t_7) {

          /* "pandas/algos.pyx":1035
 *             else:
 *                 if i >= 1:
 *                     output[i] = output[i - 1]             # <<<<<<<<<<<<<<
 * 
 *     return output
 */
          __pyx_t_23 = (__pyx_v_i - 1);
          __pyx_t_10 = -1;
          if (__pyx_t_23 < 0) {
            __pyx_t_23 += __pyx_pybuffernd_output.diminfo[0].shape;
            if (unlikely(__pyx_t_23 < 0)) __pyx_t_10 = 0;
          } else if (unlikely(__pyx_t_23 >= __pyx_pybuffernd_output.diminfo[0].shape)) __pyx_t_10 = 0;
          if (unlikely(__pyx_t_10 != -1)) {
            __Pyx_RaiseBufferIndexError(__pyx_t_10);
            {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1035; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          }
          __pyx_t_24 = __pyx_v_i;
          __pyx_t_10 = -1;
          if (__pyx_t_24 < 0) {
            __pyx_t_24 += __pyx_pybuffernd_output.diminfo[0].shape;
            if (unlikely(__pyx_t_24 < 0)) __pyx_t_10 = 0;
          } else if (unlikely(__pyx_t_24 >= __pyx_pybuffernd_output.diminfo[0].shape)) __pyx_t_10 = 0;
          if (unlikely(__pyx_t_10 != -1)) {
            __Pyx_RaiseBufferIndexError(__pyx_t_10);
            {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1035; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          }
          *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_double_t *, __pyx_pybuffernd_output.rcbuffer->pybuffer.buf, __pyx_t_24, __pyx_pybuffernd_output.diminfo[0].strides) = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_double_t *, __pyx_pybuffernd_output.rcbuffer->pybuffer.buf, __pyx_t_23, __pyx_pybuffernd_output.diminfo[0].strides));
          goto __pyx_L13;
        }
        __pyx_L13:;
      }
      __pyx_L12:;
    }
    goto __pyx_L9;
  }
  __pyx_L9:;

  /* "pandas/algos.pyx":1037
 *                     output[i] = output[i - 1]
 * 
 *     return output             # <<<<<<<<<<<<<<
 * 
 * #----------------------------------------------------------------------
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_output));
  __pyx_r = ((PyObject *)__pyx_v_output);
  goto __pyx_L0;

  /* "pandas/algos.pyx":982
 * # Exponentially weighted moving average
 * 
 * def ewma(ndarray[double_t] input, double_t com, int adjust):             # <<<<<<<<<<<<<<
 *     '''
 *     Compute exponentially-weighted moving average using center-of-mass.
 */

  /* function exit code */
  __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_pybuffernd_input.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_output.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas.algos.ewma", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_input.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_output.rcbuffer->pybuffer);
  __pyx_L2:;
  __Pyx_XDECREF((PyObject *)__pyx_v_output);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/algos.pyx":1044
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def nancorr(ndarray[float64_t, ndim=2] mat, cov=False, minp=None):             # <<<<<<<<<<<<<<
 *     cdef:
 *         Py_ssize_t i, j, xi, yi, N, K
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pandas_5algos_29nancorr(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_5algos_29nancorr = {__Pyx_NAMESTR("nancorr"), (PyCFunction)__pyx_pw_6pandas_5algos_29nancorr, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pw_6pandas_5algos_29nancorr(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyArrayObject *__pyx_v_mat = 0;
  PyObject *__pyx_v_cov = 0;
  PyObject *__pyx_v_minp = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("nancorr (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_mat,&__pyx_n_s_cov,&__pyx_n_s_minp,0};
    PyObject* values[3] = {0,0,0};
    values[1] = ((PyObject *)Py_False);
    values[2] = ((PyObject *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_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 (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_mat)) != 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--; }
        }
        case  2:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_minp);
          if (value) { values[2] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "nancorr") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1044; __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_mat = ((PyArrayObject *)values[0]);
    __pyx_v_cov = values[1];
    __pyx_v_minp = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("nancorr", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1044; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas.algos.nancorr", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_mat), __pyx_ptype_5numpy_ndarray, 1, "mat", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1044; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_28nancorr(__pyx_self, __pyx_v_mat, __pyx_v_cov, __pyx_v_minp);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pandas_5algos_28nancorr(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_mat, PyObject *__pyx_v_cov, PyObject *__pyx_v_minp) {
  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;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_mask;
  __Pyx_Buffer __pyx_pybuffer_mask;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_mat;
  __Pyx_Buffer __pyx_pybuffer_mat;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_result;
  __Pyx_Buffer __pyx_pybuffer_result;
  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;
  int __pyx_t_8;
  int __pyx_t_9;
  PyObject *__pyx_t_10 = NULL;
  PyArrayObject *__pyx_t_11 = NULL;
  int __pyx_t_12;
  PyObject *__pyx_t_13 = NULL;
  PyObject *__pyx_t_14 = NULL;
  PyObject *__pyx_t_15 = NULL;
  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;
  Py_ssize_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;
  __Pyx_RefNannySetupContext("nancorr", 0);
  __Pyx_INCREF(__pyx_v_minp);
  __pyx_pybuffer_result.pybuffer.buf = NULL;
  __pyx_pybuffer_result.refcount = 0;
  __pyx_pybuffernd_result.data = NULL;
  __pyx_pybuffernd_result.rcbuffer = &__pyx_pybuffer_result;
  __pyx_pybuffer_mask.pybuffer.buf = NULL;
  __pyx_pybuffer_mask.refcount = 0;
  __pyx_pybuffernd_mask.data = NULL;
  __pyx_pybuffernd_mask.rcbuffer = &__pyx_pybuffer_mask;
  __pyx_pybuffer_mat.pybuffer.buf = NULL;
  __pyx_pybuffer_mat.refcount = 0;
  __pyx_pybuffernd_mat.data = NULL;
  __pyx_pybuffernd_mat.rcbuffer = &__pyx_pybuffer_mat;
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_mat.rcbuffer->pybuffer, (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[0]; __pyx_lineno = 1044; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_mat.diminfo[0].strides = __pyx_pybuffernd_mat.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_mat.diminfo[0].shape = __pyx_pybuffernd_mat.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_mat.diminfo[1].strides = __pyx_pybuffernd_mat.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_mat.diminfo[1].shape = __pyx_pybuffernd_mat.rcbuffer->pybuffer.shape[1];

  /* "pandas/algos.pyx":1049
 *         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;

  /* "pandas/algos.pyx":1052
 *         float64_t vx, vy, sumx, sumy, sumxx, sumyy, meanx, meany, divisor
 * 
 *     N, K = (<object> mat).shape             # <<<<<<<<<<<<<<
 * 
 *     if minp is None:
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_mat), __pyx_n_s_shape); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1052; __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 CYTHON_COMPILING_IN_CPYTHON
    Py_ssize_t size = Py_SIZE(sequence);
    #else
    Py_ssize_t size = PySequence_Size(sequence);
    #endif
    if (unlikely(size != 2)) {
      if (size > 2) __Pyx_RaiseTooManyValuesError(2);
      else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1052; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    #if CYTHON_COMPILING_IN_CPYTHON
    if (likely(PyTuple_CheckExact(sequence))) {
      __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); 
      __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1); 
    } else {
      __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);
    #else
    __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1052; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = PySequence_ITEM(sequence, 1); 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);
    #endif
    __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[0]; __pyx_lineno = 1052; __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_L3_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_L3_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_3);
    if (__Pyx_IternextUnpackEndCheck(__pyx_t_5(__pyx_t_4), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1052; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_5 = NULL;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    goto __pyx_L4_unpacking_done;
    __pyx_L3_unpacking_failed:;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_5 = NULL;
    if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1052; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_L4_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[0]; __pyx_lineno = 1052; __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[0]; __pyx_lineno = 1052; __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;

  /* "pandas/algos.pyx":1054
 *     N, K = (<object> mat).shape
 * 
 *     if minp is None:             # <<<<<<<<<<<<<<
 *         minp = 1
 * 
 */
  __pyx_t_8 = (__pyx_v_minp == Py_None);
  __pyx_t_9 = (__pyx_t_8 != 0);
  if (__pyx_t_9) {

    /* "pandas/algos.pyx":1055
 * 
 *     if minp is None:
 *         minp = 1             # <<<<<<<<<<<<<<
 * 
 *     result = np.empty((K, K), dtype=np.float64)
 */
    __Pyx_INCREF(__pyx_int_1);
    __Pyx_DECREF_SET(__pyx_v_minp, __pyx_int_1);
    goto __pyx_L5;
  }
  __pyx_L5:;

  /* "pandas/algos.pyx":1057
 *         minp = 1
 * 
 *     result = np.empty((K, K), dtype=np.float64)             # <<<<<<<<<<<<<<
 *     mask = np.isfinite(mat).view(np.uint8)
 * 
 */
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1057; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_empty); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1057; __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[0]; __pyx_lineno = 1057; __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[0]; __pyx_lineno = 1057; __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[0]; __pyx_lineno = 1057; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__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[0]; __pyx_lineno = 1057; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__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 = PyDict_New(); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1057; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1057; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_float64); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1057; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_10);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_dtype, __pyx_t_10) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1057; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_2, __pyx_t_4); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1057; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_10);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__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[0]; __pyx_lineno = 1057; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_11 = ((PyArrayObject *)__pyx_t_10);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer);
    __pyx_t_12 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_result.rcbuffer->pybuffer, (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_12 < 0)) {
      PyErr_Fetch(&__pyx_t_13, &__pyx_t_14, &__pyx_t_15);
      if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_result.rcbuffer->pybuffer, (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_13); Py_XDECREF(__pyx_t_14); Py_XDECREF(__pyx_t_15);
        __Pyx_RaiseBufferFallbackError();
      } else {
        PyErr_Restore(__pyx_t_13, __pyx_t_14, __pyx_t_15);
      }
    }
    __pyx_pybuffernd_result.diminfo[0].strides = __pyx_pybuffernd_result.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_result.diminfo[0].shape = __pyx_pybuffernd_result.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_result.diminfo[1].strides = __pyx_pybuffernd_result.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_result.diminfo[1].shape = __pyx_pybuffernd_result.rcbuffer->pybuffer.shape[1];
    if (unlikely(__pyx_t_12 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1057; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_11 = 0;
  __pyx_v_result = ((PyArrayObject *)__pyx_t_10);
  __pyx_t_10 = 0;

  /* "pandas/algos.pyx":1058
 * 
 *     result = np.empty((K, K), dtype=np.float64)
 *     mask = np.isfinite(mat).view(np.uint8)             # <<<<<<<<<<<<<<
 * 
 *     for xi in range(K):
 */
  __pyx_t_10 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1058; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_10);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_isfinite); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1058; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  __pyx_t_10 = PyTuple_New(1); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1058; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_10);
  __Pyx_INCREF(((PyObject *)__pyx_v_mat));
  PyTuple_SET_ITEM(__pyx_t_10, 0, ((PyObject *)__pyx_v_mat));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_mat));
  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_10, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1058; __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_10); __pyx_t_10 = 0;
  __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_view); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1058; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_10);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1058; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_uint8); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1058; __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[0]; __pyx_lineno = 1058; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__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 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_t_2, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1058; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  __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[0]; __pyx_lineno = 1058; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_16 = ((PyArrayObject *)__pyx_t_4);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_mask.rcbuffer->pybuffer);
    __pyx_t_12 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_mask.rcbuffer->pybuffer, (PyObject*)__pyx_t_16, &__Pyx_TypeInfo_nn___pyx_t_5numpy_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack);
    if (unlikely(__pyx_t_12 < 0)) {
      PyErr_Fetch(&__pyx_t_15, &__pyx_t_14, &__pyx_t_13);
      if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_mask.rcbuffer->pybuffer, (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_15); Py_XDECREF(__pyx_t_14); Py_XDECREF(__pyx_t_13);
        __Pyx_RaiseBufferFallbackError();
      } else {
        PyErr_Restore(__pyx_t_15, __pyx_t_14, __pyx_t_13);
      }
    }
    __pyx_pybuffernd_mask.diminfo[0].strides = __pyx_pybuffernd_mask.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_mask.diminfo[0].shape = __pyx_pybuffernd_mask.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_mask.diminfo[1].strides = __pyx_pybuffernd_mask.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_mask.diminfo[1].shape = __pyx_pybuffernd_mask.rcbuffer->pybuffer.shape[1];
    if (unlikely(__pyx_t_12 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1058; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_16 = 0;
  __pyx_v_mask = ((PyArrayObject *)__pyx_t_4);
  __pyx_t_4 = 0;

  /* "pandas/algos.pyx":1060
 *     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;

    /* "pandas/algos.pyx":1061
 * 
 *     for xi in range(K):
 *         for yi in range(xi + 1):             # <<<<<<<<<<<<<<
 *             nobs = sumxx = sumyy = sumx = sumy = 0
 *             for i in range(N):
 */
    __pyx_t_17 = (__pyx_v_xi + 1);
    for (__pyx_t_18 = 0; __pyx_t_18 < __pyx_t_17; __pyx_t_18+=1) {
      __pyx_v_yi = __pyx_t_18;

      /* "pandas/algos.pyx":1062
 *     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;

      /* "pandas/algos.pyx":1063
 *         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_19 = __pyx_v_N;
      for (__pyx_t_20 = 0; __pyx_t_20 < __pyx_t_19; __pyx_t_20+=1) {
        __pyx_v_i = __pyx_t_20;

        /* "pandas/algos.pyx":1064
 *             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_21 = __pyx_v_i;
        __pyx_t_22 = __pyx_v_xi;
        __pyx_t_9 = ((*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_uint8_t *, __pyx_pybuffernd_mask.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_mask.diminfo[0].strides, __pyx_t_22, __pyx_pybuffernd_mask.diminfo[1].strides)) != 0);
        if (__pyx_t_9) {
          __pyx_t_23 = __pyx_v_i;
          __pyx_t_24 = __pyx_v_yi;
          __pyx_t_8 = ((*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_uint8_t *, __pyx_pybuffernd_mask.rcbuffer->pybuffer.buf, __pyx_t_23, __pyx_pybuffernd_mask.diminfo[0].strides, __pyx_t_24, __pyx_pybuffernd_mask.diminfo[1].strides)) != 0);
          __pyx_t_25 = __pyx_t_8;
        } else {
          __pyx_t_25 = __pyx_t_9;
        }
        if (__pyx_t_25) {

          /* "pandas/algos.pyx":1065
 *             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_pybuffernd_mat.rcbuffer->pybuffer.buf, __pyx_t_26, __pyx_pybuffernd_mat.diminfo[0].strides, __pyx_t_27, __pyx_pybuffernd_mat.diminfo[1].strides));

          /* "pandas/algos.pyx":1066
 *                 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_pybuffernd_mat.rcbuffer->pybuffer.buf, __pyx_t_28, __pyx_pybuffernd_mat.diminfo[0].strides, __pyx_t_29, __pyx_pybuffernd_mat.diminfo[1].strides));

          /* "pandas/algos.pyx":1067
 *                     vx = mat[i, xi]
 *                     vy = mat[i, yi]
 *                     nobs += 1             # <<<<<<<<<<<<<<
 *                     sumx += vx
 *                     sumy += vy
 */
          __pyx_v_nobs = (__pyx_v_nobs + 1);

          /* "pandas/algos.pyx":1068
 *                     vy = mat[i, yi]
 *                     nobs += 1
 *                     sumx += vx             # <<<<<<<<<<<<<<
 *                     sumy += vy
 * 
 */
          __pyx_v_sumx = (__pyx_v_sumx + __pyx_v_vx);

          /* "pandas/algos.pyx":1069
 *                     nobs += 1
 *                     sumx += vx
 *                     sumy += vy             # <<<<<<<<<<<<<<
 * 
 *             if nobs < minp:
 */
          __pyx_v_sumy = (__pyx_v_sumy + __pyx_v_vy);
          goto __pyx_L12;
        }
        __pyx_L12:;
      }

      /* "pandas/algos.pyx":1071
 *                     sumy += vy
 * 
 *             if nobs < minp:             # <<<<<<<<<<<<<<
 *                 result[xi, yi] = result[yi, xi] = np.NaN
 *             else:
 */
      __pyx_t_4 = __Pyx_PyInt_From_npy_int64(__pyx_v_nobs); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1071; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_2 = PyObject_RichCompare(__pyx_t_4, __pyx_v_minp, Py_LT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1071; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_25 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_25 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1071; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      if (__pyx_t_25) {

        /* "pandas/algos.pyx":1072
 * 
 *             if nobs < minp:
 *                 result[xi, yi] = result[yi, xi] = np.NaN             # <<<<<<<<<<<<<<
 *             else:
 *                 meanx = sumx / nobs
 */
        __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1072; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_2);
        __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_NaN); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1072; __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[0]; __pyx_lineno = 1072; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __pyx_t_19 = __pyx_v_xi;
        __pyx_t_20 = __pyx_v_yi;
        *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_19, __pyx_pybuffernd_result.diminfo[0].strides, __pyx_t_20, __pyx_pybuffernd_result.diminfo[1].strides) = __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[0]; __pyx_lineno = 1072; __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_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_31, __pyx_pybuffernd_result.diminfo[0].strides, __pyx_t_32, __pyx_pybuffernd_result.diminfo[1].strides) = __pyx_t_30;
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        goto __pyx_L13;
      }
      /*else*/ {

        /* "pandas/algos.pyx":1074
 *                 result[xi, yi] = result[yi, xi] = np.NaN
 *             else:
 *                 meanx = sumx / nobs             # <<<<<<<<<<<<<<
 *                 meany = sumy / nobs
 * 
 */
        if (unlikely(__pyx_v_nobs == 0)) {
          #ifdef WITH_THREAD
          PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
          #endif
          PyErr_SetString(PyExc_ZeroDivisionError, "float division");
          #ifdef WITH_THREAD
          PyGILState_Release(__pyx_gilstate_save);
          #endif
          {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1074; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        __pyx_v_meanx = (__pyx_v_sumx / __pyx_v_nobs);

        /* "pandas/algos.pyx":1075
 *             else:
 *                 meanx = sumx / nobs
 *                 meany = sumy / nobs             # <<<<<<<<<<<<<<
 * 
 *                 # now the cov numerator
 */
        if (unlikely(__pyx_v_nobs == 0)) {
          #ifdef WITH_THREAD
          PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
          #endif
          PyErr_SetString(PyExc_ZeroDivisionError, "float division");
          #ifdef WITH_THREAD
          PyGILState_Release(__pyx_gilstate_save);
          #endif
          {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1075; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        __pyx_v_meany = (__pyx_v_sumy / __pyx_v_nobs);

        /* "pandas/algos.pyx":1078
 * 
 *                 # now the cov numerator
 *                 sumx = 0             # <<<<<<<<<<<<<<
 * 
 *                 for i in range(N):
 */
        __pyx_v_sumx = 0.0;

        /* "pandas/algos.pyx":1080
 *                 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;

          /* "pandas/algos.pyx":1081
 * 
 *                 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_25 = ((*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_uint8_t *, __pyx_pybuffernd_mask.rcbuffer->pybuffer.buf, __pyx_t_35, __pyx_pybuffernd_mask.diminfo[0].strides, __pyx_t_36, __pyx_pybuffernd_mask.diminfo[1].strides)) != 0);
          if (__pyx_t_25) {
            __pyx_t_37 = __pyx_v_i;
            __pyx_t_38 = __pyx_v_yi;
            __pyx_t_9 = ((*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_uint8_t *, __pyx_pybuffernd_mask.rcbuffer->pybuffer.buf, __pyx_t_37, __pyx_pybuffernd_mask.diminfo[0].strides, __pyx_t_38, __pyx_pybuffernd_mask.diminfo[1].strides)) != 0);
            __pyx_t_8 = __pyx_t_9;
          } else {
            __pyx_t_8 = __pyx_t_25;
          }
          if (__pyx_t_8) {

            /* "pandas/algos.pyx":1082
 *                 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_pybuffernd_mat.rcbuffer->pybuffer.buf, __pyx_t_39, __pyx_pybuffernd_mat.diminfo[0].strides, __pyx_t_40, __pyx_pybuffernd_mat.diminfo[1].strides)) - __pyx_v_meanx);

            /* "pandas/algos.pyx":1083
 *                     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_pybuffernd_mat.rcbuffer->pybuffer.buf, __pyx_t_41, __pyx_pybuffernd_mat.diminfo[0].strides, __pyx_t_42, __pyx_pybuffernd_mat.diminfo[1].strides)) - __pyx_v_meany);

            /* "pandas/algos.pyx":1085
 *                         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));

            /* "pandas/algos.pyx":1086
 * 
 *                         sumx += vx * vy
 *                         sumxx += vx * vx             # <<<<<<<<<<<<<<
 *                         sumyy += vy * vy
 * 
 */
            __pyx_v_sumxx = (__pyx_v_sumxx + (__pyx_v_vx * __pyx_v_vx));

            /* "pandas/algos.pyx":1087
 *                         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_L16;
          }
          __pyx_L16:;
        }

        /* "pandas/algos.pyx":1089
 *                         sumyy += vy * vy
 * 
 *                 divisor = (nobs - 1.0) if cov else sqrt(sumxx * sumyy)             # <<<<<<<<<<<<<<
 * 
 *                 if divisor != 0:
 */
        __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_v_cov); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1089; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        if (__pyx_t_8) {
          __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;

        /* "pandas/algos.pyx":1091
 *                 divisor = (nobs - 1.0) if cov else sqrt(sumxx * sumyy)
 * 
 *                 if divisor != 0:             # <<<<<<<<<<<<<<
 *                     result[xi, yi] = result[yi, xi] = sumx / divisor
 *                 else:
 */
        __pyx_t_8 = ((__pyx_v_divisor != 0.0) != 0);
        if (__pyx_t_8) {

          /* "pandas/algos.pyx":1092
 * 
 *                 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)) {
            #ifdef WITH_THREAD
            PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
            #endif
            PyErr_SetString(PyExc_ZeroDivisionError, "float division");
            #ifdef WITH_THREAD
            PyGILState_Release(__pyx_gilstate_save);
            #endif
            {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1092; __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_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_33, __pyx_pybuffernd_result.diminfo[0].strides, __pyx_t_34, __pyx_pybuffernd_result.diminfo[1].strides) = __pyx_t_30;
          __pyx_t_44 = __pyx_v_yi;
          __pyx_t_45 = __pyx_v_xi;
          *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_44, __pyx_pybuffernd_result.diminfo[0].strides, __pyx_t_45, __pyx_pybuffernd_result.diminfo[1].strides) = __pyx_t_30;
          goto __pyx_L17;
        }
        /*else*/ {

          /* "pandas/algos.pyx":1094
 *                     result[xi, yi] = result[yi, xi] = sumx / divisor
 *                 else:
 *                     result[xi, yi] = result[yi, xi] = np.NaN             # <<<<<<<<<<<<<<
 * 
 *     return result
 */
          __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1094; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_4);
          __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_NaN); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1094; __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[0]; __pyx_lineno = 1094; __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_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_46, __pyx_pybuffernd_result.diminfo[0].strides, __pyx_t_47, __pyx_pybuffernd_result.diminfo[1].strides) = __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[0]; __pyx_lineno = 1094; __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_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_48, __pyx_pybuffernd_result.diminfo[0].strides, __pyx_t_49, __pyx_pybuffernd_result.diminfo[1].strides) = __pyx_t_30;
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        }
        __pyx_L17:;
      }
      __pyx_L13:;
    }
  }

  /* "pandas/algos.pyx":1096
 *                     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;

  /* "pandas/algos.pyx":1044
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def nancorr(ndarray[float64_t, ndim=2] mat, cov=False, minp=None):             # <<<<<<<<<<<<<<
 *     cdef:
 *         Py_ssize_t i, j, xi, yi, N, K
 */

  /* function exit code */
  __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_10);
  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
    __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_mask.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_mat.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas.algos.nancorr", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_mask.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_mat.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer);
  __pyx_L2:;
  __Pyx_XDECREF((PyObject *)__pyx_v_result);
  __Pyx_XDECREF((PyObject *)__pyx_v_mask);
  __Pyx_XDECREF(__pyx_v_minp);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/algos.pyx":1103
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def nancorr_spearman(ndarray[float64_t, ndim=2] mat, Py_ssize_t minp=1):             # <<<<<<<<<<<<<<
 *     cdef:
 *         Py_ssize_t i, j, xi, yi, N, K
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pandas_5algos_31nancorr_spearman(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_5algos_31nancorr_spearman = {__Pyx_NAMESTR("nancorr_spearman"), (PyCFunction)__pyx_pw_6pandas_5algos_31nancorr_spearman, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pw_6pandas_5algos_31nancorr_spearman(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyArrayObject *__pyx_v_mat = 0;
  Py_ssize_t __pyx_v_minp;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("nancorr_spearman (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_mat,&__pyx_n_s_minp,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_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 (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_mat)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_minp);
          if (value) { values[1] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "nancorr_spearman") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1103; __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]);
    if (values[1]) {
      __pyx_v_minp = __Pyx_PyIndex_AsSsize_t(values[1]); if (unlikely((__pyx_v_minp == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1103; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    } else {
      __pyx_v_minp = ((Py_ssize_t)1);
    }
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("nancorr_spearman", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1103; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas.algos.nancorr_spearman", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_mat), __pyx_ptype_5numpy_ndarray, 1, "mat", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1103; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_30nancorr_spearman(__pyx_self, __pyx_v_mat, __pyx_v_minp);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pandas_5algos_30nancorr_spearman(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_mat, Py_ssize_t __pyx_v_minp) {
  Py_ssize_t __pyx_v_i;
  Py_ssize_t __pyx_v_j;
  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_maskedx = 0;
  PyArrayObject *__pyx_v_maskedy = 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_sumxx;
  __pyx_t_5numpy_float64_t __pyx_v_sumyy;
  __pyx_t_5numpy_float64_t __pyx_v_mean;
  __pyx_t_5numpy_float64_t __pyx_v_divisor;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_mask;
  __Pyx_Buffer __pyx_pybuffer_mask;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_maskedx;
  __Pyx_Buffer __pyx_pybuffer_maskedx;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_maskedy;
  __Pyx_Buffer __pyx_pybuffer_maskedy;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_mat;
  __Pyx_Buffer __pyx_pybuffer_mat;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_result;
  __Pyx_Buffer __pyx_pybuffer_result;
  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;
  int __pyx_t_21;
  Py_ssize_t __pyx_t_22;
  Py_ssize_t __pyx_t_23;
  int __pyx_t_24;
  int __pyx_t_25;
  __pyx_t_5numpy_float64_t __pyx_t_26;
  Py_ssize_t __pyx_t_27;
  Py_ssize_t __pyx_t_28;
  PyArrayObject *__pyx_t_29 = NULL;
  PyArrayObject *__pyx_t_30 = NULL;
  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;
  __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;
  Py_ssize_t __pyx_t_47;
  Py_ssize_t __pyx_t_48;
  Py_ssize_t __pyx_t_49;
  Py_ssize_t __pyx_t_50;
  Py_ssize_t __pyx_t_51;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("nancorr_spearman", 0);
  __pyx_pybuffer_result.pybuffer.buf = NULL;
  __pyx_pybuffer_result.refcount = 0;
  __pyx_pybuffernd_result.data = NULL;
  __pyx_pybuffernd_result.rcbuffer = &__pyx_pybuffer_result;
  __pyx_pybuffer_maskedx.pybuffer.buf = NULL;
  __pyx_pybuffer_maskedx.refcount = 0;
  __pyx_pybuffernd_maskedx.data = NULL;
  __pyx_pybuffernd_maskedx.rcbuffer = &__pyx_pybuffer_maskedx;
  __pyx_pybuffer_maskedy.pybuffer.buf = NULL;
  __pyx_pybuffer_maskedy.refcount = 0;
  __pyx_pybuffernd_maskedy.data = NULL;
  __pyx_pybuffernd_maskedy.rcbuffer = &__pyx_pybuffer_maskedy;
  __pyx_pybuffer_mask.pybuffer.buf = NULL;
  __pyx_pybuffer_mask.refcount = 0;
  __pyx_pybuffernd_mask.data = NULL;
  __pyx_pybuffernd_mask.rcbuffer = &__pyx_pybuffer_mask;
  __pyx_pybuffer_mat.pybuffer.buf = NULL;
  __pyx_pybuffer_mat.refcount = 0;
  __pyx_pybuffernd_mat.data = NULL;
  __pyx_pybuffernd_mat.rcbuffer = &__pyx_pybuffer_mat;
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_mat.rcbuffer->pybuffer, (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[0]; __pyx_lineno = 1103; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_mat.diminfo[0].strides = __pyx_pybuffernd_mat.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_mat.diminfo[0].shape = __pyx_pybuffernd_mat.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_mat.diminfo[1].strides = __pyx_pybuffernd_mat.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_mat.diminfo[1].shape = __pyx_pybuffernd_mat.rcbuffer->pybuffer.shape[1];

  /* "pandas/algos.pyx":1110
 *         ndarray[float64_t, ndim=1] maskedy
 *         ndarray[uint8_t, ndim=2] mask
 *         int64_t nobs = 0             # <<<<<<<<<<<<<<
 *         float64_t vx, vy, sumx, sumxx, sumyy, mean, divisor
 * 
 */
  __pyx_v_nobs = 0;

  /* "pandas/algos.pyx":1113
 *         float64_t vx, vy, sumx, sumxx, sumyy, mean, divisor
 * 
 *     N, K = (<object> mat).shape             # <<<<<<<<<<<<<<
 * 
 *     result = np.empty((K, K), dtype=np.float64)
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_mat), __pyx_n_s_shape); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1113; __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 CYTHON_COMPILING_IN_CPYTHON
    Py_ssize_t size = Py_SIZE(sequence);
    #else
    Py_ssize_t size = PySequence_Size(sequence);
    #endif
    if (unlikely(size != 2)) {
      if (size > 2) __Pyx_RaiseTooManyValuesError(2);
      else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1113; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    #if CYTHON_COMPILING_IN_CPYTHON
    if (likely(PyTuple_CheckExact(sequence))) {
      __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); 
      __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1); 
    } else {
      __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);
    #else
    __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1113; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1113; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    #endif
    __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[0]; __pyx_lineno = 1113; __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_L3_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_L3_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_3);
    if (__Pyx_IternextUnpackEndCheck(__pyx_t_5(__pyx_t_4), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1113; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_5 = NULL;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    goto __pyx_L4_unpacking_done;
    __pyx_L3_unpacking_failed:;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_5 = NULL;
    if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1113; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_L4_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[0]; __pyx_lineno = 1113; __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[0]; __pyx_lineno = 1113; __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;

  /* "pandas/algos.pyx":1115
 *     N, K = (<object> mat).shape
 * 
 *     result = np.empty((K, K), dtype=np.float64)             # <<<<<<<<<<<<<<
 *     mask = np.isfinite(mat).view(np.uint8)
 * 
 */
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1115; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_empty); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1115; __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[0]; __pyx_lineno = 1115; __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[0]; __pyx_lineno = 1115; __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[0]; __pyx_lineno = 1115; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__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[0]; __pyx_lineno = 1115; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__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 = PyDict_New(); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1115; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1115; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_float64); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1115; __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, __pyx_n_s_dtype, __pyx_t_8) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1115; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_2, __pyx_t_4); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1115; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__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[0]; __pyx_lineno = 1115; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_9 = ((PyArrayObject *)__pyx_t_8);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer);
    __pyx_t_10 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_result.rcbuffer->pybuffer, (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_pybuffernd_result.rcbuffer->pybuffer, (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_pybuffernd_result.diminfo[0].strides = __pyx_pybuffernd_result.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_result.diminfo[0].shape = __pyx_pybuffernd_result.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_result.diminfo[1].strides = __pyx_pybuffernd_result.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_result.diminfo[1].shape = __pyx_pybuffernd_result.rcbuffer->pybuffer.shape[1];
    if (unlikely(__pyx_t_10 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1115; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_9 = 0;
  __pyx_v_result = ((PyArrayObject *)__pyx_t_8);
  __pyx_t_8 = 0;

  /* "pandas/algos.pyx":1116
 * 
 *     result = np.empty((K, K), dtype=np.float64)
 *     mask = np.isfinite(mat).view(np.uint8)             # <<<<<<<<<<<<<<
 * 
 *     for xi in range(K):
 */
  __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1116; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_8);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_isfinite); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1116; __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[0]; __pyx_lineno = 1116; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__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 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_8, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1116; __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_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_view); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1116; __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_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1116; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_uint8); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1116; __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[0]; __pyx_lineno = 1116; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__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 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_2, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1116; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  __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[0]; __pyx_lineno = 1116; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_14 = ((PyArrayObject *)__pyx_t_4);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_mask.rcbuffer->pybuffer);
    __pyx_t_10 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_mask.rcbuffer->pybuffer, (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_pybuffernd_mask.rcbuffer->pybuffer, (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_pybuffernd_mask.diminfo[0].strides = __pyx_pybuffernd_mask.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_mask.diminfo[0].shape = __pyx_pybuffernd_mask.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_mask.diminfo[1].strides = __pyx_pybuffernd_mask.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_mask.diminfo[1].shape = __pyx_pybuffernd_mask.rcbuffer->pybuffer.shape[1];
    if (unlikely(__pyx_t_10 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1116; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_14 = 0;
  __pyx_v_mask = ((PyArrayObject *)__pyx_t_4);
  __pyx_t_4 = 0;

  /* "pandas/algos.pyx":1118
 *     mask = np.isfinite(mat).view(np.uint8)
 * 
 *     for xi in range(K):             # <<<<<<<<<<<<<<
 *         for yi in range(xi + 1):
 *             nobs = 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;

    /* "pandas/algos.pyx":1119
 * 
 *     for xi in range(K):
 *         for yi in range(xi + 1):             # <<<<<<<<<<<<<<
 *             nobs = 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;

      /* "pandas/algos.pyx":1120
 *     for xi in range(K):
 *         for yi in range(xi + 1):
 *             nobs = 0             # <<<<<<<<<<<<<<
 *             for i in range(N):
 *                 if mask[i, xi] and mask[i, yi]:
 */
      __pyx_v_nobs = 0;

      /* "pandas/algos.pyx":1121
 *         for yi in range(xi + 1):
 *             nobs = 0
 *             for i in range(N):             # <<<<<<<<<<<<<<
 *                 if mask[i, xi] and mask[i, yi]:
 *                     nobs += 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;

        /* "pandas/algos.pyx":1122
 *             nobs = 0
 *             for i in range(N):
 *                 if mask[i, xi] and mask[i, yi]:             # <<<<<<<<<<<<<<
 *                     nobs += 1
 * 
 */
        __pyx_t_19 = __pyx_v_i;
        __pyx_t_20 = __pyx_v_xi;
        __pyx_t_21 = ((*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_uint8_t *, __pyx_pybuffernd_mask.rcbuffer->pybuffer.buf, __pyx_t_19, __pyx_pybuffernd_mask.diminfo[0].strides, __pyx_t_20, __pyx_pybuffernd_mask.diminfo[1].strides)) != 0);
        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_pybuffernd_mask.rcbuffer->pybuffer.buf, __pyx_t_22, __pyx_pybuffernd_mask.diminfo[0].strides, __pyx_t_23, __pyx_pybuffernd_mask.diminfo[1].strides)) != 0);
          __pyx_t_25 = __pyx_t_24;
        } else {
          __pyx_t_25 = __pyx_t_21;
        }
        if (__pyx_t_25) {

          /* "pandas/algos.pyx":1123
 *             for i in range(N):
 *                 if mask[i, xi] and mask[i, yi]:
 *                     nobs += 1             # <<<<<<<<<<<<<<
 * 
 *             if nobs < minp:
 */
          __pyx_v_nobs = (__pyx_v_nobs + 1);
          goto __pyx_L11;
        }
        __pyx_L11:;
      }

      /* "pandas/algos.pyx":1125
 *                     nobs += 1
 * 
 *             if nobs < minp:             # <<<<<<<<<<<<<<
 *                 result[xi, yi] = result[yi, xi] = np.NaN
 *             else:
 */
      __pyx_t_25 = ((__pyx_v_nobs < __pyx_v_minp) != 0);
      if (__pyx_t_25) {

        /* "pandas/algos.pyx":1126
 * 
 *             if nobs < minp:
 *                 result[xi, yi] = result[yi, xi] = np.NaN             # <<<<<<<<<<<<<<
 *             else:
 *                 maskedx = np.empty(nobs, dtype=np.float64)
 */
        __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1126; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_4);
        __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_NaN); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1126; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __pyx_t_26 = __pyx_PyFloat_AsDouble(__pyx_t_2); if (unlikely((__pyx_t_26 == (npy_float64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1126; __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_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_result.diminfo[0].strides, __pyx_t_18, __pyx_pybuffernd_result.diminfo[1].strides) = __pyx_t_26;
        __pyx_t_26 = __pyx_PyFloat_AsDouble(__pyx_t_2); if (unlikely((__pyx_t_26 == (npy_float64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1126; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __pyx_t_27 = __pyx_v_yi;
        __pyx_t_28 = __pyx_v_xi;
        *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_27, __pyx_pybuffernd_result.diminfo[0].strides, __pyx_t_28, __pyx_pybuffernd_result.diminfo[1].strides) = __pyx_t_26;
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        goto __pyx_L12;
      }
      /*else*/ {

        /* "pandas/algos.pyx":1128
 *                 result[xi, yi] = result[yi, xi] = np.NaN
 *             else:
 *                 maskedx = np.empty(nobs, dtype=np.float64)             # <<<<<<<<<<<<<<
 *                 maskedy = np.empty(nobs, dtype=np.float64)
 *                 j = 0
 */
        __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1128; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_2);
        __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_empty); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1128; __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_PyInt_From_npy_int64(__pyx_v_nobs); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1128; __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 = 1128; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__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 = 1128; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_2);
        __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1128; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_3);
        __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_float64); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1128; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1128; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_8, __pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1128; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __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[0]; __pyx_lineno = 1128; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __pyx_t_29 = ((PyArrayObject *)__pyx_t_1);
        {
          __Pyx_BufFmt_StackElem __pyx_stack[1];
          __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_maskedx.rcbuffer->pybuffer);
          __pyx_t_10 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_maskedx.rcbuffer->pybuffer, (PyObject*)__pyx_t_29, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_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_pybuffernd_maskedx.rcbuffer->pybuffer, (PyObject*)__pyx_v_maskedx, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_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_pybuffernd_maskedx.diminfo[0].strides = __pyx_pybuffernd_maskedx.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_maskedx.diminfo[0].shape = __pyx_pybuffernd_maskedx.rcbuffer->pybuffer.shape[0];
          if (unlikely(__pyx_t_10 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1128; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        __pyx_t_29 = 0;
        __Pyx_XDECREF_SET(__pyx_v_maskedx, ((PyArrayObject *)__pyx_t_1));
        __pyx_t_1 = 0;

        /* "pandas/algos.pyx":1129
 *             else:
 *                 maskedx = np.empty(nobs, dtype=np.float64)
 *                 maskedy = np.empty(nobs, dtype=np.float64)             # <<<<<<<<<<<<<<
 *                 j = 0
 *                 for i in range(N):
 */
        __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1129; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_1);
        __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_empty); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1129; __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_PyInt_From_npy_int64(__pyx_v_nobs); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1129; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_1);
        __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1129; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_8);
        PyTuple_SET_ITEM(__pyx_t_8, 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 = 1129; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_1);
        __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1129; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_4);
        __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_float64); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1129; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1129; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_8, __pyx_t_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1129; __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_8); __pyx_t_8 = 0;
        __Pyx_DECREF(__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[0]; __pyx_lineno = 1129; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __pyx_t_30 = ((PyArrayObject *)__pyx_t_3);
        {
          __Pyx_BufFmt_StackElem __pyx_stack[1];
          __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_maskedy.rcbuffer->pybuffer);
          __pyx_t_10 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_maskedy.rcbuffer->pybuffer, (PyObject*)__pyx_t_30, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_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_pybuffernd_maskedy.rcbuffer->pybuffer, (PyObject*)__pyx_v_maskedy, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_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_pybuffernd_maskedy.diminfo[0].strides = __pyx_pybuffernd_maskedy.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_maskedy.diminfo[0].shape = __pyx_pybuffernd_maskedy.rcbuffer->pybuffer.shape[0];
          if (unlikely(__pyx_t_10 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1129; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        __pyx_t_30 = 0;
        __Pyx_XDECREF_SET(__pyx_v_maskedy, ((PyArrayObject *)__pyx_t_3));
        __pyx_t_3 = 0;

        /* "pandas/algos.pyx":1130
 *                 maskedx = np.empty(nobs, dtype=np.float64)
 *                 maskedy = np.empty(nobs, dtype=np.float64)
 *                 j = 0             # <<<<<<<<<<<<<<
 *                 for i in range(N):
 *                     if mask[i, xi] and mask[i, yi]:
 */
        __pyx_v_j = 0;

        /* "pandas/algos.pyx":1131
 *                 maskedy = np.empty(nobs, dtype=np.float64)
 *                 j = 0
 *                 for i in range(N):             # <<<<<<<<<<<<<<
 *                     if mask[i, xi] and mask[i, yi]:
 *                         maskedx[j] = mat[i, xi]
 */
        __pyx_t_31 = __pyx_v_N;
        for (__pyx_t_32 = 0; __pyx_t_32 < __pyx_t_31; __pyx_t_32+=1) {
          __pyx_v_i = __pyx_t_32;

          /* "pandas/algos.pyx":1132
 *                 j = 0
 *                 for i in range(N):
 *                     if mask[i, xi] and mask[i, yi]:             # <<<<<<<<<<<<<<
 *                         maskedx[j] = mat[i, xi]
 *                         maskedy[j] = mat[i, yi]
 */
          __pyx_t_33 = __pyx_v_i;
          __pyx_t_34 = __pyx_v_xi;
          __pyx_t_25 = ((*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_uint8_t *, __pyx_pybuffernd_mask.rcbuffer->pybuffer.buf, __pyx_t_33, __pyx_pybuffernd_mask.diminfo[0].strides, __pyx_t_34, __pyx_pybuffernd_mask.diminfo[1].strides)) != 0);
          if (__pyx_t_25) {
            __pyx_t_35 = __pyx_v_i;
            __pyx_t_36 = __pyx_v_yi;
            __pyx_t_21 = ((*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_uint8_t *, __pyx_pybuffernd_mask.rcbuffer->pybuffer.buf, __pyx_t_35, __pyx_pybuffernd_mask.diminfo[0].strides, __pyx_t_36, __pyx_pybuffernd_mask.diminfo[1].strides)) != 0);
            __pyx_t_24 = __pyx_t_21;
          } else {
            __pyx_t_24 = __pyx_t_25;
          }
          if (__pyx_t_24) {

            /* "pandas/algos.pyx":1133
 *                 for i in range(N):
 *                     if mask[i, xi] and mask[i, yi]:
 *                         maskedx[j] = mat[i, xi]             # <<<<<<<<<<<<<<
 *                         maskedy[j] = mat[i, yi]
 *                         j += 1
 */
            __pyx_t_37 = __pyx_v_i;
            __pyx_t_38 = __pyx_v_xi;
            __pyx_t_39 = __pyx_v_j;
            *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_maskedx.rcbuffer->pybuffer.buf, __pyx_t_39, __pyx_pybuffernd_maskedx.diminfo[0].strides) = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_mat.rcbuffer->pybuffer.buf, __pyx_t_37, __pyx_pybuffernd_mat.diminfo[0].strides, __pyx_t_38, __pyx_pybuffernd_mat.diminfo[1].strides));

            /* "pandas/algos.pyx":1134
 *                     if mask[i, xi] and mask[i, yi]:
 *                         maskedx[j] = mat[i, xi]
 *                         maskedy[j] = mat[i, yi]             # <<<<<<<<<<<<<<
 *                         j += 1
 *                 maskedx = rank_1d_float64(maskedx)
 */
            __pyx_t_40 = __pyx_v_i;
            __pyx_t_41 = __pyx_v_yi;
            __pyx_t_42 = __pyx_v_j;
            *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_maskedy.rcbuffer->pybuffer.buf, __pyx_t_42, __pyx_pybuffernd_maskedy.diminfo[0].strides) = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_mat.rcbuffer->pybuffer.buf, __pyx_t_40, __pyx_pybuffernd_mat.diminfo[0].strides, __pyx_t_41, __pyx_pybuffernd_mat.diminfo[1].strides));

            /* "pandas/algos.pyx":1135
 *                         maskedx[j] = mat[i, xi]
 *                         maskedy[j] = mat[i, yi]
 *                         j += 1             # <<<<<<<<<<<<<<
 *                 maskedx = rank_1d_float64(maskedx)
 *                 maskedy = rank_1d_float64(maskedy)
 */
            __pyx_v_j = (__pyx_v_j + 1);
            goto __pyx_L15;
          }
          __pyx_L15:;
        }

        /* "pandas/algos.pyx":1136
 *                         maskedy[j] = mat[i, yi]
 *                         j += 1
 *                 maskedx = rank_1d_float64(maskedx)             # <<<<<<<<<<<<<<
 *                 maskedy = rank_1d_float64(maskedy)
 * 
 */
        __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_rank_1d_float64); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1136; __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[0]; __pyx_lineno = 1136; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_INCREF(((PyObject *)__pyx_v_maskedx));
        PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_maskedx));
        __Pyx_GIVEREF(((PyObject *)__pyx_v_maskedx));
        __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_1, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1136; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 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 = 1136; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __pyx_t_29 = ((PyArrayObject *)__pyx_t_8);
        {
          __Pyx_BufFmt_StackElem __pyx_stack[1];
          __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_maskedx.rcbuffer->pybuffer);
          __pyx_t_10 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_maskedx.rcbuffer->pybuffer, (PyObject*)__pyx_t_29, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_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_pybuffernd_maskedx.rcbuffer->pybuffer, (PyObject*)__pyx_v_maskedx, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_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_pybuffernd_maskedx.diminfo[0].strides = __pyx_pybuffernd_maskedx.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_maskedx.diminfo[0].shape = __pyx_pybuffernd_maskedx.rcbuffer->pybuffer.shape[0];
          if (unlikely(__pyx_t_10 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1136; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        __pyx_t_29 = 0;
        __Pyx_DECREF_SET(__pyx_v_maskedx, ((PyArrayObject *)__pyx_t_8));
        __pyx_t_8 = 0;

        /* "pandas/algos.pyx":1137
 *                         j += 1
 *                 maskedx = rank_1d_float64(maskedx)
 *                 maskedy = rank_1d_float64(maskedy)             # <<<<<<<<<<<<<<
 * 
 *                 mean = (nobs + 1) / 2.
 */
        __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_rank_1d_float64); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1137; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_8);
        __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1137; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_INCREF(((PyObject *)__pyx_v_maskedy));
        PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_maskedy));
        __Pyx_GIVEREF(((PyObject *)__pyx_v_maskedy));
        __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1137; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __Pyx_DECREF(__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[0]; __pyx_lineno = 1137; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __pyx_t_30 = ((PyArrayObject *)__pyx_t_3);
        {
          __Pyx_BufFmt_StackElem __pyx_stack[1];
          __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_maskedy.rcbuffer->pybuffer);
          __pyx_t_10 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_maskedy.rcbuffer->pybuffer, (PyObject*)__pyx_t_30, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_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_pybuffernd_maskedy.rcbuffer->pybuffer, (PyObject*)__pyx_v_maskedy, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_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_pybuffernd_maskedy.diminfo[0].strides = __pyx_pybuffernd_maskedy.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_maskedy.diminfo[0].shape = __pyx_pybuffernd_maskedy.rcbuffer->pybuffer.shape[0];
          if (unlikely(__pyx_t_10 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1137; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        __pyx_t_30 = 0;
        __Pyx_DECREF_SET(__pyx_v_maskedy, ((PyArrayObject *)__pyx_t_3));
        __pyx_t_3 = 0;

        /* "pandas/algos.pyx":1139
 *                 maskedy = rank_1d_float64(maskedy)
 * 
 *                 mean = (nobs + 1) / 2.             # <<<<<<<<<<<<<<
 * 
 *                 # now the cov numerator
 */
        __pyx_v_mean = ((__pyx_v_nobs + 1) / 2.);

        /* "pandas/algos.pyx":1142
 * 
 *                 # now the cov numerator
 *                 sumx = sumxx = sumyy = 0             # <<<<<<<<<<<<<<
 * 
 *                 for i in range(nobs):
 */
        __pyx_v_sumx = 0;
        __pyx_v_sumxx = 0;
        __pyx_v_sumyy = 0;

        /* "pandas/algos.pyx":1144
 *                 sumx = sumxx = sumyy = 0
 * 
 *                 for i in range(nobs):             # <<<<<<<<<<<<<<
 *                     vx = maskedx[i] - mean
 *                     vy = maskedy[i] - mean
 */
        __pyx_t_43 = __pyx_v_nobs;
        for (__pyx_t_31 = 0; __pyx_t_31 < __pyx_t_43; __pyx_t_31+=1) {
          __pyx_v_i = __pyx_t_31;

          /* "pandas/algos.pyx":1145
 * 
 *                 for i in range(nobs):
 *                     vx = maskedx[i] - mean             # <<<<<<<<<<<<<<
 *                     vy = maskedy[i] - mean
 * 
 */
          __pyx_t_32 = __pyx_v_i;
          __pyx_v_vx = ((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_maskedx.rcbuffer->pybuffer.buf, __pyx_t_32, __pyx_pybuffernd_maskedx.diminfo[0].strides)) - __pyx_v_mean);

          /* "pandas/algos.pyx":1146
 *                 for i in range(nobs):
 *                     vx = maskedx[i] - mean
 *                     vy = maskedy[i] - mean             # <<<<<<<<<<<<<<
 * 
 *                     sumx += vx * vy
 */
          __pyx_t_44 = __pyx_v_i;
          __pyx_v_vy = ((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_maskedy.rcbuffer->pybuffer.buf, __pyx_t_44, __pyx_pybuffernd_maskedy.diminfo[0].strides)) - __pyx_v_mean);

          /* "pandas/algos.pyx":1148
 *                     vy = maskedy[i] - mean
 * 
 *                     sumx += vx * vy             # <<<<<<<<<<<<<<
 *                     sumxx += vx * vx
 *                     sumyy += vy * vy
 */
          __pyx_v_sumx = (__pyx_v_sumx + (__pyx_v_vx * __pyx_v_vy));

          /* "pandas/algos.pyx":1149
 * 
 *                     sumx += vx * vy
 *                     sumxx += vx * vx             # <<<<<<<<<<<<<<
 *                     sumyy += vy * vy
 * 
 */
          __pyx_v_sumxx = (__pyx_v_sumxx + (__pyx_v_vx * __pyx_v_vx));

          /* "pandas/algos.pyx":1150
 *                     sumx += vx * vy
 *                     sumxx += vx * vx
 *                     sumyy += vy * vy             # <<<<<<<<<<<<<<
 * 
 *                 divisor = sqrt(sumxx * sumyy)
 */
          __pyx_v_sumyy = (__pyx_v_sumyy + (__pyx_v_vy * __pyx_v_vy));
        }

        /* "pandas/algos.pyx":1152
 *                     sumyy += vy * vy
 * 
 *                 divisor = sqrt(sumxx * sumyy)             # <<<<<<<<<<<<<<
 * 
 *                 if divisor != 0:
 */
        __pyx_v_divisor = sqrt((__pyx_v_sumxx * __pyx_v_sumyy));

        /* "pandas/algos.pyx":1154
 *                 divisor = sqrt(sumxx * sumyy)
 * 
 *                 if divisor != 0:             # <<<<<<<<<<<<<<
 *                     result[xi, yi] = result[yi, xi] = sumx / divisor
 *                 else:
 */
        __pyx_t_24 = ((__pyx_v_divisor != 0.0) != 0);
        if (__pyx_t_24) {

          /* "pandas/algos.pyx":1155
 * 
 *                 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)) {
            #ifdef WITH_THREAD
            PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
            #endif
            PyErr_SetString(PyExc_ZeroDivisionError, "float division");
            #ifdef WITH_THREAD
            PyGILState_Release(__pyx_gilstate_save);
            #endif
            {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1155; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          }
          __pyx_t_26 = (__pyx_v_sumx / __pyx_v_divisor);
          __pyx_t_31 = __pyx_v_xi;
          __pyx_t_45 = __pyx_v_yi;
          *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_31, __pyx_pybuffernd_result.diminfo[0].strides, __pyx_t_45, __pyx_pybuffernd_result.diminfo[1].strides) = __pyx_t_26;
          __pyx_t_46 = __pyx_v_yi;
          __pyx_t_47 = __pyx_v_xi;
          *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_46, __pyx_pybuffernd_result.diminfo[0].strides, __pyx_t_47, __pyx_pybuffernd_result.diminfo[1].strides) = __pyx_t_26;
          goto __pyx_L18;
        }
        /*else*/ {

          /* "pandas/algos.pyx":1157
 *                     result[xi, yi] = result[yi, xi] = sumx / divisor
 *                 else:
 *                     result[xi, yi] = result[yi, xi] = np.NaN             # <<<<<<<<<<<<<<
 * 
 *     return result
 */
          __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1157; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_3);
          __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_NaN); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1157; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
          __pyx_t_26 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_26 == (npy_float64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1157; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __pyx_t_48 = __pyx_v_xi;
          __pyx_t_49 = __pyx_v_yi;
          *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_48, __pyx_pybuffernd_result.diminfo[0].strides, __pyx_t_49, __pyx_pybuffernd_result.diminfo[1].strides) = __pyx_t_26;
          __pyx_t_26 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_26 == (npy_float64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1157; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __pyx_t_50 = __pyx_v_yi;
          __pyx_t_51 = __pyx_v_xi;
          *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_50, __pyx_pybuffernd_result.diminfo[0].strides, __pyx_t_51, __pyx_pybuffernd_result.diminfo[1].strides) = __pyx_t_26;
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        }
        __pyx_L18:;
      }
      __pyx_L12:;
    }
  }

  /* "pandas/algos.pyx":1159
 *                     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;

  /* "pandas/algos.pyx":1103
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def nancorr_spearman(ndarray[float64_t, ndim=2] mat, Py_ssize_t minp=1):             # <<<<<<<<<<<<<<
 *     cdef:
 *         Py_ssize_t i, j, xi, yi, N, K
 */

  /* function exit code */
  __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_pybuffernd_mask.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_maskedx.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_maskedy.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_mat.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas.algos.nancorr_spearman", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_mask.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_maskedx.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_maskedy.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_mat.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer);
  __pyx_L2:;
  __Pyx_XDECREF((PyObject *)__pyx_v_result);
  __Pyx_XDECREF((PyObject *)__pyx_v_maskedx);
  __Pyx_XDECREF((PyObject *)__pyx_v_maskedy);
  __Pyx_XDECREF((PyObject *)__pyx_v_mask);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/algos.pyx":1164
 * # Rolling variance
 * 
 * def roll_var(ndarray[double_t] input, int win, int minp, int ddof=1):             # <<<<<<<<<<<<<<
 *     """
 *     Numerically stable implementation using Welford's method.
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pandas_5algos_33roll_var(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6pandas_5algos_32roll_var[] = "\n    Numerically stable implementation using Welford's method.\n    ";
static PyMethodDef __pyx_mdef_6pandas_5algos_33roll_var = {__Pyx_NAMESTR("roll_var"), (PyCFunction)__pyx_pw_6pandas_5algos_33roll_var, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6pandas_5algos_32roll_var)};
static PyObject *__pyx_pw_6pandas_5algos_33roll_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;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("roll_var (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_input,&__pyx_n_s_win,&__pyx_n_s_minp,&__pyx_n_s_ddof,0};
    PyObject* values[4] = {0,0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_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 (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_input)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_win)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("roll_var", 0, 3, 4, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1164; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_minp)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("roll_var", 0, 3, 4, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1164; __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, pos_args, "roll_var") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1164; __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_As_int(values[1]); if (unlikely((__pyx_v_win == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1164; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_v_minp = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_minp == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1164; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    if (values[3]) {
      __pyx_v_ddof = __Pyx_PyInt_As_int(values[3]); if (unlikely((__pyx_v_ddof == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1164; __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[0]; __pyx_lineno = 1164; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas.algos.roll_var", __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[0]; __pyx_lineno = 1164; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_32roll_var(__pyx_self, __pyx_v_input, __pyx_v_win, __pyx_v_minp, __pyx_v_ddof);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pandas_5algos_32roll_var(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_input, int __pyx_v_win, int __pyx_v_minp, int __pyx_v_ddof) {
  double __pyx_v_val;
  double __pyx_v_prev;
  double __pyx_v_mean_x;
  double __pyx_v_ssqdm_x;
  double __pyx_v_nobs;
  double __pyx_v_delta;
  Py_ssize_t __pyx_v_i;
  Py_ssize_t __pyx_v_N;
  PyArrayObject *__pyx_v_output = 0;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_input;
  __Pyx_Buffer __pyx_pybuffer_input;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_output;
  __Pyx_Buffer __pyx_pybuffer_output;
  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;
  PyObject *__pyx_t_7 = NULL;
  int __pyx_t_8;
  int __pyx_t_9;
  int __pyx_t_10;
  double __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;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("roll_var", 0);
  __pyx_pybuffer_output.pybuffer.buf = NULL;
  __pyx_pybuffer_output.refcount = 0;
  __pyx_pybuffernd_output.data = NULL;
  __pyx_pybuffernd_output.rcbuffer = &__pyx_pybuffer_output;
  __pyx_pybuffer_input.pybuffer.buf = NULL;
  __pyx_pybuffer_input.refcount = 0;
  __pyx_pybuffernd_input.data = NULL;
  __pyx_pybuffernd_input.rcbuffer = &__pyx_pybuffer_input;
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_input.rcbuffer->pybuffer, (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[0]; __pyx_lineno = 1164; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_input.diminfo[0].strides = __pyx_pybuffernd_input.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_input.diminfo[0].shape = __pyx_pybuffernd_input.rcbuffer->pybuffer.shape[0];

  /* "pandas/algos.pyx":1168
 *     Numerically stable implementation using Welford's method.
 *     """
 *     cdef double val, prev, mean_x = 0, ssqdm_x = 0, nobs = 0, delta             # <<<<<<<<<<<<<<
 *     cdef Py_ssize_t i
 *     cdef Py_ssize_t N = len(input)
 */
  __pyx_v_mean_x = 0.0;
  __pyx_v_ssqdm_x = 0.0;
  __pyx_v_nobs = 0.0;

  /* "pandas/algos.pyx":1170
 *     cdef double val, prev, mean_x = 0, ssqdm_x = 0, nobs = 0, delta
 *     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[0]; __pyx_lineno = 1170; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_N = __pyx_t_1;

  /* "pandas/algos.pyx":1172
 *     cdef Py_ssize_t N = len(input)
 * 
 *     cdef ndarray[double_t] output = np.empty(N, dtype=float)             # <<<<<<<<<<<<<<
 * 
 *     minp = _check_minp(win, minp, N)
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1172; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_empty); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1172; __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 = 1172; __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 = 1172; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__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 = 1172; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, ((PyObject *)((PyObject*)(&PyFloat_Type)))) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1172; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1172; __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_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__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 = 1172; __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_pybuffernd_output.rcbuffer->pybuffer, (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_pybuffernd_output.rcbuffer->pybuffer.buf = NULL;
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1172; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    } else {__pyx_pybuffernd_output.diminfo[0].strides = __pyx_pybuffernd_output.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_output.diminfo[0].shape = __pyx_pybuffernd_output.rcbuffer->pybuffer.shape[0];
    }
  }
  __pyx_t_6 = 0;
  __pyx_v_output = ((PyArrayObject *)__pyx_t_5);
  __pyx_t_5 = 0;

  /* "pandas/algos.pyx":1174
 *     cdef ndarray[double_t] output = np.empty(N, dtype=float)
 * 
 *     minp = _check_minp(win, minp, N)             # <<<<<<<<<<<<<<
 * 
 *     for i from 0 <= i < win:
 */
  __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_check_minp); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1174; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_win); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1174; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_minp); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1174; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_N); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1174; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_7 = PyTuple_New(3); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1174; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__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_4);
  __Pyx_GIVEREF(__pyx_t_4);
  PyTuple_SET_ITEM(__pyx_t_7, 2, __pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_3);
  __pyx_t_2 = 0;
  __pyx_t_4 = 0;
  __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_7, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1174; __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_7); __pyx_t_7 = 0;
  __pyx_t_8 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_8 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1174; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_v_minp = __pyx_t_8;

  /* "pandas/algos.pyx":1176
 *     minp = _check_minp(win, minp, N)
 * 
 *     for i from 0 <= i < win:             # <<<<<<<<<<<<<<
 *         val = input[i]
 * 
 */
  __pyx_t_8 = __pyx_v_win;
  for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_8; __pyx_v_i++) {

    /* "pandas/algos.pyx":1177
 * 
 *     for i from 0 <= i < win:
 *         val = input[i]             # <<<<<<<<<<<<<<
 * 
 *         # Not NaN
 */
    __pyx_t_1 = __pyx_v_i;
    __pyx_t_9 = -1;
    if (__pyx_t_1 < 0) {
      __pyx_t_1 += __pyx_pybuffernd_input.diminfo[0].shape;
      if (unlikely(__pyx_t_1 < 0)) __pyx_t_9 = 0;
    } else if (unlikely(__pyx_t_1 >= __pyx_pybuffernd_input.diminfo[0].shape)) __pyx_t_9 = 0;
    if (unlikely(__pyx_t_9 != -1)) {
      __Pyx_RaiseBufferIndexError(__pyx_t_9);
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1177; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_v_val = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_double_t *, __pyx_pybuffernd_input.rcbuffer->pybuffer.buf, __pyx_t_1, __pyx_pybuffernd_input.diminfo[0].strides));

    /* "pandas/algos.pyx":1180
 * 
 *         # Not NaN
 *         if val == val:             # <<<<<<<<<<<<<<
 *             nobs += 1
 *             delta = (val - mean_x)
 */
    __pyx_t_10 = ((__pyx_v_val == __pyx_v_val) != 0);
    if (__pyx_t_10) {

      /* "pandas/algos.pyx":1181
 *         # Not NaN
 *         if val == val:
 *             nobs += 1             # <<<<<<<<<<<<<<
 *             delta = (val - mean_x)
 *             mean_x += delta / nobs
 */
      __pyx_v_nobs = (__pyx_v_nobs + 1.0);

      /* "pandas/algos.pyx":1182
 *         if val == val:
 *             nobs += 1
 *             delta = (val - mean_x)             # <<<<<<<<<<<<<<
 *             mean_x += delta / nobs
 *             ssqdm_x += delta * (val - mean_x)
 */
      __pyx_v_delta = (__pyx_v_val - __pyx_v_mean_x);

      /* "pandas/algos.pyx":1183
 *             nobs += 1
 *             delta = (val - mean_x)
 *             mean_x += delta / nobs             # <<<<<<<<<<<<<<
 *             ssqdm_x += delta * (val - mean_x)
 * 
 */
      if (unlikely(__pyx_v_nobs == 0)) {
        #ifdef WITH_THREAD
        PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
        #endif
        PyErr_SetString(PyExc_ZeroDivisionError, "float division");
        #ifdef WITH_THREAD
        PyGILState_Release(__pyx_gilstate_save);
        #endif
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1183; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_v_mean_x = (__pyx_v_mean_x + (__pyx_v_delta / __pyx_v_nobs));

      /* "pandas/algos.pyx":1184
 *             delta = (val - mean_x)
 *             mean_x += delta / nobs
 *             ssqdm_x += delta * (val - mean_x)             # <<<<<<<<<<<<<<
 * 
 *         if nobs >= minp:
 */
      __pyx_v_ssqdm_x = (__pyx_v_ssqdm_x + (__pyx_v_delta * (__pyx_v_val - __pyx_v_mean_x)));
      goto __pyx_L5;
    }
    __pyx_L5:;

    /* "pandas/algos.pyx":1186
 *             ssqdm_x += delta * (val - mean_x)
 * 
 *         if nobs >= minp:             # <<<<<<<<<<<<<<
 *             #pathological case
 *             if nobs == 1:
 */
    __pyx_t_10 = ((__pyx_v_nobs >= __pyx_v_minp) != 0);
    if (__pyx_t_10) {

      /* "pandas/algos.pyx":1188
 *         if nobs >= minp:
 *             #pathological case
 *             if nobs == 1:             # <<<<<<<<<<<<<<
 *                 val = 0
 *             else:
 */
      __pyx_t_10 = ((__pyx_v_nobs == 1.0) != 0);
      if (__pyx_t_10) {

        /* "pandas/algos.pyx":1189
 *             #pathological case
 *             if nobs == 1:
 *                 val = 0             # <<<<<<<<<<<<<<
 *             else:
 *                 val = ssqdm_x / (nobs - ddof)
 */
        __pyx_v_val = 0.0;
        goto __pyx_L7;
      }
      /*else*/ {

        /* "pandas/algos.pyx":1191
 *                 val = 0
 *             else:
 *                 val = ssqdm_x / (nobs - ddof)             # <<<<<<<<<<<<<<
 *                 if val < 0:
 *                     val = 0
 */
        __pyx_t_11 = (__pyx_v_nobs - __pyx_v_ddof);
        if (unlikely(__pyx_t_11 == 0)) {
          #ifdef WITH_THREAD
          PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
          #endif
          PyErr_SetString(PyExc_ZeroDivisionError, "float division");
          #ifdef WITH_THREAD
          PyGILState_Release(__pyx_gilstate_save);
          #endif
          {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1191; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        __pyx_v_val = (__pyx_v_ssqdm_x / __pyx_t_11);

        /* "pandas/algos.pyx":1192
 *             else:
 *                 val = ssqdm_x / (nobs - ddof)
 *                 if val < 0:             # <<<<<<<<<<<<<<
 *                     val = 0
 *         else:
 */
        __pyx_t_10 = ((__pyx_v_val < 0.0) != 0);
        if (__pyx_t_10) {

          /* "pandas/algos.pyx":1193
 *                 val = ssqdm_x / (nobs - ddof)
 *                 if val < 0:
 *                     val = 0             # <<<<<<<<<<<<<<
 *         else:
 *             val = NaN
 */
          __pyx_v_val = 0.0;
          goto __pyx_L8;
        }
        __pyx_L8:;
      }
      __pyx_L7:;
      goto __pyx_L6;
    }
    /*else*/ {

      /* "pandas/algos.pyx":1195
 *                     val = 0
 *         else:
 *             val = NaN             # <<<<<<<<<<<<<<
 * 
 *         output[i] = val
 */
      __pyx_v_val = __pyx_v_6pandas_5algos_NaN;
    }
    __pyx_L6:;

    /* "pandas/algos.pyx":1197
 *             val = NaN
 * 
 *         output[i] = val             # <<<<<<<<<<<<<<
 * 
 *     for i from win <= i < N:
 */
    __pyx_t_12 = __pyx_v_i;
    __pyx_t_9 = -1;
    if (__pyx_t_12 < 0) {
      __pyx_t_12 += __pyx_pybuffernd_output.diminfo[0].shape;
      if (unlikely(__pyx_t_12 < 0)) __pyx_t_9 = 0;
    } else if (unlikely(__pyx_t_12 >= __pyx_pybuffernd_output.diminfo[0].shape)) __pyx_t_9 = 0;
    if (unlikely(__pyx_t_9 != -1)) {
      __Pyx_RaiseBufferIndexError(__pyx_t_9);
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1197; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_double_t *, __pyx_pybuffernd_output.rcbuffer->pybuffer.buf, __pyx_t_12, __pyx_pybuffernd_output.diminfo[0].strides) = __pyx_v_val;
  }

  /* "pandas/algos.pyx":1199
 *         output[i] = val
 * 
 *     for i from win <= i < N:             # <<<<<<<<<<<<<<
 *         val = input[i]
 *         prev = input[i - win]
 */
  __pyx_t_13 = __pyx_v_N;
  for (__pyx_v_i = __pyx_v_win; __pyx_v_i < __pyx_t_13; __pyx_v_i++) {

    /* "pandas/algos.pyx":1200
 * 
 *     for i from win <= i < N:
 *         val = input[i]             # <<<<<<<<<<<<<<
 *         prev = input[i - win]
 * 
 */
    __pyx_t_14 = __pyx_v_i;
    __pyx_t_8 = -1;
    if (__pyx_t_14 < 0) {
      __pyx_t_14 += __pyx_pybuffernd_input.diminfo[0].shape;
      if (unlikely(__pyx_t_14 < 0)) __pyx_t_8 = 0;
    } else if (unlikely(__pyx_t_14 >= __pyx_pybuffernd_input.diminfo[0].shape)) __pyx_t_8 = 0;
    if (unlikely(__pyx_t_8 != -1)) {
      __Pyx_RaiseBufferIndexError(__pyx_t_8);
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1200; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_v_val = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_double_t *, __pyx_pybuffernd_input.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_input.diminfo[0].strides));

    /* "pandas/algos.pyx":1201
 *     for i from win <= i < N:
 *         val = input[i]
 *         prev = input[i - win]             # <<<<<<<<<<<<<<
 * 
 *         if val == val:
 */
    __pyx_t_15 = (__pyx_v_i - __pyx_v_win);
    __pyx_t_8 = -1;
    if (__pyx_t_15 < 0) {
      __pyx_t_15 += __pyx_pybuffernd_input.diminfo[0].shape;
      if (unlikely(__pyx_t_15 < 0)) __pyx_t_8 = 0;
    } else if (unlikely(__pyx_t_15 >= __pyx_pybuffernd_input.diminfo[0].shape)) __pyx_t_8 = 0;
    if (unlikely(__pyx_t_8 != -1)) {
      __Pyx_RaiseBufferIndexError(__pyx_t_8);
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1201; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_v_prev = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_double_t *, __pyx_pybuffernd_input.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_input.diminfo[0].strides));

    /* "pandas/algos.pyx":1203
 *         prev = input[i - win]
 * 
 *         if val == val:             # <<<<<<<<<<<<<<
 *             if prev == prev:
 *                 delta = val - prev
 */
    __pyx_t_10 = ((__pyx_v_val == __pyx_v_val) != 0);
    if (__pyx_t_10) {

      /* "pandas/algos.pyx":1204
 * 
 *         if val == val:
 *             if prev == prev:             # <<<<<<<<<<<<<<
 *                 delta = val - prev
 *                 prev -= mean_x
 */
      __pyx_t_10 = ((__pyx_v_prev == __pyx_v_prev) != 0);
      if (__pyx_t_10) {

        /* "pandas/algos.pyx":1205
 *         if val == val:
 *             if prev == prev:
 *                 delta = val - prev             # <<<<<<<<<<<<<<
 *                 prev -= mean_x
 *                 mean_x += delta / nobs
 */
        __pyx_v_delta = (__pyx_v_val - __pyx_v_prev);

        /* "pandas/algos.pyx":1206
 *             if prev == prev:
 *                 delta = val - prev
 *                 prev -= mean_x             # <<<<<<<<<<<<<<
 *                 mean_x += delta / nobs
 *                 val -= mean_x
 */
        __pyx_v_prev = (__pyx_v_prev - __pyx_v_mean_x);

        /* "pandas/algos.pyx":1207
 *                 delta = val - prev
 *                 prev -= mean_x
 *                 mean_x += delta / nobs             # <<<<<<<<<<<<<<
 *                 val -= mean_x
 *                 ssqdm_x += (val + prev) * delta
 */
        if (unlikely(__pyx_v_nobs == 0)) {
          #ifdef WITH_THREAD
          PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
          #endif
          PyErr_SetString(PyExc_ZeroDivisionError, "float division");
          #ifdef WITH_THREAD
          PyGILState_Release(__pyx_gilstate_save);
          #endif
          {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1207; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        __pyx_v_mean_x = (__pyx_v_mean_x + (__pyx_v_delta / __pyx_v_nobs));

        /* "pandas/algos.pyx":1208
 *                 prev -= mean_x
 *                 mean_x += delta / nobs
 *                 val -= mean_x             # <<<<<<<<<<<<<<
 *                 ssqdm_x += (val + prev) * delta
 *             else:
 */
        __pyx_v_val = (__pyx_v_val - __pyx_v_mean_x);

        /* "pandas/algos.pyx":1209
 *                 mean_x += delta / nobs
 *                 val -= mean_x
 *                 ssqdm_x += (val + prev) * delta             # <<<<<<<<<<<<<<
 *             else:
 *                 nobs += 1
 */
        __pyx_v_ssqdm_x = (__pyx_v_ssqdm_x + ((__pyx_v_val + __pyx_v_prev) * __pyx_v_delta));
        goto __pyx_L12;
      }
      /*else*/ {

        /* "pandas/algos.pyx":1211
 *                 ssqdm_x += (val + prev) * delta
 *             else:
 *                 nobs += 1             # <<<<<<<<<<<<<<
 *                 delta = (val - mean_x)
 *                 mean_x += delta / nobs
 */
        __pyx_v_nobs = (__pyx_v_nobs + 1.0);

        /* "pandas/algos.pyx":1212
 *             else:
 *                 nobs += 1
 *                 delta = (val - mean_x)             # <<<<<<<<<<<<<<
 *                 mean_x += delta / nobs
 *                 ssqdm_x += delta * (val - mean_x)
 */
        __pyx_v_delta = (__pyx_v_val - __pyx_v_mean_x);

        /* "pandas/algos.pyx":1213
 *                 nobs += 1
 *                 delta = (val - mean_x)
 *                 mean_x += delta / nobs             # <<<<<<<<<<<<<<
 *                 ssqdm_x += delta * (val - mean_x)
 *         elif prev == prev:
 */
        if (unlikely(__pyx_v_nobs == 0)) {
          #ifdef WITH_THREAD
          PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
          #endif
          PyErr_SetString(PyExc_ZeroDivisionError, "float division");
          #ifdef WITH_THREAD
          PyGILState_Release(__pyx_gilstate_save);
          #endif
          {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1213; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        __pyx_v_mean_x = (__pyx_v_mean_x + (__pyx_v_delta / __pyx_v_nobs));

        /* "pandas/algos.pyx":1214
 *                 delta = (val - mean_x)
 *                 mean_x += delta / nobs
 *                 ssqdm_x += delta * (val - mean_x)             # <<<<<<<<<<<<<<
 *         elif prev == prev:
 *             nobs -= 1
 */
        __pyx_v_ssqdm_x = (__pyx_v_ssqdm_x + (__pyx_v_delta * (__pyx_v_val - __pyx_v_mean_x)));
      }
      __pyx_L12:;
      goto __pyx_L11;
    }

    /* "pandas/algos.pyx":1215
 *                 mean_x += delta / nobs
 *                 ssqdm_x += delta * (val - mean_x)
 *         elif prev == prev:             # <<<<<<<<<<<<<<
 *             nobs -= 1
 *             if nobs:
 */
    __pyx_t_10 = ((__pyx_v_prev == __pyx_v_prev) != 0);
    if (__pyx_t_10) {

      /* "pandas/algos.pyx":1216
 *                 ssqdm_x += delta * (val - mean_x)
 *         elif prev == prev:
 *             nobs -= 1             # <<<<<<<<<<<<<<
 *             if nobs:
 *                 delta = (prev - mean_x)
 */
      __pyx_v_nobs = (__pyx_v_nobs - 1.0);

      /* "pandas/algos.pyx":1217
 *         elif prev == prev:
 *             nobs -= 1
 *             if nobs:             # <<<<<<<<<<<<<<
 *                 delta = (prev - mean_x)
 *                 mean_x -= delta  / nobs
 */
      __pyx_t_10 = (__pyx_v_nobs != 0);
      if (__pyx_t_10) {

        /* "pandas/algos.pyx":1218
 *             nobs -= 1
 *             if nobs:
 *                 delta = (prev - mean_x)             # <<<<<<<<<<<<<<
 *                 mean_x -= delta  / nobs
 *                 ssqdm_x -= delta * (prev - mean_x)
 */
        __pyx_v_delta = (__pyx_v_prev - __pyx_v_mean_x);

        /* "pandas/algos.pyx":1219
 *             if nobs:
 *                 delta = (prev - mean_x)
 *                 mean_x -= delta  / nobs             # <<<<<<<<<<<<<<
 *                 ssqdm_x -= delta * (prev - mean_x)
 *             else:
 */
        if (unlikely(__pyx_v_nobs == 0)) {
          #ifdef WITH_THREAD
          PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
          #endif
          PyErr_SetString(PyExc_ZeroDivisionError, "float division");
          #ifdef WITH_THREAD
          PyGILState_Release(__pyx_gilstate_save);
          #endif
          {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1219; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        __pyx_v_mean_x = (__pyx_v_mean_x - (__pyx_v_delta / __pyx_v_nobs));

        /* "pandas/algos.pyx":1220
 *                 delta = (prev - mean_x)
 *                 mean_x -= delta  / nobs
 *                 ssqdm_x -= delta * (prev - mean_x)             # <<<<<<<<<<<<<<
 *             else:
 *                 mean_x = 0
 */
        __pyx_v_ssqdm_x = (__pyx_v_ssqdm_x - (__pyx_v_delta * (__pyx_v_prev - __pyx_v_mean_x)));
        goto __pyx_L13;
      }
      /*else*/ {

        /* "pandas/algos.pyx":1222
 *                 ssqdm_x -= delta * (prev - mean_x)
 *             else:
 *                 mean_x = 0             # <<<<<<<<<<<<<<
 *                 ssqdm_x = 0
 * 
 */
        __pyx_v_mean_x = 0.0;

        /* "pandas/algos.pyx":1223
 *             else:
 *                 mean_x = 0
 *                 ssqdm_x = 0             # <<<<<<<<<<<<<<
 * 
 *         if nobs >= minp:
 */
        __pyx_v_ssqdm_x = 0.0;
      }
      __pyx_L13:;
      goto __pyx_L11;
    }
    __pyx_L11:;

    /* "pandas/algos.pyx":1225
 *                 ssqdm_x = 0
 * 
 *         if nobs >= minp:             # <<<<<<<<<<<<<<
 *             #pathological case
 *             if nobs == 1:
 */
    __pyx_t_10 = ((__pyx_v_nobs >= __pyx_v_minp) != 0);
    if (__pyx_t_10) {

      /* "pandas/algos.pyx":1227
 *         if nobs >= minp:
 *             #pathological case
 *             if nobs == 1:             # <<<<<<<<<<<<<<
 *                 val = 0
 *             else:
 */
      __pyx_t_10 = ((__pyx_v_nobs == 1.0) != 0);
      if (__pyx_t_10) {

        /* "pandas/algos.pyx":1228
 *             #pathological case
 *             if nobs == 1:
 *                 val = 0             # <<<<<<<<<<<<<<
 *             else:
 *                 val = ssqdm_x / (nobs - ddof)
 */
        __pyx_v_val = 0.0;
        goto __pyx_L15;
      }
      /*else*/ {

        /* "pandas/algos.pyx":1230
 *                 val = 0
 *             else:
 *                 val = ssqdm_x / (nobs - ddof)             # <<<<<<<<<<<<<<
 *                 if val < 0:
 *                     val = 0
 */
        __pyx_t_11 = (__pyx_v_nobs - __pyx_v_ddof);
        if (unlikely(__pyx_t_11 == 0)) {
          #ifdef WITH_THREAD
          PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
          #endif
          PyErr_SetString(PyExc_ZeroDivisionError, "float division");
          #ifdef WITH_THREAD
          PyGILState_Release(__pyx_gilstate_save);
          #endif
          {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1230; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        __pyx_v_val = (__pyx_v_ssqdm_x / __pyx_t_11);

        /* "pandas/algos.pyx":1231
 *             else:
 *                 val = ssqdm_x / (nobs - ddof)
 *                 if val < 0:             # <<<<<<<<<<<<<<
 *                     val = 0
 *         else:
 */
        __pyx_t_10 = ((__pyx_v_val < 0.0) != 0);
        if (__pyx_t_10) {

          /* "pandas/algos.pyx":1232
 *                 val = ssqdm_x / (nobs - ddof)
 *                 if val < 0:
 *                     val = 0             # <<<<<<<<<<<<<<
 *         else:
 *             val = NaN
 */
          __pyx_v_val = 0.0;
          goto __pyx_L16;
        }
        __pyx_L16:;
      }
      __pyx_L15:;
      goto __pyx_L14;
    }
    /*else*/ {

      /* "pandas/algos.pyx":1234
 *                     val = 0
 *         else:
 *             val = NaN             # <<<<<<<<<<<<<<
 * 
 *         output[i] = val
 */
      __pyx_v_val = __pyx_v_6pandas_5algos_NaN;
    }
    __pyx_L14:;

    /* "pandas/algos.pyx":1236
 *             val = NaN
 * 
 *         output[i] = val             # <<<<<<<<<<<<<<
 * 
 *     return output
 */
    __pyx_t_16 = __pyx_v_i;
    __pyx_t_8 = -1;
    if (__pyx_t_16 < 0) {
      __pyx_t_16 += __pyx_pybuffernd_output.diminfo[0].shape;
      if (unlikely(__pyx_t_16 < 0)) __pyx_t_8 = 0;
    } else if (unlikely(__pyx_t_16 >= __pyx_pybuffernd_output.diminfo[0].shape)) __pyx_t_8 = 0;
    if (unlikely(__pyx_t_8 != -1)) {
      __Pyx_RaiseBufferIndexError(__pyx_t_8);
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1236; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_double_t *, __pyx_pybuffernd_output.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_output.diminfo[0].strides) = __pyx_v_val;
  }

  /* "pandas/algos.pyx":1238
 *         output[i] = val
 * 
 *     return output             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_output));
  __pyx_r = ((PyObject *)__pyx_v_output);
  goto __pyx_L0;

  /* "pandas/algos.pyx":1164
 * # Rolling variance
 * 
 * def roll_var(ndarray[double_t] input, int win, int minp, int ddof=1):             # <<<<<<<<<<<<<<
 *     """
 *     Numerically stable implementation using Welford's method.
 */

  /* function exit code */
  __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_7);
  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
    __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_input.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_output.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas.algos.roll_var", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_input.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_output.rcbuffer->pybuffer);
  __pyx_L2:;
  __Pyx_XDECREF((PyObject *)__pyx_v_output);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/algos.pyx":1244
 * # 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
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pandas_5algos_35roll_skew(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_5algos_35roll_skew = {__Pyx_NAMESTR("roll_skew"), (PyCFunction)__pyx_pw_6pandas_5algos_35roll_skew, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pw_6pandas_5algos_35roll_skew(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyArrayObject *__pyx_v_input = 0;
  int __pyx_v_win;
  int __pyx_v_minp;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("roll_skew (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_input,&__pyx_n_s_win,&__pyx_n_s_minp,0};
    PyObject* values[3] = {0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_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 (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_input)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_win)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("roll_skew", 1, 3, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1244; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_minp)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("roll_skew", 1, 3, 3, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1244; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "roll_skew") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1244; __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_As_int(values[1]); if (unlikely((__pyx_v_win == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1244; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_v_minp = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_minp == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1244; __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[0]; __pyx_lineno = 1244; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas.algos.roll_skew", __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[0]; __pyx_lineno = 1244; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_34roll_skew(__pyx_self, __pyx_v_input, __pyx_v_win, __pyx_v_minp);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pandas_5algos_34roll_skew(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_input, 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;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_input;
  __Pyx_Buffer __pyx_pybuffer_input;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_output;
  __Pyx_Buffer __pyx_pybuffer_output;
  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;
  PyObject *__pyx_t_7 = NULL;
  int __pyx_t_8;
  long __pyx_t_9;
  int __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_t_15;
  int __pyx_t_16;
  Py_ssize_t __pyx_t_17;
  double __pyx_t_18;
  double __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("roll_skew", 0);
  __pyx_pybuffer_output.pybuffer.buf = NULL;
  __pyx_pybuffer_output.refcount = 0;
  __pyx_pybuffernd_output.data = NULL;
  __pyx_pybuffernd_output.rcbuffer = &__pyx_pybuffer_output;
  __pyx_pybuffer_input.pybuffer.buf = NULL;
  __pyx_pybuffer_input.refcount = 0;
  __pyx_pybuffernd_input.data = NULL;
  __pyx_pybuffernd_input.rcbuffer = &__pyx_pybuffer_input;
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_input.rcbuffer->pybuffer, (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[0]; __pyx_lineno = 1244; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_input.diminfo[0].strides = __pyx_pybuffernd_input.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_input.diminfo[0].shape = __pyx_pybuffernd_input.rcbuffer->pybuffer.shape[0];

  /* "pandas/algos.pyx":1246
 * 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;

  /* "pandas/algos.pyx":1247
 *     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;

  /* "pandas/algos.pyx":1248
 *     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[0]; __pyx_lineno = 1248; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_N = __pyx_t_1;

  /* "pandas/algos.pyx":1250
 *     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_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1250; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_empty); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1250; __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 = 1250; __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 = 1250; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__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 = 1250; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, ((PyObject *)((PyObject*)(&PyFloat_Type)))) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1250; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1250; __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_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__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 = 1250; __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_pybuffernd_output.rcbuffer->pybuffer, (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_pybuffernd_output.rcbuffer->pybuffer.buf = NULL;
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1250; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    } else {__pyx_pybuffernd_output.diminfo[0].strides = __pyx_pybuffernd_output.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_output.diminfo[0].shape = __pyx_pybuffernd_output.rcbuffer->pybuffer.shape[0];
    }
  }
  __pyx_t_6 = 0;
  __pyx_v_output = ((PyArrayObject *)__pyx_t_5);
  __pyx_t_5 = 0;

  /* "pandas/algos.pyx":1255
 *     cdef double A, B, C, R
 * 
 *     minp = _check_minp(win, minp, N)             # <<<<<<<<<<<<<<
 * 
 *     for i from 0 <= i < minp - 1:
 */
  __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_check_minp); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1255; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_win); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1255; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_minp); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1255; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_N); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1255; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_7 = PyTuple_New(3); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1255; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__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_4);
  __Pyx_GIVEREF(__pyx_t_4);
  PyTuple_SET_ITEM(__pyx_t_7, 2, __pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_3);
  __pyx_t_2 = 0;
  __pyx_t_4 = 0;
  __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_7, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1255; __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_7); __pyx_t_7 = 0;
  __pyx_t_8 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_8 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1255; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_v_minp = __pyx_t_8;

  /* "pandas/algos.pyx":1257
 *     minp = _check_minp(win, minp, N)
 * 
 *     for i from 0 <= i < minp - 1:             # <<<<<<<<<<<<<<
 *         val = input[i]
 * 
 */
  __pyx_t_9 = (__pyx_v_minp - 1);
  for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_9; __pyx_v_i++) {

    /* "pandas/algos.pyx":1258
 * 
 *     for i from 0 <= i < minp - 1:
 *         val = input[i]             # <<<<<<<<<<<<<<
 * 
 *         # Not NaN
 */
    __pyx_t_1 = __pyx_v_i;
    __pyx_t_8 = -1;
    if (__pyx_t_1 < 0) {
      __pyx_t_1 += __pyx_pybuffernd_input.diminfo[0].shape;
      if (unlikely(__pyx_t_1 < 0)) __pyx_t_8 = 0;
    } else if (unlikely(__pyx_t_1 >= __pyx_pybuffernd_input.diminfo[0].shape)) __pyx_t_8 = 0;
    if (unlikely(__pyx_t_8 != -1)) {
      __Pyx_RaiseBufferIndexError(__pyx_t_8);
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1258; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_v_val = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_double_t *, __pyx_pybuffernd_input.rcbuffer->pybuffer.buf, __pyx_t_1, __pyx_pybuffernd_input.diminfo[0].strides));

    /* "pandas/algos.pyx":1261
 * 
 *         # Not NaN
 *         if val == val:             # <<<<<<<<<<<<<<
 *             nobs += 1
 *             x += val
 */
    __pyx_t_10 = ((__pyx_v_val == __pyx_v_val) != 0);
    if (__pyx_t_10) {

      /* "pandas/algos.pyx":1262
 *         # Not NaN
 *         if val == val:
 *             nobs += 1             # <<<<<<<<<<<<<<
 *             x += val
 *             xx += val * val
 */
      __pyx_v_nobs = (__pyx_v_nobs + 1);

      /* "pandas/algos.pyx":1263
 *         if val == val:
 *             nobs += 1
 *             x += val             # <<<<<<<<<<<<<<
 *             xx += val * val
 *             xxx += val * val * val
 */
      __pyx_v_x = (__pyx_v_x + __pyx_v_val);

      /* "pandas/algos.pyx":1264
 *             nobs += 1
 *             x += val
 *             xx += val * val             # <<<<<<<<<<<<<<
 *             xxx += val * val * val
 * 
 */
      __pyx_v_xx = (__pyx_v_xx + (__pyx_v_val * __pyx_v_val));

      /* "pandas/algos.pyx":1265
 *             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_L5;
    }
    __pyx_L5:;

    /* "pandas/algos.pyx":1267
 *             xxx += val * val * val
 * 
 *         output[i] = NaN             # <<<<<<<<<<<<<<
 * 
 *     for i from minp - 1 <= i < N:
 */
    __pyx_t_11 = __pyx_v_i;
    __pyx_t_8 = -1;
    if (__pyx_t_11 < 0) {
      __pyx_t_11 += __pyx_pybuffernd_output.diminfo[0].shape;
      if (unlikely(__pyx_t_11 < 0)) __pyx_t_8 = 0;
    } else if (unlikely(__pyx_t_11 >= __pyx_pybuffernd_output.diminfo[0].shape)) __pyx_t_8 = 0;
    if (unlikely(__pyx_t_8 != -1)) {
      __Pyx_RaiseBufferIndexError(__pyx_t_8);
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1267; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_double_t *, __pyx_pybuffernd_output.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_output.diminfo[0].strides) = __pyx_v_6pandas_5algos_NaN;
  }

  /* "pandas/algos.pyx":1269
 *         output[i] = NaN
 * 
 *     for i from minp - 1 <= i < N:             # <<<<<<<<<<<<<<
 *         val = input[i]
 * 
 */
  __pyx_t_12 = __pyx_v_N;
  for (__pyx_v_i = (__pyx_v_minp - 1); __pyx_v_i < __pyx_t_12; __pyx_v_i++) {

    /* "pandas/algos.pyx":1270
 * 
 *     for i from minp - 1 <= i < N:
 *         val = input[i]             # <<<<<<<<<<<<<<
 * 
 *         if val == val:
 */
    __pyx_t_13 = __pyx_v_i;
    __pyx_t_8 = -1;
    if (__pyx_t_13 < 0) {
      __pyx_t_13 += __pyx_pybuffernd_input.diminfo[0].shape;
      if (unlikely(__pyx_t_13 < 0)) __pyx_t_8 = 0;
    } else if (unlikely(__pyx_t_13 >= __pyx_pybuffernd_input.diminfo[0].shape)) __pyx_t_8 = 0;
    if (unlikely(__pyx_t_8 != -1)) {
      __Pyx_RaiseBufferIndexError(__pyx_t_8);
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1270; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_v_val = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_double_t *, __pyx_pybuffernd_input.rcbuffer->pybuffer.buf, __pyx_t_13, __pyx_pybuffernd_input.diminfo[0].strides));

    /* "pandas/algos.pyx":1272
 *         val = input[i]
 * 
 *         if val == val:             # <<<<<<<<<<<<<<
 *             nobs += 1
 *             x += val
 */
    __pyx_t_10 = ((__pyx_v_val == __pyx_v_val) != 0);
    if (__pyx_t_10) {

      /* "pandas/algos.pyx":1273
 * 
 *         if val == val:
 *             nobs += 1             # <<<<<<<<<<<<<<
 *             x += val
 *             xx += val * val
 */
      __pyx_v_nobs = (__pyx_v_nobs + 1);

      /* "pandas/algos.pyx":1274
 *         if val == val:
 *             nobs += 1
 *             x += val             # <<<<<<<<<<<<<<
 *             xx += val * val
 *             xxx += val * val * val
 */
      __pyx_v_x = (__pyx_v_x + __pyx_v_val);

      /* "pandas/algos.pyx":1275
 *             nobs += 1
 *             x += val
 *             xx += val * val             # <<<<<<<<<<<<<<
 *             xxx += val * val * val
 * 
 */
      __pyx_v_xx = (__pyx_v_xx + (__pyx_v_val * __pyx_v_val));

      /* "pandas/algos.pyx":1276
 *             x += val
 *             xx += val * val
 *             xxx += val * val * val             # <<<<<<<<<<<<<<
 * 
 *         if i > win - 1:
 */
      __pyx_v_xxx = (__pyx_v_xxx + ((__pyx_v_val * __pyx_v_val) * __pyx_v_val));
      goto __pyx_L8;
    }
    __pyx_L8:;

    /* "pandas/algos.pyx":1278
 *             xxx += val * val * val
 * 
 *         if i > win - 1:             # <<<<<<<<<<<<<<
 *             prev = input[i - win]
 *             if prev == prev:
 */
    __pyx_t_10 = ((__pyx_v_i > (__pyx_v_win - 1)) != 0);
    if (__pyx_t_10) {

      /* "pandas/algos.pyx":1279
 * 
 *         if i > win - 1:
 *             prev = input[i - win]             # <<<<<<<<<<<<<<
 *             if prev == prev:
 *                 x -= prev
 */
      __pyx_t_14 = (__pyx_v_i - __pyx_v_win);
      __pyx_t_8 = -1;
      if (__pyx_t_14 < 0) {
        __pyx_t_14 += __pyx_pybuffernd_input.diminfo[0].shape;
        if (unlikely(__pyx_t_14 < 0)) __pyx_t_8 = 0;
      } else if (unlikely(__pyx_t_14 >= __pyx_pybuffernd_input.diminfo[0].shape)) __pyx_t_8 = 0;
      if (unlikely(__pyx_t_8 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_8);
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1279; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_v_prev = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_double_t *, __pyx_pybuffernd_input.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_input.diminfo[0].strides));

      /* "pandas/algos.pyx":1280
 *         if i > win - 1:
 *             prev = input[i - win]
 *             if prev == prev:             # <<<<<<<<<<<<<<
 *                 x -= prev
 *                 xx -= prev * prev
 */
      __pyx_t_10 = ((__pyx_v_prev == __pyx_v_prev) != 0);
      if (__pyx_t_10) {

        /* "pandas/algos.pyx":1281
 *             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);

        /* "pandas/algos.pyx":1282
 *             if prev == prev:
 *                 x -= prev
 *                 xx -= prev * prev             # <<<<<<<<<<<<<<
 *                 xxx -= prev * prev * prev
 * 
 */
        __pyx_v_xx = (__pyx_v_xx - (__pyx_v_prev * __pyx_v_prev));

        /* "pandas/algos.pyx":1283
 *                 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));

        /* "pandas/algos.pyx":1285
 *                 xxx -= prev * prev * prev
 * 
 *                 nobs -= 1             # <<<<<<<<<<<<<<
 * 
 *         if nobs >= minp:
 */
        __pyx_v_nobs = (__pyx_v_nobs - 1);
        goto __pyx_L10;
      }
      __pyx_L10:;
      goto __pyx_L9;
    }
    __pyx_L9:;

    /* "pandas/algos.pyx":1287
 *                 nobs -= 1
 * 
 *         if nobs >= minp:             # <<<<<<<<<<<<<<
 *             A = x / nobs
 *             B = xx / nobs - A * A
 */
    __pyx_t_10 = ((__pyx_v_nobs >= __pyx_v_minp) != 0);
    if (__pyx_t_10) {

      /* "pandas/algos.pyx":1288
 * 
 *         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)) {
        #ifdef WITH_THREAD
        PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
        #endif
        PyErr_SetString(PyExc_ZeroDivisionError, "float division");
        #ifdef WITH_THREAD
        PyGILState_Release(__pyx_gilstate_save);
        #endif
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1288; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_v_A = (__pyx_v_x / __pyx_v_nobs);

      /* "pandas/algos.pyx":1289
 *         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)) {
        #ifdef WITH_THREAD
        PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
        #endif
        PyErr_SetString(PyExc_ZeroDivisionError, "float division");
        #ifdef WITH_THREAD
        PyGILState_Release(__pyx_gilstate_save);
        #endif
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1289; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_v_B = ((__pyx_v_xx / __pyx_v_nobs) - (__pyx_v_A * __pyx_v_A));

      /* "pandas/algos.pyx":1290
 *             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)) {
        #ifdef WITH_THREAD
        PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
        #endif
        PyErr_SetString(PyExc_ZeroDivisionError, "float division");
        #ifdef WITH_THREAD
        PyGILState_Release(__pyx_gilstate_save);
        #endif
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1290; __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));

      /* "pandas/algos.pyx":1292
 *             C = xxx / nobs - A * A * A - 3 * A * B
 * 
 *             R = sqrt(B)             # <<<<<<<<<<<<<<
 * 
 *             if B == 0 or nobs < 3:
 */
      __pyx_v_R = sqrt(__pyx_v_B);

      /* "pandas/algos.pyx":1294
 *             R = sqrt(B)
 * 
 *             if B == 0 or nobs < 3:             # <<<<<<<<<<<<<<
 *                 output[i] = NaN
 *             else:
 */
      __pyx_t_10 = ((__pyx_v_B == 0.0) != 0);
      if (!__pyx_t_10) {
        __pyx_t_15 = ((__pyx_v_nobs < 3) != 0);
        __pyx_t_16 = __pyx_t_15;
      } else {
        __pyx_t_16 = __pyx_t_10;
      }
      if (__pyx_t_16) {

        /* "pandas/algos.pyx":1295
 * 
 *             if B == 0 or nobs < 3:
 *                 output[i] = NaN             # <<<<<<<<<<<<<<
 *             else:
 *                 output[i] = ((sqrt(nobs * (nobs - 1.)) * C) /
 */
        __pyx_t_17 = __pyx_v_i;
        __pyx_t_8 = -1;
        if (__pyx_t_17 < 0) {
          __pyx_t_17 += __pyx_pybuffernd_output.diminfo[0].shape;
          if (unlikely(__pyx_t_17 < 0)) __pyx_t_8 = 0;
        } else if (unlikely(__pyx_t_17 >= __pyx_pybuffernd_output.diminfo[0].shape)) __pyx_t_8 = 0;
        if (unlikely(__pyx_t_8 != -1)) {
          __Pyx_RaiseBufferIndexError(__pyx_t_8);
          {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1295; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_double_t *, __pyx_pybuffernd_output.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_output.diminfo[0].strides) = __pyx_v_6pandas_5algos_NaN;
        goto __pyx_L12;
      }
      /*else*/ {

        /* "pandas/algos.pyx":1297
 *                 output[i] = NaN
 *             else:
 *                 output[i] = ((sqrt(nobs * (nobs - 1.)) * C) /             # <<<<<<<<<<<<<<
 *                              ((nobs-2) * R * R * R))
 *         else:
 */
        __pyx_t_18 = (sqrt((__pyx_v_nobs * (__pyx_v_nobs - 1.))) * __pyx_v_C);

        /* "pandas/algos.pyx":1298
 *             else:
 *                 output[i] = ((sqrt(nobs * (nobs - 1.)) * C) /
 *                              ((nobs-2) * R * R * R))             # <<<<<<<<<<<<<<
 *         else:
 *             output[i] = NaN
 */
        __pyx_t_19 = ((((__pyx_v_nobs - 2) * __pyx_v_R) * __pyx_v_R) * __pyx_v_R);

        /* "pandas/algos.pyx":1297
 *                 output[i] = NaN
 *             else:
 *                 output[i] = ((sqrt(nobs * (nobs - 1.)) * C) /             # <<<<<<<<<<<<<<
 *                              ((nobs-2) * R * R * R))
 *         else:
 */
        if (unlikely(__pyx_t_19 == 0)) {
          #ifdef WITH_THREAD
          PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
          #endif
          PyErr_SetString(PyExc_ZeroDivisionError, "float division");
          #ifdef WITH_THREAD
          PyGILState_Release(__pyx_gilstate_save);
          #endif
          {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1297; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        __pyx_t_20 = __pyx_v_i;
        __pyx_t_8 = -1;
        if (__pyx_t_20 < 0) {
          __pyx_t_20 += __pyx_pybuffernd_output.diminfo[0].shape;
          if (unlikely(__pyx_t_20 < 0)) __pyx_t_8 = 0;
        } else if (unlikely(__pyx_t_20 >= __pyx_pybuffernd_output.diminfo[0].shape)) __pyx_t_8 = 0;
        if (unlikely(__pyx_t_8 != -1)) {
          __Pyx_RaiseBufferIndexError(__pyx_t_8);
          {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1297; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_double_t *, __pyx_pybuffernd_output.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_output.diminfo[0].strides) = (__pyx_t_18 / __pyx_t_19);
      }
      __pyx_L12:;
      goto __pyx_L11;
    }
    /*else*/ {

      /* "pandas/algos.pyx":1300
 *                              ((nobs-2) * R * R * R))
 *         else:
 *             output[i] = NaN             # <<<<<<<<<<<<<<
 * 
 *     return output
 */
      __pyx_t_21 = __pyx_v_i;
      __pyx_t_8 = -1;
      if (__pyx_t_21 < 0) {
        __pyx_t_21 += __pyx_pybuffernd_output.diminfo[0].shape;
        if (unlikely(__pyx_t_21 < 0)) __pyx_t_8 = 0;
      } else if (unlikely(__pyx_t_21 >= __pyx_pybuffernd_output.diminfo[0].shape)) __pyx_t_8 = 0;
      if (unlikely(__pyx_t_8 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_8);
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1300; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_double_t *, __pyx_pybuffernd_output.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_output.diminfo[0].strides) = __pyx_v_6pandas_5algos_NaN;
    }
    __pyx_L11:;
  }

  /* "pandas/algos.pyx":1302
 *             output[i] = NaN
 * 
 *     return output             # <<<<<<<<<<<<<<
 * 
 * #-------------------------------------------------------------------------------
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_output));
  __pyx_r = ((PyObject *)__pyx_v_output);
  goto __pyx_L0;

  /* "pandas/algos.pyx":1244
 * # 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
 */

  /* function exit code */
  __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_7);
  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
    __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_input.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_output.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas.algos.roll_skew", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_input.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_output.rcbuffer->pybuffer);
  __pyx_L2:;
  __Pyx_XDECREF((PyObject *)__pyx_v_output);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/algos.pyx":1308
 * 
 * 
 * def roll_kurt(ndarray[double_t] input,             # <<<<<<<<<<<<<<
 *                int win, int minp):
 *     cdef double val, prev
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pandas_5algos_37roll_kurt(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_5algos_37roll_kurt = {__Pyx_NAMESTR("roll_kurt"), (PyCFunction)__pyx_pw_6pandas_5algos_37roll_kurt, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pw_6pandas_5algos_37roll_kurt(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyArrayObject *__pyx_v_input = 0;
  int __pyx_v_win;
  int __pyx_v_minp;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("roll_kurt (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_input,&__pyx_n_s_win,&__pyx_n_s_minp,0};
    PyObject* values[3] = {0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_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 (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_input)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_win)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("roll_kurt", 1, 3, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1308; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_minp)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("roll_kurt", 1, 3, 3, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1308; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "roll_kurt") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1308; __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_As_int(values[1]); if (unlikely((__pyx_v_win == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1309; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_v_minp = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_minp == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1309; __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[0]; __pyx_lineno = 1308; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas.algos.roll_kurt", __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[0]; __pyx_lineno = 1308; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_36roll_kurt(__pyx_self, __pyx_v_input, __pyx_v_win, __pyx_v_minp);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pandas_5algos_36roll_kurt(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_input, 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;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_input;
  __Pyx_Buffer __pyx_pybuffer_input;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_output;
  __Pyx_Buffer __pyx_pybuffer_output;
  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;
  PyObject *__pyx_t_7 = NULL;
  int __pyx_t_8;
  long __pyx_t_9;
  int __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_t_15;
  int __pyx_t_16;
  Py_ssize_t __pyx_t_17;
  double __pyx_t_18;
  double __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("roll_kurt", 0);
  __pyx_pybuffer_output.pybuffer.buf = NULL;
  __pyx_pybuffer_output.refcount = 0;
  __pyx_pybuffernd_output.data = NULL;
  __pyx_pybuffernd_output.rcbuffer = &__pyx_pybuffer_output;
  __pyx_pybuffer_input.pybuffer.buf = NULL;
  __pyx_pybuffer_input.refcount = 0;
  __pyx_pybuffernd_input.data = NULL;
  __pyx_pybuffernd_input.rcbuffer = &__pyx_pybuffer_input;
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_input.rcbuffer->pybuffer, (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[0]; __pyx_lineno = 1308; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_input.diminfo[0].strides = __pyx_pybuffernd_input.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_input.diminfo[0].shape = __pyx_pybuffernd_input.rcbuffer->pybuffer.shape[0];

  /* "pandas/algos.pyx":1311
 *                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;

  /* "pandas/algos.pyx":1312
 *     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;

  /* "pandas/algos.pyx":1313
 *     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[0]; __pyx_lineno = 1313; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_N = __pyx_t_1;

  /* "pandas/algos.pyx":1315
 *     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_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1315; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_empty); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1315; __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 = 1315; __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 = 1315; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__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 = 1315; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, ((PyObject *)((PyObject*)(&PyFloat_Type)))) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1315; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1315; __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_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__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 = 1315; __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_pybuffernd_output.rcbuffer->pybuffer, (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_pybuffernd_output.rcbuffer->pybuffer.buf = NULL;
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1315; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    } else {__pyx_pybuffernd_output.diminfo[0].strides = __pyx_pybuffernd_output.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_output.diminfo[0].shape = __pyx_pybuffernd_output.rcbuffer->pybuffer.shape[0];
    }
  }
  __pyx_t_6 = 0;
  __pyx_v_output = ((PyArrayObject *)__pyx_t_5);
  __pyx_t_5 = 0;

  /* "pandas/algos.pyx":1320
 *     cdef double A, B, C, D, R, K
 * 
 *     minp = _check_minp(win, minp, N)             # <<<<<<<<<<<<<<
 * 
 *     for i from 0 <= i < minp - 1:
 */
  __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_check_minp); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1320; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_win); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1320; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_minp); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1320; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_N); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1320; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_7 = PyTuple_New(3); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1320; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__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_4);
  __Pyx_GIVEREF(__pyx_t_4);
  PyTuple_SET_ITEM(__pyx_t_7, 2, __pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_3);
  __pyx_t_2 = 0;
  __pyx_t_4 = 0;
  __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_7, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1320; __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_7); __pyx_t_7 = 0;
  __pyx_t_8 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_8 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1320; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_v_minp = __pyx_t_8;

  /* "pandas/algos.pyx":1322
 *     minp = _check_minp(win, minp, N)
 * 
 *     for i from 0 <= i < minp - 1:             # <<<<<<<<<<<<<<
 *         val = input[i]
 * 
 */
  __pyx_t_9 = (__pyx_v_minp - 1);
  for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_9; __pyx_v_i++) {

    /* "pandas/algos.pyx":1323
 * 
 *     for i from 0 <= i < minp - 1:
 *         val = input[i]             # <<<<<<<<<<<<<<
 * 
 *         # Not NaN
 */
    __pyx_t_1 = __pyx_v_i;
    __pyx_t_8 = -1;
    if (__pyx_t_1 < 0) {
      __pyx_t_1 += __pyx_pybuffernd_input.diminfo[0].shape;
      if (unlikely(__pyx_t_1 < 0)) __pyx_t_8 = 0;
    } else if (unlikely(__pyx_t_1 >= __pyx_pybuffernd_input.diminfo[0].shape)) __pyx_t_8 = 0;
    if (unlikely(__pyx_t_8 != -1)) {
      __Pyx_RaiseBufferIndexError(__pyx_t_8);
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1323; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_v_val = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_double_t *, __pyx_pybuffernd_input.rcbuffer->pybuffer.buf, __pyx_t_1, __pyx_pybuffernd_input.diminfo[0].strides));

    /* "pandas/algos.pyx":1326
 * 
 *         # Not NaN
 *         if val == val:             # <<<<<<<<<<<<<<
 *             nobs += 1
 * 
 */
    __pyx_t_10 = ((__pyx_v_val == __pyx_v_val) != 0);
    if (__pyx_t_10) {

      /* "pandas/algos.pyx":1327
 *         # Not NaN
 *         if val == val:
 *             nobs += 1             # <<<<<<<<<<<<<<
 * 
 *             # seriously don't ask me why this is faster
 */
      __pyx_v_nobs = (__pyx_v_nobs + 1);

      /* "pandas/algos.pyx":1330
 * 
 *             # 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);

      /* "pandas/algos.pyx":1331
 *             # 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));

      /* "pandas/algos.pyx":1332
 *             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));

      /* "pandas/algos.pyx":1333
 *             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_L5;
    }
    __pyx_L5:;

    /* "pandas/algos.pyx":1335
 *             xxxx += val * val * val * val
 * 
 *         output[i] = NaN             # <<<<<<<<<<<<<<
 * 
 *     for i from minp - 1 <= i < N:
 */
    __pyx_t_11 = __pyx_v_i;
    __pyx_t_8 = -1;
    if (__pyx_t_11 < 0) {
      __pyx_t_11 += __pyx_pybuffernd_output.diminfo[0].shape;
      if (unlikely(__pyx_t_11 < 0)) __pyx_t_8 = 0;
    } else if (unlikely(__pyx_t_11 >= __pyx_pybuffernd_output.diminfo[0].shape)) __pyx_t_8 = 0;
    if (unlikely(__pyx_t_8 != -1)) {
      __Pyx_RaiseBufferIndexError(__pyx_t_8);
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1335; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_double_t *, __pyx_pybuffernd_output.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_output.diminfo[0].strides) = __pyx_v_6pandas_5algos_NaN;
  }

  /* "pandas/algos.pyx":1337
 *         output[i] = NaN
 * 
 *     for i from minp - 1 <= i < N:             # <<<<<<<<<<<<<<
 *         val = input[i]
 * 
 */
  __pyx_t_12 = __pyx_v_N;
  for (__pyx_v_i = (__pyx_v_minp - 1); __pyx_v_i < __pyx_t_12; __pyx_v_i++) {

    /* "pandas/algos.pyx":1338
 * 
 *     for i from minp - 1 <= i < N:
 *         val = input[i]             # <<<<<<<<<<<<<<
 * 
 *         if val == val:
 */
    __pyx_t_13 = __pyx_v_i;
    __pyx_t_8 = -1;
    if (__pyx_t_13 < 0) {
      __pyx_t_13 += __pyx_pybuffernd_input.diminfo[0].shape;
      if (unlikely(__pyx_t_13 < 0)) __pyx_t_8 = 0;
    } else if (unlikely(__pyx_t_13 >= __pyx_pybuffernd_input.diminfo[0].shape)) __pyx_t_8 = 0;
    if (unlikely(__pyx_t_8 != -1)) {
      __Pyx_RaiseBufferIndexError(__pyx_t_8);
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1338; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_v_val = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_double_t *, __pyx_pybuffernd_input.rcbuffer->pybuffer.buf, __pyx_t_13, __pyx_pybuffernd_input.diminfo[0].strides));

    /* "pandas/algos.pyx":1340
 *         val = input[i]
 * 
 *         if val == val:             # <<<<<<<<<<<<<<
 *             nobs += 1
 *             x += val
 */
    __pyx_t_10 = ((__pyx_v_val == __pyx_v_val) != 0);
    if (__pyx_t_10) {

      /* "pandas/algos.pyx":1341
 * 
 *         if val == val:
 *             nobs += 1             # <<<<<<<<<<<<<<
 *             x += val
 *             xx += val * val
 */
      __pyx_v_nobs = (__pyx_v_nobs + 1);

      /* "pandas/algos.pyx":1342
 *         if val == val:
 *             nobs += 1
 *             x += val             # <<<<<<<<<<<<<<
 *             xx += val * val
 *             xxx += val * val * val
 */
      __pyx_v_x = (__pyx_v_x + __pyx_v_val);

      /* "pandas/algos.pyx":1343
 *             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));

      /* "pandas/algos.pyx":1344
 *             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));

      /* "pandas/algos.pyx":1345
 *             xx += val * val
 *             xxx += val * val * val
 *             xxxx += val * val * val * val             # <<<<<<<<<<<<<<
 * 
 *         if i > win - 1:
 */
      __pyx_v_xxxx = (__pyx_v_xxxx + (((__pyx_v_val * __pyx_v_val) * __pyx_v_val) * __pyx_v_val));
      goto __pyx_L8;
    }
    __pyx_L8:;

    /* "pandas/algos.pyx":1347
 *             xxxx += val * val * val * val
 * 
 *         if i > win - 1:             # <<<<<<<<<<<<<<
 *             prev = input[i - win]
 *             if prev == prev:
 */
    __pyx_t_10 = ((__pyx_v_i > (__pyx_v_win - 1)) != 0);
    if (__pyx_t_10) {

      /* "pandas/algos.pyx":1348
 * 
 *         if i > win - 1:
 *             prev = input[i - win]             # <<<<<<<<<<<<<<
 *             if prev == prev:
 *                 x -= prev
 */
      __pyx_t_14 = (__pyx_v_i - __pyx_v_win);
      __pyx_t_8 = -1;
      if (__pyx_t_14 < 0) {
        __pyx_t_14 += __pyx_pybuffernd_input.diminfo[0].shape;
        if (unlikely(__pyx_t_14 < 0)) __pyx_t_8 = 0;
      } else if (unlikely(__pyx_t_14 >= __pyx_pybuffernd_input.diminfo[0].shape)) __pyx_t_8 = 0;
      if (unlikely(__pyx_t_8 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_8);
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1348; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_v_prev = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_double_t *, __pyx_pybuffernd_input.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_input.diminfo[0].strides));

      /* "pandas/algos.pyx":1349
 *         if i > win - 1:
 *             prev = input[i - win]
 *             if prev == prev:             # <<<<<<<<<<<<<<
 *                 x -= prev
 *                 xx -= prev * prev
 */
      __pyx_t_10 = ((__pyx_v_prev == __pyx_v_prev) != 0);
      if (__pyx_t_10) {

        /* "pandas/algos.pyx":1350
 *             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);

        /* "pandas/algos.pyx":1351
 *             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));

        /* "pandas/algos.pyx":1352
 *                 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));

        /* "pandas/algos.pyx":1353
 *                 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));

        /* "pandas/algos.pyx":1355
 *                 xxxx -= prev * prev * prev * prev
 * 
 *                 nobs -= 1             # <<<<<<<<<<<<<<
 * 
 *         if nobs >= minp:
 */
        __pyx_v_nobs = (__pyx_v_nobs - 1);
        goto __pyx_L10;
      }
      __pyx_L10:;
      goto __pyx_L9;
    }
    __pyx_L9:;

    /* "pandas/algos.pyx":1357
 *                 nobs -= 1
 * 
 *         if nobs >= minp:             # <<<<<<<<<<<<<<
 *             A = x / nobs
 *             R = A * A
 */
    __pyx_t_10 = ((__pyx_v_nobs >= __pyx_v_minp) != 0);
    if (__pyx_t_10) {

      /* "pandas/algos.pyx":1358
 * 
 *         if nobs >= minp:
 *             A = x / nobs             # <<<<<<<<<<<<<<
 *             R = A * A
 *             B = xx / nobs - R
 */
      if (unlikely(__pyx_v_nobs == 0)) {
        #ifdef WITH_THREAD
        PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
        #endif
        PyErr_SetString(PyExc_ZeroDivisionError, "float division");
        #ifdef WITH_THREAD
        PyGILState_Release(__pyx_gilstate_save);
        #endif
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1358; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_v_A = (__pyx_v_x / __pyx_v_nobs);

      /* "pandas/algos.pyx":1359
 *         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);

      /* "pandas/algos.pyx":1360
 *             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)) {
        #ifdef WITH_THREAD
        PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
        #endif
        PyErr_SetString(PyExc_ZeroDivisionError, "float division");
        #ifdef WITH_THREAD
        PyGILState_Release(__pyx_gilstate_save);
        #endif
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1360; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_v_B = ((__pyx_v_xx / __pyx_v_nobs) - __pyx_v_R);

      /* "pandas/algos.pyx":1361
 *             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);

      /* "pandas/algos.pyx":1362
 *             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)) {
        #ifdef WITH_THREAD
        PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
        #endif
        PyErr_SetString(PyExc_ZeroDivisionError, "float division");
        #ifdef WITH_THREAD
        PyGILState_Release(__pyx_gilstate_save);
        #endif
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1362; __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));

      /* "pandas/algos.pyx":1363
 *             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);

      /* "pandas/algos.pyx":1364
 *             C = xxx / nobs - R - 3 * A * B
 *             R = R * A
 *             D = xxxx / nobs - R - 6*B*A*A - 4*C*A             # <<<<<<<<<<<<<<
 * 
 *             if B == 0 or nobs < 4:
 */
      if (unlikely(__pyx_v_nobs == 0)) {
        #ifdef WITH_THREAD
        PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
        #endif
        PyErr_SetString(PyExc_ZeroDivisionError, "float division");
        #ifdef WITH_THREAD
        PyGILState_Release(__pyx_gilstate_save);
        #endif
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1364; __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));

      /* "pandas/algos.pyx":1366
 *             D = xxxx / nobs - R - 6*B*A*A - 4*C*A
 * 
 *             if B == 0 or nobs < 4:             # <<<<<<<<<<<<<<
 *                 output[i] = NaN
 * 
 */
      __pyx_t_10 = ((__pyx_v_B == 0.0) != 0);
      if (!__pyx_t_10) {
        __pyx_t_15 = ((__pyx_v_nobs < 4) != 0);
        __pyx_t_16 = __pyx_t_15;
      } else {
        __pyx_t_16 = __pyx_t_10;
      }
      if (__pyx_t_16) {

        /* "pandas/algos.pyx":1367
 * 
 *             if B == 0 or nobs < 4:
 *                 output[i] = NaN             # <<<<<<<<<<<<<<
 * 
 *             else:
 */
        __pyx_t_17 = __pyx_v_i;
        __pyx_t_8 = -1;
        if (__pyx_t_17 < 0) {
          __pyx_t_17 += __pyx_pybuffernd_output.diminfo[0].shape;
          if (unlikely(__pyx_t_17 < 0)) __pyx_t_8 = 0;
        } else if (unlikely(__pyx_t_17 >= __pyx_pybuffernd_output.diminfo[0].shape)) __pyx_t_8 = 0;
        if (unlikely(__pyx_t_8 != -1)) {
          __Pyx_RaiseBufferIndexError(__pyx_t_8);
          {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1367; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_double_t *, __pyx_pybuffernd_output.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_output.diminfo[0].strides) = __pyx_v_6pandas_5algos_NaN;
        goto __pyx_L12;
      }
      /*else*/ {

        /* "pandas/algos.pyx":1370
 * 
 *             else:
 *                 K = (nobs * nobs - 1.)*D/(B*B) - 3*((nobs-1.)**2)             # <<<<<<<<<<<<<<
 *                 K = K / ((nobs - 2.)*(nobs-3.))
 * 
 */
        __pyx_t_18 = (((__pyx_v_nobs * __pyx_v_nobs) - 1.) * __pyx_v_D);
        __pyx_t_19 = (__pyx_v_B * __pyx_v_B);
        if (unlikely(__pyx_t_19 == 0)) {
          #ifdef WITH_THREAD
          PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
          #endif
          PyErr_SetString(PyExc_ZeroDivisionError, "float division");
          #ifdef WITH_THREAD
          PyGILState_Release(__pyx_gilstate_save);
          #endif
          {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1370; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        __pyx_v_K = ((__pyx_t_18 / __pyx_t_19) - (3.0 * pow((__pyx_v_nobs - 1.), 2.0)));

        /* "pandas/algos.pyx":1371
 *             else:
 *                 K = (nobs * nobs - 1.)*D/(B*B) - 3*((nobs-1.)**2)
 *                 K = K / ((nobs - 2.)*(nobs-3.))             # <<<<<<<<<<<<<<
 * 
 *                 output[i] = K
 */
        __pyx_t_19 = ((__pyx_v_nobs - 2.) * (__pyx_v_nobs - 3.));
        if (unlikely(__pyx_t_19 == 0)) {
          #ifdef WITH_THREAD
          PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
          #endif
          PyErr_SetString(PyExc_ZeroDivisionError, "float division");
          #ifdef WITH_THREAD
          PyGILState_Release(__pyx_gilstate_save);
          #endif
          {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1371; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        __pyx_v_K = (__pyx_v_K / __pyx_t_19);

        /* "pandas/algos.pyx":1373
 *                 K = K / ((nobs - 2.)*(nobs-3.))
 * 
 *                 output[i] = K             # <<<<<<<<<<<<<<
 * 
 *         else:
 */
        __pyx_t_20 = __pyx_v_i;
        __pyx_t_8 = -1;
        if (__pyx_t_20 < 0) {
          __pyx_t_20 += __pyx_pybuffernd_output.diminfo[0].shape;
          if (unlikely(__pyx_t_20 < 0)) __pyx_t_8 = 0;
        } else if (unlikely(__pyx_t_20 >= __pyx_pybuffernd_output.diminfo[0].shape)) __pyx_t_8 = 0;
        if (unlikely(__pyx_t_8 != -1)) {
          __Pyx_RaiseBufferIndexError(__pyx_t_8);
          {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1373; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_double_t *, __pyx_pybuffernd_output.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_output.diminfo[0].strides) = __pyx_v_K;
      }
      __pyx_L12:;
      goto __pyx_L11;
    }
    /*else*/ {

      /* "pandas/algos.pyx":1376
 * 
 *         else:
 *             output[i] = NaN             # <<<<<<<<<<<<<<
 * 
 *     return output
 */
      __pyx_t_21 = __pyx_v_i;
      __pyx_t_8 = -1;
      if (__pyx_t_21 < 0) {
        __pyx_t_21 += __pyx_pybuffernd_output.diminfo[0].shape;
        if (unlikely(__pyx_t_21 < 0)) __pyx_t_8 = 0;
      } else if (unlikely(__pyx_t_21 >= __pyx_pybuffernd_output.diminfo[0].shape)) __pyx_t_8 = 0;
      if (unlikely(__pyx_t_8 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_8);
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1376; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_double_t *, __pyx_pybuffernd_output.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_output.diminfo[0].strides) = __pyx_v_6pandas_5algos_NaN;
    }
    __pyx_L11:;
  }

  /* "pandas/algos.pyx":1378
 *             output[i] = NaN
 * 
 *     return output             # <<<<<<<<<<<<<<
 * 
 * #-------------------------------------------------------------------------------
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_output));
  __pyx_r = ((PyObject *)__pyx_v_output);
  goto __pyx_L0;

  /* "pandas/algos.pyx":1308
 * 
 * 
 * def roll_kurt(ndarray[double_t] input,             # <<<<<<<<<<<<<<
 *                int win, int minp):
 *     cdef double val, prev
 */

  /* function exit code */
  __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_7);
  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
    __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_input.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_output.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas.algos.roll_kurt", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_input.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_output.rcbuffer->pybuffer);
  __pyx_L2:;
  __Pyx_XDECREF((PyObject *)__pyx_v_output);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/algos.pyx":1385
 * 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_5algos__roll_skiplist_op(PyArrayObject *__pyx_v_arg, int __pyx_v_win, int __pyx_v_minp, __pyx_t_6pandas_5algos_skiplist_f __pyx_v_op) {
  PyArrayObject *__pyx_v_input = 0;
  double __pyx_v_val;
  double __pyx_v_prev;
  struct __pyx_obj_6pandas_5algos_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;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_input;
  __Pyx_Buffer __pyx_pybuffer_input;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_output;
  __Pyx_Buffer __pyx_pybuffer_output;
  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;
  PyObject *__pyx_t_7 = NULL;
  int __pyx_t_8;
  long __pyx_t_9;
  int __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;
  __Pyx_RefNannySetupContext("_roll_skiplist_op", 0);
  __pyx_pybuffer_input.pybuffer.buf = NULL;
  __pyx_pybuffer_input.refcount = 0;
  __pyx_pybuffernd_input.data = NULL;
  __pyx_pybuffernd_input.rcbuffer = &__pyx_pybuffer_input;
  __pyx_pybuffer_output.pybuffer.buf = NULL;
  __pyx_pybuffer_output.refcount = 0;
  __pyx_pybuffernd_output.data = NULL;
  __pyx_pybuffernd_output.rcbuffer = &__pyx_pybuffer_output;

  /* "pandas/algos.pyx":1386
 * 
 * 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_pybuffernd_input.rcbuffer->pybuffer, (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_pybuffernd_input.rcbuffer->pybuffer.buf = NULL;
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1386; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    } else {__pyx_pybuffernd_input.diminfo[0].strides = __pyx_pybuffernd_input.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_input.diminfo[0].shape = __pyx_pybuffernd_input.rcbuffer->pybuffer.shape[0];
    }
  }
  __Pyx_INCREF(((PyObject *)__pyx_v_arg));
  __pyx_v_input = ((PyArrayObject *)__pyx_v_arg);

  /* "pandas/algos.pyx":1389
 *     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;

  /* "pandas/algos.pyx":1391
 *     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[0]; __pyx_lineno = 1391; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_N = __pyx_t_1;

  /* "pandas/algos.pyx":1392
 * 
 *     cdef Py_ssize_t N = len(input)
 *     cdef ndarray[double_t] output = np.empty(N, dtype=float)             # <<<<<<<<<<<<<<
 * 
 *     skiplist = IndexableSkiplist(win)
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1392; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_empty); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1392; __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 = 1392; __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 = 1392; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__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 = 1392; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, ((PyObject *)((PyObject*)(&PyFloat_Type)))) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1392; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1392; __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_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__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 = 1392; __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_pybuffernd_output.rcbuffer->pybuffer, (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_pybuffernd_output.rcbuffer->pybuffer.buf = NULL;
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1392; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    } else {__pyx_pybuffernd_output.diminfo[0].strides = __pyx_pybuffernd_output.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_output.diminfo[0].shape = __pyx_pybuffernd_output.rcbuffer->pybuffer.shape[0];
    }
  }
  __pyx_t_6 = 0;
  __pyx_v_output = ((PyArrayObject *)__pyx_t_5);
  __pyx_t_5 = 0;

  /* "pandas/algos.pyx":1394
 *     cdef ndarray[double_t] output = np.empty(N, dtype=float)
 * 
 *     skiplist = IndexableSkiplist(win)             # <<<<<<<<<<<<<<
 * 
 *     minp = _check_minp(win, minp, N)
 */
  __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_win); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1394; __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[0]; __pyx_lineno = 1394; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__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 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_6pandas_5algos_IndexableSkiplist)), __pyx_t_2, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1394; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_skiplist = ((struct __pyx_obj_6pandas_5algos_IndexableSkiplist *)__pyx_t_5);
  __pyx_t_5 = 0;

  /* "pandas/algos.pyx":1396
 *     skiplist = IndexableSkiplist(win)
 * 
 *     minp = _check_minp(win, minp, N)             # <<<<<<<<<<<<<<
 * 
 *     for i from 0 <= i < minp - 1:
 */
  __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_check_minp); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1396; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_win); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1396; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_minp); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1396; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_N); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1396; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_7 = PyTuple_New(3); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1396; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__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_4);
  __Pyx_GIVEREF(__pyx_t_4);
  PyTuple_SET_ITEM(__pyx_t_7, 2, __pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_3);
  __pyx_t_2 = 0;
  __pyx_t_4 = 0;
  __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_7, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1396; __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_7); __pyx_t_7 = 0;
  __pyx_t_8 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_8 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1396; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_v_minp = __pyx_t_8;

  /* "pandas/algos.pyx":1398
 *     minp = _check_minp(win, minp, N)
 * 
 *     for i from 0 <= i < minp - 1:             # <<<<<<<<<<<<<<
 *         val = input[i]
 * 
 */
  __pyx_t_9 = (__pyx_v_minp - 1);
  for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_9; __pyx_v_i++) {

    /* "pandas/algos.pyx":1399
 * 
 *     for i from 0 <= i < minp - 1:
 *         val = input[i]             # <<<<<<<<<<<<<<
 * 
 *         # Not NaN
 */
    __pyx_t_1 = __pyx_v_i;
    __pyx_t_8 = -1;
    if (__pyx_t_1 < 0) {
      __pyx_t_1 += __pyx_pybuffernd_input.diminfo[0].shape;
      if (unlikely(__pyx_t_1 < 0)) __pyx_t_8 = 0;
    } else if (unlikely(__pyx_t_1 >= __pyx_pybuffernd_input.diminfo[0].shape)) __pyx_t_8 = 0;
    if (unlikely(__pyx_t_8 != -1)) {
      __Pyx_RaiseBufferIndexError(__pyx_t_8);
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1399; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_v_val = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_double_t *, __pyx_pybuffernd_input.rcbuffer->pybuffer.buf, __pyx_t_1, __pyx_pybuffernd_input.diminfo[0].strides));

    /* "pandas/algos.pyx":1402
 * 
 *         # Not NaN
 *         if val == val:             # <<<<<<<<<<<<<<
 *             nobs += 1
 *             skiplist.insert(val)
 */
    __pyx_t_10 = ((__pyx_v_val == __pyx_v_val) != 0);
    if (__pyx_t_10) {

      /* "pandas/algos.pyx":1403
 *         # Not NaN
 *         if val == val:
 *             nobs += 1             # <<<<<<<<<<<<<<
 *             skiplist.insert(val)
 * 
 */
      __pyx_v_nobs = (__pyx_v_nobs + 1);

      /* "pandas/algos.pyx":1404
 *         if val == val:
 *             nobs += 1
 *             skiplist.insert(val)             # <<<<<<<<<<<<<<
 * 
 *         output[i] = NaN
 */
      __pyx_t_3 = ((struct __pyx_vtabstruct_6pandas_5algos_IndexableSkiplist *)__pyx_v_skiplist->__pyx_vtab)->insert(__pyx_v_skiplist, __pyx_v_val, 0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1404; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      goto __pyx_L5;
    }
    __pyx_L5:;

    /* "pandas/algos.pyx":1406
 *             skiplist.insert(val)
 * 
 *         output[i] = NaN             # <<<<<<<<<<<<<<
 * 
 *     for i from minp - 1 <= i < N:
 */
    __pyx_t_11 = __pyx_v_i;
    __pyx_t_8 = -1;
    if (__pyx_t_11 < 0) {
      __pyx_t_11 += __pyx_pybuffernd_output.diminfo[0].shape;
      if (unlikely(__pyx_t_11 < 0)) __pyx_t_8 = 0;
    } else if (unlikely(__pyx_t_11 >= __pyx_pybuffernd_output.diminfo[0].shape)) __pyx_t_8 = 0;
    if (unlikely(__pyx_t_8 != -1)) {
      __Pyx_RaiseBufferIndexError(__pyx_t_8);
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1406; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_double_t *, __pyx_pybuffernd_output.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_output.diminfo[0].strides) = __pyx_v_6pandas_5algos_NaN;
  }

  /* "pandas/algos.pyx":1408
 *         output[i] = NaN
 * 
 *     for i from minp - 1 <= i < N:             # <<<<<<<<<<<<<<
 *         val = input[i]
 * 
 */
  __pyx_t_12 = __pyx_v_N;
  for (__pyx_v_i = (__pyx_v_minp - 1); __pyx_v_i < __pyx_t_12; __pyx_v_i++) {

    /* "pandas/algos.pyx":1409
 * 
 *     for i from minp - 1 <= i < N:
 *         val = input[i]             # <<<<<<<<<<<<<<
 * 
 *         if i > win - 1:
 */
    __pyx_t_13 = __pyx_v_i;
    __pyx_t_8 = -1;
    if (__pyx_t_13 < 0) {
      __pyx_t_13 += __pyx_pybuffernd_input.diminfo[0].shape;
      if (unlikely(__pyx_t_13 < 0)) __pyx_t_8 = 0;
    } else if (unlikely(__pyx_t_13 >= __pyx_pybuffernd_input.diminfo[0].shape)) __pyx_t_8 = 0;
    if (unlikely(__pyx_t_8 != -1)) {
      __Pyx_RaiseBufferIndexError(__pyx_t_8);
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1409; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_v_val = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_double_t *, __pyx_pybuffernd_input.rcbuffer->pybuffer.buf, __pyx_t_13, __pyx_pybuffernd_input.diminfo[0].strides));

    /* "pandas/algos.pyx":1411
 *         val = input[i]
 * 
 *         if i > win - 1:             # <<<<<<<<<<<<<<
 *             prev = input[i - win]
 * 
 */
    __pyx_t_10 = ((__pyx_v_i > (__pyx_v_win - 1)) != 0);
    if (__pyx_t_10) {

      /* "pandas/algos.pyx":1412
 * 
 *         if i > win - 1:
 *             prev = input[i - win]             # <<<<<<<<<<<<<<
 * 
 *             if prev == prev:
 */
      __pyx_t_14 = (__pyx_v_i - __pyx_v_win);
      __pyx_t_8 = -1;
      if (__pyx_t_14 < 0) {
        __pyx_t_14 += __pyx_pybuffernd_input.diminfo[0].shape;
        if (unlikely(__pyx_t_14 < 0)) __pyx_t_8 = 0;
      } else if (unlikely(__pyx_t_14 >= __pyx_pybuffernd_input.diminfo[0].shape)) __pyx_t_8 = 0;
      if (unlikely(__pyx_t_8 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_8);
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1412; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_v_prev = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_double_t *, __pyx_pybuffernd_input.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_input.diminfo[0].strides));

      /* "pandas/algos.pyx":1414
 *             prev = input[i - win]
 * 
 *             if prev == prev:             # <<<<<<<<<<<<<<
 *                 skiplist.remove(prev)
 *                 nobs -= 1
 */
      __pyx_t_10 = ((__pyx_v_prev == __pyx_v_prev) != 0);
      if (__pyx_t_10) {

        /* "pandas/algos.pyx":1415
 * 
 *             if prev == prev:
 *                 skiplist.remove(prev)             # <<<<<<<<<<<<<<
 *                 nobs -= 1
 * 
 */
        __pyx_t_3 = ((struct __pyx_vtabstruct_6pandas_5algos_IndexableSkiplist *)__pyx_v_skiplist->__pyx_vtab)->remove(__pyx_v_skiplist, __pyx_v_prev, 0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1415; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

        /* "pandas/algos.pyx":1416
 *             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:;

    /* "pandas/algos.pyx":1418
 *                 nobs -= 1
 * 
 *         if val == val:             # <<<<<<<<<<<<<<
 *             nobs += 1
 *             skiplist.insert(val)
 */
    __pyx_t_10 = ((__pyx_v_val == __pyx_v_val) != 0);
    if (__pyx_t_10) {

      /* "pandas/algos.pyx":1419
 * 
 *         if val == val:
 *             nobs += 1             # <<<<<<<<<<<<<<
 *             skiplist.insert(val)
 * 
 */
      __pyx_v_nobs = (__pyx_v_nobs + 1);

      /* "pandas/algos.pyx":1420
 *         if val == val:
 *             nobs += 1
 *             skiplist.insert(val)             # <<<<<<<<<<<<<<
 * 
 *         output[i] = op(skiplist, nobs, minp)
 */
      __pyx_t_3 = ((struct __pyx_vtabstruct_6pandas_5algos_IndexableSkiplist *)__pyx_v_skiplist->__pyx_vtab)->insert(__pyx_v_skiplist, __pyx_v_val, 0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1420; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      goto __pyx_L10;
    }
    __pyx_L10:;

    /* "pandas/algos.pyx":1422
 *             skiplist.insert(val)
 * 
 *         output[i] = op(skiplist, nobs, minp)             # <<<<<<<<<<<<<<
 * 
 *     return output
 */
    __pyx_t_15 = __pyx_v_i;
    __pyx_t_8 = -1;
    if (__pyx_t_15 < 0) {
      __pyx_t_15 += __pyx_pybuffernd_output.diminfo[0].shape;
      if (unlikely(__pyx_t_15 < 0)) __pyx_t_8 = 0;
    } else if (unlikely(__pyx_t_15 >= __pyx_pybuffernd_output.diminfo[0].shape)) __pyx_t_8 = 0;
    if (unlikely(__pyx_t_8 != -1)) {
      __Pyx_RaiseBufferIndexError(__pyx_t_8);
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1422; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_double_t *, __pyx_pybuffernd_output.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_output.diminfo[0].strides) = __pyx_v_op(((PyObject *)__pyx_v_skiplist), __pyx_v_nobs, __pyx_v_minp);
  }

  /* "pandas/algos.pyx":1424
 *         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;

  /* "pandas/algos.pyx":1385
 * 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
 */

  /* function exit code */
  __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_7);
  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
    __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_input.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_output.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas.algos._roll_skiplist_op", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_input.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_output.rcbuffer->pybuffer);
  __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;
}

/* "pandas/algos.pyx":1428
 * from skiplist cimport *
 * 
 * def roll_median_c(ndarray[float64_t] arg, int win, int minp):             # <<<<<<<<<<<<<<
 *     cdef double val, res, prev
 *     cdef:
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pandas_5algos_39roll_median_c(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_5algos_39roll_median_c = {__Pyx_NAMESTR("roll_median_c"), (PyCFunction)__pyx_pw_6pandas_5algos_39roll_median_c, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pw_6pandas_5algos_39roll_median_c(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyArrayObject *__pyx_v_arg = 0;
  int __pyx_v_win;
  int __pyx_v_minp;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("roll_median_c (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_arg,&__pyx_n_s_win,&__pyx_n_s_minp,0};
    PyObject* values[3] = {0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_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 (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_arg)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_win)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("roll_median_c", 1, 3, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1428; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_minp)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("roll_median_c", 1, 3, 3, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1428; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "roll_median_c") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1428; __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_As_int(values[1]); if (unlikely((__pyx_v_win == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1428; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_v_minp = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_minp == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1428; __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[0]; __pyx_lineno = 1428; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas.algos.roll_median_c", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_arg), __pyx_ptype_5numpy_ndarray, 1, "arg", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1428; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_38roll_median_c(__pyx_self, __pyx_v_arg, __pyx_v_win, __pyx_v_minp);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pandas_5algos_38roll_median_c(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_arg, 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;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_arg;
  __Pyx_Buffer __pyx_pybuffer_arg;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_output;
  __Pyx_Buffer __pyx_pybuffer_output;
  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;
  PyObject *__pyx_t_7 = NULL;
  int __pyx_t_8;
  long __pyx_t_9;
  int __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;
  __Pyx_RefNannySetupContext("roll_median_c", 0);
  __pyx_pybuffer_output.pybuffer.buf = NULL;
  __pyx_pybuffer_output.refcount = 0;
  __pyx_pybuffernd_output.data = NULL;
  __pyx_pybuffernd_output.rcbuffer = &__pyx_pybuffer_output;
  __pyx_pybuffer_arg.pybuffer.buf = NULL;
  __pyx_pybuffer_arg.refcount = 0;
  __pyx_pybuffernd_arg.data = NULL;
  __pyx_pybuffernd_arg.rcbuffer = &__pyx_pybuffer_arg;
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_arg.rcbuffer->pybuffer, (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[0]; __pyx_lineno = 1428; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_arg.diminfo[0].strides = __pyx_pybuffernd_arg.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_arg.diminfo[0].shape = __pyx_pybuffernd_arg.rcbuffer->pybuffer.shape[0];

  /* "pandas/algos.pyx":1431
 *     cdef double val, res, prev
 *     cdef:
 *         int ret=0             # <<<<<<<<<<<<<<
 *         skiplist_t *sl
 *         Py_ssize_t midpoint, nobs = 0, i
 */
  __pyx_v_ret = 0;

  /* "pandas/algos.pyx":1433
 *         int ret=0
 *         skiplist_t *sl
 *         Py_ssize_t midpoint, nobs = 0, i             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_v_nobs = 0;

  /* "pandas/algos.pyx":1436
 * 
 * 
 *     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[0]; __pyx_lineno = 1436; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_N = __pyx_t_1;

  /* "pandas/algos.pyx":1437
 * 
 *     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_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1437; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_empty); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1437; __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 = 1437; __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 = 1437; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__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 = 1437; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, ((PyObject *)((PyObject*)(&PyFloat_Type)))) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1437; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1437; __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_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__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 = 1437; __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_pybuffernd_output.rcbuffer->pybuffer, (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_pybuffernd_output.rcbuffer->pybuffer.buf = NULL;
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1437; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    } else {__pyx_pybuffernd_output.diminfo[0].strides = __pyx_pybuffernd_output.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_output.diminfo[0].shape = __pyx_pybuffernd_output.rcbuffer->pybuffer.shape[0];
    }
  }
  __pyx_t_6 = 0;
  __pyx_v_output = ((PyArrayObject *)__pyx_t_5);
  __pyx_t_5 = 0;

  /* "pandas/algos.pyx":1439
 *     cdef ndarray[double_t] output = np.empty(N, dtype=float)
 * 
 *     sl = skiplist_init(win)             # <<<<<<<<<<<<<<
 * 
 *     minp = _check_minp(win, minp, N)
 */
  __pyx_v_sl = skiplist_init(__pyx_v_win);

  /* "pandas/algos.pyx":1441
 *     sl = skiplist_init(win)
 * 
 *     minp = _check_minp(win, minp, N)             # <<<<<<<<<<<<<<
 * 
 *     for i from 0 <= i < minp - 1:
 */
  __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_check_minp); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1441; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_win); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1441; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_minp); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1441; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_N); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1441; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_7 = PyTuple_New(3); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1441; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__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_4);
  __Pyx_GIVEREF(__pyx_t_4);
  PyTuple_SET_ITEM(__pyx_t_7, 2, __pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_3);
  __pyx_t_2 = 0;
  __pyx_t_4 = 0;
  __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_7, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1441; __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_7); __pyx_t_7 = 0;
  __pyx_t_8 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_8 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1441; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_v_minp = __pyx_t_8;

  /* "pandas/algos.pyx":1443
 *     minp = _check_minp(win, minp, N)
 * 
 *     for i from 0 <= i < minp - 1:             # <<<<<<<<<<<<<<
 *         val = arg[i]
 * 
 */
  __pyx_t_9 = (__pyx_v_minp - 1);
  for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_9; __pyx_v_i++) {

    /* "pandas/algos.pyx":1444
 * 
 *     for i from 0 <= i < minp - 1:
 *         val = arg[i]             # <<<<<<<<<<<<<<
 * 
 *         # Not NaN
 */
    __pyx_t_1 = __pyx_v_i;
    __pyx_t_8 = -1;
    if (__pyx_t_1 < 0) {
      __pyx_t_1 += __pyx_pybuffernd_arg.diminfo[0].shape;
      if (unlikely(__pyx_t_1 < 0)) __pyx_t_8 = 0;
    } else if (unlikely(__pyx_t_1 >= __pyx_pybuffernd_arg.diminfo[0].shape)) __pyx_t_8 = 0;
    if (unlikely(__pyx_t_8 != -1)) {
      __Pyx_RaiseBufferIndexError(__pyx_t_8);
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1444; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_v_val = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_arg.rcbuffer->pybuffer.buf, __pyx_t_1, __pyx_pybuffernd_arg.diminfo[0].strides));

    /* "pandas/algos.pyx":1447
 * 
 *         # Not NaN
 *         if val == val:             # <<<<<<<<<<<<<<
 *             nobs += 1
 *             skiplist_insert(sl, val)
 */
    __pyx_t_10 = ((__pyx_v_val == __pyx_v_val) != 0);
    if (__pyx_t_10) {

      /* "pandas/algos.pyx":1448
 *         # Not NaN
 *         if val == val:
 *             nobs += 1             # <<<<<<<<<<<<<<
 *             skiplist_insert(sl, val)
 * 
 */
      __pyx_v_nobs = (__pyx_v_nobs + 1);

      /* "pandas/algos.pyx":1449
 *         if val == val:
 *             nobs += 1
 *             skiplist_insert(sl, val)             # <<<<<<<<<<<<<<
 * 
 *         output[i] = NaN
 */
      skiplist_insert(__pyx_v_sl, __pyx_v_val);
      goto __pyx_L5;
    }
    __pyx_L5:;

    /* "pandas/algos.pyx":1451
 *             skiplist_insert(sl, val)
 * 
 *         output[i] = NaN             # <<<<<<<<<<<<<<
 * 
 *     for i from minp - 1 <= i < N:
 */
    __pyx_t_11 = __pyx_v_i;
    __pyx_t_8 = -1;
    if (__pyx_t_11 < 0) {
      __pyx_t_11 += __pyx_pybuffernd_output.diminfo[0].shape;
      if (unlikely(__pyx_t_11 < 0)) __pyx_t_8 = 0;
    } else if (unlikely(__pyx_t_11 >= __pyx_pybuffernd_output.diminfo[0].shape)) __pyx_t_8 = 0;
    if (unlikely(__pyx_t_8 != -1)) {
      __Pyx_RaiseBufferIndexError(__pyx_t_8);
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1451; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_double_t *, __pyx_pybuffernd_output.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_output.diminfo[0].strides) = __pyx_v_6pandas_5algos_NaN;
  }

  /* "pandas/algos.pyx":1453
 *         output[i] = NaN
 * 
 *     for i from minp - 1 <= i < N:             # <<<<<<<<<<<<<<
 *         val = arg[i]
 * 
 */
  __pyx_t_12 = __pyx_v_N;
  for (__pyx_v_i = (__pyx_v_minp - 1); __pyx_v_i < __pyx_t_12; __pyx_v_i++) {

    /* "pandas/algos.pyx":1454
 * 
 *     for i from minp - 1 <= i < N:
 *         val = arg[i]             # <<<<<<<<<<<<<<
 * 
 *         if i > win - 1:
 */
    __pyx_t_13 = __pyx_v_i;
    __pyx_t_8 = -1;
    if (__pyx_t_13 < 0) {
      __pyx_t_13 += __pyx_pybuffernd_arg.diminfo[0].shape;
      if (unlikely(__pyx_t_13 < 0)) __pyx_t_8 = 0;
    } else if (unlikely(__pyx_t_13 >= __pyx_pybuffernd_arg.diminfo[0].shape)) __pyx_t_8 = 0;
    if (unlikely(__pyx_t_8 != -1)) {
      __Pyx_RaiseBufferIndexError(__pyx_t_8);
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1454; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_v_val = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_arg.rcbuffer->pybuffer.buf, __pyx_t_13, __pyx_pybuffernd_arg.diminfo[0].strides));

    /* "pandas/algos.pyx":1456
 *         val = arg[i]
 * 
 *         if i > win - 1:             # <<<<<<<<<<<<<<
 *             prev = arg[i - win]
 * 
 */
    __pyx_t_10 = ((__pyx_v_i > (__pyx_v_win - 1)) != 0);
    if (__pyx_t_10) {

      /* "pandas/algos.pyx":1457
 * 
 *         if i > win - 1:
 *             prev = arg[i - win]             # <<<<<<<<<<<<<<
 * 
 *             if prev == prev:
 */
      __pyx_t_14 = (__pyx_v_i - __pyx_v_win);
      __pyx_t_8 = -1;
      if (__pyx_t_14 < 0) {
        __pyx_t_14 += __pyx_pybuffernd_arg.diminfo[0].shape;
        if (unlikely(__pyx_t_14 < 0)) __pyx_t_8 = 0;
      } else if (unlikely(__pyx_t_14 >= __pyx_pybuffernd_arg.diminfo[0].shape)) __pyx_t_8 = 0;
      if (unlikely(__pyx_t_8 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_8);
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1457; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_v_prev = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_arg.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_arg.diminfo[0].strides));

      /* "pandas/algos.pyx":1459
 *             prev = arg[i - win]
 * 
 *             if prev == prev:             # <<<<<<<<<<<<<<
 *                 skiplist_remove(sl, prev)
 *                 nobs -= 1
 */
      __pyx_t_10 = ((__pyx_v_prev == __pyx_v_prev) != 0);
      if (__pyx_t_10) {

        /* "pandas/algos.pyx":1460
 * 
 *             if prev == prev:
 *                 skiplist_remove(sl, prev)             # <<<<<<<<<<<<<<
 *                 nobs -= 1
 * 
 */
        skiplist_remove(__pyx_v_sl, __pyx_v_prev);

        /* "pandas/algos.pyx":1461
 *             if prev == prev:
 *                 skiplist_remove(sl, prev)
 *                 nobs -= 1             # <<<<<<<<<<<<<<
 * 
 *         if val == val:
 */
        __pyx_v_nobs = (__pyx_v_nobs - 1);
        goto __pyx_L9;
      }
      __pyx_L9:;
      goto __pyx_L8;
    }
    __pyx_L8:;

    /* "pandas/algos.pyx":1463
 *                 nobs -= 1
 * 
 *         if val == val:             # <<<<<<<<<<<<<<
 *             nobs += 1
 *             skiplist_insert(sl, val)
 */
    __pyx_t_10 = ((__pyx_v_val == __pyx_v_val) != 0);
    if (__pyx_t_10) {

      /* "pandas/algos.pyx":1464
 * 
 *         if val == val:
 *             nobs += 1             # <<<<<<<<<<<<<<
 *             skiplist_insert(sl, val)
 * 
 */
      __pyx_v_nobs = (__pyx_v_nobs + 1);

      /* "pandas/algos.pyx":1465
 *         if val == val:
 *             nobs += 1
 *             skiplist_insert(sl, val)             # <<<<<<<<<<<<<<
 * 
 *         if nobs >= minp:
 */
      skiplist_insert(__pyx_v_sl, __pyx_v_val);
      goto __pyx_L10;
    }
    __pyx_L10:;

    /* "pandas/algos.pyx":1467
 *             skiplist_insert(sl, val)
 * 
 *         if nobs >= minp:             # <<<<<<<<<<<<<<
 *             midpoint = nobs / 2
 *             if nobs % 2:
 */
    __pyx_t_10 = ((__pyx_v_nobs >= __pyx_v_minp) != 0);
    if (__pyx_t_10) {

      /* "pandas/algos.pyx":1468
 * 
 *         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);

      /* "pandas/algos.pyx":1469
 *         if nobs >= minp:
 *             midpoint = nobs / 2
 *             if nobs % 2:             # <<<<<<<<<<<<<<
 *                 res = skiplist_get(sl, midpoint, &ret)
 *             else:
 */
      __pyx_t_10 = (__Pyx_mod_Py_ssize_t(__pyx_v_nobs, 2) != 0);
      if (__pyx_t_10) {

        /* "pandas/algos.pyx":1470
 *             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_L12;
      }
      /*else*/ {

        /* "pandas/algos.pyx":1473
 *             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_L12:;
      goto __pyx_L11;
    }
    /*else*/ {

      /* "pandas/algos.pyx":1475
 *                        skiplist_get(sl, (midpoint - 1), &ret)) / 2
 *         else:
 *             res = NaN             # <<<<<<<<<<<<<<
 * 
 *         output[i] = res
 */
      __pyx_v_res = __pyx_v_6pandas_5algos_NaN;
    }
    __pyx_L11:;

    /* "pandas/algos.pyx":1477
 *             res = NaN
 * 
 *         output[i] = res             # <<<<<<<<<<<<<<
 * 
 *     skiplist_destroy(sl)
 */
    __pyx_t_15 = __pyx_v_i;
    __pyx_t_8 = -1;
    if (__pyx_t_15 < 0) {
      __pyx_t_15 += __pyx_pybuffernd_output.diminfo[0].shape;
      if (unlikely(__pyx_t_15 < 0)) __pyx_t_8 = 0;
    } else if (unlikely(__pyx_t_15 >= __pyx_pybuffernd_output.diminfo[0].shape)) __pyx_t_8 = 0;
    if (unlikely(__pyx_t_8 != -1)) {
      __Pyx_RaiseBufferIndexError(__pyx_t_8);
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1477; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_double_t *, __pyx_pybuffernd_output.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_output.diminfo[0].strides) = __pyx_v_res;
  }

  /* "pandas/algos.pyx":1479
 *         output[i] = res
 * 
 *     skiplist_destroy(sl)             # <<<<<<<<<<<<<<
 * 
 *     return output
 */
  skiplist_destroy(__pyx_v_sl);

  /* "pandas/algos.pyx":1481
 *     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;

  /* "pandas/algos.pyx":1428
 * from skiplist cimport *
 * 
 * def roll_median_c(ndarray[float64_t] arg, int win, int minp):             # <<<<<<<<<<<<<<
 *     cdef double val, res, prev
 *     cdef:
 */

  /* function exit code */
  __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_7);
  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
    __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_arg.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_output.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas.algos.roll_median_c", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_arg.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_output.rcbuffer->pybuffer);
  __pyx_L2:;
  __Pyx_XDECREF((PyObject *)__pyx_v_output);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/algos.pyx":1483
 *     return output
 * 
 * def roll_median_cython(ndarray input, int win, int minp):             # <<<<<<<<<<<<<<
 *     '''
 *     O(N log(window)) implementation using skip list
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pandas_5algos_41roll_median_cython(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6pandas_5algos_40roll_median_cython[] = "\n    O(N log(window)) implementation using skip list\n    ";
static PyMethodDef __pyx_mdef_6pandas_5algos_41roll_median_cython = {__Pyx_NAMESTR("roll_median_cython"), (PyCFunction)__pyx_pw_6pandas_5algos_41roll_median_cython, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6pandas_5algos_40roll_median_cython)};
static PyObject *__pyx_pw_6pandas_5algos_41roll_median_cython(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyArrayObject *__pyx_v_input = 0;
  int __pyx_v_win;
  int __pyx_v_minp;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("roll_median_cython (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_input,&__pyx_n_s_win,&__pyx_n_s_minp,0};
    PyObject* values[3] = {0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_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 (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_input)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_win)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("roll_median_cython", 1, 3, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1483; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_minp)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("roll_median_cython", 1, 3, 3, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1483; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "roll_median_cython") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1483; __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_As_int(values[1]); if (unlikely((__pyx_v_win == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1483; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_v_minp = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_minp == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1483; __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[0]; __pyx_lineno = 1483; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas.algos.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[0]; __pyx_lineno = 1483; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_40roll_median_cython(__pyx_self, __pyx_v_input, __pyx_v_win, __pyx_v_minp);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pandas_5algos_40roll_median_cython(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_input, 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;
  __Pyx_RefNannySetupContext("roll_median_cython", 0);

  /* "pandas/algos.pyx":1487
 *     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_5algos__roll_skiplist_op(__pyx_v_input, __pyx_v_win, __pyx_v_minp, __pyx_f_6pandas_5algos__get_median); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1487; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pandas/algos.pyx":1483
 *     return output
 * 
 * def roll_median_cython(ndarray input, int win, int minp):             # <<<<<<<<<<<<<<
 *     '''
 *     O(N log(window)) implementation using skip list
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pandas.algos.roll_median_cython", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/algos.pyx":1492
 * # 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_5algos__get_median(PyObject *__pyx_v_sl, int __pyx_v_nobs, int __pyx_v_minp) {
  Py_ssize_t __pyx_v_midpoint;
  struct __pyx_obj_6pandas_5algos_IndexableSkiplist *__pyx_v_skiplist = 0;
  __pyx_t_5numpy_double_t __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  __pyx_t_5numpy_double_t __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("_get_median", 0);

  /* "pandas/algos.pyx":1494
 * 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_t_1 = __pyx_v_sl;
  __Pyx_INCREF(__pyx_t_1);
  __pyx_v_skiplist = ((struct __pyx_obj_6pandas_5algos_IndexableSkiplist *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pandas/algos.pyx":1495
 *     cdef Py_ssize_t midpoint
 *     cdef IndexableSkiplist skiplist = <IndexableSkiplist> sl
 *     if nobs >= minp:             # <<<<<<<<<<<<<<
 *         midpoint = nobs / 2
 *         if nobs % 2:
 */
  __pyx_t_2 = ((__pyx_v_nobs >= __pyx_v_minp) != 0);
  if (__pyx_t_2) {

    /* "pandas/algos.pyx":1496
 *     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);

    /* "pandas/algos.pyx":1497
 *     if nobs >= minp:
 *         midpoint = nobs / 2
 *         if nobs % 2:             # <<<<<<<<<<<<<<
 *             return skiplist.get(midpoint)
 *         else:
 */
    __pyx_t_2 = (__Pyx_mod_long(__pyx_v_nobs, 2) != 0);
    if (__pyx_t_2) {

      /* "pandas/algos.pyx":1498
 *         midpoint = nobs / 2
 *         if nobs % 2:
 *             return skiplist.get(midpoint)             # <<<<<<<<<<<<<<
 *         else:
 *             return (skiplist.get(midpoint) +
 */
      __pyx_t_1 = ((struct __pyx_vtabstruct_6pandas_5algos_IndexableSkiplist *)__pyx_v_skiplist->__pyx_vtab)->get(__pyx_v_skiplist, __pyx_v_midpoint, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1498; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_3 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_3 == (npy_double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1498; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_r = __pyx_t_3;
      goto __pyx_L0;
    }
    /*else*/ {

      /* "pandas/algos.pyx":1500
 *             return skiplist.get(midpoint)
 *         else:
 *             return (skiplist.get(midpoint) +             # <<<<<<<<<<<<<<
 *                     skiplist.get(midpoint - 1)) / 2
 *     else:
 */
      __pyx_t_1 = ((struct __pyx_vtabstruct_6pandas_5algos_IndexableSkiplist *)__pyx_v_skiplist->__pyx_vtab)->get(__pyx_v_skiplist, __pyx_v_midpoint, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1500; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);

      /* "pandas/algos.pyx":1501
 *         else:
 *             return (skiplist.get(midpoint) +
 *                     skiplist.get(midpoint - 1)) / 2             # <<<<<<<<<<<<<<
 *     else:
 *         return NaN
 */
      __pyx_t_4 = ((struct __pyx_vtabstruct_6pandas_5algos_IndexableSkiplist *)__pyx_v_skiplist->__pyx_vtab)->get(__pyx_v_skiplist, (__pyx_v_midpoint - 1), 0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1501; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);

      /* "pandas/algos.pyx":1500
 *             return skiplist.get(midpoint)
 *         else:
 *             return (skiplist.get(midpoint) +             # <<<<<<<<<<<<<<
 *                     skiplist.get(midpoint - 1)) / 2
 *     else:
 */
      __pyx_t_5 = PyNumber_Add(__pyx_t_1, __pyx_t_4); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1500; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

      /* "pandas/algos.pyx":1501
 *         else:
 *             return (skiplist.get(midpoint) +
 *                     skiplist.get(midpoint - 1)) / 2             # <<<<<<<<<<<<<<
 *     else:
 *         return NaN
 */
      __pyx_t_4 = __Pyx_PyNumber_Divide(__pyx_t_5, __pyx_int_2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1501; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_3 = __pyx_PyFloat_AsDouble(__pyx_t_4); if (unlikely((__pyx_t_3 == (npy_double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1501; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_r = __pyx_t_3;
      goto __pyx_L0;
    }
  }
  /*else*/ {

    /* "pandas/algos.pyx":1503
 *                     skiplist.get(midpoint - 1)) / 2
 *     else:
 *         return NaN             # <<<<<<<<<<<<<<
 * 
 * #----------------------------------------------------------------------
 */
    __pyx_r = __pyx_v_6pandas_5algos_NaN;
    goto __pyx_L0;
  }

  /* "pandas/algos.pyx":1492
 * # 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
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_WriteUnraisable("pandas.algos._get_median", __pyx_clineno, __pyx_lineno, __pyx_filename, 0);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_skiplist);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/algos.pyx":1519
 * @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
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pandas_5algos_43roll_max2(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6pandas_5algos_42roll_max2[] = "Moving max of 1d array of dtype=float64 along axis=0 ignoring NaNs.";
static PyMethodDef __pyx_mdef_6pandas_5algos_43roll_max2 = {__Pyx_NAMESTR("roll_max2"), (PyCFunction)__pyx_pw_6pandas_5algos_43roll_max2, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6pandas_5algos_42roll_max2)};
static PyObject *__pyx_pw_6pandas_5algos_43roll_max2(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyArrayObject *__pyx_v_a = 0;
  int __pyx_v_window;
  int __pyx_v_minp;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("roll_max2 (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_a,&__pyx_n_s_window,&__pyx_n_s_minp,0};
    PyObject* values[3] = {0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_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 (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_a)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_window)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("roll_max2", 1, 3, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1519; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_minp)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("roll_max2", 1, 3, 3, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1519; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "roll_max2") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1519; __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_As_int(values[1]); if (unlikely((__pyx_v_window == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1519; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_v_minp = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_minp == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1519; __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[0]; __pyx_lineno = 1519; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas.algos.roll_max2", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_a), __pyx_ptype_5numpy_ndarray, 1, "a", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1519; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_42roll_max2(__pyx_self, __pyx_v_a, __pyx_v_window, __pyx_v_minp);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pandas_5algos_42roll_max2(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_a, 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_5algos_pairs *__pyx_v_ring;
  struct __pyx_t_6pandas_5algos_pairs *__pyx_v_minpair;
  struct __pyx_t_6pandas_5algos_pairs *__pyx_v_end;
  struct __pyx_t_6pandas_5algos_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;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_a;
  __Pyx_Buffer __pyx_pybuffer_a;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_y;
  __Pyx_Buffer __pyx_pybuffer_y;
  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;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  int __pyx_t_9;
  Py_ssize_t __pyx_t_10;
  Py_ssize_t __pyx_t_11;
  long __pyx_t_12;
  Py_ssize_t __pyx_t_13;
  Py_ssize_t __pyx_t_14;
  double __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;
  __Pyx_RefNannySetupContext("roll_max2", 0);
  __pyx_pybuffer_y.pybuffer.buf = NULL;
  __pyx_pybuffer_y.refcount = 0;
  __pyx_pybuffernd_y.data = NULL;
  __pyx_pybuffernd_y.rcbuffer = &__pyx_pybuffer_y;
  __pyx_pybuffer_a.pybuffer.buf = NULL;
  __pyx_pybuffer_a.refcount = 0;
  __pyx_pybuffernd_a.data = NULL;
  __pyx_pybuffernd_a.rcbuffer = &__pyx_pybuffer_a;
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_a.rcbuffer->pybuffer, (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[0]; __pyx_lineno = 1519; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_a.diminfo[0].strides = __pyx_pybuffernd_a.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_a.diminfo[0].shape = __pyx_pybuffernd_a.rcbuffer->pybuffer.shape[0];

  /* "pandas/algos.pyx":1529
 *     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));

  /* "pandas/algos.pyx":1530
 *     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]);

  /* "pandas/algos.pyx":1531
 *     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;

  /* "pandas/algos.pyx":1532
 *     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_2 = PyArray_EMPTY(1, __pyx_v_dims, NPY_FLOAT64, 0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1532; __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[0]; __pyx_lineno = 1532; __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_pybuffernd_y.rcbuffer->pybuffer, (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_pybuffernd_y.rcbuffer->pybuffer.buf = NULL;
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1532; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    } else {__pyx_pybuffernd_y.diminfo[0].strides = __pyx_pybuffernd_y.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_y.diminfo[0].shape = __pyx_pybuffernd_y.rcbuffer->pybuffer.shape[0];
    }
  }
  __pyx_t_3 = 0;
  __pyx_v_y = ((PyArrayObject *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "pandas/algos.pyx":1535
 * 		NPY_float64, 0)
 * 
 *     if window < 1:             # <<<<<<<<<<<<<<
 *         raise ValueError('Invalid window size %d'
 *                          % (window))
 */
  __pyx_t_4 = ((__pyx_v_window < 1) != 0);
  if (__pyx_t_4) {

    /* "pandas/algos.pyx":1537
 *     if window < 1:
 *         raise ValueError('Invalid window size %d'
 *                          % (window))             # <<<<<<<<<<<<<<
 * 
 *     if minp > window:
 */
    __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_window); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1537; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_5 = __Pyx_PyString_Format(__pyx_kp_s_Invalid_window_size_d, __pyx_t_2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1537; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "pandas/algos.pyx":1536
 * 
 *     if window < 1:
 *         raise ValueError('Invalid window size %d'             # <<<<<<<<<<<<<<
 *                          % (window))
 * 
 */
    __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1536; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__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 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_2, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1536; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__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 = 1536; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }

  /* "pandas/algos.pyx":1539
 *                          % (window))
 * 
 *     if minp > window:             # <<<<<<<<<<<<<<
 *         raise ValueError('Invalid min_periods size %d greater than window %d'
 *                         % (minp, window))
 */
  __pyx_t_4 = ((__pyx_v_minp > __pyx_v_window) != 0);
  if (__pyx_t_4) {

    /* "pandas/algos.pyx":1541
 *     if minp > window:
 *         raise ValueError('Invalid min_periods size %d greater than window %d'
 *                         % (minp, window))             # <<<<<<<<<<<<<<
 * 
 *     minp = _check_minp(window, minp, n0)
 */
    __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_minp); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1541; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_window); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1541; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1541; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5);
    __Pyx_GIVEREF(__pyx_t_5);
    PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_2);
    __Pyx_GIVEREF(__pyx_t_2);
    __pyx_t_5 = 0;
    __pyx_t_2 = 0;
    __pyx_t_2 = __Pyx_PyString_Format(__pyx_kp_s_Invalid_min_periods_size_d_great, __pyx_t_6); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1541; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

    /* "pandas/algos.pyx":1540
 * 
 *     if minp > window:
 *         raise ValueError('Invalid min_periods size %d greater than window %d'             # <<<<<<<<<<<<<<
 *                         % (minp, window))
 * 
 */
    __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1540; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__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 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1540; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__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[0]; __pyx_lineno = 1540; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }

  /* "pandas/algos.pyx":1543
 *                         % (minp, window))
 * 
 *     minp = _check_minp(window, minp, n0)             # <<<<<<<<<<<<<<
 * 
 *     window = min(window, n0)
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_check_minp); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1543; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_v_window); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1543; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_minp); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1543; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_7 = PyInt_FromSsize_t(__pyx_v_n0); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1543; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_8 = PyTuple_New(3); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1543; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_8);
  PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_6);
  __Pyx_GIVEREF(__pyx_t_6);
  PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_5);
  __Pyx_GIVEREF(__pyx_t_5);
  PyTuple_SET_ITEM(__pyx_t_8, 2, __pyx_t_7);
  __Pyx_GIVEREF(__pyx_t_7);
  __pyx_t_6 = 0;
  __pyx_t_5 = 0;
  __pyx_t_7 = 0;
  __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_8, NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1543; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  __pyx_t_9 = __Pyx_PyInt_As_int(__pyx_t_7); if (unlikely((__pyx_t_9 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1543; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __pyx_v_minp = __pyx_t_9;

  /* "pandas/algos.pyx":1545
 *     minp = _check_minp(window, minp, n0)
 * 
 *     window = min(window, n0)             # <<<<<<<<<<<<<<
 * 
 *     ring = <pairs*>stdlib.malloc(window * sizeof(pairs))
 */
  __pyx_t_10 = __pyx_v_n0;
  __pyx_t_9 = __pyx_v_window;
  if (((__pyx_t_10 < __pyx_t_9) != 0)) {
    __pyx_t_11 = __pyx_t_10;
  } else {
    __pyx_t_11 = __pyx_t_9;
  }
  __pyx_v_window = __pyx_t_11;

  /* "pandas/algos.pyx":1547
 *     window = min(window, n0)
 * 
 *     ring = <pairs*>stdlib.malloc(window * sizeof(pairs))             # <<<<<<<<<<<<<<
 *     end = ring + window
 *     last = ring
 */
  __pyx_v_ring = ((struct __pyx_t_6pandas_5algos_pairs *)malloc((__pyx_v_window * (sizeof(struct __pyx_t_6pandas_5algos_pairs)))));

  /* "pandas/algos.pyx":1548
 * 
 *     ring = <pairs*>stdlib.malloc(window * sizeof(pairs))
 *     end = ring + window             # <<<<<<<<<<<<<<
 *     last = ring
 * 
 */
  __pyx_v_end = (__pyx_v_ring + __pyx_v_window);

  /* "pandas/algos.pyx":1549
 *     ring = <pairs*>stdlib.malloc(window * sizeof(pairs))
 *     end = ring + window
 *     last = ring             # <<<<<<<<<<<<<<
 * 
 *     minpair = ring
 */
  __pyx_v_last = __pyx_v_ring;

  /* "pandas/algos.pyx":1551
 *     last = ring
 * 
 *     minpair = ring             # <<<<<<<<<<<<<<
 *     ai = a[0]
 *     if ai == ai:
 */
  __pyx_v_minpair = __pyx_v_ring;

  /* "pandas/algos.pyx":1552
 * 
 *     minpair = ring
 *     ai = a[0]             # <<<<<<<<<<<<<<
 *     if ai == ai:
 *         minpair.value = ai
 */
  __pyx_t_12 = 0;
  __pyx_v_ai = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_a.rcbuffer->pybuffer.buf, __pyx_t_12, __pyx_pybuffernd_a.diminfo[0].strides));

  /* "pandas/algos.pyx":1553
 *     minpair = ring
 *     ai = a[0]
 *     if ai == ai:             # <<<<<<<<<<<<<<
 *         minpair.value = ai
 *     else:
 */
  __pyx_t_4 = ((__pyx_v_ai == __pyx_v_ai) != 0);
  if (__pyx_t_4) {

    /* "pandas/algos.pyx":1554
 *     ai = a[0]
 *     if ai == ai:
 *         minpair.value = ai             # <<<<<<<<<<<<<<
 *     else:
 *         minpair.value = MINfloat64
 */
    __pyx_v_minpair->value = __pyx_v_ai;
    goto __pyx_L5;
  }
  /*else*/ {

    /* "pandas/algos.pyx":1556
 *         minpair.value = ai
 *     else:
 *         minpair.value = MINfloat64             # <<<<<<<<<<<<<<
 *     minpair.death = window
 * 
 */
    __pyx_v_minpair->value = __pyx_v_6pandas_5algos_MINfloat64;
  }
  __pyx_L5:;

  /* "pandas/algos.pyx":1557
 *     else:
 *         minpair.value = MINfloat64
 *     minpair.death = window             # <<<<<<<<<<<<<<
 * 
 *     count = 0
 */
  __pyx_v_minpair->death = __pyx_v_window;

  /* "pandas/algos.pyx":1559
 *     minpair.death = window
 * 
 *     count = 0             # <<<<<<<<<<<<<<
 *     for i0 in range(n0):
 *         ai = a[i0]
 */
  __pyx_v_count = 0;

  /* "pandas/algos.pyx":1560
 * 
 *     count = 0
 *     for i0 in range(n0):             # <<<<<<<<<<<<<<
 *         ai = a[i0]
 *         if ai == ai:
 */
  __pyx_t_11 = __pyx_v_n0;
  for (__pyx_t_10 = 0; __pyx_t_10 < __pyx_t_11; __pyx_t_10+=1) {
    __pyx_v_i0 = __pyx_t_10;

    /* "pandas/algos.pyx":1561
 *     count = 0
 *     for i0 in range(n0):
 *         ai = a[i0]             # <<<<<<<<<<<<<<
 *         if ai == ai:
 *             count += 1
 */
    __pyx_t_13 = __pyx_v_i0;
    __pyx_v_ai = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_a.rcbuffer->pybuffer.buf, __pyx_t_13, __pyx_pybuffernd_a.diminfo[0].strides));

    /* "pandas/algos.pyx":1562
 *     for i0 in range(n0):
 *         ai = a[i0]
 *         if ai == ai:             # <<<<<<<<<<<<<<
 *             count += 1
 *         else:
 */
    __pyx_t_4 = ((__pyx_v_ai == __pyx_v_ai) != 0);
    if (__pyx_t_4) {

      /* "pandas/algos.pyx":1563
 *         ai = a[i0]
 *         if ai == ai:
 *             count += 1             # <<<<<<<<<<<<<<
 *         else:
 *             ai = MINfloat64
 */
      __pyx_v_count = (__pyx_v_count + 1);
      goto __pyx_L8;
    }
    /*else*/ {

      /* "pandas/algos.pyx":1565
 *             count += 1
 *         else:
 *             ai = MINfloat64             # <<<<<<<<<<<<<<
 *         if i0 >= window:
 *             aold = a[i0 - window]
 */
      __pyx_v_ai = __pyx_v_6pandas_5algos_MINfloat64;
    }
    __pyx_L8:;

    /* "pandas/algos.pyx":1566
 *         else:
 *             ai = MINfloat64
 *         if i0 >= window:             # <<<<<<<<<<<<<<
 *             aold = a[i0 - window]
 *             if aold == aold:
 */
    __pyx_t_4 = ((__pyx_v_i0 >= __pyx_v_window) != 0);
    if (__pyx_t_4) {

      /* "pandas/algos.pyx":1567
 *             ai = MINfloat64
 *         if i0 >= window:
 *             aold = a[i0 - window]             # <<<<<<<<<<<<<<
 *             if aold == aold:
 *                 count -= 1
 */
      __pyx_t_14 = (__pyx_v_i0 - __pyx_v_window);
      __pyx_v_aold = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_a.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_a.diminfo[0].strides));

      /* "pandas/algos.pyx":1568
 *         if i0 >= window:
 *             aold = a[i0 - window]
 *             if aold == aold:             # <<<<<<<<<<<<<<
 *                 count -= 1
 *         if minpair.death == i0:
 */
      __pyx_t_4 = ((__pyx_v_aold == __pyx_v_aold) != 0);
      if (__pyx_t_4) {

        /* "pandas/algos.pyx":1569
 *             aold = a[i0 - window]
 *             if aold == aold:
 *                 count -= 1             # <<<<<<<<<<<<<<
 *         if minpair.death == i0:
 *             minpair += 1
 */
        __pyx_v_count = (__pyx_v_count - 1);
        goto __pyx_L10;
      }
      __pyx_L10:;
      goto __pyx_L9;
    }
    __pyx_L9:;

    /* "pandas/algos.pyx":1570
 *             if aold == aold:
 *                 count -= 1
 *         if minpair.death == i0:             # <<<<<<<<<<<<<<
 *             minpair += 1
 *             if minpair >= end:
 */
    __pyx_t_4 = ((__pyx_v_minpair->death == __pyx_v_i0) != 0);
    if (__pyx_t_4) {

      /* "pandas/algos.pyx":1571
 *                 count -= 1
 *         if minpair.death == i0:
 *             minpair += 1             # <<<<<<<<<<<<<<
 *             if minpair >= end:
 *                 minpair = ring
 */
      __pyx_v_minpair = (__pyx_v_minpair + 1);

      /* "pandas/algos.pyx":1572
 *         if minpair.death == i0:
 *             minpair += 1
 *             if minpair >= end:             # <<<<<<<<<<<<<<
 *                 minpair = ring
 *         if ai >= minpair.value:
 */
      __pyx_t_4 = ((__pyx_v_minpair >= __pyx_v_end) != 0);
      if (__pyx_t_4) {

        /* "pandas/algos.pyx":1573
 *             minpair += 1
 *             if minpair >= end:
 *                 minpair = ring             # <<<<<<<<<<<<<<
 *         if ai >= minpair.value:
 *             minpair.value = ai
 */
        __pyx_v_minpair = __pyx_v_ring;
        goto __pyx_L12;
      }
      __pyx_L12:;
      goto __pyx_L11;
    }
    __pyx_L11:;

    /* "pandas/algos.pyx":1574
 *             if minpair >= end:
 *                 minpair = ring
 *         if ai >= minpair.value:             # <<<<<<<<<<<<<<
 *             minpair.value = ai
 *             minpair.death = i0 + window
 */
    __pyx_t_4 = ((__pyx_v_ai >= __pyx_v_minpair->value) != 0);
    if (__pyx_t_4) {

      /* "pandas/algos.pyx":1575
 *                 minpair = ring
 *         if ai >= minpair.value:
 *             minpair.value = ai             # <<<<<<<<<<<<<<
 *             minpair.death = i0 + window
 *             last = minpair
 */
      __pyx_v_minpair->value = __pyx_v_ai;

      /* "pandas/algos.pyx":1576
 *         if ai >= minpair.value:
 *             minpair.value = ai
 *             minpair.death = i0 + window             # <<<<<<<<<<<<<<
 *             last = minpair
 *         else:
 */
      __pyx_v_minpair->death = (__pyx_v_i0 + __pyx_v_window);

      /* "pandas/algos.pyx":1577
 *             minpair.value = ai
 *             minpair.death = i0 + window
 *             last = minpair             # <<<<<<<<<<<<<<
 *         else:
 *             while last.value <= ai:
 */
      __pyx_v_last = __pyx_v_minpair;
      goto __pyx_L13;
    }
    /*else*/ {

      /* "pandas/algos.pyx":1579
 *             last = minpair
 *         else:
 *             while last.value <= ai:             # <<<<<<<<<<<<<<
 *                 if last == ring:
 *                     last = end
 */
      while (1) {
        __pyx_t_4 = ((__pyx_v_last->value <= __pyx_v_ai) != 0);
        if (!__pyx_t_4) break;

        /* "pandas/algos.pyx":1580
 *         else:
 *             while last.value <= ai:
 *                 if last == ring:             # <<<<<<<<<<<<<<
 *                     last = end
 *                 last -= 1
 */
        __pyx_t_4 = ((__pyx_v_last == __pyx_v_ring) != 0);
        if (__pyx_t_4) {

          /* "pandas/algos.pyx":1581
 *             while last.value <= ai:
 *                 if last == ring:
 *                     last = end             # <<<<<<<<<<<<<<
 *                 last -= 1
 *             last += 1
 */
          __pyx_v_last = __pyx_v_end;
          goto __pyx_L16;
        }
        __pyx_L16:;

        /* "pandas/algos.pyx":1582
 *                 if last == ring:
 *                     last = end
 *                 last -= 1             # <<<<<<<<<<<<<<
 *             last += 1
 *             if last == end:
 */
        __pyx_v_last = (__pyx_v_last - 1);
      }

      /* "pandas/algos.pyx":1583
 *                     last = end
 *                 last -= 1
 *             last += 1             # <<<<<<<<<<<<<<
 *             if last == end:
 *                 last = ring
 */
      __pyx_v_last = (__pyx_v_last + 1);

      /* "pandas/algos.pyx":1584
 *                 last -= 1
 *             last += 1
 *             if last == end:             # <<<<<<<<<<<<<<
 *                 last = ring
 *             last.value = ai
 */
      __pyx_t_4 = ((__pyx_v_last == __pyx_v_end) != 0);
      if (__pyx_t_4) {

        /* "pandas/algos.pyx":1585
 *             last += 1
 *             if last == end:
 *                 last = ring             # <<<<<<<<<<<<<<
 *             last.value = ai
 *             last.death = i0 + window
 */
        __pyx_v_last = __pyx_v_ring;
        goto __pyx_L17;
      }
      __pyx_L17:;

      /* "pandas/algos.pyx":1586
 *             if last == end:
 *                 last = ring
 *             last.value = ai             # <<<<<<<<<<<<<<
 *             last.death = i0 + window
 *         if count >= minp:
 */
      __pyx_v_last->value = __pyx_v_ai;

      /* "pandas/algos.pyx":1587
 *                 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_L13:;

    /* "pandas/algos.pyx":1588
 *             last.value = ai
 *             last.death = i0 + window
 *         if count >= minp:             # <<<<<<<<<<<<<<
 *             y[i0] = minpair.value
 *         else:
 */
    __pyx_t_4 = ((__pyx_v_count >= __pyx_v_minp) != 0);
    if (__pyx_t_4) {

      /* "pandas/algos.pyx":1589
 *             last.death = i0 + window
 *         if count >= minp:
 *             y[i0] = minpair.value             # <<<<<<<<<<<<<<
 *         else:
 *             y[i0] = NaN
 */
      __pyx_t_15 = __pyx_v_minpair->value;
      __pyx_t_16 = __pyx_v_i0;
      *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_y.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_y.diminfo[0].strides) = __pyx_t_15;
      goto __pyx_L18;
    }
    /*else*/ {

      /* "pandas/algos.pyx":1591
 *             y[i0] = minpair.value
 *         else:
 *             y[i0] = NaN             # <<<<<<<<<<<<<<
 * 
 *     for i0 in range(minp - 1):
 */
      __pyx_t_17 = __pyx_v_i0;
      *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_y.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_y.diminfo[0].strides) = __pyx_v_6pandas_5algos_NaN;
    }
    __pyx_L18:;
  }

  /* "pandas/algos.pyx":1593
 *             y[i0] = NaN
 * 
 *     for i0 in range(minp - 1):             # <<<<<<<<<<<<<<
 *         y[i0] = NaN
 * 
 */
  __pyx_t_18 = (__pyx_v_minp - 1);
  for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_18; __pyx_t_11+=1) {
    __pyx_v_i0 = __pyx_t_11;

    /* "pandas/algos.pyx":1594
 * 
 *     for i0 in range(minp - 1):
 *         y[i0] = NaN             # <<<<<<<<<<<<<<
 * 
 *     stdlib.free(ring)
 */
    __pyx_t_10 = __pyx_v_i0;
    *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_y.rcbuffer->pybuffer.buf, __pyx_t_10, __pyx_pybuffernd_y.diminfo[0].strides) = __pyx_v_6pandas_5algos_NaN;
  }

  /* "pandas/algos.pyx":1596
 *         y[i0] = NaN
 * 
 *     stdlib.free(ring)             # <<<<<<<<<<<<<<
 *     return y
 * 
 */
  free(__pyx_v_ring);

  /* "pandas/algos.pyx":1597
 * 
 *     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;

  /* "pandas/algos.pyx":1519
 * @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
 */

  /* function exit code */
  __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_pybuffernd_a.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_y.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas.algos.roll_max2", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_a.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_y.rcbuffer->pybuffer);
  __pyx_L2:;
  __Pyx_XDECREF((PyObject *)__pyx_v_y);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/algos.pyx":1599
 *     return y
 * 
 * def roll_max(ndarray input, int win, int minp):             # <<<<<<<<<<<<<<
 *     '''
 *     O(N log(window)) implementation using skip list
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pandas_5algos_45roll_max(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6pandas_5algos_44roll_max[] = "\n    O(N log(window)) implementation using skip list\n    ";
static PyMethodDef __pyx_mdef_6pandas_5algos_45roll_max = {__Pyx_NAMESTR("roll_max"), (PyCFunction)__pyx_pw_6pandas_5algos_45roll_max, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6pandas_5algos_44roll_max)};
static PyObject *__pyx_pw_6pandas_5algos_45roll_max(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyArrayObject *__pyx_v_input = 0;
  int __pyx_v_win;
  int __pyx_v_minp;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("roll_max (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_input,&__pyx_n_s_win,&__pyx_n_s_minp,0};
    PyObject* values[3] = {0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_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 (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_input)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_win)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("roll_max", 1, 3, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1599; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_minp)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("roll_max", 1, 3, 3, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1599; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "roll_max") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1599; __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_As_int(values[1]); if (unlikely((__pyx_v_win == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1599; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_v_minp = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_minp == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1599; __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[0]; __pyx_lineno = 1599; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas.algos.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[0]; __pyx_lineno = 1599; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_44roll_max(__pyx_self, __pyx_v_input, __pyx_v_win, __pyx_v_minp);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pandas_5algos_44roll_max(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_input, 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;
  __Pyx_RefNannySetupContext("roll_max", 0);

  /* "pandas/algos.pyx":1603
 *     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_5algos__roll_skiplist_op(__pyx_v_input, __pyx_v_win, __pyx_v_minp, __pyx_f_6pandas_5algos__get_max); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1603; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pandas/algos.pyx":1599
 *     return y
 * 
 * def roll_max(ndarray input, int win, int minp):             # <<<<<<<<<<<<<<
 *     '''
 *     O(N log(window)) implementation using skip list
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pandas.algos.roll_max", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/algos.pyx":1606
 * 
 * 
 * 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_5algos__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", 0);

  /* "pandas/algos.pyx":1607
 * 
 * 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) != 0);
  if (__pyx_t_1) {

    /* "pandas/algos.pyx":1608
 * 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 = __Pyx_PyObject_GetAttrStr(__pyx_v_skiplist, __pyx_n_s_get); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1608; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = __Pyx_PyInt_From_long((__pyx_v_nobs - 1)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1608; __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 = 1608; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__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 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1608; __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_5 = __pyx_PyFloat_AsDouble(__pyx_t_3); if (unlikely((__pyx_t_5 == (npy_double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1608; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_r = __pyx_t_5;
    goto __pyx_L0;
  }
  /*else*/ {

    /* "pandas/algos.pyx":1610
 *         return <IndexableSkiplist> skiplist.get(nobs - 1)
 *     else:
 *         return NaN             # <<<<<<<<<<<<<<
 * 
 * def roll_min(ndarray input, int win, int minp):
 */
    __pyx_r = __pyx_v_6pandas_5algos_NaN;
    goto __pyx_L0;
  }

  /* "pandas/algos.pyx":1606
 * 
 * 
 * cdef double_t _get_max(object skiplist, int nobs, int minp):             # <<<<<<<<<<<<<<
 *     if nobs >= minp:
 *         return <IndexableSkiplist> skiplist.get(nobs - 1)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_WriteUnraisable("pandas.algos._get_max", __pyx_clineno, __pyx_lineno, __pyx_filename, 0);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/algos.pyx":1612
 *         return NaN
 * 
 * def roll_min(ndarray input, int win, int minp):             # <<<<<<<<<<<<<<
 *     '''
 *     O(N log(window)) implementation using skip list
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pandas_5algos_47roll_min(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6pandas_5algos_46roll_min[] = "\n    O(N log(window)) implementation using skip list\n    ";
static PyMethodDef __pyx_mdef_6pandas_5algos_47roll_min = {__Pyx_NAMESTR("roll_min"), (PyCFunction)__pyx_pw_6pandas_5algos_47roll_min, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6pandas_5algos_46roll_min)};
static PyObject *__pyx_pw_6pandas_5algos_47roll_min(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyArrayObject *__pyx_v_input = 0;
  int __pyx_v_win;
  int __pyx_v_minp;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("roll_min (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_input,&__pyx_n_s_win,&__pyx_n_s_minp,0};
    PyObject* values[3] = {0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_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 (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_input)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_win)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("roll_min", 1, 3, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1612; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_minp)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("roll_min", 1, 3, 3, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1612; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "roll_min") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1612; __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_As_int(values[1]); if (unlikely((__pyx_v_win == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1612; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_v_minp = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_minp == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1612; __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[0]; __pyx_lineno = 1612; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas.algos.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[0]; __pyx_lineno = 1612; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_46roll_min(__pyx_self, __pyx_v_input, __pyx_v_win, __pyx_v_minp);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pandas_5algos_46roll_min(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_input, 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;
  __Pyx_RefNannySetupContext("roll_min", 0);

  /* "pandas/algos.pyx":1616
 *     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_5algos__roll_skiplist_op(__pyx_v_input, __pyx_v_win, __pyx_v_minp, __pyx_f_6pandas_5algos__get_min); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1616; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pandas/algos.pyx":1612
 *         return NaN
 * 
 * def roll_min(ndarray input, int win, int minp):             # <<<<<<<<<<<<<<
 *     '''
 *     O(N log(window)) implementation using skip list
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pandas.algos.roll_min", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/algos.pyx":1620
 * @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
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pandas_5algos_49roll_min2(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6pandas_5algos_48roll_min2[] = "Moving min of 1d array of dtype=float64 along axis=0 ignoring NaNs.";
static PyMethodDef __pyx_mdef_6pandas_5algos_49roll_min2 = {__Pyx_NAMESTR("roll_min2"), (PyCFunction)__pyx_pw_6pandas_5algos_49roll_min2, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6pandas_5algos_48roll_min2)};
static PyObject *__pyx_pw_6pandas_5algos_49roll_min2(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyArrayObject *__pyx_v_a = 0;
  int __pyx_v_window;
  int __pyx_v_minp;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("roll_min2 (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_a,&__pyx_n_s_window,&__pyx_n_s_minp,0};
    PyObject* values[3] = {0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_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 (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_a)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_window)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("roll_min2", 1, 3, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1620; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_minp)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("roll_min2", 1, 3, 3, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1620; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "roll_min2") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1620; __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_As_int(values[1]); if (unlikely((__pyx_v_window == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1620; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_v_minp = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_minp == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1620; __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[0]; __pyx_lineno = 1620; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas.algos.roll_min2", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_a), __pyx_ptype_5numpy_ndarray, 1, "a", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1620; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_48roll_min2(__pyx_self, __pyx_v_a, __pyx_v_window, __pyx_v_minp);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pandas_5algos_48roll_min2(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_a, 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_5algos_pairs *__pyx_v_ring;
  struct __pyx_t_6pandas_5algos_pairs *__pyx_v_minpair;
  struct __pyx_t_6pandas_5algos_pairs *__pyx_v_end;
  struct __pyx_t_6pandas_5algos_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;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_a;
  __Pyx_Buffer __pyx_pybuffer_a;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_y;
  __Pyx_Buffer __pyx_pybuffer_y;
  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;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  Py_ssize_t __pyx_t_7;
  int __pyx_t_8;
  Py_ssize_t __pyx_t_9;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  long __pyx_t_12;
  Py_ssize_t __pyx_t_13;
  Py_ssize_t __pyx_t_14;
  double __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;
  __Pyx_RefNannySetupContext("roll_min2", 0);
  __pyx_pybuffer_y.pybuffer.buf = NULL;
  __pyx_pybuffer_y.refcount = 0;
  __pyx_pybuffernd_y.data = NULL;
  __pyx_pybuffernd_y.rcbuffer = &__pyx_pybuffer_y;
  __pyx_pybuffer_a.pybuffer.buf = NULL;
  __pyx_pybuffer_a.refcount = 0;
  __pyx_pybuffernd_a.data = NULL;
  __pyx_pybuffernd_a.rcbuffer = &__pyx_pybuffer_a;
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_a.rcbuffer->pybuffer, (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[0]; __pyx_lineno = 1620; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_a.diminfo[0].strides = __pyx_pybuffernd_a.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_a.diminfo[0].shape = __pyx_pybuffernd_a.rcbuffer->pybuffer.shape[0];

  /* "pandas/algos.pyx":1630
 *     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));

  /* "pandas/algos.pyx":1631
 *     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]);

  /* "pandas/algos.pyx":1632
 *     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;

  /* "pandas/algos.pyx":1633
 *     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_2 = PyArray_EMPTY(1, __pyx_v_dims, NPY_FLOAT64, 0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1633; __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[0]; __pyx_lineno = 1633; __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_pybuffernd_y.rcbuffer->pybuffer, (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_pybuffernd_y.rcbuffer->pybuffer.buf = NULL;
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1633; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    } else {__pyx_pybuffernd_y.diminfo[0].strides = __pyx_pybuffernd_y.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_y.diminfo[0].shape = __pyx_pybuffernd_y.rcbuffer->pybuffer.shape[0];
    }
  }
  __pyx_t_3 = 0;
  __pyx_v_y = ((PyArrayObject *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "pandas/algos.pyx":1636
 * 		NPY_float64, 0)
 * 
 *     if window < 1:             # <<<<<<<<<<<<<<
 *         raise ValueError('Invalid window size %d'
 *                          % (window))
 */
  __pyx_t_4 = ((__pyx_v_window < 1) != 0);
  if (__pyx_t_4) {

    /* "pandas/algos.pyx":1638
 *     if window < 1:
 *         raise ValueError('Invalid window size %d'
 *                          % (window))             # <<<<<<<<<<<<<<
 * 
 *     if minp > window:
 */
    __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_window); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1638; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_5 = __Pyx_PyString_Format(__pyx_kp_s_Invalid_window_size_d, __pyx_t_2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1638; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "pandas/algos.pyx":1637
 * 
 *     if window < 1:
 *         raise ValueError('Invalid window size %d'             # <<<<<<<<<<<<<<
 *                          % (window))
 * 
 */
    __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1637; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__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 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_2, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1637; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__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 = 1637; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }

  /* "pandas/algos.pyx":1640
 *                          % (window))
 * 
 *     if minp > window:             # <<<<<<<<<<<<<<
 *         raise ValueError('Invalid min_periods size %d greater than window %d'
 *                         % (minp, window))
 */
  __pyx_t_4 = ((__pyx_v_minp > __pyx_v_window) != 0);
  if (__pyx_t_4) {

    /* "pandas/algos.pyx":1642
 *     if minp > window:
 *         raise ValueError('Invalid min_periods size %d greater than window %d'
 *                         % (minp, window))             # <<<<<<<<<<<<<<
 * 
 *     window = min(window, n0)
 */
    __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_minp); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1642; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_window); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1642; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1642; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5);
    __Pyx_GIVEREF(__pyx_t_5);
    PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_2);
    __Pyx_GIVEREF(__pyx_t_2);
    __pyx_t_5 = 0;
    __pyx_t_2 = 0;
    __pyx_t_2 = __Pyx_PyString_Format(__pyx_kp_s_Invalid_min_periods_size_d_great, __pyx_t_6); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1642; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

    /* "pandas/algos.pyx":1641
 * 
 *     if minp > window:
 *         raise ValueError('Invalid min_periods size %d greater than window %d'             # <<<<<<<<<<<<<<
 *                         % (minp, window))
 * 
 */
    __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1641; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__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 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1641; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__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[0]; __pyx_lineno = 1641; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }

  /* "pandas/algos.pyx":1644
 *                         % (minp, window))
 * 
 *     window = min(window, n0)             # <<<<<<<<<<<<<<
 * 
 *     minp = _check_minp(window, minp, n0)
 */
  __pyx_t_7 = __pyx_v_n0;
  __pyx_t_8 = __pyx_v_window;
  if (((__pyx_t_7 < __pyx_t_8) != 0)) {
    __pyx_t_9 = __pyx_t_7;
  } else {
    __pyx_t_9 = __pyx_t_8;
  }
  __pyx_v_window = __pyx_t_9;

  /* "pandas/algos.pyx":1646
 *     window = min(window, n0)
 * 
 *     minp = _check_minp(window, minp, n0)             # <<<<<<<<<<<<<<
 * 
 *     ring = <pairs*>stdlib.malloc(window * sizeof(pairs))
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_check_minp); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1646; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_v_window); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1646; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_minp); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1646; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_10 = PyInt_FromSsize_t(__pyx_v_n0); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1646; __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[0]; __pyx_lineno = 1646; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_11);
  PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_6);
  __Pyx_GIVEREF(__pyx_t_6);
  PyTuple_SET_ITEM(__pyx_t_11, 1, __pyx_t_5);
  __Pyx_GIVEREF(__pyx_t_5);
  PyTuple_SET_ITEM(__pyx_t_11, 2, __pyx_t_10);
  __Pyx_GIVEREF(__pyx_t_10);
  __pyx_t_6 = 0;
  __pyx_t_5 = 0;
  __pyx_t_10 = 0;
  __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_11, NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1646; __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_11); __pyx_t_11 = 0;
  __pyx_t_8 = __Pyx_PyInt_As_int(__pyx_t_10); if (unlikely((__pyx_t_8 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1646; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  __pyx_v_minp = __pyx_t_8;

  /* "pandas/algos.pyx":1648
 *     minp = _check_minp(window, minp, n0)
 * 
 *     ring = <pairs*>stdlib.malloc(window * sizeof(pairs))             # <<<<<<<<<<<<<<
 *     end = ring + window
 *     last = ring
 */
  __pyx_v_ring = ((struct __pyx_t_6pandas_5algos_pairs *)malloc((__pyx_v_window * (sizeof(struct __pyx_t_6pandas_5algos_pairs)))));

  /* "pandas/algos.pyx":1649
 * 
 *     ring = <pairs*>stdlib.malloc(window * sizeof(pairs))
 *     end = ring + window             # <<<<<<<<<<<<<<
 *     last = ring
 * 
 */
  __pyx_v_end = (__pyx_v_ring + __pyx_v_window);

  /* "pandas/algos.pyx":1650
 *     ring = <pairs*>stdlib.malloc(window * sizeof(pairs))
 *     end = ring + window
 *     last = ring             # <<<<<<<<<<<<<<
 * 
 *     minpair = ring
 */
  __pyx_v_last = __pyx_v_ring;

  /* "pandas/algos.pyx":1652
 *     last = ring
 * 
 *     minpair = ring             # <<<<<<<<<<<<<<
 *     ai = a[0]
 *     if ai == ai:
 */
  __pyx_v_minpair = __pyx_v_ring;

  /* "pandas/algos.pyx":1653
 * 
 *     minpair = ring
 *     ai = a[0]             # <<<<<<<<<<<<<<
 *     if ai == ai:
 *         minpair.value = ai
 */
  __pyx_t_12 = 0;
  __pyx_v_ai = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_a.rcbuffer->pybuffer.buf, __pyx_t_12, __pyx_pybuffernd_a.diminfo[0].strides));

  /* "pandas/algos.pyx":1654
 *     minpair = ring
 *     ai = a[0]
 *     if ai == ai:             # <<<<<<<<<<<<<<
 *         minpair.value = ai
 *     else:
 */
  __pyx_t_4 = ((__pyx_v_ai == __pyx_v_ai) != 0);
  if (__pyx_t_4) {

    /* "pandas/algos.pyx":1655
 *     ai = a[0]
 *     if ai == ai:
 *         minpair.value = ai             # <<<<<<<<<<<<<<
 *     else:
 *         minpair.value = MAXfloat64
 */
    __pyx_v_minpair->value = __pyx_v_ai;
    goto __pyx_L5;
  }
  /*else*/ {

    /* "pandas/algos.pyx":1657
 *         minpair.value = ai
 *     else:
 *         minpair.value = MAXfloat64             # <<<<<<<<<<<<<<
 *     minpair.death = window
 * 
 */
    __pyx_v_minpair->value = __pyx_v_6pandas_5algos_MAXfloat64;
  }
  __pyx_L5:;

  /* "pandas/algos.pyx":1658
 *     else:
 *         minpair.value = MAXfloat64
 *     minpair.death = window             # <<<<<<<<<<<<<<
 * 
 *     count = 0
 */
  __pyx_v_minpair->death = __pyx_v_window;

  /* "pandas/algos.pyx":1660
 *     minpair.death = window
 * 
 *     count = 0             # <<<<<<<<<<<<<<
 *     for i0 in range(n0):
 *         ai = a[i0]
 */
  __pyx_v_count = 0;

  /* "pandas/algos.pyx":1661
 * 
 *     count = 0
 *     for i0 in range(n0):             # <<<<<<<<<<<<<<
 *         ai = a[i0]
 *         if ai == ai:
 */
  __pyx_t_9 = __pyx_v_n0;
  for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_9; __pyx_t_7+=1) {
    __pyx_v_i0 = __pyx_t_7;

    /* "pandas/algos.pyx":1662
 *     count = 0
 *     for i0 in range(n0):
 *         ai = a[i0]             # <<<<<<<<<<<<<<
 *         if ai == ai:
 *             count += 1
 */
    __pyx_t_13 = __pyx_v_i0;
    __pyx_v_ai = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_a.rcbuffer->pybuffer.buf, __pyx_t_13, __pyx_pybuffernd_a.diminfo[0].strides));

    /* "pandas/algos.pyx":1663
 *     for i0 in range(n0):
 *         ai = a[i0]
 *         if ai == ai:             # <<<<<<<<<<<<<<
 *             count += 1
 *         else:
 */
    __pyx_t_4 = ((__pyx_v_ai == __pyx_v_ai) != 0);
    if (__pyx_t_4) {

      /* "pandas/algos.pyx":1664
 *         ai = a[i0]
 *         if ai == ai:
 *             count += 1             # <<<<<<<<<<<<<<
 *         else:
 *             ai = MAXfloat64
 */
      __pyx_v_count = (__pyx_v_count + 1);
      goto __pyx_L8;
    }
    /*else*/ {

      /* "pandas/algos.pyx":1666
 *             count += 1
 *         else:
 *             ai = MAXfloat64             # <<<<<<<<<<<<<<
 *         if i0 >= window:
 *             aold = a[i0 - window]
 */
      __pyx_v_ai = __pyx_v_6pandas_5algos_MAXfloat64;
    }
    __pyx_L8:;

    /* "pandas/algos.pyx":1667
 *         else:
 *             ai = MAXfloat64
 *         if i0 >= window:             # <<<<<<<<<<<<<<
 *             aold = a[i0 - window]
 *             if aold == aold:
 */
    __pyx_t_4 = ((__pyx_v_i0 >= __pyx_v_window) != 0);
    if (__pyx_t_4) {

      /* "pandas/algos.pyx":1668
 *             ai = MAXfloat64
 *         if i0 >= window:
 *             aold = a[i0 - window]             # <<<<<<<<<<<<<<
 *             if aold == aold:
 *                 count -= 1
 */
      __pyx_t_14 = (__pyx_v_i0 - __pyx_v_window);
      __pyx_v_aold = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_a.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_a.diminfo[0].strides));

      /* "pandas/algos.pyx":1669
 *         if i0 >= window:
 *             aold = a[i0 - window]
 *             if aold == aold:             # <<<<<<<<<<<<<<
 *                 count -= 1
 *         if minpair.death == i0:
 */
      __pyx_t_4 = ((__pyx_v_aold == __pyx_v_aold) != 0);
      if (__pyx_t_4) {

        /* "pandas/algos.pyx":1670
 *             aold = a[i0 - window]
 *             if aold == aold:
 *                 count -= 1             # <<<<<<<<<<<<<<
 *         if minpair.death == i0:
 *             minpair += 1
 */
        __pyx_v_count = (__pyx_v_count - 1);
        goto __pyx_L10;
      }
      __pyx_L10:;
      goto __pyx_L9;
    }
    __pyx_L9:;

    /* "pandas/algos.pyx":1671
 *             if aold == aold:
 *                 count -= 1
 *         if minpair.death == i0:             # <<<<<<<<<<<<<<
 *             minpair += 1
 *             if minpair >= end:
 */
    __pyx_t_4 = ((__pyx_v_minpair->death == __pyx_v_i0) != 0);
    if (__pyx_t_4) {

      /* "pandas/algos.pyx":1672
 *                 count -= 1
 *         if minpair.death == i0:
 *             minpair += 1             # <<<<<<<<<<<<<<
 *             if minpair >= end:
 *                 minpair = ring
 */
      __pyx_v_minpair = (__pyx_v_minpair + 1);

      /* "pandas/algos.pyx":1673
 *         if minpair.death == i0:
 *             minpair += 1
 *             if minpair >= end:             # <<<<<<<<<<<<<<
 *                 minpair = ring
 *         if ai <= minpair.value:
 */
      __pyx_t_4 = ((__pyx_v_minpair >= __pyx_v_end) != 0);
      if (__pyx_t_4) {

        /* "pandas/algos.pyx":1674
 *             minpair += 1
 *             if minpair >= end:
 *                 minpair = ring             # <<<<<<<<<<<<<<
 *         if ai <= minpair.value:
 *             minpair.value = ai
 */
        __pyx_v_minpair = __pyx_v_ring;
        goto __pyx_L12;
      }
      __pyx_L12:;
      goto __pyx_L11;
    }
    __pyx_L11:;

    /* "pandas/algos.pyx":1675
 *             if minpair >= end:
 *                 minpair = ring
 *         if ai <= minpair.value:             # <<<<<<<<<<<<<<
 *             minpair.value = ai
 *             minpair.death = i0 + window
 */
    __pyx_t_4 = ((__pyx_v_ai <= __pyx_v_minpair->value) != 0);
    if (__pyx_t_4) {

      /* "pandas/algos.pyx":1676
 *                 minpair = ring
 *         if ai <= minpair.value:
 *             minpair.value = ai             # <<<<<<<<<<<<<<
 *             minpair.death = i0 + window
 *             last = minpair
 */
      __pyx_v_minpair->value = __pyx_v_ai;

      /* "pandas/algos.pyx":1677
 *         if ai <= minpair.value:
 *             minpair.value = ai
 *             minpair.death = i0 + window             # <<<<<<<<<<<<<<
 *             last = minpair
 *         else:
 */
      __pyx_v_minpair->death = (__pyx_v_i0 + __pyx_v_window);

      /* "pandas/algos.pyx":1678
 *             minpair.value = ai
 *             minpair.death = i0 + window
 *             last = minpair             # <<<<<<<<<<<<<<
 *         else:
 *             while last.value >= ai:
 */
      __pyx_v_last = __pyx_v_minpair;
      goto __pyx_L13;
    }
    /*else*/ {

      /* "pandas/algos.pyx":1680
 *             last = minpair
 *         else:
 *             while last.value >= ai:             # <<<<<<<<<<<<<<
 *                 if last == ring:
 *                     last = end
 */
      while (1) {
        __pyx_t_4 = ((__pyx_v_last->value >= __pyx_v_ai) != 0);
        if (!__pyx_t_4) break;

        /* "pandas/algos.pyx":1681
 *         else:
 *             while last.value >= ai:
 *                 if last == ring:             # <<<<<<<<<<<<<<
 *                     last = end
 *                 last -= 1
 */
        __pyx_t_4 = ((__pyx_v_last == __pyx_v_ring) != 0);
        if (__pyx_t_4) {

          /* "pandas/algos.pyx":1682
 *             while last.value >= ai:
 *                 if last == ring:
 *                     last = end             # <<<<<<<<<<<<<<
 *                 last -= 1
 *             last += 1
 */
          __pyx_v_last = __pyx_v_end;
          goto __pyx_L16;
        }
        __pyx_L16:;

        /* "pandas/algos.pyx":1683
 *                 if last == ring:
 *                     last = end
 *                 last -= 1             # <<<<<<<<<<<<<<
 *             last += 1
 *             if last == end:
 */
        __pyx_v_last = (__pyx_v_last - 1);
      }

      /* "pandas/algos.pyx":1684
 *                     last = end
 *                 last -= 1
 *             last += 1             # <<<<<<<<<<<<<<
 *             if last == end:
 *                 last = ring
 */
      __pyx_v_last = (__pyx_v_last + 1);

      /* "pandas/algos.pyx":1685
 *                 last -= 1
 *             last += 1
 *             if last == end:             # <<<<<<<<<<<<<<
 *                 last = ring
 *             last.value = ai
 */
      __pyx_t_4 = ((__pyx_v_last == __pyx_v_end) != 0);
      if (__pyx_t_4) {

        /* "pandas/algos.pyx":1686
 *             last += 1
 *             if last == end:
 *                 last = ring             # <<<<<<<<<<<<<<
 *             last.value = ai
 *             last.death = i0 + window
 */
        __pyx_v_last = __pyx_v_ring;
        goto __pyx_L17;
      }
      __pyx_L17:;

      /* "pandas/algos.pyx":1687
 *             if last == end:
 *                 last = ring
 *             last.value = ai             # <<<<<<<<<<<<<<
 *             last.death = i0 + window
 *         if count >= minp:
 */
      __pyx_v_last->value = __pyx_v_ai;

      /* "pandas/algos.pyx":1688
 *                 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_L13:;

    /* "pandas/algos.pyx":1689
 *             last.value = ai
 *             last.death = i0 + window
 *         if count >= minp:             # <<<<<<<<<<<<<<
 *             y[i0] = minpair.value
 *         else:
 */
    __pyx_t_4 = ((__pyx_v_count >= __pyx_v_minp) != 0);
    if (__pyx_t_4) {

      /* "pandas/algos.pyx":1690
 *             last.death = i0 + window
 *         if count >= minp:
 *             y[i0] = minpair.value             # <<<<<<<<<<<<<<
 *         else:
 *             y[i0] = NaN
 */
      __pyx_t_15 = __pyx_v_minpair->value;
      __pyx_t_16 = __pyx_v_i0;
      *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_y.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_y.diminfo[0].strides) = __pyx_t_15;
      goto __pyx_L18;
    }
    /*else*/ {

      /* "pandas/algos.pyx":1692
 *             y[i0] = minpair.value
 *         else:
 *             y[i0] = NaN             # <<<<<<<<<<<<<<
 * 
 *     for i0 in range(minp - 1):
 */
      __pyx_t_17 = __pyx_v_i0;
      *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_y.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_y.diminfo[0].strides) = __pyx_v_6pandas_5algos_NaN;
    }
    __pyx_L18:;
  }

  /* "pandas/algos.pyx":1694
 *             y[i0] = NaN
 * 
 *     for i0 in range(minp - 1):             # <<<<<<<<<<<<<<
 *         y[i0] = NaN
 * 
 */
  __pyx_t_18 = (__pyx_v_minp - 1);
  for (__pyx_t_9 = 0; __pyx_t_9 < __pyx_t_18; __pyx_t_9+=1) {
    __pyx_v_i0 = __pyx_t_9;

    /* "pandas/algos.pyx":1695
 * 
 *     for i0 in range(minp - 1):
 *         y[i0] = NaN             # <<<<<<<<<<<<<<
 * 
 *     stdlib.free(ring)
 */
    __pyx_t_7 = __pyx_v_i0;
    *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_y.rcbuffer->pybuffer.buf, __pyx_t_7, __pyx_pybuffernd_y.diminfo[0].strides) = __pyx_v_6pandas_5algos_NaN;
  }

  /* "pandas/algos.pyx":1697
 *         y[i0] = NaN
 * 
 *     stdlib.free(ring)             # <<<<<<<<<<<<<<
 *     return y
 * 
 */
  free(__pyx_v_ring);

  /* "pandas/algos.pyx":1698
 * 
 *     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;

  /* "pandas/algos.pyx":1620
 * @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
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __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_pybuffernd_a.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_y.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas.algos.roll_min2", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_a.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_y.rcbuffer->pybuffer);
  __pyx_L2:;
  __Pyx_XDECREF((PyObject *)__pyx_v_y);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/algos.pyx":1700
 *     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_5algos__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", 0);

  /* "pandas/algos.pyx":1701
 * 
 * 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) != 0);
  if (__pyx_t_1) {

    /* "pandas/algos.pyx":1702
 * 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 = __Pyx_PyObject_GetAttrStr(__pyx_v_skiplist, __pyx_n_s_get); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1702; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__44, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1702; __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[0]; __pyx_lineno = 1702; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_r = __pyx_t_4;
    goto __pyx_L0;
  }
  /*else*/ {

    /* "pandas/algos.pyx":1704
 *         return <IndexableSkiplist> skiplist.get(0)
 *     else:
 *         return NaN             # <<<<<<<<<<<<<<
 * 
 * def roll_quantile(ndarray[float64_t, cast=True] input, int win,
 */
    __pyx_r = __pyx_v_6pandas_5algos_NaN;
    goto __pyx_L0;
  }

  /* "pandas/algos.pyx":1700
 *     return y
 * 
 * cdef double_t _get_min(object skiplist, int nobs, int minp):             # <<<<<<<<<<<<<<
 *     if nobs >= minp:
 *         return <IndexableSkiplist> skiplist.get(0)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_WriteUnraisable("pandas.algos._get_min", __pyx_clineno, __pyx_lineno, __pyx_filename, 0);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/algos.pyx":1706
 *         return NaN
 * 
 * def roll_quantile(ndarray[float64_t, cast=True] input, int win,             # <<<<<<<<<<<<<<
 *                   int minp, double quantile):
 *     '''
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pandas_5algos_51roll_quantile(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6pandas_5algos_50roll_quantile[] = "\n    O(N log(window)) implementation using skip list\n    ";
static PyMethodDef __pyx_mdef_6pandas_5algos_51roll_quantile = {__Pyx_NAMESTR("roll_quantile"), (PyCFunction)__pyx_pw_6pandas_5algos_51roll_quantile, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6pandas_5algos_50roll_quantile)};
static PyObject *__pyx_pw_6pandas_5algos_51roll_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;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("roll_quantile (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_input,&__pyx_n_s_win,&__pyx_n_s_minp,&__pyx_n_s_quantile,0};
    PyObject* values[4] = {0,0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_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 (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_input)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_win)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("roll_quantile", 1, 4, 4, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1706; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_minp)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("roll_quantile", 1, 4, 4, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1706; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  3:
        if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_quantile)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("roll_quantile", 1, 4, 4, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1706; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "roll_quantile") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1706; __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_As_int(values[1]); if (unlikely((__pyx_v_win == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1706; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_v_minp = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_minp == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1707; __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[0]; __pyx_lineno = 1707; __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[0]; __pyx_lineno = 1706; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas.algos.roll_quantile", __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[0]; __pyx_lineno = 1706; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_50roll_quantile(__pyx_self, __pyx_v_input, __pyx_v_win, __pyx_v_minp, __pyx_v_quantile);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pandas_5algos_50roll_quantile(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_input, int __pyx_v_win, int __pyx_v_minp, double __pyx_v_quantile) {
  double __pyx_v_val;
  double __pyx_v_prev;
  struct __pyx_obj_6pandas_5algos_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;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_input;
  __Pyx_Buffer __pyx_pybuffer_input;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_output;
  __Pyx_Buffer __pyx_pybuffer_output;
  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;
  PyObject *__pyx_t_7 = NULL;
  int __pyx_t_8;
  long __pyx_t_9;
  int __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;
  __pyx_t_5numpy_double_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("roll_quantile", 0);
  __pyx_pybuffer_output.pybuffer.buf = NULL;
  __pyx_pybuffer_output.refcount = 0;
  __pyx_pybuffernd_output.data = NULL;
  __pyx_pybuffernd_output.rcbuffer = &__pyx_pybuffer_output;
  __pyx_pybuffer_input.pybuffer.buf = NULL;
  __pyx_pybuffer_input.refcount = 0;
  __pyx_pybuffernd_input.data = NULL;
  __pyx_pybuffernd_input.rcbuffer = &__pyx_pybuffer_input;
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_input.rcbuffer->pybuffer, (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[0]; __pyx_lineno = 1706; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_input.diminfo[0].strides = __pyx_pybuffernd_input.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_input.diminfo[0].shape = __pyx_pybuffernd_input.rcbuffer->pybuffer.shape[0];

  /* "pandas/algos.pyx":1713
 *     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;

  /* "pandas/algos.pyx":1714
 *     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[0]; __pyx_lineno = 1714; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_N = __pyx_t_1;

  /* "pandas/algos.pyx":1715
 *     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_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1715; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_empty); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1715; __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 = 1715; __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 = 1715; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__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 = 1715; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, ((PyObject *)((PyObject*)(&PyFloat_Type)))) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1715; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1715; __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_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__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 = 1715; __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_pybuffernd_output.rcbuffer->pybuffer, (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_pybuffernd_output.rcbuffer->pybuffer.buf = NULL;
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1715; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    } else {__pyx_pybuffernd_output.diminfo[0].strides = __pyx_pybuffernd_output.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_output.diminfo[0].shape = __pyx_pybuffernd_output.rcbuffer->pybuffer.shape[0];
    }
  }
  __pyx_t_6 = 0;
  __pyx_v_output = ((PyArrayObject *)__pyx_t_5);
  __pyx_t_5 = 0;

  /* "pandas/algos.pyx":1717
 *     cdef ndarray[double_t] output = np.empty(N, dtype=float)
 * 
 *     skiplist = IndexableSkiplist(win)             # <<<<<<<<<<<<<<
 * 
 *     minp = _check_minp(win, minp, N)
 */
  __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_win); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1717; __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[0]; __pyx_lineno = 1717; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__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 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_6pandas_5algos_IndexableSkiplist)), __pyx_t_2, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1717; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_skiplist = ((struct __pyx_obj_6pandas_5algos_IndexableSkiplist *)__pyx_t_5);
  __pyx_t_5 = 0;

  /* "pandas/algos.pyx":1719
 *     skiplist = IndexableSkiplist(win)
 * 
 *     minp = _check_minp(win, minp, N)             # <<<<<<<<<<<<<<
 * 
 *     for i from 0 <= i < minp - 1:
 */
  __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_check_minp); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1719; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_win); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1719; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_minp); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1719; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_N); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1719; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_7 = PyTuple_New(3); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1719; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__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_4);
  __Pyx_GIVEREF(__pyx_t_4);
  PyTuple_SET_ITEM(__pyx_t_7, 2, __pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_3);
  __pyx_t_2 = 0;
  __pyx_t_4 = 0;
  __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_7, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1719; __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_7); __pyx_t_7 = 0;
  __pyx_t_8 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_8 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1719; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_v_minp = __pyx_t_8;

  /* "pandas/algos.pyx":1721
 *     minp = _check_minp(win, minp, N)
 * 
 *     for i from 0 <= i < minp - 1:             # <<<<<<<<<<<<<<
 *         val = input[i]
 * 
 */
  __pyx_t_9 = (__pyx_v_minp - 1);
  for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_9; __pyx_v_i++) {

    /* "pandas/algos.pyx":1722
 * 
 *     for i from 0 <= i < minp - 1:
 *         val = input[i]             # <<<<<<<<<<<<<<
 * 
 *         # Not NaN
 */
    __pyx_t_1 = __pyx_v_i;
    __pyx_t_8 = -1;
    if (__pyx_t_1 < 0) {
      __pyx_t_1 += __pyx_pybuffernd_input.diminfo[0].shape;
      if (unlikely(__pyx_t_1 < 0)) __pyx_t_8 = 0;
    } else if (unlikely(__pyx_t_1 >= __pyx_pybuffernd_input.diminfo[0].shape)) __pyx_t_8 = 0;
    if (unlikely(__pyx_t_8 != -1)) {
      __Pyx_RaiseBufferIndexError(__pyx_t_8);
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1722; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_v_val = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_input.rcbuffer->pybuffer.buf, __pyx_t_1, __pyx_pybuffernd_input.diminfo[0].strides));

    /* "pandas/algos.pyx":1725
 * 
 *         # Not NaN
 *         if val == val:             # <<<<<<<<<<<<<<
 *             nobs += 1
 *             skiplist.insert(val)
 */
    __pyx_t_10 = ((__pyx_v_val == __pyx_v_val) != 0);
    if (__pyx_t_10) {

      /* "pandas/algos.pyx":1726
 *         # Not NaN
 *         if val == val:
 *             nobs += 1             # <<<<<<<<<<<<<<
 *             skiplist.insert(val)
 * 
 */
      __pyx_v_nobs = (__pyx_v_nobs + 1);

      /* "pandas/algos.pyx":1727
 *         if val == val:
 *             nobs += 1
 *             skiplist.insert(val)             # <<<<<<<<<<<<<<
 * 
 *         output[i] = NaN
 */
      __pyx_t_3 = ((struct __pyx_vtabstruct_6pandas_5algos_IndexableSkiplist *)__pyx_v_skiplist->__pyx_vtab)->insert(__pyx_v_skiplist, __pyx_v_val, 0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1727; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      goto __pyx_L5;
    }
    __pyx_L5:;

    /* "pandas/algos.pyx":1729
 *             skiplist.insert(val)
 * 
 *         output[i] = NaN             # <<<<<<<<<<<<<<
 * 
 *     for i from minp - 1 <= i < N:
 */
    __pyx_t_11 = __pyx_v_i;
    __pyx_t_8 = -1;
    if (__pyx_t_11 < 0) {
      __pyx_t_11 += __pyx_pybuffernd_output.diminfo[0].shape;
      if (unlikely(__pyx_t_11 < 0)) __pyx_t_8 = 0;
    } else if (unlikely(__pyx_t_11 >= __pyx_pybuffernd_output.diminfo[0].shape)) __pyx_t_8 = 0;
    if (unlikely(__pyx_t_8 != -1)) {
      __Pyx_RaiseBufferIndexError(__pyx_t_8);
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1729; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_double_t *, __pyx_pybuffernd_output.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_output.diminfo[0].strides) = __pyx_v_6pandas_5algos_NaN;
  }

  /* "pandas/algos.pyx":1731
 *         output[i] = NaN
 * 
 *     for i from minp - 1 <= i < N:             # <<<<<<<<<<<<<<
 *         val = input[i]
 * 
 */
  __pyx_t_12 = __pyx_v_N;
  for (__pyx_v_i = (__pyx_v_minp - 1); __pyx_v_i < __pyx_t_12; __pyx_v_i++) {

    /* "pandas/algos.pyx":1732
 * 
 *     for i from minp - 1 <= i < N:
 *         val = input[i]             # <<<<<<<<<<<<<<
 * 
 *         if i > win - 1:
 */
    __pyx_t_13 = __pyx_v_i;
    __pyx_t_8 = -1;
    if (__pyx_t_13 < 0) {
      __pyx_t_13 += __pyx_pybuffernd_input.diminfo[0].shape;
      if (unlikely(__pyx_t_13 < 0)) __pyx_t_8 = 0;
    } else if (unlikely(__pyx_t_13 >= __pyx_pybuffernd_input.diminfo[0].shape)) __pyx_t_8 = 0;
    if (unlikely(__pyx_t_8 != -1)) {
      __Pyx_RaiseBufferIndexError(__pyx_t_8);
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1732; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_v_val = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_input.rcbuffer->pybuffer.buf, __pyx_t_13, __pyx_pybuffernd_input.diminfo[0].strides));

    /* "pandas/algos.pyx":1734
 *         val = input[i]
 * 
 *         if i > win - 1:             # <<<<<<<<<<<<<<
 *             prev = input[i - win]
 * 
 */
    __pyx_t_10 = ((__pyx_v_i > (__pyx_v_win - 1)) != 0);
    if (__pyx_t_10) {

      /* "pandas/algos.pyx":1735
 * 
 *         if i > win - 1:
 *             prev = input[i - win]             # <<<<<<<<<<<<<<
 * 
 *             if prev == prev:
 */
      __pyx_t_14 = (__pyx_v_i - __pyx_v_win);
      __pyx_t_8 = -1;
      if (__pyx_t_14 < 0) {
        __pyx_t_14 += __pyx_pybuffernd_input.diminfo[0].shape;
        if (unlikely(__pyx_t_14 < 0)) __pyx_t_8 = 0;
      } else if (unlikely(__pyx_t_14 >= __pyx_pybuffernd_input.diminfo[0].shape)) __pyx_t_8 = 0;
      if (unlikely(__pyx_t_8 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_8);
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1735; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_v_prev = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_input.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_input.diminfo[0].strides));

      /* "pandas/algos.pyx":1737
 *             prev = input[i - win]
 * 
 *             if prev == prev:             # <<<<<<<<<<<<<<
 *                 skiplist.remove(prev)
 *                 nobs -= 1
 */
      __pyx_t_10 = ((__pyx_v_prev == __pyx_v_prev) != 0);
      if (__pyx_t_10) {

        /* "pandas/algos.pyx":1738
 * 
 *             if prev == prev:
 *                 skiplist.remove(prev)             # <<<<<<<<<<<<<<
 *                 nobs -= 1
 * 
 */
        __pyx_t_3 = ((struct __pyx_vtabstruct_6pandas_5algos_IndexableSkiplist *)__pyx_v_skiplist->__pyx_vtab)->remove(__pyx_v_skiplist, __pyx_v_prev, 0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1738; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

        /* "pandas/algos.pyx":1739
 *             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:;

    /* "pandas/algos.pyx":1741
 *                 nobs -= 1
 * 
 *         if val == val:             # <<<<<<<<<<<<<<
 *             nobs += 1
 *             skiplist.insert(val)
 */
    __pyx_t_10 = ((__pyx_v_val == __pyx_v_val) != 0);
    if (__pyx_t_10) {

      /* "pandas/algos.pyx":1742
 * 
 *         if val == val:
 *             nobs += 1             # <<<<<<<<<<<<<<
 *             skiplist.insert(val)
 * 
 */
      __pyx_v_nobs = (__pyx_v_nobs + 1);

      /* "pandas/algos.pyx":1743
 *         if val == val:
 *             nobs += 1
 *             skiplist.insert(val)             # <<<<<<<<<<<<<<
 * 
 *         if nobs >= minp:
 */
      __pyx_t_3 = ((struct __pyx_vtabstruct_6pandas_5algos_IndexableSkiplist *)__pyx_v_skiplist->__pyx_vtab)->insert(__pyx_v_skiplist, __pyx_v_val, 0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1743; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      goto __pyx_L10;
    }
    __pyx_L10:;

    /* "pandas/algos.pyx":1745
 *             skiplist.insert(val)
 * 
 *         if nobs >= minp:             # <<<<<<<<<<<<<<
 *             idx = int((quantile / 1.) * (nobs - 1))
 *             output[i] = skiplist.get(idx)
 */
    __pyx_t_10 = ((__pyx_v_nobs >= __pyx_v_minp) != 0);
    if (__pyx_t_10) {

      /* "pandas/algos.pyx":1746
 * 
 *         if nobs >= minp:
 *             idx = int((quantile / 1.) * (nobs - 1))             # <<<<<<<<<<<<<<
 *             output[i] = skiplist.get(idx)
 *         else:
 */
      __pyx_t_3 = PyFloat_FromDouble(((__pyx_v_quantile / 1.) * (__pyx_v_nobs - 1))); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1746; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1746; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_7);
      PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_3);
      __pyx_t_3 = 0;
      __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyInt_Type))), __pyx_t_7, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1746; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_XDECREF_SET(__pyx_v_idx, __pyx_t_3);
      __pyx_t_3 = 0;

      /* "pandas/algos.pyx":1747
 *         if nobs >= minp:
 *             idx = int((quantile / 1.) * (nobs - 1))
 *             output[i] = skiplist.get(idx)             # <<<<<<<<<<<<<<
 *         else:
 *             output[i] = NaN
 */
      __pyx_t_15 = __Pyx_PyIndex_AsSsize_t(__pyx_v_idx); if (unlikely((__pyx_t_15 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1747; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_t_3 = ((struct __pyx_vtabstruct_6pandas_5algos_IndexableSkiplist *)__pyx_v_skiplist->__pyx_vtab)->get(__pyx_v_skiplist, __pyx_t_15, 0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1747; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_16 = __pyx_PyFloat_AsDouble(__pyx_t_3); if (unlikely((__pyx_t_16 == (npy_double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1747; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_15 = __pyx_v_i;
      __pyx_t_8 = -1;
      if (__pyx_t_15 < 0) {
        __pyx_t_15 += __pyx_pybuffernd_output.diminfo[0].shape;
        if (unlikely(__pyx_t_15 < 0)) __pyx_t_8 = 0;
      } else if (unlikely(__pyx_t_15 >= __pyx_pybuffernd_output.diminfo[0].shape)) __pyx_t_8 = 0;
      if (unlikely(__pyx_t_8 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_8);
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1747; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_double_t *, __pyx_pybuffernd_output.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_output.diminfo[0].strides) = __pyx_t_16;
      goto __pyx_L11;
    }
    /*else*/ {

      /* "pandas/algos.pyx":1749
 *             output[i] = skiplist.get(idx)
 *         else:
 *             output[i] = NaN             # <<<<<<<<<<<<<<
 * 
 *     return output
 */
      __pyx_t_17 = __pyx_v_i;
      __pyx_t_8 = -1;
      if (__pyx_t_17 < 0) {
        __pyx_t_17 += __pyx_pybuffernd_output.diminfo[0].shape;
        if (unlikely(__pyx_t_17 < 0)) __pyx_t_8 = 0;
      } else if (unlikely(__pyx_t_17 >= __pyx_pybuffernd_output.diminfo[0].shape)) __pyx_t_8 = 0;
      if (unlikely(__pyx_t_8 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_8);
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1749; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_double_t *, __pyx_pybuffernd_output.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_output.diminfo[0].strides) = __pyx_v_6pandas_5algos_NaN;
    }
    __pyx_L11:;
  }

  /* "pandas/algos.pyx":1751
 *             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;

  /* "pandas/algos.pyx":1706
 *         return NaN
 * 
 * def roll_quantile(ndarray[float64_t, cast=True] input, int win,             # <<<<<<<<<<<<<<
 *                   int minp, double quantile):
 *     '''
 */

  /* function exit code */
  __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_7);
  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
    __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_input.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_output.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas.algos.roll_quantile", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_input.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_output.rcbuffer->pybuffer);
  __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;
}

/* "pandas/algos.pyx":1753
 *     return output
 * 
 * def roll_generic(ndarray[float64_t, cast=True] input, int win,             # <<<<<<<<<<<<<<
 *                  int minp, object func, object args, object kwargs):
 *     cdef ndarray[double_t] output, counts, bufarr
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pandas_5algos_53roll_generic(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_5algos_53roll_generic = {__Pyx_NAMESTR("roll_generic"), (PyCFunction)__pyx_pw_6pandas_5algos_53roll_generic, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pw_6pandas_5algos_53roll_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;
  PyObject *__pyx_v_args = 0;
  PyObject *__pyx_v_kwargs = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("roll_generic (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_input,&__pyx_n_s_win,&__pyx_n_s_minp,&__pyx_n_s_func,&__pyx_n_s_args,&__pyx_n_s_kwargs,0};
    PyObject* values[6] = {0,0,0,0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_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 (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_input)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_win)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("roll_generic", 1, 6, 6, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1753; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_minp)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("roll_generic", 1, 6, 6, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1753; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  3:
        if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_func)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("roll_generic", 1, 6, 6, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1753; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  4:
        if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_args)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("roll_generic", 1, 6, 6, 4); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1753; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  5:
        if (likely((values[5] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_kwargs)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("roll_generic", 1, 6, 6, 5); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1753; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "roll_generic") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1753; __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_input = ((PyArrayObject *)values[0]);
    __pyx_v_win = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_win == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1753; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_v_minp = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_minp == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1754; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_v_func = values[3];
    __pyx_v_args = values[4];
    __pyx_v_kwargs = values[5];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("roll_generic", 1, 6, 6, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1753; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas.algos.roll_generic", __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[0]; __pyx_lineno = 1753; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_52roll_generic(__pyx_self, __pyx_v_input, __pyx_v_win, __pyx_v_minp, __pyx_v_func, __pyx_v_args, __pyx_v_kwargs);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pandas_5algos_52roll_generic(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_input, int __pyx_v_win, int __pyx_v_minp, PyObject *__pyx_v_func, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs) {
  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;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_bufarr;
  __Pyx_Buffer __pyx_pybuffer_bufarr;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_counts;
  __Pyx_Buffer __pyx_pybuffer_counts;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_input;
  __Pyx_Buffer __pyx_pybuffer_input;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_output;
  __Pyx_Buffer __pyx_pybuffer_output;
  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;
  PyObject *__pyx_t_13 = NULL;
  PyArrayObject *__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;
  __Pyx_RefNannySetupContext("roll_generic", 0);
  __Pyx_INCREF((PyObject *)__pyx_v_input);
  __pyx_pybuffer_output.pybuffer.buf = NULL;
  __pyx_pybuffer_output.refcount = 0;
  __pyx_pybuffernd_output.data = NULL;
  __pyx_pybuffernd_output.rcbuffer = &__pyx_pybuffer_output;
  __pyx_pybuffer_counts.pybuffer.buf = NULL;
  __pyx_pybuffer_counts.refcount = 0;
  __pyx_pybuffernd_counts.data = NULL;
  __pyx_pybuffernd_counts.rcbuffer = &__pyx_pybuffer_counts;
  __pyx_pybuffer_bufarr.pybuffer.buf = NULL;
  __pyx_pybuffer_bufarr.refcount = 0;
  __pyx_pybuffernd_bufarr.data = NULL;
  __pyx_pybuffernd_bufarr.rcbuffer = &__pyx_pybuffer_bufarr;
  __pyx_pybuffer_input.pybuffer.buf = NULL;
  __pyx_pybuffer_input.refcount = 0;
  __pyx_pybuffernd_input.data = NULL;
  __pyx_pybuffernd_input.rcbuffer = &__pyx_pybuffer_input;
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_input.rcbuffer->pybuffer, (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[0]; __pyx_lineno = 1753; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_input.diminfo[0].strides = __pyx_pybuffernd_input.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_input.diminfo[0].shape = __pyx_pybuffernd_input.rcbuffer->pybuffer.shape[0];

  /* "pandas/algos.pyx":1760
 *     cdef float64_t *oldbuf
 * 
 *     if not input.flags.c_contiguous:             # <<<<<<<<<<<<<<
 *         input = input.copy('C')
 * 
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_input), __pyx_n_s_flags); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1760; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_c_contiguous); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1760; __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 = 1760; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_4 = ((!__pyx_t_3) != 0);
  if (__pyx_t_4) {

    /* "pandas/algos.pyx":1761
 * 
 *     if not input.flags.c_contiguous:
 *         input = input.copy('C')             # <<<<<<<<<<<<<<
 * 
 *     buf = <float64_t*> input.data
 */
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_input), __pyx_n_s_copy); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1761; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__45, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1761; __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[0]; __pyx_lineno = 1761; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_5 = ((PyArrayObject *)__pyx_t_1);
    {
      __Pyx_BufFmt_StackElem __pyx_stack[1];
      __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_input.rcbuffer->pybuffer);
      __pyx_t_6 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_input.rcbuffer->pybuffer, (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_pybuffernd_input.rcbuffer->pybuffer, (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_pybuffernd_input.diminfo[0].strides = __pyx_pybuffernd_input.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_input.diminfo[0].shape = __pyx_pybuffernd_input.rcbuffer->pybuffer.shape[0];
      if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1761; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_5 = 0;
    __Pyx_DECREF_SET(__pyx_v_input, ((PyArrayObject *)__pyx_t_1));
    __pyx_t_1 = 0;
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "pandas/algos.pyx":1763
 *         input = input.copy('C')
 * 
 *     buf = <float64_t*> input.data             # <<<<<<<<<<<<<<
 * 
 *     n = len(input)
 */
  __pyx_v_buf = ((__pyx_t_5numpy_float64_t *)__pyx_v_input->data);

  /* "pandas/algos.pyx":1765
 *     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[0]; __pyx_lineno = 1765; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_n = __pyx_t_10;

  /* "pandas/algos.pyx":1766
 * 
 *     n = len(input)
 *     if n == 0:             # <<<<<<<<<<<<<<
 *         return input
 * 
 */
  __pyx_t_4 = ((__pyx_v_n == 0) != 0);
  if (__pyx_t_4) {

    /* "pandas/algos.pyx":1767
 *     n = len(input)
 *     if n == 0:
 *         return input             # <<<<<<<<<<<<<<
 * 
 *     minp = _check_minp(win, minp, n)
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(((PyObject *)__pyx_v_input));
    __pyx_r = ((PyObject *)__pyx_v_input);
    goto __pyx_L0;
  }

  /* "pandas/algos.pyx":1769
 *         return input
 * 
 *     minp = _check_minp(win, minp, n)             # <<<<<<<<<<<<<<
 *     output = np.empty(n, dtype=float)
 *     counts = roll_sum(np.isfinite(input).astype(float), win, minp)
 */
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_check_minp); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1769; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_win); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1769; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_11 = __Pyx_PyInt_From_int(__pyx_v_minp); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1769; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_11);
  __pyx_t_12 = PyInt_FromSsize_t(__pyx_v_n); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1769; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_12);
  __pyx_t_13 = PyTuple_New(3); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1769; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_13);
  PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_13, 1, __pyx_t_11);
  __Pyx_GIVEREF(__pyx_t_11);
  PyTuple_SET_ITEM(__pyx_t_13, 2, __pyx_t_12);
  __Pyx_GIVEREF(__pyx_t_12);
  __pyx_t_2 = 0;
  __pyx_t_11 = 0;
  __pyx_t_12 = 0;
  __pyx_t_12 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_13, NULL); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1769; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_12);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  __pyx_t_6 = __Pyx_PyInt_As_int(__pyx_t_12); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1769; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
  __pyx_v_minp = __pyx_t_6;

  /* "pandas/algos.pyx":1770
 * 
 *     minp = _check_minp(win, minp, n)
 *     output = np.empty(n, dtype=float)             # <<<<<<<<<<<<<<
 *     counts = roll_sum(np.isfinite(input).astype(float), win, minp)
 * 
 */
  __pyx_t_12 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1770; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_12);
  __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_empty); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1770; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_13);
  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
  __pyx_t_12 = PyInt_FromSsize_t(__pyx_v_n); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1770; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_12);
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1770; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_1, 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[0]; __pyx_lineno = 1770; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_12);
  if (PyDict_SetItem(__pyx_t_12, __pyx_n_s_dtype, ((PyObject *)((PyObject*)(&PyFloat_Type)))) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1770; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_11 = __Pyx_PyObject_Call(__pyx_t_13, __pyx_t_1, __pyx_t_12); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1770; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_11);
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
  if (!(likely(((__pyx_t_11) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_11, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1770; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_14 = ((PyArrayObject *)__pyx_t_11);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_output.rcbuffer->pybuffer);
    __pyx_t_6 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_output.rcbuffer->pybuffer, (PyObject*)__pyx_t_14, &__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_pybuffernd_output.rcbuffer->pybuffer, (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_pybuffernd_output.diminfo[0].strides = __pyx_pybuffernd_output.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_output.diminfo[0].shape = __pyx_pybuffernd_output.rcbuffer->pybuffer.shape[0];
    if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1770; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_14 = 0;
  __pyx_v_output = ((PyArrayObject *)__pyx_t_11);
  __pyx_t_11 = 0;

  /* "pandas/algos.pyx":1771
 *     minp = _check_minp(win, 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_11 = __Pyx_GetModuleGlobalName(__pyx_n_s_roll_sum); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1771; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_11);
  __pyx_t_12 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1771; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_12);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_isfinite); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1771; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
  __pyx_t_12 = PyTuple_New(1); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1771; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_12);
  __Pyx_INCREF(((PyObject *)__pyx_v_input));
  PyTuple_SET_ITEM(__pyx_t_12, 0, ((PyObject *)__pyx_v_input));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_input));
  __pyx_t_13 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_12, NULL); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1771; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_13);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
  __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_n_s_astype); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1771; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_12);
  __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 = 1771; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_13);
  __Pyx_INCREF(((PyObject *)((PyObject*)(&PyFloat_Type))));
  PyTuple_SET_ITEM(__pyx_t_13, 0, ((PyObject *)((PyObject*)(&PyFloat_Type))));
  __Pyx_GIVEREF(((PyObject *)((PyObject*)(&PyFloat_Type))));
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_t_13, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1771; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  __pyx_t_13 = __Pyx_PyInt_From_int(__pyx_v_win); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1771; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_13);
  __pyx_t_12 = __Pyx_PyInt_From_int(__pyx_v_minp); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1771; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_12);
  __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1771; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_13);
  __Pyx_GIVEREF(__pyx_t_13);
  PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_t_12);
  __Pyx_GIVEREF(__pyx_t_12);
  __pyx_t_1 = 0;
  __pyx_t_13 = 0;
  __pyx_t_12 = 0;
  __pyx_t_12 = __Pyx_PyObject_Call(__pyx_t_11, __pyx_t_2, NULL); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1771; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_12);
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  __Pyx_DECREF(__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[0]; __pyx_lineno = 1771; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_14 = ((PyArrayObject *)__pyx_t_12);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_counts.rcbuffer->pybuffer);
    __pyx_t_6 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_counts.rcbuffer->pybuffer, (PyObject*)__pyx_t_14, &__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_pybuffernd_counts.rcbuffer->pybuffer, (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_pybuffernd_counts.diminfo[0].strides = __pyx_pybuffernd_counts.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_counts.diminfo[0].shape = __pyx_pybuffernd_counts.rcbuffer->pybuffer.shape[0];
    if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1771; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_14 = 0;
  __pyx_v_counts = ((PyArrayObject *)__pyx_t_12);
  __pyx_t_12 = 0;

  /* "pandas/algos.pyx":1773
 *     counts = roll_sum(np.isfinite(input).astype(float), win, minp)
 * 
 *     bufarr = np.empty(win, dtype=float)             # <<<<<<<<<<<<<<
 *     oldbuf = <float64_t*> bufarr.data
 * 
 */
  __pyx_t_12 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1773; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_12);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_empty); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1773; __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_From_int(__pyx_v_win); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1773; __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[0]; __pyx_lineno = 1773; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__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 = PyDict_New(); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1773; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_12);
  if (PyDict_SetItem(__pyx_t_12, __pyx_n_s_dtype, ((PyObject *)((PyObject*)(&PyFloat_Type)))) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1773; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_13 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_11, __pyx_t_12); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1773; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_13);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 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 = 1773; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_14 = ((PyArrayObject *)__pyx_t_13);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_bufarr.rcbuffer->pybuffer);
    __pyx_t_6 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_bufarr.rcbuffer->pybuffer, (PyObject*)__pyx_t_14, &__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_pybuffernd_bufarr.rcbuffer->pybuffer, (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_pybuffernd_bufarr.diminfo[0].strides = __pyx_pybuffernd_bufarr.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_bufarr.diminfo[0].shape = __pyx_pybuffernd_bufarr.rcbuffer->pybuffer.shape[0];
    if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1773; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_14 = 0;
  __pyx_v_bufarr = ((PyArrayObject *)__pyx_t_13);
  __pyx_t_13 = 0;

  /* "pandas/algos.pyx":1774
 * 
 *     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);

  /* "pandas/algos.pyx":1776
 *     oldbuf = <float64_t*> bufarr.data
 * 
 *     n = len(input)             # <<<<<<<<<<<<<<
 *     for i from 0 <= i < int_min(win, n):
 *         if counts[i] >= minp:
 */
  __pyx_t_10 = PyObject_Length(((PyObject *)__pyx_v_input)); if (unlikely(__pyx_t_10 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1776; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_n = __pyx_t_10;

  /* "pandas/algos.pyx":1777
 * 
 *     n = len(input)
 *     for i from 0 <= i < int_min(win, n):             # <<<<<<<<<<<<<<
 *         if counts[i] >= minp:
 *             output[i] = func(input[int_max(i - win + 1, 0) : i + 1], *args,
 */
  __pyx_t_6 = __pyx_f_6pandas_5algos_int_min(__pyx_v_win, __pyx_v_n);
  for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_6; __pyx_v_i++) {

    /* "pandas/algos.pyx":1778
 *     n = len(input)
 *     for i from 0 <= i < int_min(win, n):
 *         if counts[i] >= minp:             # <<<<<<<<<<<<<<
 *             output[i] = func(input[int_max(i - win + 1, 0) : i + 1], *args,
 *                              **kwargs)
 */
    __pyx_t_10 = __pyx_v_i;
    __pyx_t_15 = -1;
    if (__pyx_t_10 < 0) {
      __pyx_t_10 += __pyx_pybuffernd_counts.diminfo[0].shape;
      if (unlikely(__pyx_t_10 < 0)) __pyx_t_15 = 0;
    } else if (unlikely(__pyx_t_10 >= __pyx_pybuffernd_counts.diminfo[0].shape)) __pyx_t_15 = 0;
    if (unlikely(__pyx_t_15 != -1)) {
      __Pyx_RaiseBufferIndexError(__pyx_t_15);
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1778; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_4 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_double_t *, __pyx_pybuffernd_counts.rcbuffer->pybuffer.buf, __pyx_t_10, __pyx_pybuffernd_counts.diminfo[0].strides)) >= __pyx_v_minp) != 0);
    if (__pyx_t_4) {

      /* "pandas/algos.pyx":1779
 *     for i from 0 <= i < int_min(win, n):
 *         if counts[i] >= minp:
 *             output[i] = func(input[int_max(i - win + 1, 0) : i + 1], *args,             # <<<<<<<<<<<<<<
 *                              **kwargs)
 *         else:
 */
      __pyx_t_13 = __Pyx_PyObject_GetSlice(((PyObject *)__pyx_v_input), __pyx_f_6pandas_5algos_int_max(((__pyx_v_i - __pyx_v_win) + 1), 0), (__pyx_v_i + 1), NULL, NULL, NULL, 1, 1, 1); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1779; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_13);
      __pyx_t_12 = PyTuple_New(1); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1779; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_12);
      PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_13);
      __Pyx_GIVEREF(__pyx_t_13);
      __pyx_t_13 = 0;
      __pyx_t_13 = PySequence_Tuple(__pyx_v_args); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1779; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_13);
      __pyx_t_11 = PyNumber_Add(__pyx_t_12, __pyx_t_13); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1779; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_11);
      __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

      /* "pandas/algos.pyx":1780
 *         if counts[i] >= minp:
 *             output[i] = func(input[int_max(i - win + 1, 0) : i + 1], *args,
 *                              **kwargs)             # <<<<<<<<<<<<<<
 *         else:
 *             output[i] = NaN
 */
      if (unlikely(__pyx_v_kwargs == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "argument after ** must be a mapping, not NoneType");
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1780; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      if (likely(PyDict_Check(__pyx_v_kwargs))) {
        __pyx_t_13 = __pyx_v_kwargs;
        __Pyx_INCREF(__pyx_t_13);
      } else {
        __pyx_t_13 = PyObject_CallFunctionObjArgs((PyObject*)&PyDict_Type, __pyx_v_kwargs, NULL); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1779; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_13);
      }

      /* "pandas/algos.pyx":1779
 *     for i from 0 <= i < int_min(win, n):
 *         if counts[i] >= minp:
 *             output[i] = func(input[int_max(i - win + 1, 0) : i + 1], *args,             # <<<<<<<<<<<<<<
 *                              **kwargs)
 *         else:
 */
      __pyx_t_12 = __Pyx_PyObject_Call(__pyx_v_func, __pyx_t_11, __pyx_t_13); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1779; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_12);
      __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
      __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
      __pyx_t_16 = __pyx_PyFloat_AsDouble(__pyx_t_12); if (unlikely((__pyx_t_16 == (npy_double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1779; __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_pybuffernd_output.diminfo[0].shape;
        if (unlikely(__pyx_t_17 < 0)) __pyx_t_15 = 0;
      } else if (unlikely(__pyx_t_17 >= __pyx_pybuffernd_output.diminfo[0].shape)) __pyx_t_15 = 0;
      if (unlikely(__pyx_t_15 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_15);
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1779; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_double_t *, __pyx_pybuffernd_output.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_output.diminfo[0].strides) = __pyx_t_16;
      goto __pyx_L7;
    }
    /*else*/ {

      /* "pandas/algos.pyx":1782
 *                              **kwargs)
 *         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_pybuffernd_output.diminfo[0].shape;
        if (unlikely(__pyx_t_18 < 0)) __pyx_t_15 = 0;
      } else if (unlikely(__pyx_t_18 >= __pyx_pybuffernd_output.diminfo[0].shape)) __pyx_t_15 = 0;
      if (unlikely(__pyx_t_15 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_15);
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1782; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_double_t *, __pyx_pybuffernd_output.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_output.diminfo[0].strides) = __pyx_v_6pandas_5algos_NaN;
    }
    __pyx_L7:;
  }

  /* "pandas/algos.pyx":1784
 *             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++) {

    /* "pandas/algos.pyx":1785
 * 
 *     for i from win <= i < n:
 *         buf = buf + 1             # <<<<<<<<<<<<<<
 *         bufarr.data = <char*> buf
 *         if counts[i] >= minp:
 */
    __pyx_v_buf = (__pyx_v_buf + 1);

    /* "pandas/algos.pyx":1786
 *     for i from win <= i < n:
 *         buf = buf + 1
 *         bufarr.data = <char*> buf             # <<<<<<<<<<<<<<
 *         if counts[i] >= minp:
 *             output[i] = func(bufarr, *args, **kwargs)
 */
    __pyx_v_bufarr->data = ((char *)__pyx_v_buf);

    /* "pandas/algos.pyx":1787
 *         buf = buf + 1
 *         bufarr.data = <char*> buf
 *         if counts[i] >= minp:             # <<<<<<<<<<<<<<
 *             output[i] = func(bufarr, *args, **kwargs)
 *         else:
 */
    __pyx_t_20 = __pyx_v_i;
    __pyx_t_6 = -1;
    if (__pyx_t_20 < 0) {
      __pyx_t_20 += __pyx_pybuffernd_counts.diminfo[0].shape;
      if (unlikely(__pyx_t_20 < 0)) __pyx_t_6 = 0;
    } else if (unlikely(__pyx_t_20 >= __pyx_pybuffernd_counts.diminfo[0].shape)) __pyx_t_6 = 0;
    if (unlikely(__pyx_t_6 != -1)) {
      __Pyx_RaiseBufferIndexError(__pyx_t_6);
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1787; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_4 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_double_t *, __pyx_pybuffernd_counts.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_counts.diminfo[0].strides)) >= __pyx_v_minp) != 0);
    if (__pyx_t_4) {

      /* "pandas/algos.pyx":1788
 *         bufarr.data = <char*> buf
 *         if counts[i] >= minp:
 *             output[i] = func(bufarr, *args, **kwargs)             # <<<<<<<<<<<<<<
 *         else:
 *             output[i] = NaN
 */
      __pyx_t_12 = PyTuple_New(1); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1788; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__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_13 = PySequence_Tuple(__pyx_v_args); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1788; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_13);
      __pyx_t_11 = PyNumber_Add(__pyx_t_12, __pyx_t_13); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1788; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_11);
      __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
      if (unlikely(__pyx_v_kwargs == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "argument after ** must be a mapping, not NoneType");
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1788; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      if (likely(PyDict_Check(__pyx_v_kwargs))) {
        __pyx_t_13 = __pyx_v_kwargs;
        __Pyx_INCREF(__pyx_t_13);
      } else {
        __pyx_t_13 = PyObject_CallFunctionObjArgs((PyObject*)&PyDict_Type, __pyx_v_kwargs, NULL); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1788; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_13);
      }
      __pyx_t_12 = __Pyx_PyObject_Call(__pyx_v_func, __pyx_t_11, __pyx_t_13); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1788; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_12);
      __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
      __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
      __pyx_t_16 = __pyx_PyFloat_AsDouble(__pyx_t_12); if (unlikely((__pyx_t_16 == (npy_double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1788; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      __pyx_t_21 = __pyx_v_i;
      __pyx_t_6 = -1;
      if (__pyx_t_21 < 0) {
        __pyx_t_21 += __pyx_pybuffernd_output.diminfo[0].shape;
        if (unlikely(__pyx_t_21 < 0)) __pyx_t_6 = 0;
      } else if (unlikely(__pyx_t_21 >= __pyx_pybuffernd_output.diminfo[0].shape)) __pyx_t_6 = 0;
      if (unlikely(__pyx_t_6 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_6);
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1788; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_double_t *, __pyx_pybuffernd_output.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_output.diminfo[0].strides) = __pyx_t_16;
      goto __pyx_L10;
    }
    /*else*/ {

      /* "pandas/algos.pyx":1790
 *             output[i] = func(bufarr, *args, **kwargs)
 *         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_pybuffernd_output.diminfo[0].shape;
        if (unlikely(__pyx_t_22 < 0)) __pyx_t_6 = 0;
      } else if (unlikely(__pyx_t_22 >= __pyx_pybuffernd_output.diminfo[0].shape)) __pyx_t_6 = 0;
      if (unlikely(__pyx_t_6 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_6);
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1790; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_double_t *, __pyx_pybuffernd_output.rcbuffer->pybuffer.buf, __pyx_t_22, __pyx_pybuffernd_output.diminfo[0].strides) = __pyx_v_6pandas_5algos_NaN;
    }
    __pyx_L10:;
  }

  /* "pandas/algos.pyx":1792
 *             output[i] = NaN
 * 
 *     bufarr.data = <char*> oldbuf             # <<<<<<<<<<<<<<
 * 
 *     return output
 */
  __pyx_v_bufarr->data = ((char *)__pyx_v_oldbuf);

  /* "pandas/algos.pyx":1794
 *     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;

  /* "pandas/algos.pyx":1753
 *     return output
 * 
 * def roll_generic(ndarray[float64_t, cast=True] input, int win,             # <<<<<<<<<<<<<<
 *                  int minp, object func, object args, object kwargs):
 *     cdef ndarray[double_t] output, counts, bufarr
 */

  /* function exit code */
  __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_13);
  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
    __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_bufarr.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_counts.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_input.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_output.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas.algos.roll_generic", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_bufarr.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_counts.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_input.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_output.rcbuffer->pybuffer);
  __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;
}

/* "pandas/algos.pyx":1797
 * 
 * 
 * def roll_window(ndarray[float64_t, ndim=1, cast=True] input,             # <<<<<<<<<<<<<<
 *                 ndarray[float64_t, ndim=1, cast=True] weights,
 *                 int minp, bint avg=True, bint avg_wgt=False):
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pandas_5algos_55roll_window(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6pandas_5algos_54roll_window[] = "\n    Assume len(weights) << len(input)\n    ";
static PyMethodDef __pyx_mdef_6pandas_5algos_55roll_window = {__Pyx_NAMESTR("roll_window"), (PyCFunction)__pyx_pw_6pandas_5algos_55roll_window, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6pandas_5algos_54roll_window)};
static PyObject *__pyx_pw_6pandas_5algos_55roll_window(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyArrayObject *__pyx_v_input = 0;
  PyArrayObject *__pyx_v_weights = 0;
  int __pyx_v_minp;
  int __pyx_v_avg;
  int __pyx_v_avg_wgt;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("roll_window (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_input,&__pyx_n_s_weights,&__pyx_n_s_minp,&__pyx_n_s_avg,&__pyx_n_s_avg_wgt,0};
    PyObject* values[5] = {0,0,0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_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 (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_input)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_weights)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("roll_window", 0, 3, 5, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1797; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_minp)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("roll_window", 0, 3, 5, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1797; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  3:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_avg);
          if (value) { values[3] = value; kw_args--; }
        }
        case  4:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_avg_wgt);
          if (value) { values[4] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "roll_window") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1797; __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);
        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_weights = ((PyArrayObject *)values[1]);
    __pyx_v_minp = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_minp == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1799; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    if (values[3]) {
      __pyx_v_avg = __Pyx_PyObject_IsTrue(values[3]); if (unlikely((__pyx_v_avg == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1799; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    } else {

      /* "pandas/algos.pyx":1799
 * def roll_window(ndarray[float64_t, ndim=1, cast=True] input,
 *                 ndarray[float64_t, ndim=1, cast=True] weights,
 *                 int minp, bint avg=True, bint avg_wgt=False):             # <<<<<<<<<<<<<<
 *     """
 *     Assume len(weights) << len(input)
 */
      __pyx_v_avg = ((int)1);
    }
    if (values[4]) {
      __pyx_v_avg_wgt = __Pyx_PyObject_IsTrue(values[4]); if (unlikely((__pyx_v_avg_wgt == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1799; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    } else {
      __pyx_v_avg_wgt = ((int)0);
    }
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("roll_window", 0, 3, 5, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1797; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas.algos.roll_window", __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[0]; __pyx_lineno = 1797; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_weights), __pyx_ptype_5numpy_ndarray, 1, "weights", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1798; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_54roll_window(__pyx_self, __pyx_v_input, __pyx_v_weights, __pyx_v_minp, __pyx_v_avg, __pyx_v_avg_wgt);

  /* "pandas/algos.pyx":1797
 * 
 * 
 * def roll_window(ndarray[float64_t, ndim=1, cast=True] input,             # <<<<<<<<<<<<<<
 *                 ndarray[float64_t, ndim=1, cast=True] weights,
 *                 int minp, bint avg=True, bint avg_wgt=False):
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pandas_5algos_54roll_window(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_input, PyArrayObject *__pyx_v_weights, int __pyx_v_minp, int __pyx_v_avg, int __pyx_v_avg_wgt) {
  PyArrayObject *__pyx_v_output = 0;
  PyArrayObject *__pyx_v_tot_wgt = 0;
  PyArrayObject *__pyx_v_counts = 0;
  Py_ssize_t __pyx_v_in_i;
  Py_ssize_t __pyx_v_win_i;
  Py_ssize_t __pyx_v_win_n;
  Py_ssize_t __pyx_v_in_n;
  __pyx_t_5numpy_float64_t __pyx_v_val_in;
  __pyx_t_5numpy_float64_t __pyx_v_val_win;
  __pyx_t_5numpy_float64_t __pyx_v_c;
  __pyx_t_5numpy_float64_t __pyx_v_w;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_counts;
  __Pyx_Buffer __pyx_pybuffer_counts;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_input;
  __Pyx_Buffer __pyx_pybuffer_input;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_output;
  __Pyx_Buffer __pyx_pybuffer_output;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_tot_wgt;
  __Pyx_Buffer __pyx_pybuffer_tot_wgt;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_weights;
  __Pyx_Buffer __pyx_pybuffer_weights;
  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;
  PyObject *__pyx_t_12 = NULL;
  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;
  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;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("roll_window", 0);
  __pyx_pybuffer_output.pybuffer.buf = NULL;
  __pyx_pybuffer_output.refcount = 0;
  __pyx_pybuffernd_output.data = NULL;
  __pyx_pybuffernd_output.rcbuffer = &__pyx_pybuffer_output;
  __pyx_pybuffer_tot_wgt.pybuffer.buf = NULL;
  __pyx_pybuffer_tot_wgt.refcount = 0;
  __pyx_pybuffernd_tot_wgt.data = NULL;
  __pyx_pybuffernd_tot_wgt.rcbuffer = &__pyx_pybuffer_tot_wgt;
  __pyx_pybuffer_counts.pybuffer.buf = NULL;
  __pyx_pybuffer_counts.refcount = 0;
  __pyx_pybuffernd_counts.data = NULL;
  __pyx_pybuffernd_counts.rcbuffer = &__pyx_pybuffer_counts;
  __pyx_pybuffer_input.pybuffer.buf = NULL;
  __pyx_pybuffer_input.refcount = 0;
  __pyx_pybuffernd_input.data = NULL;
  __pyx_pybuffernd_input.rcbuffer = &__pyx_pybuffer_input;
  __pyx_pybuffer_weights.pybuffer.buf = NULL;
  __pyx_pybuffer_weights.refcount = 0;
  __pyx_pybuffernd_weights.data = NULL;
  __pyx_pybuffernd_weights.rcbuffer = &__pyx_pybuffer_weights;
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_input.rcbuffer->pybuffer, (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[0]; __pyx_lineno = 1797; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_input.diminfo[0].strides = __pyx_pybuffernd_input.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_input.diminfo[0].shape = __pyx_pybuffernd_input.rcbuffer->pybuffer.shape[0];
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_weights.rcbuffer->pybuffer, (PyObject*)__pyx_v_weights, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1797; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_weights.diminfo[0].strides = __pyx_pybuffernd_weights.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_weights.diminfo[0].shape = __pyx_pybuffernd_weights.rcbuffer->pybuffer.shape[0];

  /* "pandas/algos.pyx":1808
 *         float64_t val_in, val_win, c, w
 * 
 *     in_n = len(input)             # <<<<<<<<<<<<<<
 *     win_n = len(weights)
 *     output = np.zeros(in_n, dtype=float)
 */
  __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_input)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1808; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_in_n = __pyx_t_1;

  /* "pandas/algos.pyx":1809
 * 
 *     in_n = len(input)
 *     win_n = len(weights)             # <<<<<<<<<<<<<<
 *     output = np.zeros(in_n, dtype=float)
 *     counts = np.zeros(in_n, dtype=float)
 */
  __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_weights)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1809; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_win_n = __pyx_t_1;

  /* "pandas/algos.pyx":1810
 *     in_n = len(input)
 *     win_n = len(weights)
 *     output = np.zeros(in_n, dtype=float)             # <<<<<<<<<<<<<<
 *     counts = np.zeros(in_n, dtype=float)
 *     if avg:
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1810; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_zeros); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1810; __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_in_n); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1810; __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 = 1810; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__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 = 1810; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, ((PyObject *)((PyObject*)(&PyFloat_Type)))) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1810; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1810; __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_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__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 = 1810; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_6 = ((PyArrayObject *)__pyx_t_5);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_output.rcbuffer->pybuffer);
    __pyx_t_7 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_output.rcbuffer->pybuffer, (PyObject*)__pyx_t_6, &__Pyx_TypeInfo_nn___pyx_t_5numpy_double_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_pybuffernd_output.rcbuffer->pybuffer, (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_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_pybuffernd_output.diminfo[0].strides = __pyx_pybuffernd_output.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_output.diminfo[0].shape = __pyx_pybuffernd_output.rcbuffer->pybuffer.shape[0];
    if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1810; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_6 = 0;
  __pyx_v_output = ((PyArrayObject *)__pyx_t_5);
  __pyx_t_5 = 0;

  /* "pandas/algos.pyx":1811
 *     win_n = len(weights)
 *     output = np.zeros(in_n, dtype=float)
 *     counts = np.zeros(in_n, dtype=float)             # <<<<<<<<<<<<<<
 *     if avg:
 *         tot_wgt = np.zeros(in_n, dtype=float)
 */
  __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1811; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_zeros); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1811; __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_in_n); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1811; __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 = 1811; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__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[0]; __pyx_lineno = 1811; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_dtype, ((PyObject *)((PyObject*)(&PyFloat_Type)))) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1811; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1811; __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_DECREF(__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[0]; __pyx_lineno = 1811; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_6 = ((PyArrayObject *)__pyx_t_3);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_counts.rcbuffer->pybuffer);
    __pyx_t_7 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_counts.rcbuffer->pybuffer, (PyObject*)__pyx_t_6, &__Pyx_TypeInfo_nn___pyx_t_5numpy_double_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_pybuffernd_counts.rcbuffer->pybuffer, (PyObject*)__pyx_v_counts, &__Pyx_TypeInfo_nn___pyx_t_5numpy_double_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_pybuffernd_counts.diminfo[0].strides = __pyx_pybuffernd_counts.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_counts.diminfo[0].shape = __pyx_pybuffernd_counts.rcbuffer->pybuffer.shape[0];
    if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1811; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_6 = 0;
  __pyx_v_counts = ((PyArrayObject *)__pyx_t_3);
  __pyx_t_3 = 0;

  /* "pandas/algos.pyx":1812
 *     output = np.zeros(in_n, dtype=float)
 *     counts = np.zeros(in_n, dtype=float)
 *     if avg:             # <<<<<<<<<<<<<<
 *         tot_wgt = np.zeros(in_n, dtype=float)
 * 
 */
  __pyx_t_11 = (__pyx_v_avg != 0);
  if (__pyx_t_11) {

    /* "pandas/algos.pyx":1813
 *     counts = np.zeros(in_n, dtype=float)
 *     if avg:
 *         tot_wgt = np.zeros(in_n, dtype=float)             # <<<<<<<<<<<<<<
 * 
 *     minp = _check_minp(len(weights), minp, in_n)
 */
    __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1813; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_zeros); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1813; __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_in_n); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1813; __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 = 1813; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__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 = 1813; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_dtype, ((PyObject *)((PyObject*)(&PyFloat_Type)))) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1813; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1813; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__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[0]; __pyx_lineno = 1813; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_6 = ((PyArrayObject *)__pyx_t_2);
    {
      __Pyx_BufFmt_StackElem __pyx_stack[1];
      __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_tot_wgt.rcbuffer->pybuffer);
      __pyx_t_7 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_tot_wgt.rcbuffer->pybuffer, (PyObject*)__pyx_t_6, &__Pyx_TypeInfo_nn___pyx_t_5numpy_double_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_pybuffernd_tot_wgt.rcbuffer->pybuffer, (PyObject*)__pyx_v_tot_wgt, &__Pyx_TypeInfo_nn___pyx_t_5numpy_double_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_pybuffernd_tot_wgt.diminfo[0].strides = __pyx_pybuffernd_tot_wgt.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_tot_wgt.diminfo[0].shape = __pyx_pybuffernd_tot_wgt.rcbuffer->pybuffer.shape[0];
      if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1813; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_6 = 0;
    __pyx_v_tot_wgt = ((PyArrayObject *)__pyx_t_2);
    __pyx_t_2 = 0;
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "pandas/algos.pyx":1815
 *         tot_wgt = np.zeros(in_n, dtype=float)
 * 
 *     minp = _check_minp(len(weights), minp, in_n)             # <<<<<<<<<<<<<<
 * 
 *     if avg_wgt:
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_check_minp); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1815; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_weights)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1815; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_3 = PyInt_FromSsize_t(__pyx_t_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1815; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_minp); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1815; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = PyInt_FromSsize_t(__pyx_v_in_n); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1815; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_12 = PyTuple_New(3); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1815; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_12);
  PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_3);
  PyTuple_SET_ITEM(__pyx_t_12, 1, __pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_4);
  PyTuple_SET_ITEM(__pyx_t_12, 2, __pyx_t_5);
  __Pyx_GIVEREF(__pyx_t_5);
  __pyx_t_3 = 0;
  __pyx_t_4 = 0;
  __pyx_t_5 = 0;
  __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_12, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1815; __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_12); __pyx_t_12 = 0;
  __pyx_t_7 = __Pyx_PyInt_As_int(__pyx_t_5); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1815; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_v_minp = __pyx_t_7;

  /* "pandas/algos.pyx":1817
 *     minp = _check_minp(len(weights), minp, in_n)
 * 
 *     if avg_wgt:             # <<<<<<<<<<<<<<
 *         for win_i from 0 <= win_i < win_n:
 *             val_win = weights[win_i]
 */
  __pyx_t_11 = (__pyx_v_avg_wgt != 0);
  if (__pyx_t_11) {

    /* "pandas/algos.pyx":1818
 * 
 *     if avg_wgt:
 *         for win_i from 0 <= win_i < win_n:             # <<<<<<<<<<<<<<
 *             val_win = weights[win_i]
 *             if val_win != val_win:
 */
    __pyx_t_1 = __pyx_v_win_n;
    for (__pyx_v_win_i = 0; __pyx_v_win_i < __pyx_t_1; __pyx_v_win_i++) {

      /* "pandas/algos.pyx":1819
 *     if avg_wgt:
 *         for win_i from 0 <= win_i < win_n:
 *             val_win = weights[win_i]             # <<<<<<<<<<<<<<
 *             if val_win != val_win:
 *                 continue
 */
      __pyx_t_13 = __pyx_v_win_i;
      __pyx_t_7 = -1;
      if (__pyx_t_13 < 0) {
        __pyx_t_13 += __pyx_pybuffernd_weights.diminfo[0].shape;
        if (unlikely(__pyx_t_13 < 0)) __pyx_t_7 = 0;
      } else if (unlikely(__pyx_t_13 >= __pyx_pybuffernd_weights.diminfo[0].shape)) __pyx_t_7 = 0;
      if (unlikely(__pyx_t_7 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_7);
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1819; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_v_val_win = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_weights.rcbuffer->pybuffer.buf, __pyx_t_13, __pyx_pybuffernd_weights.diminfo[0].strides));

      /* "pandas/algos.pyx":1820
 *         for win_i from 0 <= win_i < win_n:
 *             val_win = weights[win_i]
 *             if val_win != val_win:             # <<<<<<<<<<<<<<
 *                 continue
 * 
 */
      __pyx_t_11 = ((__pyx_v_val_win != __pyx_v_val_win) != 0);
      if (__pyx_t_11) {

        /* "pandas/algos.pyx":1821
 *             val_win = weights[win_i]
 *             if val_win != val_win:
 *                 continue             # <<<<<<<<<<<<<<
 * 
 *             for in_i from 0 <= in_i < in_n - (win_n - win_i) + 1:
 */
        goto __pyx_L5_continue;
      }

      /* "pandas/algos.pyx":1823
 *                 continue
 * 
 *             for in_i from 0 <= in_i < in_n - (win_n - win_i) + 1:             # <<<<<<<<<<<<<<
 *                 val_in = input[in_i]
 *                 if val_in == val_in:
 */
      __pyx_t_14 = ((__pyx_v_in_n - (__pyx_v_win_n - __pyx_v_win_i)) + 1);
      for (__pyx_v_in_i = 0; __pyx_v_in_i < __pyx_t_14; __pyx_v_in_i++) {

        /* "pandas/algos.pyx":1824
 * 
 *             for in_i from 0 <= in_i < in_n - (win_n - win_i) + 1:
 *                 val_in = input[in_i]             # <<<<<<<<<<<<<<
 *                 if val_in == val_in:
 *                     output[in_i + (win_n - win_i) - 1] += val_in * val_win
 */
        __pyx_t_15 = __pyx_v_in_i;
        __pyx_t_7 = -1;
        if (__pyx_t_15 < 0) {
          __pyx_t_15 += __pyx_pybuffernd_input.diminfo[0].shape;
          if (unlikely(__pyx_t_15 < 0)) __pyx_t_7 = 0;
        } else if (unlikely(__pyx_t_15 >= __pyx_pybuffernd_input.diminfo[0].shape)) __pyx_t_7 = 0;
        if (unlikely(__pyx_t_7 != -1)) {
          __Pyx_RaiseBufferIndexError(__pyx_t_7);
          {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1824; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        __pyx_v_val_in = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_input.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_input.diminfo[0].strides));

        /* "pandas/algos.pyx":1825
 *             for in_i from 0 <= in_i < in_n - (win_n - win_i) + 1:
 *                 val_in = input[in_i]
 *                 if val_in == val_in:             # <<<<<<<<<<<<<<
 *                     output[in_i + (win_n - win_i) - 1] += val_in * val_win
 *                     counts[in_i + (win_n - win_i) - 1] += 1
 */
        __pyx_t_11 = ((__pyx_v_val_in == __pyx_v_val_in) != 0);
        if (__pyx_t_11) {

          /* "pandas/algos.pyx":1826
 *                 val_in = input[in_i]
 *                 if val_in == val_in:
 *                     output[in_i + (win_n - win_i) - 1] += val_in * val_win             # <<<<<<<<<<<<<<
 *                     counts[in_i + (win_n - win_i) - 1] += 1
 *                     tot_wgt[in_i + (win_n - win_i) - 1] += val_win
 */
          __pyx_t_16 = ((__pyx_v_in_i + (__pyx_v_win_n - __pyx_v_win_i)) - 1);
          __pyx_t_7 = -1;
          if (__pyx_t_16 < 0) {
            __pyx_t_16 += __pyx_pybuffernd_output.diminfo[0].shape;
            if (unlikely(__pyx_t_16 < 0)) __pyx_t_7 = 0;
          } else if (unlikely(__pyx_t_16 >= __pyx_pybuffernd_output.diminfo[0].shape)) __pyx_t_7 = 0;
          if (unlikely(__pyx_t_7 != -1)) {
            __Pyx_RaiseBufferIndexError(__pyx_t_7);
            {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1826; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          }
          *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_double_t *, __pyx_pybuffernd_output.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_output.diminfo[0].strides) += (__pyx_v_val_in * __pyx_v_val_win);

          /* "pandas/algos.pyx":1827
 *                 if val_in == val_in:
 *                     output[in_i + (win_n - win_i) - 1] += val_in * val_win
 *                     counts[in_i + (win_n - win_i) - 1] += 1             # <<<<<<<<<<<<<<
 *                     tot_wgt[in_i + (win_n - win_i) - 1] += val_win
 * 
 */
          __pyx_t_17 = ((__pyx_v_in_i + (__pyx_v_win_n - __pyx_v_win_i)) - 1);
          __pyx_t_7 = -1;
          if (__pyx_t_17 < 0) {
            __pyx_t_17 += __pyx_pybuffernd_counts.diminfo[0].shape;
            if (unlikely(__pyx_t_17 < 0)) __pyx_t_7 = 0;
          } else if (unlikely(__pyx_t_17 >= __pyx_pybuffernd_counts.diminfo[0].shape)) __pyx_t_7 = 0;
          if (unlikely(__pyx_t_7 != -1)) {
            __Pyx_RaiseBufferIndexError(__pyx_t_7);
            {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1827; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          }
          *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_double_t *, __pyx_pybuffernd_counts.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_counts.diminfo[0].strides) += 1.0;

          /* "pandas/algos.pyx":1828
 *                     output[in_i + (win_n - win_i) - 1] += val_in * val_win
 *                     counts[in_i + (win_n - win_i) - 1] += 1
 *                     tot_wgt[in_i + (win_n - win_i) - 1] += val_win             # <<<<<<<<<<<<<<
 * 
 *         for in_i from 0 <= in_i < in_n:
 */
          __pyx_t_18 = ((__pyx_v_in_i + (__pyx_v_win_n - __pyx_v_win_i)) - 1);
          __pyx_t_7 = -1;
          if (__pyx_t_18 < 0) {
            __pyx_t_18 += __pyx_pybuffernd_tot_wgt.diminfo[0].shape;
            if (unlikely(__pyx_t_18 < 0)) __pyx_t_7 = 0;
          } else if (unlikely(__pyx_t_18 >= __pyx_pybuffernd_tot_wgt.diminfo[0].shape)) __pyx_t_7 = 0;
          if (unlikely(__pyx_t_7 != -1)) {
            __Pyx_RaiseBufferIndexError(__pyx_t_7);
            {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1828; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          }
          *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_double_t *, __pyx_pybuffernd_tot_wgt.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_tot_wgt.diminfo[0].strides) += __pyx_v_val_win;
          goto __pyx_L10;
        }
        __pyx_L10:;
      }
      __pyx_L5_continue:;
    }

    /* "pandas/algos.pyx":1830
 *                     tot_wgt[in_i + (win_n - win_i) - 1] += val_win
 * 
 *         for in_i from 0 <= in_i < in_n:             # <<<<<<<<<<<<<<
 *             c = counts[in_i]
 *             if c < minp:
 */
    __pyx_t_1 = __pyx_v_in_n;
    for (__pyx_v_in_i = 0; __pyx_v_in_i < __pyx_t_1; __pyx_v_in_i++) {

      /* "pandas/algos.pyx":1831
 * 
 *         for in_i from 0 <= in_i < in_n:
 *             c = counts[in_i]             # <<<<<<<<<<<<<<
 *             if c < minp:
 *                 output[in_i] = NaN
 */
      __pyx_t_14 = __pyx_v_in_i;
      __pyx_t_7 = -1;
      if (__pyx_t_14 < 0) {
        __pyx_t_14 += __pyx_pybuffernd_counts.diminfo[0].shape;
        if (unlikely(__pyx_t_14 < 0)) __pyx_t_7 = 0;
      } else if (unlikely(__pyx_t_14 >= __pyx_pybuffernd_counts.diminfo[0].shape)) __pyx_t_7 = 0;
      if (unlikely(__pyx_t_7 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_7);
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1831; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_v_c = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_double_t *, __pyx_pybuffernd_counts.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_counts.diminfo[0].strides));

      /* "pandas/algos.pyx":1832
 *         for in_i from 0 <= in_i < in_n:
 *             c = counts[in_i]
 *             if c < minp:             # <<<<<<<<<<<<<<
 *                 output[in_i] = NaN
 *             else:
 */
      __pyx_t_11 = ((__pyx_v_c < __pyx_v_minp) != 0);
      if (__pyx_t_11) {

        /* "pandas/algos.pyx":1833
 *             c = counts[in_i]
 *             if c < minp:
 *                 output[in_i] = NaN             # <<<<<<<<<<<<<<
 *             else:
 *                 w = tot_wgt[in_i]
 */
        __pyx_t_19 = __pyx_v_in_i;
        __pyx_t_7 = -1;
        if (__pyx_t_19 < 0) {
          __pyx_t_19 += __pyx_pybuffernd_output.diminfo[0].shape;
          if (unlikely(__pyx_t_19 < 0)) __pyx_t_7 = 0;
        } else if (unlikely(__pyx_t_19 >= __pyx_pybuffernd_output.diminfo[0].shape)) __pyx_t_7 = 0;
        if (unlikely(__pyx_t_7 != -1)) {
          __Pyx_RaiseBufferIndexError(__pyx_t_7);
          {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1833; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_double_t *, __pyx_pybuffernd_output.rcbuffer->pybuffer.buf, __pyx_t_19, __pyx_pybuffernd_output.diminfo[0].strides) = __pyx_v_6pandas_5algos_NaN;
        goto __pyx_L13;
      }
      /*else*/ {

        /* "pandas/algos.pyx":1835
 *                 output[in_i] = NaN
 *             else:
 *                 w = tot_wgt[in_i]             # <<<<<<<<<<<<<<
 *                 if w == 0:
 *                     output[in_i] = NaN
 */
        __pyx_t_20 = __pyx_v_in_i;
        __pyx_t_7 = -1;
        if (__pyx_t_20 < 0) {
          __pyx_t_20 += __pyx_pybuffernd_tot_wgt.diminfo[0].shape;
          if (unlikely(__pyx_t_20 < 0)) __pyx_t_7 = 0;
        } else if (unlikely(__pyx_t_20 >= __pyx_pybuffernd_tot_wgt.diminfo[0].shape)) __pyx_t_7 = 0;
        if (unlikely(__pyx_t_7 != -1)) {
          __Pyx_RaiseBufferIndexError(__pyx_t_7);
          {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1835; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        __pyx_v_w = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_double_t *, __pyx_pybuffernd_tot_wgt.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_tot_wgt.diminfo[0].strides));

        /* "pandas/algos.pyx":1836
 *             else:
 *                 w = tot_wgt[in_i]
 *                 if w == 0:             # <<<<<<<<<<<<<<
 *                     output[in_i] = NaN
 *                 else:
 */
        __pyx_t_11 = ((__pyx_v_w == 0.0) != 0);
        if (__pyx_t_11) {

          /* "pandas/algos.pyx":1837
 *                 w = tot_wgt[in_i]
 *                 if w == 0:
 *                     output[in_i] = NaN             # <<<<<<<<<<<<<<
 *                 else:
 *                     output[in_i] /= tot_wgt[in_i]
 */
          __pyx_t_21 = __pyx_v_in_i;
          __pyx_t_7 = -1;
          if (__pyx_t_21 < 0) {
            __pyx_t_21 += __pyx_pybuffernd_output.diminfo[0].shape;
            if (unlikely(__pyx_t_21 < 0)) __pyx_t_7 = 0;
          } else if (unlikely(__pyx_t_21 >= __pyx_pybuffernd_output.diminfo[0].shape)) __pyx_t_7 = 0;
          if (unlikely(__pyx_t_7 != -1)) {
            __Pyx_RaiseBufferIndexError(__pyx_t_7);
            {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1837; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          }
          *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_double_t *, __pyx_pybuffernd_output.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_output.diminfo[0].strides) = __pyx_v_6pandas_5algos_NaN;
          goto __pyx_L14;
        }
        /*else*/ {

          /* "pandas/algos.pyx":1839
 *                     output[in_i] = NaN
 *                 else:
 *                     output[in_i] /= tot_wgt[in_i]             # <<<<<<<<<<<<<<
 * 
 *     else:
 */
          __pyx_t_22 = __pyx_v_in_i;
          __pyx_t_7 = -1;
          if (__pyx_t_22 < 0) {
            __pyx_t_22 += __pyx_pybuffernd_tot_wgt.diminfo[0].shape;
            if (unlikely(__pyx_t_22 < 0)) __pyx_t_7 = 0;
          } else if (unlikely(__pyx_t_22 >= __pyx_pybuffernd_tot_wgt.diminfo[0].shape)) __pyx_t_7 = 0;
          if (unlikely(__pyx_t_7 != -1)) {
            __Pyx_RaiseBufferIndexError(__pyx_t_7);
            {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1839; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          }
          __pyx_t_23 = __pyx_v_in_i;
          __pyx_t_7 = -1;
          if (__pyx_t_23 < 0) {
            __pyx_t_23 += __pyx_pybuffernd_output.diminfo[0].shape;
            if (unlikely(__pyx_t_23 < 0)) __pyx_t_7 = 0;
          } else if (unlikely(__pyx_t_23 >= __pyx_pybuffernd_output.diminfo[0].shape)) __pyx_t_7 = 0;
          if (unlikely(__pyx_t_7 != -1)) {
            __Pyx_RaiseBufferIndexError(__pyx_t_7);
            {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1839; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          }
          *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_double_t *, __pyx_pybuffernd_output.rcbuffer->pybuffer.buf, __pyx_t_23, __pyx_pybuffernd_output.diminfo[0].strides) /= (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_double_t *, __pyx_pybuffernd_tot_wgt.rcbuffer->pybuffer.buf, __pyx_t_22, __pyx_pybuffernd_tot_wgt.diminfo[0].strides));
        }
        __pyx_L14:;
      }
      __pyx_L13:;
    }
    goto __pyx_L4;
  }
  /*else*/ {

    /* "pandas/algos.pyx":1842
 * 
 *     else:
 *         for win_i from 0 <= win_i < win_n:             # <<<<<<<<<<<<<<
 *             val_win = weights[win_i]
 *             if val_win != val_win:
 */
    __pyx_t_1 = __pyx_v_win_n;
    for (__pyx_v_win_i = 0; __pyx_v_win_i < __pyx_t_1; __pyx_v_win_i++) {

      /* "pandas/algos.pyx":1843
 *     else:
 *         for win_i from 0 <= win_i < win_n:
 *             val_win = weights[win_i]             # <<<<<<<<<<<<<<
 *             if val_win != val_win:
 *                 continue
 */
      __pyx_t_24 = __pyx_v_win_i;
      __pyx_t_7 = -1;
      if (__pyx_t_24 < 0) {
        __pyx_t_24 += __pyx_pybuffernd_weights.diminfo[0].shape;
        if (unlikely(__pyx_t_24 < 0)) __pyx_t_7 = 0;
      } else if (unlikely(__pyx_t_24 >= __pyx_pybuffernd_weights.diminfo[0].shape)) __pyx_t_7 = 0;
      if (unlikely(__pyx_t_7 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_7);
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1843; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_v_val_win = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_weights.rcbuffer->pybuffer.buf, __pyx_t_24, __pyx_pybuffernd_weights.diminfo[0].strides));

      /* "pandas/algos.pyx":1844
 *         for win_i from 0 <= win_i < win_n:
 *             val_win = weights[win_i]
 *             if val_win != val_win:             # <<<<<<<<<<<<<<
 *                 continue
 * 
 */
      __pyx_t_11 = ((__pyx_v_val_win != __pyx_v_val_win) != 0);
      if (__pyx_t_11) {

        /* "pandas/algos.pyx":1845
 *             val_win = weights[win_i]
 *             if val_win != val_win:
 *                 continue             # <<<<<<<<<<<<<<
 * 
 *             for in_i from 0 <= in_i < in_n - (win_n - win_i) + 1:
 */
        goto __pyx_L15_continue;
      }

      /* "pandas/algos.pyx":1847
 *                 continue
 * 
 *             for in_i from 0 <= in_i < in_n - (win_n - win_i) + 1:             # <<<<<<<<<<<<<<
 *                 val_in = input[in_i]
 * 
 */
      __pyx_t_25 = ((__pyx_v_in_n - (__pyx_v_win_n - __pyx_v_win_i)) + 1);
      for (__pyx_v_in_i = 0; __pyx_v_in_i < __pyx_t_25; __pyx_v_in_i++) {

        /* "pandas/algos.pyx":1848
 * 
 *             for in_i from 0 <= in_i < in_n - (win_n - win_i) + 1:
 *                 val_in = input[in_i]             # <<<<<<<<<<<<<<
 * 
 *                 if val_in == val_in:
 */
        __pyx_t_26 = __pyx_v_in_i;
        __pyx_t_7 = -1;
        if (__pyx_t_26 < 0) {
          __pyx_t_26 += __pyx_pybuffernd_input.diminfo[0].shape;
          if (unlikely(__pyx_t_26 < 0)) __pyx_t_7 = 0;
        } else if (unlikely(__pyx_t_26 >= __pyx_pybuffernd_input.diminfo[0].shape)) __pyx_t_7 = 0;
        if (unlikely(__pyx_t_7 != -1)) {
          __Pyx_RaiseBufferIndexError(__pyx_t_7);
          {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1848; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        __pyx_v_val_in = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_input.rcbuffer->pybuffer.buf, __pyx_t_26, __pyx_pybuffernd_input.diminfo[0].strides));

        /* "pandas/algos.pyx":1850
 *                 val_in = input[in_i]
 * 
 *                 if val_in == val_in:             # <<<<<<<<<<<<<<
 *                     output[in_i + (win_n - win_i) - 1] += val_in * val_win
 *                     counts[in_i + (win_n - win_i) - 1] += 1
 */
        __pyx_t_11 = ((__pyx_v_val_in == __pyx_v_val_in) != 0);
        if (__pyx_t_11) {

          /* "pandas/algos.pyx":1851
 * 
 *                 if val_in == val_in:
 *                     output[in_i + (win_n - win_i) - 1] += val_in * val_win             # <<<<<<<<<<<<<<
 *                     counts[in_i + (win_n - win_i) - 1] += 1
 * 
 */
          __pyx_t_27 = ((__pyx_v_in_i + (__pyx_v_win_n - __pyx_v_win_i)) - 1);
          __pyx_t_7 = -1;
          if (__pyx_t_27 < 0) {
            __pyx_t_27 += __pyx_pybuffernd_output.diminfo[0].shape;
            if (unlikely(__pyx_t_27 < 0)) __pyx_t_7 = 0;
          } else if (unlikely(__pyx_t_27 >= __pyx_pybuffernd_output.diminfo[0].shape)) __pyx_t_7 = 0;
          if (unlikely(__pyx_t_7 != -1)) {
            __Pyx_RaiseBufferIndexError(__pyx_t_7);
            {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1851; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          }
          *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_double_t *, __pyx_pybuffernd_output.rcbuffer->pybuffer.buf, __pyx_t_27, __pyx_pybuffernd_output.diminfo[0].strides) += (__pyx_v_val_in * __pyx_v_val_win);

          /* "pandas/algos.pyx":1852
 *                 if val_in == val_in:
 *                     output[in_i + (win_n - win_i) - 1] += val_in * val_win
 *                     counts[in_i + (win_n - win_i) - 1] += 1             # <<<<<<<<<<<<<<
 * 
 *         for in_i from 0 <= in_i < in_n:
 */
          __pyx_t_28 = ((__pyx_v_in_i + (__pyx_v_win_n - __pyx_v_win_i)) - 1);
          __pyx_t_7 = -1;
          if (__pyx_t_28 < 0) {
            __pyx_t_28 += __pyx_pybuffernd_counts.diminfo[0].shape;
            if (unlikely(__pyx_t_28 < 0)) __pyx_t_7 = 0;
          } else if (unlikely(__pyx_t_28 >= __pyx_pybuffernd_counts.diminfo[0].shape)) __pyx_t_7 = 0;
          if (unlikely(__pyx_t_7 != -1)) {
            __Pyx_RaiseBufferIndexError(__pyx_t_7);
            {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1852; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          }
          *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_double_t *, __pyx_pybuffernd_counts.rcbuffer->pybuffer.buf, __pyx_t_28, __pyx_pybuffernd_counts.diminfo[0].strides) += 1.0;
          goto __pyx_L20;
        }
        __pyx_L20:;
      }
      __pyx_L15_continue:;
    }

    /* "pandas/algos.pyx":1854
 *                     counts[in_i + (win_n - win_i) - 1] += 1
 * 
 *         for in_i from 0 <= in_i < in_n:             # <<<<<<<<<<<<<<
 *             c = counts[in_i]
 *             if c < minp:
 */
    __pyx_t_1 = __pyx_v_in_n;
    for (__pyx_v_in_i = 0; __pyx_v_in_i < __pyx_t_1; __pyx_v_in_i++) {

      /* "pandas/algos.pyx":1855
 * 
 *         for in_i from 0 <= in_i < in_n:
 *             c = counts[in_i]             # <<<<<<<<<<<<<<
 *             if c < minp:
 *                 output[in_i] = NaN
 */
      __pyx_t_25 = __pyx_v_in_i;
      __pyx_t_7 = -1;
      if (__pyx_t_25 < 0) {
        __pyx_t_25 += __pyx_pybuffernd_counts.diminfo[0].shape;
        if (unlikely(__pyx_t_25 < 0)) __pyx_t_7 = 0;
      } else if (unlikely(__pyx_t_25 >= __pyx_pybuffernd_counts.diminfo[0].shape)) __pyx_t_7 = 0;
      if (unlikely(__pyx_t_7 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_7);
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1855; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_v_c = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_double_t *, __pyx_pybuffernd_counts.rcbuffer->pybuffer.buf, __pyx_t_25, __pyx_pybuffernd_counts.diminfo[0].strides));

      /* "pandas/algos.pyx":1856
 *         for in_i from 0 <= in_i < in_n:
 *             c = counts[in_i]
 *             if c < minp:             # <<<<<<<<<<<<<<
 *                 output[in_i] = NaN
 *             elif avg:
 */
      __pyx_t_11 = ((__pyx_v_c < __pyx_v_minp) != 0);
      if (__pyx_t_11) {

        /* "pandas/algos.pyx":1857
 *             c = counts[in_i]
 *             if c < minp:
 *                 output[in_i] = NaN             # <<<<<<<<<<<<<<
 *             elif avg:
 *                 output[in_i] /= c
 */
        __pyx_t_29 = __pyx_v_in_i;
        __pyx_t_7 = -1;
        if (__pyx_t_29 < 0) {
          __pyx_t_29 += __pyx_pybuffernd_output.diminfo[0].shape;
          if (unlikely(__pyx_t_29 < 0)) __pyx_t_7 = 0;
        } else if (unlikely(__pyx_t_29 >= __pyx_pybuffernd_output.diminfo[0].shape)) __pyx_t_7 = 0;
        if (unlikely(__pyx_t_7 != -1)) {
          __Pyx_RaiseBufferIndexError(__pyx_t_7);
          {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1857; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_double_t *, __pyx_pybuffernd_output.rcbuffer->pybuffer.buf, __pyx_t_29, __pyx_pybuffernd_output.diminfo[0].strides) = __pyx_v_6pandas_5algos_NaN;
        goto __pyx_L23;
      }

      /* "pandas/algos.pyx":1858
 *             if c < minp:
 *                 output[in_i] = NaN
 *             elif avg:             # <<<<<<<<<<<<<<
 *                 output[in_i] /= c
 * 
 */
      __pyx_t_11 = (__pyx_v_avg != 0);
      if (__pyx_t_11) {

        /* "pandas/algos.pyx":1859
 *                 output[in_i] = NaN
 *             elif avg:
 *                 output[in_i] /= c             # <<<<<<<<<<<<<<
 * 
 *     return output
 */
        __pyx_t_30 = __pyx_v_in_i;
        __pyx_t_7 = -1;
        if (__pyx_t_30 < 0) {
          __pyx_t_30 += __pyx_pybuffernd_output.diminfo[0].shape;
          if (unlikely(__pyx_t_30 < 0)) __pyx_t_7 = 0;
        } else if (unlikely(__pyx_t_30 >= __pyx_pybuffernd_output.diminfo[0].shape)) __pyx_t_7 = 0;
        if (unlikely(__pyx_t_7 != -1)) {
          __Pyx_RaiseBufferIndexError(__pyx_t_7);
          {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1859; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_double_t *, __pyx_pybuffernd_output.rcbuffer->pybuffer.buf, __pyx_t_30, __pyx_pybuffernd_output.diminfo[0].strides) /= __pyx_v_c;
        goto __pyx_L23;
      }
      __pyx_L23:;
    }
  }
  __pyx_L4:;

  /* "pandas/algos.pyx":1861
 *                 output[in_i] /= c
 * 
 *     return output             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_output));
  __pyx_r = ((PyObject *)__pyx_v_output);
  goto __pyx_L0;

  /* "pandas/algos.pyx":1797
 * 
 * 
 * def roll_window(ndarray[float64_t, ndim=1, cast=True] input,             # <<<<<<<<<<<<<<
 *                 ndarray[float64_t, ndim=1, cast=True] weights,
 *                 int minp, bint avg=True, bint avg_wgt=False):
 */

  /* function exit code */
  __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_12);
  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
    __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_counts.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_input.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_output.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_tot_wgt.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_weights.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas.algos.roll_window", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_counts.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_input.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_output.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_tot_wgt.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_weights.rcbuffer->pybuffer);
  __pyx_L2:;
  __Pyx_XDECREF((PyObject *)__pyx_v_output);
  __Pyx_XDECREF((PyObject *)__pyx_v_tot_wgt);
  __Pyx_XDECREF((PyObject *)__pyx_v_counts);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/algos.pyx":1870
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def is_lexsorted(list list_of_arrays):             # <<<<<<<<<<<<<<
 *     cdef:
 *         int i
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pandas_5algos_57is_lexsorted(PyObject *__pyx_self, PyObject *__pyx_v_list_of_arrays); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_5algos_57is_lexsorted = {__Pyx_NAMESTR("is_lexsorted"), (PyCFunction)__pyx_pw_6pandas_5algos_57is_lexsorted, METH_O, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pw_6pandas_5algos_57is_lexsorted(PyObject *__pyx_self, PyObject *__pyx_v_list_of_arrays) {
  CYTHON_UNUSED int __pyx_lineno = 0;
  CYTHON_UNUSED const char *__pyx_filename = NULL;
  CYTHON_UNUSED int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("is_lexsorted (wrapper)", 0);
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_list_of_arrays), (&PyList_Type), 1, "list_of_arrays", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1870; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_56is_lexsorted(__pyx_self, ((PyObject*)__pyx_v_list_of_arrays));

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pandas_5algos_56is_lexsorted(CYTHON_UNUSED 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", 0);

  /* "pandas/algos.pyx":1877
 *         ndarray arr
 * 
 *     nlevels = len(list_of_arrays)             # <<<<<<<<<<<<<<
 *     n = len(list_of_arrays[0])
 * 
 */
  if (unlikely(__pyx_v_list_of_arrays == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1877; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_1 = PyList_GET_SIZE(__pyx_v_list_of_arrays); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1877; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_nlevels = __pyx_t_1;

  /* "pandas/algos.pyx":1878
 * 
 *     nlevels = len(list_of_arrays)
 *     n = len(list_of_arrays[0])             # <<<<<<<<<<<<<<
 * 
 *     cdef int64_t **vecs = <int64_t**> malloc(nlevels * sizeof(int64_t*))
 */
  if (unlikely(__pyx_v_list_of_arrays == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1878; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __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[0]; __pyx_lineno = 1878; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_n = __pyx_t_1;

  /* "pandas/algos.pyx":1880
 *     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 *)))));

  /* "pandas/algos.pyx":1881
 * 
 *     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++) {

    /* "pandas/algos.pyx":1884
 *         # vecs[i] = <int64_t *> (<ndarray> list_of_arrays[i]).data
 * 
 *         arr = list_of_arrays[i]             # <<<<<<<<<<<<<<
 *         vecs[i] = <int64_t *> arr.data
 *     # assume uniqueness??
 */
    if (unlikely(__pyx_v_list_of_arrays == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1884; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    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[0]; __pyx_lineno = 1884; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_2 = PyList_GET_ITEM(__pyx_v_list_of_arrays, __pyx_v_i);
    __Pyx_INCREF(__pyx_t_2);
    __Pyx_XDECREF_SET(__pyx_v_arr, ((PyArrayObject *)__pyx_t_2));
    __pyx_t_2 = 0;

    /* "pandas/algos.pyx":1885
 * 
 *         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);
  }

  /* "pandas/algos.pyx":1888
 *     # 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++) {

    /* "pandas/algos.pyx":1889
 * 
 *     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++) {

      /* "pandas/algos.pyx":1890
 *     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]);

      /* "pandas/algos.pyx":1891
 *         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)]);

      /* "pandas/algos.pyx":1892
 *             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) != 0);
      if (__pyx_t_4) {

        /* "pandas/algos.pyx":1893
 *             pre = vecs[k][i-1]
 *             if cur == pre:
 *                 continue             # <<<<<<<<<<<<<<
 *             elif cur > pre:
 *                 break
 */
        goto __pyx_L7_continue;
      }

      /* "pandas/algos.pyx":1894
 *             if cur == pre:
 *                 continue
 *             elif cur > pre:             # <<<<<<<<<<<<<<
 *                 break
 *             else:
 */
      __pyx_t_4 = ((__pyx_v_cur > __pyx_v_pre) != 0);
      if (__pyx_t_4) {

        /* "pandas/algos.pyx":1895
 *                 continue
 *             elif cur > pre:
 *                 break             # <<<<<<<<<<<<<<
 *             else:
 *                 return False
 */
        goto __pyx_L8_break;
      }
      /*else*/ {

        /* "pandas/algos.pyx":1897
 *                 break
 *             else:
 *                 return False             # <<<<<<<<<<<<<<
 *     free(vecs)
 *     return True
 */
        __Pyx_XDECREF(__pyx_r);
        __Pyx_INCREF(Py_False);
        __pyx_r = Py_False;
        goto __pyx_L0;
      }
      __pyx_L7_continue:;
    }
    __pyx_L8_break:;
  }

  /* "pandas/algos.pyx":1898
 *             else:
 *                 return False
 *     free(vecs)             # <<<<<<<<<<<<<<
 *     return True
 * 
 */
  free(__pyx_v_vecs);

  /* "pandas/algos.pyx":1899
 *                 return False
 *     free(vecs)
 *     return True             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(Py_True);
  __pyx_r = Py_True;
  goto __pyx_L0;

  /* "pandas/algos.pyx":1870
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def is_lexsorted(list list_of_arrays):             # <<<<<<<<<<<<<<
 *     cdef:
 *         int i
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pandas.algos.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;
}

/* "pandas/algos.pyx":1903
 * 
 * @cython.boundscheck(False)
 * def groupby_indices(ndarray values):             # <<<<<<<<<<<<<<
 *     cdef:
 *         Py_ssize_t i, n = len(values)
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pandas_5algos_59groupby_indices(PyObject *__pyx_self, PyObject *__pyx_v_values); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_5algos_59groupby_indices = {__Pyx_NAMESTR("groupby_indices"), (PyCFunction)__pyx_pw_6pandas_5algos_59groupby_indices, METH_O, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pw_6pandas_5algos_59groupby_indices(PyObject *__pyx_self, PyObject *__pyx_v_values) {
  CYTHON_UNUSED int __pyx_lineno = 0;
  CYTHON_UNUSED const char *__pyx_filename = NULL;
  CYTHON_UNUSED int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("groupby_indices (wrapper)", 0);
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1903; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_58groupby_indices(__pyx_self, ((PyArrayObject *)__pyx_v_values));

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pandas_5algos_58groupby_indices(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__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;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_arr;
  __Pyx_Buffer __pyx_pybuffer_arr;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_counts;
  __Pyx_Buffer __pyx_pybuffer_counts;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_labels;
  __Pyx_Buffer __pyx_pybuffer_labels;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_seen;
  __Pyx_Buffer __pyx_pybuffer_seen;
  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", 0);
  __pyx_pybuffer_labels.pybuffer.buf = NULL;
  __pyx_pybuffer_labels.refcount = 0;
  __pyx_pybuffernd_labels.data = NULL;
  __pyx_pybuffernd_labels.rcbuffer = &__pyx_pybuffer_labels;
  __pyx_pybuffer_counts.pybuffer.buf = NULL;
  __pyx_pybuffer_counts.refcount = 0;
  __pyx_pybuffernd_counts.data = NULL;
  __pyx_pybuffernd_counts.rcbuffer = &__pyx_pybuffer_counts;
  __pyx_pybuffer_arr.pybuffer.buf = NULL;
  __pyx_pybuffer_arr.refcount = 0;
  __pyx_pybuffernd_arr.data = NULL;
  __pyx_pybuffernd_arr.rcbuffer = &__pyx_pybuffer_arr;
  __pyx_pybuffer_seen.pybuffer.buf = NULL;
  __pyx_pybuffer_seen.refcount = 0;
  __pyx_pybuffernd_seen.data = NULL;
  __pyx_pybuffernd_seen.rcbuffer = &__pyx_pybuffer_seen;

  /* "pandas/algos.pyx":1905
 * 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(((PyObject *)__pyx_v_values)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1905; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_n = __pyx_t_1;

  /* "pandas/algos.pyx":1908
 *         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[0]; __pyx_lineno = 1908; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_v_ids = ((PyObject*)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "pandas/algos.pyx":1912
 *         int64_t k
 * 
 *     ids, labels, counts = group_labels(values)             # <<<<<<<<<<<<<<
 *     seen = np.zeros_like(counts)
 * 
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_group_labels); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1912; __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 = 1912; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__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 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1912; __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;
  if ((likely(PyTuple_CheckExact(__pyx_t_4))) || (PyList_CheckExact(__pyx_t_4))) {
    PyObject* sequence = __pyx_t_4;
    #if CYTHON_COMPILING_IN_CPYTHON
    Py_ssize_t size = Py_SIZE(sequence);
    #else
    Py_ssize_t size = PySequence_Size(sequence);
    #endif
    if (unlikely(size != 3)) {
      if (size > 3) __Pyx_RaiseTooManyValuesError(3);
      else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1912; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    #if CYTHON_COMPILING_IN_CPYTHON
    if (likely(PyTuple_CheckExact(sequence))) {
      __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 {
      __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);
    #else
    __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1912; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_2 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1912; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_5 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1912; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    #endif
    __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[0]; __pyx_lineno = 1912; __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_L3_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_L3_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_L3_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_5);
    if (__Pyx_IternextUnpackEndCheck(__pyx_t_7(__pyx_t_6), 3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1912; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_7 = NULL;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    goto __pyx_L4_unpacking_done;
    __pyx_L3_unpacking_failed:;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_7 = NULL;
    if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1912; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_L4_unpacking_done:;
  }
  if (!(likely(PyDict_CheckExact(__pyx_t_3))||((__pyx_t_3) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "dict", Py_TYPE(__pyx_t_3)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1912; __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[0]; __pyx_lineno = 1912; __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[0]; __pyx_lineno = 1912; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF_SET(__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_pybuffernd_labels.rcbuffer->pybuffer);
    __pyx_t_9 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_labels.rcbuffer->pybuffer, (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_pybuffernd_labels.rcbuffer->pybuffer, (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_pybuffernd_labels.diminfo[0].strides = __pyx_pybuffernd_labels.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_labels.diminfo[0].shape = __pyx_pybuffernd_labels.rcbuffer->pybuffer.shape[0];
    if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1912; __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_pybuffernd_counts.rcbuffer->pybuffer);
    __pyx_t_9 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_counts.rcbuffer->pybuffer, (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_pybuffernd_counts.rcbuffer->pybuffer, (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_pybuffernd_counts.diminfo[0].strides = __pyx_pybuffernd_counts.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_counts.diminfo[0].shape = __pyx_pybuffernd_counts.rcbuffer->pybuffer.shape[0];
    if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1912; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_8 = 0;
  __pyx_v_counts = ((PyArrayObject *)__pyx_t_5);
  __pyx_t_5 = 0;

  /* "pandas/algos.pyx":1913
 * 
 *     ids, labels, counts = group_labels(values)
 *     seen = np.zeros_like(counts)             # <<<<<<<<<<<<<<
 * 
 *     # try not to get in trouble here...
 */
  __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1913; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_zeros_like); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1913; __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[0]; __pyx_lineno = 1913; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__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 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_4, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1913; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __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[0]; __pyx_lineno = 1913; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_8 = ((PyArrayObject *)__pyx_t_2);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_seen.rcbuffer->pybuffer);
    __pyx_t_9 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_seen.rcbuffer->pybuffer, (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_pybuffernd_seen.rcbuffer->pybuffer, (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_pybuffernd_seen.diminfo[0].strides = __pyx_pybuffernd_seen.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_seen.diminfo[0].shape = __pyx_pybuffernd_seen.rcbuffer->pybuffer.shape[0];
    if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1913; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_8 = 0;
  __pyx_v_seen = ((PyArrayObject *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "pandas/algos.pyx":1916
 * 
 *     # 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(__pyx_v_ids == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1916; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_1 = PyDict_Size(__pyx_v_ids); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1916; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_vecs = ((__pyx_t_5numpy_int64_t **)malloc((__pyx_t_1 * (sizeof(__pyx_t_5numpy_int64_t *)))));

  /* "pandas/algos.pyx":1917
 *     # 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[0]; __pyx_lineno = 1917; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_v_result = ((PyObject*)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "pandas/algos.pyx":1918
 *     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[0]; __pyx_lineno = 1918; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_1; __pyx_v_i++) {

    /* "pandas/algos.pyx":1919
 *     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_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1919; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_empty); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1919; __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_pybuffernd_counts.diminfo[0].shape;
    __pyx_t_2 = __Pyx_PyInt_From_npy_int64((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_counts.rcbuffer->pybuffer.buf, __pyx_t_13, __pyx_pybuffernd_counts.diminfo[0].strides))); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1919; __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 = 1919; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__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[0]; __pyx_lineno = 1919; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1919; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_int64); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1919; __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, __pyx_n_s_dtype, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1919; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_5, __pyx_t_2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1919; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __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;
    if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1919; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_8 = ((PyArrayObject *)__pyx_t_6);
    {
      __Pyx_BufFmt_StackElem __pyx_stack[1];
      __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_arr.rcbuffer->pybuffer);
      __pyx_t_9 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_arr.rcbuffer->pybuffer, (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_pybuffernd_arr.rcbuffer->pybuffer, (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_pybuffernd_arr.diminfo[0].strides = __pyx_pybuffernd_arr.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_arr.diminfo[0].shape = __pyx_pybuffernd_arr.rcbuffer->pybuffer.shape[0];
      if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1919; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_8 = 0;
    __Pyx_XDECREF_SET(__pyx_v_arr, ((PyArrayObject *)__pyx_t_6));
    __pyx_t_6 = 0;

    /* "pandas/algos.pyx":1920
 *     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
 * 
 */
    if (unlikely(__pyx_v_ids == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1920; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_6 = PyInt_FromSsize_t(__pyx_v_i); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1920; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_2 = __Pyx_PyDict_GetItem(__pyx_v_ids, __pyx_t_6); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1920; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (unlikely(PyDict_SetItem(__pyx_v_result, __pyx_t_2, ((PyObject *)__pyx_v_arr)) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1920; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "pandas/algos.pyx":1921
 *         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);
  }

  /* "pandas/algos.pyx":1923
 *         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++) {

    /* "pandas/algos.pyx":1924
 * 
 *     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_pybuffernd_labels.diminfo[0].shape;
    __pyx_v_k = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_labels.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_labels.diminfo[0].strides));

    /* "pandas/algos.pyx":1927
 * 
 *         # was NaN
 *         if k == -1:             # <<<<<<<<<<<<<<
 *             continue
 * 
 */
    __pyx_t_15 = ((__pyx_v_k == -1) != 0);
    if (__pyx_t_15) {

      /* "pandas/algos.pyx":1928
 *         # was NaN
 *         if k == -1:
 *             continue             # <<<<<<<<<<<<<<
 * 
 *         loc = seen[k]
 */
      goto __pyx_L7_continue;
    }

    /* "pandas/algos.pyx":1930
 *             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_pybuffernd_seen.diminfo[0].shape;
    __pyx_v_loc = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_seen.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_seen.diminfo[0].strides));

    /* "pandas/algos.pyx":1931
 * 
 *         loc = seen[k]
 *         vecs[k][loc] = i             # <<<<<<<<<<<<<<
 *         seen[k] = loc + 1
 * 
 */
    ((__pyx_v_vecs[__pyx_v_k])[__pyx_v_loc]) = __pyx_v_i;

    /* "pandas/algos.pyx":1932
 *         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_pybuffernd_seen.diminfo[0].shape;
    *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_seen.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_seen.diminfo[0].strides) = (__pyx_v_loc + 1);
    __pyx_L7_continue:;
  }

  /* "pandas/algos.pyx":1934
 *         seen[k] = loc + 1
 * 
 *     free(vecs)             # <<<<<<<<<<<<<<
 * 
 *     return result
 */
  free(__pyx_v_vecs);

  /* "pandas/algos.pyx":1936
 *     free(vecs)
 * 
 *     return result             # <<<<<<<<<<<<<<
 * 
 * @cython.wraparound(False)
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_result);
  __pyx_r = __pyx_v_result;
  goto __pyx_L0;

  /* "pandas/algos.pyx":1903
 * 
 * @cython.boundscheck(False)
 * def groupby_indices(ndarray values):             # <<<<<<<<<<<<<<
 *     cdef:
 *         Py_ssize_t i, n = len(values)
 */

  /* function exit code */
  __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_pybuffernd_arr.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_counts.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_labels.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_seen.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas.algos.groupby_indices", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_arr.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_counts.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_labels.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_seen.rcbuffer->pybuffer);
  __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;
}

/* "pandas/algos.pyx":1940
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def group_labels(ndarray[object] values):             # <<<<<<<<<<<<<<
 *     '''
 *     Compute label vector from input values and associated useful data
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pandas_5algos_61group_labels(PyObject *__pyx_self, PyObject *__pyx_v_values); /*proto*/
static char __pyx_doc_6pandas_5algos_60group_labels[] = "\n    Compute label vector from input values and associated useful data\n\n    Returns\n    -------\n    ";
static PyMethodDef __pyx_mdef_6pandas_5algos_61group_labels = {__Pyx_NAMESTR("group_labels"), (PyCFunction)__pyx_pw_6pandas_5algos_61group_labels, METH_O, __Pyx_DOCSTR(__pyx_doc_6pandas_5algos_60group_labels)};
static PyObject *__pyx_pw_6pandas_5algos_61group_labels(PyObject *__pyx_self, PyObject *__pyx_v_values) {
  CYTHON_UNUSED int __pyx_lineno = 0;
  CYTHON_UNUSED const char *__pyx_filename = NULL;
  CYTHON_UNUSED int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("group_labels (wrapper)", 0);
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1940; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_60group_labels(__pyx_self, ((PyArrayObject *)__pyx_v_values));

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pandas_5algos_60group_labels(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__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;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_counts;
  __Pyx_Buffer __pyx_pybuffer_counts;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_labels;
  __Pyx_Buffer __pyx_pybuffer_labels;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_values;
  __Pyx_Buffer __pyx_pybuffer_values;
  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;
  int __pyx_t_12;
  __pyx_t_5numpy_int64_t __pyx_t_13;
  Py_ssize_t __pyx_t_14;
  __pyx_t_5numpy_int64_t __pyx_t_15;
  Py_ssize_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("group_labels", 0);
  __pyx_pybuffer_labels.pybuffer.buf = NULL;
  __pyx_pybuffer_labels.refcount = 0;
  __pyx_pybuffernd_labels.data = NULL;
  __pyx_pybuffernd_labels.rcbuffer = &__pyx_pybuffer_labels;
  __pyx_pybuffer_counts.pybuffer.buf = NULL;
  __pyx_pybuffer_counts.refcount = 0;
  __pyx_pybuffernd_counts.data = NULL;
  __pyx_pybuffernd_counts.rcbuffer = &__pyx_pybuffer_counts;
  __pyx_pybuffer_values.pybuffer.buf = NULL;
  __pyx_pybuffer_values.refcount = 0;
  __pyx_pybuffernd_values.data = NULL;
  __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values;
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1940; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0];

  /* "pandas/algos.pyx":1948
 *     '''
 *     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(((PyObject *)__pyx_v_values)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1948; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_n = __pyx_t_1;

  /* "pandas/algos.pyx":1949
 *     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_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1949; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_empty); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1949; __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 = 1949; __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 = 1949; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__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 = 1949; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1949; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_int64); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1949; __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, __pyx_n_s_dtype, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1949; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1949; __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_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__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 = 1949; __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_pybuffernd_labels.rcbuffer->pybuffer, (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_pybuffernd_labels.rcbuffer->pybuffer.buf = NULL;
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1949; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    } else {__pyx_pybuffernd_labels.diminfo[0].strides = __pyx_pybuffernd_labels.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_labels.diminfo[0].shape = __pyx_pybuffernd_labels.rcbuffer->pybuffer.shape[0];
    }
  }
  __pyx_t_7 = 0;
  __pyx_v_labels = ((PyArrayObject *)__pyx_t_6);
  __pyx_t_6 = 0;

  /* "pandas/algos.pyx":1950
 *         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_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1950; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_empty); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1950; __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 = 1950; __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[0]; __pyx_lineno = 1950; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__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[0]; __pyx_lineno = 1950; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1950; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_int64); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1950; __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, __pyx_n_s_dtype, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1950; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, __pyx_t_6); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1950; __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_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__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[0]; __pyx_lineno = 1950; __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_pybuffernd_counts.rcbuffer->pybuffer, (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_pybuffernd_counts.rcbuffer->pybuffer.buf = NULL;
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1950; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    } else {__pyx_pybuffernd_counts.diminfo[0].strides = __pyx_pybuffernd_counts.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_counts.diminfo[0].shape = __pyx_pybuffernd_counts.rcbuffer->pybuffer.shape[0];
    }
  }
  __pyx_t_8 = 0;
  __pyx_v_counts = ((PyArrayObject *)__pyx_t_5);
  __pyx_t_5 = 0;

  /* "pandas/algos.pyx":1951
 *         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[0]; __pyx_lineno = 1951; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_v_ids = ((PyObject*)__pyx_t_5);
  __pyx_t_5 = 0;
  __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1951; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_v_reverse = ((PyObject*)__pyx_t_5);
  __pyx_t_5 = 0;

  /* "pandas/algos.pyx":1954
 *         int64_t idx
 *         object val
 *         int64_t count = 0             # <<<<<<<<<<<<<<
 * 
 *     for i from 0 <= i < n:
 */
  __pyx_v_count = 0;

  /* "pandas/algos.pyx":1956
 *         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++) {

    /* "pandas/algos.pyx":1957
 * 
 *     for i from 0 <= i < n:
 *         val = values[i]             # <<<<<<<<<<<<<<
 * 
 *         # is NaN
 */
    __pyx_t_9 = __pyx_v_i;
    __pyx_t_5 = (PyObject *) *__Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_9, __pyx_pybuffernd_values.diminfo[0].strides);
    __Pyx_INCREF((PyObject*)__pyx_t_5);
    __Pyx_XDECREF_SET(__pyx_v_val, __pyx_t_5);
    __pyx_t_5 = 0;

    /* "pandas/algos.pyx":1960
 * 
 *         # is NaN
 *         if val != val:             # <<<<<<<<<<<<<<
 *             labels[i] = -1
 *             continue
 */
    __pyx_t_5 = PyObject_RichCompare(__pyx_v_val, __pyx_v_val, Py_NE); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1960; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_10 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1960; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (__pyx_t_10) {

      /* "pandas/algos.pyx":1961
 *         # is NaN
 *         if val != val:
 *             labels[i] = -1             # <<<<<<<<<<<<<<
 *             continue
 * 
 */
      __pyx_t_11 = __pyx_v_i;
      *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_labels.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_labels.diminfo[0].strides) = -1;

      /* "pandas/algos.pyx":1962
 *         if val != val:
 *             labels[i] = -1
 *             continue             # <<<<<<<<<<<<<<
 * 
 *         # for large number of groups, not doing try: except: makes a big
 */
      goto __pyx_L3_continue;
    }

    /* "pandas/algos.pyx":1966
 *         # for large number of groups, not doing try: except: makes a big
 *         # difference
 *         if val in ids:             # <<<<<<<<<<<<<<
 *             idx = ids[val]
 *             labels[i] = idx
 */
    __pyx_t_10 = (__Pyx_PyDict_Contains(__pyx_v_val, __pyx_v_ids, Py_EQ)); if (unlikely(__pyx_t_10 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1966; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_12 = (__pyx_t_10 != 0);
    if (__pyx_t_12) {

      /* "pandas/algos.pyx":1967
 *         # difference
 *         if val in ids:
 *             idx = ids[val]             # <<<<<<<<<<<<<<
 *             labels[i] = idx
 *             counts[idx] = counts[idx] + 1
 */
      __pyx_t_5 = __Pyx_PyDict_GetItem(__pyx_v_ids, __pyx_v_val); if (unlikely(__pyx_t_5 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1967; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_13 = __Pyx_PyInt_As_npy_int64(__pyx_t_5); if (unlikely((__pyx_t_13 == (npy_int64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1967; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_v_idx = __pyx_t_13;

      /* "pandas/algos.pyx":1968
 *         if val in ids:
 *             idx = ids[val]
 *             labels[i] = idx             # <<<<<<<<<<<<<<
 *             counts[idx] = counts[idx] + 1
 *         else:
 */
      __pyx_t_14 = __pyx_v_i;
      *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_labels.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_labels.diminfo[0].strides) = __pyx_v_idx;

      /* "pandas/algos.pyx":1969
 *             idx = ids[val]
 *             labels[i] = idx
 *             counts[idx] = counts[idx] + 1             # <<<<<<<<<<<<<<
 *         else:
 *             ids[val] = count
 */
      __pyx_t_13 = __pyx_v_idx;
      __pyx_t_15 = __pyx_v_idx;
      *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_counts.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_counts.diminfo[0].strides) = ((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_counts.rcbuffer->pybuffer.buf, __pyx_t_13, __pyx_pybuffernd_counts.diminfo[0].strides)) + 1);
      goto __pyx_L6;
    }
    /*else*/ {

      /* "pandas/algos.pyx":1971
 *             counts[idx] = counts[idx] + 1
 *         else:
 *             ids[val] = count             # <<<<<<<<<<<<<<
 *             reverse[count] = val
 *             labels[i] = count
 */
      __pyx_t_5 = __Pyx_PyInt_From_npy_int64(__pyx_v_count); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1971; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      if (unlikely(PyDict_SetItem(__pyx_v_ids, __pyx_v_val, __pyx_t_5) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1971; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

      /* "pandas/algos.pyx":1972
 *         else:
 *             ids[val] = count
 *             reverse[count] = val             # <<<<<<<<<<<<<<
 *             labels[i] = count
 *             counts[count] = 1
 */
      __pyx_t_5 = __Pyx_PyInt_From_npy_int64(__pyx_v_count); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1972; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      if (unlikely(PyDict_SetItem(__pyx_v_reverse, __pyx_t_5, __pyx_v_val) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1972; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

      /* "pandas/algos.pyx":1973
 *             ids[val] = count
 *             reverse[count] = val
 *             labels[i] = count             # <<<<<<<<<<<<<<
 *             counts[count] = 1
 *             count += 1
 */
      __pyx_t_16 = __pyx_v_i;
      *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_labels.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_labels.diminfo[0].strides) = __pyx_v_count;

      /* "pandas/algos.pyx":1974
 *             reverse[count] = val
 *             labels[i] = count
 *             counts[count] = 1             # <<<<<<<<<<<<<<
 *             count += 1
 * 
 */
      __pyx_t_17 = __pyx_v_count;
      *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_counts.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_counts.diminfo[0].strides) = 1;

      /* "pandas/algos.pyx":1975
 *             labels[i] = count
 *             counts[count] = 1
 *             count += 1             # <<<<<<<<<<<<<<
 * 
 *     return reverse, labels, counts[:count].copy()
 */
      __pyx_v_count = (__pyx_v_count + 1);
    }
    __pyx_L6:;
    __pyx_L3_continue:;
  }

  /* "pandas/algos.pyx":1977
 *             count += 1
 * 
 *     return reverse, labels, counts[:count].copy()             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_5 = __Pyx_PyObject_GetSlice(((PyObject *)__pyx_v_counts), 0, __pyx_v_count, NULL, NULL, NULL, 0, 1, 0); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1977; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_copy); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1977; __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_PyObject_Call(__pyx_t_6, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1977; __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[0]; __pyx_lineno = 1977; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_INCREF(__pyx_v_reverse);
  PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_v_reverse);
  __Pyx_GIVEREF(__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 = __pyx_t_6;
  __pyx_t_6 = 0;
  goto __pyx_L0;

  /* "pandas/algos.pyx":1940
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def group_labels(ndarray[object] values):             # <<<<<<<<<<<<<<
 *     '''
 *     Compute label vector from input values and associated useful data
 */

  /* function exit code */
  __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_pybuffernd_counts.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_labels.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas.algos.group_labels", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_counts.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_labels.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer);
  __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;
}

/* "pandas/algos.pyx":1982
 * @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
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pandas_5algos_63groupsort_indexer(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_5algos_63groupsort_indexer = {__Pyx_NAMESTR("groupsort_indexer"), (PyCFunction)__pyx_pw_6pandas_5algos_63groupsort_indexer, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pw_6pandas_5algos_63groupsort_indexer(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyArrayObject *__pyx_v_index = 0;
  Py_ssize_t __pyx_v_ngroups;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("groupsort_indexer (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_index,&__pyx_n_s_ngroups,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_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 (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_index)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_ngroups)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("groupsort_indexer", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1982; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "groupsort_indexer") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1982; __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[0]; __pyx_lineno = 1982; __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[0]; __pyx_lineno = 1982; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas.algos.groupsort_indexer", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_index), __pyx_ptype_5numpy_ndarray, 1, "index", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1982; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_62groupsort_indexer(__pyx_self, __pyx_v_index, __pyx_v_ngroups);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pandas_5algos_62groupsort_indexer(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_index, 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;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_counts;
  __Pyx_Buffer __pyx_pybuffer_counts;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_index;
  __Pyx_Buffer __pyx_pybuffer_index;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_result;
  __Pyx_Buffer __pyx_pybuffer_result;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_where;
  __Pyx_Buffer __pyx_pybuffer_where;
  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;
  __Pyx_RefNannySetupContext("groupsort_indexer", 0);
  __pyx_pybuffer_counts.pybuffer.buf = NULL;
  __pyx_pybuffer_counts.refcount = 0;
  __pyx_pybuffernd_counts.data = NULL;
  __pyx_pybuffernd_counts.rcbuffer = &__pyx_pybuffer_counts;
  __pyx_pybuffer_where.pybuffer.buf = NULL;
  __pyx_pybuffer_where.refcount = 0;
  __pyx_pybuffernd_where.data = NULL;
  __pyx_pybuffernd_where.rcbuffer = &__pyx_pybuffer_where;
  __pyx_pybuffer_result.pybuffer.buf = NULL;
  __pyx_pybuffer_result.refcount = 0;
  __pyx_pybuffernd_result.data = NULL;
  __pyx_pybuffernd_result.rcbuffer = &__pyx_pybuffer_result;
  __pyx_pybuffer_index.pybuffer.buf = NULL;
  __pyx_pybuffer_index.refcount = 0;
  __pyx_pybuffernd_index.data = NULL;
  __pyx_pybuffernd_index.rcbuffer = &__pyx_pybuffer_index;
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_index.rcbuffer->pybuffer, (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[0]; __pyx_lineno = 1982; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_index.diminfo[0].strides = __pyx_pybuffernd_index.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_index.diminfo[0].shape = __pyx_pybuffernd_index.rcbuffer->pybuffer.shape[0];

  /* "pandas/algos.pyx":1988
 * 
 *     # 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_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1988; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1988; __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[0]; __pyx_lineno = 1988; __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 = 1988; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__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[0]; __pyx_lineno = 1988; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1988; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_int64); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1988; __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, __pyx_n_s_dtype, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1988; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1988; __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_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__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[0]; __pyx_lineno = 1988; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_6 = ((PyArrayObject *)__pyx_t_5);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_counts.rcbuffer->pybuffer);
    __pyx_t_7 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_counts.rcbuffer->pybuffer, (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_pybuffernd_counts.rcbuffer->pybuffer, (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_pybuffernd_counts.diminfo[0].strides = __pyx_pybuffernd_counts.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_counts.diminfo[0].shape = __pyx_pybuffernd_counts.rcbuffer->pybuffer.shape[0];
    if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1988; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_6 = 0;
  __pyx_v_counts = ((PyArrayObject *)__pyx_t_5);
  __pyx_t_5 = 0;

  /* "pandas/algos.pyx":1989
 *     # 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[0]; __pyx_lineno = 1989; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_n = __pyx_t_11;

  /* "pandas/algos.pyx":1990
 *     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++) {

    /* "pandas/algos.pyx":1991
 *     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_pybuffernd_index.rcbuffer->pybuffer.buf, __pyx_t_12, __pyx_pybuffernd_index.diminfo[0].strides)) + 1);
    *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_counts.rcbuffer->pybuffer.buf, __pyx_t_13, __pyx_pybuffernd_counts.diminfo[0].strides) += 1;
  }

  /* "pandas/algos.pyx":1994
 * 
 *     # 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_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1994; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_zeros); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1994; __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[0]; __pyx_lineno = 1994; __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 = 1994; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__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 = 1994; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1994; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_int64); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1994; __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, __pyx_n_s_dtype, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1994; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, __pyx_t_5); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1994; __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_DECREF(__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[0]; __pyx_lineno = 1994; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_6 = ((PyArrayObject *)__pyx_t_4);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_where.rcbuffer->pybuffer);
    __pyx_t_7 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_where.rcbuffer->pybuffer, (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_pybuffernd_where.rcbuffer->pybuffer, (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_pybuffernd_where.diminfo[0].strides = __pyx_pybuffernd_where.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_where.diminfo[0].shape = __pyx_pybuffernd_where.rcbuffer->pybuffer.shape[0];
    if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1994; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_6 = 0;
  __pyx_v_where = ((PyArrayObject *)__pyx_t_4);
  __pyx_t_4 = 0;

  /* "pandas/algos.pyx":1995
 *     # 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++) {

    /* "pandas/algos.pyx":1996
 *     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_pybuffernd_where.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_where.diminfo[0].strides) = ((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_where.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_where.diminfo[0].strides)) + (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_counts.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_counts.diminfo[0].strides)));
  }

  /* "pandas/algos.pyx":1999
 * 
 *     # 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_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1999; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_zeros); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1999; __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[0]; __pyx_lineno = 1999; __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 = 1999; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__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 = 1999; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1999; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_int64); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1999; __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, __pyx_n_s_dtype, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1999; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1999; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __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[0]; __pyx_lineno = 1999; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_6 = ((PyArrayObject *)__pyx_t_2);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer);
    __pyx_t_7 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_result.rcbuffer->pybuffer, (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_pybuffernd_result.rcbuffer->pybuffer, (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_pybuffernd_result.diminfo[0].strides = __pyx_pybuffernd_result.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_result.diminfo[0].shape = __pyx_pybuffernd_result.rcbuffer->pybuffer.shape[0];
    if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1999; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_6 = 0;
  __pyx_v_result = ((PyArrayObject *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "pandas/algos.pyx":2000
 *     # 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++) {

    /* "pandas/algos.pyx":2001
 *     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_pybuffernd_index.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_index.diminfo[0].strides)) + 1);

    /* "pandas/algos.pyx":2002
 *     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_pybuffernd_where.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_where.diminfo[0].strides));
    *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_19, __pyx_pybuffernd_result.diminfo[0].strides) = __pyx_v_i;

    /* "pandas/algos.pyx":2003
 *         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_pybuffernd_where.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_where.diminfo[0].strides) += 1;
  }

  /* "pandas/algos.pyx":2005
 *         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[0]; __pyx_lineno = 2005; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__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 = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "pandas/algos.pyx":1982
 * @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
 */

  /* function exit code */
  __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_pybuffernd_counts.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_index.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_where.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas.algos.groupsort_indexer", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_counts.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_index.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_where.rcbuffer->pybuffer);
  __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;
}

/* "pandas/algos.pyx":2013
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def group_nth_object(ndarray[object, ndim=2] out,             # <<<<<<<<<<<<<<
 *                      ndarray[int64_t] counts,
 *                      ndarray[object, ndim=2] values,
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pandas_5algos_65group_nth_object(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6pandas_5algos_64group_nth_object[] = "\n    Only aggregates on axis=0\n    ";
static PyMethodDef __pyx_mdef_6pandas_5algos_65group_nth_object = {__Pyx_NAMESTR("group_nth_object"), (PyCFunction)__pyx_pw_6pandas_5algos_65group_nth_object, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6pandas_5algos_64group_nth_object)};
static PyObject *__pyx_pw_6pandas_5algos_65group_nth_object(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;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("group_nth_object (wrapper)", 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};
    PyObject* values[5] = {0,0,0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_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 (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_out)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_counts)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("group_nth_object", 1, 5, 5, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2013; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("group_nth_object", 1, 5, 5, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2013; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  3:
        if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_labels)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("group_nth_object", 1, 5, 5, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2013; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  4:
        if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_rank)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("group_nth_object", 1, 5, 5, 4); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2013; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "group_nth_object") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2013; __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_As_npy_int64(values[4]); if (unlikely((__pyx_v_rank == (npy_int64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2017; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("group_nth_object", 1, 5, 5, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2013; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas.algos.group_nth_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_out), __pyx_ptype_5numpy_ndarray, 1, "out", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2013; __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[0]; __pyx_lineno = 2014; __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[0]; __pyx_lineno = 2015; __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[0]; __pyx_lineno = 2016; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_64group_nth_object(__pyx_self, __pyx_v_out, __pyx_v_counts, __pyx_v_values, __pyx_v_labels, __pyx_v_rank);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pandas_5algos_64group_nth_object(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_out, PyArrayObject *__pyx_v_counts, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_labels, __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;
  PyObject *__pyx_v_val = 0;
  PyArrayObject *__pyx_v_nobs = 0;
  PyArrayObject *__pyx_v_resx = 0;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_counts;
  __Pyx_Buffer __pyx_pybuffer_counts;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_labels;
  __Pyx_Buffer __pyx_pybuffer_labels;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_nobs;
  __Pyx_Buffer __pyx_pybuffer_nobs;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_out;
  __Pyx_Buffer __pyx_pybuffer_out;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_resx;
  __Pyx_Buffer __pyx_pybuffer_resx;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_values;
  __Pyx_Buffer __pyx_pybuffer_values;
  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;
  PyObject **__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;
  __Pyx_RefNannySetupContext("group_nth_object", 0);
  __pyx_pybuffer_nobs.pybuffer.buf = NULL;
  __pyx_pybuffer_nobs.refcount = 0;
  __pyx_pybuffernd_nobs.data = NULL;
  __pyx_pybuffernd_nobs.rcbuffer = &__pyx_pybuffer_nobs;
  __pyx_pybuffer_resx.pybuffer.buf = NULL;
  __pyx_pybuffer_resx.refcount = 0;
  __pyx_pybuffernd_resx.data = NULL;
  __pyx_pybuffernd_resx.rcbuffer = &__pyx_pybuffer_resx;
  __pyx_pybuffer_out.pybuffer.buf = NULL;
  __pyx_pybuffer_out.refcount = 0;
  __pyx_pybuffernd_out.data = NULL;
  __pyx_pybuffernd_out.rcbuffer = &__pyx_pybuffer_out;
  __pyx_pybuffer_counts.pybuffer.buf = NULL;
  __pyx_pybuffer_counts.refcount = 0;
  __pyx_pybuffernd_counts.data = NULL;
  __pyx_pybuffernd_counts.rcbuffer = &__pyx_pybuffer_counts;
  __pyx_pybuffer_values.pybuffer.buf = NULL;
  __pyx_pybuffer_values.refcount = 0;
  __pyx_pybuffernd_values.data = NULL;
  __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values;
  __pyx_pybuffer_labels.pybuffer.buf = NULL;
  __pyx_pybuffer_labels.refcount = 0;
  __pyx_pybuffernd_labels.data = NULL;
  __pyx_pybuffernd_labels.rcbuffer = &__pyx_pybuffer_labels;
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_out.rcbuffer->pybuffer, (PyObject*)__pyx_v_out, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2013; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_out.diminfo[0].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_out.diminfo[0].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_out.diminfo[1].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_out.diminfo[1].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[1];
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_counts.rcbuffer->pybuffer, (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[0]; __pyx_lineno = 2013; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_counts.diminfo[0].strides = __pyx_pybuffernd_counts.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_counts.diminfo[0].shape = __pyx_pybuffernd_counts.rcbuffer->pybuffer.shape[0];
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2013; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_values.diminfo[1].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_values.diminfo[1].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[1];
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_labels.rcbuffer->pybuffer, (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[0]; __pyx_lineno = 2013; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_labels.diminfo[0].strides = __pyx_pybuffernd_labels.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_labels.diminfo[0].shape = __pyx_pybuffernd_labels.rcbuffer->pybuffer.shape[0];

  /* "pandas/algos.pyx":2028
 *         ndarray[object, ndim=2] resx
 * 
 *     nobs = np.zeros((<object> out).shape, dtype=np.int64)             # <<<<<<<<<<<<<<
 *     resx = np.empty((<object> out).shape, dtype=object)
 * 
 */
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2028; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2028; __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_PyObject_GetAttrStr(((PyObject *)__pyx_v_out), __pyx_n_s_shape); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2028; __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 = 2028; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__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[0]; __pyx_lineno = 2028; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2028; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_int64); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2028; __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, __pyx_n_s_dtype, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2028; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2028; __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_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__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[0]; __pyx_lineno = 2028; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_6 = ((PyArrayObject *)__pyx_t_5);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer);
    __pyx_t_7 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer, (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_pybuffernd_nobs.rcbuffer->pybuffer, (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_pybuffernd_nobs.diminfo[0].strides = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_nobs.diminfo[0].shape = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_nobs.diminfo[1].strides = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_nobs.diminfo[1].shape = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.shape[1];
    if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2028; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_6 = 0;
  __pyx_v_nobs = ((PyArrayObject *)__pyx_t_5);
  __pyx_t_5 = 0;

  /* "pandas/algos.pyx":2029
 * 
 *     nobs = np.zeros((<object> out).shape, dtype=np.int64)
 *     resx = np.empty((<object> out).shape, dtype=object)             # <<<<<<<<<<<<<<
 * 
 *     N, K = (<object> values).shape
 */
  __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2029; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_empty); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2029; __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_PyObject_GetAttrStr(((PyObject *)__pyx_v_out), __pyx_n_s_shape); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2029; __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 = 2029; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__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 = 2029; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_dtype, __pyx_builtin_object) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2029; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, __pyx_t_5); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2029; __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_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 = 2029; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_11 = ((PyArrayObject *)__pyx_t_2);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_resx.rcbuffer->pybuffer);
    __pyx_t_7 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_resx.rcbuffer->pybuffer, (PyObject*)__pyx_t_11, &__Pyx_TypeInfo_object, 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_pybuffernd_resx.rcbuffer->pybuffer, (PyObject*)__pyx_v_resx, &__Pyx_TypeInfo_object, 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_pybuffernd_resx.diminfo[0].strides = __pyx_pybuffernd_resx.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_resx.diminfo[0].shape = __pyx_pybuffernd_resx.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_resx.diminfo[1].strides = __pyx_pybuffernd_resx.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_resx.diminfo[1].shape = __pyx_pybuffernd_resx.rcbuffer->pybuffer.shape[1];
    if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2029; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_11 = 0;
  __pyx_v_resx = ((PyArrayObject *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "pandas/algos.pyx":2031
 *     resx = np.empty((<object> out).shape, dtype=object)
 * 
 *     N, K = (<object> values).shape             # <<<<<<<<<<<<<<
 * 
 *     for i in range(N):
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_values), __pyx_n_s_shape); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2031; __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 CYTHON_COMPILING_IN_CPYTHON
    Py_ssize_t size = Py_SIZE(sequence);
    #else
    Py_ssize_t size = PySequence_Size(sequence);
    #endif
    if (unlikely(size != 2)) {
      if (size > 2) __Pyx_RaiseTooManyValuesError(2);
      else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2031; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    #if CYTHON_COMPILING_IN_CPYTHON
    if (likely(PyTuple_CheckExact(sequence))) {
      __pyx_t_5 = PyTuple_GET_ITEM(sequence, 0); 
      __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1); 
    } else {
      __pyx_t_5 = PyList_GET_ITEM(sequence, 0); 
      __pyx_t_3 = PyList_GET_ITEM(sequence, 1); 
    }
    __Pyx_INCREF(__pyx_t_5);
    __Pyx_INCREF(__pyx_t_3);
    #else
    __pyx_t_5 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2031; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2031; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    #endif
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  } else {
    Py_ssize_t index = -1;
    __pyx_t_1 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2031; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_12 = Py_TYPE(__pyx_t_1)->tp_iternext;
    index = 0; __pyx_t_5 = __pyx_t_12(__pyx_t_1); if (unlikely(!__pyx_t_5)) goto __pyx_L3_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_5);
    index = 1; __pyx_t_3 = __pyx_t_12(__pyx_t_1); if (unlikely(!__pyx_t_3)) goto __pyx_L3_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_3);
    if (__Pyx_IternextUnpackEndCheck(__pyx_t_12(__pyx_t_1), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2031; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_12 = NULL;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    goto __pyx_L4_unpacking_done;
    __pyx_L3_unpacking_failed:;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_12 = NULL;
    if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2031; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_L4_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[0]; __pyx_lineno = 2031; __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_3); if (unlikely((__pyx_t_14 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2031; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_v_N = __pyx_t_13;
  __pyx_v_K = __pyx_t_14;

  /* "pandas/algos.pyx":2033
 *     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;

    /* "pandas/algos.pyx":2034
 * 
 *     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_pybuffernd_labels.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_labels.diminfo[0].strides));

    /* "pandas/algos.pyx":2035
 *     for i in range(N):
 *         lab = labels[i]
 *         if lab < 0:             # <<<<<<<<<<<<<<
 *             continue
 * 
 */
    __pyx_t_16 = ((__pyx_v_lab < 0) != 0);
    if (__pyx_t_16) {

      /* "pandas/algos.pyx":2036
 *         lab = labels[i]
 *         if lab < 0:
 *             continue             # <<<<<<<<<<<<<<
 * 
 *         counts[lab] += 1
 */
      goto __pyx_L5_continue;
    }

    /* "pandas/algos.pyx":2038
 *             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_pybuffernd_counts.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_counts.diminfo[0].strides) += 1;

    /* "pandas/algos.pyx":2039
 * 
 *         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;

      /* "pandas/algos.pyx":2040
 *         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_t_2 = (PyObject *) *__Pyx_BufPtrStrided2d(PyObject **, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_values.diminfo[0].strides, __pyx_t_21, __pyx_pybuffernd_values.diminfo[1].strides);
      __Pyx_INCREF((PyObject*)__pyx_t_2);
      __Pyx_XDECREF_SET(__pyx_v_val, __pyx_t_2);
      __pyx_t_2 = 0;

      /* "pandas/algos.pyx":2043
 * 
 *             # not nan
 *             if val == val:             # <<<<<<<<<<<<<<
 *                 nobs[lab, j] += 1
 *                 if nobs[lab, j] == rank:
 */
      __pyx_t_2 = PyObject_RichCompare(__pyx_v_val, __pyx_v_val, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2043; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_t_16 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_16 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2043; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      if (__pyx_t_16) {

        /* "pandas/algos.pyx":2044
 *             # 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_pybuffernd_nobs.rcbuffer->pybuffer.buf, __pyx_t_22, __pyx_pybuffernd_nobs.diminfo[0].strides, __pyx_t_23, __pyx_pybuffernd_nobs.diminfo[1].strides) += 1;

        /* "pandas/algos.pyx":2045
 *             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_pybuffernd_nobs.rcbuffer->pybuffer.buf, __pyx_t_24, __pyx_pybuffernd_nobs.diminfo[0].strides, __pyx_t_25, __pyx_pybuffernd_nobs.diminfo[1].strides)) == __pyx_v_rank) != 0);
        if (__pyx_t_16) {

          /* "pandas/algos.pyx":2046
 *                 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_t_28 = __Pyx_BufPtrStrided2d(PyObject **, __pyx_pybuffernd_resx.rcbuffer->pybuffer.buf, __pyx_t_26, __pyx_pybuffernd_resx.diminfo[0].strides, __pyx_t_27, __pyx_pybuffernd_resx.diminfo[1].strides);
          __Pyx_GOTREF(*__pyx_t_28);
          __Pyx_INCREF(__pyx_v_val); __Pyx_DECREF(*__pyx_t_28);
          *__pyx_t_28 = __pyx_v_val;
          __Pyx_GIVEREF(*__pyx_t_28);
          goto __pyx_L11;
        }
        __pyx_L11:;
        goto __pyx_L10;
      }
      __pyx_L10:;
    }
    __pyx_L5_continue:;
  }

  /* "pandas/algos.pyx":2048
 *                     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[0]; __pyx_lineno = 2048; __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;

    /* "pandas/algos.pyx":2049
 * 
 *     for i in range(len(counts)):
 *         for j in range(K):             # <<<<<<<<<<<<<<
 *             if nobs[i, j] == 0:
 *                 out[i, j] = <object> 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;

      /* "pandas/algos.pyx":2050
 *     for i in range(len(counts)):
 *         for j in range(K):
 *             if nobs[i, j] == 0:             # <<<<<<<<<<<<<<
 *                 out[i, j] = <object> nan
 *             else:
 */
      __pyx_t_29 = __pyx_v_i;
      __pyx_t_30 = __pyx_v_j;
      __pyx_t_16 = (((*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_nobs.rcbuffer->pybuffer.buf, __pyx_t_29, __pyx_pybuffernd_nobs.diminfo[0].strides, __pyx_t_30, __pyx_pybuffernd_nobs.diminfo[1].strides)) == 0) != 0);
      if (__pyx_t_16) {

        /* "pandas/algos.pyx":2051
 *         for j in range(K):
 *             if nobs[i, j] == 0:
 *                 out[i, j] = <object> nan             # <<<<<<<<<<<<<<
 *             else:
 *                 out[i, j] = resx[i, j]
 */
        __pyx_t_2 = PyFloat_FromDouble(__pyx_v_6pandas_5algos_nan); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2051; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_2);
        __pyx_t_3 = __pyx_t_2;
        __Pyx_INCREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __pyx_t_31 = __pyx_v_i;
        __pyx_t_32 = __pyx_v_j;
        __pyx_t_28 = __Pyx_BufPtrStrided2d(PyObject **, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_31, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_32, __pyx_pybuffernd_out.diminfo[1].strides);
        __Pyx_GOTREF(*__pyx_t_28);
        __Pyx_INCREF(__pyx_t_3); __Pyx_DECREF(*__pyx_t_28);
        *__pyx_t_28 = __pyx_t_3;
        __Pyx_GIVEREF(*__pyx_t_28);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        goto __pyx_L16;
      }
      /*else*/ {

        /* "pandas/algos.pyx":2053
 *                 out[i, j] = <object> 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_3 = (PyObject *) *__Pyx_BufPtrStrided2d(PyObject **, __pyx_pybuffernd_resx.rcbuffer->pybuffer.buf, __pyx_t_33, __pyx_pybuffernd_resx.diminfo[0].strides, __pyx_t_34, __pyx_pybuffernd_resx.diminfo[1].strides);
        __Pyx_INCREF((PyObject*)__pyx_t_3);
        __pyx_t_35 = __pyx_v_i;
        __pyx_t_36 = __pyx_v_j;
        __pyx_t_28 = __Pyx_BufPtrStrided2d(PyObject **, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_35, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_36, __pyx_pybuffernd_out.diminfo[1].strides);
        __Pyx_GOTREF(*__pyx_t_28);
        __Pyx_INCREF(__pyx_t_3); __Pyx_DECREF(*__pyx_t_28);
        *__pyx_t_28 = __pyx_t_3;
        __Pyx_GIVEREF(*__pyx_t_28);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      }
      __pyx_L16:;
    }
  }

  /* "pandas/algos.pyx":2013
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def group_nth_object(ndarray[object, ndim=2] out,             # <<<<<<<<<<<<<<
 *                      ndarray[int64_t] counts,
 *                      ndarray[object, ndim=2] values,
 */

  /* function exit code */
  __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_pybuffernd_counts.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_labels.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_resx.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas.algos.group_nth_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_counts.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_labels.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_resx.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer);
  __pyx_L2:;
  __Pyx_XDECREF(__pyx_v_val);
  __Pyx_XDECREF((PyObject *)__pyx_v_nobs);
  __Pyx_XDECREF((PyObject *)__pyx_v_resx);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/algos.pyx":2057
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def group_nth_bin_object(ndarray[object, ndim=2] out,             # <<<<<<<<<<<<<<
 *                          ndarray[int64_t] counts,
 *                          ndarray[object, ndim=2] values,
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pandas_5algos_67group_nth_bin_object(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6pandas_5algos_66group_nth_bin_object[] = "\n    Only aggregates on axis=0\n    ";
static PyMethodDef __pyx_mdef_6pandas_5algos_67group_nth_bin_object = {__Pyx_NAMESTR("group_nth_bin_object"), (PyCFunction)__pyx_pw_6pandas_5algos_67group_nth_bin_object, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6pandas_5algos_66group_nth_bin_object)};
static PyObject *__pyx_pw_6pandas_5algos_67group_nth_bin_object(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;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("group_nth_bin_object (wrapper)", 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};
    PyObject* values[5] = {0,0,0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_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 (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_out)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_counts)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("group_nth_bin_object", 1, 5, 5, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2057; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("group_nth_bin_object", 1, 5, 5, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2057; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  3:
        if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_bins)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("group_nth_bin_object", 1, 5, 5, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2057; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  4:
        if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_rank)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("group_nth_bin_object", 1, 5, 5, 4); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2057; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "group_nth_bin_object") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2057; __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_As_npy_int64(values[4]); if (unlikely((__pyx_v_rank == (npy_int64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2060; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("group_nth_bin_object", 1, 5, 5, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2057; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas.algos.group_nth_bin_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_out), __pyx_ptype_5numpy_ndarray, 1, "out", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2057; __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[0]; __pyx_lineno = 2058; __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[0]; __pyx_lineno = 2059; __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[0]; __pyx_lineno = 2060; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_66group_nth_bin_object(__pyx_self, __pyx_v_out, __pyx_v_counts, __pyx_v_values, __pyx_v_bins, __pyx_v_rank);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pandas_5algos_66group_nth_bin_object(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_out, PyArrayObject *__pyx_v_counts, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_bins, __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;
  PyObject *__pyx_v_val = 0;
  PyArrayObject *__pyx_v_resx = 0;
  PyArrayObject *__pyx_v_nobs = 0;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_bins;
  __Pyx_Buffer __pyx_pybuffer_bins;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_counts;
  __Pyx_Buffer __pyx_pybuffer_counts;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_nobs;
  __Pyx_Buffer __pyx_pybuffer_nobs;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_out;
  __Pyx_Buffer __pyx_pybuffer_out;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_resx;
  __Pyx_Buffer __pyx_pybuffer_resx;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_values;
  __Pyx_Buffer __pyx_pybuffer_values;
  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;
  Py_ssize_t __pyx_t_12;
  Py_ssize_t __pyx_t_13;
  Py_ssize_t __pyx_t_14;
  int __pyx_t_15;
  PyObject *(*__pyx_t_16)(PyObject *);
  Py_ssize_t __pyx_t_17;
  int __pyx_t_18;
  int __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;
  PyObject **__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;
  __Pyx_RefNannySetupContext("group_nth_bin_object", 0);
  __pyx_pybuffer_resx.pybuffer.buf = NULL;
  __pyx_pybuffer_resx.refcount = 0;
  __pyx_pybuffernd_resx.data = NULL;
  __pyx_pybuffernd_resx.rcbuffer = &__pyx_pybuffer_resx;
  __pyx_pybuffer_nobs.pybuffer.buf = NULL;
  __pyx_pybuffer_nobs.refcount = 0;
  __pyx_pybuffernd_nobs.data = NULL;
  __pyx_pybuffernd_nobs.rcbuffer = &__pyx_pybuffer_nobs;
  __pyx_pybuffer_out.pybuffer.buf = NULL;
  __pyx_pybuffer_out.refcount = 0;
  __pyx_pybuffernd_out.data = NULL;
  __pyx_pybuffernd_out.rcbuffer = &__pyx_pybuffer_out;
  __pyx_pybuffer_counts.pybuffer.buf = NULL;
  __pyx_pybuffer_counts.refcount = 0;
  __pyx_pybuffernd_counts.data = NULL;
  __pyx_pybuffernd_counts.rcbuffer = &__pyx_pybuffer_counts;
  __pyx_pybuffer_values.pybuffer.buf = NULL;
  __pyx_pybuffer_values.refcount = 0;
  __pyx_pybuffernd_values.data = NULL;
  __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values;
  __pyx_pybuffer_bins.pybuffer.buf = NULL;
  __pyx_pybuffer_bins.refcount = 0;
  __pyx_pybuffernd_bins.data = NULL;
  __pyx_pybuffernd_bins.rcbuffer = &__pyx_pybuffer_bins;
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_out.rcbuffer->pybuffer, (PyObject*)__pyx_v_out, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2057; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_out.diminfo[0].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_out.diminfo[0].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_out.diminfo[1].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_out.diminfo[1].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[1];
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_counts.rcbuffer->pybuffer, (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[0]; __pyx_lineno = 2057; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_counts.diminfo[0].strides = __pyx_pybuffernd_counts.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_counts.diminfo[0].shape = __pyx_pybuffernd_counts.rcbuffer->pybuffer.shape[0];
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2057; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_values.diminfo[1].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_values.diminfo[1].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[1];
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_bins.rcbuffer->pybuffer, (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[0]; __pyx_lineno = 2057; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_bins.diminfo[0].strides = __pyx_pybuffernd_bins.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_bins.diminfo[0].shape = __pyx_pybuffernd_bins.rcbuffer->pybuffer.shape[0];

  /* "pandas/algos.pyx":2071
 *         ndarray[float64_t, ndim=2] nobs
 * 
 *     nobs = np.zeros((<object> out).shape, dtype=np.float64)             # <<<<<<<<<<<<<<
 *     resx = np.empty((<object> out).shape, dtype=object)
 * 
 */
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2071; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2071; __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_PyObject_GetAttrStr(((PyObject *)__pyx_v_out), __pyx_n_s_shape); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2071; __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 = 2071; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__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[0]; __pyx_lineno = 2071; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2071; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_float64); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2071; __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, __pyx_n_s_dtype, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2071; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2071; __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_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__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[0]; __pyx_lineno = 2071; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_6 = ((PyArrayObject *)__pyx_t_5);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer);
    __pyx_t_7 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer, (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_7 < 0)) {
      PyErr_Fetch(&__pyx_t_8, &__pyx_t_9, &__pyx_t_10);
      if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer, (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_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_pybuffernd_nobs.diminfo[0].strides = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_nobs.diminfo[0].shape = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_nobs.diminfo[1].strides = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_nobs.diminfo[1].shape = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.shape[1];
    if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2071; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_6 = 0;
  __pyx_v_nobs = ((PyArrayObject *)__pyx_t_5);
  __pyx_t_5 = 0;

  /* "pandas/algos.pyx":2072
 * 
 *     nobs = np.zeros((<object> out).shape, dtype=np.float64)
 *     resx = np.empty((<object> out).shape, dtype=object)             # <<<<<<<<<<<<<<
 * 
 *     if bins[len(bins) - 1] == len(values):
 */
  __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2072; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_empty); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2072; __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_PyObject_GetAttrStr(((PyObject *)__pyx_v_out), __pyx_n_s_shape); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2072; __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 = 2072; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__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 = 2072; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_dtype, __pyx_builtin_object) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2072; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, __pyx_t_5); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2072; __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_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 = 2072; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_11 = ((PyArrayObject *)__pyx_t_2);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_resx.rcbuffer->pybuffer);
    __pyx_t_7 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_resx.rcbuffer->pybuffer, (PyObject*)__pyx_t_11, &__Pyx_TypeInfo_object, 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_pybuffernd_resx.rcbuffer->pybuffer, (PyObject*)__pyx_v_resx, &__Pyx_TypeInfo_object, 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_pybuffernd_resx.diminfo[0].strides = __pyx_pybuffernd_resx.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_resx.diminfo[0].shape = __pyx_pybuffernd_resx.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_resx.diminfo[1].strides = __pyx_pybuffernd_resx.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_resx.diminfo[1].shape = __pyx_pybuffernd_resx.rcbuffer->pybuffer.shape[1];
    if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2072; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_11 = 0;
  __pyx_v_resx = ((PyArrayObject *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "pandas/algos.pyx":2074
 *     resx = np.empty((<object> out).shape, dtype=object)
 * 
 *     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[0]; __pyx_lineno = 2074; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_13 = (__pyx_t_12 - 1);
  __pyx_t_14 = PyObject_Length(((PyObject *)__pyx_v_values)); if (unlikely(__pyx_t_14 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2074; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_15 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_bins.rcbuffer->pybuffer.buf, __pyx_t_13, __pyx_pybuffernd_bins.diminfo[0].strides)) == __pyx_t_14) != 0);
  if (__pyx_t_15) {

    /* "pandas/algos.pyx":2075
 * 
 *     if bins[len(bins) - 1] == len(values):
 *         ngroups = len(bins)             # <<<<<<<<<<<<<<
 *     else:
 *         ngroups = len(bins) + 1
 */
    __pyx_t_14 = PyObject_Length(((PyObject *)__pyx_v_bins)); if (unlikely(__pyx_t_14 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2075; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_v_ngroups = __pyx_t_14;
    goto __pyx_L3;
  }
  /*else*/ {

    /* "pandas/algos.pyx":2077
 *         ngroups = len(bins)
 *     else:
 *         ngroups = len(bins) + 1             # <<<<<<<<<<<<<<
 * 
 *     N, K = (<object> values).shape
 */
    __pyx_t_14 = PyObject_Length(((PyObject *)__pyx_v_bins)); if (unlikely(__pyx_t_14 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2077; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_v_ngroups = (__pyx_t_14 + 1);
  }
  __pyx_L3:;

  /* "pandas/algos.pyx":2079
 *         ngroups = len(bins) + 1
 * 
 *     N, K = (<object> values).shape             # <<<<<<<<<<<<<<
 * 
 *     b = 0
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_values), __pyx_n_s_shape); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2079; __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 CYTHON_COMPILING_IN_CPYTHON
    Py_ssize_t size = Py_SIZE(sequence);
    #else
    Py_ssize_t size = PySequence_Size(sequence);
    #endif
    if (unlikely(size != 2)) {
      if (size > 2) __Pyx_RaiseTooManyValuesError(2);
      else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2079; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    #if CYTHON_COMPILING_IN_CPYTHON
    if (likely(PyTuple_CheckExact(sequence))) {
      __pyx_t_5 = PyTuple_GET_ITEM(sequence, 0); 
      __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1); 
    } else {
      __pyx_t_5 = PyList_GET_ITEM(sequence, 0); 
      __pyx_t_3 = PyList_GET_ITEM(sequence, 1); 
    }
    __Pyx_INCREF(__pyx_t_5);
    __Pyx_INCREF(__pyx_t_3);
    #else
    __pyx_t_5 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2079; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2079; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    #endif
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  } else {
    Py_ssize_t index = -1;
    __pyx_t_1 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2079; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_16 = Py_TYPE(__pyx_t_1)->tp_iternext;
    index = 0; __pyx_t_5 = __pyx_t_16(__pyx_t_1); if (unlikely(!__pyx_t_5)) goto __pyx_L4_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_5);
    index = 1; __pyx_t_3 = __pyx_t_16(__pyx_t_1); if (unlikely(!__pyx_t_3)) goto __pyx_L4_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_3);
    if (__Pyx_IternextUnpackEndCheck(__pyx_t_16(__pyx_t_1), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2079; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_16 = NULL;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    goto __pyx_L5_unpacking_done;
    __pyx_L4_unpacking_failed:;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_16 = NULL;
    if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2079; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_L5_unpacking_done:;
  }
  __pyx_t_14 = __Pyx_PyIndex_AsSsize_t(__pyx_t_5); if (unlikely((__pyx_t_14 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2079; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 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[0]; __pyx_lineno = 2079; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_v_N = __pyx_t_14;
  __pyx_v_K = __pyx_t_12;

  /* "pandas/algos.pyx":2081
 *     N, K = (<object> values).shape
 * 
 *     b = 0             # <<<<<<<<<<<<<<
 *     for i in range(N):
 *         while b < ngroups - 1 and i >= bins[b]:
 */
  __pyx_v_b = 0;

  /* "pandas/algos.pyx":2082
 * 
 *     b = 0
 *     for i in range(N):             # <<<<<<<<<<<<<<
 *         while b < ngroups - 1 and i >= bins[b]:
 *             b += 1
 */
  __pyx_t_12 = __pyx_v_N;
  for (__pyx_t_14 = 0; __pyx_t_14 < __pyx_t_12; __pyx_t_14+=1) {
    __pyx_v_i = __pyx_t_14;

    /* "pandas/algos.pyx":2083
 *     b = 0
 *     for i in range(N):
 *         while b < ngroups - 1 and i >= bins[b]:             # <<<<<<<<<<<<<<
 *             b += 1
 * 
 */
    while (1) {
      __pyx_t_15 = ((__pyx_v_b < (__pyx_v_ngroups - 1)) != 0);
      if (__pyx_t_15) {
        __pyx_t_17 = __pyx_v_b;
        __pyx_t_18 = ((__pyx_v_i >= (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_bins.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_bins.diminfo[0].strides))) != 0);
        __pyx_t_19 = __pyx_t_18;
      } else {
        __pyx_t_19 = __pyx_t_15;
      }
      if (!__pyx_t_19) break;

      /* "pandas/algos.pyx":2084
 *     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);
    }

    /* "pandas/algos.pyx":2086
 *             b += 1
 * 
 *         counts[b] += 1             # <<<<<<<<<<<<<<
 *         for j in range(K):
 *             val = values[i, j]
 */
    __pyx_t_20 = __pyx_v_b;
    *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_counts.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_counts.diminfo[0].strides) += 1;

    /* "pandas/algos.pyx":2087
 * 
 *         counts[b] += 1
 *         for j in range(K):             # <<<<<<<<<<<<<<
 *             val = values[i, j]
 * 
 */
    __pyx_t_21 = __pyx_v_K;
    for (__pyx_t_22 = 0; __pyx_t_22 < __pyx_t_21; __pyx_t_22+=1) {
      __pyx_v_j = __pyx_t_22;

      /* "pandas/algos.pyx":2088
 *         counts[b] += 1
 *         for j in range(K):
 *             val = values[i, j]             # <<<<<<<<<<<<<<
 * 
 *             # not nan
 */
      __pyx_t_23 = __pyx_v_i;
      __pyx_t_24 = __pyx_v_j;
      __pyx_t_2 = (PyObject *) *__Pyx_BufPtrStrided2d(PyObject **, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_23, __pyx_pybuffernd_values.diminfo[0].strides, __pyx_t_24, __pyx_pybuffernd_values.diminfo[1].strides);
      __Pyx_INCREF((PyObject*)__pyx_t_2);
      __Pyx_XDECREF_SET(__pyx_v_val, __pyx_t_2);
      __pyx_t_2 = 0;

      /* "pandas/algos.pyx":2091
 * 
 *             # not nan
 *             if val == val:             # <<<<<<<<<<<<<<
 *                 nobs[b, j] += 1
 *                 if nobs[b, j] == rank:
 */
      __pyx_t_2 = PyObject_RichCompare(__pyx_v_val, __pyx_v_val, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2091; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_t_19 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_19 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2091; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      if (__pyx_t_19) {

        /* "pandas/algos.pyx":2092
 *             # not nan
 *             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_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_nobs.rcbuffer->pybuffer.buf, __pyx_t_25, __pyx_pybuffernd_nobs.diminfo[0].strides, __pyx_t_26, __pyx_pybuffernd_nobs.diminfo[1].strides) += 1.0;

        /* "pandas/algos.pyx":2093
 *             if val == val:
 *                 nobs[b, j] += 1
 *                 if nobs[b, j] == rank:             # <<<<<<<<<<<<<<
 *                     resx[b, j] = val
 * 
 */
        __pyx_t_27 = __pyx_v_b;
        __pyx_t_28 = __pyx_v_j;
        __pyx_t_19 = (((*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_nobs.rcbuffer->pybuffer.buf, __pyx_t_27, __pyx_pybuffernd_nobs.diminfo[0].strides, __pyx_t_28, __pyx_pybuffernd_nobs.diminfo[1].strides)) == __pyx_v_rank) != 0);
        if (__pyx_t_19) {

          /* "pandas/algos.pyx":2094
 *                 nobs[b, j] += 1
 *                 if nobs[b, j] == rank:
 *                     resx[b, j] = val             # <<<<<<<<<<<<<<
 * 
 *     for i in range(ngroups):
 */
          __pyx_t_29 = __pyx_v_b;
          __pyx_t_30 = __pyx_v_j;
          __pyx_t_31 = __Pyx_BufPtrStrided2d(PyObject **, __pyx_pybuffernd_resx.rcbuffer->pybuffer.buf, __pyx_t_29, __pyx_pybuffernd_resx.diminfo[0].strides, __pyx_t_30, __pyx_pybuffernd_resx.diminfo[1].strides);
          __Pyx_GOTREF(*__pyx_t_31);
          __Pyx_INCREF(__pyx_v_val); __Pyx_DECREF(*__pyx_t_31);
          *__pyx_t_31 = __pyx_v_val;
          __Pyx_GIVEREF(*__pyx_t_31);
          goto __pyx_L13;
        }
        __pyx_L13:;
        goto __pyx_L12;
      }
      __pyx_L12:;
    }
  }

  /* "pandas/algos.pyx":2096
 *                     resx[b, j] = val
 * 
 *     for i in range(ngroups):             # <<<<<<<<<<<<<<
 *         for j in range(K):
 *             if nobs[i, j] == 0:
 */
  __pyx_t_12 = __pyx_v_ngroups;
  for (__pyx_t_14 = 0; __pyx_t_14 < __pyx_t_12; __pyx_t_14+=1) {
    __pyx_v_i = __pyx_t_14;

    /* "pandas/algos.pyx":2097
 * 
 *     for i in range(ngroups):
 *         for j in range(K):             # <<<<<<<<<<<<<<
 *             if nobs[i, j] == 0:
 *                 out[i, j] = nan
 */
    __pyx_t_21 = __pyx_v_K;
    for (__pyx_t_22 = 0; __pyx_t_22 < __pyx_t_21; __pyx_t_22+=1) {
      __pyx_v_j = __pyx_t_22;

      /* "pandas/algos.pyx":2098
 *     for i in range(ngroups):
 *         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_19 = (((*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_nobs.rcbuffer->pybuffer.buf, __pyx_t_32, __pyx_pybuffernd_nobs.diminfo[0].strides, __pyx_t_33, __pyx_pybuffernd_nobs.diminfo[1].strides)) == 0.0) != 0);
      if (__pyx_t_19) {

        /* "pandas/algos.pyx":2099
 *         for j in range(K):
 *             if nobs[i, j] == 0:
 *                 out[i, j] = nan             # <<<<<<<<<<<<<<
 *             else:
 *                 out[i, j] = resx[i, j]
 */
        __pyx_t_2 = PyFloat_FromDouble(__pyx_v_6pandas_5algos_nan); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2099; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_2);
        __pyx_t_34 = __pyx_v_i;
        __pyx_t_35 = __pyx_v_j;
        __pyx_t_31 = __Pyx_BufPtrStrided2d(PyObject **, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_34, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_35, __pyx_pybuffernd_out.diminfo[1].strides);
        __Pyx_GOTREF(*__pyx_t_31);
        __Pyx_INCREF(__pyx_t_2); __Pyx_DECREF(*__pyx_t_31);
        *__pyx_t_31 = __pyx_t_2;
        __Pyx_GIVEREF(*__pyx_t_31);
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        goto __pyx_L18;
      }
      /*else*/ {

        /* "pandas/algos.pyx":2101
 *                 out[i, j] = nan
 *             else:
 *                 out[i, j] = resx[i, j]             # <<<<<<<<<<<<<<
 * 
 * @cython.boundscheck(False)
 */
        __pyx_t_36 = __pyx_v_i;
        __pyx_t_37 = __pyx_v_j;
        __pyx_t_2 = (PyObject *) *__Pyx_BufPtrStrided2d(PyObject **, __pyx_pybuffernd_resx.rcbuffer->pybuffer.buf, __pyx_t_36, __pyx_pybuffernd_resx.diminfo[0].strides, __pyx_t_37, __pyx_pybuffernd_resx.diminfo[1].strides);
        __Pyx_INCREF((PyObject*)__pyx_t_2);
        __pyx_t_38 = __pyx_v_i;
        __pyx_t_39 = __pyx_v_j;
        __pyx_t_31 = __Pyx_BufPtrStrided2d(PyObject **, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_38, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_39, __pyx_pybuffernd_out.diminfo[1].strides);
        __Pyx_GOTREF(*__pyx_t_31);
        __Pyx_INCREF(__pyx_t_2); __Pyx_DECREF(*__pyx_t_31);
        *__pyx_t_31 = __pyx_t_2;
        __Pyx_GIVEREF(*__pyx_t_31);
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      }
      __pyx_L18:;
    }
  }

  /* "pandas/algos.pyx":2057
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def group_nth_bin_object(ndarray[object, ndim=2] out,             # <<<<<<<<<<<<<<
 *                          ndarray[int64_t] counts,
 *                          ndarray[object, ndim=2] values,
 */

  /* function exit code */
  __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_pybuffernd_bins.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_counts.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_resx.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas.algos.group_nth_bin_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_bins.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_counts.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_resx.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer);
  __pyx_L2:;
  __Pyx_XDECREF(__pyx_v_val);
  __Pyx_XDECREF((PyObject *)__pyx_v_resx);
  __Pyx_XDECREF((PyObject *)__pyx_v_nobs);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/algos.pyx":2105
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def group_last_object(ndarray[object, ndim=2] out,             # <<<<<<<<<<<<<<
 *                       ndarray[int64_t] counts,
 *                       ndarray[object, ndim=2] values,
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pandas_5algos_69group_last_object(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6pandas_5algos_68group_last_object[] = "\n    Only aggregates on axis=0\n    ";
static PyMethodDef __pyx_mdef_6pandas_5algos_69group_last_object = {__Pyx_NAMESTR("group_last_object"), (PyCFunction)__pyx_pw_6pandas_5algos_69group_last_object, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6pandas_5algos_68group_last_object)};
static PyObject *__pyx_pw_6pandas_5algos_69group_last_object(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;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("group_last_object (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_out,&__pyx_n_s_counts,&__pyx_n_s_values,&__pyx_n_s_labels,0};
    PyObject* values[4] = {0,0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_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 (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_out)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_counts)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("group_last_object", 1, 4, 4, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2105; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("group_last_object", 1, 4, 4, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2105; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  3:
        if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_labels)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("group_last_object", 1, 4, 4, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2105; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "group_last_object") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2105; __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_object", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2105; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas.algos.group_last_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_out), __pyx_ptype_5numpy_ndarray, 1, "out", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2105; __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[0]; __pyx_lineno = 2106; __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[0]; __pyx_lineno = 2107; __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[0]; __pyx_lineno = 2108; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_68group_last_object(__pyx_self, __pyx_v_out, __pyx_v_counts, __pyx_v_values, __pyx_v_labels);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pandas_5algos_68group_last_object(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_out, PyArrayObject *__pyx_v_counts, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_labels) {
  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;
  PyObject *__pyx_v_val = 0;
  PyArrayObject *__pyx_v_resx = 0;
  PyArrayObject *__pyx_v_nobs = 0;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_counts;
  __Pyx_Buffer __pyx_pybuffer_counts;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_labels;
  __Pyx_Buffer __pyx_pybuffer_labels;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_nobs;
  __Pyx_Buffer __pyx_pybuffer_nobs;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_out;
  __Pyx_Buffer __pyx_pybuffer_out;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_resx;
  __Pyx_Buffer __pyx_pybuffer_resx;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_values;
  __Pyx_Buffer __pyx_pybuffer_values;
  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;
  PyObject **__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;
  __Pyx_RefNannySetupContext("group_last_object", 0);
  __pyx_pybuffer_resx.pybuffer.buf = NULL;
  __pyx_pybuffer_resx.refcount = 0;
  __pyx_pybuffernd_resx.data = NULL;
  __pyx_pybuffernd_resx.rcbuffer = &__pyx_pybuffer_resx;
  __pyx_pybuffer_nobs.pybuffer.buf = NULL;
  __pyx_pybuffer_nobs.refcount = 0;
  __pyx_pybuffernd_nobs.data = NULL;
  __pyx_pybuffernd_nobs.rcbuffer = &__pyx_pybuffer_nobs;
  __pyx_pybuffer_out.pybuffer.buf = NULL;
  __pyx_pybuffer_out.refcount = 0;
  __pyx_pybuffernd_out.data = NULL;
  __pyx_pybuffernd_out.rcbuffer = &__pyx_pybuffer_out;
  __pyx_pybuffer_counts.pybuffer.buf = NULL;
  __pyx_pybuffer_counts.refcount = 0;
  __pyx_pybuffernd_counts.data = NULL;
  __pyx_pybuffernd_counts.rcbuffer = &__pyx_pybuffer_counts;
  __pyx_pybuffer_values.pybuffer.buf = NULL;
  __pyx_pybuffer_values.refcount = 0;
  __pyx_pybuffernd_values.data = NULL;
  __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values;
  __pyx_pybuffer_labels.pybuffer.buf = NULL;
  __pyx_pybuffer_labels.refcount = 0;
  __pyx_pybuffernd_labels.data = NULL;
  __pyx_pybuffernd_labels.rcbuffer = &__pyx_pybuffer_labels;
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_out.rcbuffer->pybuffer, (PyObject*)__pyx_v_out, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2105; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_out.diminfo[0].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_out.diminfo[0].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_out.diminfo[1].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_out.diminfo[1].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[1];
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_counts.rcbuffer->pybuffer, (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[0]; __pyx_lineno = 2105; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_counts.diminfo[0].strides = __pyx_pybuffernd_counts.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_counts.diminfo[0].shape = __pyx_pybuffernd_counts.rcbuffer->pybuffer.shape[0];
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2105; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_values.diminfo[1].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_values.diminfo[1].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[1];
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_labels.rcbuffer->pybuffer, (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[0]; __pyx_lineno = 2105; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_labels.diminfo[0].strides = __pyx_pybuffernd_labels.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_labels.diminfo[0].shape = __pyx_pybuffernd_labels.rcbuffer->pybuffer.shape[0];

  /* "pandas/algos.pyx":2119
 *         ndarray[int64_t, ndim=2] nobs
 * 
 *     nobs = np.zeros((<object> out).shape, dtype=np.int64)             # <<<<<<<<<<<<<<
 *     resx = np.empty((<object> out).shape, dtype=object)
 * 
 */
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2119; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2119; __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_PyObject_GetAttrStr(((PyObject *)__pyx_v_out), __pyx_n_s_shape); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2119; __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 = 2119; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__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[0]; __pyx_lineno = 2119; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2119; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_int64); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2119; __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, __pyx_n_s_dtype, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2119; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2119; __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_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__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[0]; __pyx_lineno = 2119; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_6 = ((PyArrayObject *)__pyx_t_5);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer);
    __pyx_t_7 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer, (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_pybuffernd_nobs.rcbuffer->pybuffer, (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_pybuffernd_nobs.diminfo[0].strides = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_nobs.diminfo[0].shape = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_nobs.diminfo[1].strides = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_nobs.diminfo[1].shape = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.shape[1];
    if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2119; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_6 = 0;
  __pyx_v_nobs = ((PyArrayObject *)__pyx_t_5);
  __pyx_t_5 = 0;

  /* "pandas/algos.pyx":2120
 * 
 *     nobs = np.zeros((<object> out).shape, dtype=np.int64)
 *     resx = np.empty((<object> out).shape, dtype=object)             # <<<<<<<<<<<<<<
 * 
 *     N, K = (<object> values).shape
 */
  __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2120; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_empty); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2120; __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_PyObject_GetAttrStr(((PyObject *)__pyx_v_out), __pyx_n_s_shape); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2120; __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 = 2120; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__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 = 2120; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_dtype, __pyx_builtin_object) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2120; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, __pyx_t_5); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2120; __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_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 = 2120; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_11 = ((PyArrayObject *)__pyx_t_2);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_resx.rcbuffer->pybuffer);
    __pyx_t_7 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_resx.rcbuffer->pybuffer, (PyObject*)__pyx_t_11, &__Pyx_TypeInfo_object, 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_pybuffernd_resx.rcbuffer->pybuffer, (PyObject*)__pyx_v_resx, &__Pyx_TypeInfo_object, 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_pybuffernd_resx.diminfo[0].strides = __pyx_pybuffernd_resx.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_resx.diminfo[0].shape = __pyx_pybuffernd_resx.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_resx.diminfo[1].strides = __pyx_pybuffernd_resx.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_resx.diminfo[1].shape = __pyx_pybuffernd_resx.rcbuffer->pybuffer.shape[1];
    if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2120; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_11 = 0;
  __pyx_v_resx = ((PyArrayObject *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "pandas/algos.pyx":2122
 *     resx = np.empty((<object> out).shape, dtype=object)
 * 
 *     N, K = (<object> values).shape             # <<<<<<<<<<<<<<
 * 
 *     for i in range(N):
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_values), __pyx_n_s_shape); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2122; __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 CYTHON_COMPILING_IN_CPYTHON
    Py_ssize_t size = Py_SIZE(sequence);
    #else
    Py_ssize_t size = PySequence_Size(sequence);
    #endif
    if (unlikely(size != 2)) {
      if (size > 2) __Pyx_RaiseTooManyValuesError(2);
      else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2122; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    #if CYTHON_COMPILING_IN_CPYTHON
    if (likely(PyTuple_CheckExact(sequence))) {
      __pyx_t_5 = PyTuple_GET_ITEM(sequence, 0); 
      __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1); 
    } else {
      __pyx_t_5 = PyList_GET_ITEM(sequence, 0); 
      __pyx_t_3 = PyList_GET_ITEM(sequence, 1); 
    }
    __Pyx_INCREF(__pyx_t_5);
    __Pyx_INCREF(__pyx_t_3);
    #else
    __pyx_t_5 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2122; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2122; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    #endif
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  } else {
    Py_ssize_t index = -1;
    __pyx_t_1 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2122; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_12 = Py_TYPE(__pyx_t_1)->tp_iternext;
    index = 0; __pyx_t_5 = __pyx_t_12(__pyx_t_1); if (unlikely(!__pyx_t_5)) goto __pyx_L3_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_5);
    index = 1; __pyx_t_3 = __pyx_t_12(__pyx_t_1); if (unlikely(!__pyx_t_3)) goto __pyx_L3_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_3);
    if (__Pyx_IternextUnpackEndCheck(__pyx_t_12(__pyx_t_1), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2122; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_12 = NULL;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    goto __pyx_L4_unpacking_done;
    __pyx_L3_unpacking_failed:;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_12 = NULL;
    if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2122; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_L4_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[0]; __pyx_lineno = 2122; __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_3); if (unlikely((__pyx_t_14 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2122; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_v_N = __pyx_t_13;
  __pyx_v_K = __pyx_t_14;

  /* "pandas/algos.pyx":2124
 *     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;

    /* "pandas/algos.pyx":2125
 * 
 *     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_pybuffernd_labels.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_labels.diminfo[0].strides));

    /* "pandas/algos.pyx":2126
 *     for i in range(N):
 *         lab = labels[i]
 *         if lab < 0:             # <<<<<<<<<<<<<<
 *             continue
 * 
 */
    __pyx_t_16 = ((__pyx_v_lab < 0) != 0);
    if (__pyx_t_16) {

      /* "pandas/algos.pyx":2127
 *         lab = labels[i]
 *         if lab < 0:
 *             continue             # <<<<<<<<<<<<<<
 * 
 *         counts[lab] += 1
 */
      goto __pyx_L5_continue;
    }

    /* "pandas/algos.pyx":2129
 *             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_pybuffernd_counts.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_counts.diminfo[0].strides) += 1;

    /* "pandas/algos.pyx":2130
 * 
 *         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;

      /* "pandas/algos.pyx":2131
 *         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_t_2 = (PyObject *) *__Pyx_BufPtrStrided2d(PyObject **, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_values.diminfo[0].strides, __pyx_t_21, __pyx_pybuffernd_values.diminfo[1].strides);
      __Pyx_INCREF((PyObject*)__pyx_t_2);
      __Pyx_XDECREF_SET(__pyx_v_val, __pyx_t_2);
      __pyx_t_2 = 0;

      /* "pandas/algos.pyx":2134
 * 
 *             # not nan
 *             if val == val:             # <<<<<<<<<<<<<<
 *                 nobs[lab, j] += 1
 *                 resx[lab, j] = val
 */
      __pyx_t_2 = PyObject_RichCompare(__pyx_v_val, __pyx_v_val, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2134; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_t_16 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_16 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2134; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      if (__pyx_t_16) {

        /* "pandas/algos.pyx":2135
 *             # 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_pybuffernd_nobs.rcbuffer->pybuffer.buf, __pyx_t_22, __pyx_pybuffernd_nobs.diminfo[0].strides, __pyx_t_23, __pyx_pybuffernd_nobs.diminfo[1].strides) += 1;

        /* "pandas/algos.pyx":2136
 *             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_t_26 = __Pyx_BufPtrStrided2d(PyObject **, __pyx_pybuffernd_resx.rcbuffer->pybuffer.buf, __pyx_t_24, __pyx_pybuffernd_resx.diminfo[0].strides, __pyx_t_25, __pyx_pybuffernd_resx.diminfo[1].strides);
        __Pyx_GOTREF(*__pyx_t_26);
        __Pyx_INCREF(__pyx_v_val); __Pyx_DECREF(*__pyx_t_26);
        *__pyx_t_26 = __pyx_v_val;
        __Pyx_GIVEREF(*__pyx_t_26);
        goto __pyx_L10;
      }
      __pyx_L10:;
    }
    __pyx_L5_continue:;
  }

  /* "pandas/algos.pyx":2138
 *                 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[0]; __pyx_lineno = 2138; __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;

    /* "pandas/algos.pyx":2139
 * 
 *     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;

      /* "pandas/algos.pyx":2140
 *     for i in range(len(counts)):
 *         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_16 = (((*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_nobs.rcbuffer->pybuffer.buf, __pyx_t_27, __pyx_pybuffernd_nobs.diminfo[0].strides, __pyx_t_28, __pyx_pybuffernd_nobs.diminfo[1].strides)) == 0) != 0);
      if (__pyx_t_16) {

        /* "pandas/algos.pyx":2141
 *         for j in range(K):
 *             if nobs[i, j] == 0:
 *                 out[i, j] = nan             # <<<<<<<<<<<<<<
 *             else:
 *                 out[i, j] = resx[i, j]
 */
        __pyx_t_2 = PyFloat_FromDouble(__pyx_v_6pandas_5algos_nan); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2141; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_2);
        __pyx_t_29 = __pyx_v_i;
        __pyx_t_30 = __pyx_v_j;
        __pyx_t_26 = __Pyx_BufPtrStrided2d(PyObject **, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_29, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_30, __pyx_pybuffernd_out.diminfo[1].strides);
        __Pyx_GOTREF(*__pyx_t_26);
        __Pyx_INCREF(__pyx_t_2); __Pyx_DECREF(*__pyx_t_26);
        *__pyx_t_26 = __pyx_t_2;
        __Pyx_GIVEREF(*__pyx_t_26);
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        goto __pyx_L15;
      }
      /*else*/ {

        /* "pandas/algos.pyx":2143
 *                 out[i, j] = nan
 *             else:
 *                 out[i, j] = resx[i, j]             # <<<<<<<<<<<<<<
 * 
 * @cython.boundscheck(False)
 */
        __pyx_t_31 = __pyx_v_i;
        __pyx_t_32 = __pyx_v_j;
        __pyx_t_2 = (PyObject *) *__Pyx_BufPtrStrided2d(PyObject **, __pyx_pybuffernd_resx.rcbuffer->pybuffer.buf, __pyx_t_31, __pyx_pybuffernd_resx.diminfo[0].strides, __pyx_t_32, __pyx_pybuffernd_resx.diminfo[1].strides);
        __Pyx_INCREF((PyObject*)__pyx_t_2);
        __pyx_t_33 = __pyx_v_i;
        __pyx_t_34 = __pyx_v_j;
        __pyx_t_26 = __Pyx_BufPtrStrided2d(PyObject **, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_33, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_34, __pyx_pybuffernd_out.diminfo[1].strides);
        __Pyx_GOTREF(*__pyx_t_26);
        __Pyx_INCREF(__pyx_t_2); __Pyx_DECREF(*__pyx_t_26);
        *__pyx_t_26 = __pyx_t_2;
        __Pyx_GIVEREF(*__pyx_t_26);
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      }
      __pyx_L15:;
    }
  }

  /* "pandas/algos.pyx":2105
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def group_last_object(ndarray[object, ndim=2] out,             # <<<<<<<<<<<<<<
 *                       ndarray[int64_t] counts,
 *                       ndarray[object, ndim=2] values,
 */

  /* function exit code */
  __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_pybuffernd_counts.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_labels.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_resx.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas.algos.group_last_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_counts.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_labels.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_resx.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer);
  __pyx_L2:;
  __Pyx_XDECREF(__pyx_v_val);
  __Pyx_XDECREF((PyObject *)__pyx_v_resx);
  __Pyx_XDECREF((PyObject *)__pyx_v_nobs);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/algos.pyx":2147
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def group_last_bin_object(ndarray[object, ndim=2] out,             # <<<<<<<<<<<<<<
 *                           ndarray[int64_t] counts,
 *                           ndarray[object, ndim=2] values,
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pandas_5algos_71group_last_bin_object(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6pandas_5algos_70group_last_bin_object[] = "\n    Only aggregates on axis=0\n    ";
static PyMethodDef __pyx_mdef_6pandas_5algos_71group_last_bin_object = {__Pyx_NAMESTR("group_last_bin_object"), (PyCFunction)__pyx_pw_6pandas_5algos_71group_last_bin_object, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6pandas_5algos_70group_last_bin_object)};
static PyObject *__pyx_pw_6pandas_5algos_71group_last_bin_object(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;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("group_last_bin_object (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_out,&__pyx_n_s_counts,&__pyx_n_s_values,&__pyx_n_s_bins,0};
    PyObject* values[4] = {0,0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_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 (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_out)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_counts)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("group_last_bin_object", 1, 4, 4, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2147; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("group_last_bin_object", 1, 4, 4, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2147; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  3:
        if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_bins)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("group_last_bin_object", 1, 4, 4, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2147; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "group_last_bin_object") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2147; __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_object", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2147; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas.algos.group_last_bin_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_out), __pyx_ptype_5numpy_ndarray, 1, "out", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2147; __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[0]; __pyx_lineno = 2148; __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[0]; __pyx_lineno = 2149; __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[0]; __pyx_lineno = 2150; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_70group_last_bin_object(__pyx_self, __pyx_v_out, __pyx_v_counts, __pyx_v_values, __pyx_v_bins);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pandas_5algos_70group_last_bin_object(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_out, PyArrayObject *__pyx_v_counts, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_bins) {
  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;
  PyObject *__pyx_v_val = 0;
  PyArrayObject *__pyx_v_resx = 0;
  PyArrayObject *__pyx_v_nobs = 0;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_bins;
  __Pyx_Buffer __pyx_pybuffer_bins;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_counts;
  __Pyx_Buffer __pyx_pybuffer_counts;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_nobs;
  __Pyx_Buffer __pyx_pybuffer_nobs;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_out;
  __Pyx_Buffer __pyx_pybuffer_out;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_resx;
  __Pyx_Buffer __pyx_pybuffer_resx;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_values;
  __Pyx_Buffer __pyx_pybuffer_values;
  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;
  Py_ssize_t __pyx_t_12;
  Py_ssize_t __pyx_t_13;
  Py_ssize_t __pyx_t_14;
  int __pyx_t_15;
  PyObject *(*__pyx_t_16)(PyObject *);
  Py_ssize_t __pyx_t_17;
  int __pyx_t_18;
  int __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;
  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;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("group_last_bin_object", 0);
  __pyx_pybuffer_resx.pybuffer.buf = NULL;
  __pyx_pybuffer_resx.refcount = 0;
  __pyx_pybuffernd_resx.data = NULL;
  __pyx_pybuffernd_resx.rcbuffer = &__pyx_pybuffer_resx;
  __pyx_pybuffer_nobs.pybuffer.buf = NULL;
  __pyx_pybuffer_nobs.refcount = 0;
  __pyx_pybuffernd_nobs.data = NULL;
  __pyx_pybuffernd_nobs.rcbuffer = &__pyx_pybuffer_nobs;
  __pyx_pybuffer_out.pybuffer.buf = NULL;
  __pyx_pybuffer_out.refcount = 0;
  __pyx_pybuffernd_out.data = NULL;
  __pyx_pybuffernd_out.rcbuffer = &__pyx_pybuffer_out;
  __pyx_pybuffer_counts.pybuffer.buf = NULL;
  __pyx_pybuffer_counts.refcount = 0;
  __pyx_pybuffernd_counts.data = NULL;
  __pyx_pybuffernd_counts.rcbuffer = &__pyx_pybuffer_counts;
  __pyx_pybuffer_values.pybuffer.buf = NULL;
  __pyx_pybuffer_values.refcount = 0;
  __pyx_pybuffernd_values.data = NULL;
  __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values;
  __pyx_pybuffer_bins.pybuffer.buf = NULL;
  __pyx_pybuffer_bins.refcount = 0;
  __pyx_pybuffernd_bins.data = NULL;
  __pyx_pybuffernd_bins.rcbuffer = &__pyx_pybuffer_bins;
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_out.rcbuffer->pybuffer, (PyObject*)__pyx_v_out, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2147; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_out.diminfo[0].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_out.diminfo[0].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_out.diminfo[1].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_out.diminfo[1].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[1];
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_counts.rcbuffer->pybuffer, (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[0]; __pyx_lineno = 2147; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_counts.diminfo[0].strides = __pyx_pybuffernd_counts.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_counts.diminfo[0].shape = __pyx_pybuffernd_counts.rcbuffer->pybuffer.shape[0];
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2147; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_values.diminfo[1].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_values.diminfo[1].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[1];
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_bins.rcbuffer->pybuffer, (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[0]; __pyx_lineno = 2147; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_bins.diminfo[0].strides = __pyx_pybuffernd_bins.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_bins.diminfo[0].shape = __pyx_pybuffernd_bins.rcbuffer->pybuffer.shape[0];

  /* "pandas/algos.pyx":2161
 *         ndarray[float64_t, ndim=2] nobs
 * 
 *     nobs = np.zeros((<object> out).shape, dtype=np.float64)             # <<<<<<<<<<<<<<
 *     resx = np.empty((<object> out).shape, dtype=object)
 * 
 */
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2161; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2161; __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_PyObject_GetAttrStr(((PyObject *)__pyx_v_out), __pyx_n_s_shape); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2161; __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 = 2161; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__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[0]; __pyx_lineno = 2161; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2161; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_float64); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2161; __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, __pyx_n_s_dtype, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2161; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2161; __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_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__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[0]; __pyx_lineno = 2161; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_6 = ((PyArrayObject *)__pyx_t_5);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer);
    __pyx_t_7 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer, (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_7 < 0)) {
      PyErr_Fetch(&__pyx_t_8, &__pyx_t_9, &__pyx_t_10);
      if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer, (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_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_pybuffernd_nobs.diminfo[0].strides = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_nobs.diminfo[0].shape = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_nobs.diminfo[1].strides = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_nobs.diminfo[1].shape = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.shape[1];
    if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2161; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_6 = 0;
  __pyx_v_nobs = ((PyArrayObject *)__pyx_t_5);
  __pyx_t_5 = 0;

  /* "pandas/algos.pyx":2162
 * 
 *     nobs = np.zeros((<object> out).shape, dtype=np.float64)
 *     resx = np.empty((<object> out).shape, dtype=object)             # <<<<<<<<<<<<<<
 * 
 *     if bins[len(bins) - 1] == len(values):
 */
  __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2162; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_empty); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2162; __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_PyObject_GetAttrStr(((PyObject *)__pyx_v_out), __pyx_n_s_shape); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2162; __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 = 2162; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__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 = 2162; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_dtype, __pyx_builtin_object) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2162; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, __pyx_t_5); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2162; __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_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 = 2162; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_11 = ((PyArrayObject *)__pyx_t_2);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_resx.rcbuffer->pybuffer);
    __pyx_t_7 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_resx.rcbuffer->pybuffer, (PyObject*)__pyx_t_11, &__Pyx_TypeInfo_object, 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_pybuffernd_resx.rcbuffer->pybuffer, (PyObject*)__pyx_v_resx, &__Pyx_TypeInfo_object, 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_pybuffernd_resx.diminfo[0].strides = __pyx_pybuffernd_resx.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_resx.diminfo[0].shape = __pyx_pybuffernd_resx.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_resx.diminfo[1].strides = __pyx_pybuffernd_resx.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_resx.diminfo[1].shape = __pyx_pybuffernd_resx.rcbuffer->pybuffer.shape[1];
    if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2162; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_11 = 0;
  __pyx_v_resx = ((PyArrayObject *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "pandas/algos.pyx":2164
 *     resx = np.empty((<object> out).shape, dtype=object)
 * 
 *     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[0]; __pyx_lineno = 2164; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_13 = (__pyx_t_12 - 1);
  __pyx_t_14 = PyObject_Length(((PyObject *)__pyx_v_values)); if (unlikely(__pyx_t_14 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2164; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_15 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_bins.rcbuffer->pybuffer.buf, __pyx_t_13, __pyx_pybuffernd_bins.diminfo[0].strides)) == __pyx_t_14) != 0);
  if (__pyx_t_15) {

    /* "pandas/algos.pyx":2165
 * 
 *     if bins[len(bins) - 1] == len(values):
 *         ngroups = len(bins)             # <<<<<<<<<<<<<<
 *     else:
 *         ngroups = len(bins) + 1
 */
    __pyx_t_14 = PyObject_Length(((PyObject *)__pyx_v_bins)); if (unlikely(__pyx_t_14 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2165; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_v_ngroups = __pyx_t_14;
    goto __pyx_L3;
  }
  /*else*/ {

    /* "pandas/algos.pyx":2167
 *         ngroups = len(bins)
 *     else:
 *         ngroups = len(bins) + 1             # <<<<<<<<<<<<<<
 * 
 *     N, K = (<object> values).shape
 */
    __pyx_t_14 = PyObject_Length(((PyObject *)__pyx_v_bins)); if (unlikely(__pyx_t_14 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2167; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_v_ngroups = (__pyx_t_14 + 1);
  }
  __pyx_L3:;

  /* "pandas/algos.pyx":2169
 *         ngroups = len(bins) + 1
 * 
 *     N, K = (<object> values).shape             # <<<<<<<<<<<<<<
 * 
 *     b = 0
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_values), __pyx_n_s_shape); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2169; __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 CYTHON_COMPILING_IN_CPYTHON
    Py_ssize_t size = Py_SIZE(sequence);
    #else
    Py_ssize_t size = PySequence_Size(sequence);
    #endif
    if (unlikely(size != 2)) {
      if (size > 2) __Pyx_RaiseTooManyValuesError(2);
      else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2169; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    #if CYTHON_COMPILING_IN_CPYTHON
    if (likely(PyTuple_CheckExact(sequence))) {
      __pyx_t_5 = PyTuple_GET_ITEM(sequence, 0); 
      __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1); 
    } else {
      __pyx_t_5 = PyList_GET_ITEM(sequence, 0); 
      __pyx_t_3 = PyList_GET_ITEM(sequence, 1); 
    }
    __Pyx_INCREF(__pyx_t_5);
    __Pyx_INCREF(__pyx_t_3);
    #else
    __pyx_t_5 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2169; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2169; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    #endif
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  } else {
    Py_ssize_t index = -1;
    __pyx_t_1 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2169; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_16 = Py_TYPE(__pyx_t_1)->tp_iternext;
    index = 0; __pyx_t_5 = __pyx_t_16(__pyx_t_1); if (unlikely(!__pyx_t_5)) goto __pyx_L4_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_5);
    index = 1; __pyx_t_3 = __pyx_t_16(__pyx_t_1); if (unlikely(!__pyx_t_3)) goto __pyx_L4_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_3);
    if (__Pyx_IternextUnpackEndCheck(__pyx_t_16(__pyx_t_1), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2169; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_16 = NULL;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    goto __pyx_L5_unpacking_done;
    __pyx_L4_unpacking_failed:;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_16 = NULL;
    if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2169; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_L5_unpacking_done:;
  }
  __pyx_t_14 = __Pyx_PyIndex_AsSsize_t(__pyx_t_5); if (unlikely((__pyx_t_14 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2169; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 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[0]; __pyx_lineno = 2169; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_v_N = __pyx_t_14;
  __pyx_v_K = __pyx_t_12;

  /* "pandas/algos.pyx":2171
 *     N, K = (<object> values).shape
 * 
 *     b = 0             # <<<<<<<<<<<<<<
 *     for i in range(N):
 *         while b < ngroups - 1 and i >= bins[b]:
 */
  __pyx_v_b = 0;

  /* "pandas/algos.pyx":2172
 * 
 *     b = 0
 *     for i in range(N):             # <<<<<<<<<<<<<<
 *         while b < ngroups - 1 and i >= bins[b]:
 *             b += 1
 */
  __pyx_t_12 = __pyx_v_N;
  for (__pyx_t_14 = 0; __pyx_t_14 < __pyx_t_12; __pyx_t_14+=1) {
    __pyx_v_i = __pyx_t_14;

    /* "pandas/algos.pyx":2173
 *     b = 0
 *     for i in range(N):
 *         while b < ngroups - 1 and i >= bins[b]:             # <<<<<<<<<<<<<<
 *             b += 1
 * 
 */
    while (1) {
      __pyx_t_15 = ((__pyx_v_b < (__pyx_v_ngroups - 1)) != 0);
      if (__pyx_t_15) {
        __pyx_t_17 = __pyx_v_b;
        __pyx_t_18 = ((__pyx_v_i >= (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_bins.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_bins.diminfo[0].strides))) != 0);
        __pyx_t_19 = __pyx_t_18;
      } else {
        __pyx_t_19 = __pyx_t_15;
      }
      if (!__pyx_t_19) break;

      /* "pandas/algos.pyx":2174
 *     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);
    }

    /* "pandas/algos.pyx":2176
 *             b += 1
 * 
 *         counts[b] += 1             # <<<<<<<<<<<<<<
 *         for j in range(K):
 *             val = values[i, j]
 */
    __pyx_t_20 = __pyx_v_b;
    *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_counts.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_counts.diminfo[0].strides) += 1;

    /* "pandas/algos.pyx":2177
 * 
 *         counts[b] += 1
 *         for j in range(K):             # <<<<<<<<<<<<<<
 *             val = values[i, j]
 * 
 */
    __pyx_t_21 = __pyx_v_K;
    for (__pyx_t_22 = 0; __pyx_t_22 < __pyx_t_21; __pyx_t_22+=1) {
      __pyx_v_j = __pyx_t_22;

      /* "pandas/algos.pyx":2178
 *         counts[b] += 1
 *         for j in range(K):
 *             val = values[i, j]             # <<<<<<<<<<<<<<
 * 
 *             # not nan
 */
      __pyx_t_23 = __pyx_v_i;
      __pyx_t_24 = __pyx_v_j;
      __pyx_t_2 = (PyObject *) *__Pyx_BufPtrStrided2d(PyObject **, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_23, __pyx_pybuffernd_values.diminfo[0].strides, __pyx_t_24, __pyx_pybuffernd_values.diminfo[1].strides);
      __Pyx_INCREF((PyObject*)__pyx_t_2);
      __Pyx_XDECREF_SET(__pyx_v_val, __pyx_t_2);
      __pyx_t_2 = 0;

      /* "pandas/algos.pyx":2181
 * 
 *             # not nan
 *             if val == val:             # <<<<<<<<<<<<<<
 *                 nobs[b, j] += 1
 *                 resx[b, j] = val
 */
      __pyx_t_2 = PyObject_RichCompare(__pyx_v_val, __pyx_v_val, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2181; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_t_19 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_19 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2181; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      if (__pyx_t_19) {

        /* "pandas/algos.pyx":2182
 *             # not nan
 *             if val == val:
 *                 nobs[b, j] += 1             # <<<<<<<<<<<<<<
 *                 resx[b, j] = val
 * 
 */
        __pyx_t_25 = __pyx_v_b;
        __pyx_t_26 = __pyx_v_j;
        *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_nobs.rcbuffer->pybuffer.buf, __pyx_t_25, __pyx_pybuffernd_nobs.diminfo[0].strides, __pyx_t_26, __pyx_pybuffernd_nobs.diminfo[1].strides) += 1.0;

        /* "pandas/algos.pyx":2183
 *             if val == val:
 *                 nobs[b, j] += 1
 *                 resx[b, j] = val             # <<<<<<<<<<<<<<
 * 
 *     for i in range(ngroups):
 */
        __pyx_t_27 = __pyx_v_b;
        __pyx_t_28 = __pyx_v_j;
        __pyx_t_29 = __Pyx_BufPtrStrided2d(PyObject **, __pyx_pybuffernd_resx.rcbuffer->pybuffer.buf, __pyx_t_27, __pyx_pybuffernd_resx.diminfo[0].strides, __pyx_t_28, __pyx_pybuffernd_resx.diminfo[1].strides);
        __Pyx_GOTREF(*__pyx_t_29);
        __Pyx_INCREF(__pyx_v_val); __Pyx_DECREF(*__pyx_t_29);
        *__pyx_t_29 = __pyx_v_val;
        __Pyx_GIVEREF(*__pyx_t_29);
        goto __pyx_L12;
      }
      __pyx_L12:;
    }
  }

  /* "pandas/algos.pyx":2185
 *                 resx[b, j] = val
 * 
 *     for i in range(ngroups):             # <<<<<<<<<<<<<<
 *         for j in range(K):
 *             if nobs[i, j] == 0:
 */
  __pyx_t_12 = __pyx_v_ngroups;
  for (__pyx_t_14 = 0; __pyx_t_14 < __pyx_t_12; __pyx_t_14+=1) {
    __pyx_v_i = __pyx_t_14;

    /* "pandas/algos.pyx":2186
 * 
 *     for i in range(ngroups):
 *         for j in range(K):             # <<<<<<<<<<<<<<
 *             if nobs[i, j] == 0:
 *                 out[i, j] = nan
 */
    __pyx_t_21 = __pyx_v_K;
    for (__pyx_t_22 = 0; __pyx_t_22 < __pyx_t_21; __pyx_t_22+=1) {
      __pyx_v_j = __pyx_t_22;

      /* "pandas/algos.pyx":2187
 *     for i in range(ngroups):
 *         for j in range(K):
 *             if nobs[i, j] == 0:             # <<<<<<<<<<<<<<
 *                 out[i, j] = nan
 *             else:
 */
      __pyx_t_30 = __pyx_v_i;
      __pyx_t_31 = __pyx_v_j;
      __pyx_t_19 = (((*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_nobs.rcbuffer->pybuffer.buf, __pyx_t_30, __pyx_pybuffernd_nobs.diminfo[0].strides, __pyx_t_31, __pyx_pybuffernd_nobs.diminfo[1].strides)) == 0.0) != 0);
      if (__pyx_t_19) {

        /* "pandas/algos.pyx":2188
 *         for j in range(K):
 *             if nobs[i, j] == 0:
 *                 out[i, j] = nan             # <<<<<<<<<<<<<<
 *             else:
 *                 out[i, j] = resx[i, j]
 */
        __pyx_t_2 = PyFloat_FromDouble(__pyx_v_6pandas_5algos_nan); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2188; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_2);
        __pyx_t_32 = __pyx_v_i;
        __pyx_t_33 = __pyx_v_j;
        __pyx_t_29 = __Pyx_BufPtrStrided2d(PyObject **, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_32, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_33, __pyx_pybuffernd_out.diminfo[1].strides);
        __Pyx_GOTREF(*__pyx_t_29);
        __Pyx_INCREF(__pyx_t_2); __Pyx_DECREF(*__pyx_t_29);
        *__pyx_t_29 = __pyx_t_2;
        __Pyx_GIVEREF(*__pyx_t_29);
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        goto __pyx_L17;
      }
      /*else*/ {

        /* "pandas/algos.pyx":2190
 *                 out[i, j] = nan
 *             else:
 *                 out[i, j] = resx[i, j]             # <<<<<<<<<<<<<<
 * 
 * 
 */
        __pyx_t_34 = __pyx_v_i;
        __pyx_t_35 = __pyx_v_j;
        __pyx_t_2 = (PyObject *) *__Pyx_BufPtrStrided2d(PyObject **, __pyx_pybuffernd_resx.rcbuffer->pybuffer.buf, __pyx_t_34, __pyx_pybuffernd_resx.diminfo[0].strides, __pyx_t_35, __pyx_pybuffernd_resx.diminfo[1].strides);
        __Pyx_INCREF((PyObject*)__pyx_t_2);
        __pyx_t_36 = __pyx_v_i;
        __pyx_t_37 = __pyx_v_j;
        __pyx_t_29 = __Pyx_BufPtrStrided2d(PyObject **, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_36, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_37, __pyx_pybuffernd_out.diminfo[1].strides);
        __Pyx_GOTREF(*__pyx_t_29);
        __Pyx_INCREF(__pyx_t_2); __Pyx_DECREF(*__pyx_t_29);
        *__pyx_t_29 = __pyx_t_2;
        __Pyx_GIVEREF(*__pyx_t_29);
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      }
      __pyx_L17:;
    }
  }

  /* "pandas/algos.pyx":2147
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def group_last_bin_object(ndarray[object, ndim=2] out,             # <<<<<<<<<<<<<<
 *                           ndarray[int64_t] counts,
 *                           ndarray[object, ndim=2] values,
 */

  /* function exit code */
  __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_pybuffernd_bins.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_counts.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_resx.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas.algos.group_last_bin_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_bins.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_counts.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_resx.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer);
  __pyx_L2:;
  __Pyx_XDECREF(__pyx_v_val);
  __Pyx_XDECREF((PyObject *)__pyx_v_resx);
  __Pyx_XDECREF((PyObject *)__pyx_v_nobs);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/algos.pyx":2197
 * # median
 * 
 * def group_median(ndarray[float64_t, ndim=2] out,             # <<<<<<<<<<<<<<
 *                  ndarray[int64_t] counts,
 *                  ndarray[float64_t, ndim=2] values,
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pandas_5algos_73group_median(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6pandas_5algos_72group_median[] = "\n    Only aggregates on axis=0\n    ";
static PyMethodDef __pyx_mdef_6pandas_5algos_73group_median = {__Pyx_NAMESTR("group_median"), (PyCFunction)__pyx_pw_6pandas_5algos_73group_median, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6pandas_5algos_72group_median)};
static PyObject *__pyx_pw_6pandas_5algos_73group_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;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("group_median (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_out,&__pyx_n_s_counts,&__pyx_n_s_values,&__pyx_n_s_labels,0};
    PyObject* values[4] = {0,0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_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 (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_out)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_counts)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("group_median", 1, 4, 4, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2197; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("group_median", 1, 4, 4, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2197; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  3:
        if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_labels)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("group_median", 1, 4, 4, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2197; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "group_median") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2197; __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[0]; __pyx_lineno = 2197; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas.algos.group_median", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_out), __pyx_ptype_5numpy_ndarray, 1, "out", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2197; __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[0]; __pyx_lineno = 2198; __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[0]; __pyx_lineno = 2199; __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[0]; __pyx_lineno = 2200; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_72group_median(__pyx_self, __pyx_v_out, __pyx_v_counts, __pyx_v_values, __pyx_v_labels);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pandas_5algos_72group_median(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_out, PyArrayObject *__pyx_v_counts, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_labels) {
  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_indexer = NULL;
  __Pyx_LocalBuf_ND __pyx_pybuffernd__counts;
  __Pyx_Buffer __pyx_pybuffer__counts;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_counts;
  __Pyx_Buffer __pyx_pybuffer_counts;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_labels;
  __Pyx_Buffer __pyx_pybuffer_labels;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_out;
  __Pyx_Buffer __pyx_pybuffer_out;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_values;
  __Pyx_Buffer __pyx_pybuffer_values;
  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)(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;
  __Pyx_RefNannySetupContext("group_median", 0);
  __pyx_pybuffer__counts.pybuffer.buf = NULL;
  __pyx_pybuffer__counts.refcount = 0;
  __pyx_pybuffernd__counts.data = NULL;
  __pyx_pybuffernd__counts.rcbuffer = &__pyx_pybuffer__counts;
  __pyx_pybuffer_out.pybuffer.buf = NULL;
  __pyx_pybuffer_out.refcount = 0;
  __pyx_pybuffernd_out.data = NULL;
  __pyx_pybuffernd_out.rcbuffer = &__pyx_pybuffer_out;
  __pyx_pybuffer_counts.pybuffer.buf = NULL;
  __pyx_pybuffer_counts.refcount = 0;
  __pyx_pybuffernd_counts.data = NULL;
  __pyx_pybuffernd_counts.rcbuffer = &__pyx_pybuffer_counts;
  __pyx_pybuffer_values.pybuffer.buf = NULL;
  __pyx_pybuffer_values.refcount = 0;
  __pyx_pybuffernd_values.data = NULL;
  __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values;
  __pyx_pybuffer_labels.pybuffer.buf = NULL;
  __pyx_pybuffer_labels.refcount = 0;
  __pyx_pybuffernd_labels.data = NULL;
  __pyx_pybuffernd_labels.rcbuffer = &__pyx_pybuffer_labels;
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_out.rcbuffer->pybuffer, (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[0]; __pyx_lineno = 2197; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_out.diminfo[0].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_out.diminfo[0].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_out.diminfo[1].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_out.diminfo[1].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[1];
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_counts.rcbuffer->pybuffer, (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[0]; __pyx_lineno = 2197; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_counts.diminfo[0].strides = __pyx_pybuffernd_counts.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_counts.diminfo[0].shape = __pyx_pybuffernd_counts.rcbuffer->pybuffer.shape[0];
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (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[0]; __pyx_lineno = 2197; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_values.diminfo[1].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_values.diminfo[1].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[1];
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_labels.rcbuffer->pybuffer, (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[0]; __pyx_lineno = 2197; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_labels.diminfo[0].strides = __pyx_pybuffernd_labels.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_labels.diminfo[0].shape = __pyx_pybuffernd_labels.rcbuffer->pybuffer.shape[0];

  /* "pandas/algos.pyx":2209
 *         ndarray data
 *         float64_t* ptr
 *     ngroups = len(counts)             # <<<<<<<<<<<<<<
 *     N, K = (<object> values).shape
 * 
 */
  __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_counts)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2209; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_ngroups = __pyx_t_1;

  /* "pandas/algos.pyx":2210
 *         float64_t* ptr
 *     ngroups = len(counts)
 *     N, K = (<object> values).shape             # <<<<<<<<<<<<<<
 * 
 *     indexer, _counts = groupsort_indexer(labels, ngroups)
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_values), __pyx_n_s_shape); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2210; __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 CYTHON_COMPILING_IN_CPYTHON
    Py_ssize_t size = Py_SIZE(sequence);
    #else
    Py_ssize_t size = PySequence_Size(sequence);
    #endif
    if (unlikely(size != 2)) {
      if (size > 2) __Pyx_RaiseTooManyValuesError(2);
      else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2210; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    #if CYTHON_COMPILING_IN_CPYTHON
    if (likely(PyTuple_CheckExact(sequence))) {
      __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0); 
      __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1); 
    } else {
      __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);
    #else
    __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2210; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2210; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    #endif
    __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[0]; __pyx_lineno = 2210; __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[0]; __pyx_lineno = 2210; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_6 = NULL;
    __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;
    __pyx_t_6 = NULL;
    if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2210; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_L4_unpacking_done:;
  }
  __pyx_t_1 = __Pyx_PyIndex_AsSsize_t(__pyx_t_3); if (unlikely((__pyx_t_1 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2210; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 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[0]; __pyx_lineno = 2210; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_v_N = __pyx_t_1;
  __pyx_v_K = __pyx_t_7;

  /* "pandas/algos.pyx":2212
 *     N, K = (<object> values).shape
 * 
 *     indexer, _counts = groupsort_indexer(labels, ngroups)             # <<<<<<<<<<<<<<
 *     counts[:] = _counts[1:]
 * 
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_groupsort_indexer); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2212; __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[0]; __pyx_lineno = 2212; __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 = 2212; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_INCREF(((PyObject *)__pyx_v_labels));
  PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_labels));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_labels));
  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_4);
  __pyx_t_4 = 0;
  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2212; __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;
  if ((likely(PyTuple_CheckExact(__pyx_t_4))) || (PyList_CheckExact(__pyx_t_4))) {
    PyObject* sequence = __pyx_t_4;
    #if CYTHON_COMPILING_IN_CPYTHON
    Py_ssize_t size = Py_SIZE(sequence);
    #else
    Py_ssize_t size = PySequence_Size(sequence);
    #endif
    if (unlikely(size != 2)) {
      if (size > 2) __Pyx_RaiseTooManyValuesError(2);
      else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2212; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    #if CYTHON_COMPILING_IN_CPYTHON
    if (likely(PyTuple_CheckExact(sequence))) {
      __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0); 
      __pyx_t_2 = PyTuple_GET_ITEM(sequence, 1); 
    } else {
      __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);
    #else
    __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2212; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_2 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2212; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    #endif
    __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[0]; __pyx_lineno = 2212; __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_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_2 = __pyx_t_6(__pyx_t_5); if (unlikely(!__pyx_t_2)) goto __pyx_L5_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_2);
    if (__Pyx_IternextUnpackEndCheck(__pyx_t_6(__pyx_t_5), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2212; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_6 = NULL;
    __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;
    __pyx_t_6 = NULL;
    if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2212; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_L6_unpacking_done:;
  }
  if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2212; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_indexer = __pyx_t_3;
  __pyx_t_3 = 0;
  __pyx_t_8 = ((PyArrayObject *)__pyx_t_2);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd__counts.rcbuffer->pybuffer);
    __pyx_t_9 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd__counts.rcbuffer->pybuffer, (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_pybuffernd__counts.rcbuffer->pybuffer, (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_pybuffernd__counts.diminfo[0].strides = __pyx_pybuffernd__counts.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd__counts.diminfo[0].shape = __pyx_pybuffernd__counts.rcbuffer->pybuffer.shape[0];
    if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2212; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_8 = 0;
  __pyx_v__counts = ((PyArrayObject *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "pandas/algos.pyx":2213
 * 
 *     indexer, _counts = groupsort_indexer(labels, ngroups)
 *     counts[:] = _counts[1:]             # <<<<<<<<<<<<<<
 * 
 *     data = np.empty((K, N), dtype=np.float64)
 */
  __pyx_t_4 = __Pyx_PyObject_GetSlice(((PyObject *)__pyx_v__counts), 1, 0, NULL, NULL, &__pyx_slice__46, 1, 0, 1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2213; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_PyObject_SetSlice(((PyObject *)__pyx_v_counts), __pyx_t_4, 0, 0, NULL, NULL, &__pyx_slice__47, 0, 0, 1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2213; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "pandas/algos.pyx":2215
 *     counts[:] = _counts[1:]
 * 
 *     data = np.empty((K, N), dtype=np.float64)             # <<<<<<<<<<<<<<
 *     ptr = <float64_t*> data.data
 * 
 */
  __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2215; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_empty); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2215; __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[0]; __pyx_lineno = 2215; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_N); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2215; __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[0]; __pyx_lineno = 2215; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__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_3);
  __Pyx_GIVEREF(__pyx_t_3);
  __pyx_t_4 = 0;
  __pyx_t_3 = 0;
  __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2215; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__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 = 2215; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2215; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_float64); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2215; __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, __pyx_n_s_dtype, __pyx_t_13) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2215; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  __pyx_t_13 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_5); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2215; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_13);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__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[0]; __pyx_lineno = 2215; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_data = ((PyArrayObject *)__pyx_t_13);
  __pyx_t_13 = 0;

  /* "pandas/algos.pyx":2216
 * 
 *     data = np.empty((K, N), dtype=np.float64)
 *     ptr = <float64_t*> data.data             # <<<<<<<<<<<<<<
 * 
 *     take_2d_axis1_float64_float64(values.T, indexer, out=data)
 */
  __pyx_v_ptr = ((__pyx_t_5numpy_float64_t *)__pyx_v_data->data);

  /* "pandas/algos.pyx":2218
 *     ptr = <float64_t*> data.data
 * 
 *     take_2d_axis1_float64_float64(values.T, indexer, out=data)             # <<<<<<<<<<<<<<
 * 
 *     for i in range(K):
 */
  __pyx_t_13 = __Pyx_GetModuleGlobalName(__pyx_n_s_take_2d_axis1_float64_float64); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2218; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_13);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_values), __pyx_n_s_T); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2218; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2218; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_5);
  __Pyx_GIVEREF(__pyx_t_5);
  __Pyx_INCREF(__pyx_v_indexer);
  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_indexer);
  __Pyx_GIVEREF(__pyx_v_indexer);
  __pyx_t_5 = 0;
  __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2218; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_out, ((PyObject *)__pyx_v_data)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2218; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_13, __pyx_t_3, __pyx_t_5); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2218; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pandas/algos.pyx":2220
 *     take_2d_axis1_float64_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_1 = 0; __pyx_t_1 < __pyx_t_7; __pyx_t_1+=1) {
    __pyx_v_i = __pyx_t_1;

    /* "pandas/algos.pyx":2222
 *     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_pybuffernd__counts.diminfo[0].shape;
      if (unlikely(__pyx_t_14 < 0)) __pyx_t_9 = 0;
    } else if (unlikely(__pyx_t_14 >= __pyx_pybuffernd__counts.diminfo[0].shape)) __pyx_t_9 = 0;
    if (unlikely(__pyx_t_9 != -1)) {
      __Pyx_RaiseBufferIndexError(__pyx_t_9);
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2222; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_v_ptr = (__pyx_v_ptr + (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd__counts.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd__counts.diminfo[0].strides)));

    /* "pandas/algos.pyx":2223
 *         # 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;

      /* "pandas/algos.pyx":2224
 *         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_pybuffernd__counts.diminfo[0].shape;
        if (unlikely(__pyx_t_17 < 0)) __pyx_t_9 = 0;
      } else if (unlikely(__pyx_t_17 >= __pyx_pybuffernd__counts.diminfo[0].shape)) __pyx_t_9 = 0;
      if (unlikely(__pyx_t_9 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_9);
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2224; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_v_size = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd__counts.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd__counts.diminfo[0].strides));

      /* "pandas/algos.pyx":2225
 *         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_pybuffernd_out.diminfo[0].shape;
        if (unlikely(__pyx_t_18 < 0)) __pyx_t_9 = 0;
      } else if (unlikely(__pyx_t_18 >= __pyx_pybuffernd_out.diminfo[0].shape)) __pyx_t_9 = 0;
      if (__pyx_t_19 < 0) {
        __pyx_t_19 += __pyx_pybuffernd_out.diminfo[1].shape;
        if (unlikely(__pyx_t_19 < 0)) __pyx_t_9 = 1;
      } else if (unlikely(__pyx_t_19 >= __pyx_pybuffernd_out.diminfo[1].shape)) __pyx_t_9 = 1;
      if (unlikely(__pyx_t_9 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_9);
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2225; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_19, __pyx_pybuffernd_out.diminfo[1].strides) = __pyx_f_6pandas_5algos__median_linear(__pyx_v_ptr, __pyx_v_size);

      /* "pandas/algos.pyx":2226
 *             size = _counts[j + 1]
 *             out[j, i] = _median_linear(ptr, size)
 *             ptr += size             # <<<<<<<<<<<<<<
 * 
 * 
 */
      __pyx_v_ptr = (__pyx_v_ptr + __pyx_v_size);
    }
  }

  /* "pandas/algos.pyx":2197
 * # median
 * 
 * def group_median(ndarray[float64_t, ndim=2] out,             # <<<<<<<<<<<<<<
 *                  ndarray[int64_t] counts,
 *                  ndarray[float64_t, ndim=2] values,
 */

  /* function exit code */
  __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_pybuffernd__counts.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_counts.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_labels.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas.algos.group_median", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd__counts.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_counts.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_labels.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer);
  __pyx_L2:;
  __Pyx_XDECREF((PyObject *)__pyx_v__counts);
  __Pyx_XDECREF((PyObject *)__pyx_v_data);
  __Pyx_XDECREF(__pyx_v_indexer);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/algos.pyx":2229
 * 
 * 
 * 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_5algos__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;
  PyObject *__pyx_t_4 = NULL;
  __pyx_t_5numpy_float64_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;
  __Pyx_RefNannySetupContext("_median_linear", 0);

  /* "pandas/algos.pyx":2230
 * 
 * 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;

  /* "pandas/algos.pyx":2235
 * 
 *     # 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;

    /* "pandas/algos.pyx":2236
 *     # 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])) != 0);
    if (__pyx_t_3) {

      /* "pandas/algos.pyx":2237
 *     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:;
  }

  /* "pandas/algos.pyx":2239
 *             na_count += 1
 * 
 *     if na_count:             # <<<<<<<<<<<<<<
 *         if na_count == n:
 *             return NaN
 */
  __pyx_t_3 = (__pyx_v_na_count != 0);
  if (__pyx_t_3) {

    /* "pandas/algos.pyx":2240
 * 
 *     if na_count:
 *         if na_count == n:             # <<<<<<<<<<<<<<
 *             return NaN
 * 
 */
    __pyx_t_3 = ((__pyx_v_na_count == __pyx_v_n) != 0);
    if (__pyx_t_3) {

      /* "pandas/algos.pyx":2241
 *     if na_count:
 *         if na_count == n:
 *             return NaN             # <<<<<<<<<<<<<<
 * 
 *         tmp = <float64_t*> malloc((n - na_count) * sizeof(float64_t))
 */
      __pyx_r = __pyx_v_6pandas_5algos_NaN;
      goto __pyx_L0;
    }

    /* "pandas/algos.pyx":2243
 *             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)))));

    /* "pandas/algos.pyx":2245
 *         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;

    /* "pandas/algos.pyx":2246
 * 
 *         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;

      /* "pandas/algos.pyx":2247
 *         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])) != 0);
      if (__pyx_t_3) {

        /* "pandas/algos.pyx":2248
 *         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]);

        /* "pandas/algos.pyx":2249
 *             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:;
    }

    /* "pandas/algos.pyx":2251
 *                 j += 1
 * 
 *         a = tmp             # <<<<<<<<<<<<<<
 *         n -= na_count
 * 
 */
    __pyx_v_a = __pyx_v_tmp;

    /* "pandas/algos.pyx":2252
 * 
 *         a = tmp
 *         n -= na_count             # <<<<<<<<<<<<<<
 * 
 * 
 */
    __pyx_v_n = (__pyx_v_n - __pyx_v_na_count);
    goto __pyx_L6;
  }
  __pyx_L6:;

  /* "pandas/algos.pyx":2255
 * 
 * 
 *     if n % 2:             # <<<<<<<<<<<<<<
 *         result = kth_smallest_c( a, n / 2, n)
 *     else:
 */
  __pyx_t_3 = (__Pyx_mod_long(__pyx_v_n, 2) != 0);
  if (__pyx_t_3) {

    /* "pandas/algos.pyx":2256
 * 
 *     if n % 2:
 *         result = kth_smallest_c( a, n / 2, n)             # <<<<<<<<<<<<<<
 *     else:
 *         result = (kth_smallest_c(a, n / 2, n) +
 */
    __pyx_t_4 = __pyx_f_6pandas_5algos_kth_smallest_c(__pyx_v_a, __Pyx_div_long(__pyx_v_n, 2), __pyx_v_n); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2256; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __pyx_PyFloat_AsDouble(__pyx_t_4); if (unlikely((__pyx_t_5 == (npy_float64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2256; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_v_result = __pyx_t_5;
    goto __pyx_L11;
  }
  /*else*/ {

    /* "pandas/algos.pyx":2258
 *         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_4 = __pyx_f_6pandas_5algos_kth_smallest_c(__pyx_v_a, __Pyx_div_long(__pyx_v_n, 2), __pyx_v_n); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2258; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);

    /* "pandas/algos.pyx":2259
 *     else:
 *         result = (kth_smallest_c(a, n / 2, n) +
 *                   kth_smallest_c(a, n / 2 - 1, n)) / 2             # <<<<<<<<<<<<<<
 * 
 *     if na_count:
 */
    __pyx_t_6 = __pyx_f_6pandas_5algos_kth_smallest_c(__pyx_v_a, (__Pyx_div_long(__pyx_v_n, 2) - 1), __pyx_v_n); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2259; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);

    /* "pandas/algos.pyx":2258
 *         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_7 = PyNumber_Add(__pyx_t_4, __pyx_t_6); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2258; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

    /* "pandas/algos.pyx":2259
 *     else:
 *         result = (kth_smallest_c(a, n / 2, n) +
 *                   kth_smallest_c(a, n / 2 - 1, n)) / 2             # <<<<<<<<<<<<<<
 * 
 *     if na_count:
 */
    __pyx_t_6 = __Pyx_PyNumber_Divide(__pyx_t_7, __pyx_int_2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2259; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __pyx_t_5 = __pyx_PyFloat_AsDouble(__pyx_t_6); if (unlikely((__pyx_t_5 == (npy_float64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2259; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_v_result = __pyx_t_5;
  }
  __pyx_L11:;

  /* "pandas/algos.pyx":2261
 *                   kth_smallest_c(a, n / 2 - 1, n)) / 2
 * 
 *     if na_count:             # <<<<<<<<<<<<<<
 *         free(a)
 * 
 */
  __pyx_t_3 = (__pyx_v_na_count != 0);
  if (__pyx_t_3) {

    /* "pandas/algos.pyx":2262
 * 
 *     if na_count:
 *         free(a)             # <<<<<<<<<<<<<<
 * 
 *     return result
 */
    free(__pyx_v_a);
    goto __pyx_L12;
  }
  __pyx_L12:;

  /* "pandas/algos.pyx":2264
 *         free(a)
 * 
 *     return result             # <<<<<<<<<<<<<<
 * 
 * include "join.pyx"
 */
  __pyx_r = __pyx_v_result;
  goto __pyx_L0;

  /* "pandas/algos.pyx":2229
 * 
 * 
 * cdef inline float64_t _median_linear(float64_t* a, int n):             # <<<<<<<<<<<<<<
 *     cdef int i, j, na_count = 0
 *     cdef float64_t result
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_WriteUnraisable("pandas.algos._median_linear", __pyx_clineno, __pyx_lineno, __pyx_filename, 0);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/src/join.pyx":1
 * def inner_join(ndarray[int64_t] left, ndarray[int64_t] right,             # <<<<<<<<<<<<<<
 *                Py_ssize_t max_groups):
 *     cdef:
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pandas_5algos_75inner_join(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_5algos_75inner_join = {__Pyx_NAMESTR("inner_join"), (PyCFunction)__pyx_pw_6pandas_5algos_75inner_join, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pw_6pandas_5algos_75inner_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;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("inner_join (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_left,&__pyx_n_s_right,&__pyx_n_s_max_groups,0};
    PyObject* values[3] = {0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_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 (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_left)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_right)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("inner_join", 1, 3, 3, 1); {__pyx_filename = __pyx_f[3]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_max_groups)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("inner_join", 1, 3, 3, 2); {__pyx_filename = __pyx_f[3]; __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, pos_args, "inner_join") < 0)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 1; __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[3]; __pyx_lineno = 2; __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[3]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas.algos.inner_join", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_left), __pyx_ptype_5numpy_ndarray, 1, "left", 0))) {__pyx_filename = __pyx_f[3]; __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[3]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_74inner_join(__pyx_self, __pyx_v_left, __pyx_v_right, __pyx_v_max_groups);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pandas_5algos_74inner_join(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_left, PyArrayObject *__pyx_v_right, 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;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_left;
  __Pyx_Buffer __pyx_pybuffer_left;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_left_count;
  __Pyx_Buffer __pyx_pybuffer_left_count;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_left_indexer;
  __Pyx_Buffer __pyx_pybuffer_left_indexer;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_left_sorter;
  __Pyx_Buffer __pyx_pybuffer_left_sorter;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_right;
  __Pyx_Buffer __pyx_pybuffer_right;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_right_count;
  __Pyx_Buffer __pyx_pybuffer_right_count;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_right_indexer;
  __Pyx_Buffer __pyx_pybuffer_right_indexer;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_right_sorter;
  __Pyx_Buffer __pyx_pybuffer_right_sorter;
  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;
  __Pyx_RefNannySetupContext("inner_join", 0);
  __pyx_pybuffer_left_count.pybuffer.buf = NULL;
  __pyx_pybuffer_left_count.refcount = 0;
  __pyx_pybuffernd_left_count.data = NULL;
  __pyx_pybuffernd_left_count.rcbuffer = &__pyx_pybuffer_left_count;
  __pyx_pybuffer_right_count.pybuffer.buf = NULL;
  __pyx_pybuffer_right_count.refcount = 0;
  __pyx_pybuffernd_right_count.data = NULL;
  __pyx_pybuffernd_right_count.rcbuffer = &__pyx_pybuffer_right_count;
  __pyx_pybuffer_left_sorter.pybuffer.buf = NULL;
  __pyx_pybuffer_left_sorter.refcount = 0;
  __pyx_pybuffernd_left_sorter.data = NULL;
  __pyx_pybuffernd_left_sorter.rcbuffer = &__pyx_pybuffer_left_sorter;
  __pyx_pybuffer_right_sorter.pybuffer.buf = NULL;
  __pyx_pybuffer_right_sorter.refcount = 0;
  __pyx_pybuffernd_right_sorter.data = NULL;
  __pyx_pybuffernd_right_sorter.rcbuffer = &__pyx_pybuffer_right_sorter;
  __pyx_pybuffer_left_indexer.pybuffer.buf = NULL;
  __pyx_pybuffer_left_indexer.refcount = 0;
  __pyx_pybuffernd_left_indexer.data = NULL;
  __pyx_pybuffernd_left_indexer.rcbuffer = &__pyx_pybuffer_left_indexer;
  __pyx_pybuffer_right_indexer.pybuffer.buf = NULL;
  __pyx_pybuffer_right_indexer.refcount = 0;
  __pyx_pybuffernd_right_indexer.data = NULL;
  __pyx_pybuffernd_right_indexer.rcbuffer = &__pyx_pybuffer_right_indexer;
  __pyx_pybuffer_left.pybuffer.buf = NULL;
  __pyx_pybuffer_left.refcount = 0;
  __pyx_pybuffernd_left.data = NULL;
  __pyx_pybuffernd_left.rcbuffer = &__pyx_pybuffer_left;
  __pyx_pybuffer_right.pybuffer.buf = NULL;
  __pyx_pybuffer_right.refcount = 0;
  __pyx_pybuffernd_right.data = NULL;
  __pyx_pybuffernd_right.rcbuffer = &__pyx_pybuffer_right;
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_left.rcbuffer->pybuffer, (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[3]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_left.diminfo[0].strides = __pyx_pybuffernd_left.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_left.diminfo[0].shape = __pyx_pybuffernd_left.rcbuffer->pybuffer.shape[0];
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_right.rcbuffer->pybuffer, (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[3]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_right.diminfo[0].strides = __pyx_pybuffernd_right.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_right.diminfo[0].shape = __pyx_pybuffernd_right.rcbuffer->pybuffer.shape[0];

  /* "pandas/src/join.pyx":4
 *                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;

  /* "pandas/src/join.pyx":11
 *     # 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_GetModuleGlobalName(__pyx_n_s_groupsort_indexer); 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 = PyInt_FromSsize_t(__pyx_v_max_groups); 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_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 11; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__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 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, 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(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__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 CYTHON_COMPILING_IN_CPYTHON
    Py_ssize_t size = Py_SIZE(sequence);
    #else
    Py_ssize_t size = PySequence_Size(sequence);
    #endif
    if (unlikely(size != 2)) {
      if (size > 2) __Pyx_RaiseTooManyValuesError(2);
      else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
      {__pyx_filename = __pyx_f[3]; __pyx_lineno = 11; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    #if CYTHON_COMPILING_IN_CPYTHON
    if (likely(PyTuple_CheckExact(sequence))) {
      __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0); 
      __pyx_t_1 = PyTuple_GET_ITEM(sequence, 1); 
    } else {
      __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);
    #else
    __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 11; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_1 = PySequence_ITEM(sequence, 1); 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);
    #endif
    __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[3]; __pyx_lineno = 11; __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_L3_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_L3_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_1);
    if (__Pyx_IternextUnpackEndCheck(__pyx_t_5(__pyx_t_4), 2) < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 11; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_5 = NULL;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    goto __pyx_L4_unpacking_done;
    __pyx_L3_unpacking_failed:;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_5 = NULL;
    if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
    {__pyx_filename = __pyx_f[3]; __pyx_lineno = 11; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_L4_unpacking_done:;
  }
  if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 11; __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[3]; __pyx_lineno = 11; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_6 = ((PyArrayObject *)__pyx_t_3);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_left_sorter.rcbuffer->pybuffer);
    __pyx_t_7 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_left_sorter.rcbuffer->pybuffer, (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_pybuffernd_left_sorter.rcbuffer->pybuffer, (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_pybuffernd_left_sorter.diminfo[0].strides = __pyx_pybuffernd_left_sorter.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_left_sorter.diminfo[0].shape = __pyx_pybuffernd_left_sorter.rcbuffer->pybuffer.shape[0];
    if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 11; __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_pybuffernd_left_count.rcbuffer->pybuffer);
    __pyx_t_7 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_left_count.rcbuffer->pybuffer, (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_pybuffernd_left_count.rcbuffer->pybuffer, (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_pybuffernd_left_count.diminfo[0].strides = __pyx_pybuffernd_left_count.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_left_count.diminfo[0].shape = __pyx_pybuffernd_left_count.rcbuffer->pybuffer.shape[0];
    if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 11; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_6 = 0;
  __pyx_v_left_count = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pandas/src/join.pyx":12
 * 
 *     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_GetModuleGlobalName(__pyx_n_s_groupsort_indexer); 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 = PyInt_FromSsize_t(__pyx_v_max_groups); 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_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 12; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__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 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, 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(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__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 CYTHON_COMPILING_IN_CPYTHON
    Py_ssize_t size = Py_SIZE(sequence);
    #else
    Py_ssize_t size = PySequence_Size(sequence);
    #endif
    if (unlikely(size != 2)) {
      if (size > 2) __Pyx_RaiseTooManyValuesError(2);
      else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
      {__pyx_filename = __pyx_f[3]; __pyx_lineno = 12; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    #if CYTHON_COMPILING_IN_CPYTHON
    if (likely(PyTuple_CheckExact(sequence))) {
      __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0); 
      __pyx_t_2 = PyTuple_GET_ITEM(sequence, 1); 
    } else {
      __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);
    #else
    __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 12; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_2 = PySequence_ITEM(sequence, 1); 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);
    #endif
    __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 = 12; __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_L5_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_L5_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_2);
    if (__Pyx_IternextUnpackEndCheck(__pyx_t_5(__pyx_t_4), 2) < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 12; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_5 = NULL;
    __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;
    __pyx_t_5 = NULL;
    if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
    {__pyx_filename = __pyx_f[3]; __pyx_lineno = 12; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_L6_unpacking_done:;
  }
  if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 12; __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[3]; __pyx_lineno = 12; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_6 = ((PyArrayObject *)__pyx_t_3);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_right_sorter.rcbuffer->pybuffer);
    __pyx_t_7 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_right_sorter.rcbuffer->pybuffer, (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_pybuffernd_right_sorter.rcbuffer->pybuffer, (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_pybuffernd_right_sorter.diminfo[0].strides = __pyx_pybuffernd_right_sorter.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_right_sorter.diminfo[0].shape = __pyx_pybuffernd_right_sorter.rcbuffer->pybuffer.shape[0];
    if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 12; __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_pybuffernd_right_count.rcbuffer->pybuffer);
    __pyx_t_7 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_right_count.rcbuffer->pybuffer, (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_pybuffernd_right_count.rcbuffer->pybuffer, (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_pybuffernd_right_count.diminfo[0].strides = __pyx_pybuffernd_right_count.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_right_count.diminfo[0].shape = __pyx_pybuffernd_right_count.rcbuffer->pybuffer.shape[0];
    if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 12; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_6 = 0;
  __pyx_v_right_count = ((PyArrayObject *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "pandas/src/join.pyx":15
 * 
 *     # 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;

    /* "pandas/src/join.pyx":16
 *     # 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_pybuffernd_left_count.diminfo[0].shape;
      if (unlikely(__pyx_t_13 < 0)) __pyx_t_7 = 0;
    } else if (unlikely(__pyx_t_13 >= __pyx_pybuffernd_left_count.diminfo[0].shape)) __pyx_t_7 = 0;
    if (unlikely(__pyx_t_7 != -1)) {
      __Pyx_RaiseBufferIndexError(__pyx_t_7);
      {__pyx_filename = __pyx_f[3]; __pyx_lineno = 16; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_v_lc = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_left_count.rcbuffer->pybuffer.buf, __pyx_t_13, __pyx_pybuffernd_left_count.diminfo[0].strides));

    /* "pandas/src/join.pyx":17
 *     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_pybuffernd_right_count.diminfo[0].shape;
      if (unlikely(__pyx_t_14 < 0)) __pyx_t_7 = 0;
    } else if (unlikely(__pyx_t_14 >= __pyx_pybuffernd_right_count.diminfo[0].shape)) __pyx_t_7 = 0;
    if (unlikely(__pyx_t_7 != -1)) {
      __Pyx_RaiseBufferIndexError(__pyx_t_7);
      {__pyx_filename = __pyx_f[3]; __pyx_lineno = 17; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_v_rc = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_right_count.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_right_count.diminfo[0].strides));

    /* "pandas/src/join.pyx":19
 *         rc = right_count[i]
 * 
 *         if rc > 0 and lc > 0:             # <<<<<<<<<<<<<<
 *             count += lc * rc
 * 
 */
    __pyx_t_15 = ((__pyx_v_rc > 0) != 0);
    if (__pyx_t_15) {
      __pyx_t_16 = ((__pyx_v_lc > 0) != 0);
      __pyx_t_17 = __pyx_t_16;
    } else {
      __pyx_t_17 = __pyx_t_15;
    }
    if (__pyx_t_17) {

      /* "pandas/src/join.pyx":20
 * 
 *         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_L9;
    }
    __pyx_L9:;
  }

  /* "pandas/src/join.pyx":24
 *     # 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;

  /* "pandas/src/join.pyx":28
 * 
 *     # 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_pybuffernd_left_count.diminfo[0].shape;
    if (unlikely(__pyx_t_18 < 0)) __pyx_t_7 = 0;
  } else if (unlikely(__pyx_t_18 >= __pyx_pybuffernd_left_count.diminfo[0].shape)) __pyx_t_7 = 0;
  if (unlikely(__pyx_t_7 != -1)) {
    __Pyx_RaiseBufferIndexError(__pyx_t_7);
    {__pyx_filename = __pyx_f[3]; __pyx_lineno = 28; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_v_left_pos = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_left_count.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_left_count.diminfo[0].strides));

  /* "pandas/src/join.pyx":29
 *     # 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_pybuffernd_right_count.diminfo[0].shape;
    if (unlikely(__pyx_t_19 < 0)) __pyx_t_7 = 0;
  } else if (unlikely(__pyx_t_19 >= __pyx_pybuffernd_right_count.diminfo[0].shape)) __pyx_t_7 = 0;
  if (unlikely(__pyx_t_7 != -1)) {
    __Pyx_RaiseBufferIndexError(__pyx_t_7);
    {__pyx_filename = __pyx_f[3]; __pyx_lineno = 29; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_v_right_pos = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_right_count.rcbuffer->pybuffer.buf, __pyx_t_19, __pyx_pybuffernd_right_count.diminfo[0].strides));

  /* "pandas/src/join.pyx":31
 *     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_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 31; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_empty); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 31; __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[3]; __pyx_lineno = 31; __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 = 31; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__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[3]; __pyx_lineno = 31; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 31; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_20 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_int64); if (unlikely(!__pyx_t_20)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 31; __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, __pyx_n_s_dtype, __pyx_t_20) < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 31; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
  __pyx_t_20 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_20)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 31; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_20);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__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[3]; __pyx_lineno = 31; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_21 = ((PyArrayObject *)__pyx_t_20);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_left_indexer.rcbuffer->pybuffer);
    __pyx_t_7 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_left_indexer.rcbuffer->pybuffer, (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_pybuffernd_left_indexer.rcbuffer->pybuffer, (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_pybuffernd_left_indexer.diminfo[0].strides = __pyx_pybuffernd_left_indexer.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_left_indexer.diminfo[0].shape = __pyx_pybuffernd_left_indexer.rcbuffer->pybuffer.shape[0];
    if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 31; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_21 = 0;
  __pyx_v_left_indexer = ((PyArrayObject *)__pyx_t_20);
  __pyx_t_20 = 0;

  /* "pandas/src/join.pyx":32
 * 
 *     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_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_20)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 32; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_20);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_20, __pyx_n_s_empty); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 32; __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[3]; __pyx_lineno = 32; __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[3]; __pyx_lineno = 32; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__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[3]; __pyx_lineno = 32; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_20);
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 32; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_int64); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 32; __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, __pyx_n_s_dtype, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 32; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, __pyx_t_20); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 32; __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_DECREF(__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[3]; __pyx_lineno = 32; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_21 = ((PyArrayObject *)__pyx_t_4);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_right_indexer.rcbuffer->pybuffer);
    __pyx_t_7 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_right_indexer.rcbuffer->pybuffer, (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_pybuffernd_right_indexer.rcbuffer->pybuffer, (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_pybuffernd_right_indexer.diminfo[0].strides = __pyx_pybuffernd_right_indexer.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_right_indexer.diminfo[0].shape = __pyx_pybuffernd_right_indexer.rcbuffer->pybuffer.shape[0];
    if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 32; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_21 = 0;
  __pyx_v_right_indexer = ((PyArrayObject *)__pyx_t_4);
  __pyx_t_4 = 0;

  /* "pandas/src/join.pyx":34
 *     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;

    /* "pandas/src/join.pyx":35
 * 
 *     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_pybuffernd_left_count.diminfo[0].shape;
      if (unlikely(__pyx_t_22 < 0)) __pyx_t_7 = 0;
    } else if (unlikely(__pyx_t_22 >= __pyx_pybuffernd_left_count.diminfo[0].shape)) __pyx_t_7 = 0;
    if (unlikely(__pyx_t_7 != -1)) {
      __Pyx_RaiseBufferIndexError(__pyx_t_7);
      {__pyx_filename = __pyx_f[3]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_v_lc = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_left_count.rcbuffer->pybuffer.buf, __pyx_t_22, __pyx_pybuffernd_left_count.diminfo[0].strides));

    /* "pandas/src/join.pyx":36
 *     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_pybuffernd_right_count.diminfo[0].shape;
      if (unlikely(__pyx_t_23 < 0)) __pyx_t_7 = 0;
    } else if (unlikely(__pyx_t_23 >= __pyx_pybuffernd_right_count.diminfo[0].shape)) __pyx_t_7 = 0;
    if (unlikely(__pyx_t_7 != -1)) {
      __Pyx_RaiseBufferIndexError(__pyx_t_7);
      {__pyx_filename = __pyx_f[3]; __pyx_lineno = 36; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_v_rc = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_right_count.rcbuffer->pybuffer.buf, __pyx_t_23, __pyx_pybuffernd_right_count.diminfo[0].strides));

    /* "pandas/src/join.pyx":38
 *         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) != 0);
    if (__pyx_t_17) {
      __pyx_t_15 = ((__pyx_v_lc > 0) != 0);
      __pyx_t_16 = __pyx_t_15;
    } else {
      __pyx_t_16 = __pyx_t_17;
    }
    if (__pyx_t_16) {

      /* "pandas/src/join.pyx":39
 * 
 *         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;

        /* "pandas/src/join.pyx":40
 *         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));

        /* "pandas/src/join.pyx":41
 *             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;

          /* "pandas/src/join.pyx":42
 *                 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_pybuffernd_left_indexer.diminfo[0].shape;
            if (unlikely(__pyx_t_28 < 0)) __pyx_t_7 = 0;
          } else if (unlikely(__pyx_t_28 >= __pyx_pybuffernd_left_indexer.diminfo[0].shape)) __pyx_t_7 = 0;
          if (unlikely(__pyx_t_7 != -1)) {
            __Pyx_RaiseBufferIndexError(__pyx_t_7);
            {__pyx_filename = __pyx_f[3]; __pyx_lineno = 42; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          }
          *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_left_indexer.rcbuffer->pybuffer.buf, __pyx_t_28, __pyx_pybuffernd_left_indexer.diminfo[0].strides) = (__pyx_v_left_pos + __pyx_v_j);

          /* "pandas/src/join.pyx":43
 *                 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_pybuffernd_right_indexer.diminfo[0].shape;
            if (unlikely(__pyx_t_29 < 0)) __pyx_t_7 = 0;
          } else if (unlikely(__pyx_t_29 >= __pyx_pybuffernd_right_indexer.diminfo[0].shape)) __pyx_t_7 = 0;
          if (unlikely(__pyx_t_7 != -1)) {
            __Pyx_RaiseBufferIndexError(__pyx_t_7);
            {__pyx_filename = __pyx_f[3]; __pyx_lineno = 43; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          }
          *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_right_indexer.rcbuffer->pybuffer.buf, __pyx_t_29, __pyx_pybuffernd_right_indexer.diminfo[0].strides) = (__pyx_v_right_pos + __pyx_v_k);
        }
      }

      /* "pandas/src/join.pyx":44
 *                     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_L12;
    }
    __pyx_L12:;

    /* "pandas/src/join.pyx":45
 *                     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);

    /* "pandas/src/join.pyx":46
 *             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);
  }

  /* "pandas/src/join.pyx":48
 *         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_GetModuleGlobalName(__pyx_n_s_get_result_indexer); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 48; __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[3]; __pyx_lineno = 48; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__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 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_20, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 48; __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_20); __pyx_t_20 = 0;

  /* "pandas/src/join.pyx":49
 * 
 *     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_GetModuleGlobalName(__pyx_n_s_get_result_indexer); if (unlikely(!__pyx_t_20)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 49; __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[3]; __pyx_lineno = 49; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__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 = __Pyx_PyObject_Call(__pyx_t_20, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 49; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "pandas/src/join.pyx":48
 *         right_pos += rc
 * 
 *     return (_get_result_indexer(left_sorter, left_indexer),             # <<<<<<<<<<<<<<
 *             _get_result_indexer(right_sorter, right_indexer))
 * 
 */
  __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 48; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__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 = __pyx_t_4;
  __pyx_t_4 = 0;
  goto __pyx_L0;

  /* "pandas/src/join.pyx":1
 * def inner_join(ndarray[int64_t] left, ndarray[int64_t] right,             # <<<<<<<<<<<<<<
 *                Py_ssize_t max_groups):
 *     cdef:
 */

  /* function exit code */
  __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_pybuffernd_left.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_left_count.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_left_indexer.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_left_sorter.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_right.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_right_count.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_right_indexer.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_right_sorter.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas.algos.inner_join", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_left.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_left_count.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_left_indexer.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_left_sorter.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_right.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_right_count.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_right_indexer.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_right_sorter.rcbuffer->pybuffer);
  __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;
}

/* "pandas/src/join.pyx":51
 *             _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:
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pandas_5algos_77left_outer_join(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_5algos_77left_outer_join = {__Pyx_NAMESTR("left_outer_join"), (PyCFunction)__pyx_pw_6pandas_5algos_77left_outer_join, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pw_6pandas_5algos_77left_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;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("left_outer_join (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_left,&__pyx_n_s_right,&__pyx_n_s_max_groups,&__pyx_n_s_sort,0};
    PyObject* values[4] = {0,0,0,0};

    /* "pandas/src/join.pyx":52
 * 
 * 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
 */
    values[3] = ((PyObject *)Py_True);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_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 (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_left)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_right)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("left_outer_join", 0, 3, 4, 1); {__pyx_filename = __pyx_f[3]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_max_groups)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("left_outer_join", 0, 3, 4, 2); {__pyx_filename = __pyx_f[3]; __pyx_lineno = 51; __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, pos_args, "left_outer_join") < 0)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 51; __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[3]; __pyx_lineno = 52; __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[3]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas.algos.left_outer_join", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_left), __pyx_ptype_5numpy_ndarray, 1, "left", 0))) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 51; __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 = 51; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_76left_outer_join(__pyx_self, __pyx_v_left, __pyx_v_right, __pyx_v_max_groups, __pyx_v_sort);

  /* "pandas/src/join.pyx":51
 *             _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:
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pandas_5algos_76left_outer_join(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_left, PyArrayObject *__pyx_v_right, Py_ssize_t __pyx_v_max_groups, PyObject *__pyx_v_sort) {
  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;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_left;
  __Pyx_Buffer __pyx_pybuffer_left;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_left_count;
  __Pyx_Buffer __pyx_pybuffer_left_count;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_left_indexer;
  __Pyx_Buffer __pyx_pybuffer_left_indexer;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_right;
  __Pyx_Buffer __pyx_pybuffer_right;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_right_count;
  __Pyx_Buffer __pyx_pybuffer_right_count;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_right_indexer;
  __Pyx_Buffer __pyx_pybuffer_right_indexer;
  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;
  __Pyx_RefNannySetupContext("left_outer_join", 0);
  __pyx_pybuffer_left_count.pybuffer.buf = NULL;
  __pyx_pybuffer_left_count.refcount = 0;
  __pyx_pybuffernd_left_count.data = NULL;
  __pyx_pybuffernd_left_count.rcbuffer = &__pyx_pybuffer_left_count;
  __pyx_pybuffer_right_count.pybuffer.buf = NULL;
  __pyx_pybuffer_right_count.refcount = 0;
  __pyx_pybuffernd_right_count.data = NULL;
  __pyx_pybuffernd_right_count.rcbuffer = &__pyx_pybuffer_right_count;
  __pyx_pybuffer_left_indexer.pybuffer.buf = NULL;
  __pyx_pybuffer_left_indexer.refcount = 0;
  __pyx_pybuffernd_left_indexer.data = NULL;
  __pyx_pybuffernd_left_indexer.rcbuffer = &__pyx_pybuffer_left_indexer;
  __pyx_pybuffer_right_indexer.pybuffer.buf = NULL;
  __pyx_pybuffer_right_indexer.refcount = 0;
  __pyx_pybuffernd_right_indexer.data = NULL;
  __pyx_pybuffernd_right_indexer.rcbuffer = &__pyx_pybuffer_right_indexer;
  __pyx_pybuffer_left.pybuffer.buf = NULL;
  __pyx_pybuffer_left.refcount = 0;
  __pyx_pybuffernd_left.data = NULL;
  __pyx_pybuffernd_left.rcbuffer = &__pyx_pybuffer_left;
  __pyx_pybuffer_right.pybuffer.buf = NULL;
  __pyx_pybuffer_right.refcount = 0;
  __pyx_pybuffernd_right.data = NULL;
  __pyx_pybuffernd_right.rcbuffer = &__pyx_pybuffer_right;
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_left.rcbuffer->pybuffer, (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[3]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_left.diminfo[0].strides = __pyx_pybuffernd_left.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_left.diminfo[0].shape = __pyx_pybuffernd_left.rcbuffer->pybuffer.shape[0];
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_right.rcbuffer->pybuffer, (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[3]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_right.diminfo[0].strides = __pyx_pybuffernd_right.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_right.diminfo[0].shape = __pyx_pybuffernd_right.rcbuffer->pybuffer.shape[0];

  /* "pandas/src/join.pyx":54
 *                     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;

  /* "pandas/src/join.pyx":62
 *     # 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_GetModuleGlobalName(__pyx_n_s_groupsort_indexer); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 62; __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[3]; __pyx_lineno = 62; __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[3]; __pyx_lineno = 62; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__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 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 62; __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;
  if ((likely(PyTuple_CheckExact(__pyx_t_2))) || (PyList_CheckExact(__pyx_t_2))) {
    PyObject* sequence = __pyx_t_2;
    #if CYTHON_COMPILING_IN_CPYTHON
    Py_ssize_t size = Py_SIZE(sequence);
    #else
    Py_ssize_t size = PySequence_Size(sequence);
    #endif
    if (unlikely(size != 2)) {
      if (size > 2) __Pyx_RaiseTooManyValuesError(2);
      else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
      {__pyx_filename = __pyx_f[3]; __pyx_lineno = 62; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    #if CYTHON_COMPILING_IN_CPYTHON
    if (likely(PyTuple_CheckExact(sequence))) {
      __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0); 
      __pyx_t_1 = PyTuple_GET_ITEM(sequence, 1); 
    } else {
      __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);
    #else
    __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 62; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_1 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 62; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    #endif
    __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[3]; __pyx_lineno = 62; __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_L3_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_L3_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_1);
    if (__Pyx_IternextUnpackEndCheck(__pyx_t_5(__pyx_t_4), 2) < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 62; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_5 = NULL;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    goto __pyx_L4_unpacking_done;
    __pyx_L3_unpacking_failed:;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_5 = NULL;
    if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
    {__pyx_filename = __pyx_f[3]; __pyx_lineno = 62; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_L4_unpacking_done:;
  }
  if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 62; __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[3]; __pyx_lineno = 62; __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_pybuffernd_left_count.rcbuffer->pybuffer);
    __pyx_t_7 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_left_count.rcbuffer->pybuffer, (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_pybuffernd_left_count.rcbuffer->pybuffer, (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_pybuffernd_left_count.diminfo[0].strides = __pyx_pybuffernd_left_count.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_left_count.diminfo[0].shape = __pyx_pybuffernd_left_count.rcbuffer->pybuffer.shape[0];
    if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 62; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_6 = 0;
  __pyx_v_left_count = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pandas/src/join.pyx":63
 * 
 *     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_GetModuleGlobalName(__pyx_n_s_groupsort_indexer); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 63; __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[3]; __pyx_lineno = 63; __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[3]; __pyx_lineno = 63; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__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 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 63; __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;
  if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) {
    PyObject* sequence = __pyx_t_1;
    #if CYTHON_COMPILING_IN_CPYTHON
    Py_ssize_t size = Py_SIZE(sequence);
    #else
    Py_ssize_t size = PySequence_Size(sequence);
    #endif
    if (unlikely(size != 2)) {
      if (size > 2) __Pyx_RaiseTooManyValuesError(2);
      else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
      {__pyx_filename = __pyx_f[3]; __pyx_lineno = 63; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    #if CYTHON_COMPILING_IN_CPYTHON
    if (likely(PyTuple_CheckExact(sequence))) {
      __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0); 
      __pyx_t_2 = PyTuple_GET_ITEM(sequence, 1); 
    } else {
      __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);
    #else
    __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 63; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_2 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 63; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    #endif
    __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 = 63; __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_L5_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_L5_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_2);
    if (__Pyx_IternextUnpackEndCheck(__pyx_t_5(__pyx_t_4), 2) < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 63; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_5 = NULL;
    __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;
    __pyx_t_5 = NULL;
    if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
    {__pyx_filename = __pyx_f[3]; __pyx_lineno = 63; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_L6_unpacking_done:;
  }
  if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 63; __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[3]; __pyx_lineno = 63; __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_pybuffernd_right_count.rcbuffer->pybuffer);
    __pyx_t_7 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_right_count.rcbuffer->pybuffer, (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_pybuffernd_right_count.rcbuffer->pybuffer, (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_pybuffernd_right_count.diminfo[0].strides = __pyx_pybuffernd_right_count.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_right_count.diminfo[0].shape = __pyx_pybuffernd_right_count.rcbuffer->pybuffer.shape[0];
    if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 63; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_6 = 0;
  __pyx_v_right_count = ((PyArrayObject *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "pandas/src/join.pyx":66
 * 
 *     # 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;

    /* "pandas/src/join.pyx":67
 *     # 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_pybuffernd_right_count.diminfo[0].shape;
      if (unlikely(__pyx_t_13 < 0)) __pyx_t_7 = 0;
    } else if (unlikely(__pyx_t_13 >= __pyx_pybuffernd_right_count.diminfo[0].shape)) __pyx_t_7 = 0;
    if (unlikely(__pyx_t_7 != -1)) {
      __Pyx_RaiseBufferIndexError(__pyx_t_7);
      {__pyx_filename = __pyx_f[3]; __pyx_lineno = 67; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_14 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_right_count.rcbuffer->pybuffer.buf, __pyx_t_13, __pyx_pybuffernd_right_count.diminfo[0].strides)) > 0) != 0);
    if (__pyx_t_14) {

      /* "pandas/src/join.pyx":68
 *     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_pybuffernd_left_count.diminfo[0].shape;
        if (unlikely(__pyx_t_15 < 0)) __pyx_t_7 = 0;
      } else if (unlikely(__pyx_t_15 >= __pyx_pybuffernd_left_count.diminfo[0].shape)) __pyx_t_7 = 0;
      if (unlikely(__pyx_t_7 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_7);
        {__pyx_filename = __pyx_f[3]; __pyx_lineno = 68; __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_pybuffernd_right_count.diminfo[0].shape;
        if (unlikely(__pyx_t_16 < 0)) __pyx_t_7 = 0;
      } else if (unlikely(__pyx_t_16 >= __pyx_pybuffernd_right_count.diminfo[0].shape)) __pyx_t_7 = 0;
      if (unlikely(__pyx_t_7 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_7);
        {__pyx_filename = __pyx_f[3]; __pyx_lineno = 68; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_v_count = (__pyx_v_count + ((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_left_count.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_left_count.diminfo[0].strides)) * (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_right_count.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_right_count.diminfo[0].strides))));
      goto __pyx_L9;
    }
    /*else*/ {

      /* "pandas/src/join.pyx":70
 *             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_pybuffernd_left_count.diminfo[0].shape;
        if (unlikely(__pyx_t_17 < 0)) __pyx_t_7 = 0;
      } else if (unlikely(__pyx_t_17 >= __pyx_pybuffernd_left_count.diminfo[0].shape)) __pyx_t_7 = 0;
      if (unlikely(__pyx_t_7 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_7);
        {__pyx_filename = __pyx_f[3]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_v_count = (__pyx_v_count + (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_left_count.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_left_count.diminfo[0].strides)));
    }
    __pyx_L9:;
  }

  /* "pandas/src/join.pyx":74
 *     # 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;

  /* "pandas/src/join.pyx":78
 * 
 *     # 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_pybuffernd_left_count.diminfo[0].shape;
    if (unlikely(__pyx_t_18 < 0)) __pyx_t_7 = 0;
  } else if (unlikely(__pyx_t_18 >= __pyx_pybuffernd_left_count.diminfo[0].shape)) __pyx_t_7 = 0;
  if (unlikely(__pyx_t_7 != -1)) {
    __Pyx_RaiseBufferIndexError(__pyx_t_7);
    {__pyx_filename = __pyx_f[3]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_v_left_pos = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_left_count.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_left_count.diminfo[0].strides));

  /* "pandas/src/join.pyx":79
 *     # 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_pybuffernd_right_count.diminfo[0].shape;
    if (unlikely(__pyx_t_19 < 0)) __pyx_t_7 = 0;
  } else if (unlikely(__pyx_t_19 >= __pyx_pybuffernd_right_count.diminfo[0].shape)) __pyx_t_7 = 0;
  if (unlikely(__pyx_t_7 != -1)) {
    __Pyx_RaiseBufferIndexError(__pyx_t_7);
    {__pyx_filename = __pyx_f[3]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_v_right_pos = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_right_count.rcbuffer->pybuffer.buf, __pyx_t_19, __pyx_pybuffernd_right_count.diminfo[0].strides));

  /* "pandas/src/join.pyx":81
 *     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_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_empty); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 81; __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[3]; __pyx_lineno = 81; __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 = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__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[3]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_20 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_int64); if (unlikely(!__pyx_t_20)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 81; __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, __pyx_n_s_dtype, __pyx_t_20) < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
  __pyx_t_20 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_20)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_20);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__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[3]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_21 = ((PyArrayObject *)__pyx_t_20);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_left_indexer.rcbuffer->pybuffer);
    __pyx_t_7 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_left_indexer.rcbuffer->pybuffer, (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_pybuffernd_left_indexer.rcbuffer->pybuffer, (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_pybuffernd_left_indexer.diminfo[0].strides = __pyx_pybuffernd_left_indexer.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_left_indexer.diminfo[0].shape = __pyx_pybuffernd_left_indexer.rcbuffer->pybuffer.shape[0];
    if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_21 = 0;
  __pyx_v_left_indexer = ((PyArrayObject *)__pyx_t_20);
  __pyx_t_20 = 0;

  /* "pandas/src/join.pyx":82
 * 
 *     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_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_20)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 82; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_20);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_20, __pyx_n_s_empty); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 82; __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[3]; __pyx_lineno = 82; __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[3]; __pyx_lineno = 82; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__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[3]; __pyx_lineno = 82; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_20);
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 82; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_int64); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 82; __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, __pyx_n_s_dtype, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 82; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, __pyx_t_20); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 82; __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_DECREF(__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[3]; __pyx_lineno = 82; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_21 = ((PyArrayObject *)__pyx_t_4);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_right_indexer.rcbuffer->pybuffer);
    __pyx_t_7 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_right_indexer.rcbuffer->pybuffer, (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_pybuffernd_right_indexer.rcbuffer->pybuffer, (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_pybuffernd_right_indexer.diminfo[0].strides = __pyx_pybuffernd_right_indexer.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_right_indexer.diminfo[0].shape = __pyx_pybuffernd_right_indexer.rcbuffer->pybuffer.shape[0];
    if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 82; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_21 = 0;
  __pyx_v_right_indexer = ((PyArrayObject *)__pyx_t_4);
  __pyx_t_4 = 0;

  /* "pandas/src/join.pyx":84
 *     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;

    /* "pandas/src/join.pyx":85
 * 
 *     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_pybuffernd_left_count.diminfo[0].shape;
      if (unlikely(__pyx_t_22 < 0)) __pyx_t_7 = 0;
    } else if (unlikely(__pyx_t_22 >= __pyx_pybuffernd_left_count.diminfo[0].shape)) __pyx_t_7 = 0;
    if (unlikely(__pyx_t_7 != -1)) {
      __Pyx_RaiseBufferIndexError(__pyx_t_7);
      {__pyx_filename = __pyx_f[3]; __pyx_lineno = 85; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_v_lc = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_left_count.rcbuffer->pybuffer.buf, __pyx_t_22, __pyx_pybuffernd_left_count.diminfo[0].strides));

    /* "pandas/src/join.pyx":86
 *     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_pybuffernd_right_count.diminfo[0].shape;
      if (unlikely(__pyx_t_23 < 0)) __pyx_t_7 = 0;
    } else if (unlikely(__pyx_t_23 >= __pyx_pybuffernd_right_count.diminfo[0].shape)) __pyx_t_7 = 0;
    if (unlikely(__pyx_t_7 != -1)) {
      __Pyx_RaiseBufferIndexError(__pyx_t_7);
      {__pyx_filename = __pyx_f[3]; __pyx_lineno = 86; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_v_rc = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_right_count.rcbuffer->pybuffer.buf, __pyx_t_23, __pyx_pybuffernd_right_count.diminfo[0].strides));

    /* "pandas/src/join.pyx":88
 *         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) != 0);
    if (__pyx_t_14) {

      /* "pandas/src/join.pyx":89
 * 
 *         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;

        /* "pandas/src/join.pyx":90
 *         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_pybuffernd_left_indexer.diminfo[0].shape;
          if (unlikely(__pyx_t_26 < 0)) __pyx_t_7 = 0;
        } else if (unlikely(__pyx_t_26 >= __pyx_pybuffernd_left_indexer.diminfo[0].shape)) __pyx_t_7 = 0;
        if (unlikely(__pyx_t_7 != -1)) {
          __Pyx_RaiseBufferIndexError(__pyx_t_7);
          {__pyx_filename = __pyx_f[3]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_left_indexer.rcbuffer->pybuffer.buf, __pyx_t_26, __pyx_pybuffernd_left_indexer.diminfo[0].strides) = (__pyx_v_left_pos + __pyx_v_j);

        /* "pandas/src/join.pyx":91
 *             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_pybuffernd_right_indexer.diminfo[0].shape;
          if (unlikely(__pyx_t_27 < 0)) __pyx_t_7 = 0;
        } else if (unlikely(__pyx_t_27 >= __pyx_pybuffernd_right_indexer.diminfo[0].shape)) __pyx_t_7 = 0;
        if (unlikely(__pyx_t_7 != -1)) {
          __Pyx_RaiseBufferIndexError(__pyx_t_7);
          {__pyx_filename = __pyx_f[3]; __pyx_lineno = 91; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_right_indexer.rcbuffer->pybuffer.buf, __pyx_t_27, __pyx_pybuffernd_right_indexer.diminfo[0].strides) = -1;
      }

      /* "pandas/src/join.pyx":92
 *                 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_L12;
    }
    /*else*/ {

      /* "pandas/src/join.pyx":94
 *             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;

        /* "pandas/src/join.pyx":95
 *         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));

        /* "pandas/src/join.pyx":96
 *             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;

          /* "pandas/src/join.pyx":97
 *                 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_pybuffernd_left_indexer.diminfo[0].shape;
            if (unlikely(__pyx_t_30 < 0)) __pyx_t_7 = 0;
          } else if (unlikely(__pyx_t_30 >= __pyx_pybuffernd_left_indexer.diminfo[0].shape)) __pyx_t_7 = 0;
          if (unlikely(__pyx_t_7 != -1)) {
            __Pyx_RaiseBufferIndexError(__pyx_t_7);
            {__pyx_filename = __pyx_f[3]; __pyx_lineno = 97; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          }
          *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_left_indexer.rcbuffer->pybuffer.buf, __pyx_t_30, __pyx_pybuffernd_left_indexer.diminfo[0].strides) = (__pyx_v_left_pos + __pyx_v_j);

          /* "pandas/src/join.pyx":98
 *                 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_pybuffernd_right_indexer.diminfo[0].shape;
            if (unlikely(__pyx_t_31 < 0)) __pyx_t_7 = 0;
          } else if (unlikely(__pyx_t_31 >= __pyx_pybuffernd_right_indexer.diminfo[0].shape)) __pyx_t_7 = 0;
          if (unlikely(__pyx_t_7 != -1)) {
            __Pyx_RaiseBufferIndexError(__pyx_t_7);
            {__pyx_filename = __pyx_f[3]; __pyx_lineno = 98; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          }
          *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_right_indexer.rcbuffer->pybuffer.buf, __pyx_t_31, __pyx_pybuffernd_right_indexer.diminfo[0].strides) = (__pyx_v_right_pos + __pyx_v_k);
        }
      }

      /* "pandas/src/join.pyx":99
 *                     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_L12:;

    /* "pandas/src/join.pyx":100
 *                     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);

    /* "pandas/src/join.pyx":101
 *             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);
  }

  /* "pandas/src/join.pyx":103
 *         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_GetModuleGlobalName(__pyx_n_s_get_result_indexer); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 103; __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[3]; __pyx_lineno = 103; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__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 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_20, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 103; __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_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[3]; __pyx_lineno = 103; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_21 = ((PyArrayObject *)__pyx_t_3);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_left_indexer.rcbuffer->pybuffer);
    __pyx_t_7 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_left_indexer.rcbuffer->pybuffer, (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_pybuffernd_left_indexer.rcbuffer->pybuffer, (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_pybuffernd_left_indexer.diminfo[0].strides = __pyx_pybuffernd_left_indexer.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_left_indexer.diminfo[0].shape = __pyx_pybuffernd_left_indexer.rcbuffer->pybuffer.shape[0];
    if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 103; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_21 = 0;
  __Pyx_DECREF_SET(__pyx_v_left_indexer, ((PyArrayObject *)__pyx_t_3));
  __pyx_t_3 = 0;

  /* "pandas/src/join.pyx":104
 * 
 *     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_GetModuleGlobalName(__pyx_n_s_get_result_indexer); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 104; __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[3]; __pyx_lineno = 104; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__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 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_20, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 104; __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_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[3]; __pyx_lineno = 104; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_21 = ((PyArrayObject *)__pyx_t_4);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_right_indexer.rcbuffer->pybuffer);
    __pyx_t_7 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_right_indexer.rcbuffer->pybuffer, (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_pybuffernd_right_indexer.rcbuffer->pybuffer, (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_pybuffernd_right_indexer.diminfo[0].strides = __pyx_pybuffernd_right_indexer.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_right_indexer.diminfo[0].shape = __pyx_pybuffernd_right_indexer.rcbuffer->pybuffer.shape[0];
    if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 104; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_21 = 0;
  __Pyx_DECREF_SET(__pyx_v_right_indexer, ((PyArrayObject *)__pyx_t_4));
  __pyx_t_4 = 0;

  /* "pandas/src/join.pyx":106
 *     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[3]; __pyx_lineno = 106; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_32 = ((!__pyx_t_14) != 0);
  if (__pyx_t_32) {

    /* "pandas/src/join.pyx":107
 * 
 *     if not sort:
 *         if left_sorter.dtype != np.int_:             # <<<<<<<<<<<<<<
 *             left_sorter = left_sorter.astype(np.int_)
 * 
 */
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_left_sorter), __pyx_n_s_dtype); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_20 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_20)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_20);
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_20, __pyx_n_s_int); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 107; __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); __Pyx_XGOTREF(__pyx_t_20); if (unlikely(!__pyx_t_20)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 107; __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;
    __pyx_t_32 = __Pyx_PyObject_IsTrue(__pyx_t_20); if (unlikely(__pyx_t_32 < 0)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
    if (__pyx_t_32) {

      /* "pandas/src/join.pyx":108
 *     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 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_left_sorter), __pyx_n_s_astype); if (unlikely(!__pyx_t_20)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 108; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_20);
      __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 108; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_int); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 108; __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[3]; __pyx_lineno = 108; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__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 = __Pyx_PyObject_Call(__pyx_t_20, __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 108; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
      __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[3]; __pyx_lineno = 108; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF_SET(__pyx_v_left_sorter, ((PyArrayObject *)__pyx_t_4));
      __pyx_t_4 = 0;
      goto __pyx_L20;
    }
    __pyx_L20:;

    /* "pandas/src/join.pyx":110
 *             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_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_empty); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 110; __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[3]; __pyx_lineno = 110; __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[3]; __pyx_lineno = 110; __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[3]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__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[3]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_int); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 110; __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, __pyx_n_s_dtype, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_20, __pyx_t_4); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
    __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[3]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_v_rev = ((PyArrayObject *)__pyx_t_2);
    __pyx_t_2 = 0;

    /* "pandas/src/join.pyx":111
 * 
 *         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 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_rev), __pyx_n_s_put); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_20 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_arange); if (unlikely(!__pyx_t_20)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 111; __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[3]; __pyx_lineno = 111; __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[3]; __pyx_lineno = 111; __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 = 111; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__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 = __Pyx_PyObject_Call(__pyx_t_20, __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__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 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 111; __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_DECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "pandas/src/join.pyx":113
 *         rev.put(left_sorter, np.arange(len(left)))
 * 
 *         right_indexer = right_indexer.take(rev)             # <<<<<<<<<<<<<<
 *         left_indexer = left_indexer.take(rev)
 * 
 */
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_right_indexer), __pyx_n_s_take); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[3]; __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[3]; __pyx_lineno = 113; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__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 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 113; __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_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[3]; __pyx_lineno = 113; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_21 = ((PyArrayObject *)__pyx_t_2);
    {
      __Pyx_BufFmt_StackElem __pyx_stack[1];
      __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_right_indexer.rcbuffer->pybuffer);
      __pyx_t_7 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_right_indexer.rcbuffer->pybuffer, (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_pybuffernd_right_indexer.rcbuffer->pybuffer, (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_pybuffernd_right_indexer.diminfo[0].strides = __pyx_pybuffernd_right_indexer.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_right_indexer.diminfo[0].shape = __pyx_pybuffernd_right_indexer.rcbuffer->pybuffer.shape[0];
      if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 113; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_21 = 0;
    __Pyx_DECREF_SET(__pyx_v_right_indexer, ((PyArrayObject *)__pyx_t_2));
    __pyx_t_2 = 0;

    /* "pandas/src/join.pyx":114
 * 
 *         right_indexer = right_indexer.take(rev)
 *         left_indexer = left_indexer.take(rev)             # <<<<<<<<<<<<<<
 * 
 *     return left_indexer, right_indexer
 */
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_left_indexer), __pyx_n_s_take); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 114; __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[3]; __pyx_lineno = 114; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__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 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 114; __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;
    if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 114; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_21 = ((PyArrayObject *)__pyx_t_4);
    {
      __Pyx_BufFmt_StackElem __pyx_stack[1];
      __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_left_indexer.rcbuffer->pybuffer);
      __pyx_t_7 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_left_indexer.rcbuffer->pybuffer, (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_pybuffernd_left_indexer.rcbuffer->pybuffer, (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_pybuffernd_left_indexer.diminfo[0].strides = __pyx_pybuffernd_left_indexer.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_left_indexer.diminfo[0].shape = __pyx_pybuffernd_left_indexer.rcbuffer->pybuffer.shape[0];
      if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 114; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_21 = 0;
    __Pyx_DECREF_SET(__pyx_v_left_indexer, ((PyArrayObject *)__pyx_t_4));
    __pyx_t_4 = 0;
    goto __pyx_L19;
  }
  __pyx_L19:;

  /* "pandas/src/join.pyx":116
 *         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[3]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__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 = __pyx_t_4;
  __pyx_t_4 = 0;
  goto __pyx_L0;

  /* "pandas/src/join.pyx":51
 *             _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:
 */

  /* function exit code */
  __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_pybuffernd_left.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_left_count.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_left_indexer.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_right.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_right_count.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_right_indexer.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas.algos.left_outer_join", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_left.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_left_count.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_left_indexer.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_right.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_right_count.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_right_indexer.rcbuffer->pybuffer);
  __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;
}

/* "pandas/src/join.pyx":120
 * 
 * 
 * def full_outer_join(ndarray[int64_t] left, ndarray[int64_t] right,             # <<<<<<<<<<<<<<
 *                           Py_ssize_t max_groups):
 *     cdef:
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pandas_5algos_79full_outer_join(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_5algos_79full_outer_join = {__Pyx_NAMESTR("full_outer_join"), (PyCFunction)__pyx_pw_6pandas_5algos_79full_outer_join, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pw_6pandas_5algos_79full_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;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("full_outer_join (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_left,&__pyx_n_s_right,&__pyx_n_s_max_groups,0};
    PyObject* values[3] = {0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_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 (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_left)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_right)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("full_outer_join", 1, 3, 3, 1); {__pyx_filename = __pyx_f[3]; __pyx_lineno = 120; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_max_groups)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("full_outer_join", 1, 3, 3, 2); {__pyx_filename = __pyx_f[3]; __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, pos_args, "full_outer_join") < 0)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 120; __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[3]; __pyx_lineno = 121; __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[3]; __pyx_lineno = 120; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas.algos.full_outer_join", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_left), __pyx_ptype_5numpy_ndarray, 1, "left", 0))) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 120; __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 = 120; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_78full_outer_join(__pyx_self, __pyx_v_left, __pyx_v_right, __pyx_v_max_groups);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pandas_5algos_78full_outer_join(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_left, PyArrayObject *__pyx_v_right, 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;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_left;
  __Pyx_Buffer __pyx_pybuffer_left;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_left_count;
  __Pyx_Buffer __pyx_pybuffer_left_count;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_left_indexer;
  __Pyx_Buffer __pyx_pybuffer_left_indexer;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_left_sorter;
  __Pyx_Buffer __pyx_pybuffer_left_sorter;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_right;
  __Pyx_Buffer __pyx_pybuffer_right;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_right_count;
  __Pyx_Buffer __pyx_pybuffer_right_count;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_right_indexer;
  __Pyx_Buffer __pyx_pybuffer_right_indexer;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_right_sorter;
  __Pyx_Buffer __pyx_pybuffer_right_sorter;
  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;
  __Pyx_RefNannySetupContext("full_outer_join", 0);
  __pyx_pybuffer_left_count.pybuffer.buf = NULL;
  __pyx_pybuffer_left_count.refcount = 0;
  __pyx_pybuffernd_left_count.data = NULL;
  __pyx_pybuffernd_left_count.rcbuffer = &__pyx_pybuffer_left_count;
  __pyx_pybuffer_right_count.pybuffer.buf = NULL;
  __pyx_pybuffer_right_count.refcount = 0;
  __pyx_pybuffernd_right_count.data = NULL;
  __pyx_pybuffernd_right_count.rcbuffer = &__pyx_pybuffer_right_count;
  __pyx_pybuffer_left_sorter.pybuffer.buf = NULL;
  __pyx_pybuffer_left_sorter.refcount = 0;
  __pyx_pybuffernd_left_sorter.data = NULL;
  __pyx_pybuffernd_left_sorter.rcbuffer = &__pyx_pybuffer_left_sorter;
  __pyx_pybuffer_right_sorter.pybuffer.buf = NULL;
  __pyx_pybuffer_right_sorter.refcount = 0;
  __pyx_pybuffernd_right_sorter.data = NULL;
  __pyx_pybuffernd_right_sorter.rcbuffer = &__pyx_pybuffer_right_sorter;
  __pyx_pybuffer_left_indexer.pybuffer.buf = NULL;
  __pyx_pybuffer_left_indexer.refcount = 0;
  __pyx_pybuffernd_left_indexer.data = NULL;
  __pyx_pybuffernd_left_indexer.rcbuffer = &__pyx_pybuffer_left_indexer;
  __pyx_pybuffer_right_indexer.pybuffer.buf = NULL;
  __pyx_pybuffer_right_indexer.refcount = 0;
  __pyx_pybuffernd_right_indexer.data = NULL;
  __pyx_pybuffernd_right_indexer.rcbuffer = &__pyx_pybuffer_right_indexer;
  __pyx_pybuffer_left.pybuffer.buf = NULL;
  __pyx_pybuffer_left.refcount = 0;
  __pyx_pybuffernd_left.data = NULL;
  __pyx_pybuffernd_left.rcbuffer = &__pyx_pybuffer_left;
  __pyx_pybuffer_right.pybuffer.buf = NULL;
  __pyx_pybuffer_right.refcount = 0;
  __pyx_pybuffernd_right.data = NULL;
  __pyx_pybuffernd_right.rcbuffer = &__pyx_pybuffer_right;
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_left.rcbuffer->pybuffer, (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[3]; __pyx_lineno = 120; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_left.diminfo[0].strides = __pyx_pybuffernd_left.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_left.diminfo[0].shape = __pyx_pybuffernd_left.rcbuffer->pybuffer.shape[0];
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_right.rcbuffer->pybuffer, (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[3]; __pyx_lineno = 120; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_right.diminfo[0].strides = __pyx_pybuffernd_right.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_right.diminfo[0].shape = __pyx_pybuffernd_right.rcbuffer->pybuffer.shape[0];

  /* "pandas/src/join.pyx":123
 *                           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;

  /* "pandas/src/join.pyx":130
 *     # 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_GetModuleGlobalName(__pyx_n_s_groupsort_indexer); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 130; __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[3]; __pyx_lineno = 130; __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[3]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__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 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 130; __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;
  if ((likely(PyTuple_CheckExact(__pyx_t_2))) || (PyList_CheckExact(__pyx_t_2))) {
    PyObject* sequence = __pyx_t_2;
    #if CYTHON_COMPILING_IN_CPYTHON
    Py_ssize_t size = Py_SIZE(sequence);
    #else
    Py_ssize_t size = PySequence_Size(sequence);
    #endif
    if (unlikely(size != 2)) {
      if (size > 2) __Pyx_RaiseTooManyValuesError(2);
      else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
      {__pyx_filename = __pyx_f[3]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    #if CYTHON_COMPILING_IN_CPYTHON
    if (likely(PyTuple_CheckExact(sequence))) {
      __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0); 
      __pyx_t_1 = PyTuple_GET_ITEM(sequence, 1); 
    } else {
      __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);
    #else
    __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_1 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    #endif
    __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[3]; __pyx_lineno = 130; __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_L3_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_L3_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_1);
    if (__Pyx_IternextUnpackEndCheck(__pyx_t_5(__pyx_t_4), 2) < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_5 = NULL;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    goto __pyx_L4_unpacking_done;
    __pyx_L3_unpacking_failed:;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_5 = NULL;
    if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
    {__pyx_filename = __pyx_f[3]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_L4_unpacking_done:;
  }
  if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 130; __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[3]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_6 = ((PyArrayObject *)__pyx_t_3);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_left_sorter.rcbuffer->pybuffer);
    __pyx_t_7 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_left_sorter.rcbuffer->pybuffer, (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_pybuffernd_left_sorter.rcbuffer->pybuffer, (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_pybuffernd_left_sorter.diminfo[0].strides = __pyx_pybuffernd_left_sorter.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_left_sorter.diminfo[0].shape = __pyx_pybuffernd_left_sorter.rcbuffer->pybuffer.shape[0];
    if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 130; __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_pybuffernd_left_count.rcbuffer->pybuffer);
    __pyx_t_7 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_left_count.rcbuffer->pybuffer, (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_pybuffernd_left_count.rcbuffer->pybuffer, (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_pybuffernd_left_count.diminfo[0].strides = __pyx_pybuffernd_left_count.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_left_count.diminfo[0].shape = __pyx_pybuffernd_left_count.rcbuffer->pybuffer.shape[0];
    if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_6 = 0;
  __pyx_v_left_count = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pandas/src/join.pyx":131
 * 
 *     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_GetModuleGlobalName(__pyx_n_s_groupsort_indexer); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 131; __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[3]; __pyx_lineno = 131; __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[3]; __pyx_lineno = 131; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__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 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 131; __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;
  if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) {
    PyObject* sequence = __pyx_t_1;
    #if CYTHON_COMPILING_IN_CPYTHON
    Py_ssize_t size = Py_SIZE(sequence);
    #else
    Py_ssize_t size = PySequence_Size(sequence);
    #endif
    if (unlikely(size != 2)) {
      if (size > 2) __Pyx_RaiseTooManyValuesError(2);
      else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
      {__pyx_filename = __pyx_f[3]; __pyx_lineno = 131; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    #if CYTHON_COMPILING_IN_CPYTHON
    if (likely(PyTuple_CheckExact(sequence))) {
      __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0); 
      __pyx_t_2 = PyTuple_GET_ITEM(sequence, 1); 
    } else {
      __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);
    #else
    __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 131; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_2 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 131; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    #endif
    __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 = 131; __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_L5_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_L5_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_2);
    if (__Pyx_IternextUnpackEndCheck(__pyx_t_5(__pyx_t_4), 2) < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 131; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_5 = NULL;
    __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;
    __pyx_t_5 = NULL;
    if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
    {__pyx_filename = __pyx_f[3]; __pyx_lineno = 131; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_L6_unpacking_done:;
  }
  if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 131; __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[3]; __pyx_lineno = 131; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_6 = ((PyArrayObject *)__pyx_t_3);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_right_sorter.rcbuffer->pybuffer);
    __pyx_t_7 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_right_sorter.rcbuffer->pybuffer, (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_pybuffernd_right_sorter.rcbuffer->pybuffer, (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_pybuffernd_right_sorter.diminfo[0].strides = __pyx_pybuffernd_right_sorter.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_right_sorter.diminfo[0].shape = __pyx_pybuffernd_right_sorter.rcbuffer->pybuffer.shape[0];
    if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 131; __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_pybuffernd_right_count.rcbuffer->pybuffer);
    __pyx_t_7 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_right_count.rcbuffer->pybuffer, (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_pybuffernd_right_count.rcbuffer->pybuffer, (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_pybuffernd_right_count.diminfo[0].strides = __pyx_pybuffernd_right_count.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_right_count.diminfo[0].shape = __pyx_pybuffernd_right_count.rcbuffer->pybuffer.shape[0];
    if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 131; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_6 = 0;
  __pyx_v_right_count = ((PyArrayObject *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "pandas/src/join.pyx":134
 * 
 *     # 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;

    /* "pandas/src/join.pyx":135
 *     # 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_pybuffernd_left_count.diminfo[0].shape;
      if (unlikely(__pyx_t_13 < 0)) __pyx_t_7 = 0;
    } else if (unlikely(__pyx_t_13 >= __pyx_pybuffernd_left_count.diminfo[0].shape)) __pyx_t_7 = 0;
    if (unlikely(__pyx_t_7 != -1)) {
      __Pyx_RaiseBufferIndexError(__pyx_t_7);
      {__pyx_filename = __pyx_f[3]; __pyx_lineno = 135; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_v_lc = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_left_count.rcbuffer->pybuffer.buf, __pyx_t_13, __pyx_pybuffernd_left_count.diminfo[0].strides));

    /* "pandas/src/join.pyx":136
 *     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_pybuffernd_right_count.diminfo[0].shape;
      if (unlikely(__pyx_t_14 < 0)) __pyx_t_7 = 0;
    } else if (unlikely(__pyx_t_14 >= __pyx_pybuffernd_right_count.diminfo[0].shape)) __pyx_t_7 = 0;
    if (unlikely(__pyx_t_7 != -1)) {
      __Pyx_RaiseBufferIndexError(__pyx_t_7);
      {__pyx_filename = __pyx_f[3]; __pyx_lineno = 136; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_v_rc = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_right_count.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_right_count.diminfo[0].strides));

    /* "pandas/src/join.pyx":138
 *         rc = right_count[i]
 * 
 *         if rc > 0 and lc > 0:             # <<<<<<<<<<<<<<
 *             count += lc * rc
 *         else:
 */
    __pyx_t_15 = ((__pyx_v_rc > 0) != 0);
    if (__pyx_t_15) {
      __pyx_t_16 = ((__pyx_v_lc > 0) != 0);
      __pyx_t_17 = __pyx_t_16;
    } else {
      __pyx_t_17 = __pyx_t_15;
    }
    if (__pyx_t_17) {

      /* "pandas/src/join.pyx":139
 * 
 *         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_L9;
    }
    /*else*/ {

      /* "pandas/src/join.pyx":141
 *             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_L9:;
  }

  /* "pandas/src/join.pyx":145
 *     # 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;

  /* "pandas/src/join.pyx":146
 *     cdef:
 *         int64_t left_pos = 0, right_pos = 0
 *         Py_ssize_t offset, position = 0             # <<<<<<<<<<<<<<
 * 
 *     # exclude the NA group
 */
  __pyx_v_position = 0;

  /* "pandas/src/join.pyx":149
 * 
 *     # 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_pybuffernd_left_count.diminfo[0].shape;
    if (unlikely(__pyx_t_18 < 0)) __pyx_t_7 = 0;
  } else if (unlikely(__pyx_t_18 >= __pyx_pybuffernd_left_count.diminfo[0].shape)) __pyx_t_7 = 0;
  if (unlikely(__pyx_t_7 != -1)) {
    __Pyx_RaiseBufferIndexError(__pyx_t_7);
    {__pyx_filename = __pyx_f[3]; __pyx_lineno = 149; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_v_left_pos = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_left_count.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_left_count.diminfo[0].strides));

  /* "pandas/src/join.pyx":150
 *     # 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_pybuffernd_right_count.diminfo[0].shape;
    if (unlikely(__pyx_t_19 < 0)) __pyx_t_7 = 0;
  } else if (unlikely(__pyx_t_19 >= __pyx_pybuffernd_right_count.diminfo[0].shape)) __pyx_t_7 = 0;
  if (unlikely(__pyx_t_7 != -1)) {
    __Pyx_RaiseBufferIndexError(__pyx_t_7);
    {__pyx_filename = __pyx_f[3]; __pyx_lineno = 150; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_v_right_pos = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_right_count.rcbuffer->pybuffer.buf, __pyx_t_19, __pyx_pybuffernd_right_count.diminfo[0].strides));

  /* "pandas/src/join.pyx":152
 *     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_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 152; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_empty); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 152; __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[3]; __pyx_lineno = 152; __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 = 152; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__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[3]; __pyx_lineno = 152; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 152; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_20 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_int64); if (unlikely(!__pyx_t_20)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 152; __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, __pyx_n_s_dtype, __pyx_t_20) < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 152; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
  __pyx_t_20 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_20)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 152; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_20);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__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[3]; __pyx_lineno = 152; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_21 = ((PyArrayObject *)__pyx_t_20);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_left_indexer.rcbuffer->pybuffer);
    __pyx_t_7 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_left_indexer.rcbuffer->pybuffer, (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_pybuffernd_left_indexer.rcbuffer->pybuffer, (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_pybuffernd_left_indexer.diminfo[0].strides = __pyx_pybuffernd_left_indexer.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_left_indexer.diminfo[0].shape = __pyx_pybuffernd_left_indexer.rcbuffer->pybuffer.shape[0];
    if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 152; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_21 = 0;
  __pyx_v_left_indexer = ((PyArrayObject *)__pyx_t_20);
  __pyx_t_20 = 0;

  /* "pandas/src/join.pyx":153
 * 
 *     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_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_20)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 153; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_20);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_20, __pyx_n_s_empty); 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);
  __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[3]; __pyx_lineno = 153; __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[3]; __pyx_lineno = 153; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__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[3]; __pyx_lineno = 153; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_20);
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 153; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_int64); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 153; __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, __pyx_n_s_dtype, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 153; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, __pyx_t_20); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 153; __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_DECREF(__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[3]; __pyx_lineno = 153; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_21 = ((PyArrayObject *)__pyx_t_4);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_right_indexer.rcbuffer->pybuffer);
    __pyx_t_7 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_right_indexer.rcbuffer->pybuffer, (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_pybuffernd_right_indexer.rcbuffer->pybuffer, (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_pybuffernd_right_indexer.diminfo[0].strides = __pyx_pybuffernd_right_indexer.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_right_indexer.diminfo[0].shape = __pyx_pybuffernd_right_indexer.rcbuffer->pybuffer.shape[0];
    if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 153; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_21 = 0;
  __pyx_v_right_indexer = ((PyArrayObject *)__pyx_t_4);
  __pyx_t_4 = 0;

  /* "pandas/src/join.pyx":155
 *     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;

    /* "pandas/src/join.pyx":156
 * 
 *     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_pybuffernd_left_count.diminfo[0].shape;
      if (unlikely(__pyx_t_22 < 0)) __pyx_t_7 = 0;
    } else if (unlikely(__pyx_t_22 >= __pyx_pybuffernd_left_count.diminfo[0].shape)) __pyx_t_7 = 0;
    if (unlikely(__pyx_t_7 != -1)) {
      __Pyx_RaiseBufferIndexError(__pyx_t_7);
      {__pyx_filename = __pyx_f[3]; __pyx_lineno = 156; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_v_lc = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_left_count.rcbuffer->pybuffer.buf, __pyx_t_22, __pyx_pybuffernd_left_count.diminfo[0].strides));

    /* "pandas/src/join.pyx":157
 *     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_pybuffernd_right_count.diminfo[0].shape;
      if (unlikely(__pyx_t_23 < 0)) __pyx_t_7 = 0;
    } else if (unlikely(__pyx_t_23 >= __pyx_pybuffernd_right_count.diminfo[0].shape)) __pyx_t_7 = 0;
    if (unlikely(__pyx_t_7 != -1)) {
      __Pyx_RaiseBufferIndexError(__pyx_t_7);
      {__pyx_filename = __pyx_f[3]; __pyx_lineno = 157; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_v_rc = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_right_count.rcbuffer->pybuffer.buf, __pyx_t_23, __pyx_pybuffernd_right_count.diminfo[0].strides));

    /* "pandas/src/join.pyx":159
 *         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) != 0);
    if (__pyx_t_17) {

      /* "pandas/src/join.pyx":160
 * 
 *         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;

        /* "pandas/src/join.pyx":161
 *         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_pybuffernd_left_indexer.diminfo[0].shape;
          if (unlikely(__pyx_t_26 < 0)) __pyx_t_7 = 0;
        } else if (unlikely(__pyx_t_26 >= __pyx_pybuffernd_left_indexer.diminfo[0].shape)) __pyx_t_7 = 0;
        if (unlikely(__pyx_t_7 != -1)) {
          __Pyx_RaiseBufferIndexError(__pyx_t_7);
          {__pyx_filename = __pyx_f[3]; __pyx_lineno = 161; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_left_indexer.rcbuffer->pybuffer.buf, __pyx_t_26, __pyx_pybuffernd_left_indexer.diminfo[0].strides) = (__pyx_v_left_pos + __pyx_v_j);

        /* "pandas/src/join.pyx":162
 *             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_pybuffernd_right_indexer.diminfo[0].shape;
          if (unlikely(__pyx_t_27 < 0)) __pyx_t_7 = 0;
        } else if (unlikely(__pyx_t_27 >= __pyx_pybuffernd_right_indexer.diminfo[0].shape)) __pyx_t_7 = 0;
        if (unlikely(__pyx_t_7 != -1)) {
          __Pyx_RaiseBufferIndexError(__pyx_t_7);
          {__pyx_filename = __pyx_f[3]; __pyx_lineno = 162; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_right_indexer.rcbuffer->pybuffer.buf, __pyx_t_27, __pyx_pybuffernd_right_indexer.diminfo[0].strides) = -1;
      }

      /* "pandas/src/join.pyx":163
 *                 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_L12;
    }

    /* "pandas/src/join.pyx":164
 *                 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) != 0);
    if (__pyx_t_17) {

      /* "pandas/src/join.pyx":165
 *             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;

        /* "pandas/src/join.pyx":166
 *         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_pybuffernd_left_indexer.diminfo[0].shape;
          if (unlikely(__pyx_t_28 < 0)) __pyx_t_7 = 0;
        } else if (unlikely(__pyx_t_28 >= __pyx_pybuffernd_left_indexer.diminfo[0].shape)) __pyx_t_7 = 0;
        if (unlikely(__pyx_t_7 != -1)) {
          __Pyx_RaiseBufferIndexError(__pyx_t_7);
          {__pyx_filename = __pyx_f[3]; __pyx_lineno = 166; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_left_indexer.rcbuffer->pybuffer.buf, __pyx_t_28, __pyx_pybuffernd_left_indexer.diminfo[0].strides) = -1;

        /* "pandas/src/join.pyx":167
 *             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_pybuffernd_right_indexer.diminfo[0].shape;
          if (unlikely(__pyx_t_29 < 0)) __pyx_t_7 = 0;
        } else if (unlikely(__pyx_t_29 >= __pyx_pybuffernd_right_indexer.diminfo[0].shape)) __pyx_t_7 = 0;
        if (unlikely(__pyx_t_7 != -1)) {
          __Pyx_RaiseBufferIndexError(__pyx_t_7);
          {__pyx_filename = __pyx_f[3]; __pyx_lineno = 167; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_right_indexer.rcbuffer->pybuffer.buf, __pyx_t_29, __pyx_pybuffernd_right_indexer.diminfo[0].strides) = (__pyx_v_right_pos + __pyx_v_j);
      }

      /* "pandas/src/join.pyx":168
 *                 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_L12;
    }
    /*else*/ {

      /* "pandas/src/join.pyx":170
 *             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;

        /* "pandas/src/join.pyx":171
 *         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));

        /* "pandas/src/join.pyx":172
 *             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;

          /* "pandas/src/join.pyx":173
 *                 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_pybuffernd_left_indexer.diminfo[0].shape;
            if (unlikely(__pyx_t_32 < 0)) __pyx_t_7 = 0;
          } else if (unlikely(__pyx_t_32 >= __pyx_pybuffernd_left_indexer.diminfo[0].shape)) __pyx_t_7 = 0;
          if (unlikely(__pyx_t_7 != -1)) {
            __Pyx_RaiseBufferIndexError(__pyx_t_7);
            {__pyx_filename = __pyx_f[3]; __pyx_lineno = 173; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          }
          *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_left_indexer.rcbuffer->pybuffer.buf, __pyx_t_32, __pyx_pybuffernd_left_indexer.diminfo[0].strides) = (__pyx_v_left_pos + __pyx_v_j);

          /* "pandas/src/join.pyx":174
 *                 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_pybuffernd_right_indexer.diminfo[0].shape;
            if (unlikely(__pyx_t_33 < 0)) __pyx_t_7 = 0;
          } else if (unlikely(__pyx_t_33 >= __pyx_pybuffernd_right_indexer.diminfo[0].shape)) __pyx_t_7 = 0;
          if (unlikely(__pyx_t_7 != -1)) {
            __Pyx_RaiseBufferIndexError(__pyx_t_7);
            {__pyx_filename = __pyx_f[3]; __pyx_lineno = 174; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          }
          *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_right_indexer.rcbuffer->pybuffer.buf, __pyx_t_33, __pyx_pybuffernd_right_indexer.diminfo[0].strides) = (__pyx_v_right_pos + __pyx_v_k);
        }
      }

      /* "pandas/src/join.pyx":175
 *                     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_L12:;

    /* "pandas/src/join.pyx":176
 *                     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);

    /* "pandas/src/join.pyx":177
 *             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);
  }

  /* "pandas/src/join.pyx":179
 *         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_GetModuleGlobalName(__pyx_n_s_get_result_indexer); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 179; __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[3]; __pyx_lineno = 179; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__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 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_20, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 179; __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_20); __pyx_t_20 = 0;

  /* "pandas/src/join.pyx":180
 * 
 *     return (_get_result_indexer(left_sorter, left_indexer),
 *             _get_result_indexer(right_sorter, right_indexer))             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_20 = __Pyx_GetModuleGlobalName(__pyx_n_s_get_result_indexer); if (unlikely(!__pyx_t_20)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 180; __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[3]; __pyx_lineno = 180; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__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 = __Pyx_PyObject_Call(__pyx_t_20, __pyx_t_4, NULL); 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_DECREF(__pyx_t_20); __pyx_t_20 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "pandas/src/join.pyx":179
 *         right_pos += rc
 * 
 *     return (_get_result_indexer(left_sorter, left_indexer),             # <<<<<<<<<<<<<<
 *             _get_result_indexer(right_sorter, right_indexer))
 * 
 */
  __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 179; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__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 = __pyx_t_4;
  __pyx_t_4 = 0;
  goto __pyx_L0;

  /* "pandas/src/join.pyx":120
 * 
 * 
 * def full_outer_join(ndarray[int64_t] left, ndarray[int64_t] right,             # <<<<<<<<<<<<<<
 *                           Py_ssize_t max_groups):
 *     cdef:
 */

  /* function exit code */
  __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_pybuffernd_left.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_left_count.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_left_indexer.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_left_sorter.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_right.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_right_count.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_right_indexer.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_right_sorter.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas.algos.full_outer_join", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_left.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_left_count.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_left_indexer.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_left_sorter.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_right.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_right_count.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_right_indexer.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_right_sorter.rcbuffer->pybuffer);
  __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;
}

/* "pandas/src/join.pyx":184
 * 
 * 
 * def _get_result_indexer(sorter, indexer):             # <<<<<<<<<<<<<<
 *     if indexer.dtype != np.int_:
 *         indexer = indexer.astype(np.int_)
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pandas_5algos_81_get_result_indexer(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_5algos_81_get_result_indexer = {__Pyx_NAMESTR("_get_result_indexer"), (PyCFunction)__pyx_pw_6pandas_5algos_81_get_result_indexer, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pw_6pandas_5algos_81_get_result_indexer(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_sorter = 0;
  PyObject *__pyx_v_indexer = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_get_result_indexer (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_sorter,&__pyx_n_s_indexer,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_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 (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_sorter)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_indexer)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("_get_result_indexer", 1, 2, 2, 1); {__pyx_filename = __pyx_f[3]; __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, pos_args, "_get_result_indexer") < 0)) {__pyx_filename = __pyx_f[3]; __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_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[3]; __pyx_lineno = 184; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas.algos._get_result_indexer", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6pandas_5algos_80_get_result_indexer(__pyx_self, __pyx_v_sorter, __pyx_v_indexer);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pandas_5algos_80_get_result_indexer(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_sorter, PyObject *__pyx_v_indexer) {
  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;
  __Pyx_RefNannySetupContext("_get_result_indexer", 0);
  __Pyx_INCREF(__pyx_v_indexer);

  /* "pandas/src/join.pyx":185
 * 
 * def _get_result_indexer(sorter, indexer):
 *     if indexer.dtype != np.int_:             # <<<<<<<<<<<<<<
 *         indexer = indexer.astype(np.int_)
 *     if len(sorter) > 0:
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_indexer, __pyx_n_s_dtype); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 185; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 185; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_int); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[3]; __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 = PyObject_RichCompare(__pyx_t_1, __pyx_t_3, Py_NE); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 185; __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_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 185; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__pyx_t_4) {

    /* "pandas/src/join.pyx":186
 * 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 = __Pyx_PyObject_GetAttrStr(__pyx_v_indexer, __pyx_n_s_astype); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 186; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 186; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_int); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 186; __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[3]; __pyx_lineno = 186; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__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 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 186; __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_DECREF_SET(__pyx_v_indexer, __pyx_t_1);
    __pyx_t_1 = 0;
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "pandas/src/join.pyx":187
 *     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[3]; __pyx_lineno = 187; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_4 = ((__pyx_t_5 > 0) != 0);
  if (__pyx_t_4) {

    /* "pandas/src/join.pyx":188
 *         indexer = indexer.astype(np.int_)
 *     if len(sorter) > 0:
 *         res = sorter.take(indexer)             # <<<<<<<<<<<<<<
 *         np.putmask(res, indexer == -1, -1)
 *     else:
 */
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_sorter, __pyx_n_s_take); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __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[3]; __pyx_lineno = 188; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__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 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[3]; __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_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_v_res = __pyx_t_2;
    __pyx_t_2 = 0;

    /* "pandas/src/join.pyx":189
 *     if len(sorter) > 0:
 *         res = sorter.take(indexer)
 *         np.putmask(res, indexer == -1, -1)             # <<<<<<<<<<<<<<
 *     else:
 *         # length-0 case
 */
    __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 189; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_putmask); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[3]; __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 = PyObject_RichCompare(__pyx_v_indexer, __pyx_int_neg_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 189; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 189; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__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 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 189; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    goto __pyx_L4;
  }
  /*else*/ {

    /* "pandas/src/join.pyx":192
 *     else:
 *         # length-0 case
 *         res = np.empty(len(indexer), dtype=np.int64)             # <<<<<<<<<<<<<<
 *         res.fill(-1)
 * 
 */
    __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 192; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_empty); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 192; __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[3]; __pyx_lineno = 192; __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[3]; __pyx_lineno = 192; __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[3]; __pyx_lineno = 192; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__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[3]; __pyx_lineno = 192; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 192; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_int64); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 192; __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, __pyx_n_s_dtype, __pyx_t_7) < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 192; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 192; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_v_res = __pyx_t_7;
    __pyx_t_7 = 0;

    /* "pandas/src/join.pyx":193
 *         # length-0 case
 *         res = np.empty(len(indexer), dtype=np.int64)
 *         res.fill(-1)             # <<<<<<<<<<<<<<
 * 
 *     return res
 */
    __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_res, __pyx_n_s_fill); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 193; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_tuple__48, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 193; __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_L4:;

  /* "pandas/src/join.pyx":195
 *         res.fill(-1)
 * 
 *     return res             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_res);
  __pyx_r = __pyx_v_res;
  goto __pyx_L0;

  /* "pandas/src/join.pyx":184
 * 
 * 
 * def _get_result_indexer(sorter, indexer):             # <<<<<<<<<<<<<<
 *     if indexer.dtype != np.int_:
 *         indexer = indexer.astype(np.int_)
 */

  /* function exit code */
  __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.algos._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;
}

/* "pandas/src/join.pyx":199
 * 
 * 
 * def ffill_indexer(ndarray[int64_t] indexer):             # <<<<<<<<<<<<<<
 *     cdef:
 *         Py_ssize_t i, n = len(indexer)
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pandas_5algos_83ffill_indexer(PyObject *__pyx_self, PyObject *__pyx_v_indexer); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_5algos_83ffill_indexer = {__Pyx_NAMESTR("ffill_indexer"), (PyCFunction)__pyx_pw_6pandas_5algos_83ffill_indexer, METH_O, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pw_6pandas_5algos_83ffill_indexer(PyObject *__pyx_self, PyObject *__pyx_v_indexer) {
  CYTHON_UNUSED int __pyx_lineno = 0;
  CYTHON_UNUSED const char *__pyx_filename = NULL;
  CYTHON_UNUSED int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("ffill_indexer (wrapper)", 0);
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_indexer), __pyx_ptype_5numpy_ndarray, 1, "indexer", 0))) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 199; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_82ffill_indexer(__pyx_self, ((PyArrayObject *)__pyx_v_indexer));

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pandas_5algos_82ffill_indexer(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__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;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_indexer;
  __Pyx_Buffer __pyx_pybuffer_indexer;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_result;
  __Pyx_Buffer __pyx_pybuffer_result;
  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", 0);
  __pyx_pybuffer_result.pybuffer.buf = NULL;
  __pyx_pybuffer_result.refcount = 0;
  __pyx_pybuffernd_result.data = NULL;
  __pyx_pybuffernd_result.rcbuffer = &__pyx_pybuffer_result;
  __pyx_pybuffer_indexer.pybuffer.buf = NULL;
  __pyx_pybuffer_indexer.refcount = 0;
  __pyx_pybuffernd_indexer.data = NULL;
  __pyx_pybuffernd_indexer.rcbuffer = &__pyx_pybuffer_indexer;
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer, (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 = 199; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_indexer.diminfo[0].strides = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_indexer.diminfo[0].shape = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.shape[0];

  /* "pandas/src/join.pyx":201
 * 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(((PyObject *)__pyx_v_indexer)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 201; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_n = __pyx_t_1;

  /* "pandas/src/join.pyx":205
 *         int64_t val, last_obs
 * 
 *     result = np.empty(n, dtype=np.int64)             # <<<<<<<<<<<<<<
 *     last_obs = -1
 * 
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 205; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_empty); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 205; __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 = 205; __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 = 205; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__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 = 205; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 205; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_int64); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 205; __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, __pyx_n_s_dtype, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 205; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 205; __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_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__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 = 205; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_7 = ((PyArrayObject *)__pyx_t_6);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer);
    __pyx_t_8 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_result.rcbuffer->pybuffer, (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_pybuffernd_result.rcbuffer->pybuffer, (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_pybuffernd_result.diminfo[0].strides = __pyx_pybuffernd_result.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_result.diminfo[0].shape = __pyx_pybuffernd_result.rcbuffer->pybuffer.shape[0];
    if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 205; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_7 = 0;
  __pyx_v_result = ((PyArrayObject *)__pyx_t_6);
  __pyx_t_6 = 0;

  /* "pandas/src/join.pyx":206
 * 
 *     result = np.empty(n, dtype=np.int64)
 *     last_obs = -1             # <<<<<<<<<<<<<<
 * 
 *     for i in range(n):
 */
  __pyx_v_last_obs = -1;

  /* "pandas/src/join.pyx":208
 *     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;

    /* "pandas/src/join.pyx":209
 * 
 *     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_pybuffernd_indexer.diminfo[0].shape;
      if (unlikely(__pyx_t_13 < 0)) __pyx_t_8 = 0;
    } else if (unlikely(__pyx_t_13 >= __pyx_pybuffernd_indexer.diminfo[0].shape)) __pyx_t_8 = 0;
    if (unlikely(__pyx_t_8 != -1)) {
      __Pyx_RaiseBufferIndexError(__pyx_t_8);
      {__pyx_filename = __pyx_f[3]; __pyx_lineno = 209; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_v_val = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_13, __pyx_pybuffernd_indexer.diminfo[0].strides));

    /* "pandas/src/join.pyx":210
 *     for i in range(n):
 *         val = indexer[i]
 *         if val == -1:             # <<<<<<<<<<<<<<
 *             result[i] = last_obs
 *         else:
 */
    __pyx_t_14 = ((__pyx_v_val == -1) != 0);
    if (__pyx_t_14) {

      /* "pandas/src/join.pyx":211
 *         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_pybuffernd_result.diminfo[0].shape;
        if (unlikely(__pyx_t_15 < 0)) __pyx_t_8 = 0;
      } else if (unlikely(__pyx_t_15 >= __pyx_pybuffernd_result.diminfo[0].shape)) __pyx_t_8 = 0;
      if (unlikely(__pyx_t_8 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_8);
        {__pyx_filename = __pyx_f[3]; __pyx_lineno = 211; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_result.diminfo[0].strides) = __pyx_v_last_obs;
      goto __pyx_L5;
    }
    /*else*/ {

      /* "pandas/src/join.pyx":213
 *             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_pybuffernd_result.diminfo[0].shape;
        if (unlikely(__pyx_t_16 < 0)) __pyx_t_8 = 0;
      } else if (unlikely(__pyx_t_16 >= __pyx_pybuffernd_result.diminfo[0].shape)) __pyx_t_8 = 0;
      if (unlikely(__pyx_t_8 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_8);
        {__pyx_filename = __pyx_f[3]; __pyx_lineno = 213; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_result.diminfo[0].strides) = __pyx_v_val;

      /* "pandas/src/join.pyx":214
 *         else:
 *             result[i] = val
 *             last_obs = val             # <<<<<<<<<<<<<<
 * 
 *     return result
 */
      __pyx_v_last_obs = __pyx_v_val;
    }
    __pyx_L5:;
  }

  /* "pandas/src/join.pyx":216
 *             last_obs = val
 * 
 *     return result             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_result));
  __pyx_r = ((PyObject *)__pyx_v_result);
  goto __pyx_L0;

  /* "pandas/src/join.pyx":199
 * 
 * 
 * def ffill_indexer(ndarray[int64_t] indexer):             # <<<<<<<<<<<<<<
 *     cdef:
 *         Py_ssize_t i, n = len(indexer)
 */

  /* function exit code */
  __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_pybuffernd_indexer.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas.algos.ffill_indexer", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer);
  __pyx_L2:;
  __Pyx_XDECREF((PyObject *)__pyx_v_result);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/src/join.pyx":219
 * 
 * 
 * def ffill_by_group(ndarray[int64_t] indexer, ndarray[int64_t] group_ids,             # <<<<<<<<<<<<<<
 *                    int64_t max_group):
 *     cdef:
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pandas_5algos_85ffill_by_group(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_5algos_85ffill_by_group = {__Pyx_NAMESTR("ffill_by_group"), (PyCFunction)__pyx_pw_6pandas_5algos_85ffill_by_group, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pw_6pandas_5algos_85ffill_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;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("ffill_by_group (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_indexer,&__pyx_n_s_group_ids,&__pyx_n_s_max_group,0};
    PyObject* values[3] = {0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_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 (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_indexer)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_group_ids)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("ffill_by_group", 1, 3, 3, 1); {__pyx_filename = __pyx_f[3]; __pyx_lineno = 219; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_max_group)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("ffill_by_group", 1, 3, 3, 2); {__pyx_filename = __pyx_f[3]; __pyx_lineno = 219; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "ffill_by_group") < 0)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 219; __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_As_npy_int64(values[2]); if (unlikely((__pyx_v_max_group == (npy_int64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 220; __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[3]; __pyx_lineno = 219; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas.algos.ffill_by_group", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_indexer), __pyx_ptype_5numpy_ndarray, 1, "indexer", 0))) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 219; __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[3]; __pyx_lineno = 219; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_84ffill_by_group(__pyx_self, __pyx_v_indexer, __pyx_v_group_ids, __pyx_v_max_group);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pandas_5algos_84ffill_by_group(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_indexer, PyArrayObject *__pyx_v_group_ids, __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;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_group_ids;
  __Pyx_Buffer __pyx_pybuffer_group_ids;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_indexer;
  __Pyx_Buffer __pyx_pybuffer_indexer;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_last_obs;
  __Pyx_Buffer __pyx_pybuffer_last_obs;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_result;
  __Pyx_Buffer __pyx_pybuffer_result;
  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;
  __Pyx_RefNannySetupContext("ffill_by_group", 0);
  __pyx_pybuffer_result.pybuffer.buf = NULL;
  __pyx_pybuffer_result.refcount = 0;
  __pyx_pybuffernd_result.data = NULL;
  __pyx_pybuffernd_result.rcbuffer = &__pyx_pybuffer_result;
  __pyx_pybuffer_last_obs.pybuffer.buf = NULL;
  __pyx_pybuffer_last_obs.refcount = 0;
  __pyx_pybuffernd_last_obs.data = NULL;
  __pyx_pybuffernd_last_obs.rcbuffer = &__pyx_pybuffer_last_obs;
  __pyx_pybuffer_indexer.pybuffer.buf = NULL;
  __pyx_pybuffer_indexer.refcount = 0;
  __pyx_pybuffernd_indexer.data = NULL;
  __pyx_pybuffernd_indexer.rcbuffer = &__pyx_pybuffer_indexer;
  __pyx_pybuffer_group_ids.pybuffer.buf = NULL;
  __pyx_pybuffer_group_ids.refcount = 0;
  __pyx_pybuffernd_group_ids.data = NULL;
  __pyx_pybuffernd_group_ids.rcbuffer = &__pyx_pybuffer_group_ids;
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer, (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 = 219; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_indexer.diminfo[0].strides = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_indexer.diminfo[0].shape = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.shape[0];
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_group_ids.rcbuffer->pybuffer, (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[3]; __pyx_lineno = 219; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_group_ids.diminfo[0].strides = __pyx_pybuffernd_group_ids.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_group_ids.diminfo[0].shape = __pyx_pybuffernd_group_ids.rcbuffer->pybuffer.shape[0];

  /* "pandas/src/join.pyx":222
 *                    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[3]; __pyx_lineno = 222; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_n = __pyx_t_1;

  /* "pandas/src/join.pyx":226
 *         int64_t gid, val
 * 
 *     result = np.empty(n, dtype=np.int64)             # <<<<<<<<<<<<<<
 * 
 *     last_obs = np.empty(max_group, dtype=np.int64)
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 226; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_empty); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 226; __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 = 226; __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 = 226; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__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 = 226; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 226; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_int64); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 226; __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, __pyx_n_s_dtype, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 226; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 226; __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_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__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 = 226; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_7 = ((PyArrayObject *)__pyx_t_6);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer);
    __pyx_t_8 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_result.rcbuffer->pybuffer, (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_pybuffernd_result.rcbuffer->pybuffer, (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_pybuffernd_result.diminfo[0].strides = __pyx_pybuffernd_result.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_result.diminfo[0].shape = __pyx_pybuffernd_result.rcbuffer->pybuffer.shape[0];
    if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 226; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_7 = 0;
  __pyx_v_result = ((PyArrayObject *)__pyx_t_6);
  __pyx_t_6 = 0;

  /* "pandas/src/join.pyx":228
 *     result = np.empty(n, dtype=np.int64)
 * 
 *     last_obs = np.empty(max_group, dtype=np.int64)             # <<<<<<<<<<<<<<
 *     last_obs.fill(-1)
 * 
 */
  __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 228; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_empty); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 228; __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_From_npy_int64(__pyx_v_max_group); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 228; __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[3]; __pyx_lineno = 228; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__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[3]; __pyx_lineno = 228; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 228; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_int64); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 228; __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, __pyx_n_s_dtype, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 228; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, __pyx_t_6); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 228; __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_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__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 = 228; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_7 = ((PyArrayObject *)__pyx_t_5);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_last_obs.rcbuffer->pybuffer);
    __pyx_t_8 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_last_obs.rcbuffer->pybuffer, (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_pybuffernd_last_obs.rcbuffer->pybuffer, (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_pybuffernd_last_obs.diminfo[0].strides = __pyx_pybuffernd_last_obs.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_last_obs.diminfo[0].shape = __pyx_pybuffernd_last_obs.rcbuffer->pybuffer.shape[0];
    if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 228; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_7 = 0;
  __pyx_v_last_obs = ((PyArrayObject *)__pyx_t_5);
  __pyx_t_5 = 0;

  /* "pandas/src/join.pyx":229
 * 
 *     last_obs = np.empty(max_group, dtype=np.int64)
 *     last_obs.fill(-1)             # <<<<<<<<<<<<<<
 * 
 *     for i in range(n):
 */
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_last_obs), __pyx_n_s_fill); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 229; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_tuple__49, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 229; __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;

  /* "pandas/src/join.pyx":231
 *     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;

    /* "pandas/src/join.pyx":232
 * 
 *     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_pybuffernd_group_ids.diminfo[0].shape;
      if (unlikely(__pyx_t_13 < 0)) __pyx_t_8 = 0;
    } else if (unlikely(__pyx_t_13 >= __pyx_pybuffernd_group_ids.diminfo[0].shape)) __pyx_t_8 = 0;
    if (unlikely(__pyx_t_8 != -1)) {
      __Pyx_RaiseBufferIndexError(__pyx_t_8);
      {__pyx_filename = __pyx_f[3]; __pyx_lineno = 232; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_v_gid = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_group_ids.rcbuffer->pybuffer.buf, __pyx_t_13, __pyx_pybuffernd_group_ids.diminfo[0].strides));

    /* "pandas/src/join.pyx":233
 *     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_pybuffernd_indexer.diminfo[0].shape;
      if (unlikely(__pyx_t_14 < 0)) __pyx_t_8 = 0;
    } else if (unlikely(__pyx_t_14 >= __pyx_pybuffernd_indexer.diminfo[0].shape)) __pyx_t_8 = 0;
    if (unlikely(__pyx_t_8 != -1)) {
      __Pyx_RaiseBufferIndexError(__pyx_t_8);
      {__pyx_filename = __pyx_f[3]; __pyx_lineno = 233; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_v_val = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_indexer.diminfo[0].strides));

    /* "pandas/src/join.pyx":234
 *         gid = group_ids[i]
 *         val = indexer[i]
 *         if val == -1:             # <<<<<<<<<<<<<<
 *             result[i] = last_obs[gid]
 *         else:
 */
    __pyx_t_15 = ((__pyx_v_val == -1) != 0);
    if (__pyx_t_15) {

      /* "pandas/src/join.pyx":235
 *         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_pybuffernd_last_obs.diminfo[0].shape;
        if (unlikely(__pyx_t_16 < 0)) __pyx_t_8 = 0;
      } else if (unlikely(__pyx_t_16 >= __pyx_pybuffernd_last_obs.diminfo[0].shape)) __pyx_t_8 = 0;
      if (unlikely(__pyx_t_8 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_8);
        {__pyx_filename = __pyx_f[3]; __pyx_lineno = 235; __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_pybuffernd_result.diminfo[0].shape;
        if (unlikely(__pyx_t_17 < 0)) __pyx_t_8 = 0;
      } else if (unlikely(__pyx_t_17 >= __pyx_pybuffernd_result.diminfo[0].shape)) __pyx_t_8 = 0;
      if (unlikely(__pyx_t_8 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_8);
        {__pyx_filename = __pyx_f[3]; __pyx_lineno = 235; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_result.diminfo[0].strides) = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_last_obs.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_last_obs.diminfo[0].strides));
      goto __pyx_L5;
    }
    /*else*/ {

      /* "pandas/src/join.pyx":237
 *             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_pybuffernd_result.diminfo[0].shape;
        if (unlikely(__pyx_t_18 < 0)) __pyx_t_8 = 0;
      } else if (unlikely(__pyx_t_18 >= __pyx_pybuffernd_result.diminfo[0].shape)) __pyx_t_8 = 0;
      if (unlikely(__pyx_t_8 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_8);
        {__pyx_filename = __pyx_f[3]; __pyx_lineno = 237; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_result.diminfo[0].strides) = __pyx_v_val;

      /* "pandas/src/join.pyx":238
 *         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_pybuffernd_last_obs.diminfo[0].shape;
        if (unlikely(__pyx_t_19 < 0)) __pyx_t_8 = 0;
      } else if (unlikely(__pyx_t_19 >= __pyx_pybuffernd_last_obs.diminfo[0].shape)) __pyx_t_8 = 0;
      if (unlikely(__pyx_t_8 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_8);
        {__pyx_filename = __pyx_f[3]; __pyx_lineno = 238; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_last_obs.rcbuffer->pybuffer.buf, __pyx_t_19, __pyx_pybuffernd_last_obs.diminfo[0].strides) = __pyx_v_val;
    }
    __pyx_L5:;
  }

  /* "pandas/src/join.pyx":240
 *             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;

  /* "pandas/src/join.pyx":219
 * 
 * 
 * def ffill_by_group(ndarray[int64_t] indexer, ndarray[int64_t] group_ids,             # <<<<<<<<<<<<<<
 *                    int64_t max_group):
 *     cdef:
 */

  /* function exit code */
  __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_pybuffernd_group_ids.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_last_obs.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas.algos.ffill_by_group", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_group_ids.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_last_obs.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer);
  __pyx_L2:;
  __Pyx_XDECREF((PyObject *)__pyx_v_result);
  __Pyx_XDECREF((PyObject *)__pyx_v_last_obs);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/src/generated.pyx":43
 * cdef int PLATFORM_INT = (<ndarray> np.arange(0, dtype=np.int_)).descr.type_num
 * 
 * cpdef ensure_platform_int(object arr):             # <<<<<<<<<<<<<<
 *     if util.is_array(arr):
 *         if (<ndarray> arr).descr.type_num == PLATFORM_INT:
 */

static PyObject *__pyx_pw_6pandas_5algos_87ensure_platform_int(PyObject *__pyx_self, PyObject *__pyx_v_arr); /*proto*/
static PyObject *__pyx_f_6pandas_5algos_ensure_platform_int(PyObject *__pyx_v_arr, CYTHON_UNUSED int __pyx_skip_dispatch) {
  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_platform_int", 0);

  /* "pandas/src/generated.pyx":44
 * 
 * cpdef ensure_platform_int(object arr):
 *     if util.is_array(arr):             # <<<<<<<<<<<<<<
 *         if (<ndarray> arr).descr.type_num == PLATFORM_INT:
 *             return arr
 */
  __pyx_t_1 = __pyx_f_4util_is_array(__pyx_v_arr); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 44; __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[2]; __pyx_lineno = 44; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_2) {

    /* "pandas/src/generated.pyx":45
 * cpdef ensure_platform_int(object arr):
 *     if util.is_array(arr):
 *         if (<ndarray> arr).descr.type_num == PLATFORM_INT:             # <<<<<<<<<<<<<<
 *             return arr
 *         else:
 */
    __pyx_t_2 = ((((PyArrayObject *)__pyx_v_arr)->descr->type_num == __pyx_v_6pandas_5algos_PLATFORM_INT) != 0);
    if (__pyx_t_2) {

      /* "pandas/src/generated.pyx":46
 *     if util.is_array(arr):
 *         if (<ndarray> arr).descr.type_num == PLATFORM_INT:
 *             return arr             # <<<<<<<<<<<<<<
 *         else:
 *             return arr.astype(np.int_)
 */
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(__pyx_v_arr);
      __pyx_r = __pyx_v_arr;
      goto __pyx_L0;
    }
    /*else*/ {

      /* "pandas/src/generated.pyx":48
 *             return arr
 *         else:
 *             return arr.astype(np.int_)             # <<<<<<<<<<<<<<
 *     else:
 *         return np.array(arr, dtype=np.int_)
 */
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_arr, __pyx_n_s_astype); 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 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 48; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_int); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 48; __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[2]; __pyx_lineno = 48; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__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 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 48; __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_r = __pyx_t_4;
      __pyx_t_4 = 0;
      goto __pyx_L0;
    }
  }
  /*else*/ {

    /* "pandas/src/generated.pyx":50
 *             return arr.astype(np.int_)
 *     else:
 *         return np.array(arr, dtype=np.int_)             # <<<<<<<<<<<<<<
 * 
 * 
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 50; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_array); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __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_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 50; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__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[2]; __pyx_lineno = 50; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 50; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_int); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 50; __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, __pyx_n_s_dtype, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 50; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, __pyx_t_1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 50; __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_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_r = __pyx_t_6;
    __pyx_t_6 = 0;
    goto __pyx_L0;
  }

  /* "pandas/src/generated.pyx":43
 * cdef int PLATFORM_INT = (<ndarray> np.arange(0, dtype=np.int_)).descr.type_num
 * 
 * cpdef ensure_platform_int(object arr):             # <<<<<<<<<<<<<<
 *     if util.is_array(arr):
 *         if (<ndarray> arr).descr.type_num == PLATFORM_INT:
 */

  /* function exit code */
  __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.algos.ensure_platform_int", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_6pandas_5algos_87ensure_platform_int(PyObject *__pyx_self, PyObject *__pyx_v_arr); /*proto*/
static PyObject *__pyx_pw_6pandas_5algos_87ensure_platform_int(PyObject *__pyx_self, PyObject *__pyx_v_arr) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("ensure_platform_int (wrapper)", 0);
  __pyx_r = __pyx_pf_6pandas_5algos_86ensure_platform_int(__pyx_self, ((PyObject *)__pyx_v_arr));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pandas_5algos_86ensure_platform_int(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_arr) {
  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("ensure_platform_int", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_6pandas_5algos_ensure_platform_int(__pyx_v_arr, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 43; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pandas.algos.ensure_platform_int", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/src/generated.pyx":54
 * 
 * 
 * cpdef ensure_float64(object arr):             # <<<<<<<<<<<<<<
 *     if util.is_array(arr):
 *         if (<ndarray> arr).descr.type_num == NPY_FLOAT64:
 */

static PyObject *__pyx_pw_6pandas_5algos_89ensure_float64(PyObject *__pyx_self, PyObject *__pyx_v_arr); /*proto*/
static PyObject *__pyx_f_6pandas_5algos_ensure_float64(PyObject *__pyx_v_arr, CYTHON_UNUSED int __pyx_skip_dispatch) {
  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_float64", 0);

  /* "pandas/src/generated.pyx":55
 * 
 * cpdef ensure_float64(object arr):
 *     if util.is_array(arr):             # <<<<<<<<<<<<<<
 *         if (<ndarray> arr).descr.type_num == NPY_FLOAT64:
 *             return arr
 */
  __pyx_t_1 = __pyx_f_4util_is_array(__pyx_v_arr); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 55; __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[2]; __pyx_lineno = 55; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_2) {

    /* "pandas/src/generated.pyx":56
 * cpdef ensure_float64(object arr):
 *     if util.is_array(arr):
 *         if (<ndarray> arr).descr.type_num == NPY_FLOAT64:             # <<<<<<<<<<<<<<
 *             return arr
 *         else:
 */
    __pyx_t_2 = ((((PyArrayObject *)__pyx_v_arr)->descr->type_num == NPY_FLOAT64) != 0);
    if (__pyx_t_2) {

      /* "pandas/src/generated.pyx":57
 *     if util.is_array(arr):
 *         if (<ndarray> arr).descr.type_num == NPY_FLOAT64:
 *             return arr             # <<<<<<<<<<<<<<
 *         else:
 *             return arr.astype(np.float64)
 */
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(__pyx_v_arr);
      __pyx_r = __pyx_v_arr;
      goto __pyx_L0;
    }
    /*else*/ {

      /* "pandas/src/generated.pyx":59
 *             return arr
 *         else:
 *             return arr.astype(np.float64)             # <<<<<<<<<<<<<<
 *     else:
 *         return np.array(arr, dtype=np.float64)
 */
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_arr, __pyx_n_s_astype); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 59; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 59; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_float64); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 59; __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[2]; __pyx_lineno = 59; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__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 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 59; __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_r = __pyx_t_4;
      __pyx_t_4 = 0;
      goto __pyx_L0;
    }
  }
  /*else*/ {

    /* "pandas/src/generated.pyx":61
 *             return arr.astype(np.float64)
 *     else:
 *         return np.array(arr, dtype=np.float64)             # <<<<<<<<<<<<<<
 * 
 * 
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_array); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 61; __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 = 61; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__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[2]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_float64); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 61; __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, __pyx_n_s_dtype, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, __pyx_t_1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 61; __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_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_r = __pyx_t_6;
    __pyx_t_6 = 0;
    goto __pyx_L0;
  }

  /* "pandas/src/generated.pyx":54
 * 
 * 
 * cpdef ensure_float64(object arr):             # <<<<<<<<<<<<<<
 *     if util.is_array(arr):
 *         if (<ndarray> arr).descr.type_num == NPY_FLOAT64:
 */

  /* function exit code */
  __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.algos.ensure_float64", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_6pandas_5algos_89ensure_float64(PyObject *__pyx_self, PyObject *__pyx_v_arr); /*proto*/
static PyObject *__pyx_pw_6pandas_5algos_89ensure_float64(PyObject *__pyx_self, PyObject *__pyx_v_arr) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("ensure_float64 (wrapper)", 0);
  __pyx_r = __pyx_pf_6pandas_5algos_88ensure_float64(__pyx_self, ((PyObject *)__pyx_v_arr));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pandas_5algos_88ensure_float64(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_arr) {
  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("ensure_float64", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_6pandas_5algos_ensure_float64(__pyx_v_arr, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __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;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pandas.algos.ensure_float64", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/src/generated.pyx":64
 * 
 * 
 * cpdef ensure_float32(object arr):             # <<<<<<<<<<<<<<
 *     if util.is_array(arr):
 *         if (<ndarray> arr).descr.type_num == NPY_FLOAT32:
 */

static PyObject *__pyx_pw_6pandas_5algos_91ensure_float32(PyObject *__pyx_self, PyObject *__pyx_v_arr); /*proto*/
static PyObject *__pyx_f_6pandas_5algos_ensure_float32(PyObject *__pyx_v_arr, CYTHON_UNUSED int __pyx_skip_dispatch) {
  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_float32", 0);

  /* "pandas/src/generated.pyx":65
 * 
 * cpdef ensure_float32(object arr):
 *     if util.is_array(arr):             # <<<<<<<<<<<<<<
 *         if (<ndarray> arr).descr.type_num == NPY_FLOAT32:
 *             return arr
 */
  __pyx_t_1 = __pyx_f_4util_is_array(__pyx_v_arr); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 65; __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[2]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_2) {

    /* "pandas/src/generated.pyx":66
 * cpdef ensure_float32(object arr):
 *     if util.is_array(arr):
 *         if (<ndarray> arr).descr.type_num == NPY_FLOAT32:             # <<<<<<<<<<<<<<
 *             return arr
 *         else:
 */
    __pyx_t_2 = ((((PyArrayObject *)__pyx_v_arr)->descr->type_num == NPY_FLOAT32) != 0);
    if (__pyx_t_2) {

      /* "pandas/src/generated.pyx":67
 *     if util.is_array(arr):
 *         if (<ndarray> arr).descr.type_num == NPY_FLOAT32:
 *             return arr             # <<<<<<<<<<<<<<
 *         else:
 *             return arr.astype(np.float32)
 */
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(__pyx_v_arr);
      __pyx_r = __pyx_v_arr;
      goto __pyx_L0;
    }
    /*else*/ {

      /* "pandas/src/generated.pyx":69
 *             return arr
 *         else:
 *             return arr.astype(np.float32)             # <<<<<<<<<<<<<<
 *     else:
 *         return np.array(arr, dtype=np.float32)
 */
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_arr, __pyx_n_s_astype); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_float32); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 69; __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[2]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__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 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 69; __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_r = __pyx_t_4;
      __pyx_t_4 = 0;
      goto __pyx_L0;
    }
  }
  /*else*/ {

    /* "pandas/src/generated.pyx":71
 *             return arr.astype(np.float32)
 *     else:
 *         return np.array(arr, dtype=np.float32)             # <<<<<<<<<<<<<<
 * 
 * 
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 71; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_array); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 71; __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 = 71; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__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[2]; __pyx_lineno = 71; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 71; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_float32); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 71; __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, __pyx_n_s_dtype, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 71; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, __pyx_t_1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 71; __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_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_r = __pyx_t_6;
    __pyx_t_6 = 0;
    goto __pyx_L0;
  }

  /* "pandas/src/generated.pyx":64
 * 
 * 
 * cpdef ensure_float32(object arr):             # <<<<<<<<<<<<<<
 *     if util.is_array(arr):
 *         if (<ndarray> arr).descr.type_num == NPY_FLOAT32:
 */

  /* function exit code */
  __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.algos.ensure_float32", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_6pandas_5algos_91ensure_float32(PyObject *__pyx_self, PyObject *__pyx_v_arr); /*proto*/
static PyObject *__pyx_pw_6pandas_5algos_91ensure_float32(PyObject *__pyx_self, PyObject *__pyx_v_arr) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("ensure_float32 (wrapper)", 0);
  __pyx_r = __pyx_pf_6pandas_5algos_90ensure_float32(__pyx_self, ((PyObject *)__pyx_v_arr));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pandas_5algos_90ensure_float32(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_arr) {
  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("ensure_float32", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_6pandas_5algos_ensure_float32(__pyx_v_arr, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 64; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pandas.algos.ensure_float32", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/src/generated.pyx":74
 * 
 * 
 * cpdef ensure_int8(object arr):             # <<<<<<<<<<<<<<
 *     if util.is_array(arr):
 *         if (<ndarray> arr).descr.type_num == NPY_INT8:
 */

static PyObject *__pyx_pw_6pandas_5algos_93ensure_int8(PyObject *__pyx_self, PyObject *__pyx_v_arr); /*proto*/
static PyObject *__pyx_f_6pandas_5algos_ensure_int8(PyObject *__pyx_v_arr, CYTHON_UNUSED int __pyx_skip_dispatch) {
  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_int8", 0);

  /* "pandas/src/generated.pyx":75
 * 
 * cpdef ensure_int8(object arr):
 *     if util.is_array(arr):             # <<<<<<<<<<<<<<
 *         if (<ndarray> arr).descr.type_num == NPY_INT8:
 *             return arr
 */
  __pyx_t_1 = __pyx_f_4util_is_array(__pyx_v_arr); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 75; __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[2]; __pyx_lineno = 75; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_2) {

    /* "pandas/src/generated.pyx":76
 * cpdef ensure_int8(object arr):
 *     if util.is_array(arr):
 *         if (<ndarray> arr).descr.type_num == NPY_INT8:             # <<<<<<<<<<<<<<
 *             return arr
 *         else:
 */
    __pyx_t_2 = ((((PyArrayObject *)__pyx_v_arr)->descr->type_num == NPY_INT8) != 0);
    if (__pyx_t_2) {

      /* "pandas/src/generated.pyx":77
 *     if util.is_array(arr):
 *         if (<ndarray> arr).descr.type_num == NPY_INT8:
 *             return arr             # <<<<<<<<<<<<<<
 *         else:
 *             return arr.astype(np.int8)
 */
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(__pyx_v_arr);
      __pyx_r = __pyx_v_arr;
      goto __pyx_L0;
    }
    /*else*/ {

      /* "pandas/src/generated.pyx":79
 *             return arr
 *         else:
 *             return arr.astype(np.int8)             # <<<<<<<<<<<<<<
 *     else:
 *         return np.array(arr, dtype=np.int8)
 */
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_arr, __pyx_n_s_astype); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_int8); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 79; __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[2]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__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 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 79; __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_r = __pyx_t_4;
      __pyx_t_4 = 0;
      goto __pyx_L0;
    }
  }
  /*else*/ {

    /* "pandas/src/generated.pyx":81
 *             return arr.astype(np.int8)
 *     else:
 *         return np.array(arr, dtype=np.int8)             # <<<<<<<<<<<<<<
 * 
 * 
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_array); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 81; __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 = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__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[2]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_int8); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 81; __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, __pyx_n_s_dtype, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, __pyx_t_1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 81; __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_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_r = __pyx_t_6;
    __pyx_t_6 = 0;
    goto __pyx_L0;
  }

  /* "pandas/src/generated.pyx":74
 * 
 * 
 * cpdef ensure_int8(object arr):             # <<<<<<<<<<<<<<
 *     if util.is_array(arr):
 *         if (<ndarray> arr).descr.type_num == NPY_INT8:
 */

  /* function exit code */
  __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.algos.ensure_int8", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_6pandas_5algos_93ensure_int8(PyObject *__pyx_self, PyObject *__pyx_v_arr); /*proto*/
static PyObject *__pyx_pw_6pandas_5algos_93ensure_int8(PyObject *__pyx_self, PyObject *__pyx_v_arr) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("ensure_int8 (wrapper)", 0);
  __pyx_r = __pyx_pf_6pandas_5algos_92ensure_int8(__pyx_self, ((PyObject *)__pyx_v_arr));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pandas_5algos_92ensure_int8(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_arr) {
  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("ensure_int8", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_6pandas_5algos_ensure_int8(__pyx_v_arr, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pandas.algos.ensure_int8", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/src/generated.pyx":84
 * 
 * 
 * cpdef ensure_int16(object arr):             # <<<<<<<<<<<<<<
 *     if util.is_array(arr):
 *         if (<ndarray> arr).descr.type_num == NPY_INT16:
 */

static PyObject *__pyx_pw_6pandas_5algos_95ensure_int16(PyObject *__pyx_self, PyObject *__pyx_v_arr); /*proto*/
static PyObject *__pyx_f_6pandas_5algos_ensure_int16(PyObject *__pyx_v_arr, CYTHON_UNUSED int __pyx_skip_dispatch) {
  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_int16", 0);

  /* "pandas/src/generated.pyx":85
 * 
 * cpdef ensure_int16(object arr):
 *     if util.is_array(arr):             # <<<<<<<<<<<<<<
 *         if (<ndarray> arr).descr.type_num == NPY_INT16:
 *             return arr
 */
  __pyx_t_1 = __pyx_f_4util_is_array(__pyx_v_arr); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 85; __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[2]; __pyx_lineno = 85; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_2) {

    /* "pandas/src/generated.pyx":86
 * cpdef ensure_int16(object arr):
 *     if util.is_array(arr):
 *         if (<ndarray> arr).descr.type_num == NPY_INT16:             # <<<<<<<<<<<<<<
 *             return arr
 *         else:
 */
    __pyx_t_2 = ((((PyArrayObject *)__pyx_v_arr)->descr->type_num == NPY_INT16) != 0);
    if (__pyx_t_2) {

      /* "pandas/src/generated.pyx":87
 *     if util.is_array(arr):
 *         if (<ndarray> arr).descr.type_num == NPY_INT16:
 *             return arr             # <<<<<<<<<<<<<<
 *         else:
 *             return arr.astype(np.int16)
 */
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(__pyx_v_arr);
      __pyx_r = __pyx_v_arr;
      goto __pyx_L0;
    }
    /*else*/ {

      /* "pandas/src/generated.pyx":89
 *             return arr
 *         else:
 *             return arr.astype(np.int16)             # <<<<<<<<<<<<<<
 *     else:
 *         return np.array(arr, dtype=np.int16)
 */
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_arr, __pyx_n_s_astype); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 89; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 89; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_int16); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 89; __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[2]; __pyx_lineno = 89; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__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 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 89; __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_r = __pyx_t_4;
      __pyx_t_4 = 0;
      goto __pyx_L0;
    }
  }
  /*else*/ {

    /* "pandas/src/generated.pyx":91
 *             return arr.astype(np.int16)
 *     else:
 *         return np.array(arr, dtype=np.int16)             # <<<<<<<<<<<<<<
 * 
 * 
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 91; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_array); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 91; __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 = 91; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__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[2]; __pyx_lineno = 91; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 91; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_int16); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 91; __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, __pyx_n_s_dtype, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 91; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, __pyx_t_1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 91; __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_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_r = __pyx_t_6;
    __pyx_t_6 = 0;
    goto __pyx_L0;
  }

  /* "pandas/src/generated.pyx":84
 * 
 * 
 * cpdef ensure_int16(object arr):             # <<<<<<<<<<<<<<
 *     if util.is_array(arr):
 *         if (<ndarray> arr).descr.type_num == NPY_INT16:
 */

  /* function exit code */
  __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.algos.ensure_int16", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_6pandas_5algos_95ensure_int16(PyObject *__pyx_self, PyObject *__pyx_v_arr); /*proto*/
static PyObject *__pyx_pw_6pandas_5algos_95ensure_int16(PyObject *__pyx_self, PyObject *__pyx_v_arr) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("ensure_int16 (wrapper)", 0);
  __pyx_r = __pyx_pf_6pandas_5algos_94ensure_int16(__pyx_self, ((PyObject *)__pyx_v_arr));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pandas_5algos_94ensure_int16(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_arr) {
  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("ensure_int16", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_6pandas_5algos_ensure_int16(__pyx_v_arr, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pandas.algos.ensure_int16", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/src/generated.pyx":94
 * 
 * 
 * cpdef ensure_int32(object arr):             # <<<<<<<<<<<<<<
 *     if util.is_array(arr):
 *         if (<ndarray> arr).descr.type_num == NPY_INT32:
 */

static PyObject *__pyx_pw_6pandas_5algos_97ensure_int32(PyObject *__pyx_self, PyObject *__pyx_v_arr); /*proto*/
static PyObject *__pyx_f_6pandas_5algos_ensure_int32(PyObject *__pyx_v_arr, CYTHON_UNUSED int __pyx_skip_dispatch) {
  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_int32", 0);

  /* "pandas/src/generated.pyx":95
 * 
 * cpdef ensure_int32(object arr):
 *     if util.is_array(arr):             # <<<<<<<<<<<<<<
 *         if (<ndarray> arr).descr.type_num == NPY_INT32:
 *             return arr
 */
  __pyx_t_1 = __pyx_f_4util_is_array(__pyx_v_arr); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 95; __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[2]; __pyx_lineno = 95; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_2) {

    /* "pandas/src/generated.pyx":96
 * cpdef ensure_int32(object arr):
 *     if util.is_array(arr):
 *         if (<ndarray> arr).descr.type_num == NPY_INT32:             # <<<<<<<<<<<<<<
 *             return arr
 *         else:
 */
    __pyx_t_2 = ((((PyArrayObject *)__pyx_v_arr)->descr->type_num == NPY_INT32) != 0);
    if (__pyx_t_2) {

      /* "pandas/src/generated.pyx":97
 *     if util.is_array(arr):
 *         if (<ndarray> arr).descr.type_num == NPY_INT32:
 *             return arr             # <<<<<<<<<<<<<<
 *         else:
 *             return arr.astype(np.int32)
 */
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(__pyx_v_arr);
      __pyx_r = __pyx_v_arr;
      goto __pyx_L0;
    }
    /*else*/ {

      /* "pandas/src/generated.pyx":99
 *             return arr
 *         else:
 *             return arr.astype(np.int32)             # <<<<<<<<<<<<<<
 *     else:
 *         return np.array(arr, dtype=np.int32)
 */
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_arr, __pyx_n_s_astype); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 99; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 99; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_int32); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 99; __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[2]; __pyx_lineno = 99; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__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 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 99; __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_r = __pyx_t_4;
      __pyx_t_4 = 0;
      goto __pyx_L0;
    }
  }
  /*else*/ {

    /* "pandas/src/generated.pyx":101
 *             return arr.astype(np.int32)
 *     else:
 *         return np.array(arr, dtype=np.int32)             # <<<<<<<<<<<<<<
 * 
 * 
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 101; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_array); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 101; __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 = 101; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__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[2]; __pyx_lineno = 101; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 101; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_int32); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 101; __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, __pyx_n_s_dtype, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 101; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, __pyx_t_1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 101; __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_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_r = __pyx_t_6;
    __pyx_t_6 = 0;
    goto __pyx_L0;
  }

  /* "pandas/src/generated.pyx":94
 * 
 * 
 * cpdef ensure_int32(object arr):             # <<<<<<<<<<<<<<
 *     if util.is_array(arr):
 *         if (<ndarray> arr).descr.type_num == NPY_INT32:
 */

  /* function exit code */
  __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.algos.ensure_int32", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_6pandas_5algos_97ensure_int32(PyObject *__pyx_self, PyObject *__pyx_v_arr); /*proto*/
static PyObject *__pyx_pw_6pandas_5algos_97ensure_int32(PyObject *__pyx_self, PyObject *__pyx_v_arr) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("ensure_int32 (wrapper)", 0);
  __pyx_r = __pyx_pf_6pandas_5algos_96ensure_int32(__pyx_self, ((PyObject *)__pyx_v_arr));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pandas_5algos_96ensure_int32(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_arr) {
  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("ensure_int32", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_6pandas_5algos_ensure_int32(__pyx_v_arr, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 94; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pandas.algos.ensure_int32", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/src/generated.pyx":104
 * 
 * 
 * cpdef ensure_int64(object arr):             # <<<<<<<<<<<<<<
 *     if util.is_array(arr):
 *         if (<ndarray> arr).descr.type_num == NPY_INT64:
 */

static PyObject *__pyx_pw_6pandas_5algos_99ensure_int64(PyObject *__pyx_self, PyObject *__pyx_v_arr); /*proto*/
static PyObject *__pyx_f_6pandas_5algos_ensure_int64(PyObject *__pyx_v_arr, CYTHON_UNUSED int __pyx_skip_dispatch) {
  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", 0);

  /* "pandas/src/generated.pyx":105
 * 
 * cpdef 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[2]; __pyx_lineno = 105; __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[2]; __pyx_lineno = 105; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_2) {

    /* "pandas/src/generated.pyx":106
 * cpdef 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) != 0);
    if (__pyx_t_2) {

      /* "pandas/src/generated.pyx":107
 *     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;
    }
    /*else*/ {

      /* "pandas/src/generated.pyx":109
 *             return arr
 *         else:
 *             return arr.astype(np.int64)             # <<<<<<<<<<<<<<
 *     else:
 *         return np.array(arr, dtype=np.int64)
 */
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_arr, __pyx_n_s_astype); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_int64); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 109; __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[2]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__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 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 109; __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_r = __pyx_t_4;
      __pyx_t_4 = 0;
      goto __pyx_L0;
    }
  }
  /*else*/ {

    /* "pandas/src/generated.pyx":111
 *             return arr.astype(np.int64)
 *     else:
 *         return np.array(arr, dtype=np.int64)             # <<<<<<<<<<<<<<
 * 
 * 
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_array); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 111; __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 = 111; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__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[2]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_int64); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 111; __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, __pyx_n_s_dtype, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, __pyx_t_1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 111; __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_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_r = __pyx_t_6;
    __pyx_t_6 = 0;
    goto __pyx_L0;
  }

  /* "pandas/src/generated.pyx":104
 * 
 * 
 * cpdef ensure_int64(object arr):             # <<<<<<<<<<<<<<
 *     if util.is_array(arr):
 *         if (<ndarray> arr).descr.type_num == NPY_INT64:
 */

  /* function exit code */
  __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.algos.ensure_int64", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_6pandas_5algos_99ensure_int64(PyObject *__pyx_self, PyObject *__pyx_v_arr); /*proto*/
static PyObject *__pyx_pw_6pandas_5algos_99ensure_int64(PyObject *__pyx_self, PyObject *__pyx_v_arr) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("ensure_int64 (wrapper)", 0);
  __pyx_r = __pyx_pf_6pandas_5algos_98ensure_int64(__pyx_self, ((PyObject *)__pyx_v_arr));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pandas_5algos_98ensure_int64(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_arr) {
  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("ensure_int64", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_6pandas_5algos_ensure_int64(__pyx_v_arr, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 104; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pandas.algos.ensure_int64", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/src/generated.pyx":114
 * 
 * 
 * cpdef ensure_object(object arr):             # <<<<<<<<<<<<<<
 *     if util.is_array(arr):
 *         if (<ndarray> arr).descr.type_num == NPY_OBJECT:
 */

static PyObject *__pyx_pw_6pandas_5algos_101ensure_object(PyObject *__pyx_self, PyObject *__pyx_v_arr); /*proto*/
static PyObject *__pyx_f_6pandas_5algos_ensure_object(PyObject *__pyx_v_arr, CYTHON_UNUSED int __pyx_skip_dispatch) {
  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_object", 0);

  /* "pandas/src/generated.pyx":115
 * 
 * cpdef ensure_object(object arr):
 *     if util.is_array(arr):             # <<<<<<<<<<<<<<
 *         if (<ndarray> arr).descr.type_num == NPY_OBJECT:
 *             return arr
 */
  __pyx_t_1 = __pyx_f_4util_is_array(__pyx_v_arr); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 115; __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[2]; __pyx_lineno = 115; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_2) {

    /* "pandas/src/generated.pyx":116
 * cpdef ensure_object(object arr):
 *     if util.is_array(arr):
 *         if (<ndarray> arr).descr.type_num == NPY_OBJECT:             # <<<<<<<<<<<<<<
 *             return arr
 *         else:
 */
    __pyx_t_2 = ((((PyArrayObject *)__pyx_v_arr)->descr->type_num == NPY_OBJECT) != 0);
    if (__pyx_t_2) {

      /* "pandas/src/generated.pyx":117
 *     if util.is_array(arr):
 *         if (<ndarray> arr).descr.type_num == NPY_OBJECT:
 *             return arr             # <<<<<<<<<<<<<<
 *         else:
 *             return arr.astype(np.object_)
 */
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(__pyx_v_arr);
      __pyx_r = __pyx_v_arr;
      goto __pyx_L0;
    }
    /*else*/ {

      /* "pandas/src/generated.pyx":119
 *             return arr
 *         else:
 *             return arr.astype(np.object_)             # <<<<<<<<<<<<<<
 *     else:
 *         return np.array(arr, dtype=np.object_)
 */
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_arr, __pyx_n_s_astype); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); 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_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_object_2); 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_3); __pyx_t_3 = 0;
      __pyx_t_3 = PyTuple_New(1); 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);
      PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4);
      __Pyx_GIVEREF(__pyx_t_4);
      __pyx_t_4 = 0;
      __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, NULL); 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_1); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_r = __pyx_t_4;
      __pyx_t_4 = 0;
      goto __pyx_L0;
    }
  }
  /*else*/ {

    /* "pandas/src/generated.pyx":121
 *             return arr.astype(np.object_)
 *     else:
 *         return np.array(arr, dtype=np.object_)             # <<<<<<<<<<<<<<
 * 
 * 
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); 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_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_array); 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_t_4 = PyTuple_New(1); 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_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[2]; __pyx_lineno = 121; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 121; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_object_2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 121; __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, __pyx_n_s_dtype, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 121; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, __pyx_t_1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 121; __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_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_r = __pyx_t_6;
    __pyx_t_6 = 0;
    goto __pyx_L0;
  }

  /* "pandas/src/generated.pyx":114
 * 
 * 
 * cpdef ensure_object(object arr):             # <<<<<<<<<<<<<<
 *     if util.is_array(arr):
 *         if (<ndarray> arr).descr.type_num == NPY_OBJECT:
 */

  /* function exit code */
  __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.algos.ensure_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_6pandas_5algos_101ensure_object(PyObject *__pyx_self, PyObject *__pyx_v_arr); /*proto*/
static PyObject *__pyx_pw_6pandas_5algos_101ensure_object(PyObject *__pyx_self, PyObject *__pyx_v_arr) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("ensure_object (wrapper)", 0);
  __pyx_r = __pyx_pf_6pandas_5algos_100ensure_object(__pyx_self, ((PyObject *)__pyx_v_arr));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pandas_5algos_100ensure_object(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_arr) {
  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("ensure_object", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_6pandas_5algos_ensure_object(__pyx_v_arr, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 114; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pandas.algos.ensure_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/src/generated.pyx":126
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * cpdef map_indices_float64(ndarray[float64_t] index):             # <<<<<<<<<<<<<<
 *     '''
 *     Produce a dict mapping the values of the input array to their respective
 */

static PyObject *__pyx_pw_6pandas_5algos_103map_indices_float64(PyObject *__pyx_self, PyObject *__pyx_v_index); /*proto*/
static PyObject *__pyx_f_6pandas_5algos_map_indices_float64(PyArrayObject *__pyx_v_index, CYTHON_UNUSED int __pyx_skip_dispatch) {
  Py_ssize_t __pyx_v_i;
  Py_ssize_t __pyx_v_length;
  PyObject *__pyx_v_result = 0;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_index;
  __Pyx_Buffer __pyx_pybuffer_index;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  Py_ssize_t __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("map_indices_float64", 0);
  __pyx_pybuffer_index.pybuffer.buf = NULL;
  __pyx_pybuffer_index.refcount = 0;
  __pyx_pybuffernd_index.data = NULL;
  __pyx_pybuffernd_index.rcbuffer = &__pyx_pybuffer_index;
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_index.rcbuffer->pybuffer, (PyObject*)__pyx_v_index, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 126; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_index.diminfo[0].strides = __pyx_pybuffernd_index.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_index.diminfo[0].shape = __pyx_pybuffernd_index.rcbuffer->pybuffer.shape[0];

  /* "pandas/src/generated.pyx":137
 *     '''
 *     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[2]; __pyx_lineno = 137; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_result = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pandas/src/generated.pyx":139
 *     cdef dict result = {}
 * 
 *     length = len(index)             # <<<<<<<<<<<<<<
 * 
 *     for i in range(length):
 */
  __pyx_t_2 = PyObject_Length(((PyObject *)__pyx_v_index)); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 139; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_length = __pyx_t_2;

  /* "pandas/src/generated.pyx":141
 *     length = len(index)
 * 
 *     for i in range(length):             # <<<<<<<<<<<<<<
 *         result[index[i]] = i
 * 
 */
  __pyx_t_2 = __pyx_v_length;
  for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
    __pyx_v_i = __pyx_t_3;

    /* "pandas/src/generated.pyx":142
 * 
 *     for i in range(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[2]; __pyx_lineno = 142; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_4 = __pyx_v_i;
    __pyx_t_5 = PyFloat_FromDouble((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_index.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_index.diminfo[0].strides))); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 142; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    if (unlikely(PyDict_SetItem(__pyx_v_result, __pyx_t_5, __pyx_t_1) < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 142; __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;
  }

  /* "pandas/src/generated.pyx":144
 *         result[index[i]] = i
 * 
 *     return result             # <<<<<<<<<<<<<<
 * 
 * @cython.wraparound(False)
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_result);
  __pyx_r = __pyx_v_result;
  goto __pyx_L0;

  /* "pandas/src/generated.pyx":126
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * cpdef map_indices_float64(ndarray[float64_t] index):             # <<<<<<<<<<<<<<
 *     '''
 *     Produce a dict mapping the values of the input array to their respective
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_5);
  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
    __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_index.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas.algos.map_indices_float64", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_index.rcbuffer->pybuffer);
  __pyx_L2:;
  __Pyx_XDECREF(__pyx_v_result);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_6pandas_5algos_103map_indices_float64(PyObject *__pyx_self, PyObject *__pyx_v_index); /*proto*/
static char __pyx_doc_6pandas_5algos_102map_indices_float64[] = "\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_pw_6pandas_5algos_103map_indices_float64(PyObject *__pyx_self, PyObject *__pyx_v_index) {
  CYTHON_UNUSED int __pyx_lineno = 0;
  CYTHON_UNUSED const char *__pyx_filename = NULL;
  CYTHON_UNUSED int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("map_indices_float64 (wrapper)", 0);
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_index), __pyx_ptype_5numpy_ndarray, 1, "index", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 126; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_102map_indices_float64(__pyx_self, ((PyArrayObject *)__pyx_v_index));

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pandas_5algos_102map_indices_float64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_index) {
  __Pyx_LocalBuf_ND __pyx_pybuffernd_index;
  __Pyx_Buffer __pyx_pybuffer_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_float64", 0);
  __pyx_pybuffer_index.pybuffer.buf = NULL;
  __pyx_pybuffer_index.refcount = 0;
  __pyx_pybuffernd_index.data = NULL;
  __pyx_pybuffernd_index.rcbuffer = &__pyx_pybuffer_index;
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_index.rcbuffer->pybuffer, (PyObject*)__pyx_v_index, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 126; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_index.diminfo[0].strides = __pyx_pybuffernd_index.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_index.diminfo[0].shape = __pyx_pybuffernd_index.rcbuffer->pybuffer.shape[0];
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_6pandas_5algos_map_indices_float64(__pyx_v_index, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 126; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __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_pybuffernd_index.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas.algos.map_indices_float64", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_index.rcbuffer->pybuffer);
  __pyx_L2:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/src/generated.pyx":148
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * cpdef map_indices_float32(ndarray[float32_t] index):             # <<<<<<<<<<<<<<
 *     '''
 *     Produce a dict mapping the values of the input array to their respective
 */

static PyObject *__pyx_pw_6pandas_5algos_105map_indices_float32(PyObject *__pyx_self, PyObject *__pyx_v_index); /*proto*/
static PyObject *__pyx_f_6pandas_5algos_map_indices_float32(PyArrayObject *__pyx_v_index, CYTHON_UNUSED int __pyx_skip_dispatch) {
  Py_ssize_t __pyx_v_i;
  Py_ssize_t __pyx_v_length;
  PyObject *__pyx_v_result = 0;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_index;
  __Pyx_Buffer __pyx_pybuffer_index;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  Py_ssize_t __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("map_indices_float32", 0);
  __pyx_pybuffer_index.pybuffer.buf = NULL;
  __pyx_pybuffer_index.refcount = 0;
  __pyx_pybuffernd_index.data = NULL;
  __pyx_pybuffernd_index.rcbuffer = &__pyx_pybuffer_index;
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_index.rcbuffer->pybuffer, (PyObject*)__pyx_v_index, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 148; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_index.diminfo[0].strides = __pyx_pybuffernd_index.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_index.diminfo[0].shape = __pyx_pybuffernd_index.rcbuffer->pybuffer.shape[0];

  /* "pandas/src/generated.pyx":159
 *     '''
 *     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[2]; __pyx_lineno = 159; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_result = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pandas/src/generated.pyx":161
 *     cdef dict result = {}
 * 
 *     length = len(index)             # <<<<<<<<<<<<<<
 * 
 *     for i in range(length):
 */
  __pyx_t_2 = PyObject_Length(((PyObject *)__pyx_v_index)); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 161; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_length = __pyx_t_2;

  /* "pandas/src/generated.pyx":163
 *     length = len(index)
 * 
 *     for i in range(length):             # <<<<<<<<<<<<<<
 *         result[index[i]] = i
 * 
 */
  __pyx_t_2 = __pyx_v_length;
  for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
    __pyx_v_i = __pyx_t_3;

    /* "pandas/src/generated.pyx":164
 * 
 *     for i in range(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[2]; __pyx_lineno = 164; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_4 = __pyx_v_i;
    __pyx_t_5 = PyFloat_FromDouble((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_index.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_index.diminfo[0].strides))); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 164; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    if (unlikely(PyDict_SetItem(__pyx_v_result, __pyx_t_5, __pyx_t_1) < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 164; __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;
  }

  /* "pandas/src/generated.pyx":166
 *         result[index[i]] = i
 * 
 *     return result             # <<<<<<<<<<<<<<
 * 
 * @cython.wraparound(False)
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_result);
  __pyx_r = __pyx_v_result;
  goto __pyx_L0;

  /* "pandas/src/generated.pyx":148
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * cpdef map_indices_float32(ndarray[float32_t] index):             # <<<<<<<<<<<<<<
 *     '''
 *     Produce a dict mapping the values of the input array to their respective
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_5);
  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
    __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_index.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas.algos.map_indices_float32", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_index.rcbuffer->pybuffer);
  __pyx_L2:;
  __Pyx_XDECREF(__pyx_v_result);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_6pandas_5algos_105map_indices_float32(PyObject *__pyx_self, PyObject *__pyx_v_index); /*proto*/
static char __pyx_doc_6pandas_5algos_104map_indices_float32[] = "\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_pw_6pandas_5algos_105map_indices_float32(PyObject *__pyx_self, PyObject *__pyx_v_index) {
  CYTHON_UNUSED int __pyx_lineno = 0;
  CYTHON_UNUSED const char *__pyx_filename = NULL;
  CYTHON_UNUSED int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("map_indices_float32 (wrapper)", 0);
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_index), __pyx_ptype_5numpy_ndarray, 1, "index", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 148; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_104map_indices_float32(__pyx_self, ((PyArrayObject *)__pyx_v_index));

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pandas_5algos_104map_indices_float32(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_index) {
  __Pyx_LocalBuf_ND __pyx_pybuffernd_index;
  __Pyx_Buffer __pyx_pybuffer_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_float32", 0);
  __pyx_pybuffer_index.pybuffer.buf = NULL;
  __pyx_pybuffer_index.refcount = 0;
  __pyx_pybuffernd_index.data = NULL;
  __pyx_pybuffernd_index.rcbuffer = &__pyx_pybuffer_index;
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_index.rcbuffer->pybuffer, (PyObject*)__pyx_v_index, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 148; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_index.diminfo[0].strides = __pyx_pybuffernd_index.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_index.diminfo[0].shape = __pyx_pybuffernd_index.rcbuffer->pybuffer.shape[0];
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_6pandas_5algos_map_indices_float32(__pyx_v_index, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 148; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __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_pybuffernd_index.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas.algos.map_indices_float32", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_index.rcbuffer->pybuffer);
  __pyx_L2:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/src/generated.pyx":170
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * cpdef map_indices_object(ndarray[object] index):             # <<<<<<<<<<<<<<
 *     '''
 *     Produce a dict mapping the values of the input array to their respective
 */

static PyObject *__pyx_pw_6pandas_5algos_107map_indices_object(PyObject *__pyx_self, PyObject *__pyx_v_index); /*proto*/
static PyObject *__pyx_f_6pandas_5algos_map_indices_object(PyArrayObject *__pyx_v_index, CYTHON_UNUSED int __pyx_skip_dispatch) {
  Py_ssize_t __pyx_v_i;
  Py_ssize_t __pyx_v_length;
  PyObject *__pyx_v_result = 0;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_index;
  __Pyx_Buffer __pyx_pybuffer_index;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  Py_ssize_t __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  Py_ssize_t __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("map_indices_object", 0);
  __pyx_pybuffer_index.pybuffer.buf = NULL;
  __pyx_pybuffer_index.refcount = 0;
  __pyx_pybuffernd_index.data = NULL;
  __pyx_pybuffernd_index.rcbuffer = &__pyx_pybuffer_index;
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_index.rcbuffer->pybuffer, (PyObject*)__pyx_v_index, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 170; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_index.diminfo[0].strides = __pyx_pybuffernd_index.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_index.diminfo[0].shape = __pyx_pybuffernd_index.rcbuffer->pybuffer.shape[0];

  /* "pandas/src/generated.pyx":181
 *     '''
 *     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[2]; __pyx_lineno = 181; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_result = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pandas/src/generated.pyx":183
 *     cdef dict result = {}
 * 
 *     length = len(index)             # <<<<<<<<<<<<<<
 * 
 *     for i in range(length):
 */
  __pyx_t_2 = PyObject_Length(((PyObject *)__pyx_v_index)); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 183; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_length = __pyx_t_2;

  /* "pandas/src/generated.pyx":185
 *     length = len(index)
 * 
 *     for i in range(length):             # <<<<<<<<<<<<<<
 *         result[index[i]] = i
 * 
 */
  __pyx_t_2 = __pyx_v_length;
  for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
    __pyx_v_i = __pyx_t_3;

    /* "pandas/src/generated.pyx":186
 * 
 *     for i in range(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[2]; __pyx_lineno = 186; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_5 = __pyx_v_i;
    __pyx_t_4 = (PyObject *) *__Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_index.rcbuffer->pybuffer.buf, __pyx_t_5, __pyx_pybuffernd_index.diminfo[0].strides);
    __Pyx_INCREF((PyObject*)__pyx_t_4);
    if (unlikely(PyDict_SetItem(__pyx_v_result, __pyx_t_4, __pyx_t_1) < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 186; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "pandas/src/generated.pyx":188
 *         result[index[i]] = i
 * 
 *     return result             # <<<<<<<<<<<<<<
 * 
 * @cython.wraparound(False)
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_result);
  __pyx_r = __pyx_v_result;
  goto __pyx_L0;

  /* "pandas/src/generated.pyx":170
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * cpdef map_indices_object(ndarray[object] index):             # <<<<<<<<<<<<<<
 *     '''
 *     Produce a dict mapping the values of the input array to their respective
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_4);
  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
    __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_index.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas.algos.map_indices_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_index.rcbuffer->pybuffer);
  __pyx_L2:;
  __Pyx_XDECREF(__pyx_v_result);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_6pandas_5algos_107map_indices_object(PyObject *__pyx_self, PyObject *__pyx_v_index); /*proto*/
static char __pyx_doc_6pandas_5algos_106map_indices_object[] = "\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_pw_6pandas_5algos_107map_indices_object(PyObject *__pyx_self, PyObject *__pyx_v_index) {
  CYTHON_UNUSED int __pyx_lineno = 0;
  CYTHON_UNUSED const char *__pyx_filename = NULL;
  CYTHON_UNUSED int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("map_indices_object (wrapper)", 0);
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_index), __pyx_ptype_5numpy_ndarray, 1, "index", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 170; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_106map_indices_object(__pyx_self, ((PyArrayObject *)__pyx_v_index));

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pandas_5algos_106map_indices_object(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_index) {
  __Pyx_LocalBuf_ND __pyx_pybuffernd_index;
  __Pyx_Buffer __pyx_pybuffer_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_object", 0);
  __pyx_pybuffer_index.pybuffer.buf = NULL;
  __pyx_pybuffer_index.refcount = 0;
  __pyx_pybuffernd_index.data = NULL;
  __pyx_pybuffernd_index.rcbuffer = &__pyx_pybuffer_index;
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_index.rcbuffer->pybuffer, (PyObject*)__pyx_v_index, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 170; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_index.diminfo[0].strides = __pyx_pybuffernd_index.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_index.diminfo[0].shape = __pyx_pybuffernd_index.rcbuffer->pybuffer.shape[0];
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_6pandas_5algos_map_indices_object(__pyx_v_index, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __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;

  /* function exit code */
  __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_pybuffernd_index.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas.algos.map_indices_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_index.rcbuffer->pybuffer);
  __pyx_L2:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/src/generated.pyx":192
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * cpdef map_indices_int32(ndarray[int32_t] index):             # <<<<<<<<<<<<<<
 *     '''
 *     Produce a dict mapping the values of the input array to their respective
 */

static PyObject *__pyx_pw_6pandas_5algos_109map_indices_int32(PyObject *__pyx_self, PyObject *__pyx_v_index); /*proto*/
static PyObject *__pyx_f_6pandas_5algos_map_indices_int32(PyArrayObject *__pyx_v_index, CYTHON_UNUSED int __pyx_skip_dispatch) {
  Py_ssize_t __pyx_v_i;
  Py_ssize_t __pyx_v_length;
  PyObject *__pyx_v_result = 0;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_index;
  __Pyx_Buffer __pyx_pybuffer_index;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  Py_ssize_t __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("map_indices_int32", 0);
  __pyx_pybuffer_index.pybuffer.buf = NULL;
  __pyx_pybuffer_index.refcount = 0;
  __pyx_pybuffernd_index.data = NULL;
  __pyx_pybuffernd_index.rcbuffer = &__pyx_pybuffer_index;
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_index.rcbuffer->pybuffer, (PyObject*)__pyx_v_index, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 192; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_index.diminfo[0].strides = __pyx_pybuffernd_index.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_index.diminfo[0].shape = __pyx_pybuffernd_index.rcbuffer->pybuffer.shape[0];

  /* "pandas/src/generated.pyx":203
 *     '''
 *     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[2]; __pyx_lineno = 203; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_result = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pandas/src/generated.pyx":205
 *     cdef dict result = {}
 * 
 *     length = len(index)             # <<<<<<<<<<<<<<
 * 
 *     for i in range(length):
 */
  __pyx_t_2 = PyObject_Length(((PyObject *)__pyx_v_index)); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 205; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_length = __pyx_t_2;

  /* "pandas/src/generated.pyx":207
 *     length = len(index)
 * 
 *     for i in range(length):             # <<<<<<<<<<<<<<
 *         result[index[i]] = i
 * 
 */
  __pyx_t_2 = __pyx_v_length;
  for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
    __pyx_v_i = __pyx_t_3;

    /* "pandas/src/generated.pyx":208
 * 
 *     for i in range(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[2]; __pyx_lineno = 208; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_4 = __pyx_v_i;
    __pyx_t_5 = __Pyx_PyInt_From_npy_int32((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_index.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_index.diminfo[0].strides))); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 208; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    if (unlikely(PyDict_SetItem(__pyx_v_result, __pyx_t_5, __pyx_t_1) < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 208; __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;
  }

  /* "pandas/src/generated.pyx":210
 *         result[index[i]] = i
 * 
 *     return result             # <<<<<<<<<<<<<<
 * 
 * @cython.wraparound(False)
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_result);
  __pyx_r = __pyx_v_result;
  goto __pyx_L0;

  /* "pandas/src/generated.pyx":192
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * cpdef map_indices_int32(ndarray[int32_t] index):             # <<<<<<<<<<<<<<
 *     '''
 *     Produce a dict mapping the values of the input array to their respective
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_5);
  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
    __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_index.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas.algos.map_indices_int32", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_index.rcbuffer->pybuffer);
  __pyx_L2:;
  __Pyx_XDECREF(__pyx_v_result);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_6pandas_5algos_109map_indices_int32(PyObject *__pyx_self, PyObject *__pyx_v_index); /*proto*/
static char __pyx_doc_6pandas_5algos_108map_indices_int32[] = "\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_pw_6pandas_5algos_109map_indices_int32(PyObject *__pyx_self, PyObject *__pyx_v_index) {
  CYTHON_UNUSED int __pyx_lineno = 0;
  CYTHON_UNUSED const char *__pyx_filename = NULL;
  CYTHON_UNUSED int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("map_indices_int32 (wrapper)", 0);
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_index), __pyx_ptype_5numpy_ndarray, 1, "index", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 192; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_108map_indices_int32(__pyx_self, ((PyArrayObject *)__pyx_v_index));

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pandas_5algos_108map_indices_int32(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_index) {
  __Pyx_LocalBuf_ND __pyx_pybuffernd_index;
  __Pyx_Buffer __pyx_pybuffer_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_int32", 0);
  __pyx_pybuffer_index.pybuffer.buf = NULL;
  __pyx_pybuffer_index.refcount = 0;
  __pyx_pybuffernd_index.data = NULL;
  __pyx_pybuffernd_index.rcbuffer = &__pyx_pybuffer_index;
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_index.rcbuffer->pybuffer, (PyObject*)__pyx_v_index, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 192; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_index.diminfo[0].strides = __pyx_pybuffernd_index.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_index.diminfo[0].shape = __pyx_pybuffernd_index.rcbuffer->pybuffer.shape[0];
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_6pandas_5algos_map_indices_int32(__pyx_v_index, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 192; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __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_pybuffernd_index.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas.algos.map_indices_int32", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_index.rcbuffer->pybuffer);
  __pyx_L2:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/src/generated.pyx":214
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * cpdef map_indices_int64(ndarray[int64_t] index):             # <<<<<<<<<<<<<<
 *     '''
 *     Produce a dict mapping the values of the input array to their respective
 */

static PyObject *__pyx_pw_6pandas_5algos_111map_indices_int64(PyObject *__pyx_self, PyObject *__pyx_v_index); /*proto*/
static PyObject *__pyx_f_6pandas_5algos_map_indices_int64(PyArrayObject *__pyx_v_index, CYTHON_UNUSED int __pyx_skip_dispatch) {
  Py_ssize_t __pyx_v_i;
  Py_ssize_t __pyx_v_length;
  PyObject *__pyx_v_result = 0;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_index;
  __Pyx_Buffer __pyx_pybuffer_index;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  Py_ssize_t __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("map_indices_int64", 0);
  __pyx_pybuffer_index.pybuffer.buf = NULL;
  __pyx_pybuffer_index.refcount = 0;
  __pyx_pybuffernd_index.data = NULL;
  __pyx_pybuffernd_index.rcbuffer = &__pyx_pybuffer_index;
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_index.rcbuffer->pybuffer, (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[2]; __pyx_lineno = 214; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_index.diminfo[0].strides = __pyx_pybuffernd_index.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_index.diminfo[0].shape = __pyx_pybuffernd_index.rcbuffer->pybuffer.shape[0];

  /* "pandas/src/generated.pyx":225
 *     '''
 *     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[2]; __pyx_lineno = 225; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_result = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pandas/src/generated.pyx":227
 *     cdef dict result = {}
 * 
 *     length = len(index)             # <<<<<<<<<<<<<<
 * 
 *     for i in range(length):
 */
  __pyx_t_2 = PyObject_Length(((PyObject *)__pyx_v_index)); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 227; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_length = __pyx_t_2;

  /* "pandas/src/generated.pyx":229
 *     length = len(index)
 * 
 *     for i in range(length):             # <<<<<<<<<<<<<<
 *         result[index[i]] = i
 * 
 */
  __pyx_t_2 = __pyx_v_length;
  for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
    __pyx_v_i = __pyx_t_3;

    /* "pandas/src/generated.pyx":230
 * 
 *     for i in range(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[2]; __pyx_lineno = 230; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_4 = __pyx_v_i;
    __pyx_t_5 = __Pyx_PyInt_From_npy_int64((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_index.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_index.diminfo[0].strides))); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 230; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    if (unlikely(PyDict_SetItem(__pyx_v_result, __pyx_t_5, __pyx_t_1) < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 230; __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;
  }

  /* "pandas/src/generated.pyx":232
 *         result[index[i]] = i
 * 
 *     return result             # <<<<<<<<<<<<<<
 * 
 * @cython.wraparound(False)
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_result);
  __pyx_r = __pyx_v_result;
  goto __pyx_L0;

  /* "pandas/src/generated.pyx":214
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * cpdef map_indices_int64(ndarray[int64_t] index):             # <<<<<<<<<<<<<<
 *     '''
 *     Produce a dict mapping the values of the input array to their respective
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_5);
  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
    __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_index.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas.algos.map_indices_int64", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_index.rcbuffer->pybuffer);
  __pyx_L2:;
  __Pyx_XDECREF(__pyx_v_result);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_6pandas_5algos_111map_indices_int64(PyObject *__pyx_self, PyObject *__pyx_v_index); /*proto*/
static char __pyx_doc_6pandas_5algos_110map_indices_int64[] = "\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_pw_6pandas_5algos_111map_indices_int64(PyObject *__pyx_self, PyObject *__pyx_v_index) {
  CYTHON_UNUSED int __pyx_lineno = 0;
  CYTHON_UNUSED const char *__pyx_filename = NULL;
  CYTHON_UNUSED int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("map_indices_int64 (wrapper)", 0);
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_index), __pyx_ptype_5numpy_ndarray, 1, "index", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 214; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_110map_indices_int64(__pyx_self, ((PyArrayObject *)__pyx_v_index));

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pandas_5algos_110map_indices_int64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_index) {
  __Pyx_LocalBuf_ND __pyx_pybuffernd_index;
  __Pyx_Buffer __pyx_pybuffer_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_int64", 0);
  __pyx_pybuffer_index.pybuffer.buf = NULL;
  __pyx_pybuffer_index.refcount = 0;
  __pyx_pybuffernd_index.data = NULL;
  __pyx_pybuffernd_index.rcbuffer = &__pyx_pybuffer_index;
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_index.rcbuffer->pybuffer, (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[2]; __pyx_lineno = 214; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_index.diminfo[0].strides = __pyx_pybuffernd_index.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_index.diminfo[0].shape = __pyx_pybuffernd_index.rcbuffer->pybuffer.shape[0];
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_6pandas_5algos_map_indices_int64(__pyx_v_index, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 214; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __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_pybuffernd_index.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas.algos.map_indices_int64", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_index.rcbuffer->pybuffer);
  __pyx_L2:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/src/generated.pyx":236
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * cpdef map_indices_bool(ndarray[uint8_t] index):             # <<<<<<<<<<<<<<
 *     '''
 *     Produce a dict mapping the values of the input array to their respective
 */

static PyObject *__pyx_pw_6pandas_5algos_113map_indices_bool(PyObject *__pyx_self, PyObject *__pyx_v_index); /*proto*/
static PyObject *__pyx_f_6pandas_5algos_map_indices_bool(PyArrayObject *__pyx_v_index, CYTHON_UNUSED int __pyx_skip_dispatch) {
  Py_ssize_t __pyx_v_i;
  Py_ssize_t __pyx_v_length;
  PyObject *__pyx_v_result = 0;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_index;
  __Pyx_Buffer __pyx_pybuffer_index;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  Py_ssize_t __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("map_indices_bool", 0);
  __pyx_pybuffer_index.pybuffer.buf = NULL;
  __pyx_pybuffer_index.refcount = 0;
  __pyx_pybuffernd_index.data = NULL;
  __pyx_pybuffernd_index.rcbuffer = &__pyx_pybuffer_index;
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_index.rcbuffer->pybuffer, (PyObject*)__pyx_v_index, &__Pyx_TypeInfo_nn___pyx_t_5numpy_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 236; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_index.diminfo[0].strides = __pyx_pybuffernd_index.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_index.diminfo[0].shape = __pyx_pybuffernd_index.rcbuffer->pybuffer.shape[0];

  /* "pandas/src/generated.pyx":247
 *     '''
 *     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[2]; __pyx_lineno = 247; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_result = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pandas/src/generated.pyx":249
 *     cdef dict result = {}
 * 
 *     length = len(index)             # <<<<<<<<<<<<<<
 * 
 *     for i in range(length):
 */
  __pyx_t_2 = PyObject_Length(((PyObject *)__pyx_v_index)); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 249; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_length = __pyx_t_2;

  /* "pandas/src/generated.pyx":251
 *     length = len(index)
 * 
 *     for i in range(length):             # <<<<<<<<<<<<<<
 *         result[index[i]] = i
 * 
 */
  __pyx_t_2 = __pyx_v_length;
  for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
    __pyx_v_i = __pyx_t_3;

    /* "pandas/src/generated.pyx":252
 * 
 *     for i in range(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[2]; __pyx_lineno = 252; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_4 = __pyx_v_i;
    __pyx_t_5 = __Pyx_PyInt_From_npy_uint8((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_uint8_t *, __pyx_pybuffernd_index.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_index.diminfo[0].strides))); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 252; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    if (unlikely(PyDict_SetItem(__pyx_v_result, __pyx_t_5, __pyx_t_1) < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 252; __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;
  }

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

  /* "pandas/src/generated.pyx":236
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * cpdef map_indices_bool(ndarray[uint8_t] index):             # <<<<<<<<<<<<<<
 *     '''
 *     Produce a dict mapping the values of the input array to their respective
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_5);
  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
    __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_index.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas.algos.map_indices_bool", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_index.rcbuffer->pybuffer);
  __pyx_L2:;
  __Pyx_XDECREF(__pyx_v_result);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_6pandas_5algos_113map_indices_bool(PyObject *__pyx_self, PyObject *__pyx_v_index); /*proto*/
static char __pyx_doc_6pandas_5algos_112map_indices_bool[] = "\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_pw_6pandas_5algos_113map_indices_bool(PyObject *__pyx_self, PyObject *__pyx_v_index) {
  CYTHON_UNUSED int __pyx_lineno = 0;
  CYTHON_UNUSED const char *__pyx_filename = NULL;
  CYTHON_UNUSED int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("map_indices_bool (wrapper)", 0);
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_index), __pyx_ptype_5numpy_ndarray, 1, "index", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 236; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_112map_indices_bool(__pyx_self, ((PyArrayObject *)__pyx_v_index));

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pandas_5algos_112map_indices_bool(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_index) {
  __Pyx_LocalBuf_ND __pyx_pybuffernd_index;
  __Pyx_Buffer __pyx_pybuffer_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_bool", 0);
  __pyx_pybuffer_index.pybuffer.buf = NULL;
  __pyx_pybuffer_index.refcount = 0;
  __pyx_pybuffernd_index.data = NULL;
  __pyx_pybuffernd_index.rcbuffer = &__pyx_pybuffer_index;
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_index.rcbuffer->pybuffer, (PyObject*)__pyx_v_index, &__Pyx_TypeInfo_nn___pyx_t_5numpy_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 236; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_index.diminfo[0].strides = __pyx_pybuffernd_index.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_index.diminfo[0].shape = __pyx_pybuffernd_index.rcbuffer->pybuffer.shape[0];
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_6pandas_5algos_map_indices_bool(__pyx_v_index, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __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;

  /* function exit code */
  __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_pybuffernd_index.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas.algos.map_indices_bool", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_index.rcbuffer->pybuffer);
  __pyx_L2:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/src/generated.pyx":259
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def pad_float64(ndarray[float64_t] old, ndarray[float64_t] new,             # <<<<<<<<<<<<<<
 *                    limit=None):
 *     cdef Py_ssize_t i, j, nleft, nright
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pandas_5algos_115pad_float64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_5algos_115pad_float64 = {__Pyx_NAMESTR("pad_float64"), (PyCFunction)__pyx_pw_6pandas_5algos_115pad_float64, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pw_6pandas_5algos_115pad_float64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyArrayObject *__pyx_v_old = 0;
  PyArrayObject *__pyx_v_new = 0;
  PyObject *__pyx_v_limit = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("pad_float64 (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_old,&__pyx_n_s_new,&__pyx_n_s_limit,0};
    PyObject* values[3] = {0,0,0};

    /* "pandas/src/generated.pyx":260
 * @cython.wraparound(False)
 * def pad_float64(ndarray[float64_t] old, ndarray[float64_t] new,
 *                    limit=None):             # <<<<<<<<<<<<<<
 *     cdef Py_ssize_t i, j, nleft, nright
 *     cdef ndarray[int64_t, ndim=1] indexer
 */
    values[2] = ((PyObject *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_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 (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_old)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_new)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("pad_float64", 0, 2, 3, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 259; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_limit);
          if (value) { values[2] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "pad_float64") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 259; __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_old = ((PyArrayObject *)values[0]);
    __pyx_v_new = ((PyArrayObject *)values[1]);
    __pyx_v_limit = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("pad_float64", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 259; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas.algos.pad_float64", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_old), __pyx_ptype_5numpy_ndarray, 1, "old", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 259; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_new), __pyx_ptype_5numpy_ndarray, 1, "new", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 259; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_114pad_float64(__pyx_self, __pyx_v_old, __pyx_v_new, __pyx_v_limit);

  /* "pandas/src/generated.pyx":259
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def pad_float64(ndarray[float64_t] old, ndarray[float64_t] new,             # <<<<<<<<<<<<<<
 *                    limit=None):
 *     cdef Py_ssize_t i, j, nleft, nright
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pandas_5algos_114pad_float64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_old, PyArrayObject *__pyx_v_new, PyObject *__pyx_v_limit) {
  Py_ssize_t __pyx_v_i;
  Py_ssize_t __pyx_v_j;
  Py_ssize_t __pyx_v_nleft;
  Py_ssize_t __pyx_v_nright;
  PyArrayObject *__pyx_v_indexer = 0;
  __pyx_t_5numpy_float64_t __pyx_v_cur;
  __pyx_t_5numpy_float64_t __pyx_v_next;
  int __pyx_v_lim;
  int __pyx_v_fill_count;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_indexer;
  __Pyx_Buffer __pyx_pybuffer_indexer;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_new;
  __Pyx_Buffer __pyx_pybuffer_new;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_old;
  __Pyx_Buffer __pyx_pybuffer_old;
  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;
  long __pyx_t_14;
  int __pyx_t_15;
  int __pyx_t_16;
  long __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_float64_t __pyx_t_25;
  Py_ssize_t __pyx_t_26;
  Py_ssize_t __pyx_t_27;
  Py_ssize_t __pyx_t_28;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("pad_float64", 0);
  __pyx_pybuffer_indexer.pybuffer.buf = NULL;
  __pyx_pybuffer_indexer.refcount = 0;
  __pyx_pybuffernd_indexer.data = NULL;
  __pyx_pybuffernd_indexer.rcbuffer = &__pyx_pybuffer_indexer;
  __pyx_pybuffer_old.pybuffer.buf = NULL;
  __pyx_pybuffer_old.refcount = 0;
  __pyx_pybuffernd_old.data = NULL;
  __pyx_pybuffernd_old.rcbuffer = &__pyx_pybuffer_old;
  __pyx_pybuffer_new.pybuffer.buf = NULL;
  __pyx_pybuffer_new.refcount = 0;
  __pyx_pybuffernd_new.data = NULL;
  __pyx_pybuffernd_new.rcbuffer = &__pyx_pybuffer_new;
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_old.rcbuffer->pybuffer, (PyObject*)__pyx_v_old, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, 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_pybuffernd_old.diminfo[0].strides = __pyx_pybuffernd_old.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_old.diminfo[0].shape = __pyx_pybuffernd_old.rcbuffer->pybuffer.shape[0];
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_new.rcbuffer->pybuffer, (PyObject*)__pyx_v_new, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, 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_pybuffernd_new.diminfo[0].strides = __pyx_pybuffernd_new.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_new.diminfo[0].shape = __pyx_pybuffernd_new.rcbuffer->pybuffer.shape[0];

  /* "pandas/src/generated.pyx":264
 *     cdef ndarray[int64_t, ndim=1] indexer
 *     cdef float64_t cur, next
 *     cdef int lim, fill_count = 0             # <<<<<<<<<<<<<<
 * 
 *     nleft = len(old)
 */
  __pyx_v_fill_count = 0;

  /* "pandas/src/generated.pyx":266
 *     cdef int lim, fill_count = 0
 * 
 *     nleft = len(old)             # <<<<<<<<<<<<<<
 *     nright = len(new)
 *     indexer = np.empty(nright, dtype=np.int64)
 */
  __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_old)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 266; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_nleft = __pyx_t_1;

  /* "pandas/src/generated.pyx":267
 * 
 *     nleft = len(old)
 *     nright = len(new)             # <<<<<<<<<<<<<<
 *     indexer = np.empty(nright, dtype=np.int64)
 *     indexer.fill(-1)
 */
  __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_new)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 267; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_nright = __pyx_t_1;

  /* "pandas/src/generated.pyx":268
 *     nleft = len(old)
 *     nright = len(new)
 *     indexer = np.empty(nright, dtype=np.int64)             # <<<<<<<<<<<<<<
 *     indexer.fill(-1)
 * 
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 268; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_empty); 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_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_nright); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 268; __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 = 268; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__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 = 268; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 268; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_int64); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 268; __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, __pyx_n_s_dtype, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 268; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 268; __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_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__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 = 268; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_7 = ((PyArrayObject *)__pyx_t_6);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer);
    __pyx_t_8 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer, (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_pybuffernd_indexer.rcbuffer->pybuffer, (PyObject*)__pyx_v_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_pybuffernd_indexer.diminfo[0].strides = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_indexer.diminfo[0].shape = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.shape[0];
    if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 268; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_7 = 0;
  __pyx_v_indexer = ((PyArrayObject *)__pyx_t_6);
  __pyx_t_6 = 0;

  /* "pandas/src/generated.pyx":269
 *     nright = len(new)
 *     indexer = np.empty(nright, dtype=np.int64)
 *     indexer.fill(-1)             # <<<<<<<<<<<<<<
 * 
 *     if limit is None:
 */
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_indexer), __pyx_n_s_fill); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 269; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_tuple__50, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 269; __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/generated.pyx":271
 *     indexer.fill(-1)
 * 
 *     if limit is None:             # <<<<<<<<<<<<<<
 *         lim = nright
 *     else:
 */
  __pyx_t_12 = (__pyx_v_limit == Py_None);
  __pyx_t_13 = (__pyx_t_12 != 0);
  if (__pyx_t_13) {

    /* "pandas/src/generated.pyx":272
 * 
 *     if limit is None:
 *         lim = nright             # <<<<<<<<<<<<<<
 *     else:
 *         if limit < 0:
 */
    __pyx_v_lim = __pyx_v_nright;
    goto __pyx_L3;
  }
  /*else*/ {

    /* "pandas/src/generated.pyx":274
 *         lim = nright
 *     else:
 *         if limit < 0:             # <<<<<<<<<<<<<<
 *             raise ValueError('Limit must be non-negative')
 *         lim = limit
 */
    __pyx_t_2 = PyObject_RichCompare(__pyx_v_limit, __pyx_int_0, Py_LT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 274; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_13 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_13 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 274; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (__pyx_t_13) {

      /* "pandas/src/generated.pyx":275
 *     else:
 *         if limit < 0:
 *             raise ValueError('Limit must be non-negative')             # <<<<<<<<<<<<<<
 *         lim = limit
 * 
 */
      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__51, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 275; __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 = 275; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }

    /* "pandas/src/generated.pyx":276
 *         if limit < 0:
 *             raise ValueError('Limit must be non-negative')
 *         lim = limit             # <<<<<<<<<<<<<<
 * 
 *     if nleft == 0 or nright == 0 or new[nright - 1] < old[0]:
 */
    __pyx_t_8 = __Pyx_PyInt_As_int(__pyx_v_limit); if (unlikely((__pyx_t_8 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 276; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_v_lim = __pyx_t_8;
  }
  __pyx_L3:;

  /* "pandas/src/generated.pyx":278
 *         lim = limit
 * 
 *     if nleft == 0 or nright == 0 or new[nright - 1] < old[0]:             # <<<<<<<<<<<<<<
 *         return indexer
 * 
 */
  __pyx_t_13 = ((__pyx_v_nleft == 0) != 0);
  if (!__pyx_t_13) {
    __pyx_t_12 = ((__pyx_v_nright == 0) != 0);
    if (!__pyx_t_12) {
      __pyx_t_1 = (__pyx_v_nright - 1);
      __pyx_t_14 = 0;
      __pyx_t_15 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_new.rcbuffer->pybuffer.buf, __pyx_t_1, __pyx_pybuffernd_new.diminfo[0].strides)) < (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_old.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_old.diminfo[0].strides))) != 0);
      __pyx_t_16 = __pyx_t_15;
    } else {
      __pyx_t_16 = __pyx_t_12;
    }
    __pyx_t_12 = __pyx_t_16;
  } else {
    __pyx_t_12 = __pyx_t_13;
  }
  if (__pyx_t_12) {

    /* "pandas/src/generated.pyx":279
 * 
 *     if nleft == 0 or nright == 0 or new[nright - 1] < old[0]:
 *         return indexer             # <<<<<<<<<<<<<<
 * 
 *     i = j = 0
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(((PyObject *)__pyx_v_indexer));
    __pyx_r = ((PyObject *)__pyx_v_indexer);
    goto __pyx_L0;
  }

  /* "pandas/src/generated.pyx":281
 *         return indexer
 * 
 *     i = j = 0             # <<<<<<<<<<<<<<
 * 
 *     cur = old[0]
 */
  __pyx_v_i = 0;
  __pyx_v_j = 0;

  /* "pandas/src/generated.pyx":283
 *     i = j = 0
 * 
 *     cur = old[0]             # <<<<<<<<<<<<<<
 * 
 *     while j <= nright - 1 and new[j] < cur:
 */
  __pyx_t_17 = 0;
  __pyx_v_cur = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_old.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_old.diminfo[0].strides));

  /* "pandas/src/generated.pyx":285
 *     cur = old[0]
 * 
 *     while j <= nright - 1 and new[j] < cur:             # <<<<<<<<<<<<<<
 *         j += 1
 * 
 */
  while (1) {
    __pyx_t_12 = ((__pyx_v_j <= (__pyx_v_nright - 1)) != 0);
    if (__pyx_t_12) {
      __pyx_t_18 = __pyx_v_j;
      __pyx_t_13 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_new.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_new.diminfo[0].strides)) < __pyx_v_cur) != 0);
      __pyx_t_16 = __pyx_t_13;
    } else {
      __pyx_t_16 = __pyx_t_12;
    }
    if (!__pyx_t_16) break;

    /* "pandas/src/generated.pyx":286
 * 
 *     while j <= nright - 1 and new[j] < cur:
 *         j += 1             # <<<<<<<<<<<<<<
 * 
 *     while True:
 */
    __pyx_v_j = (__pyx_v_j + 1);
  }

  /* "pandas/src/generated.pyx":288
 *         j += 1
 * 
 *     while True:             # <<<<<<<<<<<<<<
 *         if j == nright:
 *             break
 */
  while (1) {

    /* "pandas/src/generated.pyx":289
 * 
 *     while True:
 *         if j == nright:             # <<<<<<<<<<<<<<
 *             break
 * 
 */
    __pyx_t_16 = ((__pyx_v_j == __pyx_v_nright) != 0);
    if (__pyx_t_16) {

      /* "pandas/src/generated.pyx":290
 *     while True:
 *         if j == nright:
 *             break             # <<<<<<<<<<<<<<
 * 
 *         if i == nleft - 1:
 */
      goto __pyx_L9_break;
    }

    /* "pandas/src/generated.pyx":292
 *             break
 * 
 *         if i == nleft - 1:             # <<<<<<<<<<<<<<
 *             while j < nright:
 *                 if new[j] == cur:
 */
    __pyx_t_16 = ((__pyx_v_i == (__pyx_v_nleft - 1)) != 0);
    if (__pyx_t_16) {

      /* "pandas/src/generated.pyx":293
 * 
 *         if i == nleft - 1:
 *             while j < nright:             # <<<<<<<<<<<<<<
 *                 if new[j] == cur:
 *                     indexer[j] = i
 */
      while (1) {
        __pyx_t_16 = ((__pyx_v_j < __pyx_v_nright) != 0);
        if (!__pyx_t_16) break;

        /* "pandas/src/generated.pyx":294
 *         if i == nleft - 1:
 *             while j < nright:
 *                 if new[j] == cur:             # <<<<<<<<<<<<<<
 *                     indexer[j] = i
 *                 elif new[j] > cur and fill_count < lim:
 */
        __pyx_t_19 = __pyx_v_j;
        __pyx_t_16 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_new.rcbuffer->pybuffer.buf, __pyx_t_19, __pyx_pybuffernd_new.diminfo[0].strides)) == __pyx_v_cur) != 0);
        if (__pyx_t_16) {

          /* "pandas/src/generated.pyx":295
 *             while j < nright:
 *                 if new[j] == cur:
 *                     indexer[j] = i             # <<<<<<<<<<<<<<
 *                 elif new[j] > cur and fill_count < lim:
 *                     indexer[j] = i
 */
          __pyx_t_20 = __pyx_v_j;
          *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_indexer.diminfo[0].strides) = __pyx_v_i;
          goto __pyx_L14;
        }

        /* "pandas/src/generated.pyx":296
 *                 if new[j] == cur:
 *                     indexer[j] = i
 *                 elif new[j] > cur and fill_count < lim:             # <<<<<<<<<<<<<<
 *                     indexer[j] = i
 *                     fill_count += 1
 */
        __pyx_t_21 = __pyx_v_j;
        __pyx_t_16 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_new.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_new.diminfo[0].strides)) > __pyx_v_cur) != 0);
        if (__pyx_t_16) {
          __pyx_t_12 = ((__pyx_v_fill_count < __pyx_v_lim) != 0);
          __pyx_t_13 = __pyx_t_12;
        } else {
          __pyx_t_13 = __pyx_t_16;
        }
        if (__pyx_t_13) {

          /* "pandas/src/generated.pyx":297
 *                     indexer[j] = i
 *                 elif new[j] > cur and fill_count < lim:
 *                     indexer[j] = i             # <<<<<<<<<<<<<<
 *                     fill_count += 1
 *                 j += 1
 */
          __pyx_t_22 = __pyx_v_j;
          *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_22, __pyx_pybuffernd_indexer.diminfo[0].strides) = __pyx_v_i;

          /* "pandas/src/generated.pyx":298
 *                 elif new[j] > cur and fill_count < lim:
 *                     indexer[j] = i
 *                     fill_count += 1             # <<<<<<<<<<<<<<
 *                 j += 1
 *             break
 */
          __pyx_v_fill_count = (__pyx_v_fill_count + 1);
          goto __pyx_L14;
        }
        __pyx_L14:;

        /* "pandas/src/generated.pyx":299
 *                     indexer[j] = i
 *                     fill_count += 1
 *                 j += 1             # <<<<<<<<<<<<<<
 *             break
 * 
 */
        __pyx_v_j = (__pyx_v_j + 1);
      }

      /* "pandas/src/generated.pyx":300
 *                     fill_count += 1
 *                 j += 1
 *             break             # <<<<<<<<<<<<<<
 * 
 *         next = old[i + 1]
 */
      goto __pyx_L9_break;
    }

    /* "pandas/src/generated.pyx":302
 *             break
 * 
 *         next = old[i + 1]             # <<<<<<<<<<<<<<
 * 
 *         while j < nright and cur <= new[j] < next:
 */
    __pyx_t_23 = (__pyx_v_i + 1);
    __pyx_v_next = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_old.rcbuffer->pybuffer.buf, __pyx_t_23, __pyx_pybuffernd_old.diminfo[0].strides));

    /* "pandas/src/generated.pyx":304
 *         next = old[i + 1]
 * 
 *         while j < nright and cur <= new[j] < next:             # <<<<<<<<<<<<<<
 *             if new[j] == cur:
 *                 indexer[j] = i
 */
    while (1) {
      __pyx_t_13 = ((__pyx_v_j < __pyx_v_nright) != 0);
      if (__pyx_t_13) {
        __pyx_t_24 = __pyx_v_j;
        __pyx_t_25 = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_new.rcbuffer->pybuffer.buf, __pyx_t_24, __pyx_pybuffernd_new.diminfo[0].strides));
        __pyx_t_16 = (__pyx_v_cur <= __pyx_t_25);
        if (__pyx_t_16) {
          __pyx_t_16 = (__pyx_t_25 < __pyx_v_next);
        }
        __pyx_t_12 = (__pyx_t_16 != 0);
      } else {
        __pyx_t_12 = __pyx_t_13;
      }
      if (!__pyx_t_12) break;

      /* "pandas/src/generated.pyx":305
 * 
 *         while j < nright and cur <= new[j] < next:
 *             if new[j] == cur:             # <<<<<<<<<<<<<<
 *                 indexer[j] = i
 *             elif fill_count < lim:
 */
      __pyx_t_26 = __pyx_v_j;
      __pyx_t_12 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_new.rcbuffer->pybuffer.buf, __pyx_t_26, __pyx_pybuffernd_new.diminfo[0].strides)) == __pyx_v_cur) != 0);
      if (__pyx_t_12) {

        /* "pandas/src/generated.pyx":306
 *         while j < nright and cur <= new[j] < next:
 *             if new[j] == cur:
 *                 indexer[j] = i             # <<<<<<<<<<<<<<
 *             elif fill_count < lim:
 *                 indexer[j] = i
 */
        __pyx_t_27 = __pyx_v_j;
        *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_27, __pyx_pybuffernd_indexer.diminfo[0].strides) = __pyx_v_i;
        goto __pyx_L17;
      }

      /* "pandas/src/generated.pyx":307
 *             if new[j] == cur:
 *                 indexer[j] = i
 *             elif fill_count < lim:             # <<<<<<<<<<<<<<
 *                 indexer[j] = i
 *                 fill_count += 1
 */
      __pyx_t_12 = ((__pyx_v_fill_count < __pyx_v_lim) != 0);
      if (__pyx_t_12) {

        /* "pandas/src/generated.pyx":308
 *                 indexer[j] = i
 *             elif fill_count < lim:
 *                 indexer[j] = i             # <<<<<<<<<<<<<<
 *                 fill_count += 1
 *             j += 1
 */
        __pyx_t_28 = __pyx_v_j;
        *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_28, __pyx_pybuffernd_indexer.diminfo[0].strides) = __pyx_v_i;

        /* "pandas/src/generated.pyx":309
 *             elif fill_count < lim:
 *                 indexer[j] = i
 *                 fill_count += 1             # <<<<<<<<<<<<<<
 *             j += 1
 * 
 */
        __pyx_v_fill_count = (__pyx_v_fill_count + 1);
        goto __pyx_L17;
      }
      __pyx_L17:;

      /* "pandas/src/generated.pyx":310
 *                 indexer[j] = i
 *                 fill_count += 1
 *             j += 1             # <<<<<<<<<<<<<<
 * 
 *         fill_count = 0
 */
      __pyx_v_j = (__pyx_v_j + 1);
    }

    /* "pandas/src/generated.pyx":312
 *             j += 1
 * 
 *         fill_count = 0             # <<<<<<<<<<<<<<
 *         i += 1
 *         cur = next
 */
    __pyx_v_fill_count = 0;

    /* "pandas/src/generated.pyx":313
 * 
 *         fill_count = 0
 *         i += 1             # <<<<<<<<<<<<<<
 *         cur = next
 * 
 */
    __pyx_v_i = (__pyx_v_i + 1);

    /* "pandas/src/generated.pyx":314
 *         fill_count = 0
 *         i += 1
 *         cur = next             # <<<<<<<<<<<<<<
 * 
 *     return indexer
 */
    __pyx_v_cur = __pyx_v_next;
  }
  __pyx_L9_break:;

  /* "pandas/src/generated.pyx":316
 *         cur = next
 * 
 *     return indexer             # <<<<<<<<<<<<<<
 * 
 * @cython.boundscheck(False)
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_indexer));
  __pyx_r = ((PyObject *)__pyx_v_indexer);
  goto __pyx_L0;

  /* "pandas/src/generated.pyx":259
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def pad_float64(ndarray[float64_t] old, ndarray[float64_t] new,             # <<<<<<<<<<<<<<
 *                    limit=None):
 *     cdef Py_ssize_t i, j, nleft, nright
 */

  /* function exit code */
  __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_pybuffernd_indexer.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_new.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_old.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas.algos.pad_float64", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_new.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_old.rcbuffer->pybuffer);
  __pyx_L2:;
  __Pyx_XDECREF((PyObject *)__pyx_v_indexer);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/src/generated.pyx":320
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def pad_float32(ndarray[float32_t] old, ndarray[float32_t] new,             # <<<<<<<<<<<<<<
 *                    limit=None):
 *     cdef Py_ssize_t i, j, nleft, nright
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pandas_5algos_117pad_float32(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_5algos_117pad_float32 = {__Pyx_NAMESTR("pad_float32"), (PyCFunction)__pyx_pw_6pandas_5algos_117pad_float32, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pw_6pandas_5algos_117pad_float32(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyArrayObject *__pyx_v_old = 0;
  PyArrayObject *__pyx_v_new = 0;
  PyObject *__pyx_v_limit = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("pad_float32 (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_old,&__pyx_n_s_new,&__pyx_n_s_limit,0};
    PyObject* values[3] = {0,0,0};

    /* "pandas/src/generated.pyx":321
 * @cython.wraparound(False)
 * def pad_float32(ndarray[float32_t] old, ndarray[float32_t] new,
 *                    limit=None):             # <<<<<<<<<<<<<<
 *     cdef Py_ssize_t i, j, nleft, nright
 *     cdef ndarray[int64_t, ndim=1] indexer
 */
    values[2] = ((PyObject *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_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 (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_old)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_new)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("pad_float32", 0, 2, 3, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 320; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_limit);
          if (value) { values[2] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "pad_float32") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 320; __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_old = ((PyArrayObject *)values[0]);
    __pyx_v_new = ((PyArrayObject *)values[1]);
    __pyx_v_limit = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("pad_float32", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 320; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas.algos.pad_float32", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_old), __pyx_ptype_5numpy_ndarray, 1, "old", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 320; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_new), __pyx_ptype_5numpy_ndarray, 1, "new", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 320; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_116pad_float32(__pyx_self, __pyx_v_old, __pyx_v_new, __pyx_v_limit);

  /* "pandas/src/generated.pyx":320
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def pad_float32(ndarray[float32_t] old, ndarray[float32_t] new,             # <<<<<<<<<<<<<<
 *                    limit=None):
 *     cdef Py_ssize_t i, j, nleft, nright
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pandas_5algos_116pad_float32(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_old, PyArrayObject *__pyx_v_new, PyObject *__pyx_v_limit) {
  Py_ssize_t __pyx_v_i;
  Py_ssize_t __pyx_v_j;
  Py_ssize_t __pyx_v_nleft;
  Py_ssize_t __pyx_v_nright;
  PyArrayObject *__pyx_v_indexer = 0;
  __pyx_t_5numpy_float32_t __pyx_v_cur;
  __pyx_t_5numpy_float32_t __pyx_v_next;
  int __pyx_v_lim;
  int __pyx_v_fill_count;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_indexer;
  __Pyx_Buffer __pyx_pybuffer_indexer;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_new;
  __Pyx_Buffer __pyx_pybuffer_new;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_old;
  __Pyx_Buffer __pyx_pybuffer_old;
  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;
  long __pyx_t_14;
  int __pyx_t_15;
  int __pyx_t_16;
  long __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_float32_t __pyx_t_25;
  Py_ssize_t __pyx_t_26;
  Py_ssize_t __pyx_t_27;
  Py_ssize_t __pyx_t_28;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("pad_float32", 0);
  __pyx_pybuffer_indexer.pybuffer.buf = NULL;
  __pyx_pybuffer_indexer.refcount = 0;
  __pyx_pybuffernd_indexer.data = NULL;
  __pyx_pybuffernd_indexer.rcbuffer = &__pyx_pybuffer_indexer;
  __pyx_pybuffer_old.pybuffer.buf = NULL;
  __pyx_pybuffer_old.refcount = 0;
  __pyx_pybuffernd_old.data = NULL;
  __pyx_pybuffernd_old.rcbuffer = &__pyx_pybuffer_old;
  __pyx_pybuffer_new.pybuffer.buf = NULL;
  __pyx_pybuffer_new.refcount = 0;
  __pyx_pybuffernd_new.data = NULL;
  __pyx_pybuffernd_new.rcbuffer = &__pyx_pybuffer_new;
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_old.rcbuffer->pybuffer, (PyObject*)__pyx_v_old, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 320; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_old.diminfo[0].strides = __pyx_pybuffernd_old.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_old.diminfo[0].shape = __pyx_pybuffernd_old.rcbuffer->pybuffer.shape[0];
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_new.rcbuffer->pybuffer, (PyObject*)__pyx_v_new, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 320; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_new.diminfo[0].strides = __pyx_pybuffernd_new.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_new.diminfo[0].shape = __pyx_pybuffernd_new.rcbuffer->pybuffer.shape[0];

  /* "pandas/src/generated.pyx":325
 *     cdef ndarray[int64_t, ndim=1] indexer
 *     cdef float32_t cur, next
 *     cdef int lim, fill_count = 0             # <<<<<<<<<<<<<<
 * 
 *     nleft = len(old)
 */
  __pyx_v_fill_count = 0;

  /* "pandas/src/generated.pyx":327
 *     cdef int lim, fill_count = 0
 * 
 *     nleft = len(old)             # <<<<<<<<<<<<<<
 *     nright = len(new)
 *     indexer = np.empty(nright, dtype=np.int64)
 */
  __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_old)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 327; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_nleft = __pyx_t_1;

  /* "pandas/src/generated.pyx":328
 * 
 *     nleft = len(old)
 *     nright = len(new)             # <<<<<<<<<<<<<<
 *     indexer = np.empty(nright, dtype=np.int64)
 *     indexer.fill(-1)
 */
  __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_new)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 328; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_nright = __pyx_t_1;

  /* "pandas/src/generated.pyx":329
 *     nleft = len(old)
 *     nright = len(new)
 *     indexer = np.empty(nright, dtype=np.int64)             # <<<<<<<<<<<<<<
 *     indexer.fill(-1)
 * 
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 329; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_empty); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 329; __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_nright); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 329; __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 = 329; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__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 = 329; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 329; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_int64); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 329; __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, __pyx_n_s_dtype, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 329; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 329; __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_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__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 = 329; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_7 = ((PyArrayObject *)__pyx_t_6);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer);
    __pyx_t_8 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer, (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_pybuffernd_indexer.rcbuffer->pybuffer, (PyObject*)__pyx_v_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_pybuffernd_indexer.diminfo[0].strides = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_indexer.diminfo[0].shape = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.shape[0];
    if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 329; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_7 = 0;
  __pyx_v_indexer = ((PyArrayObject *)__pyx_t_6);
  __pyx_t_6 = 0;

  /* "pandas/src/generated.pyx":330
 *     nright = len(new)
 *     indexer = np.empty(nright, dtype=np.int64)
 *     indexer.fill(-1)             # <<<<<<<<<<<<<<
 * 
 *     if limit is None:
 */
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_indexer), __pyx_n_s_fill); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 330; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_tuple__52, NULL); 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_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pandas/src/generated.pyx":332
 *     indexer.fill(-1)
 * 
 *     if limit is None:             # <<<<<<<<<<<<<<
 *         lim = nright
 *     else:
 */
  __pyx_t_12 = (__pyx_v_limit == Py_None);
  __pyx_t_13 = (__pyx_t_12 != 0);
  if (__pyx_t_13) {

    /* "pandas/src/generated.pyx":333
 * 
 *     if limit is None:
 *         lim = nright             # <<<<<<<<<<<<<<
 *     else:
 *         if limit < 0:
 */
    __pyx_v_lim = __pyx_v_nright;
    goto __pyx_L3;
  }
  /*else*/ {

    /* "pandas/src/generated.pyx":335
 *         lim = nright
 *     else:
 *         if limit < 0:             # <<<<<<<<<<<<<<
 *             raise ValueError('Limit must be non-negative')
 *         lim = limit
 */
    __pyx_t_2 = PyObject_RichCompare(__pyx_v_limit, __pyx_int_0, Py_LT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 335; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_13 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_13 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 335; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (__pyx_t_13) {

      /* "pandas/src/generated.pyx":336
 *     else:
 *         if limit < 0:
 *             raise ValueError('Limit must be non-negative')             # <<<<<<<<<<<<<<
 *         lim = limit
 * 
 */
      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__53, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 336; __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 = 336; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }

    /* "pandas/src/generated.pyx":337
 *         if limit < 0:
 *             raise ValueError('Limit must be non-negative')
 *         lim = limit             # <<<<<<<<<<<<<<
 * 
 *     if nleft == 0 or nright == 0 or new[nright - 1] < old[0]:
 */
    __pyx_t_8 = __Pyx_PyInt_As_int(__pyx_v_limit); if (unlikely((__pyx_t_8 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 337; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_v_lim = __pyx_t_8;
  }
  __pyx_L3:;

  /* "pandas/src/generated.pyx":339
 *         lim = limit
 * 
 *     if nleft == 0 or nright == 0 or new[nright - 1] < old[0]:             # <<<<<<<<<<<<<<
 *         return indexer
 * 
 */
  __pyx_t_13 = ((__pyx_v_nleft == 0) != 0);
  if (!__pyx_t_13) {
    __pyx_t_12 = ((__pyx_v_nright == 0) != 0);
    if (!__pyx_t_12) {
      __pyx_t_1 = (__pyx_v_nright - 1);
      __pyx_t_14 = 0;
      __pyx_t_15 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_new.rcbuffer->pybuffer.buf, __pyx_t_1, __pyx_pybuffernd_new.diminfo[0].strides)) < (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_old.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_old.diminfo[0].strides))) != 0);
      __pyx_t_16 = __pyx_t_15;
    } else {
      __pyx_t_16 = __pyx_t_12;
    }
    __pyx_t_12 = __pyx_t_16;
  } else {
    __pyx_t_12 = __pyx_t_13;
  }
  if (__pyx_t_12) {

    /* "pandas/src/generated.pyx":340
 * 
 *     if nleft == 0 or nright == 0 or new[nright - 1] < old[0]:
 *         return indexer             # <<<<<<<<<<<<<<
 * 
 *     i = j = 0
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(((PyObject *)__pyx_v_indexer));
    __pyx_r = ((PyObject *)__pyx_v_indexer);
    goto __pyx_L0;
  }

  /* "pandas/src/generated.pyx":342
 *         return indexer
 * 
 *     i = j = 0             # <<<<<<<<<<<<<<
 * 
 *     cur = old[0]
 */
  __pyx_v_i = 0;
  __pyx_v_j = 0;

  /* "pandas/src/generated.pyx":344
 *     i = j = 0
 * 
 *     cur = old[0]             # <<<<<<<<<<<<<<
 * 
 *     while j <= nright - 1 and new[j] < cur:
 */
  __pyx_t_17 = 0;
  __pyx_v_cur = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_old.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_old.diminfo[0].strides));

  /* "pandas/src/generated.pyx":346
 *     cur = old[0]
 * 
 *     while j <= nright - 1 and new[j] < cur:             # <<<<<<<<<<<<<<
 *         j += 1
 * 
 */
  while (1) {
    __pyx_t_12 = ((__pyx_v_j <= (__pyx_v_nright - 1)) != 0);
    if (__pyx_t_12) {
      __pyx_t_18 = __pyx_v_j;
      __pyx_t_13 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_new.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_new.diminfo[0].strides)) < __pyx_v_cur) != 0);
      __pyx_t_16 = __pyx_t_13;
    } else {
      __pyx_t_16 = __pyx_t_12;
    }
    if (!__pyx_t_16) break;

    /* "pandas/src/generated.pyx":347
 * 
 *     while j <= nright - 1 and new[j] < cur:
 *         j += 1             # <<<<<<<<<<<<<<
 * 
 *     while True:
 */
    __pyx_v_j = (__pyx_v_j + 1);
  }

  /* "pandas/src/generated.pyx":349
 *         j += 1
 * 
 *     while True:             # <<<<<<<<<<<<<<
 *         if j == nright:
 *             break
 */
  while (1) {

    /* "pandas/src/generated.pyx":350
 * 
 *     while True:
 *         if j == nright:             # <<<<<<<<<<<<<<
 *             break
 * 
 */
    __pyx_t_16 = ((__pyx_v_j == __pyx_v_nright) != 0);
    if (__pyx_t_16) {

      /* "pandas/src/generated.pyx":351
 *     while True:
 *         if j == nright:
 *             break             # <<<<<<<<<<<<<<
 * 
 *         if i == nleft - 1:
 */
      goto __pyx_L9_break;
    }

    /* "pandas/src/generated.pyx":353
 *             break
 * 
 *         if i == nleft - 1:             # <<<<<<<<<<<<<<
 *             while j < nright:
 *                 if new[j] == cur:
 */
    __pyx_t_16 = ((__pyx_v_i == (__pyx_v_nleft - 1)) != 0);
    if (__pyx_t_16) {

      /* "pandas/src/generated.pyx":354
 * 
 *         if i == nleft - 1:
 *             while j < nright:             # <<<<<<<<<<<<<<
 *                 if new[j] == cur:
 *                     indexer[j] = i
 */
      while (1) {
        __pyx_t_16 = ((__pyx_v_j < __pyx_v_nright) != 0);
        if (!__pyx_t_16) break;

        /* "pandas/src/generated.pyx":355
 *         if i == nleft - 1:
 *             while j < nright:
 *                 if new[j] == cur:             # <<<<<<<<<<<<<<
 *                     indexer[j] = i
 *                 elif new[j] > cur and fill_count < lim:
 */
        __pyx_t_19 = __pyx_v_j;
        __pyx_t_16 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_new.rcbuffer->pybuffer.buf, __pyx_t_19, __pyx_pybuffernd_new.diminfo[0].strides)) == __pyx_v_cur) != 0);
        if (__pyx_t_16) {

          /* "pandas/src/generated.pyx":356
 *             while j < nright:
 *                 if new[j] == cur:
 *                     indexer[j] = i             # <<<<<<<<<<<<<<
 *                 elif new[j] > cur and fill_count < lim:
 *                     indexer[j] = i
 */
          __pyx_t_20 = __pyx_v_j;
          *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_indexer.diminfo[0].strides) = __pyx_v_i;
          goto __pyx_L14;
        }

        /* "pandas/src/generated.pyx":357
 *                 if new[j] == cur:
 *                     indexer[j] = i
 *                 elif new[j] > cur and fill_count < lim:             # <<<<<<<<<<<<<<
 *                     indexer[j] = i
 *                     fill_count += 1
 */
        __pyx_t_21 = __pyx_v_j;
        __pyx_t_16 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_new.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_new.diminfo[0].strides)) > __pyx_v_cur) != 0);
        if (__pyx_t_16) {
          __pyx_t_12 = ((__pyx_v_fill_count < __pyx_v_lim) != 0);
          __pyx_t_13 = __pyx_t_12;
        } else {
          __pyx_t_13 = __pyx_t_16;
        }
        if (__pyx_t_13) {

          /* "pandas/src/generated.pyx":358
 *                     indexer[j] = i
 *                 elif new[j] > cur and fill_count < lim:
 *                     indexer[j] = i             # <<<<<<<<<<<<<<
 *                     fill_count += 1
 *                 j += 1
 */
          __pyx_t_22 = __pyx_v_j;
          *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_22, __pyx_pybuffernd_indexer.diminfo[0].strides) = __pyx_v_i;

          /* "pandas/src/generated.pyx":359
 *                 elif new[j] > cur and fill_count < lim:
 *                     indexer[j] = i
 *                     fill_count += 1             # <<<<<<<<<<<<<<
 *                 j += 1
 *             break
 */
          __pyx_v_fill_count = (__pyx_v_fill_count + 1);
          goto __pyx_L14;
        }
        __pyx_L14:;

        /* "pandas/src/generated.pyx":360
 *                     indexer[j] = i
 *                     fill_count += 1
 *                 j += 1             # <<<<<<<<<<<<<<
 *             break
 * 
 */
        __pyx_v_j = (__pyx_v_j + 1);
      }

      /* "pandas/src/generated.pyx":361
 *                     fill_count += 1
 *                 j += 1
 *             break             # <<<<<<<<<<<<<<
 * 
 *         next = old[i + 1]
 */
      goto __pyx_L9_break;
    }

    /* "pandas/src/generated.pyx":363
 *             break
 * 
 *         next = old[i + 1]             # <<<<<<<<<<<<<<
 * 
 *         while j < nright and cur <= new[j] < next:
 */
    __pyx_t_23 = (__pyx_v_i + 1);
    __pyx_v_next = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_old.rcbuffer->pybuffer.buf, __pyx_t_23, __pyx_pybuffernd_old.diminfo[0].strides));

    /* "pandas/src/generated.pyx":365
 *         next = old[i + 1]
 * 
 *         while j < nright and cur <= new[j] < next:             # <<<<<<<<<<<<<<
 *             if new[j] == cur:
 *                 indexer[j] = i
 */
    while (1) {
      __pyx_t_13 = ((__pyx_v_j < __pyx_v_nright) != 0);
      if (__pyx_t_13) {
        __pyx_t_24 = __pyx_v_j;
        __pyx_t_25 = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_new.rcbuffer->pybuffer.buf, __pyx_t_24, __pyx_pybuffernd_new.diminfo[0].strides));
        __pyx_t_16 = (__pyx_v_cur <= __pyx_t_25);
        if (__pyx_t_16) {
          __pyx_t_16 = (__pyx_t_25 < __pyx_v_next);
        }
        __pyx_t_12 = (__pyx_t_16 != 0);
      } else {
        __pyx_t_12 = __pyx_t_13;
      }
      if (!__pyx_t_12) break;

      /* "pandas/src/generated.pyx":366
 * 
 *         while j < nright and cur <= new[j] < next:
 *             if new[j] == cur:             # <<<<<<<<<<<<<<
 *                 indexer[j] = i
 *             elif fill_count < lim:
 */
      __pyx_t_26 = __pyx_v_j;
      __pyx_t_12 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_new.rcbuffer->pybuffer.buf, __pyx_t_26, __pyx_pybuffernd_new.diminfo[0].strides)) == __pyx_v_cur) != 0);
      if (__pyx_t_12) {

        /* "pandas/src/generated.pyx":367
 *         while j < nright and cur <= new[j] < next:
 *             if new[j] == cur:
 *                 indexer[j] = i             # <<<<<<<<<<<<<<
 *             elif fill_count < lim:
 *                 indexer[j] = i
 */
        __pyx_t_27 = __pyx_v_j;
        *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_27, __pyx_pybuffernd_indexer.diminfo[0].strides) = __pyx_v_i;
        goto __pyx_L17;
      }

      /* "pandas/src/generated.pyx":368
 *             if new[j] == cur:
 *                 indexer[j] = i
 *             elif fill_count < lim:             # <<<<<<<<<<<<<<
 *                 indexer[j] = i
 *                 fill_count += 1
 */
      __pyx_t_12 = ((__pyx_v_fill_count < __pyx_v_lim) != 0);
      if (__pyx_t_12) {

        /* "pandas/src/generated.pyx":369
 *                 indexer[j] = i
 *             elif fill_count < lim:
 *                 indexer[j] = i             # <<<<<<<<<<<<<<
 *                 fill_count += 1
 *             j += 1
 */
        __pyx_t_28 = __pyx_v_j;
        *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_28, __pyx_pybuffernd_indexer.diminfo[0].strides) = __pyx_v_i;

        /* "pandas/src/generated.pyx":370
 *             elif fill_count < lim:
 *                 indexer[j] = i
 *                 fill_count += 1             # <<<<<<<<<<<<<<
 *             j += 1
 * 
 */
        __pyx_v_fill_count = (__pyx_v_fill_count + 1);
        goto __pyx_L17;
      }
      __pyx_L17:;

      /* "pandas/src/generated.pyx":371
 *                 indexer[j] = i
 *                 fill_count += 1
 *             j += 1             # <<<<<<<<<<<<<<
 * 
 *         fill_count = 0
 */
      __pyx_v_j = (__pyx_v_j + 1);
    }

    /* "pandas/src/generated.pyx":373
 *             j += 1
 * 
 *         fill_count = 0             # <<<<<<<<<<<<<<
 *         i += 1
 *         cur = next
 */
    __pyx_v_fill_count = 0;

    /* "pandas/src/generated.pyx":374
 * 
 *         fill_count = 0
 *         i += 1             # <<<<<<<<<<<<<<
 *         cur = next
 * 
 */
    __pyx_v_i = (__pyx_v_i + 1);

    /* "pandas/src/generated.pyx":375
 *         fill_count = 0
 *         i += 1
 *         cur = next             # <<<<<<<<<<<<<<
 * 
 *     return indexer
 */
    __pyx_v_cur = __pyx_v_next;
  }
  __pyx_L9_break:;

  /* "pandas/src/generated.pyx":377
 *         cur = next
 * 
 *     return indexer             # <<<<<<<<<<<<<<
 * 
 * @cython.boundscheck(False)
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_indexer));
  __pyx_r = ((PyObject *)__pyx_v_indexer);
  goto __pyx_L0;

  /* "pandas/src/generated.pyx":320
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def pad_float32(ndarray[float32_t] old, ndarray[float32_t] new,             # <<<<<<<<<<<<<<
 *                    limit=None):
 *     cdef Py_ssize_t i, j, nleft, nright
 */

  /* function exit code */
  __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_pybuffernd_indexer.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_new.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_old.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas.algos.pad_float32", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_new.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_old.rcbuffer->pybuffer);
  __pyx_L2:;
  __Pyx_XDECREF((PyObject *)__pyx_v_indexer);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/src/generated.pyx":381
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def pad_object(ndarray[object] old, ndarray[object] new,             # <<<<<<<<<<<<<<
 *                    limit=None):
 *     cdef Py_ssize_t i, j, nleft, nright
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pandas_5algos_119pad_object(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_5algos_119pad_object = {__Pyx_NAMESTR("pad_object"), (PyCFunction)__pyx_pw_6pandas_5algos_119pad_object, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pw_6pandas_5algos_119pad_object(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyArrayObject *__pyx_v_old = 0;
  PyArrayObject *__pyx_v_new = 0;
  PyObject *__pyx_v_limit = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("pad_object (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_old,&__pyx_n_s_new,&__pyx_n_s_limit,0};
    PyObject* values[3] = {0,0,0};

    /* "pandas/src/generated.pyx":382
 * @cython.wraparound(False)
 * def pad_object(ndarray[object] old, ndarray[object] new,
 *                    limit=None):             # <<<<<<<<<<<<<<
 *     cdef Py_ssize_t i, j, nleft, nright
 *     cdef ndarray[int64_t, ndim=1] indexer
 */
    values[2] = ((PyObject *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_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 (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_old)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_new)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("pad_object", 0, 2, 3, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 381; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_limit);
          if (value) { values[2] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "pad_object") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 381; __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_old = ((PyArrayObject *)values[0]);
    __pyx_v_new = ((PyArrayObject *)values[1]);
    __pyx_v_limit = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("pad_object", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 381; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas.algos.pad_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_old), __pyx_ptype_5numpy_ndarray, 1, "old", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 381; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_new), __pyx_ptype_5numpy_ndarray, 1, "new", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 381; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_118pad_object(__pyx_self, __pyx_v_old, __pyx_v_new, __pyx_v_limit);

  /* "pandas/src/generated.pyx":381
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def pad_object(ndarray[object] old, ndarray[object] new,             # <<<<<<<<<<<<<<
 *                    limit=None):
 *     cdef Py_ssize_t i, j, nleft, nright
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pandas_5algos_118pad_object(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_old, PyArrayObject *__pyx_v_new, PyObject *__pyx_v_limit) {
  Py_ssize_t __pyx_v_i;
  Py_ssize_t __pyx_v_j;
  Py_ssize_t __pyx_v_nleft;
  Py_ssize_t __pyx_v_nright;
  PyArrayObject *__pyx_v_indexer = 0;
  PyObject *__pyx_v_cur = 0;
  PyObject *__pyx_v_next = 0;
  int __pyx_v_lim;
  int __pyx_v_fill_count;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_indexer;
  __Pyx_Buffer __pyx_pybuffer_indexer;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_new;
  __Pyx_Buffer __pyx_pybuffer_new;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_old;
  __Pyx_Buffer __pyx_pybuffer_old;
  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;
  long __pyx_t_14;
  int __pyx_t_15;
  int __pyx_t_16;
  long __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;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("pad_object", 0);
  __pyx_pybuffer_indexer.pybuffer.buf = NULL;
  __pyx_pybuffer_indexer.refcount = 0;
  __pyx_pybuffernd_indexer.data = NULL;
  __pyx_pybuffernd_indexer.rcbuffer = &__pyx_pybuffer_indexer;
  __pyx_pybuffer_old.pybuffer.buf = NULL;
  __pyx_pybuffer_old.refcount = 0;
  __pyx_pybuffernd_old.data = NULL;
  __pyx_pybuffernd_old.rcbuffer = &__pyx_pybuffer_old;
  __pyx_pybuffer_new.pybuffer.buf = NULL;
  __pyx_pybuffer_new.refcount = 0;
  __pyx_pybuffernd_new.data = NULL;
  __pyx_pybuffernd_new.rcbuffer = &__pyx_pybuffer_new;
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_old.rcbuffer->pybuffer, (PyObject*)__pyx_v_old, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 381; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_old.diminfo[0].strides = __pyx_pybuffernd_old.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_old.diminfo[0].shape = __pyx_pybuffernd_old.rcbuffer->pybuffer.shape[0];
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_new.rcbuffer->pybuffer, (PyObject*)__pyx_v_new, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 381; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_new.diminfo[0].strides = __pyx_pybuffernd_new.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_new.diminfo[0].shape = __pyx_pybuffernd_new.rcbuffer->pybuffer.shape[0];

  /* "pandas/src/generated.pyx":386
 *     cdef ndarray[int64_t, ndim=1] indexer
 *     cdef object cur, next
 *     cdef int lim, fill_count = 0             # <<<<<<<<<<<<<<
 * 
 *     nleft = len(old)
 */
  __pyx_v_fill_count = 0;

  /* "pandas/src/generated.pyx":388
 *     cdef int lim, fill_count = 0
 * 
 *     nleft = len(old)             # <<<<<<<<<<<<<<
 *     nright = len(new)
 *     indexer = np.empty(nright, dtype=np.int64)
 */
  __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_old)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 388; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_nleft = __pyx_t_1;

  /* "pandas/src/generated.pyx":389
 * 
 *     nleft = len(old)
 *     nright = len(new)             # <<<<<<<<<<<<<<
 *     indexer = np.empty(nright, dtype=np.int64)
 *     indexer.fill(-1)
 */
  __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_new)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 389; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_nright = __pyx_t_1;

  /* "pandas/src/generated.pyx":390
 *     nleft = len(old)
 *     nright = len(new)
 *     indexer = np.empty(nright, dtype=np.int64)             # <<<<<<<<<<<<<<
 *     indexer.fill(-1)
 * 
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 390; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_empty); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 390; __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_nright); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 390; __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 = 390; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__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 = 390; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 390; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_int64); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 390; __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, __pyx_n_s_dtype, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 390; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 390; __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_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__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 = 390; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_7 = ((PyArrayObject *)__pyx_t_6);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer);
    __pyx_t_8 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer, (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_pybuffernd_indexer.rcbuffer->pybuffer, (PyObject*)__pyx_v_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_pybuffernd_indexer.diminfo[0].strides = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_indexer.diminfo[0].shape = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.shape[0];
    if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 390; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_7 = 0;
  __pyx_v_indexer = ((PyArrayObject *)__pyx_t_6);
  __pyx_t_6 = 0;

  /* "pandas/src/generated.pyx":391
 *     nright = len(new)
 *     indexer = np.empty(nright, dtype=np.int64)
 *     indexer.fill(-1)             # <<<<<<<<<<<<<<
 * 
 *     if limit is None:
 */
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_indexer), __pyx_n_s_fill); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 391; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_tuple__54, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 391; __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/generated.pyx":393
 *     indexer.fill(-1)
 * 
 *     if limit is None:             # <<<<<<<<<<<<<<
 *         lim = nright
 *     else:
 */
  __pyx_t_12 = (__pyx_v_limit == Py_None);
  __pyx_t_13 = (__pyx_t_12 != 0);
  if (__pyx_t_13) {

    /* "pandas/src/generated.pyx":394
 * 
 *     if limit is None:
 *         lim = nright             # <<<<<<<<<<<<<<
 *     else:
 *         if limit < 0:
 */
    __pyx_v_lim = __pyx_v_nright;
    goto __pyx_L3;
  }
  /*else*/ {

    /* "pandas/src/generated.pyx":396
 *         lim = nright
 *     else:
 *         if limit < 0:             # <<<<<<<<<<<<<<
 *             raise ValueError('Limit must be non-negative')
 *         lim = limit
 */
    __pyx_t_2 = PyObject_RichCompare(__pyx_v_limit, __pyx_int_0, Py_LT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 396; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_13 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_13 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 396; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (__pyx_t_13) {

      /* "pandas/src/generated.pyx":397
 *     else:
 *         if limit < 0:
 *             raise ValueError('Limit must be non-negative')             # <<<<<<<<<<<<<<
 *         lim = limit
 * 
 */
      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__55, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 397; __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 = 397; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }

    /* "pandas/src/generated.pyx":398
 *         if limit < 0:
 *             raise ValueError('Limit must be non-negative')
 *         lim = limit             # <<<<<<<<<<<<<<
 * 
 *     if nleft == 0 or nright == 0 or new[nright - 1] < old[0]:
 */
    __pyx_t_8 = __Pyx_PyInt_As_int(__pyx_v_limit); if (unlikely((__pyx_t_8 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 398; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_v_lim = __pyx_t_8;
  }
  __pyx_L3:;

  /* "pandas/src/generated.pyx":400
 *         lim = limit
 * 
 *     if nleft == 0 or nright == 0 or new[nright - 1] < old[0]:             # <<<<<<<<<<<<<<
 *         return indexer
 * 
 */
  __pyx_t_13 = (__pyx_v_nleft == 0);
  if (!__pyx_t_13) {
    __pyx_t_12 = (__pyx_v_nright == 0);
    if (!__pyx_t_12) {
      __pyx_t_1 = (__pyx_v_nright - 1);
      __pyx_t_2 = (PyObject *) *__Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_new.rcbuffer->pybuffer.buf, __pyx_t_1, __pyx_pybuffernd_new.diminfo[0].strides);
      __Pyx_INCREF((PyObject*)__pyx_t_2);
      __pyx_t_14 = 0;
      __pyx_t_6 = (PyObject *) *__Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_old.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_old.diminfo[0].strides);
      __Pyx_INCREF((PyObject*)__pyx_t_6);
      __pyx_t_4 = PyObject_RichCompare(__pyx_t_2, __pyx_t_6, Py_LT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 400; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_15 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_15 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 400; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_16 = __pyx_t_15;
    } else {
      __pyx_t_16 = __pyx_t_12;
    }
    __pyx_t_12 = __pyx_t_16;
  } else {
    __pyx_t_12 = __pyx_t_13;
  }
  if (__pyx_t_12) {

    /* "pandas/src/generated.pyx":401
 * 
 *     if nleft == 0 or nright == 0 or new[nright - 1] < old[0]:
 *         return indexer             # <<<<<<<<<<<<<<
 * 
 *     i = j = 0
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(((PyObject *)__pyx_v_indexer));
    __pyx_r = ((PyObject *)__pyx_v_indexer);
    goto __pyx_L0;
  }

  /* "pandas/src/generated.pyx":403
 *         return indexer
 * 
 *     i = j = 0             # <<<<<<<<<<<<<<
 * 
 *     cur = old[0]
 */
  __pyx_v_i = 0;
  __pyx_v_j = 0;

  /* "pandas/src/generated.pyx":405
 *     i = j = 0
 * 
 *     cur = old[0]             # <<<<<<<<<<<<<<
 * 
 *     while j <= nright - 1 and new[j] < cur:
 */
  __pyx_t_17 = 0;
  __pyx_t_4 = (PyObject *) *__Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_old.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_old.diminfo[0].strides);
  __Pyx_INCREF((PyObject*)__pyx_t_4);
  __pyx_v_cur = __pyx_t_4;
  __pyx_t_4 = 0;

  /* "pandas/src/generated.pyx":407
 *     cur = old[0]
 * 
 *     while j <= nright - 1 and new[j] < cur:             # <<<<<<<<<<<<<<
 *         j += 1
 * 
 */
  while (1) {
    __pyx_t_12 = (__pyx_v_j <= (__pyx_v_nright - 1));
    if (__pyx_t_12) {
      __pyx_t_18 = __pyx_v_j;
      __pyx_t_4 = (PyObject *) *__Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_new.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_new.diminfo[0].strides);
      __Pyx_INCREF((PyObject*)__pyx_t_4);
      __pyx_t_6 = PyObject_RichCompare(__pyx_t_4, __pyx_v_cur, Py_LT); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 407; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_13 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_13 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 407; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_16 = __pyx_t_13;
    } else {
      __pyx_t_16 = __pyx_t_12;
    }
    if (!__pyx_t_16) break;

    /* "pandas/src/generated.pyx":408
 * 
 *     while j <= nright - 1 and new[j] < cur:
 *         j += 1             # <<<<<<<<<<<<<<
 * 
 *     while True:
 */
    __pyx_v_j = (__pyx_v_j + 1);
  }

  /* "pandas/src/generated.pyx":410
 *         j += 1
 * 
 *     while True:             # <<<<<<<<<<<<<<
 *         if j == nright:
 *             break
 */
  while (1) {

    /* "pandas/src/generated.pyx":411
 * 
 *     while True:
 *         if j == nright:             # <<<<<<<<<<<<<<
 *             break
 * 
 */
    __pyx_t_16 = ((__pyx_v_j == __pyx_v_nright) != 0);
    if (__pyx_t_16) {

      /* "pandas/src/generated.pyx":412
 *     while True:
 *         if j == nright:
 *             break             # <<<<<<<<<<<<<<
 * 
 *         if i == nleft - 1:
 */
      goto __pyx_L9_break;
    }

    /* "pandas/src/generated.pyx":414
 *             break
 * 
 *         if i == nleft - 1:             # <<<<<<<<<<<<<<
 *             while j < nright:
 *                 if new[j] == cur:
 */
    __pyx_t_16 = ((__pyx_v_i == (__pyx_v_nleft - 1)) != 0);
    if (__pyx_t_16) {

      /* "pandas/src/generated.pyx":415
 * 
 *         if i == nleft - 1:
 *             while j < nright:             # <<<<<<<<<<<<<<
 *                 if new[j] == cur:
 *                     indexer[j] = i
 */
      while (1) {
        __pyx_t_16 = ((__pyx_v_j < __pyx_v_nright) != 0);
        if (!__pyx_t_16) break;

        /* "pandas/src/generated.pyx":416
 *         if i == nleft - 1:
 *             while j < nright:
 *                 if new[j] == cur:             # <<<<<<<<<<<<<<
 *                     indexer[j] = i
 *                 elif new[j] > cur and fill_count < lim:
 */
        __pyx_t_19 = __pyx_v_j;
        __pyx_t_6 = (PyObject *) *__Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_new.rcbuffer->pybuffer.buf, __pyx_t_19, __pyx_pybuffernd_new.diminfo[0].strides);
        __Pyx_INCREF((PyObject*)__pyx_t_6);
        __pyx_t_4 = PyObject_RichCompare(__pyx_t_6, __pyx_v_cur, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 416; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __pyx_t_16 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_16 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 416; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        if (__pyx_t_16) {

          /* "pandas/src/generated.pyx":417
 *             while j < nright:
 *                 if new[j] == cur:
 *                     indexer[j] = i             # <<<<<<<<<<<<<<
 *                 elif new[j] > cur and fill_count < lim:
 *                     indexer[j] = i
 */
          __pyx_t_20 = __pyx_v_j;
          *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_indexer.diminfo[0].strides) = __pyx_v_i;
          goto __pyx_L14;
        }

        /* "pandas/src/generated.pyx":418
 *                 if new[j] == cur:
 *                     indexer[j] = i
 *                 elif new[j] > cur and fill_count < lim:             # <<<<<<<<<<<<<<
 *                     indexer[j] = i
 *                     fill_count += 1
 */
        __pyx_t_21 = __pyx_v_j;
        __pyx_t_4 = (PyObject *) *__Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_new.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_new.diminfo[0].strides);
        __Pyx_INCREF((PyObject*)__pyx_t_4);
        __pyx_t_6 = PyObject_RichCompare(__pyx_t_4, __pyx_v_cur, Py_GT); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 418; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __pyx_t_16 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_16 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 418; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        if (__pyx_t_16) {
          __pyx_t_12 = (__pyx_v_fill_count < __pyx_v_lim);
          __pyx_t_13 = __pyx_t_12;
        } else {
          __pyx_t_13 = __pyx_t_16;
        }
        if (__pyx_t_13) {

          /* "pandas/src/generated.pyx":419
 *                     indexer[j] = i
 *                 elif new[j] > cur and fill_count < lim:
 *                     indexer[j] = i             # <<<<<<<<<<<<<<
 *                     fill_count += 1
 *                 j += 1
 */
          __pyx_t_22 = __pyx_v_j;
          *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_22, __pyx_pybuffernd_indexer.diminfo[0].strides) = __pyx_v_i;

          /* "pandas/src/generated.pyx":420
 *                 elif new[j] > cur and fill_count < lim:
 *                     indexer[j] = i
 *                     fill_count += 1             # <<<<<<<<<<<<<<
 *                 j += 1
 *             break
 */
          __pyx_v_fill_count = (__pyx_v_fill_count + 1);
          goto __pyx_L14;
        }
        __pyx_L14:;

        /* "pandas/src/generated.pyx":421
 *                     indexer[j] = i
 *                     fill_count += 1
 *                 j += 1             # <<<<<<<<<<<<<<
 *             break
 * 
 */
        __pyx_v_j = (__pyx_v_j + 1);
      }

      /* "pandas/src/generated.pyx":422
 *                     fill_count += 1
 *                 j += 1
 *             break             # <<<<<<<<<<<<<<
 * 
 *         next = old[i + 1]
 */
      goto __pyx_L9_break;
    }

    /* "pandas/src/generated.pyx":424
 *             break
 * 
 *         next = old[i + 1]             # <<<<<<<<<<<<<<
 * 
 *         while j < nright and cur <= new[j] < next:
 */
    __pyx_t_23 = (__pyx_v_i + 1);
    __pyx_t_6 = (PyObject *) *__Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_old.rcbuffer->pybuffer.buf, __pyx_t_23, __pyx_pybuffernd_old.diminfo[0].strides);
    __Pyx_INCREF((PyObject*)__pyx_t_6);
    __Pyx_XDECREF_SET(__pyx_v_next, __pyx_t_6);
    __pyx_t_6 = 0;

    /* "pandas/src/generated.pyx":426
 *         next = old[i + 1]
 * 
 *         while j < nright and cur <= new[j] < next:             # <<<<<<<<<<<<<<
 *             if new[j] == cur:
 *                 indexer[j] = i
 */
    while (1) {
      __pyx_t_13 = (__pyx_v_j < __pyx_v_nright);
      if (__pyx_t_13) {
        __pyx_t_24 = __pyx_v_j;
        __pyx_t_6 = (PyObject *) *__Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_new.rcbuffer->pybuffer.buf, __pyx_t_24, __pyx_pybuffernd_new.diminfo[0].strides);
        __Pyx_INCREF((PyObject*)__pyx_t_6);
        __pyx_t_4 = PyObject_RichCompare(__pyx_v_cur, __pyx_t_6, Py_LE); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 426; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        if (__Pyx_PyObject_IsTrue(__pyx_t_4)) {
          __Pyx_DECREF(__pyx_t_4);
          __pyx_t_4 = PyObject_RichCompare(__pyx_t_6, __pyx_v_next, Py_LT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 426; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __pyx_t_16 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_16 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 426; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __pyx_t_12 = __pyx_t_16;
      } else {
        __pyx_t_12 = __pyx_t_13;
      }
      if (!__pyx_t_12) break;

      /* "pandas/src/generated.pyx":427
 * 
 *         while j < nright and cur <= new[j] < next:
 *             if new[j] == cur:             # <<<<<<<<<<<<<<
 *                 indexer[j] = i
 *             elif fill_count < lim:
 */
      __pyx_t_25 = __pyx_v_j;
      __pyx_t_4 = (PyObject *) *__Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_new.rcbuffer->pybuffer.buf, __pyx_t_25, __pyx_pybuffernd_new.diminfo[0].strides);
      __Pyx_INCREF((PyObject*)__pyx_t_4);
      __pyx_t_6 = PyObject_RichCompare(__pyx_t_4, __pyx_v_cur, Py_EQ); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 427; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_12 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 427; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (__pyx_t_12) {

        /* "pandas/src/generated.pyx":428
 *         while j < nright and cur <= new[j] < next:
 *             if new[j] == cur:
 *                 indexer[j] = i             # <<<<<<<<<<<<<<
 *             elif fill_count < lim:
 *                 indexer[j] = i
 */
        __pyx_t_26 = __pyx_v_j;
        *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_26, __pyx_pybuffernd_indexer.diminfo[0].strides) = __pyx_v_i;
        goto __pyx_L17;
      }

      /* "pandas/src/generated.pyx":429
 *             if new[j] == cur:
 *                 indexer[j] = i
 *             elif fill_count < lim:             # <<<<<<<<<<<<<<
 *                 indexer[j] = i
 *                 fill_count += 1
 */
      __pyx_t_12 = ((__pyx_v_fill_count < __pyx_v_lim) != 0);
      if (__pyx_t_12) {

        /* "pandas/src/generated.pyx":430
 *                 indexer[j] = i
 *             elif fill_count < lim:
 *                 indexer[j] = i             # <<<<<<<<<<<<<<
 *                 fill_count += 1
 *             j += 1
 */
        __pyx_t_27 = __pyx_v_j;
        *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_27, __pyx_pybuffernd_indexer.diminfo[0].strides) = __pyx_v_i;

        /* "pandas/src/generated.pyx":431
 *             elif fill_count < lim:
 *                 indexer[j] = i
 *                 fill_count += 1             # <<<<<<<<<<<<<<
 *             j += 1
 * 
 */
        __pyx_v_fill_count = (__pyx_v_fill_count + 1);
        goto __pyx_L17;
      }
      __pyx_L17:;

      /* "pandas/src/generated.pyx":432
 *                 indexer[j] = i
 *                 fill_count += 1
 *             j += 1             # <<<<<<<<<<<<<<
 * 
 *         fill_count = 0
 */
      __pyx_v_j = (__pyx_v_j + 1);
    }

    /* "pandas/src/generated.pyx":434
 *             j += 1
 * 
 *         fill_count = 0             # <<<<<<<<<<<<<<
 *         i += 1
 *         cur = next
 */
    __pyx_v_fill_count = 0;

    /* "pandas/src/generated.pyx":435
 * 
 *         fill_count = 0
 *         i += 1             # <<<<<<<<<<<<<<
 *         cur = next
 * 
 */
    __pyx_v_i = (__pyx_v_i + 1);

    /* "pandas/src/generated.pyx":436
 *         fill_count = 0
 *         i += 1
 *         cur = next             # <<<<<<<<<<<<<<
 * 
 *     return indexer
 */
    __Pyx_INCREF(__pyx_v_next);
    __Pyx_DECREF_SET(__pyx_v_cur, __pyx_v_next);
  }
  __pyx_L9_break:;

  /* "pandas/src/generated.pyx":438
 *         cur = next
 * 
 *     return indexer             # <<<<<<<<<<<<<<
 * 
 * @cython.boundscheck(False)
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_indexer));
  __pyx_r = ((PyObject *)__pyx_v_indexer);
  goto __pyx_L0;

  /* "pandas/src/generated.pyx":381
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def pad_object(ndarray[object] old, ndarray[object] new,             # <<<<<<<<<<<<<<
 *                    limit=None):
 *     cdef Py_ssize_t i, j, nleft, nright
 */

  /* function exit code */
  __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_pybuffernd_indexer.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_new.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_old.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas.algos.pad_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_new.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_old.rcbuffer->pybuffer);
  __pyx_L2:;
  __Pyx_XDECREF((PyObject *)__pyx_v_indexer);
  __Pyx_XDECREF(__pyx_v_cur);
  __Pyx_XDECREF(__pyx_v_next);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/src/generated.pyx":442
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def pad_int32(ndarray[int32_t] old, ndarray[int32_t] new,             # <<<<<<<<<<<<<<
 *                    limit=None):
 *     cdef Py_ssize_t i, j, nleft, nright
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pandas_5algos_121pad_int32(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_5algos_121pad_int32 = {__Pyx_NAMESTR("pad_int32"), (PyCFunction)__pyx_pw_6pandas_5algos_121pad_int32, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pw_6pandas_5algos_121pad_int32(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyArrayObject *__pyx_v_old = 0;
  PyArrayObject *__pyx_v_new = 0;
  PyObject *__pyx_v_limit = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("pad_int32 (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_old,&__pyx_n_s_new,&__pyx_n_s_limit,0};
    PyObject* values[3] = {0,0,0};

    /* "pandas/src/generated.pyx":443
 * @cython.wraparound(False)
 * def pad_int32(ndarray[int32_t] old, ndarray[int32_t] new,
 *                    limit=None):             # <<<<<<<<<<<<<<
 *     cdef Py_ssize_t i, j, nleft, nright
 *     cdef ndarray[int64_t, ndim=1] indexer
 */
    values[2] = ((PyObject *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_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 (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_old)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_new)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("pad_int32", 0, 2, 3, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 442; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_limit);
          if (value) { values[2] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "pad_int32") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 442; __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_old = ((PyArrayObject *)values[0]);
    __pyx_v_new = ((PyArrayObject *)values[1]);
    __pyx_v_limit = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("pad_int32", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 442; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas.algos.pad_int32", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_old), __pyx_ptype_5numpy_ndarray, 1, "old", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 442; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_new), __pyx_ptype_5numpy_ndarray, 1, "new", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 442; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_120pad_int32(__pyx_self, __pyx_v_old, __pyx_v_new, __pyx_v_limit);

  /* "pandas/src/generated.pyx":442
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def pad_int32(ndarray[int32_t] old, ndarray[int32_t] new,             # <<<<<<<<<<<<<<
 *                    limit=None):
 *     cdef Py_ssize_t i, j, nleft, nright
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pandas_5algos_120pad_int32(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_old, PyArrayObject *__pyx_v_new, PyObject *__pyx_v_limit) {
  Py_ssize_t __pyx_v_i;
  Py_ssize_t __pyx_v_j;
  Py_ssize_t __pyx_v_nleft;
  Py_ssize_t __pyx_v_nright;
  PyArrayObject *__pyx_v_indexer = 0;
  __pyx_t_5numpy_int32_t __pyx_v_cur;
  __pyx_t_5numpy_int32_t __pyx_v_next;
  int __pyx_v_lim;
  int __pyx_v_fill_count;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_indexer;
  __Pyx_Buffer __pyx_pybuffer_indexer;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_new;
  __Pyx_Buffer __pyx_pybuffer_new;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_old;
  __Pyx_Buffer __pyx_pybuffer_old;
  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;
  long __pyx_t_14;
  int __pyx_t_15;
  int __pyx_t_16;
  long __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_int32_t __pyx_t_25;
  Py_ssize_t __pyx_t_26;
  Py_ssize_t __pyx_t_27;
  Py_ssize_t __pyx_t_28;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("pad_int32", 0);
  __pyx_pybuffer_indexer.pybuffer.buf = NULL;
  __pyx_pybuffer_indexer.refcount = 0;
  __pyx_pybuffernd_indexer.data = NULL;
  __pyx_pybuffernd_indexer.rcbuffer = &__pyx_pybuffer_indexer;
  __pyx_pybuffer_old.pybuffer.buf = NULL;
  __pyx_pybuffer_old.refcount = 0;
  __pyx_pybuffernd_old.data = NULL;
  __pyx_pybuffernd_old.rcbuffer = &__pyx_pybuffer_old;
  __pyx_pybuffer_new.pybuffer.buf = NULL;
  __pyx_pybuffer_new.refcount = 0;
  __pyx_pybuffernd_new.data = NULL;
  __pyx_pybuffernd_new.rcbuffer = &__pyx_pybuffer_new;
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_old.rcbuffer->pybuffer, (PyObject*)__pyx_v_old, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 442; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_old.diminfo[0].strides = __pyx_pybuffernd_old.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_old.diminfo[0].shape = __pyx_pybuffernd_old.rcbuffer->pybuffer.shape[0];
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_new.rcbuffer->pybuffer, (PyObject*)__pyx_v_new, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 442; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_new.diminfo[0].strides = __pyx_pybuffernd_new.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_new.diminfo[0].shape = __pyx_pybuffernd_new.rcbuffer->pybuffer.shape[0];

  /* "pandas/src/generated.pyx":447
 *     cdef ndarray[int64_t, ndim=1] indexer
 *     cdef int32_t cur, next
 *     cdef int lim, fill_count = 0             # <<<<<<<<<<<<<<
 * 
 *     nleft = len(old)
 */
  __pyx_v_fill_count = 0;

  /* "pandas/src/generated.pyx":449
 *     cdef int lim, fill_count = 0
 * 
 *     nleft = len(old)             # <<<<<<<<<<<<<<
 *     nright = len(new)
 *     indexer = np.empty(nright, dtype=np.int64)
 */
  __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_old)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 449; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_nleft = __pyx_t_1;

  /* "pandas/src/generated.pyx":450
 * 
 *     nleft = len(old)
 *     nright = len(new)             # <<<<<<<<<<<<<<
 *     indexer = np.empty(nright, dtype=np.int64)
 *     indexer.fill(-1)
 */
  __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_new)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 450; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_nright = __pyx_t_1;

  /* "pandas/src/generated.pyx":451
 *     nleft = len(old)
 *     nright = len(new)
 *     indexer = np.empty(nright, dtype=np.int64)             # <<<<<<<<<<<<<<
 *     indexer.fill(-1)
 * 
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 451; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_empty); 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_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_nright); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 451; __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 = 451; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__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 = 451; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 451; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_int64); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 451; __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, __pyx_n_s_dtype, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 451; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 451; __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_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__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 = 451; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_7 = ((PyArrayObject *)__pyx_t_6);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer);
    __pyx_t_8 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer, (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_pybuffernd_indexer.rcbuffer->pybuffer, (PyObject*)__pyx_v_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_pybuffernd_indexer.diminfo[0].strides = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_indexer.diminfo[0].shape = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.shape[0];
    if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 451; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_7 = 0;
  __pyx_v_indexer = ((PyArrayObject *)__pyx_t_6);
  __pyx_t_6 = 0;

  /* "pandas/src/generated.pyx":452
 *     nright = len(new)
 *     indexer = np.empty(nright, dtype=np.int64)
 *     indexer.fill(-1)             # <<<<<<<<<<<<<<
 * 
 *     if limit is None:
 */
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_indexer), __pyx_n_s_fill); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 452; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_tuple__56, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 452; __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/generated.pyx":454
 *     indexer.fill(-1)
 * 
 *     if limit is None:             # <<<<<<<<<<<<<<
 *         lim = nright
 *     else:
 */
  __pyx_t_12 = (__pyx_v_limit == Py_None);
  __pyx_t_13 = (__pyx_t_12 != 0);
  if (__pyx_t_13) {

    /* "pandas/src/generated.pyx":455
 * 
 *     if limit is None:
 *         lim = nright             # <<<<<<<<<<<<<<
 *     else:
 *         if limit < 0:
 */
    __pyx_v_lim = __pyx_v_nright;
    goto __pyx_L3;
  }
  /*else*/ {

    /* "pandas/src/generated.pyx":457
 *         lim = nright
 *     else:
 *         if limit < 0:             # <<<<<<<<<<<<<<
 *             raise ValueError('Limit must be non-negative')
 *         lim = limit
 */
    __pyx_t_2 = PyObject_RichCompare(__pyx_v_limit, __pyx_int_0, Py_LT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 457; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_13 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_13 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 457; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (__pyx_t_13) {

      /* "pandas/src/generated.pyx":458
 *     else:
 *         if limit < 0:
 *             raise ValueError('Limit must be non-negative')             # <<<<<<<<<<<<<<
 *         lim = limit
 * 
 */
      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__57, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 458; __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 = 458; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }

    /* "pandas/src/generated.pyx":459
 *         if limit < 0:
 *             raise ValueError('Limit must be non-negative')
 *         lim = limit             # <<<<<<<<<<<<<<
 * 
 *     if nleft == 0 or nright == 0 or new[nright - 1] < old[0]:
 */
    __pyx_t_8 = __Pyx_PyInt_As_int(__pyx_v_limit); if (unlikely((__pyx_t_8 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 459; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_v_lim = __pyx_t_8;
  }
  __pyx_L3:;

  /* "pandas/src/generated.pyx":461
 *         lim = limit
 * 
 *     if nleft == 0 or nright == 0 or new[nright - 1] < old[0]:             # <<<<<<<<<<<<<<
 *         return indexer
 * 
 */
  __pyx_t_13 = ((__pyx_v_nleft == 0) != 0);
  if (!__pyx_t_13) {
    __pyx_t_12 = ((__pyx_v_nright == 0) != 0);
    if (!__pyx_t_12) {
      __pyx_t_1 = (__pyx_v_nright - 1);
      __pyx_t_14 = 0;
      __pyx_t_15 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_new.rcbuffer->pybuffer.buf, __pyx_t_1, __pyx_pybuffernd_new.diminfo[0].strides)) < (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_old.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_old.diminfo[0].strides))) != 0);
      __pyx_t_16 = __pyx_t_15;
    } else {
      __pyx_t_16 = __pyx_t_12;
    }
    __pyx_t_12 = __pyx_t_16;
  } else {
    __pyx_t_12 = __pyx_t_13;
  }
  if (__pyx_t_12) {

    /* "pandas/src/generated.pyx":462
 * 
 *     if nleft == 0 or nright == 0 or new[nright - 1] < old[0]:
 *         return indexer             # <<<<<<<<<<<<<<
 * 
 *     i = j = 0
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(((PyObject *)__pyx_v_indexer));
    __pyx_r = ((PyObject *)__pyx_v_indexer);
    goto __pyx_L0;
  }

  /* "pandas/src/generated.pyx":464
 *         return indexer
 * 
 *     i = j = 0             # <<<<<<<<<<<<<<
 * 
 *     cur = old[0]
 */
  __pyx_v_i = 0;
  __pyx_v_j = 0;

  /* "pandas/src/generated.pyx":466
 *     i = j = 0
 * 
 *     cur = old[0]             # <<<<<<<<<<<<<<
 * 
 *     while j <= nright - 1 and new[j] < cur:
 */
  __pyx_t_17 = 0;
  __pyx_v_cur = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_old.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_old.diminfo[0].strides));

  /* "pandas/src/generated.pyx":468
 *     cur = old[0]
 * 
 *     while j <= nright - 1 and new[j] < cur:             # <<<<<<<<<<<<<<
 *         j += 1
 * 
 */
  while (1) {
    __pyx_t_12 = ((__pyx_v_j <= (__pyx_v_nright - 1)) != 0);
    if (__pyx_t_12) {
      __pyx_t_18 = __pyx_v_j;
      __pyx_t_13 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_new.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_new.diminfo[0].strides)) < __pyx_v_cur) != 0);
      __pyx_t_16 = __pyx_t_13;
    } else {
      __pyx_t_16 = __pyx_t_12;
    }
    if (!__pyx_t_16) break;

    /* "pandas/src/generated.pyx":469
 * 
 *     while j <= nright - 1 and new[j] < cur:
 *         j += 1             # <<<<<<<<<<<<<<
 * 
 *     while True:
 */
    __pyx_v_j = (__pyx_v_j + 1);
  }

  /* "pandas/src/generated.pyx":471
 *         j += 1
 * 
 *     while True:             # <<<<<<<<<<<<<<
 *         if j == nright:
 *             break
 */
  while (1) {

    /* "pandas/src/generated.pyx":472
 * 
 *     while True:
 *         if j == nright:             # <<<<<<<<<<<<<<
 *             break
 * 
 */
    __pyx_t_16 = ((__pyx_v_j == __pyx_v_nright) != 0);
    if (__pyx_t_16) {

      /* "pandas/src/generated.pyx":473
 *     while True:
 *         if j == nright:
 *             break             # <<<<<<<<<<<<<<
 * 
 *         if i == nleft - 1:
 */
      goto __pyx_L9_break;
    }

    /* "pandas/src/generated.pyx":475
 *             break
 * 
 *         if i == nleft - 1:             # <<<<<<<<<<<<<<
 *             while j < nright:
 *                 if new[j] == cur:
 */
    __pyx_t_16 = ((__pyx_v_i == (__pyx_v_nleft - 1)) != 0);
    if (__pyx_t_16) {

      /* "pandas/src/generated.pyx":476
 * 
 *         if i == nleft - 1:
 *             while j < nright:             # <<<<<<<<<<<<<<
 *                 if new[j] == cur:
 *                     indexer[j] = i
 */
      while (1) {
        __pyx_t_16 = ((__pyx_v_j < __pyx_v_nright) != 0);
        if (!__pyx_t_16) break;

        /* "pandas/src/generated.pyx":477
 *         if i == nleft - 1:
 *             while j < nright:
 *                 if new[j] == cur:             # <<<<<<<<<<<<<<
 *                     indexer[j] = i
 *                 elif new[j] > cur and fill_count < lim:
 */
        __pyx_t_19 = __pyx_v_j;
        __pyx_t_16 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_new.rcbuffer->pybuffer.buf, __pyx_t_19, __pyx_pybuffernd_new.diminfo[0].strides)) == __pyx_v_cur) != 0);
        if (__pyx_t_16) {

          /* "pandas/src/generated.pyx":478
 *             while j < nright:
 *                 if new[j] == cur:
 *                     indexer[j] = i             # <<<<<<<<<<<<<<
 *                 elif new[j] > cur and fill_count < lim:
 *                     indexer[j] = i
 */
          __pyx_t_20 = __pyx_v_j;
          *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_indexer.diminfo[0].strides) = __pyx_v_i;
          goto __pyx_L14;
        }

        /* "pandas/src/generated.pyx":479
 *                 if new[j] == cur:
 *                     indexer[j] = i
 *                 elif new[j] > cur and fill_count < lim:             # <<<<<<<<<<<<<<
 *                     indexer[j] = i
 *                     fill_count += 1
 */
        __pyx_t_21 = __pyx_v_j;
        __pyx_t_16 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_new.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_new.diminfo[0].strides)) > __pyx_v_cur) != 0);
        if (__pyx_t_16) {
          __pyx_t_12 = ((__pyx_v_fill_count < __pyx_v_lim) != 0);
          __pyx_t_13 = __pyx_t_12;
        } else {
          __pyx_t_13 = __pyx_t_16;
        }
        if (__pyx_t_13) {

          /* "pandas/src/generated.pyx":480
 *                     indexer[j] = i
 *                 elif new[j] > cur and fill_count < lim:
 *                     indexer[j] = i             # <<<<<<<<<<<<<<
 *                     fill_count += 1
 *                 j += 1
 */
          __pyx_t_22 = __pyx_v_j;
          *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_22, __pyx_pybuffernd_indexer.diminfo[0].strides) = __pyx_v_i;

          /* "pandas/src/generated.pyx":481
 *                 elif new[j] > cur and fill_count < lim:
 *                     indexer[j] = i
 *                     fill_count += 1             # <<<<<<<<<<<<<<
 *                 j += 1
 *             break
 */
          __pyx_v_fill_count = (__pyx_v_fill_count + 1);
          goto __pyx_L14;
        }
        __pyx_L14:;

        /* "pandas/src/generated.pyx":482
 *                     indexer[j] = i
 *                     fill_count += 1
 *                 j += 1             # <<<<<<<<<<<<<<
 *             break
 * 
 */
        __pyx_v_j = (__pyx_v_j + 1);
      }

      /* "pandas/src/generated.pyx":483
 *                     fill_count += 1
 *                 j += 1
 *             break             # <<<<<<<<<<<<<<
 * 
 *         next = old[i + 1]
 */
      goto __pyx_L9_break;
    }

    /* "pandas/src/generated.pyx":485
 *             break
 * 
 *         next = old[i + 1]             # <<<<<<<<<<<<<<
 * 
 *         while j < nright and cur <= new[j] < next:
 */
    __pyx_t_23 = (__pyx_v_i + 1);
    __pyx_v_next = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_old.rcbuffer->pybuffer.buf, __pyx_t_23, __pyx_pybuffernd_old.diminfo[0].strides));

    /* "pandas/src/generated.pyx":487
 *         next = old[i + 1]
 * 
 *         while j < nright and cur <= new[j] < next:             # <<<<<<<<<<<<<<
 *             if new[j] == cur:
 *                 indexer[j] = i
 */
    while (1) {
      __pyx_t_13 = ((__pyx_v_j < __pyx_v_nright) != 0);
      if (__pyx_t_13) {
        __pyx_t_24 = __pyx_v_j;
        __pyx_t_25 = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_new.rcbuffer->pybuffer.buf, __pyx_t_24, __pyx_pybuffernd_new.diminfo[0].strides));
        __pyx_t_16 = (__pyx_v_cur <= __pyx_t_25);
        if (__pyx_t_16) {
          __pyx_t_16 = (__pyx_t_25 < __pyx_v_next);
        }
        __pyx_t_12 = (__pyx_t_16 != 0);
      } else {
        __pyx_t_12 = __pyx_t_13;
      }
      if (!__pyx_t_12) break;

      /* "pandas/src/generated.pyx":488
 * 
 *         while j < nright and cur <= new[j] < next:
 *             if new[j] == cur:             # <<<<<<<<<<<<<<
 *                 indexer[j] = i
 *             elif fill_count < lim:
 */
      __pyx_t_26 = __pyx_v_j;
      __pyx_t_12 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_new.rcbuffer->pybuffer.buf, __pyx_t_26, __pyx_pybuffernd_new.diminfo[0].strides)) == __pyx_v_cur) != 0);
      if (__pyx_t_12) {

        /* "pandas/src/generated.pyx":489
 *         while j < nright and cur <= new[j] < next:
 *             if new[j] == cur:
 *                 indexer[j] = i             # <<<<<<<<<<<<<<
 *             elif fill_count < lim:
 *                 indexer[j] = i
 */
        __pyx_t_27 = __pyx_v_j;
        *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_27, __pyx_pybuffernd_indexer.diminfo[0].strides) = __pyx_v_i;
        goto __pyx_L17;
      }

      /* "pandas/src/generated.pyx":490
 *             if new[j] == cur:
 *                 indexer[j] = i
 *             elif fill_count < lim:             # <<<<<<<<<<<<<<
 *                 indexer[j] = i
 *                 fill_count += 1
 */
      __pyx_t_12 = ((__pyx_v_fill_count < __pyx_v_lim) != 0);
      if (__pyx_t_12) {

        /* "pandas/src/generated.pyx":491
 *                 indexer[j] = i
 *             elif fill_count < lim:
 *                 indexer[j] = i             # <<<<<<<<<<<<<<
 *                 fill_count += 1
 *             j += 1
 */
        __pyx_t_28 = __pyx_v_j;
        *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_28, __pyx_pybuffernd_indexer.diminfo[0].strides) = __pyx_v_i;

        /* "pandas/src/generated.pyx":492
 *             elif fill_count < lim:
 *                 indexer[j] = i
 *                 fill_count += 1             # <<<<<<<<<<<<<<
 *             j += 1
 * 
 */
        __pyx_v_fill_count = (__pyx_v_fill_count + 1);
        goto __pyx_L17;
      }
      __pyx_L17:;

      /* "pandas/src/generated.pyx":493
 *                 indexer[j] = i
 *                 fill_count += 1
 *             j += 1             # <<<<<<<<<<<<<<
 * 
 *         fill_count = 0
 */
      __pyx_v_j = (__pyx_v_j + 1);
    }

    /* "pandas/src/generated.pyx":495
 *             j += 1
 * 
 *         fill_count = 0             # <<<<<<<<<<<<<<
 *         i += 1
 *         cur = next
 */
    __pyx_v_fill_count = 0;

    /* "pandas/src/generated.pyx":496
 * 
 *         fill_count = 0
 *         i += 1             # <<<<<<<<<<<<<<
 *         cur = next
 * 
 */
    __pyx_v_i = (__pyx_v_i + 1);

    /* "pandas/src/generated.pyx":497
 *         fill_count = 0
 *         i += 1
 *         cur = next             # <<<<<<<<<<<<<<
 * 
 *     return indexer
 */
    __pyx_v_cur = __pyx_v_next;
  }
  __pyx_L9_break:;

  /* "pandas/src/generated.pyx":499
 *         cur = next
 * 
 *     return indexer             # <<<<<<<<<<<<<<
 * 
 * @cython.boundscheck(False)
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_indexer));
  __pyx_r = ((PyObject *)__pyx_v_indexer);
  goto __pyx_L0;

  /* "pandas/src/generated.pyx":442
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def pad_int32(ndarray[int32_t] old, ndarray[int32_t] new,             # <<<<<<<<<<<<<<
 *                    limit=None):
 *     cdef Py_ssize_t i, j, nleft, nright
 */

  /* function exit code */
  __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_pybuffernd_indexer.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_new.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_old.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas.algos.pad_int32", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_new.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_old.rcbuffer->pybuffer);
  __pyx_L2:;
  __Pyx_XDECREF((PyObject *)__pyx_v_indexer);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/src/generated.pyx":503
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def pad_int64(ndarray[int64_t] old, ndarray[int64_t] new,             # <<<<<<<<<<<<<<
 *                    limit=None):
 *     cdef Py_ssize_t i, j, nleft, nright
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pandas_5algos_123pad_int64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_5algos_123pad_int64 = {__Pyx_NAMESTR("pad_int64"), (PyCFunction)__pyx_pw_6pandas_5algos_123pad_int64, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pw_6pandas_5algos_123pad_int64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyArrayObject *__pyx_v_old = 0;
  PyArrayObject *__pyx_v_new = 0;
  PyObject *__pyx_v_limit = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("pad_int64 (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_old,&__pyx_n_s_new,&__pyx_n_s_limit,0};
    PyObject* values[3] = {0,0,0};

    /* "pandas/src/generated.pyx":504
 * @cython.wraparound(False)
 * def pad_int64(ndarray[int64_t] old, ndarray[int64_t] new,
 *                    limit=None):             # <<<<<<<<<<<<<<
 *     cdef Py_ssize_t i, j, nleft, nright
 *     cdef ndarray[int64_t, ndim=1] indexer
 */
    values[2] = ((PyObject *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_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 (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_old)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_new)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("pad_int64", 0, 2, 3, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 503; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_limit);
          if (value) { values[2] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "pad_int64") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 503; __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_old = ((PyArrayObject *)values[0]);
    __pyx_v_new = ((PyArrayObject *)values[1]);
    __pyx_v_limit = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("pad_int64", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 503; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas.algos.pad_int64", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_old), __pyx_ptype_5numpy_ndarray, 1, "old", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 503; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_new), __pyx_ptype_5numpy_ndarray, 1, "new", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 503; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_122pad_int64(__pyx_self, __pyx_v_old, __pyx_v_new, __pyx_v_limit);

  /* "pandas/src/generated.pyx":503
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def pad_int64(ndarray[int64_t] old, ndarray[int64_t] new,             # <<<<<<<<<<<<<<
 *                    limit=None):
 *     cdef Py_ssize_t i, j, nleft, nright
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pandas_5algos_122pad_int64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_old, PyArrayObject *__pyx_v_new, PyObject *__pyx_v_limit) {
  Py_ssize_t __pyx_v_i;
  Py_ssize_t __pyx_v_j;
  Py_ssize_t __pyx_v_nleft;
  Py_ssize_t __pyx_v_nright;
  PyArrayObject *__pyx_v_indexer = 0;
  __pyx_t_5numpy_int64_t __pyx_v_cur;
  __pyx_t_5numpy_int64_t __pyx_v_next;
  int __pyx_v_lim;
  int __pyx_v_fill_count;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_indexer;
  __Pyx_Buffer __pyx_pybuffer_indexer;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_new;
  __Pyx_Buffer __pyx_pybuffer_new;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_old;
  __Pyx_Buffer __pyx_pybuffer_old;
  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;
  long __pyx_t_14;
  int __pyx_t_15;
  int __pyx_t_16;
  long __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;
  Py_ssize_t __pyx_t_26;
  Py_ssize_t __pyx_t_27;
  Py_ssize_t __pyx_t_28;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("pad_int64", 0);
  __pyx_pybuffer_indexer.pybuffer.buf = NULL;
  __pyx_pybuffer_indexer.refcount = 0;
  __pyx_pybuffernd_indexer.data = NULL;
  __pyx_pybuffernd_indexer.rcbuffer = &__pyx_pybuffer_indexer;
  __pyx_pybuffer_old.pybuffer.buf = NULL;
  __pyx_pybuffer_old.refcount = 0;
  __pyx_pybuffernd_old.data = NULL;
  __pyx_pybuffernd_old.rcbuffer = &__pyx_pybuffer_old;
  __pyx_pybuffer_new.pybuffer.buf = NULL;
  __pyx_pybuffer_new.refcount = 0;
  __pyx_pybuffernd_new.data = NULL;
  __pyx_pybuffernd_new.rcbuffer = &__pyx_pybuffer_new;
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_old.rcbuffer->pybuffer, (PyObject*)__pyx_v_old, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 503; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_old.diminfo[0].strides = __pyx_pybuffernd_old.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_old.diminfo[0].shape = __pyx_pybuffernd_old.rcbuffer->pybuffer.shape[0];
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_new.rcbuffer->pybuffer, (PyObject*)__pyx_v_new, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 503; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_new.diminfo[0].strides = __pyx_pybuffernd_new.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_new.diminfo[0].shape = __pyx_pybuffernd_new.rcbuffer->pybuffer.shape[0];

  /* "pandas/src/generated.pyx":508
 *     cdef ndarray[int64_t, ndim=1] indexer
 *     cdef int64_t cur, next
 *     cdef int lim, fill_count = 0             # <<<<<<<<<<<<<<
 * 
 *     nleft = len(old)
 */
  __pyx_v_fill_count = 0;

  /* "pandas/src/generated.pyx":510
 *     cdef int lim, fill_count = 0
 * 
 *     nleft = len(old)             # <<<<<<<<<<<<<<
 *     nright = len(new)
 *     indexer = np.empty(nright, dtype=np.int64)
 */
  __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_old)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 510; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_nleft = __pyx_t_1;

  /* "pandas/src/generated.pyx":511
 * 
 *     nleft = len(old)
 *     nright = len(new)             # <<<<<<<<<<<<<<
 *     indexer = np.empty(nright, dtype=np.int64)
 *     indexer.fill(-1)
 */
  __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_new)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 511; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_nright = __pyx_t_1;

  /* "pandas/src/generated.pyx":512
 *     nleft = len(old)
 *     nright = len(new)
 *     indexer = np.empty(nright, dtype=np.int64)             # <<<<<<<<<<<<<<
 *     indexer.fill(-1)
 * 
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 512; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_empty); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 512; __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_nright); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 512; __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 = 512; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__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 = 512; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 512; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_int64); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 512; __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, __pyx_n_s_dtype, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 512; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 512; __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_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__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 = 512; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_7 = ((PyArrayObject *)__pyx_t_6);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer);
    __pyx_t_8 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer, (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_pybuffernd_indexer.rcbuffer->pybuffer, (PyObject*)__pyx_v_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_pybuffernd_indexer.diminfo[0].strides = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_indexer.diminfo[0].shape = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.shape[0];
    if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 512; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_7 = 0;
  __pyx_v_indexer = ((PyArrayObject *)__pyx_t_6);
  __pyx_t_6 = 0;

  /* "pandas/src/generated.pyx":513
 *     nright = len(new)
 *     indexer = np.empty(nright, dtype=np.int64)
 *     indexer.fill(-1)             # <<<<<<<<<<<<<<
 * 
 *     if limit is None:
 */
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_indexer), __pyx_n_s_fill); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 513; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_tuple__58, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 513; __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/generated.pyx":515
 *     indexer.fill(-1)
 * 
 *     if limit is None:             # <<<<<<<<<<<<<<
 *         lim = nright
 *     else:
 */
  __pyx_t_12 = (__pyx_v_limit == Py_None);
  __pyx_t_13 = (__pyx_t_12 != 0);
  if (__pyx_t_13) {

    /* "pandas/src/generated.pyx":516
 * 
 *     if limit is None:
 *         lim = nright             # <<<<<<<<<<<<<<
 *     else:
 *         if limit < 0:
 */
    __pyx_v_lim = __pyx_v_nright;
    goto __pyx_L3;
  }
  /*else*/ {

    /* "pandas/src/generated.pyx":518
 *         lim = nright
 *     else:
 *         if limit < 0:             # <<<<<<<<<<<<<<
 *             raise ValueError('Limit must be non-negative')
 *         lim = limit
 */
    __pyx_t_2 = PyObject_RichCompare(__pyx_v_limit, __pyx_int_0, Py_LT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 518; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_13 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_13 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 518; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (__pyx_t_13) {

      /* "pandas/src/generated.pyx":519
 *     else:
 *         if limit < 0:
 *             raise ValueError('Limit must be non-negative')             # <<<<<<<<<<<<<<
 *         lim = limit
 * 
 */
      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__59, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 519; __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 = 519; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }

    /* "pandas/src/generated.pyx":520
 *         if limit < 0:
 *             raise ValueError('Limit must be non-negative')
 *         lim = limit             # <<<<<<<<<<<<<<
 * 
 *     if nleft == 0 or nright == 0 or new[nright - 1] < old[0]:
 */
    __pyx_t_8 = __Pyx_PyInt_As_int(__pyx_v_limit); if (unlikely((__pyx_t_8 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 520; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_v_lim = __pyx_t_8;
  }
  __pyx_L3:;

  /* "pandas/src/generated.pyx":522
 *         lim = limit
 * 
 *     if nleft == 0 or nright == 0 or new[nright - 1] < old[0]:             # <<<<<<<<<<<<<<
 *         return indexer
 * 
 */
  __pyx_t_13 = ((__pyx_v_nleft == 0) != 0);
  if (!__pyx_t_13) {
    __pyx_t_12 = ((__pyx_v_nright == 0) != 0);
    if (!__pyx_t_12) {
      __pyx_t_1 = (__pyx_v_nright - 1);
      __pyx_t_14 = 0;
      __pyx_t_15 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_new.rcbuffer->pybuffer.buf, __pyx_t_1, __pyx_pybuffernd_new.diminfo[0].strides)) < (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_old.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_old.diminfo[0].strides))) != 0);
      __pyx_t_16 = __pyx_t_15;
    } else {
      __pyx_t_16 = __pyx_t_12;
    }
    __pyx_t_12 = __pyx_t_16;
  } else {
    __pyx_t_12 = __pyx_t_13;
  }
  if (__pyx_t_12) {

    /* "pandas/src/generated.pyx":523
 * 
 *     if nleft == 0 or nright == 0 or new[nright - 1] < old[0]:
 *         return indexer             # <<<<<<<<<<<<<<
 * 
 *     i = j = 0
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(((PyObject *)__pyx_v_indexer));
    __pyx_r = ((PyObject *)__pyx_v_indexer);
    goto __pyx_L0;
  }

  /* "pandas/src/generated.pyx":525
 *         return indexer
 * 
 *     i = j = 0             # <<<<<<<<<<<<<<
 * 
 *     cur = old[0]
 */
  __pyx_v_i = 0;
  __pyx_v_j = 0;

  /* "pandas/src/generated.pyx":527
 *     i = j = 0
 * 
 *     cur = old[0]             # <<<<<<<<<<<<<<
 * 
 *     while j <= nright - 1 and new[j] < cur:
 */
  __pyx_t_17 = 0;
  __pyx_v_cur = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_old.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_old.diminfo[0].strides));

  /* "pandas/src/generated.pyx":529
 *     cur = old[0]
 * 
 *     while j <= nright - 1 and new[j] < cur:             # <<<<<<<<<<<<<<
 *         j += 1
 * 
 */
  while (1) {
    __pyx_t_12 = ((__pyx_v_j <= (__pyx_v_nright - 1)) != 0);
    if (__pyx_t_12) {
      __pyx_t_18 = __pyx_v_j;
      __pyx_t_13 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_new.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_new.diminfo[0].strides)) < __pyx_v_cur) != 0);
      __pyx_t_16 = __pyx_t_13;
    } else {
      __pyx_t_16 = __pyx_t_12;
    }
    if (!__pyx_t_16) break;

    /* "pandas/src/generated.pyx":530
 * 
 *     while j <= nright - 1 and new[j] < cur:
 *         j += 1             # <<<<<<<<<<<<<<
 * 
 *     while True:
 */
    __pyx_v_j = (__pyx_v_j + 1);
  }

  /* "pandas/src/generated.pyx":532
 *         j += 1
 * 
 *     while True:             # <<<<<<<<<<<<<<
 *         if j == nright:
 *             break
 */
  while (1) {

    /* "pandas/src/generated.pyx":533
 * 
 *     while True:
 *         if j == nright:             # <<<<<<<<<<<<<<
 *             break
 * 
 */
    __pyx_t_16 = ((__pyx_v_j == __pyx_v_nright) != 0);
    if (__pyx_t_16) {

      /* "pandas/src/generated.pyx":534
 *     while True:
 *         if j == nright:
 *             break             # <<<<<<<<<<<<<<
 * 
 *         if i == nleft - 1:
 */
      goto __pyx_L9_break;
    }

    /* "pandas/src/generated.pyx":536
 *             break
 * 
 *         if i == nleft - 1:             # <<<<<<<<<<<<<<
 *             while j < nright:
 *                 if new[j] == cur:
 */
    __pyx_t_16 = ((__pyx_v_i == (__pyx_v_nleft - 1)) != 0);
    if (__pyx_t_16) {

      /* "pandas/src/generated.pyx":537
 * 
 *         if i == nleft - 1:
 *             while j < nright:             # <<<<<<<<<<<<<<
 *                 if new[j] == cur:
 *                     indexer[j] = i
 */
      while (1) {
        __pyx_t_16 = ((__pyx_v_j < __pyx_v_nright) != 0);
        if (!__pyx_t_16) break;

        /* "pandas/src/generated.pyx":538
 *         if i == nleft - 1:
 *             while j < nright:
 *                 if new[j] == cur:             # <<<<<<<<<<<<<<
 *                     indexer[j] = i
 *                 elif new[j] > cur and fill_count < lim:
 */
        __pyx_t_19 = __pyx_v_j;
        __pyx_t_16 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_new.rcbuffer->pybuffer.buf, __pyx_t_19, __pyx_pybuffernd_new.diminfo[0].strides)) == __pyx_v_cur) != 0);
        if (__pyx_t_16) {

          /* "pandas/src/generated.pyx":539
 *             while j < nright:
 *                 if new[j] == cur:
 *                     indexer[j] = i             # <<<<<<<<<<<<<<
 *                 elif new[j] > cur and fill_count < lim:
 *                     indexer[j] = i
 */
          __pyx_t_20 = __pyx_v_j;
          *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_indexer.diminfo[0].strides) = __pyx_v_i;
          goto __pyx_L14;
        }

        /* "pandas/src/generated.pyx":540
 *                 if new[j] == cur:
 *                     indexer[j] = i
 *                 elif new[j] > cur and fill_count < lim:             # <<<<<<<<<<<<<<
 *                     indexer[j] = i
 *                     fill_count += 1
 */
        __pyx_t_21 = __pyx_v_j;
        __pyx_t_16 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_new.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_new.diminfo[0].strides)) > __pyx_v_cur) != 0);
        if (__pyx_t_16) {
          __pyx_t_12 = ((__pyx_v_fill_count < __pyx_v_lim) != 0);
          __pyx_t_13 = __pyx_t_12;
        } else {
          __pyx_t_13 = __pyx_t_16;
        }
        if (__pyx_t_13) {

          /* "pandas/src/generated.pyx":541
 *                     indexer[j] = i
 *                 elif new[j] > cur and fill_count < lim:
 *                     indexer[j] = i             # <<<<<<<<<<<<<<
 *                     fill_count += 1
 *                 j += 1
 */
          __pyx_t_22 = __pyx_v_j;
          *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_22, __pyx_pybuffernd_indexer.diminfo[0].strides) = __pyx_v_i;

          /* "pandas/src/generated.pyx":542
 *                 elif new[j] > cur and fill_count < lim:
 *                     indexer[j] = i
 *                     fill_count += 1             # <<<<<<<<<<<<<<
 *                 j += 1
 *             break
 */
          __pyx_v_fill_count = (__pyx_v_fill_count + 1);
          goto __pyx_L14;
        }
        __pyx_L14:;

        /* "pandas/src/generated.pyx":543
 *                     indexer[j] = i
 *                     fill_count += 1
 *                 j += 1             # <<<<<<<<<<<<<<
 *             break
 * 
 */
        __pyx_v_j = (__pyx_v_j + 1);
      }

      /* "pandas/src/generated.pyx":544
 *                     fill_count += 1
 *                 j += 1
 *             break             # <<<<<<<<<<<<<<
 * 
 *         next = old[i + 1]
 */
      goto __pyx_L9_break;
    }

    /* "pandas/src/generated.pyx":546
 *             break
 * 
 *         next = old[i + 1]             # <<<<<<<<<<<<<<
 * 
 *         while j < nright and cur <= new[j] < next:
 */
    __pyx_t_23 = (__pyx_v_i + 1);
    __pyx_v_next = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_old.rcbuffer->pybuffer.buf, __pyx_t_23, __pyx_pybuffernd_old.diminfo[0].strides));

    /* "pandas/src/generated.pyx":548
 *         next = old[i + 1]
 * 
 *         while j < nright and cur <= new[j] < next:             # <<<<<<<<<<<<<<
 *             if new[j] == cur:
 *                 indexer[j] = i
 */
    while (1) {
      __pyx_t_13 = ((__pyx_v_j < __pyx_v_nright) != 0);
      if (__pyx_t_13) {
        __pyx_t_24 = __pyx_v_j;
        __pyx_t_25 = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_new.rcbuffer->pybuffer.buf, __pyx_t_24, __pyx_pybuffernd_new.diminfo[0].strides));
        __pyx_t_16 = (__pyx_v_cur <= __pyx_t_25);
        if (__pyx_t_16) {
          __pyx_t_16 = (__pyx_t_25 < __pyx_v_next);
        }
        __pyx_t_12 = (__pyx_t_16 != 0);
      } else {
        __pyx_t_12 = __pyx_t_13;
      }
      if (!__pyx_t_12) break;

      /* "pandas/src/generated.pyx":549
 * 
 *         while j < nright and cur <= new[j] < next:
 *             if new[j] == cur:             # <<<<<<<<<<<<<<
 *                 indexer[j] = i
 *             elif fill_count < lim:
 */
      __pyx_t_26 = __pyx_v_j;
      __pyx_t_12 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_new.rcbuffer->pybuffer.buf, __pyx_t_26, __pyx_pybuffernd_new.diminfo[0].strides)) == __pyx_v_cur) != 0);
      if (__pyx_t_12) {

        /* "pandas/src/generated.pyx":550
 *         while j < nright and cur <= new[j] < next:
 *             if new[j] == cur:
 *                 indexer[j] = i             # <<<<<<<<<<<<<<
 *             elif fill_count < lim:
 *                 indexer[j] = i
 */
        __pyx_t_27 = __pyx_v_j;
        *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_27, __pyx_pybuffernd_indexer.diminfo[0].strides) = __pyx_v_i;
        goto __pyx_L17;
      }

      /* "pandas/src/generated.pyx":551
 *             if new[j] == cur:
 *                 indexer[j] = i
 *             elif fill_count < lim:             # <<<<<<<<<<<<<<
 *                 indexer[j] = i
 *                 fill_count += 1
 */
      __pyx_t_12 = ((__pyx_v_fill_count < __pyx_v_lim) != 0);
      if (__pyx_t_12) {

        /* "pandas/src/generated.pyx":552
 *                 indexer[j] = i
 *             elif fill_count < lim:
 *                 indexer[j] = i             # <<<<<<<<<<<<<<
 *                 fill_count += 1
 *             j += 1
 */
        __pyx_t_28 = __pyx_v_j;
        *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_28, __pyx_pybuffernd_indexer.diminfo[0].strides) = __pyx_v_i;

        /* "pandas/src/generated.pyx":553
 *             elif fill_count < lim:
 *                 indexer[j] = i
 *                 fill_count += 1             # <<<<<<<<<<<<<<
 *             j += 1
 * 
 */
        __pyx_v_fill_count = (__pyx_v_fill_count + 1);
        goto __pyx_L17;
      }
      __pyx_L17:;

      /* "pandas/src/generated.pyx":554
 *                 indexer[j] = i
 *                 fill_count += 1
 *             j += 1             # <<<<<<<<<<<<<<
 * 
 *         fill_count = 0
 */
      __pyx_v_j = (__pyx_v_j + 1);
    }

    /* "pandas/src/generated.pyx":556
 *             j += 1
 * 
 *         fill_count = 0             # <<<<<<<<<<<<<<
 *         i += 1
 *         cur = next
 */
    __pyx_v_fill_count = 0;

    /* "pandas/src/generated.pyx":557
 * 
 *         fill_count = 0
 *         i += 1             # <<<<<<<<<<<<<<
 *         cur = next
 * 
 */
    __pyx_v_i = (__pyx_v_i + 1);

    /* "pandas/src/generated.pyx":558
 *         fill_count = 0
 *         i += 1
 *         cur = next             # <<<<<<<<<<<<<<
 * 
 *     return indexer
 */
    __pyx_v_cur = __pyx_v_next;
  }
  __pyx_L9_break:;

  /* "pandas/src/generated.pyx":560
 *         cur = next
 * 
 *     return indexer             # <<<<<<<<<<<<<<
 * 
 * @cython.boundscheck(False)
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_indexer));
  __pyx_r = ((PyObject *)__pyx_v_indexer);
  goto __pyx_L0;

  /* "pandas/src/generated.pyx":503
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def pad_int64(ndarray[int64_t] old, ndarray[int64_t] new,             # <<<<<<<<<<<<<<
 *                    limit=None):
 *     cdef Py_ssize_t i, j, nleft, nright
 */

  /* function exit code */
  __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_pybuffernd_indexer.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_new.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_old.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas.algos.pad_int64", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_new.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_old.rcbuffer->pybuffer);
  __pyx_L2:;
  __Pyx_XDECREF((PyObject *)__pyx_v_indexer);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/src/generated.pyx":564
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def pad_bool(ndarray[uint8_t] old, ndarray[uint8_t] new,             # <<<<<<<<<<<<<<
 *                    limit=None):
 *     cdef Py_ssize_t i, j, nleft, nright
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pandas_5algos_125pad_bool(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_5algos_125pad_bool = {__Pyx_NAMESTR("pad_bool"), (PyCFunction)__pyx_pw_6pandas_5algos_125pad_bool, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pw_6pandas_5algos_125pad_bool(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyArrayObject *__pyx_v_old = 0;
  PyArrayObject *__pyx_v_new = 0;
  PyObject *__pyx_v_limit = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("pad_bool (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_old,&__pyx_n_s_new,&__pyx_n_s_limit,0};
    PyObject* values[3] = {0,0,0};

    /* "pandas/src/generated.pyx":565
 * @cython.wraparound(False)
 * def pad_bool(ndarray[uint8_t] old, ndarray[uint8_t] new,
 *                    limit=None):             # <<<<<<<<<<<<<<
 *     cdef Py_ssize_t i, j, nleft, nright
 *     cdef ndarray[int64_t, ndim=1] indexer
 */
    values[2] = ((PyObject *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_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 (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_old)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_new)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("pad_bool", 0, 2, 3, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 564; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_limit);
          if (value) { values[2] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "pad_bool") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 564; __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_old = ((PyArrayObject *)values[0]);
    __pyx_v_new = ((PyArrayObject *)values[1]);
    __pyx_v_limit = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("pad_bool", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 564; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas.algos.pad_bool", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_old), __pyx_ptype_5numpy_ndarray, 1, "old", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 564; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_new), __pyx_ptype_5numpy_ndarray, 1, "new", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 564; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_124pad_bool(__pyx_self, __pyx_v_old, __pyx_v_new, __pyx_v_limit);

  /* "pandas/src/generated.pyx":564
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def pad_bool(ndarray[uint8_t] old, ndarray[uint8_t] new,             # <<<<<<<<<<<<<<
 *                    limit=None):
 *     cdef Py_ssize_t i, j, nleft, nright
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pandas_5algos_124pad_bool(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_old, PyArrayObject *__pyx_v_new, PyObject *__pyx_v_limit) {
  Py_ssize_t __pyx_v_i;
  Py_ssize_t __pyx_v_j;
  Py_ssize_t __pyx_v_nleft;
  Py_ssize_t __pyx_v_nright;
  PyArrayObject *__pyx_v_indexer = 0;
  __pyx_t_5numpy_uint8_t __pyx_v_cur;
  __pyx_t_5numpy_uint8_t __pyx_v_next;
  int __pyx_v_lim;
  int __pyx_v_fill_count;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_indexer;
  __Pyx_Buffer __pyx_pybuffer_indexer;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_new;
  __Pyx_Buffer __pyx_pybuffer_new;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_old;
  __Pyx_Buffer __pyx_pybuffer_old;
  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;
  long __pyx_t_14;
  int __pyx_t_15;
  int __pyx_t_16;
  long __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_uint8_t __pyx_t_25;
  Py_ssize_t __pyx_t_26;
  Py_ssize_t __pyx_t_27;
  Py_ssize_t __pyx_t_28;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("pad_bool", 0);
  __pyx_pybuffer_indexer.pybuffer.buf = NULL;
  __pyx_pybuffer_indexer.refcount = 0;
  __pyx_pybuffernd_indexer.data = NULL;
  __pyx_pybuffernd_indexer.rcbuffer = &__pyx_pybuffer_indexer;
  __pyx_pybuffer_old.pybuffer.buf = NULL;
  __pyx_pybuffer_old.refcount = 0;
  __pyx_pybuffernd_old.data = NULL;
  __pyx_pybuffernd_old.rcbuffer = &__pyx_pybuffer_old;
  __pyx_pybuffer_new.pybuffer.buf = NULL;
  __pyx_pybuffer_new.refcount = 0;
  __pyx_pybuffernd_new.data = NULL;
  __pyx_pybuffernd_new.rcbuffer = &__pyx_pybuffer_new;
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_old.rcbuffer->pybuffer, (PyObject*)__pyx_v_old, &__Pyx_TypeInfo_nn___pyx_t_5numpy_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 564; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_old.diminfo[0].strides = __pyx_pybuffernd_old.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_old.diminfo[0].shape = __pyx_pybuffernd_old.rcbuffer->pybuffer.shape[0];
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_new.rcbuffer->pybuffer, (PyObject*)__pyx_v_new, &__Pyx_TypeInfo_nn___pyx_t_5numpy_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 564; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_new.diminfo[0].strides = __pyx_pybuffernd_new.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_new.diminfo[0].shape = __pyx_pybuffernd_new.rcbuffer->pybuffer.shape[0];

  /* "pandas/src/generated.pyx":569
 *     cdef ndarray[int64_t, ndim=1] indexer
 *     cdef uint8_t cur, next
 *     cdef int lim, fill_count = 0             # <<<<<<<<<<<<<<
 * 
 *     nleft = len(old)
 */
  __pyx_v_fill_count = 0;

  /* "pandas/src/generated.pyx":571
 *     cdef int lim, fill_count = 0
 * 
 *     nleft = len(old)             # <<<<<<<<<<<<<<
 *     nright = len(new)
 *     indexer = np.empty(nright, dtype=np.int64)
 */
  __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_old)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 571; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_nleft = __pyx_t_1;

  /* "pandas/src/generated.pyx":572
 * 
 *     nleft = len(old)
 *     nright = len(new)             # <<<<<<<<<<<<<<
 *     indexer = np.empty(nright, dtype=np.int64)
 *     indexer.fill(-1)
 */
  __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_new)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 572; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_nright = __pyx_t_1;

  /* "pandas/src/generated.pyx":573
 *     nleft = len(old)
 *     nright = len(new)
 *     indexer = np.empty(nright, dtype=np.int64)             # <<<<<<<<<<<<<<
 *     indexer.fill(-1)
 * 
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 573; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_empty); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 573; __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_nright); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 573; __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 = 573; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__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 = 573; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 573; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_int64); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 573; __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, __pyx_n_s_dtype, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 573; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 573; __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_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__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 = 573; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_7 = ((PyArrayObject *)__pyx_t_6);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer);
    __pyx_t_8 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer, (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_pybuffernd_indexer.rcbuffer->pybuffer, (PyObject*)__pyx_v_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_pybuffernd_indexer.diminfo[0].strides = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_indexer.diminfo[0].shape = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.shape[0];
    if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 573; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_7 = 0;
  __pyx_v_indexer = ((PyArrayObject *)__pyx_t_6);
  __pyx_t_6 = 0;

  /* "pandas/src/generated.pyx":574
 *     nright = len(new)
 *     indexer = np.empty(nright, dtype=np.int64)
 *     indexer.fill(-1)             # <<<<<<<<<<<<<<
 * 
 *     if limit is None:
 */
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_indexer), __pyx_n_s_fill); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 574; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_tuple__60, 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(__pyx_t_6); __pyx_t_6 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pandas/src/generated.pyx":576
 *     indexer.fill(-1)
 * 
 *     if limit is None:             # <<<<<<<<<<<<<<
 *         lim = nright
 *     else:
 */
  __pyx_t_12 = (__pyx_v_limit == Py_None);
  __pyx_t_13 = (__pyx_t_12 != 0);
  if (__pyx_t_13) {

    /* "pandas/src/generated.pyx":577
 * 
 *     if limit is None:
 *         lim = nright             # <<<<<<<<<<<<<<
 *     else:
 *         if limit < 0:
 */
    __pyx_v_lim = __pyx_v_nright;
    goto __pyx_L3;
  }
  /*else*/ {

    /* "pandas/src/generated.pyx":579
 *         lim = nright
 *     else:
 *         if limit < 0:             # <<<<<<<<<<<<<<
 *             raise ValueError('Limit must be non-negative')
 *         lim = limit
 */
    __pyx_t_2 = PyObject_RichCompare(__pyx_v_limit, __pyx_int_0, Py_LT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 579; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_13 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_13 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 579; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (__pyx_t_13) {

      /* "pandas/src/generated.pyx":580
 *     else:
 *         if limit < 0:
 *             raise ValueError('Limit must be non-negative')             # <<<<<<<<<<<<<<
 *         lim = limit
 * 
 */
      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__61, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 580; __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 = 580; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }

    /* "pandas/src/generated.pyx":581
 *         if limit < 0:
 *             raise ValueError('Limit must be non-negative')
 *         lim = limit             # <<<<<<<<<<<<<<
 * 
 *     if nleft == 0 or nright == 0 or new[nright - 1] < old[0]:
 */
    __pyx_t_8 = __Pyx_PyInt_As_int(__pyx_v_limit); if (unlikely((__pyx_t_8 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 581; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_v_lim = __pyx_t_8;
  }
  __pyx_L3:;

  /* "pandas/src/generated.pyx":583
 *         lim = limit
 * 
 *     if nleft == 0 or nright == 0 or new[nright - 1] < old[0]:             # <<<<<<<<<<<<<<
 *         return indexer
 * 
 */
  __pyx_t_13 = ((__pyx_v_nleft == 0) != 0);
  if (!__pyx_t_13) {
    __pyx_t_12 = ((__pyx_v_nright == 0) != 0);
    if (!__pyx_t_12) {
      __pyx_t_1 = (__pyx_v_nright - 1);
      __pyx_t_14 = 0;
      __pyx_t_15 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_uint8_t *, __pyx_pybuffernd_new.rcbuffer->pybuffer.buf, __pyx_t_1, __pyx_pybuffernd_new.diminfo[0].strides)) < (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_uint8_t *, __pyx_pybuffernd_old.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_old.diminfo[0].strides))) != 0);
      __pyx_t_16 = __pyx_t_15;
    } else {
      __pyx_t_16 = __pyx_t_12;
    }
    __pyx_t_12 = __pyx_t_16;
  } else {
    __pyx_t_12 = __pyx_t_13;
  }
  if (__pyx_t_12) {

    /* "pandas/src/generated.pyx":584
 * 
 *     if nleft == 0 or nright == 0 or new[nright - 1] < old[0]:
 *         return indexer             # <<<<<<<<<<<<<<
 * 
 *     i = j = 0
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(((PyObject *)__pyx_v_indexer));
    __pyx_r = ((PyObject *)__pyx_v_indexer);
    goto __pyx_L0;
  }

  /* "pandas/src/generated.pyx":586
 *         return indexer
 * 
 *     i = j = 0             # <<<<<<<<<<<<<<
 * 
 *     cur = old[0]
 */
  __pyx_v_i = 0;
  __pyx_v_j = 0;

  /* "pandas/src/generated.pyx":588
 *     i = j = 0
 * 
 *     cur = old[0]             # <<<<<<<<<<<<<<
 * 
 *     while j <= nright - 1 and new[j] < cur:
 */
  __pyx_t_17 = 0;
  __pyx_v_cur = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_uint8_t *, __pyx_pybuffernd_old.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_old.diminfo[0].strides));

  /* "pandas/src/generated.pyx":590
 *     cur = old[0]
 * 
 *     while j <= nright - 1 and new[j] < cur:             # <<<<<<<<<<<<<<
 *         j += 1
 * 
 */
  while (1) {
    __pyx_t_12 = ((__pyx_v_j <= (__pyx_v_nright - 1)) != 0);
    if (__pyx_t_12) {
      __pyx_t_18 = __pyx_v_j;
      __pyx_t_13 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_uint8_t *, __pyx_pybuffernd_new.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_new.diminfo[0].strides)) < __pyx_v_cur) != 0);
      __pyx_t_16 = __pyx_t_13;
    } else {
      __pyx_t_16 = __pyx_t_12;
    }
    if (!__pyx_t_16) break;

    /* "pandas/src/generated.pyx":591
 * 
 *     while j <= nright - 1 and new[j] < cur:
 *         j += 1             # <<<<<<<<<<<<<<
 * 
 *     while True:
 */
    __pyx_v_j = (__pyx_v_j + 1);
  }

  /* "pandas/src/generated.pyx":593
 *         j += 1
 * 
 *     while True:             # <<<<<<<<<<<<<<
 *         if j == nright:
 *             break
 */
  while (1) {

    /* "pandas/src/generated.pyx":594
 * 
 *     while True:
 *         if j == nright:             # <<<<<<<<<<<<<<
 *             break
 * 
 */
    __pyx_t_16 = ((__pyx_v_j == __pyx_v_nright) != 0);
    if (__pyx_t_16) {

      /* "pandas/src/generated.pyx":595
 *     while True:
 *         if j == nright:
 *             break             # <<<<<<<<<<<<<<
 * 
 *         if i == nleft - 1:
 */
      goto __pyx_L9_break;
    }

    /* "pandas/src/generated.pyx":597
 *             break
 * 
 *         if i == nleft - 1:             # <<<<<<<<<<<<<<
 *             while j < nright:
 *                 if new[j] == cur:
 */
    __pyx_t_16 = ((__pyx_v_i == (__pyx_v_nleft - 1)) != 0);
    if (__pyx_t_16) {

      /* "pandas/src/generated.pyx":598
 * 
 *         if i == nleft - 1:
 *             while j < nright:             # <<<<<<<<<<<<<<
 *                 if new[j] == cur:
 *                     indexer[j] = i
 */
      while (1) {
        __pyx_t_16 = ((__pyx_v_j < __pyx_v_nright) != 0);
        if (!__pyx_t_16) break;

        /* "pandas/src/generated.pyx":599
 *         if i == nleft - 1:
 *             while j < nright:
 *                 if new[j] == cur:             # <<<<<<<<<<<<<<
 *                     indexer[j] = i
 *                 elif new[j] > cur and fill_count < lim:
 */
        __pyx_t_19 = __pyx_v_j;
        __pyx_t_16 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_uint8_t *, __pyx_pybuffernd_new.rcbuffer->pybuffer.buf, __pyx_t_19, __pyx_pybuffernd_new.diminfo[0].strides)) == __pyx_v_cur) != 0);
        if (__pyx_t_16) {

          /* "pandas/src/generated.pyx":600
 *             while j < nright:
 *                 if new[j] == cur:
 *                     indexer[j] = i             # <<<<<<<<<<<<<<
 *                 elif new[j] > cur and fill_count < lim:
 *                     indexer[j] = i
 */
          __pyx_t_20 = __pyx_v_j;
          *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_indexer.diminfo[0].strides) = __pyx_v_i;
          goto __pyx_L14;
        }

        /* "pandas/src/generated.pyx":601
 *                 if new[j] == cur:
 *                     indexer[j] = i
 *                 elif new[j] > cur and fill_count < lim:             # <<<<<<<<<<<<<<
 *                     indexer[j] = i
 *                     fill_count += 1
 */
        __pyx_t_21 = __pyx_v_j;
        __pyx_t_16 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_uint8_t *, __pyx_pybuffernd_new.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_new.diminfo[0].strides)) > __pyx_v_cur) != 0);
        if (__pyx_t_16) {
          __pyx_t_12 = ((__pyx_v_fill_count < __pyx_v_lim) != 0);
          __pyx_t_13 = __pyx_t_12;
        } else {
          __pyx_t_13 = __pyx_t_16;
        }
        if (__pyx_t_13) {

          /* "pandas/src/generated.pyx":602
 *                     indexer[j] = i
 *                 elif new[j] > cur and fill_count < lim:
 *                     indexer[j] = i             # <<<<<<<<<<<<<<
 *                     fill_count += 1
 *                 j += 1
 */
          __pyx_t_22 = __pyx_v_j;
          *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_22, __pyx_pybuffernd_indexer.diminfo[0].strides) = __pyx_v_i;

          /* "pandas/src/generated.pyx":603
 *                 elif new[j] > cur and fill_count < lim:
 *                     indexer[j] = i
 *                     fill_count += 1             # <<<<<<<<<<<<<<
 *                 j += 1
 *             break
 */
          __pyx_v_fill_count = (__pyx_v_fill_count + 1);
          goto __pyx_L14;
        }
        __pyx_L14:;

        /* "pandas/src/generated.pyx":604
 *                     indexer[j] = i
 *                     fill_count += 1
 *                 j += 1             # <<<<<<<<<<<<<<
 *             break
 * 
 */
        __pyx_v_j = (__pyx_v_j + 1);
      }

      /* "pandas/src/generated.pyx":605
 *                     fill_count += 1
 *                 j += 1
 *             break             # <<<<<<<<<<<<<<
 * 
 *         next = old[i + 1]
 */
      goto __pyx_L9_break;
    }

    /* "pandas/src/generated.pyx":607
 *             break
 * 
 *         next = old[i + 1]             # <<<<<<<<<<<<<<
 * 
 *         while j < nright and cur <= new[j] < next:
 */
    __pyx_t_23 = (__pyx_v_i + 1);
    __pyx_v_next = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_uint8_t *, __pyx_pybuffernd_old.rcbuffer->pybuffer.buf, __pyx_t_23, __pyx_pybuffernd_old.diminfo[0].strides));

    /* "pandas/src/generated.pyx":609
 *         next = old[i + 1]
 * 
 *         while j < nright and cur <= new[j] < next:             # <<<<<<<<<<<<<<
 *             if new[j] == cur:
 *                 indexer[j] = i
 */
    while (1) {
      __pyx_t_13 = ((__pyx_v_j < __pyx_v_nright) != 0);
      if (__pyx_t_13) {
        __pyx_t_24 = __pyx_v_j;
        __pyx_t_25 = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_uint8_t *, __pyx_pybuffernd_new.rcbuffer->pybuffer.buf, __pyx_t_24, __pyx_pybuffernd_new.diminfo[0].strides));
        __pyx_t_16 = (__pyx_v_cur <= __pyx_t_25);
        if (__pyx_t_16) {
          __pyx_t_16 = (__pyx_t_25 < __pyx_v_next);
        }
        __pyx_t_12 = (__pyx_t_16 != 0);
      } else {
        __pyx_t_12 = __pyx_t_13;
      }
      if (!__pyx_t_12) break;

      /* "pandas/src/generated.pyx":610
 * 
 *         while j < nright and cur <= new[j] < next:
 *             if new[j] == cur:             # <<<<<<<<<<<<<<
 *                 indexer[j] = i
 *             elif fill_count < lim:
 */
      __pyx_t_26 = __pyx_v_j;
      __pyx_t_12 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_uint8_t *, __pyx_pybuffernd_new.rcbuffer->pybuffer.buf, __pyx_t_26, __pyx_pybuffernd_new.diminfo[0].strides)) == __pyx_v_cur) != 0);
      if (__pyx_t_12) {

        /* "pandas/src/generated.pyx":611
 *         while j < nright and cur <= new[j] < next:
 *             if new[j] == cur:
 *                 indexer[j] = i             # <<<<<<<<<<<<<<
 *             elif fill_count < lim:
 *                 indexer[j] = i
 */
        __pyx_t_27 = __pyx_v_j;
        *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_27, __pyx_pybuffernd_indexer.diminfo[0].strides) = __pyx_v_i;
        goto __pyx_L17;
      }

      /* "pandas/src/generated.pyx":612
 *             if new[j] == cur:
 *                 indexer[j] = i
 *             elif fill_count < lim:             # <<<<<<<<<<<<<<
 *                 indexer[j] = i
 *                 fill_count += 1
 */
      __pyx_t_12 = ((__pyx_v_fill_count < __pyx_v_lim) != 0);
      if (__pyx_t_12) {

        /* "pandas/src/generated.pyx":613
 *                 indexer[j] = i
 *             elif fill_count < lim:
 *                 indexer[j] = i             # <<<<<<<<<<<<<<
 *                 fill_count += 1
 *             j += 1
 */
        __pyx_t_28 = __pyx_v_j;
        *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_28, __pyx_pybuffernd_indexer.diminfo[0].strides) = __pyx_v_i;

        /* "pandas/src/generated.pyx":614
 *             elif fill_count < lim:
 *                 indexer[j] = i
 *                 fill_count += 1             # <<<<<<<<<<<<<<
 *             j += 1
 * 
 */
        __pyx_v_fill_count = (__pyx_v_fill_count + 1);
        goto __pyx_L17;
      }
      __pyx_L17:;

      /* "pandas/src/generated.pyx":615
 *                 indexer[j] = i
 *                 fill_count += 1
 *             j += 1             # <<<<<<<<<<<<<<
 * 
 *         fill_count = 0
 */
      __pyx_v_j = (__pyx_v_j + 1);
    }

    /* "pandas/src/generated.pyx":617
 *             j += 1
 * 
 *         fill_count = 0             # <<<<<<<<<<<<<<
 *         i += 1
 *         cur = next
 */
    __pyx_v_fill_count = 0;

    /* "pandas/src/generated.pyx":618
 * 
 *         fill_count = 0
 *         i += 1             # <<<<<<<<<<<<<<
 *         cur = next
 * 
 */
    __pyx_v_i = (__pyx_v_i + 1);

    /* "pandas/src/generated.pyx":619
 *         fill_count = 0
 *         i += 1
 *         cur = next             # <<<<<<<<<<<<<<
 * 
 *     return indexer
 */
    __pyx_v_cur = __pyx_v_next;
  }
  __pyx_L9_break:;

  /* "pandas/src/generated.pyx":621
 *         cur = next
 * 
 *     return indexer             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_indexer));
  __pyx_r = ((PyObject *)__pyx_v_indexer);
  goto __pyx_L0;

  /* "pandas/src/generated.pyx":564
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def pad_bool(ndarray[uint8_t] old, ndarray[uint8_t] new,             # <<<<<<<<<<<<<<
 *                    limit=None):
 *     cdef Py_ssize_t i, j, nleft, nright
 */

  /* function exit code */
  __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_pybuffernd_indexer.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_new.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_old.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas.algos.pad_bool", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_new.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_old.rcbuffer->pybuffer);
  __pyx_L2:;
  __Pyx_XDECREF((PyObject *)__pyx_v_indexer);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/src/generated.pyx":626
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def backfill_float64(ndarray[float64_t] old, ndarray[float64_t] new,             # <<<<<<<<<<<<<<
 *                       limit=None):
 *     cdef Py_ssize_t i, j, nleft, nright
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pandas_5algos_127backfill_float64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_5algos_127backfill_float64 = {__Pyx_NAMESTR("backfill_float64"), (PyCFunction)__pyx_pw_6pandas_5algos_127backfill_float64, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pw_6pandas_5algos_127backfill_float64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyArrayObject *__pyx_v_old = 0;
  PyArrayObject *__pyx_v_new = 0;
  PyObject *__pyx_v_limit = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("backfill_float64 (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_old,&__pyx_n_s_new,&__pyx_n_s_limit,0};
    PyObject* values[3] = {0,0,0};

    /* "pandas/src/generated.pyx":627
 * @cython.wraparound(False)
 * def backfill_float64(ndarray[float64_t] old, ndarray[float64_t] new,
 *                       limit=None):             # <<<<<<<<<<<<<<
 *     cdef Py_ssize_t i, j, nleft, nright
 *     cdef ndarray[int64_t, ndim=1] indexer
 */
    values[2] = ((PyObject *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_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 (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_old)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_new)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("backfill_float64", 0, 2, 3, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 626; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_limit);
          if (value) { values[2] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "backfill_float64") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 626; __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_old = ((PyArrayObject *)values[0]);
    __pyx_v_new = ((PyArrayObject *)values[1]);
    __pyx_v_limit = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("backfill_float64", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 626; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas.algos.backfill_float64", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_old), __pyx_ptype_5numpy_ndarray, 1, "old", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 626; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_new), __pyx_ptype_5numpy_ndarray, 1, "new", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 626; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_126backfill_float64(__pyx_self, __pyx_v_old, __pyx_v_new, __pyx_v_limit);

  /* "pandas/src/generated.pyx":626
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def backfill_float64(ndarray[float64_t] old, ndarray[float64_t] new,             # <<<<<<<<<<<<<<
 *                       limit=None):
 *     cdef Py_ssize_t i, j, nleft, nright
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pandas_5algos_126backfill_float64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_old, PyArrayObject *__pyx_v_new, PyObject *__pyx_v_limit) {
  Py_ssize_t __pyx_v_i;
  Py_ssize_t __pyx_v_j;
  Py_ssize_t __pyx_v_nleft;
  Py_ssize_t __pyx_v_nright;
  PyArrayObject *__pyx_v_indexer = 0;
  __pyx_t_5numpy_float64_t __pyx_v_cur;
  __pyx_t_5numpy_float64_t __pyx_v_prev;
  int __pyx_v_lim;
  int __pyx_v_fill_count;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_indexer;
  __Pyx_Buffer __pyx_pybuffer_indexer;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_new;
  __Pyx_Buffer __pyx_pybuffer_new;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_old;
  __Pyx_Buffer __pyx_pybuffer_old;
  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;
  long __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;
  Py_ssize_t __pyx_t_23;
  Py_ssize_t __pyx_t_24;
  __pyx_t_5numpy_float64_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;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("backfill_float64", 0);
  __pyx_pybuffer_indexer.pybuffer.buf = NULL;
  __pyx_pybuffer_indexer.refcount = 0;
  __pyx_pybuffernd_indexer.data = NULL;
  __pyx_pybuffernd_indexer.rcbuffer = &__pyx_pybuffer_indexer;
  __pyx_pybuffer_old.pybuffer.buf = NULL;
  __pyx_pybuffer_old.refcount = 0;
  __pyx_pybuffernd_old.data = NULL;
  __pyx_pybuffernd_old.rcbuffer = &__pyx_pybuffer_old;
  __pyx_pybuffer_new.pybuffer.buf = NULL;
  __pyx_pybuffer_new.refcount = 0;
  __pyx_pybuffernd_new.data = NULL;
  __pyx_pybuffernd_new.rcbuffer = &__pyx_pybuffer_new;
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_old.rcbuffer->pybuffer, (PyObject*)__pyx_v_old, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 626; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_old.diminfo[0].strides = __pyx_pybuffernd_old.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_old.diminfo[0].shape = __pyx_pybuffernd_old.rcbuffer->pybuffer.shape[0];
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_new.rcbuffer->pybuffer, (PyObject*)__pyx_v_new, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 626; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_new.diminfo[0].strides = __pyx_pybuffernd_new.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_new.diminfo[0].shape = __pyx_pybuffernd_new.rcbuffer->pybuffer.shape[0];

  /* "pandas/src/generated.pyx":631
 *     cdef ndarray[int64_t, ndim=1] indexer
 *     cdef float64_t cur, prev
 *     cdef int lim, fill_count = 0             # <<<<<<<<<<<<<<
 * 
 *     nleft = len(old)
 */
  __pyx_v_fill_count = 0;

  /* "pandas/src/generated.pyx":633
 *     cdef int lim, fill_count = 0
 * 
 *     nleft = len(old)             # <<<<<<<<<<<<<<
 *     nright = len(new)
 *     indexer = np.empty(nright, dtype=np.int64)
 */
  __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_old)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 633; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_nleft = __pyx_t_1;

  /* "pandas/src/generated.pyx":634
 * 
 *     nleft = len(old)
 *     nright = len(new)             # <<<<<<<<<<<<<<
 *     indexer = np.empty(nright, dtype=np.int64)
 *     indexer.fill(-1)
 */
  __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_new)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 634; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_nright = __pyx_t_1;

  /* "pandas/src/generated.pyx":635
 *     nleft = len(old)
 *     nright = len(new)
 *     indexer = np.empty(nright, dtype=np.int64)             # <<<<<<<<<<<<<<
 *     indexer.fill(-1)
 * 
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 635; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_empty); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 635; __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_nright); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 635; __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 = 635; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__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 = 635; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 635; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_int64); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 635; __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, __pyx_n_s_dtype, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 635; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 635; __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_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__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 = 635; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_7 = ((PyArrayObject *)__pyx_t_6);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer);
    __pyx_t_8 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer, (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_pybuffernd_indexer.rcbuffer->pybuffer, (PyObject*)__pyx_v_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_pybuffernd_indexer.diminfo[0].strides = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_indexer.diminfo[0].shape = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.shape[0];
    if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 635; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_7 = 0;
  __pyx_v_indexer = ((PyArrayObject *)__pyx_t_6);
  __pyx_t_6 = 0;

  /* "pandas/src/generated.pyx":636
 *     nright = len(new)
 *     indexer = np.empty(nright, dtype=np.int64)
 *     indexer.fill(-1)             # <<<<<<<<<<<<<<
 * 
 *     if limit is None:
 */
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_indexer), __pyx_n_s_fill); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 636; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_tuple__62, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 636; __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/generated.pyx":638
 *     indexer.fill(-1)
 * 
 *     if limit is None:             # <<<<<<<<<<<<<<
 *         lim = nright
 *     else:
 */
  __pyx_t_12 = (__pyx_v_limit == Py_None);
  __pyx_t_13 = (__pyx_t_12 != 0);
  if (__pyx_t_13) {

    /* "pandas/src/generated.pyx":639
 * 
 *     if limit is None:
 *         lim = nright             # <<<<<<<<<<<<<<
 *     else:
 *         if limit < 0:
 */
    __pyx_v_lim = __pyx_v_nright;
    goto __pyx_L3;
  }
  /*else*/ {

    /* "pandas/src/generated.pyx":641
 *         lim = nright
 *     else:
 *         if limit < 0:             # <<<<<<<<<<<<<<
 *             raise ValueError('Limit must be non-negative')
 *         lim = limit
 */
    __pyx_t_2 = PyObject_RichCompare(__pyx_v_limit, __pyx_int_0, Py_LT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 641; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_13 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_13 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 641; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (__pyx_t_13) {

      /* "pandas/src/generated.pyx":642
 *     else:
 *         if limit < 0:
 *             raise ValueError('Limit must be non-negative')             # <<<<<<<<<<<<<<
 *         lim = limit
 * 
 */
      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__63, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 642; __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 = 642; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }

    /* "pandas/src/generated.pyx":643
 *         if limit < 0:
 *             raise ValueError('Limit must be non-negative')
 *         lim = limit             # <<<<<<<<<<<<<<
 * 
 *     if nleft == 0 or nright == 0 or new[0] > old[nleft - 1]:
 */
    __pyx_t_8 = __Pyx_PyInt_As_int(__pyx_v_limit); if (unlikely((__pyx_t_8 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 643; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_v_lim = __pyx_t_8;
  }
  __pyx_L3:;

  /* "pandas/src/generated.pyx":645
 *         lim = limit
 * 
 *     if nleft == 0 or nright == 0 or new[0] > old[nleft - 1]:             # <<<<<<<<<<<<<<
 *         return indexer
 * 
 */
  __pyx_t_13 = ((__pyx_v_nleft == 0) != 0);
  if (!__pyx_t_13) {
    __pyx_t_12 = ((__pyx_v_nright == 0) != 0);
    if (!__pyx_t_12) {
      __pyx_t_14 = 0;
      __pyx_t_1 = (__pyx_v_nleft - 1);
      __pyx_t_15 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_new.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_new.diminfo[0].strides)) > (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_old.rcbuffer->pybuffer.buf, __pyx_t_1, __pyx_pybuffernd_old.diminfo[0].strides))) != 0);
      __pyx_t_16 = __pyx_t_15;
    } else {
      __pyx_t_16 = __pyx_t_12;
    }
    __pyx_t_12 = __pyx_t_16;
  } else {
    __pyx_t_12 = __pyx_t_13;
  }
  if (__pyx_t_12) {

    /* "pandas/src/generated.pyx":646
 * 
 *     if nleft == 0 or nright == 0 or new[0] > old[nleft - 1]:
 *         return indexer             # <<<<<<<<<<<<<<
 * 
 *     i = nleft - 1
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(((PyObject *)__pyx_v_indexer));
    __pyx_r = ((PyObject *)__pyx_v_indexer);
    goto __pyx_L0;
  }

  /* "pandas/src/generated.pyx":648
 *         return indexer
 * 
 *     i = nleft - 1             # <<<<<<<<<<<<<<
 *     j = nright - 1
 * 
 */
  __pyx_v_i = (__pyx_v_nleft - 1);

  /* "pandas/src/generated.pyx":649
 * 
 *     i = nleft - 1
 *     j = nright - 1             # <<<<<<<<<<<<<<
 * 
 *     cur = old[nleft - 1]
 */
  __pyx_v_j = (__pyx_v_nright - 1);

  /* "pandas/src/generated.pyx":651
 *     j = nright - 1
 * 
 *     cur = old[nleft - 1]             # <<<<<<<<<<<<<<
 * 
 *     while j >= 0 and new[j] > cur:
 */
  __pyx_t_17 = (__pyx_v_nleft - 1);
  __pyx_v_cur = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_old.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_old.diminfo[0].strides));

  /* "pandas/src/generated.pyx":653
 *     cur = old[nleft - 1]
 * 
 *     while j >= 0 and new[j] > cur:             # <<<<<<<<<<<<<<
 *         j -= 1
 * 
 */
  while (1) {
    __pyx_t_12 = ((__pyx_v_j >= 0) != 0);
    if (__pyx_t_12) {
      __pyx_t_18 = __pyx_v_j;
      __pyx_t_13 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_new.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_new.diminfo[0].strides)) > __pyx_v_cur) != 0);
      __pyx_t_16 = __pyx_t_13;
    } else {
      __pyx_t_16 = __pyx_t_12;
    }
    if (!__pyx_t_16) break;

    /* "pandas/src/generated.pyx":654
 * 
 *     while j >= 0 and new[j] > cur:
 *         j -= 1             # <<<<<<<<<<<<<<
 * 
 *     while True:
 */
    __pyx_v_j = (__pyx_v_j - 1);
  }

  /* "pandas/src/generated.pyx":656
 *         j -= 1
 * 
 *     while True:             # <<<<<<<<<<<<<<
 *         if j < 0:
 *             break
 */
  while (1) {

    /* "pandas/src/generated.pyx":657
 * 
 *     while True:
 *         if j < 0:             # <<<<<<<<<<<<<<
 *             break
 * 
 */
    __pyx_t_16 = ((__pyx_v_j < 0) != 0);
    if (__pyx_t_16) {

      /* "pandas/src/generated.pyx":658
 *     while True:
 *         if j < 0:
 *             break             # <<<<<<<<<<<<<<
 * 
 *         if i == 0:
 */
      goto __pyx_L9_break;
    }

    /* "pandas/src/generated.pyx":660
 *             break
 * 
 *         if i == 0:             # <<<<<<<<<<<<<<
 *             while j >= 0:
 *                 if new[j] == cur:
 */
    __pyx_t_16 = ((__pyx_v_i == 0) != 0);
    if (__pyx_t_16) {

      /* "pandas/src/generated.pyx":661
 * 
 *         if i == 0:
 *             while j >= 0:             # <<<<<<<<<<<<<<
 *                 if new[j] == cur:
 *                     indexer[j] = i
 */
      while (1) {
        __pyx_t_16 = ((__pyx_v_j >= 0) != 0);
        if (!__pyx_t_16) break;

        /* "pandas/src/generated.pyx":662
 *         if i == 0:
 *             while j >= 0:
 *                 if new[j] == cur:             # <<<<<<<<<<<<<<
 *                     indexer[j] = i
 *                 elif new[j] < cur and fill_count < lim:
 */
        __pyx_t_19 = __pyx_v_j;
        __pyx_t_16 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_new.rcbuffer->pybuffer.buf, __pyx_t_19, __pyx_pybuffernd_new.diminfo[0].strides)) == __pyx_v_cur) != 0);
        if (__pyx_t_16) {

          /* "pandas/src/generated.pyx":663
 *             while j >= 0:
 *                 if new[j] == cur:
 *                     indexer[j] = i             # <<<<<<<<<<<<<<
 *                 elif new[j] < cur and fill_count < lim:
 *                     indexer[j] = i
 */
          __pyx_t_20 = __pyx_v_j;
          *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_indexer.diminfo[0].strides) = __pyx_v_i;
          goto __pyx_L14;
        }

        /* "pandas/src/generated.pyx":664
 *                 if new[j] == cur:
 *                     indexer[j] = i
 *                 elif new[j] < cur and fill_count < lim:             # <<<<<<<<<<<<<<
 *                     indexer[j] = i
 *                     fill_count += 1
 */
        __pyx_t_21 = __pyx_v_j;
        __pyx_t_16 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_new.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_new.diminfo[0].strides)) < __pyx_v_cur) != 0);
        if (__pyx_t_16) {
          __pyx_t_12 = ((__pyx_v_fill_count < __pyx_v_lim) != 0);
          __pyx_t_13 = __pyx_t_12;
        } else {
          __pyx_t_13 = __pyx_t_16;
        }
        if (__pyx_t_13) {

          /* "pandas/src/generated.pyx":665
 *                     indexer[j] = i
 *                 elif new[j] < cur and fill_count < lim:
 *                     indexer[j] = i             # <<<<<<<<<<<<<<
 *                     fill_count += 1
 *                 j -= 1
 */
          __pyx_t_22 = __pyx_v_j;
          *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_22, __pyx_pybuffernd_indexer.diminfo[0].strides) = __pyx_v_i;

          /* "pandas/src/generated.pyx":666
 *                 elif new[j] < cur and fill_count < lim:
 *                     indexer[j] = i
 *                     fill_count += 1             # <<<<<<<<<<<<<<
 *                 j -= 1
 *             break
 */
          __pyx_v_fill_count = (__pyx_v_fill_count + 1);
          goto __pyx_L14;
        }
        __pyx_L14:;

        /* "pandas/src/generated.pyx":667
 *                     indexer[j] = i
 *                     fill_count += 1
 *                 j -= 1             # <<<<<<<<<<<<<<
 *             break
 * 
 */
        __pyx_v_j = (__pyx_v_j - 1);
      }

      /* "pandas/src/generated.pyx":668
 *                     fill_count += 1
 *                 j -= 1
 *             break             # <<<<<<<<<<<<<<
 * 
 *         prev = old[i - 1]
 */
      goto __pyx_L9_break;
    }

    /* "pandas/src/generated.pyx":670
 *             break
 * 
 *         prev = old[i - 1]             # <<<<<<<<<<<<<<
 * 
 *         while j >= 0 and prev < new[j] <= cur:
 */
    __pyx_t_23 = (__pyx_v_i - 1);
    __pyx_v_prev = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_old.rcbuffer->pybuffer.buf, __pyx_t_23, __pyx_pybuffernd_old.diminfo[0].strides));

    /* "pandas/src/generated.pyx":672
 *         prev = old[i - 1]
 * 
 *         while j >= 0 and prev < new[j] <= cur:             # <<<<<<<<<<<<<<
 *             if new[j] == cur:
 *                 indexer[j] = i
 */
    while (1) {
      __pyx_t_13 = ((__pyx_v_j >= 0) != 0);
      if (__pyx_t_13) {
        __pyx_t_24 = __pyx_v_j;
        __pyx_t_25 = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_new.rcbuffer->pybuffer.buf, __pyx_t_24, __pyx_pybuffernd_new.diminfo[0].strides));
        __pyx_t_16 = (__pyx_v_prev < __pyx_t_25);
        if (__pyx_t_16) {
          __pyx_t_16 = (__pyx_t_25 <= __pyx_v_cur);
        }
        __pyx_t_12 = (__pyx_t_16 != 0);
      } else {
        __pyx_t_12 = __pyx_t_13;
      }
      if (!__pyx_t_12) break;

      /* "pandas/src/generated.pyx":673
 * 
 *         while j >= 0 and prev < new[j] <= cur:
 *             if new[j] == cur:             # <<<<<<<<<<<<<<
 *                 indexer[j] = i
 *             elif new[j] < cur and fill_count < lim:
 */
      __pyx_t_26 = __pyx_v_j;
      __pyx_t_12 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_new.rcbuffer->pybuffer.buf, __pyx_t_26, __pyx_pybuffernd_new.diminfo[0].strides)) == __pyx_v_cur) != 0);
      if (__pyx_t_12) {

        /* "pandas/src/generated.pyx":674
 *         while j >= 0 and prev < new[j] <= cur:
 *             if new[j] == cur:
 *                 indexer[j] = i             # <<<<<<<<<<<<<<
 *             elif new[j] < cur and fill_count < lim:
 *                 indexer[j] = i
 */
        __pyx_t_27 = __pyx_v_j;
        *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_27, __pyx_pybuffernd_indexer.diminfo[0].strides) = __pyx_v_i;
        goto __pyx_L17;
      }

      /* "pandas/src/generated.pyx":675
 *             if new[j] == cur:
 *                 indexer[j] = i
 *             elif new[j] < cur and fill_count < lim:             # <<<<<<<<<<<<<<
 *                 indexer[j] = i
 *                 fill_count += 1
 */
      __pyx_t_28 = __pyx_v_j;
      __pyx_t_12 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_new.rcbuffer->pybuffer.buf, __pyx_t_28, __pyx_pybuffernd_new.diminfo[0].strides)) < __pyx_v_cur) != 0);
      if (__pyx_t_12) {
        __pyx_t_13 = ((__pyx_v_fill_count < __pyx_v_lim) != 0);
        __pyx_t_16 = __pyx_t_13;
      } else {
        __pyx_t_16 = __pyx_t_12;
      }
      if (__pyx_t_16) {

        /* "pandas/src/generated.pyx":676
 *                 indexer[j] = i
 *             elif new[j] < cur and fill_count < lim:
 *                 indexer[j] = i             # <<<<<<<<<<<<<<
 *                 fill_count += 1
 *             j -= 1
 */
        __pyx_t_29 = __pyx_v_j;
        *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_29, __pyx_pybuffernd_indexer.diminfo[0].strides) = __pyx_v_i;

        /* "pandas/src/generated.pyx":677
 *             elif new[j] < cur and fill_count < lim:
 *                 indexer[j] = i
 *                 fill_count += 1             # <<<<<<<<<<<<<<
 *             j -= 1
 * 
 */
        __pyx_v_fill_count = (__pyx_v_fill_count + 1);
        goto __pyx_L17;
      }
      __pyx_L17:;

      /* "pandas/src/generated.pyx":678
 *                 indexer[j] = i
 *                 fill_count += 1
 *             j -= 1             # <<<<<<<<<<<<<<
 * 
 *         fill_count = 0
 */
      __pyx_v_j = (__pyx_v_j - 1);
    }

    /* "pandas/src/generated.pyx":680
 *             j -= 1
 * 
 *         fill_count = 0             # <<<<<<<<<<<<<<
 *         i -= 1
 *         cur = prev
 */
    __pyx_v_fill_count = 0;

    /* "pandas/src/generated.pyx":681
 * 
 *         fill_count = 0
 *         i -= 1             # <<<<<<<<<<<<<<
 *         cur = prev
 * 
 */
    __pyx_v_i = (__pyx_v_i - 1);

    /* "pandas/src/generated.pyx":682
 *         fill_count = 0
 *         i -= 1
 *         cur = prev             # <<<<<<<<<<<<<<
 * 
 *     return indexer
 */
    __pyx_v_cur = __pyx_v_prev;
  }
  __pyx_L9_break:;

  /* "pandas/src/generated.pyx":684
 *         cur = prev
 * 
 *     return indexer             # <<<<<<<<<<<<<<
 * 
 * @cython.boundscheck(False)
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_indexer));
  __pyx_r = ((PyObject *)__pyx_v_indexer);
  goto __pyx_L0;

  /* "pandas/src/generated.pyx":626
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def backfill_float64(ndarray[float64_t] old, ndarray[float64_t] new,             # <<<<<<<<<<<<<<
 *                       limit=None):
 *     cdef Py_ssize_t i, j, nleft, nright
 */

  /* function exit code */
  __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_pybuffernd_indexer.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_new.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_old.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas.algos.backfill_float64", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_new.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_old.rcbuffer->pybuffer);
  __pyx_L2:;
  __Pyx_XDECREF((PyObject *)__pyx_v_indexer);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/src/generated.pyx":688
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def backfill_float32(ndarray[float32_t] old, ndarray[float32_t] new,             # <<<<<<<<<<<<<<
 *                       limit=None):
 *     cdef Py_ssize_t i, j, nleft, nright
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pandas_5algos_129backfill_float32(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_5algos_129backfill_float32 = {__Pyx_NAMESTR("backfill_float32"), (PyCFunction)__pyx_pw_6pandas_5algos_129backfill_float32, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pw_6pandas_5algos_129backfill_float32(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyArrayObject *__pyx_v_old = 0;
  PyArrayObject *__pyx_v_new = 0;
  PyObject *__pyx_v_limit = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("backfill_float32 (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_old,&__pyx_n_s_new,&__pyx_n_s_limit,0};
    PyObject* values[3] = {0,0,0};

    /* "pandas/src/generated.pyx":689
 * @cython.wraparound(False)
 * def backfill_float32(ndarray[float32_t] old, ndarray[float32_t] new,
 *                       limit=None):             # <<<<<<<<<<<<<<
 *     cdef Py_ssize_t i, j, nleft, nright
 *     cdef ndarray[int64_t, ndim=1] indexer
 */
    values[2] = ((PyObject *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_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 (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_old)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_new)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("backfill_float32", 0, 2, 3, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 688; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_limit);
          if (value) { values[2] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "backfill_float32") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 688; __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_old = ((PyArrayObject *)values[0]);
    __pyx_v_new = ((PyArrayObject *)values[1]);
    __pyx_v_limit = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("backfill_float32", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 688; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas.algos.backfill_float32", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_old), __pyx_ptype_5numpy_ndarray, 1, "old", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 688; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_new), __pyx_ptype_5numpy_ndarray, 1, "new", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 688; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_128backfill_float32(__pyx_self, __pyx_v_old, __pyx_v_new, __pyx_v_limit);

  /* "pandas/src/generated.pyx":688
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def backfill_float32(ndarray[float32_t] old, ndarray[float32_t] new,             # <<<<<<<<<<<<<<
 *                       limit=None):
 *     cdef Py_ssize_t i, j, nleft, nright
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pandas_5algos_128backfill_float32(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_old, PyArrayObject *__pyx_v_new, PyObject *__pyx_v_limit) {
  Py_ssize_t __pyx_v_i;
  Py_ssize_t __pyx_v_j;
  Py_ssize_t __pyx_v_nleft;
  Py_ssize_t __pyx_v_nright;
  PyArrayObject *__pyx_v_indexer = 0;
  __pyx_t_5numpy_float32_t __pyx_v_cur;
  __pyx_t_5numpy_float32_t __pyx_v_prev;
  int __pyx_v_lim;
  int __pyx_v_fill_count;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_indexer;
  __Pyx_Buffer __pyx_pybuffer_indexer;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_new;
  __Pyx_Buffer __pyx_pybuffer_new;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_old;
  __Pyx_Buffer __pyx_pybuffer_old;
  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;
  long __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;
  Py_ssize_t __pyx_t_23;
  Py_ssize_t __pyx_t_24;
  __pyx_t_5numpy_float32_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;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("backfill_float32", 0);
  __pyx_pybuffer_indexer.pybuffer.buf = NULL;
  __pyx_pybuffer_indexer.refcount = 0;
  __pyx_pybuffernd_indexer.data = NULL;
  __pyx_pybuffernd_indexer.rcbuffer = &__pyx_pybuffer_indexer;
  __pyx_pybuffer_old.pybuffer.buf = NULL;
  __pyx_pybuffer_old.refcount = 0;
  __pyx_pybuffernd_old.data = NULL;
  __pyx_pybuffernd_old.rcbuffer = &__pyx_pybuffer_old;
  __pyx_pybuffer_new.pybuffer.buf = NULL;
  __pyx_pybuffer_new.refcount = 0;
  __pyx_pybuffernd_new.data = NULL;
  __pyx_pybuffernd_new.rcbuffer = &__pyx_pybuffer_new;
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_old.rcbuffer->pybuffer, (PyObject*)__pyx_v_old, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 688; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_old.diminfo[0].strides = __pyx_pybuffernd_old.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_old.diminfo[0].shape = __pyx_pybuffernd_old.rcbuffer->pybuffer.shape[0];
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_new.rcbuffer->pybuffer, (PyObject*)__pyx_v_new, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 688; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_new.diminfo[0].strides = __pyx_pybuffernd_new.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_new.diminfo[0].shape = __pyx_pybuffernd_new.rcbuffer->pybuffer.shape[0];

  /* "pandas/src/generated.pyx":693
 *     cdef ndarray[int64_t, ndim=1] indexer
 *     cdef float32_t cur, prev
 *     cdef int lim, fill_count = 0             # <<<<<<<<<<<<<<
 * 
 *     nleft = len(old)
 */
  __pyx_v_fill_count = 0;

  /* "pandas/src/generated.pyx":695
 *     cdef int lim, fill_count = 0
 * 
 *     nleft = len(old)             # <<<<<<<<<<<<<<
 *     nright = len(new)
 *     indexer = np.empty(nright, dtype=np.int64)
 */
  __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_old)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 695; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_nleft = __pyx_t_1;

  /* "pandas/src/generated.pyx":696
 * 
 *     nleft = len(old)
 *     nright = len(new)             # <<<<<<<<<<<<<<
 *     indexer = np.empty(nright, dtype=np.int64)
 *     indexer.fill(-1)
 */
  __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_new)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 696; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_nright = __pyx_t_1;

  /* "pandas/src/generated.pyx":697
 *     nleft = len(old)
 *     nright = len(new)
 *     indexer = np.empty(nright, dtype=np.int64)             # <<<<<<<<<<<<<<
 *     indexer.fill(-1)
 * 
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 697; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_empty); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 697; __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_nright); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 697; __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 = 697; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__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 = 697; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 697; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_int64); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 697; __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, __pyx_n_s_dtype, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 697; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 697; __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_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__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 = 697; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_7 = ((PyArrayObject *)__pyx_t_6);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer);
    __pyx_t_8 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer, (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_pybuffernd_indexer.rcbuffer->pybuffer, (PyObject*)__pyx_v_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_pybuffernd_indexer.diminfo[0].strides = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_indexer.diminfo[0].shape = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.shape[0];
    if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 697; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_7 = 0;
  __pyx_v_indexer = ((PyArrayObject *)__pyx_t_6);
  __pyx_t_6 = 0;

  /* "pandas/src/generated.pyx":698
 *     nright = len(new)
 *     indexer = np.empty(nright, dtype=np.int64)
 *     indexer.fill(-1)             # <<<<<<<<<<<<<<
 * 
 *     if limit is None:
 */
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_indexer), __pyx_n_s_fill); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 698; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_tuple__64, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 698; __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/generated.pyx":700
 *     indexer.fill(-1)
 * 
 *     if limit is None:             # <<<<<<<<<<<<<<
 *         lim = nright
 *     else:
 */
  __pyx_t_12 = (__pyx_v_limit == Py_None);
  __pyx_t_13 = (__pyx_t_12 != 0);
  if (__pyx_t_13) {

    /* "pandas/src/generated.pyx":701
 * 
 *     if limit is None:
 *         lim = nright             # <<<<<<<<<<<<<<
 *     else:
 *         if limit < 0:
 */
    __pyx_v_lim = __pyx_v_nright;
    goto __pyx_L3;
  }
  /*else*/ {

    /* "pandas/src/generated.pyx":703
 *         lim = nright
 *     else:
 *         if limit < 0:             # <<<<<<<<<<<<<<
 *             raise ValueError('Limit must be non-negative')
 *         lim = limit
 */
    __pyx_t_2 = PyObject_RichCompare(__pyx_v_limit, __pyx_int_0, Py_LT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 703; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_13 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_13 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 703; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (__pyx_t_13) {

      /* "pandas/src/generated.pyx":704
 *     else:
 *         if limit < 0:
 *             raise ValueError('Limit must be non-negative')             # <<<<<<<<<<<<<<
 *         lim = limit
 * 
 */
      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__65, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 704; __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 = 704; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }

    /* "pandas/src/generated.pyx":705
 *         if limit < 0:
 *             raise ValueError('Limit must be non-negative')
 *         lim = limit             # <<<<<<<<<<<<<<
 * 
 *     if nleft == 0 or nright == 0 or new[0] > old[nleft - 1]:
 */
    __pyx_t_8 = __Pyx_PyInt_As_int(__pyx_v_limit); if (unlikely((__pyx_t_8 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 705; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_v_lim = __pyx_t_8;
  }
  __pyx_L3:;

  /* "pandas/src/generated.pyx":707
 *         lim = limit
 * 
 *     if nleft == 0 or nright == 0 or new[0] > old[nleft - 1]:             # <<<<<<<<<<<<<<
 *         return indexer
 * 
 */
  __pyx_t_13 = ((__pyx_v_nleft == 0) != 0);
  if (!__pyx_t_13) {
    __pyx_t_12 = ((__pyx_v_nright == 0) != 0);
    if (!__pyx_t_12) {
      __pyx_t_14 = 0;
      __pyx_t_1 = (__pyx_v_nleft - 1);
      __pyx_t_15 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_new.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_new.diminfo[0].strides)) > (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_old.rcbuffer->pybuffer.buf, __pyx_t_1, __pyx_pybuffernd_old.diminfo[0].strides))) != 0);
      __pyx_t_16 = __pyx_t_15;
    } else {
      __pyx_t_16 = __pyx_t_12;
    }
    __pyx_t_12 = __pyx_t_16;
  } else {
    __pyx_t_12 = __pyx_t_13;
  }
  if (__pyx_t_12) {

    /* "pandas/src/generated.pyx":708
 * 
 *     if nleft == 0 or nright == 0 or new[0] > old[nleft - 1]:
 *         return indexer             # <<<<<<<<<<<<<<
 * 
 *     i = nleft - 1
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(((PyObject *)__pyx_v_indexer));
    __pyx_r = ((PyObject *)__pyx_v_indexer);
    goto __pyx_L0;
  }

  /* "pandas/src/generated.pyx":710
 *         return indexer
 * 
 *     i = nleft - 1             # <<<<<<<<<<<<<<
 *     j = nright - 1
 * 
 */
  __pyx_v_i = (__pyx_v_nleft - 1);

  /* "pandas/src/generated.pyx":711
 * 
 *     i = nleft - 1
 *     j = nright - 1             # <<<<<<<<<<<<<<
 * 
 *     cur = old[nleft - 1]
 */
  __pyx_v_j = (__pyx_v_nright - 1);

  /* "pandas/src/generated.pyx":713
 *     j = nright - 1
 * 
 *     cur = old[nleft - 1]             # <<<<<<<<<<<<<<
 * 
 *     while j >= 0 and new[j] > cur:
 */
  __pyx_t_17 = (__pyx_v_nleft - 1);
  __pyx_v_cur = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_old.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_old.diminfo[0].strides));

  /* "pandas/src/generated.pyx":715
 *     cur = old[nleft - 1]
 * 
 *     while j >= 0 and new[j] > cur:             # <<<<<<<<<<<<<<
 *         j -= 1
 * 
 */
  while (1) {
    __pyx_t_12 = ((__pyx_v_j >= 0) != 0);
    if (__pyx_t_12) {
      __pyx_t_18 = __pyx_v_j;
      __pyx_t_13 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_new.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_new.diminfo[0].strides)) > __pyx_v_cur) != 0);
      __pyx_t_16 = __pyx_t_13;
    } else {
      __pyx_t_16 = __pyx_t_12;
    }
    if (!__pyx_t_16) break;

    /* "pandas/src/generated.pyx":716
 * 
 *     while j >= 0 and new[j] > cur:
 *         j -= 1             # <<<<<<<<<<<<<<
 * 
 *     while True:
 */
    __pyx_v_j = (__pyx_v_j - 1);
  }

  /* "pandas/src/generated.pyx":718
 *         j -= 1
 * 
 *     while True:             # <<<<<<<<<<<<<<
 *         if j < 0:
 *             break
 */
  while (1) {

    /* "pandas/src/generated.pyx":719
 * 
 *     while True:
 *         if j < 0:             # <<<<<<<<<<<<<<
 *             break
 * 
 */
    __pyx_t_16 = ((__pyx_v_j < 0) != 0);
    if (__pyx_t_16) {

      /* "pandas/src/generated.pyx":720
 *     while True:
 *         if j < 0:
 *             break             # <<<<<<<<<<<<<<
 * 
 *         if i == 0:
 */
      goto __pyx_L9_break;
    }

    /* "pandas/src/generated.pyx":722
 *             break
 * 
 *         if i == 0:             # <<<<<<<<<<<<<<
 *             while j >= 0:
 *                 if new[j] == cur:
 */
    __pyx_t_16 = ((__pyx_v_i == 0) != 0);
    if (__pyx_t_16) {

      /* "pandas/src/generated.pyx":723
 * 
 *         if i == 0:
 *             while j >= 0:             # <<<<<<<<<<<<<<
 *                 if new[j] == cur:
 *                     indexer[j] = i
 */
      while (1) {
        __pyx_t_16 = ((__pyx_v_j >= 0) != 0);
        if (!__pyx_t_16) break;

        /* "pandas/src/generated.pyx":724
 *         if i == 0:
 *             while j >= 0:
 *                 if new[j] == cur:             # <<<<<<<<<<<<<<
 *                     indexer[j] = i
 *                 elif new[j] < cur and fill_count < lim:
 */
        __pyx_t_19 = __pyx_v_j;
        __pyx_t_16 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_new.rcbuffer->pybuffer.buf, __pyx_t_19, __pyx_pybuffernd_new.diminfo[0].strides)) == __pyx_v_cur) != 0);
        if (__pyx_t_16) {

          /* "pandas/src/generated.pyx":725
 *             while j >= 0:
 *                 if new[j] == cur:
 *                     indexer[j] = i             # <<<<<<<<<<<<<<
 *                 elif new[j] < cur and fill_count < lim:
 *                     indexer[j] = i
 */
          __pyx_t_20 = __pyx_v_j;
          *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_indexer.diminfo[0].strides) = __pyx_v_i;
          goto __pyx_L14;
        }

        /* "pandas/src/generated.pyx":726
 *                 if new[j] == cur:
 *                     indexer[j] = i
 *                 elif new[j] < cur and fill_count < lim:             # <<<<<<<<<<<<<<
 *                     indexer[j] = i
 *                     fill_count += 1
 */
        __pyx_t_21 = __pyx_v_j;
        __pyx_t_16 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_new.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_new.diminfo[0].strides)) < __pyx_v_cur) != 0);
        if (__pyx_t_16) {
          __pyx_t_12 = ((__pyx_v_fill_count < __pyx_v_lim) != 0);
          __pyx_t_13 = __pyx_t_12;
        } else {
          __pyx_t_13 = __pyx_t_16;
        }
        if (__pyx_t_13) {

          /* "pandas/src/generated.pyx":727
 *                     indexer[j] = i
 *                 elif new[j] < cur and fill_count < lim:
 *                     indexer[j] = i             # <<<<<<<<<<<<<<
 *                     fill_count += 1
 *                 j -= 1
 */
          __pyx_t_22 = __pyx_v_j;
          *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_22, __pyx_pybuffernd_indexer.diminfo[0].strides) = __pyx_v_i;

          /* "pandas/src/generated.pyx":728
 *                 elif new[j] < cur and fill_count < lim:
 *                     indexer[j] = i
 *                     fill_count += 1             # <<<<<<<<<<<<<<
 *                 j -= 1
 *             break
 */
          __pyx_v_fill_count = (__pyx_v_fill_count + 1);
          goto __pyx_L14;
        }
        __pyx_L14:;

        /* "pandas/src/generated.pyx":729
 *                     indexer[j] = i
 *                     fill_count += 1
 *                 j -= 1             # <<<<<<<<<<<<<<
 *             break
 * 
 */
        __pyx_v_j = (__pyx_v_j - 1);
      }

      /* "pandas/src/generated.pyx":730
 *                     fill_count += 1
 *                 j -= 1
 *             break             # <<<<<<<<<<<<<<
 * 
 *         prev = old[i - 1]
 */
      goto __pyx_L9_break;
    }

    /* "pandas/src/generated.pyx":732
 *             break
 * 
 *         prev = old[i - 1]             # <<<<<<<<<<<<<<
 * 
 *         while j >= 0 and prev < new[j] <= cur:
 */
    __pyx_t_23 = (__pyx_v_i - 1);
    __pyx_v_prev = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_old.rcbuffer->pybuffer.buf, __pyx_t_23, __pyx_pybuffernd_old.diminfo[0].strides));

    /* "pandas/src/generated.pyx":734
 *         prev = old[i - 1]
 * 
 *         while j >= 0 and prev < new[j] <= cur:             # <<<<<<<<<<<<<<
 *             if new[j] == cur:
 *                 indexer[j] = i
 */
    while (1) {
      __pyx_t_13 = ((__pyx_v_j >= 0) != 0);
      if (__pyx_t_13) {
        __pyx_t_24 = __pyx_v_j;
        __pyx_t_25 = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_new.rcbuffer->pybuffer.buf, __pyx_t_24, __pyx_pybuffernd_new.diminfo[0].strides));
        __pyx_t_16 = (__pyx_v_prev < __pyx_t_25);
        if (__pyx_t_16) {
          __pyx_t_16 = (__pyx_t_25 <= __pyx_v_cur);
        }
        __pyx_t_12 = (__pyx_t_16 != 0);
      } else {
        __pyx_t_12 = __pyx_t_13;
      }
      if (!__pyx_t_12) break;

      /* "pandas/src/generated.pyx":735
 * 
 *         while j >= 0 and prev < new[j] <= cur:
 *             if new[j] == cur:             # <<<<<<<<<<<<<<
 *                 indexer[j] = i
 *             elif new[j] < cur and fill_count < lim:
 */
      __pyx_t_26 = __pyx_v_j;
      __pyx_t_12 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_new.rcbuffer->pybuffer.buf, __pyx_t_26, __pyx_pybuffernd_new.diminfo[0].strides)) == __pyx_v_cur) != 0);
      if (__pyx_t_12) {

        /* "pandas/src/generated.pyx":736
 *         while j >= 0 and prev < new[j] <= cur:
 *             if new[j] == cur:
 *                 indexer[j] = i             # <<<<<<<<<<<<<<
 *             elif new[j] < cur and fill_count < lim:
 *                 indexer[j] = i
 */
        __pyx_t_27 = __pyx_v_j;
        *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_27, __pyx_pybuffernd_indexer.diminfo[0].strides) = __pyx_v_i;
        goto __pyx_L17;
      }

      /* "pandas/src/generated.pyx":737
 *             if new[j] == cur:
 *                 indexer[j] = i
 *             elif new[j] < cur and fill_count < lim:             # <<<<<<<<<<<<<<
 *                 indexer[j] = i
 *                 fill_count += 1
 */
      __pyx_t_28 = __pyx_v_j;
      __pyx_t_12 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_new.rcbuffer->pybuffer.buf, __pyx_t_28, __pyx_pybuffernd_new.diminfo[0].strides)) < __pyx_v_cur) != 0);
      if (__pyx_t_12) {
        __pyx_t_13 = ((__pyx_v_fill_count < __pyx_v_lim) != 0);
        __pyx_t_16 = __pyx_t_13;
      } else {
        __pyx_t_16 = __pyx_t_12;
      }
      if (__pyx_t_16) {

        /* "pandas/src/generated.pyx":738
 *                 indexer[j] = i
 *             elif new[j] < cur and fill_count < lim:
 *                 indexer[j] = i             # <<<<<<<<<<<<<<
 *                 fill_count += 1
 *             j -= 1
 */
        __pyx_t_29 = __pyx_v_j;
        *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_29, __pyx_pybuffernd_indexer.diminfo[0].strides) = __pyx_v_i;

        /* "pandas/src/generated.pyx":739
 *             elif new[j] < cur and fill_count < lim:
 *                 indexer[j] = i
 *                 fill_count += 1             # <<<<<<<<<<<<<<
 *             j -= 1
 * 
 */
        __pyx_v_fill_count = (__pyx_v_fill_count + 1);
        goto __pyx_L17;
      }
      __pyx_L17:;

      /* "pandas/src/generated.pyx":740
 *                 indexer[j] = i
 *                 fill_count += 1
 *             j -= 1             # <<<<<<<<<<<<<<
 * 
 *         fill_count = 0
 */
      __pyx_v_j = (__pyx_v_j - 1);
    }

    /* "pandas/src/generated.pyx":742
 *             j -= 1
 * 
 *         fill_count = 0             # <<<<<<<<<<<<<<
 *         i -= 1
 *         cur = prev
 */
    __pyx_v_fill_count = 0;

    /* "pandas/src/generated.pyx":743
 * 
 *         fill_count = 0
 *         i -= 1             # <<<<<<<<<<<<<<
 *         cur = prev
 * 
 */
    __pyx_v_i = (__pyx_v_i - 1);

    /* "pandas/src/generated.pyx":744
 *         fill_count = 0
 *         i -= 1
 *         cur = prev             # <<<<<<<<<<<<<<
 * 
 *     return indexer
 */
    __pyx_v_cur = __pyx_v_prev;
  }
  __pyx_L9_break:;

  /* "pandas/src/generated.pyx":746
 *         cur = prev
 * 
 *     return indexer             # <<<<<<<<<<<<<<
 * 
 * @cython.boundscheck(False)
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_indexer));
  __pyx_r = ((PyObject *)__pyx_v_indexer);
  goto __pyx_L0;

  /* "pandas/src/generated.pyx":688
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def backfill_float32(ndarray[float32_t] old, ndarray[float32_t] new,             # <<<<<<<<<<<<<<
 *                       limit=None):
 *     cdef Py_ssize_t i, j, nleft, nright
 */

  /* function exit code */
  __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_pybuffernd_indexer.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_new.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_old.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas.algos.backfill_float32", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_new.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_old.rcbuffer->pybuffer);
  __pyx_L2:;
  __Pyx_XDECREF((PyObject *)__pyx_v_indexer);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/src/generated.pyx":750
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def backfill_object(ndarray[object] old, ndarray[object] new,             # <<<<<<<<<<<<<<
 *                       limit=None):
 *     cdef Py_ssize_t i, j, nleft, nright
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pandas_5algos_131backfill_object(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_5algos_131backfill_object = {__Pyx_NAMESTR("backfill_object"), (PyCFunction)__pyx_pw_6pandas_5algos_131backfill_object, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pw_6pandas_5algos_131backfill_object(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyArrayObject *__pyx_v_old = 0;
  PyArrayObject *__pyx_v_new = 0;
  PyObject *__pyx_v_limit = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("backfill_object (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_old,&__pyx_n_s_new,&__pyx_n_s_limit,0};
    PyObject* values[3] = {0,0,0};

    /* "pandas/src/generated.pyx":751
 * @cython.wraparound(False)
 * def backfill_object(ndarray[object] old, ndarray[object] new,
 *                       limit=None):             # <<<<<<<<<<<<<<
 *     cdef Py_ssize_t i, j, nleft, nright
 *     cdef ndarray[int64_t, ndim=1] indexer
 */
    values[2] = ((PyObject *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_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 (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_old)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_new)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("backfill_object", 0, 2, 3, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 750; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_limit);
          if (value) { values[2] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "backfill_object") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 750; __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_old = ((PyArrayObject *)values[0]);
    __pyx_v_new = ((PyArrayObject *)values[1]);
    __pyx_v_limit = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("backfill_object", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 750; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas.algos.backfill_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_old), __pyx_ptype_5numpy_ndarray, 1, "old", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 750; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_new), __pyx_ptype_5numpy_ndarray, 1, "new", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 750; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_130backfill_object(__pyx_self, __pyx_v_old, __pyx_v_new, __pyx_v_limit);

  /* "pandas/src/generated.pyx":750
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def backfill_object(ndarray[object] old, ndarray[object] new,             # <<<<<<<<<<<<<<
 *                       limit=None):
 *     cdef Py_ssize_t i, j, nleft, nright
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pandas_5algos_130backfill_object(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_old, PyArrayObject *__pyx_v_new, PyObject *__pyx_v_limit) {
  Py_ssize_t __pyx_v_i;
  Py_ssize_t __pyx_v_j;
  Py_ssize_t __pyx_v_nleft;
  Py_ssize_t __pyx_v_nright;
  PyArrayObject *__pyx_v_indexer = 0;
  PyObject *__pyx_v_cur = 0;
  PyObject *__pyx_v_prev = 0;
  int __pyx_v_lim;
  int __pyx_v_fill_count;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_indexer;
  __Pyx_Buffer __pyx_pybuffer_indexer;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_new;
  __Pyx_Buffer __pyx_pybuffer_new;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_old;
  __Pyx_Buffer __pyx_pybuffer_old;
  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;
  long __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;
  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;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("backfill_object", 0);
  __pyx_pybuffer_indexer.pybuffer.buf = NULL;
  __pyx_pybuffer_indexer.refcount = 0;
  __pyx_pybuffernd_indexer.data = NULL;
  __pyx_pybuffernd_indexer.rcbuffer = &__pyx_pybuffer_indexer;
  __pyx_pybuffer_old.pybuffer.buf = NULL;
  __pyx_pybuffer_old.refcount = 0;
  __pyx_pybuffernd_old.data = NULL;
  __pyx_pybuffernd_old.rcbuffer = &__pyx_pybuffer_old;
  __pyx_pybuffer_new.pybuffer.buf = NULL;
  __pyx_pybuffer_new.refcount = 0;
  __pyx_pybuffernd_new.data = NULL;
  __pyx_pybuffernd_new.rcbuffer = &__pyx_pybuffer_new;
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_old.rcbuffer->pybuffer, (PyObject*)__pyx_v_old, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 750; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_old.diminfo[0].strides = __pyx_pybuffernd_old.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_old.diminfo[0].shape = __pyx_pybuffernd_old.rcbuffer->pybuffer.shape[0];
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_new.rcbuffer->pybuffer, (PyObject*)__pyx_v_new, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 750; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_new.diminfo[0].strides = __pyx_pybuffernd_new.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_new.diminfo[0].shape = __pyx_pybuffernd_new.rcbuffer->pybuffer.shape[0];

  /* "pandas/src/generated.pyx":755
 *     cdef ndarray[int64_t, ndim=1] indexer
 *     cdef object cur, prev
 *     cdef int lim, fill_count = 0             # <<<<<<<<<<<<<<
 * 
 *     nleft = len(old)
 */
  __pyx_v_fill_count = 0;

  /* "pandas/src/generated.pyx":757
 *     cdef int lim, fill_count = 0
 * 
 *     nleft = len(old)             # <<<<<<<<<<<<<<
 *     nright = len(new)
 *     indexer = np.empty(nright, dtype=np.int64)
 */
  __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_old)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 757; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_nleft = __pyx_t_1;

  /* "pandas/src/generated.pyx":758
 * 
 *     nleft = len(old)
 *     nright = len(new)             # <<<<<<<<<<<<<<
 *     indexer = np.empty(nright, dtype=np.int64)
 *     indexer.fill(-1)
 */
  __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_new)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 758; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_nright = __pyx_t_1;

  /* "pandas/src/generated.pyx":759
 *     nleft = len(old)
 *     nright = len(new)
 *     indexer = np.empty(nright, dtype=np.int64)             # <<<<<<<<<<<<<<
 *     indexer.fill(-1)
 * 
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 759; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_empty); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 759; __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_nright); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 759; __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 = 759; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__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 = 759; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 759; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_int64); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 759; __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, __pyx_n_s_dtype, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 759; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 759; __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_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__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 = 759; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_7 = ((PyArrayObject *)__pyx_t_6);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer);
    __pyx_t_8 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer, (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_pybuffernd_indexer.rcbuffer->pybuffer, (PyObject*)__pyx_v_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_pybuffernd_indexer.diminfo[0].strides = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_indexer.diminfo[0].shape = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.shape[0];
    if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 759; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_7 = 0;
  __pyx_v_indexer = ((PyArrayObject *)__pyx_t_6);
  __pyx_t_6 = 0;

  /* "pandas/src/generated.pyx":760
 *     nright = len(new)
 *     indexer = np.empty(nright, dtype=np.int64)
 *     indexer.fill(-1)             # <<<<<<<<<<<<<<
 * 
 *     if limit is None:
 */
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_indexer), __pyx_n_s_fill); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 760; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_tuple__66, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 760; __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/generated.pyx":762
 *     indexer.fill(-1)
 * 
 *     if limit is None:             # <<<<<<<<<<<<<<
 *         lim = nright
 *     else:
 */
  __pyx_t_12 = (__pyx_v_limit == Py_None);
  __pyx_t_13 = (__pyx_t_12 != 0);
  if (__pyx_t_13) {

    /* "pandas/src/generated.pyx":763
 * 
 *     if limit is None:
 *         lim = nright             # <<<<<<<<<<<<<<
 *     else:
 *         if limit < 0:
 */
    __pyx_v_lim = __pyx_v_nright;
    goto __pyx_L3;
  }
  /*else*/ {

    /* "pandas/src/generated.pyx":765
 *         lim = nright
 *     else:
 *         if limit < 0:             # <<<<<<<<<<<<<<
 *             raise ValueError('Limit must be non-negative')
 *         lim = limit
 */
    __pyx_t_2 = PyObject_RichCompare(__pyx_v_limit, __pyx_int_0, Py_LT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 765; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_13 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_13 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 765; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (__pyx_t_13) {

      /* "pandas/src/generated.pyx":766
 *     else:
 *         if limit < 0:
 *             raise ValueError('Limit must be non-negative')             # <<<<<<<<<<<<<<
 *         lim = limit
 * 
 */
      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__67, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 766; __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 = 766; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }

    /* "pandas/src/generated.pyx":767
 *         if limit < 0:
 *             raise ValueError('Limit must be non-negative')
 *         lim = limit             # <<<<<<<<<<<<<<
 * 
 *     if nleft == 0 or nright == 0 or new[0] > old[nleft - 1]:
 */
    __pyx_t_8 = __Pyx_PyInt_As_int(__pyx_v_limit); if (unlikely((__pyx_t_8 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 767; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_v_lim = __pyx_t_8;
  }
  __pyx_L3:;

  /* "pandas/src/generated.pyx":769
 *         lim = limit
 * 
 *     if nleft == 0 or nright == 0 or new[0] > old[nleft - 1]:             # <<<<<<<<<<<<<<
 *         return indexer
 * 
 */
  __pyx_t_13 = (__pyx_v_nleft == 0);
  if (!__pyx_t_13) {
    __pyx_t_12 = (__pyx_v_nright == 0);
    if (!__pyx_t_12) {
      __pyx_t_14 = 0;
      __pyx_t_2 = (PyObject *) *__Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_new.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_new.diminfo[0].strides);
      __Pyx_INCREF((PyObject*)__pyx_t_2);
      __pyx_t_1 = (__pyx_v_nleft - 1);
      __pyx_t_6 = (PyObject *) *__Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_old.rcbuffer->pybuffer.buf, __pyx_t_1, __pyx_pybuffernd_old.diminfo[0].strides);
      __Pyx_INCREF((PyObject*)__pyx_t_6);
      __pyx_t_4 = PyObject_RichCompare(__pyx_t_2, __pyx_t_6, Py_GT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 769; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_15 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_15 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 769; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_16 = __pyx_t_15;
    } else {
      __pyx_t_16 = __pyx_t_12;
    }
    __pyx_t_12 = __pyx_t_16;
  } else {
    __pyx_t_12 = __pyx_t_13;
  }
  if (__pyx_t_12) {

    /* "pandas/src/generated.pyx":770
 * 
 *     if nleft == 0 or nright == 0 or new[0] > old[nleft - 1]:
 *         return indexer             # <<<<<<<<<<<<<<
 * 
 *     i = nleft - 1
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(((PyObject *)__pyx_v_indexer));
    __pyx_r = ((PyObject *)__pyx_v_indexer);
    goto __pyx_L0;
  }

  /* "pandas/src/generated.pyx":772
 *         return indexer
 * 
 *     i = nleft - 1             # <<<<<<<<<<<<<<
 *     j = nright - 1
 * 
 */
  __pyx_v_i = (__pyx_v_nleft - 1);

  /* "pandas/src/generated.pyx":773
 * 
 *     i = nleft - 1
 *     j = nright - 1             # <<<<<<<<<<<<<<
 * 
 *     cur = old[nleft - 1]
 */
  __pyx_v_j = (__pyx_v_nright - 1);

  /* "pandas/src/generated.pyx":775
 *     j = nright - 1
 * 
 *     cur = old[nleft - 1]             # <<<<<<<<<<<<<<
 * 
 *     while j >= 0 and new[j] > cur:
 */
  __pyx_t_17 = (__pyx_v_nleft - 1);
  __pyx_t_4 = (PyObject *) *__Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_old.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_old.diminfo[0].strides);
  __Pyx_INCREF((PyObject*)__pyx_t_4);
  __pyx_v_cur = __pyx_t_4;
  __pyx_t_4 = 0;

  /* "pandas/src/generated.pyx":777
 *     cur = old[nleft - 1]
 * 
 *     while j >= 0 and new[j] > cur:             # <<<<<<<<<<<<<<
 *         j -= 1
 * 
 */
  while (1) {
    __pyx_t_12 = (__pyx_v_j >= 0);
    if (__pyx_t_12) {
      __pyx_t_18 = __pyx_v_j;
      __pyx_t_4 = (PyObject *) *__Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_new.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_new.diminfo[0].strides);
      __Pyx_INCREF((PyObject*)__pyx_t_4);
      __pyx_t_6 = PyObject_RichCompare(__pyx_t_4, __pyx_v_cur, Py_GT); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 777; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_13 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_13 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 777; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_16 = __pyx_t_13;
    } else {
      __pyx_t_16 = __pyx_t_12;
    }
    if (!__pyx_t_16) break;

    /* "pandas/src/generated.pyx":778
 * 
 *     while j >= 0 and new[j] > cur:
 *         j -= 1             # <<<<<<<<<<<<<<
 * 
 *     while True:
 */
    __pyx_v_j = (__pyx_v_j - 1);
  }

  /* "pandas/src/generated.pyx":780
 *         j -= 1
 * 
 *     while True:             # <<<<<<<<<<<<<<
 *         if j < 0:
 *             break
 */
  while (1) {

    /* "pandas/src/generated.pyx":781
 * 
 *     while True:
 *         if j < 0:             # <<<<<<<<<<<<<<
 *             break
 * 
 */
    __pyx_t_16 = ((__pyx_v_j < 0) != 0);
    if (__pyx_t_16) {

      /* "pandas/src/generated.pyx":782
 *     while True:
 *         if j < 0:
 *             break             # <<<<<<<<<<<<<<
 * 
 *         if i == 0:
 */
      goto __pyx_L9_break;
    }

    /* "pandas/src/generated.pyx":784
 *             break
 * 
 *         if i == 0:             # <<<<<<<<<<<<<<
 *             while j >= 0:
 *                 if new[j] == cur:
 */
    __pyx_t_16 = ((__pyx_v_i == 0) != 0);
    if (__pyx_t_16) {

      /* "pandas/src/generated.pyx":785
 * 
 *         if i == 0:
 *             while j >= 0:             # <<<<<<<<<<<<<<
 *                 if new[j] == cur:
 *                     indexer[j] = i
 */
      while (1) {
        __pyx_t_16 = ((__pyx_v_j >= 0) != 0);
        if (!__pyx_t_16) break;

        /* "pandas/src/generated.pyx":786
 *         if i == 0:
 *             while j >= 0:
 *                 if new[j] == cur:             # <<<<<<<<<<<<<<
 *                     indexer[j] = i
 *                 elif new[j] < cur and fill_count < lim:
 */
        __pyx_t_19 = __pyx_v_j;
        __pyx_t_6 = (PyObject *) *__Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_new.rcbuffer->pybuffer.buf, __pyx_t_19, __pyx_pybuffernd_new.diminfo[0].strides);
        __Pyx_INCREF((PyObject*)__pyx_t_6);
        __pyx_t_4 = PyObject_RichCompare(__pyx_t_6, __pyx_v_cur, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 786; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __pyx_t_16 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_16 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 786; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        if (__pyx_t_16) {

          /* "pandas/src/generated.pyx":787
 *             while j >= 0:
 *                 if new[j] == cur:
 *                     indexer[j] = i             # <<<<<<<<<<<<<<
 *                 elif new[j] < cur and fill_count < lim:
 *                     indexer[j] = i
 */
          __pyx_t_20 = __pyx_v_j;
          *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_indexer.diminfo[0].strides) = __pyx_v_i;
          goto __pyx_L14;
        }

        /* "pandas/src/generated.pyx":788
 *                 if new[j] == cur:
 *                     indexer[j] = i
 *                 elif new[j] < cur and fill_count < lim:             # <<<<<<<<<<<<<<
 *                     indexer[j] = i
 *                     fill_count += 1
 */
        __pyx_t_21 = __pyx_v_j;
        __pyx_t_4 = (PyObject *) *__Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_new.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_new.diminfo[0].strides);
        __Pyx_INCREF((PyObject*)__pyx_t_4);
        __pyx_t_6 = PyObject_RichCompare(__pyx_t_4, __pyx_v_cur, Py_LT); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 788; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __pyx_t_16 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_16 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 788; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        if (__pyx_t_16) {
          __pyx_t_12 = (__pyx_v_fill_count < __pyx_v_lim);
          __pyx_t_13 = __pyx_t_12;
        } else {
          __pyx_t_13 = __pyx_t_16;
        }
        if (__pyx_t_13) {

          /* "pandas/src/generated.pyx":789
 *                     indexer[j] = i
 *                 elif new[j] < cur and fill_count < lim:
 *                     indexer[j] = i             # <<<<<<<<<<<<<<
 *                     fill_count += 1
 *                 j -= 1
 */
          __pyx_t_22 = __pyx_v_j;
          *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_22, __pyx_pybuffernd_indexer.diminfo[0].strides) = __pyx_v_i;

          /* "pandas/src/generated.pyx":790
 *                 elif new[j] < cur and fill_count < lim:
 *                     indexer[j] = i
 *                     fill_count += 1             # <<<<<<<<<<<<<<
 *                 j -= 1
 *             break
 */
          __pyx_v_fill_count = (__pyx_v_fill_count + 1);
          goto __pyx_L14;
        }
        __pyx_L14:;

        /* "pandas/src/generated.pyx":791
 *                     indexer[j] = i
 *                     fill_count += 1
 *                 j -= 1             # <<<<<<<<<<<<<<
 *             break
 * 
 */
        __pyx_v_j = (__pyx_v_j - 1);
      }

      /* "pandas/src/generated.pyx":792
 *                     fill_count += 1
 *                 j -= 1
 *             break             # <<<<<<<<<<<<<<
 * 
 *         prev = old[i - 1]
 */
      goto __pyx_L9_break;
    }

    /* "pandas/src/generated.pyx":794
 *             break
 * 
 *         prev = old[i - 1]             # <<<<<<<<<<<<<<
 * 
 *         while j >= 0 and prev < new[j] <= cur:
 */
    __pyx_t_23 = (__pyx_v_i - 1);
    __pyx_t_6 = (PyObject *) *__Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_old.rcbuffer->pybuffer.buf, __pyx_t_23, __pyx_pybuffernd_old.diminfo[0].strides);
    __Pyx_INCREF((PyObject*)__pyx_t_6);
    __Pyx_XDECREF_SET(__pyx_v_prev, __pyx_t_6);
    __pyx_t_6 = 0;

    /* "pandas/src/generated.pyx":796
 *         prev = old[i - 1]
 * 
 *         while j >= 0 and prev < new[j] <= cur:             # <<<<<<<<<<<<<<
 *             if new[j] == cur:
 *                 indexer[j] = i
 */
    while (1) {
      __pyx_t_13 = (__pyx_v_j >= 0);
      if (__pyx_t_13) {
        __pyx_t_24 = __pyx_v_j;
        __pyx_t_6 = (PyObject *) *__Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_new.rcbuffer->pybuffer.buf, __pyx_t_24, __pyx_pybuffernd_new.diminfo[0].strides);
        __Pyx_INCREF((PyObject*)__pyx_t_6);
        __pyx_t_4 = PyObject_RichCompare(__pyx_v_prev, __pyx_t_6, Py_LT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 796; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        if (__Pyx_PyObject_IsTrue(__pyx_t_4)) {
          __Pyx_DECREF(__pyx_t_4);
          __pyx_t_4 = PyObject_RichCompare(__pyx_t_6, __pyx_v_cur, Py_LE); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 796; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __pyx_t_16 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_16 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 796; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __pyx_t_12 = __pyx_t_16;
      } else {
        __pyx_t_12 = __pyx_t_13;
      }
      if (!__pyx_t_12) break;

      /* "pandas/src/generated.pyx":797
 * 
 *         while j >= 0 and prev < new[j] <= cur:
 *             if new[j] == cur:             # <<<<<<<<<<<<<<
 *                 indexer[j] = i
 *             elif new[j] < cur and fill_count < lim:
 */
      __pyx_t_25 = __pyx_v_j;
      __pyx_t_4 = (PyObject *) *__Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_new.rcbuffer->pybuffer.buf, __pyx_t_25, __pyx_pybuffernd_new.diminfo[0].strides);
      __Pyx_INCREF((PyObject*)__pyx_t_4);
      __pyx_t_6 = PyObject_RichCompare(__pyx_t_4, __pyx_v_cur, Py_EQ); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 797; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_12 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 797; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (__pyx_t_12) {

        /* "pandas/src/generated.pyx":798
 *         while j >= 0 and prev < new[j] <= cur:
 *             if new[j] == cur:
 *                 indexer[j] = i             # <<<<<<<<<<<<<<
 *             elif new[j] < cur and fill_count < lim:
 *                 indexer[j] = i
 */
        __pyx_t_26 = __pyx_v_j;
        *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_26, __pyx_pybuffernd_indexer.diminfo[0].strides) = __pyx_v_i;
        goto __pyx_L17;
      }

      /* "pandas/src/generated.pyx":799
 *             if new[j] == cur:
 *                 indexer[j] = i
 *             elif new[j] < cur and fill_count < lim:             # <<<<<<<<<<<<<<
 *                 indexer[j] = i
 *                 fill_count += 1
 */
      __pyx_t_27 = __pyx_v_j;
      __pyx_t_6 = (PyObject *) *__Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_new.rcbuffer->pybuffer.buf, __pyx_t_27, __pyx_pybuffernd_new.diminfo[0].strides);
      __Pyx_INCREF((PyObject*)__pyx_t_6);
      __pyx_t_4 = PyObject_RichCompare(__pyx_t_6, __pyx_v_cur, Py_LT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 799; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_12 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 799; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (__pyx_t_12) {
        __pyx_t_13 = (__pyx_v_fill_count < __pyx_v_lim);
        __pyx_t_16 = __pyx_t_13;
      } else {
        __pyx_t_16 = __pyx_t_12;
      }
      if (__pyx_t_16) {

        /* "pandas/src/generated.pyx":800
 *                 indexer[j] = i
 *             elif new[j] < cur and fill_count < lim:
 *                 indexer[j] = i             # <<<<<<<<<<<<<<
 *                 fill_count += 1
 *             j -= 1
 */
        __pyx_t_28 = __pyx_v_j;
        *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_28, __pyx_pybuffernd_indexer.diminfo[0].strides) = __pyx_v_i;

        /* "pandas/src/generated.pyx":801
 *             elif new[j] < cur and fill_count < lim:
 *                 indexer[j] = i
 *                 fill_count += 1             # <<<<<<<<<<<<<<
 *             j -= 1
 * 
 */
        __pyx_v_fill_count = (__pyx_v_fill_count + 1);
        goto __pyx_L17;
      }
      __pyx_L17:;

      /* "pandas/src/generated.pyx":802
 *                 indexer[j] = i
 *                 fill_count += 1
 *             j -= 1             # <<<<<<<<<<<<<<
 * 
 *         fill_count = 0
 */
      __pyx_v_j = (__pyx_v_j - 1);
    }

    /* "pandas/src/generated.pyx":804
 *             j -= 1
 * 
 *         fill_count = 0             # <<<<<<<<<<<<<<
 *         i -= 1
 *         cur = prev
 */
    __pyx_v_fill_count = 0;

    /* "pandas/src/generated.pyx":805
 * 
 *         fill_count = 0
 *         i -= 1             # <<<<<<<<<<<<<<
 *         cur = prev
 * 
 */
    __pyx_v_i = (__pyx_v_i - 1);

    /* "pandas/src/generated.pyx":806
 *         fill_count = 0
 *         i -= 1
 *         cur = prev             # <<<<<<<<<<<<<<
 * 
 *     return indexer
 */
    __Pyx_INCREF(__pyx_v_prev);
    __Pyx_DECREF_SET(__pyx_v_cur, __pyx_v_prev);
  }
  __pyx_L9_break:;

  /* "pandas/src/generated.pyx":808
 *         cur = prev
 * 
 *     return indexer             # <<<<<<<<<<<<<<
 * 
 * @cython.boundscheck(False)
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_indexer));
  __pyx_r = ((PyObject *)__pyx_v_indexer);
  goto __pyx_L0;

  /* "pandas/src/generated.pyx":750
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def backfill_object(ndarray[object] old, ndarray[object] new,             # <<<<<<<<<<<<<<
 *                       limit=None):
 *     cdef Py_ssize_t i, j, nleft, nright
 */

  /* function exit code */
  __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_pybuffernd_indexer.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_new.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_old.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas.algos.backfill_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_new.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_old.rcbuffer->pybuffer);
  __pyx_L2:;
  __Pyx_XDECREF((PyObject *)__pyx_v_indexer);
  __Pyx_XDECREF(__pyx_v_cur);
  __Pyx_XDECREF(__pyx_v_prev);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/src/generated.pyx":812
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def backfill_int32(ndarray[int32_t] old, ndarray[int32_t] new,             # <<<<<<<<<<<<<<
 *                       limit=None):
 *     cdef Py_ssize_t i, j, nleft, nright
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pandas_5algos_133backfill_int32(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_5algos_133backfill_int32 = {__Pyx_NAMESTR("backfill_int32"), (PyCFunction)__pyx_pw_6pandas_5algos_133backfill_int32, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pw_6pandas_5algos_133backfill_int32(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyArrayObject *__pyx_v_old = 0;
  PyArrayObject *__pyx_v_new = 0;
  PyObject *__pyx_v_limit = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("backfill_int32 (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_old,&__pyx_n_s_new,&__pyx_n_s_limit,0};
    PyObject* values[3] = {0,0,0};

    /* "pandas/src/generated.pyx":813
 * @cython.wraparound(False)
 * def backfill_int32(ndarray[int32_t] old, ndarray[int32_t] new,
 *                       limit=None):             # <<<<<<<<<<<<<<
 *     cdef Py_ssize_t i, j, nleft, nright
 *     cdef ndarray[int64_t, ndim=1] indexer
 */
    values[2] = ((PyObject *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_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 (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_old)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_new)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("backfill_int32", 0, 2, 3, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 812; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_limit);
          if (value) { values[2] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "backfill_int32") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 812; __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_old = ((PyArrayObject *)values[0]);
    __pyx_v_new = ((PyArrayObject *)values[1]);
    __pyx_v_limit = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("backfill_int32", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 812; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas.algos.backfill_int32", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_old), __pyx_ptype_5numpy_ndarray, 1, "old", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 812; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_new), __pyx_ptype_5numpy_ndarray, 1, "new", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 812; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_132backfill_int32(__pyx_self, __pyx_v_old, __pyx_v_new, __pyx_v_limit);

  /* "pandas/src/generated.pyx":812
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def backfill_int32(ndarray[int32_t] old, ndarray[int32_t] new,             # <<<<<<<<<<<<<<
 *                       limit=None):
 *     cdef Py_ssize_t i, j, nleft, nright
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pandas_5algos_132backfill_int32(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_old, PyArrayObject *__pyx_v_new, PyObject *__pyx_v_limit) {
  Py_ssize_t __pyx_v_i;
  Py_ssize_t __pyx_v_j;
  Py_ssize_t __pyx_v_nleft;
  Py_ssize_t __pyx_v_nright;
  PyArrayObject *__pyx_v_indexer = 0;
  __pyx_t_5numpy_int32_t __pyx_v_cur;
  __pyx_t_5numpy_int32_t __pyx_v_prev;
  int __pyx_v_lim;
  int __pyx_v_fill_count;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_indexer;
  __Pyx_Buffer __pyx_pybuffer_indexer;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_new;
  __Pyx_Buffer __pyx_pybuffer_new;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_old;
  __Pyx_Buffer __pyx_pybuffer_old;
  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;
  long __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;
  Py_ssize_t __pyx_t_23;
  Py_ssize_t __pyx_t_24;
  __pyx_t_5numpy_int32_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;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("backfill_int32", 0);
  __pyx_pybuffer_indexer.pybuffer.buf = NULL;
  __pyx_pybuffer_indexer.refcount = 0;
  __pyx_pybuffernd_indexer.data = NULL;
  __pyx_pybuffernd_indexer.rcbuffer = &__pyx_pybuffer_indexer;
  __pyx_pybuffer_old.pybuffer.buf = NULL;
  __pyx_pybuffer_old.refcount = 0;
  __pyx_pybuffernd_old.data = NULL;
  __pyx_pybuffernd_old.rcbuffer = &__pyx_pybuffer_old;
  __pyx_pybuffer_new.pybuffer.buf = NULL;
  __pyx_pybuffer_new.refcount = 0;
  __pyx_pybuffernd_new.data = NULL;
  __pyx_pybuffernd_new.rcbuffer = &__pyx_pybuffer_new;
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_old.rcbuffer->pybuffer, (PyObject*)__pyx_v_old, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 812; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_old.diminfo[0].strides = __pyx_pybuffernd_old.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_old.diminfo[0].shape = __pyx_pybuffernd_old.rcbuffer->pybuffer.shape[0];
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_new.rcbuffer->pybuffer, (PyObject*)__pyx_v_new, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 812; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_new.diminfo[0].strides = __pyx_pybuffernd_new.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_new.diminfo[0].shape = __pyx_pybuffernd_new.rcbuffer->pybuffer.shape[0];

  /* "pandas/src/generated.pyx":817
 *     cdef ndarray[int64_t, ndim=1] indexer
 *     cdef int32_t cur, prev
 *     cdef int lim, fill_count = 0             # <<<<<<<<<<<<<<
 * 
 *     nleft = len(old)
 */
  __pyx_v_fill_count = 0;

  /* "pandas/src/generated.pyx":819
 *     cdef int lim, fill_count = 0
 * 
 *     nleft = len(old)             # <<<<<<<<<<<<<<
 *     nright = len(new)
 *     indexer = np.empty(nright, dtype=np.int64)
 */
  __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_old)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 819; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_nleft = __pyx_t_1;

  /* "pandas/src/generated.pyx":820
 * 
 *     nleft = len(old)
 *     nright = len(new)             # <<<<<<<<<<<<<<
 *     indexer = np.empty(nright, dtype=np.int64)
 *     indexer.fill(-1)
 */
  __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_new)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 820; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_nright = __pyx_t_1;

  /* "pandas/src/generated.pyx":821
 *     nleft = len(old)
 *     nright = len(new)
 *     indexer = np.empty(nright, dtype=np.int64)             # <<<<<<<<<<<<<<
 *     indexer.fill(-1)
 * 
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 821; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_empty); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 821; __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_nright); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 821; __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 = 821; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__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 = 821; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 821; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_int64); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 821; __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, __pyx_n_s_dtype, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 821; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 821; __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_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__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 = 821; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_7 = ((PyArrayObject *)__pyx_t_6);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer);
    __pyx_t_8 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer, (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_pybuffernd_indexer.rcbuffer->pybuffer, (PyObject*)__pyx_v_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_pybuffernd_indexer.diminfo[0].strides = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_indexer.diminfo[0].shape = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.shape[0];
    if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 821; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_7 = 0;
  __pyx_v_indexer = ((PyArrayObject *)__pyx_t_6);
  __pyx_t_6 = 0;

  /* "pandas/src/generated.pyx":822
 *     nright = len(new)
 *     indexer = np.empty(nright, dtype=np.int64)
 *     indexer.fill(-1)             # <<<<<<<<<<<<<<
 * 
 *     if limit is None:
 */
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_indexer), __pyx_n_s_fill); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 822; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_tuple__68, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 822; __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/generated.pyx":824
 *     indexer.fill(-1)
 * 
 *     if limit is None:             # <<<<<<<<<<<<<<
 *         lim = nright
 *     else:
 */
  __pyx_t_12 = (__pyx_v_limit == Py_None);
  __pyx_t_13 = (__pyx_t_12 != 0);
  if (__pyx_t_13) {

    /* "pandas/src/generated.pyx":825
 * 
 *     if limit is None:
 *         lim = nright             # <<<<<<<<<<<<<<
 *     else:
 *         if limit < 0:
 */
    __pyx_v_lim = __pyx_v_nright;
    goto __pyx_L3;
  }
  /*else*/ {

    /* "pandas/src/generated.pyx":827
 *         lim = nright
 *     else:
 *         if limit < 0:             # <<<<<<<<<<<<<<
 *             raise ValueError('Limit must be non-negative')
 *         lim = limit
 */
    __pyx_t_2 = PyObject_RichCompare(__pyx_v_limit, __pyx_int_0, Py_LT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 827; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_13 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_13 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 827; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (__pyx_t_13) {

      /* "pandas/src/generated.pyx":828
 *     else:
 *         if limit < 0:
 *             raise ValueError('Limit must be non-negative')             # <<<<<<<<<<<<<<
 *         lim = limit
 * 
 */
      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__69, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 828; __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 = 828; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }

    /* "pandas/src/generated.pyx":829
 *         if limit < 0:
 *             raise ValueError('Limit must be non-negative')
 *         lim = limit             # <<<<<<<<<<<<<<
 * 
 *     if nleft == 0 or nright == 0 or new[0] > old[nleft - 1]:
 */
    __pyx_t_8 = __Pyx_PyInt_As_int(__pyx_v_limit); if (unlikely((__pyx_t_8 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 829; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_v_lim = __pyx_t_8;
  }
  __pyx_L3:;

  /* "pandas/src/generated.pyx":831
 *         lim = limit
 * 
 *     if nleft == 0 or nright == 0 or new[0] > old[nleft - 1]:             # <<<<<<<<<<<<<<
 *         return indexer
 * 
 */
  __pyx_t_13 = ((__pyx_v_nleft == 0) != 0);
  if (!__pyx_t_13) {
    __pyx_t_12 = ((__pyx_v_nright == 0) != 0);
    if (!__pyx_t_12) {
      __pyx_t_14 = 0;
      __pyx_t_1 = (__pyx_v_nleft - 1);
      __pyx_t_15 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_new.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_new.diminfo[0].strides)) > (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_old.rcbuffer->pybuffer.buf, __pyx_t_1, __pyx_pybuffernd_old.diminfo[0].strides))) != 0);
      __pyx_t_16 = __pyx_t_15;
    } else {
      __pyx_t_16 = __pyx_t_12;
    }
    __pyx_t_12 = __pyx_t_16;
  } else {
    __pyx_t_12 = __pyx_t_13;
  }
  if (__pyx_t_12) {

    /* "pandas/src/generated.pyx":832
 * 
 *     if nleft == 0 or nright == 0 or new[0] > old[nleft - 1]:
 *         return indexer             # <<<<<<<<<<<<<<
 * 
 *     i = nleft - 1
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(((PyObject *)__pyx_v_indexer));
    __pyx_r = ((PyObject *)__pyx_v_indexer);
    goto __pyx_L0;
  }

  /* "pandas/src/generated.pyx":834
 *         return indexer
 * 
 *     i = nleft - 1             # <<<<<<<<<<<<<<
 *     j = nright - 1
 * 
 */
  __pyx_v_i = (__pyx_v_nleft - 1);

  /* "pandas/src/generated.pyx":835
 * 
 *     i = nleft - 1
 *     j = nright - 1             # <<<<<<<<<<<<<<
 * 
 *     cur = old[nleft - 1]
 */
  __pyx_v_j = (__pyx_v_nright - 1);

  /* "pandas/src/generated.pyx":837
 *     j = nright - 1
 * 
 *     cur = old[nleft - 1]             # <<<<<<<<<<<<<<
 * 
 *     while j >= 0 and new[j] > cur:
 */
  __pyx_t_17 = (__pyx_v_nleft - 1);
  __pyx_v_cur = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_old.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_old.diminfo[0].strides));

  /* "pandas/src/generated.pyx":839
 *     cur = old[nleft - 1]
 * 
 *     while j >= 0 and new[j] > cur:             # <<<<<<<<<<<<<<
 *         j -= 1
 * 
 */
  while (1) {
    __pyx_t_12 = ((__pyx_v_j >= 0) != 0);
    if (__pyx_t_12) {
      __pyx_t_18 = __pyx_v_j;
      __pyx_t_13 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_new.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_new.diminfo[0].strides)) > __pyx_v_cur) != 0);
      __pyx_t_16 = __pyx_t_13;
    } else {
      __pyx_t_16 = __pyx_t_12;
    }
    if (!__pyx_t_16) break;

    /* "pandas/src/generated.pyx":840
 * 
 *     while j >= 0 and new[j] > cur:
 *         j -= 1             # <<<<<<<<<<<<<<
 * 
 *     while True:
 */
    __pyx_v_j = (__pyx_v_j - 1);
  }

  /* "pandas/src/generated.pyx":842
 *         j -= 1
 * 
 *     while True:             # <<<<<<<<<<<<<<
 *         if j < 0:
 *             break
 */
  while (1) {

    /* "pandas/src/generated.pyx":843
 * 
 *     while True:
 *         if j < 0:             # <<<<<<<<<<<<<<
 *             break
 * 
 */
    __pyx_t_16 = ((__pyx_v_j < 0) != 0);
    if (__pyx_t_16) {

      /* "pandas/src/generated.pyx":844
 *     while True:
 *         if j < 0:
 *             break             # <<<<<<<<<<<<<<
 * 
 *         if i == 0:
 */
      goto __pyx_L9_break;
    }

    /* "pandas/src/generated.pyx":846
 *             break
 * 
 *         if i == 0:             # <<<<<<<<<<<<<<
 *             while j >= 0:
 *                 if new[j] == cur:
 */
    __pyx_t_16 = ((__pyx_v_i == 0) != 0);
    if (__pyx_t_16) {

      /* "pandas/src/generated.pyx":847
 * 
 *         if i == 0:
 *             while j >= 0:             # <<<<<<<<<<<<<<
 *                 if new[j] == cur:
 *                     indexer[j] = i
 */
      while (1) {
        __pyx_t_16 = ((__pyx_v_j >= 0) != 0);
        if (!__pyx_t_16) break;

        /* "pandas/src/generated.pyx":848
 *         if i == 0:
 *             while j >= 0:
 *                 if new[j] == cur:             # <<<<<<<<<<<<<<
 *                     indexer[j] = i
 *                 elif new[j] < cur and fill_count < lim:
 */
        __pyx_t_19 = __pyx_v_j;
        __pyx_t_16 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_new.rcbuffer->pybuffer.buf, __pyx_t_19, __pyx_pybuffernd_new.diminfo[0].strides)) == __pyx_v_cur) != 0);
        if (__pyx_t_16) {

          /* "pandas/src/generated.pyx":849
 *             while j >= 0:
 *                 if new[j] == cur:
 *                     indexer[j] = i             # <<<<<<<<<<<<<<
 *                 elif new[j] < cur and fill_count < lim:
 *                     indexer[j] = i
 */
          __pyx_t_20 = __pyx_v_j;
          *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_indexer.diminfo[0].strides) = __pyx_v_i;
          goto __pyx_L14;
        }

        /* "pandas/src/generated.pyx":850
 *                 if new[j] == cur:
 *                     indexer[j] = i
 *                 elif new[j] < cur and fill_count < lim:             # <<<<<<<<<<<<<<
 *                     indexer[j] = i
 *                     fill_count += 1
 */
        __pyx_t_21 = __pyx_v_j;
        __pyx_t_16 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_new.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_new.diminfo[0].strides)) < __pyx_v_cur) != 0);
        if (__pyx_t_16) {
          __pyx_t_12 = ((__pyx_v_fill_count < __pyx_v_lim) != 0);
          __pyx_t_13 = __pyx_t_12;
        } else {
          __pyx_t_13 = __pyx_t_16;
        }
        if (__pyx_t_13) {

          /* "pandas/src/generated.pyx":851
 *                     indexer[j] = i
 *                 elif new[j] < cur and fill_count < lim:
 *                     indexer[j] = i             # <<<<<<<<<<<<<<
 *                     fill_count += 1
 *                 j -= 1
 */
          __pyx_t_22 = __pyx_v_j;
          *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_22, __pyx_pybuffernd_indexer.diminfo[0].strides) = __pyx_v_i;

          /* "pandas/src/generated.pyx":852
 *                 elif new[j] < cur and fill_count < lim:
 *                     indexer[j] = i
 *                     fill_count += 1             # <<<<<<<<<<<<<<
 *                 j -= 1
 *             break
 */
          __pyx_v_fill_count = (__pyx_v_fill_count + 1);
          goto __pyx_L14;
        }
        __pyx_L14:;

        /* "pandas/src/generated.pyx":853
 *                     indexer[j] = i
 *                     fill_count += 1
 *                 j -= 1             # <<<<<<<<<<<<<<
 *             break
 * 
 */
        __pyx_v_j = (__pyx_v_j - 1);
      }

      /* "pandas/src/generated.pyx":854
 *                     fill_count += 1
 *                 j -= 1
 *             break             # <<<<<<<<<<<<<<
 * 
 *         prev = old[i - 1]
 */
      goto __pyx_L9_break;
    }

    /* "pandas/src/generated.pyx":856
 *             break
 * 
 *         prev = old[i - 1]             # <<<<<<<<<<<<<<
 * 
 *         while j >= 0 and prev < new[j] <= cur:
 */
    __pyx_t_23 = (__pyx_v_i - 1);
    __pyx_v_prev = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_old.rcbuffer->pybuffer.buf, __pyx_t_23, __pyx_pybuffernd_old.diminfo[0].strides));

    /* "pandas/src/generated.pyx":858
 *         prev = old[i - 1]
 * 
 *         while j >= 0 and prev < new[j] <= cur:             # <<<<<<<<<<<<<<
 *             if new[j] == cur:
 *                 indexer[j] = i
 */
    while (1) {
      __pyx_t_13 = ((__pyx_v_j >= 0) != 0);
      if (__pyx_t_13) {
        __pyx_t_24 = __pyx_v_j;
        __pyx_t_25 = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_new.rcbuffer->pybuffer.buf, __pyx_t_24, __pyx_pybuffernd_new.diminfo[0].strides));
        __pyx_t_16 = (__pyx_v_prev < __pyx_t_25);
        if (__pyx_t_16) {
          __pyx_t_16 = (__pyx_t_25 <= __pyx_v_cur);
        }
        __pyx_t_12 = (__pyx_t_16 != 0);
      } else {
        __pyx_t_12 = __pyx_t_13;
      }
      if (!__pyx_t_12) break;

      /* "pandas/src/generated.pyx":859
 * 
 *         while j >= 0 and prev < new[j] <= cur:
 *             if new[j] == cur:             # <<<<<<<<<<<<<<
 *                 indexer[j] = i
 *             elif new[j] < cur and fill_count < lim:
 */
      __pyx_t_26 = __pyx_v_j;
      __pyx_t_12 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_new.rcbuffer->pybuffer.buf, __pyx_t_26, __pyx_pybuffernd_new.diminfo[0].strides)) == __pyx_v_cur) != 0);
      if (__pyx_t_12) {

        /* "pandas/src/generated.pyx":860
 *         while j >= 0 and prev < new[j] <= cur:
 *             if new[j] == cur:
 *                 indexer[j] = i             # <<<<<<<<<<<<<<
 *             elif new[j] < cur and fill_count < lim:
 *                 indexer[j] = i
 */
        __pyx_t_27 = __pyx_v_j;
        *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_27, __pyx_pybuffernd_indexer.diminfo[0].strides) = __pyx_v_i;
        goto __pyx_L17;
      }

      /* "pandas/src/generated.pyx":861
 *             if new[j] == cur:
 *                 indexer[j] = i
 *             elif new[j] < cur and fill_count < lim:             # <<<<<<<<<<<<<<
 *                 indexer[j] = i
 *                 fill_count += 1
 */
      __pyx_t_28 = __pyx_v_j;
      __pyx_t_12 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_new.rcbuffer->pybuffer.buf, __pyx_t_28, __pyx_pybuffernd_new.diminfo[0].strides)) < __pyx_v_cur) != 0);
      if (__pyx_t_12) {
        __pyx_t_13 = ((__pyx_v_fill_count < __pyx_v_lim) != 0);
        __pyx_t_16 = __pyx_t_13;
      } else {
        __pyx_t_16 = __pyx_t_12;
      }
      if (__pyx_t_16) {

        /* "pandas/src/generated.pyx":862
 *                 indexer[j] = i
 *             elif new[j] < cur and fill_count < lim:
 *                 indexer[j] = i             # <<<<<<<<<<<<<<
 *                 fill_count += 1
 *             j -= 1
 */
        __pyx_t_29 = __pyx_v_j;
        *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_29, __pyx_pybuffernd_indexer.diminfo[0].strides) = __pyx_v_i;

        /* "pandas/src/generated.pyx":863
 *             elif new[j] < cur and fill_count < lim:
 *                 indexer[j] = i
 *                 fill_count += 1             # <<<<<<<<<<<<<<
 *             j -= 1
 * 
 */
        __pyx_v_fill_count = (__pyx_v_fill_count + 1);
        goto __pyx_L17;
      }
      __pyx_L17:;

      /* "pandas/src/generated.pyx":864
 *                 indexer[j] = i
 *                 fill_count += 1
 *             j -= 1             # <<<<<<<<<<<<<<
 * 
 *         fill_count = 0
 */
      __pyx_v_j = (__pyx_v_j - 1);
    }

    /* "pandas/src/generated.pyx":866
 *             j -= 1
 * 
 *         fill_count = 0             # <<<<<<<<<<<<<<
 *         i -= 1
 *         cur = prev
 */
    __pyx_v_fill_count = 0;

    /* "pandas/src/generated.pyx":867
 * 
 *         fill_count = 0
 *         i -= 1             # <<<<<<<<<<<<<<
 *         cur = prev
 * 
 */
    __pyx_v_i = (__pyx_v_i - 1);

    /* "pandas/src/generated.pyx":868
 *         fill_count = 0
 *         i -= 1
 *         cur = prev             # <<<<<<<<<<<<<<
 * 
 *     return indexer
 */
    __pyx_v_cur = __pyx_v_prev;
  }
  __pyx_L9_break:;

  /* "pandas/src/generated.pyx":870
 *         cur = prev
 * 
 *     return indexer             # <<<<<<<<<<<<<<
 * 
 * @cython.boundscheck(False)
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_indexer));
  __pyx_r = ((PyObject *)__pyx_v_indexer);
  goto __pyx_L0;

  /* "pandas/src/generated.pyx":812
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def backfill_int32(ndarray[int32_t] old, ndarray[int32_t] new,             # <<<<<<<<<<<<<<
 *                       limit=None):
 *     cdef Py_ssize_t i, j, nleft, nright
 */

  /* function exit code */
  __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_pybuffernd_indexer.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_new.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_old.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas.algos.backfill_int32", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_new.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_old.rcbuffer->pybuffer);
  __pyx_L2:;
  __Pyx_XDECREF((PyObject *)__pyx_v_indexer);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/src/generated.pyx":874
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def backfill_int64(ndarray[int64_t] old, ndarray[int64_t] new,             # <<<<<<<<<<<<<<
 *                       limit=None):
 *     cdef Py_ssize_t i, j, nleft, nright
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pandas_5algos_135backfill_int64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_5algos_135backfill_int64 = {__Pyx_NAMESTR("backfill_int64"), (PyCFunction)__pyx_pw_6pandas_5algos_135backfill_int64, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pw_6pandas_5algos_135backfill_int64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyArrayObject *__pyx_v_old = 0;
  PyArrayObject *__pyx_v_new = 0;
  PyObject *__pyx_v_limit = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("backfill_int64 (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_old,&__pyx_n_s_new,&__pyx_n_s_limit,0};
    PyObject* values[3] = {0,0,0};

    /* "pandas/src/generated.pyx":875
 * @cython.wraparound(False)
 * def backfill_int64(ndarray[int64_t] old, ndarray[int64_t] new,
 *                       limit=None):             # <<<<<<<<<<<<<<
 *     cdef Py_ssize_t i, j, nleft, nright
 *     cdef ndarray[int64_t, ndim=1] indexer
 */
    values[2] = ((PyObject *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_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 (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_old)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_new)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("backfill_int64", 0, 2, 3, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 874; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_limit);
          if (value) { values[2] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "backfill_int64") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 874; __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_old = ((PyArrayObject *)values[0]);
    __pyx_v_new = ((PyArrayObject *)values[1]);
    __pyx_v_limit = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("backfill_int64", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 874; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas.algos.backfill_int64", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_old), __pyx_ptype_5numpy_ndarray, 1, "old", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 874; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_new), __pyx_ptype_5numpy_ndarray, 1, "new", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 874; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_134backfill_int64(__pyx_self, __pyx_v_old, __pyx_v_new, __pyx_v_limit);

  /* "pandas/src/generated.pyx":874
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def backfill_int64(ndarray[int64_t] old, ndarray[int64_t] new,             # <<<<<<<<<<<<<<
 *                       limit=None):
 *     cdef Py_ssize_t i, j, nleft, nright
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pandas_5algos_134backfill_int64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_old, PyArrayObject *__pyx_v_new, PyObject *__pyx_v_limit) {
  Py_ssize_t __pyx_v_i;
  Py_ssize_t __pyx_v_j;
  Py_ssize_t __pyx_v_nleft;
  Py_ssize_t __pyx_v_nright;
  PyArrayObject *__pyx_v_indexer = 0;
  __pyx_t_5numpy_int64_t __pyx_v_cur;
  __pyx_t_5numpy_int64_t __pyx_v_prev;
  int __pyx_v_lim;
  int __pyx_v_fill_count;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_indexer;
  __Pyx_Buffer __pyx_pybuffer_indexer;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_new;
  __Pyx_Buffer __pyx_pybuffer_new;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_old;
  __Pyx_Buffer __pyx_pybuffer_old;
  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;
  long __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;
  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;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("backfill_int64", 0);
  __pyx_pybuffer_indexer.pybuffer.buf = NULL;
  __pyx_pybuffer_indexer.refcount = 0;
  __pyx_pybuffernd_indexer.data = NULL;
  __pyx_pybuffernd_indexer.rcbuffer = &__pyx_pybuffer_indexer;
  __pyx_pybuffer_old.pybuffer.buf = NULL;
  __pyx_pybuffer_old.refcount = 0;
  __pyx_pybuffernd_old.data = NULL;
  __pyx_pybuffernd_old.rcbuffer = &__pyx_pybuffer_old;
  __pyx_pybuffer_new.pybuffer.buf = NULL;
  __pyx_pybuffer_new.refcount = 0;
  __pyx_pybuffernd_new.data = NULL;
  __pyx_pybuffernd_new.rcbuffer = &__pyx_pybuffer_new;
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_old.rcbuffer->pybuffer, (PyObject*)__pyx_v_old, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 874; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_old.diminfo[0].strides = __pyx_pybuffernd_old.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_old.diminfo[0].shape = __pyx_pybuffernd_old.rcbuffer->pybuffer.shape[0];
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_new.rcbuffer->pybuffer, (PyObject*)__pyx_v_new, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 874; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_new.diminfo[0].strides = __pyx_pybuffernd_new.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_new.diminfo[0].shape = __pyx_pybuffernd_new.rcbuffer->pybuffer.shape[0];

  /* "pandas/src/generated.pyx":879
 *     cdef ndarray[int64_t, ndim=1] indexer
 *     cdef int64_t cur, prev
 *     cdef int lim, fill_count = 0             # <<<<<<<<<<<<<<
 * 
 *     nleft = len(old)
 */
  __pyx_v_fill_count = 0;

  /* "pandas/src/generated.pyx":881
 *     cdef int lim, fill_count = 0
 * 
 *     nleft = len(old)             # <<<<<<<<<<<<<<
 *     nright = len(new)
 *     indexer = np.empty(nright, dtype=np.int64)
 */
  __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_old)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 881; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_nleft = __pyx_t_1;

  /* "pandas/src/generated.pyx":882
 * 
 *     nleft = len(old)
 *     nright = len(new)             # <<<<<<<<<<<<<<
 *     indexer = np.empty(nright, dtype=np.int64)
 *     indexer.fill(-1)
 */
  __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_new)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 882; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_nright = __pyx_t_1;

  /* "pandas/src/generated.pyx":883
 *     nleft = len(old)
 *     nright = len(new)
 *     indexer = np.empty(nright, dtype=np.int64)             # <<<<<<<<<<<<<<
 *     indexer.fill(-1)
 * 
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 883; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_empty); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 883; __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_nright); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 883; __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 = 883; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__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 = 883; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 883; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_int64); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 883; __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, __pyx_n_s_dtype, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 883; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 883; __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_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__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 = 883; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_7 = ((PyArrayObject *)__pyx_t_6);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer);
    __pyx_t_8 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer, (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_pybuffernd_indexer.rcbuffer->pybuffer, (PyObject*)__pyx_v_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_pybuffernd_indexer.diminfo[0].strides = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_indexer.diminfo[0].shape = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.shape[0];
    if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 883; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_7 = 0;
  __pyx_v_indexer = ((PyArrayObject *)__pyx_t_6);
  __pyx_t_6 = 0;

  /* "pandas/src/generated.pyx":884
 *     nright = len(new)
 *     indexer = np.empty(nright, dtype=np.int64)
 *     indexer.fill(-1)             # <<<<<<<<<<<<<<
 * 
 *     if limit is None:
 */
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_indexer), __pyx_n_s_fill); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 884; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_tuple__70, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 884; __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/generated.pyx":886
 *     indexer.fill(-1)
 * 
 *     if limit is None:             # <<<<<<<<<<<<<<
 *         lim = nright
 *     else:
 */
  __pyx_t_12 = (__pyx_v_limit == Py_None);
  __pyx_t_13 = (__pyx_t_12 != 0);
  if (__pyx_t_13) {

    /* "pandas/src/generated.pyx":887
 * 
 *     if limit is None:
 *         lim = nright             # <<<<<<<<<<<<<<
 *     else:
 *         if limit < 0:
 */
    __pyx_v_lim = __pyx_v_nright;
    goto __pyx_L3;
  }
  /*else*/ {

    /* "pandas/src/generated.pyx":889
 *         lim = nright
 *     else:
 *         if limit < 0:             # <<<<<<<<<<<<<<
 *             raise ValueError('Limit must be non-negative')
 *         lim = limit
 */
    __pyx_t_2 = PyObject_RichCompare(__pyx_v_limit, __pyx_int_0, Py_LT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 889; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_13 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_13 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 889; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (__pyx_t_13) {

      /* "pandas/src/generated.pyx":890
 *     else:
 *         if limit < 0:
 *             raise ValueError('Limit must be non-negative')             # <<<<<<<<<<<<<<
 *         lim = limit
 * 
 */
      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__71, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 890; __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 = 890; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }

    /* "pandas/src/generated.pyx":891
 *         if limit < 0:
 *             raise ValueError('Limit must be non-negative')
 *         lim = limit             # <<<<<<<<<<<<<<
 * 
 *     if nleft == 0 or nright == 0 or new[0] > old[nleft - 1]:
 */
    __pyx_t_8 = __Pyx_PyInt_As_int(__pyx_v_limit); if (unlikely((__pyx_t_8 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 891; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_v_lim = __pyx_t_8;
  }
  __pyx_L3:;

  /* "pandas/src/generated.pyx":893
 *         lim = limit
 * 
 *     if nleft == 0 or nright == 0 or new[0] > old[nleft - 1]:             # <<<<<<<<<<<<<<
 *         return indexer
 * 
 */
  __pyx_t_13 = ((__pyx_v_nleft == 0) != 0);
  if (!__pyx_t_13) {
    __pyx_t_12 = ((__pyx_v_nright == 0) != 0);
    if (!__pyx_t_12) {
      __pyx_t_14 = 0;
      __pyx_t_1 = (__pyx_v_nleft - 1);
      __pyx_t_15 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_new.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_new.diminfo[0].strides)) > (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_old.rcbuffer->pybuffer.buf, __pyx_t_1, __pyx_pybuffernd_old.diminfo[0].strides))) != 0);
      __pyx_t_16 = __pyx_t_15;
    } else {
      __pyx_t_16 = __pyx_t_12;
    }
    __pyx_t_12 = __pyx_t_16;
  } else {
    __pyx_t_12 = __pyx_t_13;
  }
  if (__pyx_t_12) {

    /* "pandas/src/generated.pyx":894
 * 
 *     if nleft == 0 or nright == 0 or new[0] > old[nleft - 1]:
 *         return indexer             # <<<<<<<<<<<<<<
 * 
 *     i = nleft - 1
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(((PyObject *)__pyx_v_indexer));
    __pyx_r = ((PyObject *)__pyx_v_indexer);
    goto __pyx_L0;
  }

  /* "pandas/src/generated.pyx":896
 *         return indexer
 * 
 *     i = nleft - 1             # <<<<<<<<<<<<<<
 *     j = nright - 1
 * 
 */
  __pyx_v_i = (__pyx_v_nleft - 1);

  /* "pandas/src/generated.pyx":897
 * 
 *     i = nleft - 1
 *     j = nright - 1             # <<<<<<<<<<<<<<
 * 
 *     cur = old[nleft - 1]
 */
  __pyx_v_j = (__pyx_v_nright - 1);

  /* "pandas/src/generated.pyx":899
 *     j = nright - 1
 * 
 *     cur = old[nleft - 1]             # <<<<<<<<<<<<<<
 * 
 *     while j >= 0 and new[j] > cur:
 */
  __pyx_t_17 = (__pyx_v_nleft - 1);
  __pyx_v_cur = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_old.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_old.diminfo[0].strides));

  /* "pandas/src/generated.pyx":901
 *     cur = old[nleft - 1]
 * 
 *     while j >= 0 and new[j] > cur:             # <<<<<<<<<<<<<<
 *         j -= 1
 * 
 */
  while (1) {
    __pyx_t_12 = ((__pyx_v_j >= 0) != 0);
    if (__pyx_t_12) {
      __pyx_t_18 = __pyx_v_j;
      __pyx_t_13 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_new.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_new.diminfo[0].strides)) > __pyx_v_cur) != 0);
      __pyx_t_16 = __pyx_t_13;
    } else {
      __pyx_t_16 = __pyx_t_12;
    }
    if (!__pyx_t_16) break;

    /* "pandas/src/generated.pyx":902
 * 
 *     while j >= 0 and new[j] > cur:
 *         j -= 1             # <<<<<<<<<<<<<<
 * 
 *     while True:
 */
    __pyx_v_j = (__pyx_v_j - 1);
  }

  /* "pandas/src/generated.pyx":904
 *         j -= 1
 * 
 *     while True:             # <<<<<<<<<<<<<<
 *         if j < 0:
 *             break
 */
  while (1) {

    /* "pandas/src/generated.pyx":905
 * 
 *     while True:
 *         if j < 0:             # <<<<<<<<<<<<<<
 *             break
 * 
 */
    __pyx_t_16 = ((__pyx_v_j < 0) != 0);
    if (__pyx_t_16) {

      /* "pandas/src/generated.pyx":906
 *     while True:
 *         if j < 0:
 *             break             # <<<<<<<<<<<<<<
 * 
 *         if i == 0:
 */
      goto __pyx_L9_break;
    }

    /* "pandas/src/generated.pyx":908
 *             break
 * 
 *         if i == 0:             # <<<<<<<<<<<<<<
 *             while j >= 0:
 *                 if new[j] == cur:
 */
    __pyx_t_16 = ((__pyx_v_i == 0) != 0);
    if (__pyx_t_16) {

      /* "pandas/src/generated.pyx":909
 * 
 *         if i == 0:
 *             while j >= 0:             # <<<<<<<<<<<<<<
 *                 if new[j] == cur:
 *                     indexer[j] = i
 */
      while (1) {
        __pyx_t_16 = ((__pyx_v_j >= 0) != 0);
        if (!__pyx_t_16) break;

        /* "pandas/src/generated.pyx":910
 *         if i == 0:
 *             while j >= 0:
 *                 if new[j] == cur:             # <<<<<<<<<<<<<<
 *                     indexer[j] = i
 *                 elif new[j] < cur and fill_count < lim:
 */
        __pyx_t_19 = __pyx_v_j;
        __pyx_t_16 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_new.rcbuffer->pybuffer.buf, __pyx_t_19, __pyx_pybuffernd_new.diminfo[0].strides)) == __pyx_v_cur) != 0);
        if (__pyx_t_16) {

          /* "pandas/src/generated.pyx":911
 *             while j >= 0:
 *                 if new[j] == cur:
 *                     indexer[j] = i             # <<<<<<<<<<<<<<
 *                 elif new[j] < cur and fill_count < lim:
 *                     indexer[j] = i
 */
          __pyx_t_20 = __pyx_v_j;
          *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_indexer.diminfo[0].strides) = __pyx_v_i;
          goto __pyx_L14;
        }

        /* "pandas/src/generated.pyx":912
 *                 if new[j] == cur:
 *                     indexer[j] = i
 *                 elif new[j] < cur and fill_count < lim:             # <<<<<<<<<<<<<<
 *                     indexer[j] = i
 *                     fill_count += 1
 */
        __pyx_t_21 = __pyx_v_j;
        __pyx_t_16 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_new.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_new.diminfo[0].strides)) < __pyx_v_cur) != 0);
        if (__pyx_t_16) {
          __pyx_t_12 = ((__pyx_v_fill_count < __pyx_v_lim) != 0);
          __pyx_t_13 = __pyx_t_12;
        } else {
          __pyx_t_13 = __pyx_t_16;
        }
        if (__pyx_t_13) {

          /* "pandas/src/generated.pyx":913
 *                     indexer[j] = i
 *                 elif new[j] < cur and fill_count < lim:
 *                     indexer[j] = i             # <<<<<<<<<<<<<<
 *                     fill_count += 1
 *                 j -= 1
 */
          __pyx_t_22 = __pyx_v_j;
          *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_22, __pyx_pybuffernd_indexer.diminfo[0].strides) = __pyx_v_i;

          /* "pandas/src/generated.pyx":914
 *                 elif new[j] < cur and fill_count < lim:
 *                     indexer[j] = i
 *                     fill_count += 1             # <<<<<<<<<<<<<<
 *                 j -= 1
 *             break
 */
          __pyx_v_fill_count = (__pyx_v_fill_count + 1);
          goto __pyx_L14;
        }
        __pyx_L14:;

        /* "pandas/src/generated.pyx":915
 *                     indexer[j] = i
 *                     fill_count += 1
 *                 j -= 1             # <<<<<<<<<<<<<<
 *             break
 * 
 */
        __pyx_v_j = (__pyx_v_j - 1);
      }

      /* "pandas/src/generated.pyx":916
 *                     fill_count += 1
 *                 j -= 1
 *             break             # <<<<<<<<<<<<<<
 * 
 *         prev = old[i - 1]
 */
      goto __pyx_L9_break;
    }

    /* "pandas/src/generated.pyx":918
 *             break
 * 
 *         prev = old[i - 1]             # <<<<<<<<<<<<<<
 * 
 *         while j >= 0 and prev < new[j] <= cur:
 */
    __pyx_t_23 = (__pyx_v_i - 1);
    __pyx_v_prev = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_old.rcbuffer->pybuffer.buf, __pyx_t_23, __pyx_pybuffernd_old.diminfo[0].strides));

    /* "pandas/src/generated.pyx":920
 *         prev = old[i - 1]
 * 
 *         while j >= 0 and prev < new[j] <= cur:             # <<<<<<<<<<<<<<
 *             if new[j] == cur:
 *                 indexer[j] = i
 */
    while (1) {
      __pyx_t_13 = ((__pyx_v_j >= 0) != 0);
      if (__pyx_t_13) {
        __pyx_t_24 = __pyx_v_j;
        __pyx_t_25 = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_new.rcbuffer->pybuffer.buf, __pyx_t_24, __pyx_pybuffernd_new.diminfo[0].strides));
        __pyx_t_16 = (__pyx_v_prev < __pyx_t_25);
        if (__pyx_t_16) {
          __pyx_t_16 = (__pyx_t_25 <= __pyx_v_cur);
        }
        __pyx_t_12 = (__pyx_t_16 != 0);
      } else {
        __pyx_t_12 = __pyx_t_13;
      }
      if (!__pyx_t_12) break;

      /* "pandas/src/generated.pyx":921
 * 
 *         while j >= 0 and prev < new[j] <= cur:
 *             if new[j] == cur:             # <<<<<<<<<<<<<<
 *                 indexer[j] = i
 *             elif new[j] < cur and fill_count < lim:
 */
      __pyx_t_26 = __pyx_v_j;
      __pyx_t_12 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_new.rcbuffer->pybuffer.buf, __pyx_t_26, __pyx_pybuffernd_new.diminfo[0].strides)) == __pyx_v_cur) != 0);
      if (__pyx_t_12) {

        /* "pandas/src/generated.pyx":922
 *         while j >= 0 and prev < new[j] <= cur:
 *             if new[j] == cur:
 *                 indexer[j] = i             # <<<<<<<<<<<<<<
 *             elif new[j] < cur and fill_count < lim:
 *                 indexer[j] = i
 */
        __pyx_t_27 = __pyx_v_j;
        *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_27, __pyx_pybuffernd_indexer.diminfo[0].strides) = __pyx_v_i;
        goto __pyx_L17;
      }

      /* "pandas/src/generated.pyx":923
 *             if new[j] == cur:
 *                 indexer[j] = i
 *             elif new[j] < cur and fill_count < lim:             # <<<<<<<<<<<<<<
 *                 indexer[j] = i
 *                 fill_count += 1
 */
      __pyx_t_28 = __pyx_v_j;
      __pyx_t_12 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_new.rcbuffer->pybuffer.buf, __pyx_t_28, __pyx_pybuffernd_new.diminfo[0].strides)) < __pyx_v_cur) != 0);
      if (__pyx_t_12) {
        __pyx_t_13 = ((__pyx_v_fill_count < __pyx_v_lim) != 0);
        __pyx_t_16 = __pyx_t_13;
      } else {
        __pyx_t_16 = __pyx_t_12;
      }
      if (__pyx_t_16) {

        /* "pandas/src/generated.pyx":924
 *                 indexer[j] = i
 *             elif new[j] < cur and fill_count < lim:
 *                 indexer[j] = i             # <<<<<<<<<<<<<<
 *                 fill_count += 1
 *             j -= 1
 */
        __pyx_t_29 = __pyx_v_j;
        *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_29, __pyx_pybuffernd_indexer.diminfo[0].strides) = __pyx_v_i;

        /* "pandas/src/generated.pyx":925
 *             elif new[j] < cur and fill_count < lim:
 *                 indexer[j] = i
 *                 fill_count += 1             # <<<<<<<<<<<<<<
 *             j -= 1
 * 
 */
        __pyx_v_fill_count = (__pyx_v_fill_count + 1);
        goto __pyx_L17;
      }
      __pyx_L17:;

      /* "pandas/src/generated.pyx":926
 *                 indexer[j] = i
 *                 fill_count += 1
 *             j -= 1             # <<<<<<<<<<<<<<
 * 
 *         fill_count = 0
 */
      __pyx_v_j = (__pyx_v_j - 1);
    }

    /* "pandas/src/generated.pyx":928
 *             j -= 1
 * 
 *         fill_count = 0             # <<<<<<<<<<<<<<
 *         i -= 1
 *         cur = prev
 */
    __pyx_v_fill_count = 0;

    /* "pandas/src/generated.pyx":929
 * 
 *         fill_count = 0
 *         i -= 1             # <<<<<<<<<<<<<<
 *         cur = prev
 * 
 */
    __pyx_v_i = (__pyx_v_i - 1);

    /* "pandas/src/generated.pyx":930
 *         fill_count = 0
 *         i -= 1
 *         cur = prev             # <<<<<<<<<<<<<<
 * 
 *     return indexer
 */
    __pyx_v_cur = __pyx_v_prev;
  }
  __pyx_L9_break:;

  /* "pandas/src/generated.pyx":932
 *         cur = prev
 * 
 *     return indexer             # <<<<<<<<<<<<<<
 * 
 * @cython.boundscheck(False)
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_indexer));
  __pyx_r = ((PyObject *)__pyx_v_indexer);
  goto __pyx_L0;

  /* "pandas/src/generated.pyx":874
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def backfill_int64(ndarray[int64_t] old, ndarray[int64_t] new,             # <<<<<<<<<<<<<<
 *                       limit=None):
 *     cdef Py_ssize_t i, j, nleft, nright
 */

  /* function exit code */
  __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_pybuffernd_indexer.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_new.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_old.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas.algos.backfill_int64", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_new.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_old.rcbuffer->pybuffer);
  __pyx_L2:;
  __Pyx_XDECREF((PyObject *)__pyx_v_indexer);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/src/generated.pyx":936
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def backfill_bool(ndarray[uint8_t] old, ndarray[uint8_t] new,             # <<<<<<<<<<<<<<
 *                       limit=None):
 *     cdef Py_ssize_t i, j, nleft, nright
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pandas_5algos_137backfill_bool(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_5algos_137backfill_bool = {__Pyx_NAMESTR("backfill_bool"), (PyCFunction)__pyx_pw_6pandas_5algos_137backfill_bool, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pw_6pandas_5algos_137backfill_bool(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyArrayObject *__pyx_v_old = 0;
  PyArrayObject *__pyx_v_new = 0;
  PyObject *__pyx_v_limit = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("backfill_bool (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_old,&__pyx_n_s_new,&__pyx_n_s_limit,0};
    PyObject* values[3] = {0,0,0};

    /* "pandas/src/generated.pyx":937
 * @cython.wraparound(False)
 * def backfill_bool(ndarray[uint8_t] old, ndarray[uint8_t] new,
 *                       limit=None):             # <<<<<<<<<<<<<<
 *     cdef Py_ssize_t i, j, nleft, nright
 *     cdef ndarray[int64_t, ndim=1] indexer
 */
    values[2] = ((PyObject *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_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 (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_old)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_new)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("backfill_bool", 0, 2, 3, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 936; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_limit);
          if (value) { values[2] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "backfill_bool") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 936; __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_old = ((PyArrayObject *)values[0]);
    __pyx_v_new = ((PyArrayObject *)values[1]);
    __pyx_v_limit = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("backfill_bool", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 936; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas.algos.backfill_bool", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_old), __pyx_ptype_5numpy_ndarray, 1, "old", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 936; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_new), __pyx_ptype_5numpy_ndarray, 1, "new", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 936; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_136backfill_bool(__pyx_self, __pyx_v_old, __pyx_v_new, __pyx_v_limit);

  /* "pandas/src/generated.pyx":936
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def backfill_bool(ndarray[uint8_t] old, ndarray[uint8_t] new,             # <<<<<<<<<<<<<<
 *                       limit=None):
 *     cdef Py_ssize_t i, j, nleft, nright
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pandas_5algos_136backfill_bool(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_old, PyArrayObject *__pyx_v_new, PyObject *__pyx_v_limit) {
  Py_ssize_t __pyx_v_i;
  Py_ssize_t __pyx_v_j;
  Py_ssize_t __pyx_v_nleft;
  Py_ssize_t __pyx_v_nright;
  PyArrayObject *__pyx_v_indexer = 0;
  __pyx_t_5numpy_uint8_t __pyx_v_cur;
  __pyx_t_5numpy_uint8_t __pyx_v_prev;
  int __pyx_v_lim;
  int __pyx_v_fill_count;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_indexer;
  __Pyx_Buffer __pyx_pybuffer_indexer;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_new;
  __Pyx_Buffer __pyx_pybuffer_new;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_old;
  __Pyx_Buffer __pyx_pybuffer_old;
  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;
  long __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;
  Py_ssize_t __pyx_t_23;
  Py_ssize_t __pyx_t_24;
  __pyx_t_5numpy_uint8_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;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("backfill_bool", 0);
  __pyx_pybuffer_indexer.pybuffer.buf = NULL;
  __pyx_pybuffer_indexer.refcount = 0;
  __pyx_pybuffernd_indexer.data = NULL;
  __pyx_pybuffernd_indexer.rcbuffer = &__pyx_pybuffer_indexer;
  __pyx_pybuffer_old.pybuffer.buf = NULL;
  __pyx_pybuffer_old.refcount = 0;
  __pyx_pybuffernd_old.data = NULL;
  __pyx_pybuffernd_old.rcbuffer = &__pyx_pybuffer_old;
  __pyx_pybuffer_new.pybuffer.buf = NULL;
  __pyx_pybuffer_new.refcount = 0;
  __pyx_pybuffernd_new.data = NULL;
  __pyx_pybuffernd_new.rcbuffer = &__pyx_pybuffer_new;
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_old.rcbuffer->pybuffer, (PyObject*)__pyx_v_old, &__Pyx_TypeInfo_nn___pyx_t_5numpy_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 936; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_old.diminfo[0].strides = __pyx_pybuffernd_old.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_old.diminfo[0].shape = __pyx_pybuffernd_old.rcbuffer->pybuffer.shape[0];
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_new.rcbuffer->pybuffer, (PyObject*)__pyx_v_new, &__Pyx_TypeInfo_nn___pyx_t_5numpy_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 936; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_new.diminfo[0].strides = __pyx_pybuffernd_new.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_new.diminfo[0].shape = __pyx_pybuffernd_new.rcbuffer->pybuffer.shape[0];

  /* "pandas/src/generated.pyx":941
 *     cdef ndarray[int64_t, ndim=1] indexer
 *     cdef uint8_t cur, prev
 *     cdef int lim, fill_count = 0             # <<<<<<<<<<<<<<
 * 
 *     nleft = len(old)
 */
  __pyx_v_fill_count = 0;

  /* "pandas/src/generated.pyx":943
 *     cdef int lim, fill_count = 0
 * 
 *     nleft = len(old)             # <<<<<<<<<<<<<<
 *     nright = len(new)
 *     indexer = np.empty(nright, dtype=np.int64)
 */
  __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_old)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 943; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_nleft = __pyx_t_1;

  /* "pandas/src/generated.pyx":944
 * 
 *     nleft = len(old)
 *     nright = len(new)             # <<<<<<<<<<<<<<
 *     indexer = np.empty(nright, dtype=np.int64)
 *     indexer.fill(-1)
 */
  __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_new)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 944; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_nright = __pyx_t_1;

  /* "pandas/src/generated.pyx":945
 *     nleft = len(old)
 *     nright = len(new)
 *     indexer = np.empty(nright, dtype=np.int64)             # <<<<<<<<<<<<<<
 *     indexer.fill(-1)
 * 
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 945; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_empty); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 945; __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_nright); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 945; __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 = 945; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__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 = 945; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 945; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_int64); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 945; __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, __pyx_n_s_dtype, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 945; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 945; __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_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__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 = 945; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_7 = ((PyArrayObject *)__pyx_t_6);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer);
    __pyx_t_8 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer, (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_pybuffernd_indexer.rcbuffer->pybuffer, (PyObject*)__pyx_v_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_pybuffernd_indexer.diminfo[0].strides = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_indexer.diminfo[0].shape = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.shape[0];
    if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 945; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_7 = 0;
  __pyx_v_indexer = ((PyArrayObject *)__pyx_t_6);
  __pyx_t_6 = 0;

  /* "pandas/src/generated.pyx":946
 *     nright = len(new)
 *     indexer = np.empty(nright, dtype=np.int64)
 *     indexer.fill(-1)             # <<<<<<<<<<<<<<
 * 
 *     if limit is None:
 */
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_indexer), __pyx_n_s_fill); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 946; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_tuple__72, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 946; __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/generated.pyx":948
 *     indexer.fill(-1)
 * 
 *     if limit is None:             # <<<<<<<<<<<<<<
 *         lim = nright
 *     else:
 */
  __pyx_t_12 = (__pyx_v_limit == Py_None);
  __pyx_t_13 = (__pyx_t_12 != 0);
  if (__pyx_t_13) {

    /* "pandas/src/generated.pyx":949
 * 
 *     if limit is None:
 *         lim = nright             # <<<<<<<<<<<<<<
 *     else:
 *         if limit < 0:
 */
    __pyx_v_lim = __pyx_v_nright;
    goto __pyx_L3;
  }
  /*else*/ {

    /* "pandas/src/generated.pyx":951
 *         lim = nright
 *     else:
 *         if limit < 0:             # <<<<<<<<<<<<<<
 *             raise ValueError('Limit must be non-negative')
 *         lim = limit
 */
    __pyx_t_2 = PyObject_RichCompare(__pyx_v_limit, __pyx_int_0, Py_LT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 951; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_13 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_13 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 951; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (__pyx_t_13) {

      /* "pandas/src/generated.pyx":952
 *     else:
 *         if limit < 0:
 *             raise ValueError('Limit must be non-negative')             # <<<<<<<<<<<<<<
 *         lim = limit
 * 
 */
      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__73, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 952; __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 = 952; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }

    /* "pandas/src/generated.pyx":953
 *         if limit < 0:
 *             raise ValueError('Limit must be non-negative')
 *         lim = limit             # <<<<<<<<<<<<<<
 * 
 *     if nleft == 0 or nright == 0 or new[0] > old[nleft - 1]:
 */
    __pyx_t_8 = __Pyx_PyInt_As_int(__pyx_v_limit); if (unlikely((__pyx_t_8 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 953; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_v_lim = __pyx_t_8;
  }
  __pyx_L3:;

  /* "pandas/src/generated.pyx":955
 *         lim = limit
 * 
 *     if nleft == 0 or nright == 0 or new[0] > old[nleft - 1]:             # <<<<<<<<<<<<<<
 *         return indexer
 * 
 */
  __pyx_t_13 = ((__pyx_v_nleft == 0) != 0);
  if (!__pyx_t_13) {
    __pyx_t_12 = ((__pyx_v_nright == 0) != 0);
    if (!__pyx_t_12) {
      __pyx_t_14 = 0;
      __pyx_t_1 = (__pyx_v_nleft - 1);
      __pyx_t_15 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_uint8_t *, __pyx_pybuffernd_new.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_new.diminfo[0].strides)) > (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_uint8_t *, __pyx_pybuffernd_old.rcbuffer->pybuffer.buf, __pyx_t_1, __pyx_pybuffernd_old.diminfo[0].strides))) != 0);
      __pyx_t_16 = __pyx_t_15;
    } else {
      __pyx_t_16 = __pyx_t_12;
    }
    __pyx_t_12 = __pyx_t_16;
  } else {
    __pyx_t_12 = __pyx_t_13;
  }
  if (__pyx_t_12) {

    /* "pandas/src/generated.pyx":956
 * 
 *     if nleft == 0 or nright == 0 or new[0] > old[nleft - 1]:
 *         return indexer             # <<<<<<<<<<<<<<
 * 
 *     i = nleft - 1
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(((PyObject *)__pyx_v_indexer));
    __pyx_r = ((PyObject *)__pyx_v_indexer);
    goto __pyx_L0;
  }

  /* "pandas/src/generated.pyx":958
 *         return indexer
 * 
 *     i = nleft - 1             # <<<<<<<<<<<<<<
 *     j = nright - 1
 * 
 */
  __pyx_v_i = (__pyx_v_nleft - 1);

  /* "pandas/src/generated.pyx":959
 * 
 *     i = nleft - 1
 *     j = nright - 1             # <<<<<<<<<<<<<<
 * 
 *     cur = old[nleft - 1]
 */
  __pyx_v_j = (__pyx_v_nright - 1);

  /* "pandas/src/generated.pyx":961
 *     j = nright - 1
 * 
 *     cur = old[nleft - 1]             # <<<<<<<<<<<<<<
 * 
 *     while j >= 0 and new[j] > cur:
 */
  __pyx_t_17 = (__pyx_v_nleft - 1);
  __pyx_v_cur = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_uint8_t *, __pyx_pybuffernd_old.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_old.diminfo[0].strides));

  /* "pandas/src/generated.pyx":963
 *     cur = old[nleft - 1]
 * 
 *     while j >= 0 and new[j] > cur:             # <<<<<<<<<<<<<<
 *         j -= 1
 * 
 */
  while (1) {
    __pyx_t_12 = ((__pyx_v_j >= 0) != 0);
    if (__pyx_t_12) {
      __pyx_t_18 = __pyx_v_j;
      __pyx_t_13 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_uint8_t *, __pyx_pybuffernd_new.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_new.diminfo[0].strides)) > __pyx_v_cur) != 0);
      __pyx_t_16 = __pyx_t_13;
    } else {
      __pyx_t_16 = __pyx_t_12;
    }
    if (!__pyx_t_16) break;

    /* "pandas/src/generated.pyx":964
 * 
 *     while j >= 0 and new[j] > cur:
 *         j -= 1             # <<<<<<<<<<<<<<
 * 
 *     while True:
 */
    __pyx_v_j = (__pyx_v_j - 1);
  }

  /* "pandas/src/generated.pyx":966
 *         j -= 1
 * 
 *     while True:             # <<<<<<<<<<<<<<
 *         if j < 0:
 *             break
 */
  while (1) {

    /* "pandas/src/generated.pyx":967
 * 
 *     while True:
 *         if j < 0:             # <<<<<<<<<<<<<<
 *             break
 * 
 */
    __pyx_t_16 = ((__pyx_v_j < 0) != 0);
    if (__pyx_t_16) {

      /* "pandas/src/generated.pyx":968
 *     while True:
 *         if j < 0:
 *             break             # <<<<<<<<<<<<<<
 * 
 *         if i == 0:
 */
      goto __pyx_L9_break;
    }

    /* "pandas/src/generated.pyx":970
 *             break
 * 
 *         if i == 0:             # <<<<<<<<<<<<<<
 *             while j >= 0:
 *                 if new[j] == cur:
 */
    __pyx_t_16 = ((__pyx_v_i == 0) != 0);
    if (__pyx_t_16) {

      /* "pandas/src/generated.pyx":971
 * 
 *         if i == 0:
 *             while j >= 0:             # <<<<<<<<<<<<<<
 *                 if new[j] == cur:
 *                     indexer[j] = i
 */
      while (1) {
        __pyx_t_16 = ((__pyx_v_j >= 0) != 0);
        if (!__pyx_t_16) break;

        /* "pandas/src/generated.pyx":972
 *         if i == 0:
 *             while j >= 0:
 *                 if new[j] == cur:             # <<<<<<<<<<<<<<
 *                     indexer[j] = i
 *                 elif new[j] < cur and fill_count < lim:
 */
        __pyx_t_19 = __pyx_v_j;
        __pyx_t_16 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_uint8_t *, __pyx_pybuffernd_new.rcbuffer->pybuffer.buf, __pyx_t_19, __pyx_pybuffernd_new.diminfo[0].strides)) == __pyx_v_cur) != 0);
        if (__pyx_t_16) {

          /* "pandas/src/generated.pyx":973
 *             while j >= 0:
 *                 if new[j] == cur:
 *                     indexer[j] = i             # <<<<<<<<<<<<<<
 *                 elif new[j] < cur and fill_count < lim:
 *                     indexer[j] = i
 */
          __pyx_t_20 = __pyx_v_j;
          *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_indexer.diminfo[0].strides) = __pyx_v_i;
          goto __pyx_L14;
        }

        /* "pandas/src/generated.pyx":974
 *                 if new[j] == cur:
 *                     indexer[j] = i
 *                 elif new[j] < cur and fill_count < lim:             # <<<<<<<<<<<<<<
 *                     indexer[j] = i
 *                     fill_count += 1
 */
        __pyx_t_21 = __pyx_v_j;
        __pyx_t_16 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_uint8_t *, __pyx_pybuffernd_new.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_new.diminfo[0].strides)) < __pyx_v_cur) != 0);
        if (__pyx_t_16) {
          __pyx_t_12 = ((__pyx_v_fill_count < __pyx_v_lim) != 0);
          __pyx_t_13 = __pyx_t_12;
        } else {
          __pyx_t_13 = __pyx_t_16;
        }
        if (__pyx_t_13) {

          /* "pandas/src/generated.pyx":975
 *                     indexer[j] = i
 *                 elif new[j] < cur and fill_count < lim:
 *                     indexer[j] = i             # <<<<<<<<<<<<<<
 *                     fill_count += 1
 *                 j -= 1
 */
          __pyx_t_22 = __pyx_v_j;
          *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_22, __pyx_pybuffernd_indexer.diminfo[0].strides) = __pyx_v_i;

          /* "pandas/src/generated.pyx":976
 *                 elif new[j] < cur and fill_count < lim:
 *                     indexer[j] = i
 *                     fill_count += 1             # <<<<<<<<<<<<<<
 *                 j -= 1
 *             break
 */
          __pyx_v_fill_count = (__pyx_v_fill_count + 1);
          goto __pyx_L14;
        }
        __pyx_L14:;

        /* "pandas/src/generated.pyx":977
 *                     indexer[j] = i
 *                     fill_count += 1
 *                 j -= 1             # <<<<<<<<<<<<<<
 *             break
 * 
 */
        __pyx_v_j = (__pyx_v_j - 1);
      }

      /* "pandas/src/generated.pyx":978
 *                     fill_count += 1
 *                 j -= 1
 *             break             # <<<<<<<<<<<<<<
 * 
 *         prev = old[i - 1]
 */
      goto __pyx_L9_break;
    }

    /* "pandas/src/generated.pyx":980
 *             break
 * 
 *         prev = old[i - 1]             # <<<<<<<<<<<<<<
 * 
 *         while j >= 0 and prev < new[j] <= cur:
 */
    __pyx_t_23 = (__pyx_v_i - 1);
    __pyx_v_prev = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_uint8_t *, __pyx_pybuffernd_old.rcbuffer->pybuffer.buf, __pyx_t_23, __pyx_pybuffernd_old.diminfo[0].strides));

    /* "pandas/src/generated.pyx":982
 *         prev = old[i - 1]
 * 
 *         while j >= 0 and prev < new[j] <= cur:             # <<<<<<<<<<<<<<
 *             if new[j] == cur:
 *                 indexer[j] = i
 */
    while (1) {
      __pyx_t_13 = ((__pyx_v_j >= 0) != 0);
      if (__pyx_t_13) {
        __pyx_t_24 = __pyx_v_j;
        __pyx_t_25 = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_uint8_t *, __pyx_pybuffernd_new.rcbuffer->pybuffer.buf, __pyx_t_24, __pyx_pybuffernd_new.diminfo[0].strides));
        __pyx_t_16 = (__pyx_v_prev < __pyx_t_25);
        if (__pyx_t_16) {
          __pyx_t_16 = (__pyx_t_25 <= __pyx_v_cur);
        }
        __pyx_t_12 = (__pyx_t_16 != 0);
      } else {
        __pyx_t_12 = __pyx_t_13;
      }
      if (!__pyx_t_12) break;

      /* "pandas/src/generated.pyx":983
 * 
 *         while j >= 0 and prev < new[j] <= cur:
 *             if new[j] == cur:             # <<<<<<<<<<<<<<
 *                 indexer[j] = i
 *             elif new[j] < cur and fill_count < lim:
 */
      __pyx_t_26 = __pyx_v_j;
      __pyx_t_12 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_uint8_t *, __pyx_pybuffernd_new.rcbuffer->pybuffer.buf, __pyx_t_26, __pyx_pybuffernd_new.diminfo[0].strides)) == __pyx_v_cur) != 0);
      if (__pyx_t_12) {

        /* "pandas/src/generated.pyx":984
 *         while j >= 0 and prev < new[j] <= cur:
 *             if new[j] == cur:
 *                 indexer[j] = i             # <<<<<<<<<<<<<<
 *             elif new[j] < cur and fill_count < lim:
 *                 indexer[j] = i
 */
        __pyx_t_27 = __pyx_v_j;
        *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_27, __pyx_pybuffernd_indexer.diminfo[0].strides) = __pyx_v_i;
        goto __pyx_L17;
      }

      /* "pandas/src/generated.pyx":985
 *             if new[j] == cur:
 *                 indexer[j] = i
 *             elif new[j] < cur and fill_count < lim:             # <<<<<<<<<<<<<<
 *                 indexer[j] = i
 *                 fill_count += 1
 */
      __pyx_t_28 = __pyx_v_j;
      __pyx_t_12 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_uint8_t *, __pyx_pybuffernd_new.rcbuffer->pybuffer.buf, __pyx_t_28, __pyx_pybuffernd_new.diminfo[0].strides)) < __pyx_v_cur) != 0);
      if (__pyx_t_12) {
        __pyx_t_13 = ((__pyx_v_fill_count < __pyx_v_lim) != 0);
        __pyx_t_16 = __pyx_t_13;
      } else {
        __pyx_t_16 = __pyx_t_12;
      }
      if (__pyx_t_16) {

        /* "pandas/src/generated.pyx":986
 *                 indexer[j] = i
 *             elif new[j] < cur and fill_count < lim:
 *                 indexer[j] = i             # <<<<<<<<<<<<<<
 *                 fill_count += 1
 *             j -= 1
 */
        __pyx_t_29 = __pyx_v_j;
        *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_29, __pyx_pybuffernd_indexer.diminfo[0].strides) = __pyx_v_i;

        /* "pandas/src/generated.pyx":987
 *             elif new[j] < cur and fill_count < lim:
 *                 indexer[j] = i
 *                 fill_count += 1             # <<<<<<<<<<<<<<
 *             j -= 1
 * 
 */
        __pyx_v_fill_count = (__pyx_v_fill_count + 1);
        goto __pyx_L17;
      }
      __pyx_L17:;

      /* "pandas/src/generated.pyx":988
 *                 indexer[j] = i
 *                 fill_count += 1
 *             j -= 1             # <<<<<<<<<<<<<<
 * 
 *         fill_count = 0
 */
      __pyx_v_j = (__pyx_v_j - 1);
    }

    /* "pandas/src/generated.pyx":990
 *             j -= 1
 * 
 *         fill_count = 0             # <<<<<<<<<<<<<<
 *         i -= 1
 *         cur = prev
 */
    __pyx_v_fill_count = 0;

    /* "pandas/src/generated.pyx":991
 * 
 *         fill_count = 0
 *         i -= 1             # <<<<<<<<<<<<<<
 *         cur = prev
 * 
 */
    __pyx_v_i = (__pyx_v_i - 1);

    /* "pandas/src/generated.pyx":992
 *         fill_count = 0
 *         i -= 1
 *         cur = prev             # <<<<<<<<<<<<<<
 * 
 *     return indexer
 */
    __pyx_v_cur = __pyx_v_prev;
  }
  __pyx_L9_break:;

  /* "pandas/src/generated.pyx":994
 *         cur = prev
 * 
 *     return indexer             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_indexer));
  __pyx_r = ((PyObject *)__pyx_v_indexer);
  goto __pyx_L0;

  /* "pandas/src/generated.pyx":936
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def backfill_bool(ndarray[uint8_t] old, ndarray[uint8_t] new,             # <<<<<<<<<<<<<<
 *                       limit=None):
 *     cdef Py_ssize_t i, j, nleft, nright
 */

  /* function exit code */
  __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_pybuffernd_indexer.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_new.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_old.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas.algos.backfill_bool", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_new.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_old.rcbuffer->pybuffer);
  __pyx_L2:;
  __Pyx_XDECREF((PyObject *)__pyx_v_indexer);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/src/generated.pyx":999
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def pad_inplace_float64(ndarray[float64_t] values,             # <<<<<<<<<<<<<<
 *                          ndarray[uint8_t, cast=True] mask,
 *                          limit=None):
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pandas_5algos_139pad_inplace_float64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_5algos_139pad_inplace_float64 = {__Pyx_NAMESTR("pad_inplace_float64"), (PyCFunction)__pyx_pw_6pandas_5algos_139pad_inplace_float64, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pw_6pandas_5algos_139pad_inplace_float64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyArrayObject *__pyx_v_values = 0;
  PyArrayObject *__pyx_v_mask = 0;
  PyObject *__pyx_v_limit = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("pad_inplace_float64 (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_values,&__pyx_n_s_mask,&__pyx_n_s_limit,0};
    PyObject* values[3] = {0,0,0};

    /* "pandas/src/generated.pyx":1001
 * def pad_inplace_float64(ndarray[float64_t] values,
 *                          ndarray[uint8_t, cast=True] mask,
 *                          limit=None):             # <<<<<<<<<<<<<<
 *     cdef Py_ssize_t i, N
 *     cdef float64_t val
 */
    values[2] = ((PyObject *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_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 (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_mask)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("pad_inplace_float64", 0, 2, 3, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 999; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_limit);
          if (value) { values[2] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "pad_inplace_float64") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 999; __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_mask = ((PyArrayObject *)values[1]);
    __pyx_v_limit = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("pad_inplace_float64", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 999; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas.algos.pad_inplace_float64", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 999; __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[2]; __pyx_lineno = 1000; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_138pad_inplace_float64(__pyx_self, __pyx_v_values, __pyx_v_mask, __pyx_v_limit);

  /* "pandas/src/generated.pyx":999
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def pad_inplace_float64(ndarray[float64_t] values,             # <<<<<<<<<<<<<<
 *                          ndarray[uint8_t, cast=True] mask,
 *                          limit=None):
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pandas_5algos_138pad_inplace_float64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_mask, PyObject *__pyx_v_limit) {
  Py_ssize_t __pyx_v_i;
  Py_ssize_t __pyx_v_N;
  __pyx_t_5numpy_float64_t __pyx_v_val;
  int __pyx_v_lim;
  int __pyx_v_fill_count;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_mask;
  __Pyx_Buffer __pyx_pybuffer_mask;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_values;
  __Pyx_Buffer __pyx_pybuffer_values;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  Py_ssize_t __pyx_t_1;
  int __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  long __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;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("pad_inplace_float64", 0);
  __pyx_pybuffer_values.pybuffer.buf = NULL;
  __pyx_pybuffer_values.refcount = 0;
  __pyx_pybuffernd_values.data = NULL;
  __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values;
  __pyx_pybuffer_mask.pybuffer.buf = NULL;
  __pyx_pybuffer_mask.refcount = 0;
  __pyx_pybuffernd_mask.data = NULL;
  __pyx_pybuffernd_mask.rcbuffer = &__pyx_pybuffer_mask;
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 999; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0];
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_mask.rcbuffer->pybuffer, (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[2]; __pyx_lineno = 999; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_mask.diminfo[0].strides = __pyx_pybuffernd_mask.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_mask.diminfo[0].shape = __pyx_pybuffernd_mask.rcbuffer->pybuffer.shape[0];

  /* "pandas/src/generated.pyx":1004
 *     cdef Py_ssize_t i, N
 *     cdef float64_t val
 *     cdef int lim, fill_count = 0             # <<<<<<<<<<<<<<
 * 
 *     N = len(values)
 */
  __pyx_v_fill_count = 0;

  /* "pandas/src/generated.pyx":1006
 *     cdef int lim, fill_count = 0
 * 
 *     N = len(values)             # <<<<<<<<<<<<<<
 * 
 *     # GH 2778
 */
  __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_values)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1006; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_N = __pyx_t_1;

  /* "pandas/src/generated.pyx":1009
 * 
 *     # GH 2778
 *     if N == 0:             # <<<<<<<<<<<<<<
 *         return
 * 
 */
  __pyx_t_2 = ((__pyx_v_N == 0) != 0);
  if (__pyx_t_2) {

    /* "pandas/src/generated.pyx":1010
 *     # GH 2778
 *     if N == 0:
 *         return             # <<<<<<<<<<<<<<
 * 
 *     if limit is None:
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_r = Py_None; __Pyx_INCREF(Py_None);
    goto __pyx_L0;
  }

  /* "pandas/src/generated.pyx":1012
 *         return
 * 
 *     if limit is None:             # <<<<<<<<<<<<<<
 *         lim = N
 *     else:
 */
  __pyx_t_2 = (__pyx_v_limit == Py_None);
  __pyx_t_3 = (__pyx_t_2 != 0);
  if (__pyx_t_3) {

    /* "pandas/src/generated.pyx":1013
 * 
 *     if limit is None:
 *         lim = N             # <<<<<<<<<<<<<<
 *     else:
 *         if limit < 0:
 */
    __pyx_v_lim = __pyx_v_N;
    goto __pyx_L4;
  }
  /*else*/ {

    /* "pandas/src/generated.pyx":1015
 *         lim = N
 *     else:
 *         if limit < 0:             # <<<<<<<<<<<<<<
 *             raise ValueError('Limit must be non-negative')
 *         lim = limit
 */
    __pyx_t_4 = PyObject_RichCompare(__pyx_v_limit, __pyx_int_0, Py_LT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1015; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1015; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (__pyx_t_3) {

      /* "pandas/src/generated.pyx":1016
 *     else:
 *         if limit < 0:
 *             raise ValueError('Limit must be non-negative')             # <<<<<<<<<<<<<<
 *         lim = limit
 * 
 */
      __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__74, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1016; __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[2]; __pyx_lineno = 1016; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }

    /* "pandas/src/generated.pyx":1017
 *         if limit < 0:
 *             raise ValueError('Limit must be non-negative')
 *         lim = limit             # <<<<<<<<<<<<<<
 * 
 *     val = values[0]
 */
    __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_v_limit); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1017; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_v_lim = __pyx_t_5;
  }
  __pyx_L4:;

  /* "pandas/src/generated.pyx":1019
 *         lim = limit
 * 
 *     val = values[0]             # <<<<<<<<<<<<<<
 *     for i in range(N):
 *         if mask[i]:
 */
  __pyx_t_6 = 0;
  __pyx_v_val = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_values.diminfo[0].strides));

  /* "pandas/src/generated.pyx":1020
 * 
 *     val = values[0]
 *     for i in range(N):             # <<<<<<<<<<<<<<
 *         if mask[i]:
 *             if fill_count >= lim:
 */
  __pyx_t_1 = __pyx_v_N;
  for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_1; __pyx_t_7+=1) {
    __pyx_v_i = __pyx_t_7;

    /* "pandas/src/generated.pyx":1021
 *     val = values[0]
 *     for i in range(N):
 *         if mask[i]:             # <<<<<<<<<<<<<<
 *             if fill_count >= lim:
 *                 continue
 */
    __pyx_t_8 = __pyx_v_i;
    __pyx_t_3 = ((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_uint8_t *, __pyx_pybuffernd_mask.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_mask.diminfo[0].strides)) != 0);
    if (__pyx_t_3) {

      /* "pandas/src/generated.pyx":1022
 *     for i in range(N):
 *         if mask[i]:
 *             if fill_count >= lim:             # <<<<<<<<<<<<<<
 *                 continue
 *             fill_count += 1
 */
      __pyx_t_3 = ((__pyx_v_fill_count >= __pyx_v_lim) != 0);
      if (__pyx_t_3) {

        /* "pandas/src/generated.pyx":1023
 *         if mask[i]:
 *             if fill_count >= lim:
 *                 continue             # <<<<<<<<<<<<<<
 *             fill_count += 1
 *             values[i] = val
 */
        goto __pyx_L6_continue;
      }

      /* "pandas/src/generated.pyx":1024
 *             if fill_count >= lim:
 *                 continue
 *             fill_count += 1             # <<<<<<<<<<<<<<
 *             values[i] = val
 *         else:
 */
      __pyx_v_fill_count = (__pyx_v_fill_count + 1);

      /* "pandas/src/generated.pyx":1025
 *                 continue
 *             fill_count += 1
 *             values[i] = val             # <<<<<<<<<<<<<<
 *         else:
 *             fill_count = 0
 */
      __pyx_t_9 = __pyx_v_i;
      *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_9, __pyx_pybuffernd_values.diminfo[0].strides) = __pyx_v_val;
      goto __pyx_L8;
    }
    /*else*/ {

      /* "pandas/src/generated.pyx":1027
 *             values[i] = val
 *         else:
 *             fill_count = 0             # <<<<<<<<<<<<<<
 *             val = values[i]
 * 
 */
      __pyx_v_fill_count = 0;

      /* "pandas/src/generated.pyx":1028
 *         else:
 *             fill_count = 0
 *             val = values[i]             # <<<<<<<<<<<<<<
 * 
 * @cython.boundscheck(False)
 */
      __pyx_t_10 = __pyx_v_i;
      __pyx_v_val = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_10, __pyx_pybuffernd_values.diminfo[0].strides));
    }
    __pyx_L8:;
    __pyx_L6_continue:;
  }

  /* "pandas/src/generated.pyx":999
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def pad_inplace_float64(ndarray[float64_t] values,             # <<<<<<<<<<<<<<
 *                          ndarray[uint8_t, cast=True] mask,
 *                          limit=None):
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
    __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_mask.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas.algos.pad_inplace_float64", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_mask.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer);
  __pyx_L2:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/src/generated.pyx":1032
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def pad_inplace_float32(ndarray[float32_t] values,             # <<<<<<<<<<<<<<
 *                          ndarray[uint8_t, cast=True] mask,
 *                          limit=None):
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pandas_5algos_141pad_inplace_float32(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_5algos_141pad_inplace_float32 = {__Pyx_NAMESTR("pad_inplace_float32"), (PyCFunction)__pyx_pw_6pandas_5algos_141pad_inplace_float32, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pw_6pandas_5algos_141pad_inplace_float32(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyArrayObject *__pyx_v_values = 0;
  PyArrayObject *__pyx_v_mask = 0;
  PyObject *__pyx_v_limit = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("pad_inplace_float32 (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_values,&__pyx_n_s_mask,&__pyx_n_s_limit,0};
    PyObject* values[3] = {0,0,0};

    /* "pandas/src/generated.pyx":1034
 * def pad_inplace_float32(ndarray[float32_t] values,
 *                          ndarray[uint8_t, cast=True] mask,
 *                          limit=None):             # <<<<<<<<<<<<<<
 *     cdef Py_ssize_t i, N
 *     cdef float32_t val
 */
    values[2] = ((PyObject *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_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 (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_mask)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("pad_inplace_float32", 0, 2, 3, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1032; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_limit);
          if (value) { values[2] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "pad_inplace_float32") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1032; __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_mask = ((PyArrayObject *)values[1]);
    __pyx_v_limit = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("pad_inplace_float32", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1032; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas.algos.pad_inplace_float32", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1032; __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[2]; __pyx_lineno = 1033; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_140pad_inplace_float32(__pyx_self, __pyx_v_values, __pyx_v_mask, __pyx_v_limit);

  /* "pandas/src/generated.pyx":1032
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def pad_inplace_float32(ndarray[float32_t] values,             # <<<<<<<<<<<<<<
 *                          ndarray[uint8_t, cast=True] mask,
 *                          limit=None):
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pandas_5algos_140pad_inplace_float32(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_mask, PyObject *__pyx_v_limit) {
  Py_ssize_t __pyx_v_i;
  Py_ssize_t __pyx_v_N;
  __pyx_t_5numpy_float32_t __pyx_v_val;
  int __pyx_v_lim;
  int __pyx_v_fill_count;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_mask;
  __Pyx_Buffer __pyx_pybuffer_mask;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_values;
  __Pyx_Buffer __pyx_pybuffer_values;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  Py_ssize_t __pyx_t_1;
  int __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  long __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;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("pad_inplace_float32", 0);
  __pyx_pybuffer_values.pybuffer.buf = NULL;
  __pyx_pybuffer_values.refcount = 0;
  __pyx_pybuffernd_values.data = NULL;
  __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values;
  __pyx_pybuffer_mask.pybuffer.buf = NULL;
  __pyx_pybuffer_mask.refcount = 0;
  __pyx_pybuffernd_mask.data = NULL;
  __pyx_pybuffernd_mask.rcbuffer = &__pyx_pybuffer_mask;
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1032; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0];
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_mask.rcbuffer->pybuffer, (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[2]; __pyx_lineno = 1032; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_mask.diminfo[0].strides = __pyx_pybuffernd_mask.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_mask.diminfo[0].shape = __pyx_pybuffernd_mask.rcbuffer->pybuffer.shape[0];

  /* "pandas/src/generated.pyx":1037
 *     cdef Py_ssize_t i, N
 *     cdef float32_t val
 *     cdef int lim, fill_count = 0             # <<<<<<<<<<<<<<
 * 
 *     N = len(values)
 */
  __pyx_v_fill_count = 0;

  /* "pandas/src/generated.pyx":1039
 *     cdef int lim, fill_count = 0
 * 
 *     N = len(values)             # <<<<<<<<<<<<<<
 * 
 *     # GH 2778
 */
  __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_values)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1039; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_N = __pyx_t_1;

  /* "pandas/src/generated.pyx":1042
 * 
 *     # GH 2778
 *     if N == 0:             # <<<<<<<<<<<<<<
 *         return
 * 
 */
  __pyx_t_2 = ((__pyx_v_N == 0) != 0);
  if (__pyx_t_2) {

    /* "pandas/src/generated.pyx":1043
 *     # GH 2778
 *     if N == 0:
 *         return             # <<<<<<<<<<<<<<
 * 
 *     if limit is None:
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_r = Py_None; __Pyx_INCREF(Py_None);
    goto __pyx_L0;
  }

  /* "pandas/src/generated.pyx":1045
 *         return
 * 
 *     if limit is None:             # <<<<<<<<<<<<<<
 *         lim = N
 *     else:
 */
  __pyx_t_2 = (__pyx_v_limit == Py_None);
  __pyx_t_3 = (__pyx_t_2 != 0);
  if (__pyx_t_3) {

    /* "pandas/src/generated.pyx":1046
 * 
 *     if limit is None:
 *         lim = N             # <<<<<<<<<<<<<<
 *     else:
 *         if limit < 0:
 */
    __pyx_v_lim = __pyx_v_N;
    goto __pyx_L4;
  }
  /*else*/ {

    /* "pandas/src/generated.pyx":1048
 *         lim = N
 *     else:
 *         if limit < 0:             # <<<<<<<<<<<<<<
 *             raise ValueError('Limit must be non-negative')
 *         lim = limit
 */
    __pyx_t_4 = PyObject_RichCompare(__pyx_v_limit, __pyx_int_0, Py_LT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1048; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1048; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (__pyx_t_3) {

      /* "pandas/src/generated.pyx":1049
 *     else:
 *         if limit < 0:
 *             raise ValueError('Limit must be non-negative')             # <<<<<<<<<<<<<<
 *         lim = limit
 * 
 */
      __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__75, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1049; __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[2]; __pyx_lineno = 1049; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }

    /* "pandas/src/generated.pyx":1050
 *         if limit < 0:
 *             raise ValueError('Limit must be non-negative')
 *         lim = limit             # <<<<<<<<<<<<<<
 * 
 *     val = values[0]
 */
    __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_v_limit); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1050; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_v_lim = __pyx_t_5;
  }
  __pyx_L4:;

  /* "pandas/src/generated.pyx":1052
 *         lim = limit
 * 
 *     val = values[0]             # <<<<<<<<<<<<<<
 *     for i in range(N):
 *         if mask[i]:
 */
  __pyx_t_6 = 0;
  __pyx_v_val = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_values.diminfo[0].strides));

  /* "pandas/src/generated.pyx":1053
 * 
 *     val = values[0]
 *     for i in range(N):             # <<<<<<<<<<<<<<
 *         if mask[i]:
 *             if fill_count >= lim:
 */
  __pyx_t_1 = __pyx_v_N;
  for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_1; __pyx_t_7+=1) {
    __pyx_v_i = __pyx_t_7;

    /* "pandas/src/generated.pyx":1054
 *     val = values[0]
 *     for i in range(N):
 *         if mask[i]:             # <<<<<<<<<<<<<<
 *             if fill_count >= lim:
 *                 continue
 */
    __pyx_t_8 = __pyx_v_i;
    __pyx_t_3 = ((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_uint8_t *, __pyx_pybuffernd_mask.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_mask.diminfo[0].strides)) != 0);
    if (__pyx_t_3) {

      /* "pandas/src/generated.pyx":1055
 *     for i in range(N):
 *         if mask[i]:
 *             if fill_count >= lim:             # <<<<<<<<<<<<<<
 *                 continue
 *             fill_count += 1
 */
      __pyx_t_3 = ((__pyx_v_fill_count >= __pyx_v_lim) != 0);
      if (__pyx_t_3) {

        /* "pandas/src/generated.pyx":1056
 *         if mask[i]:
 *             if fill_count >= lim:
 *                 continue             # <<<<<<<<<<<<<<
 *             fill_count += 1
 *             values[i] = val
 */
        goto __pyx_L6_continue;
      }

      /* "pandas/src/generated.pyx":1057
 *             if fill_count >= lim:
 *                 continue
 *             fill_count += 1             # <<<<<<<<<<<<<<
 *             values[i] = val
 *         else:
 */
      __pyx_v_fill_count = (__pyx_v_fill_count + 1);

      /* "pandas/src/generated.pyx":1058
 *                 continue
 *             fill_count += 1
 *             values[i] = val             # <<<<<<<<<<<<<<
 *         else:
 *             fill_count = 0
 */
      __pyx_t_9 = __pyx_v_i;
      *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_9, __pyx_pybuffernd_values.diminfo[0].strides) = __pyx_v_val;
      goto __pyx_L8;
    }
    /*else*/ {

      /* "pandas/src/generated.pyx":1060
 *             values[i] = val
 *         else:
 *             fill_count = 0             # <<<<<<<<<<<<<<
 *             val = values[i]
 * 
 */
      __pyx_v_fill_count = 0;

      /* "pandas/src/generated.pyx":1061
 *         else:
 *             fill_count = 0
 *             val = values[i]             # <<<<<<<<<<<<<<
 * 
 * @cython.boundscheck(False)
 */
      __pyx_t_10 = __pyx_v_i;
      __pyx_v_val = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_10, __pyx_pybuffernd_values.diminfo[0].strides));
    }
    __pyx_L8:;
    __pyx_L6_continue:;
  }

  /* "pandas/src/generated.pyx":1032
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def pad_inplace_float32(ndarray[float32_t] values,             # <<<<<<<<<<<<<<
 *                          ndarray[uint8_t, cast=True] mask,
 *                          limit=None):
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
    __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_mask.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas.algos.pad_inplace_float32", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_mask.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer);
  __pyx_L2:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/src/generated.pyx":1065
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def pad_inplace_object(ndarray[object] values,             # <<<<<<<<<<<<<<
 *                          ndarray[uint8_t, cast=True] mask,
 *                          limit=None):
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pandas_5algos_143pad_inplace_object(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_5algos_143pad_inplace_object = {__Pyx_NAMESTR("pad_inplace_object"), (PyCFunction)__pyx_pw_6pandas_5algos_143pad_inplace_object, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pw_6pandas_5algos_143pad_inplace_object(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyArrayObject *__pyx_v_values = 0;
  PyArrayObject *__pyx_v_mask = 0;
  PyObject *__pyx_v_limit = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("pad_inplace_object (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_values,&__pyx_n_s_mask,&__pyx_n_s_limit,0};
    PyObject* values[3] = {0,0,0};

    /* "pandas/src/generated.pyx":1067
 * def pad_inplace_object(ndarray[object] values,
 *                          ndarray[uint8_t, cast=True] mask,
 *                          limit=None):             # <<<<<<<<<<<<<<
 *     cdef Py_ssize_t i, N
 *     cdef object val
 */
    values[2] = ((PyObject *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_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 (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_mask)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("pad_inplace_object", 0, 2, 3, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1065; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_limit);
          if (value) { values[2] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "pad_inplace_object") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1065; __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_mask = ((PyArrayObject *)values[1]);
    __pyx_v_limit = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("pad_inplace_object", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1065; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas.algos.pad_inplace_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1065; __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[2]; __pyx_lineno = 1066; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_142pad_inplace_object(__pyx_self, __pyx_v_values, __pyx_v_mask, __pyx_v_limit);

  /* "pandas/src/generated.pyx":1065
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def pad_inplace_object(ndarray[object] values,             # <<<<<<<<<<<<<<
 *                          ndarray[uint8_t, cast=True] mask,
 *                          limit=None):
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pandas_5algos_142pad_inplace_object(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_mask, PyObject *__pyx_v_limit) {
  Py_ssize_t __pyx_v_i;
  Py_ssize_t __pyx_v_N;
  PyObject *__pyx_v_val = 0;
  int __pyx_v_lim;
  int __pyx_v_fill_count;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_mask;
  __Pyx_Buffer __pyx_pybuffer_mask;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_values;
  __Pyx_Buffer __pyx_pybuffer_values;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  Py_ssize_t __pyx_t_1;
  int __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  long __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;
  Py_ssize_t __pyx_t_11;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("pad_inplace_object", 0);
  __pyx_pybuffer_values.pybuffer.buf = NULL;
  __pyx_pybuffer_values.refcount = 0;
  __pyx_pybuffernd_values.data = NULL;
  __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values;
  __pyx_pybuffer_mask.pybuffer.buf = NULL;
  __pyx_pybuffer_mask.refcount = 0;
  __pyx_pybuffernd_mask.data = NULL;
  __pyx_pybuffernd_mask.rcbuffer = &__pyx_pybuffer_mask;
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (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 = 1065; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0];
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_mask.rcbuffer->pybuffer, (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[2]; __pyx_lineno = 1065; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_mask.diminfo[0].strides = __pyx_pybuffernd_mask.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_mask.diminfo[0].shape = __pyx_pybuffernd_mask.rcbuffer->pybuffer.shape[0];

  /* "pandas/src/generated.pyx":1070
 *     cdef Py_ssize_t i, N
 *     cdef object val
 *     cdef int lim, fill_count = 0             # <<<<<<<<<<<<<<
 * 
 *     N = len(values)
 */
  __pyx_v_fill_count = 0;

  /* "pandas/src/generated.pyx":1072
 *     cdef int lim, fill_count = 0
 * 
 *     N = len(values)             # <<<<<<<<<<<<<<
 * 
 *     # GH 2778
 */
  __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_values)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1072; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_N = __pyx_t_1;

  /* "pandas/src/generated.pyx":1075
 * 
 *     # GH 2778
 *     if N == 0:             # <<<<<<<<<<<<<<
 *         return
 * 
 */
  __pyx_t_2 = ((__pyx_v_N == 0) != 0);
  if (__pyx_t_2) {

    /* "pandas/src/generated.pyx":1076
 *     # GH 2778
 *     if N == 0:
 *         return             # <<<<<<<<<<<<<<
 * 
 *     if limit is None:
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_r = Py_None; __Pyx_INCREF(Py_None);
    goto __pyx_L0;
  }

  /* "pandas/src/generated.pyx":1078
 *         return
 * 
 *     if limit is None:             # <<<<<<<<<<<<<<
 *         lim = N
 *     else:
 */
  __pyx_t_2 = (__pyx_v_limit == Py_None);
  __pyx_t_3 = (__pyx_t_2 != 0);
  if (__pyx_t_3) {

    /* "pandas/src/generated.pyx":1079
 * 
 *     if limit is None:
 *         lim = N             # <<<<<<<<<<<<<<
 *     else:
 *         if limit < 0:
 */
    __pyx_v_lim = __pyx_v_N;
    goto __pyx_L4;
  }
  /*else*/ {

    /* "pandas/src/generated.pyx":1081
 *         lim = N
 *     else:
 *         if limit < 0:             # <<<<<<<<<<<<<<
 *             raise ValueError('Limit must be non-negative')
 *         lim = limit
 */
    __pyx_t_4 = PyObject_RichCompare(__pyx_v_limit, __pyx_int_0, Py_LT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1081; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1081; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (__pyx_t_3) {

      /* "pandas/src/generated.pyx":1082
 *     else:
 *         if limit < 0:
 *             raise ValueError('Limit must be non-negative')             # <<<<<<<<<<<<<<
 *         lim = limit
 * 
 */
      __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__76, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1082; __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[2]; __pyx_lineno = 1082; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }

    /* "pandas/src/generated.pyx":1083
 *         if limit < 0:
 *             raise ValueError('Limit must be non-negative')
 *         lim = limit             # <<<<<<<<<<<<<<
 * 
 *     val = values[0]
 */
    __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_v_limit); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1083; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_v_lim = __pyx_t_5;
  }
  __pyx_L4:;

  /* "pandas/src/generated.pyx":1085
 *         lim = limit
 * 
 *     val = values[0]             # <<<<<<<<<<<<<<
 *     for i in range(N):
 *         if mask[i]:
 */
  __pyx_t_6 = 0;
  __pyx_t_4 = (PyObject *) *__Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_values.diminfo[0].strides);
  __Pyx_INCREF((PyObject*)__pyx_t_4);
  __pyx_v_val = __pyx_t_4;
  __pyx_t_4 = 0;

  /* "pandas/src/generated.pyx":1086
 * 
 *     val = values[0]
 *     for i in range(N):             # <<<<<<<<<<<<<<
 *         if mask[i]:
 *             if fill_count >= lim:
 */
  __pyx_t_1 = __pyx_v_N;
  for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_1; __pyx_t_7+=1) {
    __pyx_v_i = __pyx_t_7;

    /* "pandas/src/generated.pyx":1087
 *     val = values[0]
 *     for i in range(N):
 *         if mask[i]:             # <<<<<<<<<<<<<<
 *             if fill_count >= lim:
 *                 continue
 */
    __pyx_t_8 = __pyx_v_i;
    __pyx_t_3 = ((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_uint8_t *, __pyx_pybuffernd_mask.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_mask.diminfo[0].strides)) != 0);
    if (__pyx_t_3) {

      /* "pandas/src/generated.pyx":1088
 *     for i in range(N):
 *         if mask[i]:
 *             if fill_count >= lim:             # <<<<<<<<<<<<<<
 *                 continue
 *             fill_count += 1
 */
      __pyx_t_3 = ((__pyx_v_fill_count >= __pyx_v_lim) != 0);
      if (__pyx_t_3) {

        /* "pandas/src/generated.pyx":1089
 *         if mask[i]:
 *             if fill_count >= lim:
 *                 continue             # <<<<<<<<<<<<<<
 *             fill_count += 1
 *             values[i] = val
 */
        goto __pyx_L6_continue;
      }

      /* "pandas/src/generated.pyx":1090
 *             if fill_count >= lim:
 *                 continue
 *             fill_count += 1             # <<<<<<<<<<<<<<
 *             values[i] = val
 *         else:
 */
      __pyx_v_fill_count = (__pyx_v_fill_count + 1);

      /* "pandas/src/generated.pyx":1091
 *                 continue
 *             fill_count += 1
 *             values[i] = val             # <<<<<<<<<<<<<<
 *         else:
 *             fill_count = 0
 */
      __pyx_t_9 = __pyx_v_i;
      __pyx_t_10 = __Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_9, __pyx_pybuffernd_values.diminfo[0].strides);
      __Pyx_GOTREF(*__pyx_t_10);
      __Pyx_INCREF(__pyx_v_val); __Pyx_DECREF(*__pyx_t_10);
      *__pyx_t_10 = __pyx_v_val;
      __Pyx_GIVEREF(*__pyx_t_10);
      goto __pyx_L8;
    }
    /*else*/ {

      /* "pandas/src/generated.pyx":1093
 *             values[i] = val
 *         else:
 *             fill_count = 0             # <<<<<<<<<<<<<<
 *             val = values[i]
 * 
 */
      __pyx_v_fill_count = 0;

      /* "pandas/src/generated.pyx":1094
 *         else:
 *             fill_count = 0
 *             val = values[i]             # <<<<<<<<<<<<<<
 * 
 * @cython.boundscheck(False)
 */
      __pyx_t_11 = __pyx_v_i;
      __pyx_t_4 = (PyObject *) *__Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_values.diminfo[0].strides);
      __Pyx_INCREF((PyObject*)__pyx_t_4);
      __Pyx_DECREF_SET(__pyx_v_val, __pyx_t_4);
      __pyx_t_4 = 0;
    }
    __pyx_L8:;
    __pyx_L6_continue:;
  }

  /* "pandas/src/generated.pyx":1065
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def pad_inplace_object(ndarray[object] values,             # <<<<<<<<<<<<<<
 *                          ndarray[uint8_t, cast=True] mask,
 *                          limit=None):
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
    __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_mask.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas.algos.pad_inplace_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_mask.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer);
  __pyx_L2:;
  __Pyx_XDECREF(__pyx_v_val);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/src/generated.pyx":1098
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def pad_inplace_int32(ndarray[int32_t] values,             # <<<<<<<<<<<<<<
 *                          ndarray[uint8_t, cast=True] mask,
 *                          limit=None):
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pandas_5algos_145pad_inplace_int32(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_5algos_145pad_inplace_int32 = {__Pyx_NAMESTR("pad_inplace_int32"), (PyCFunction)__pyx_pw_6pandas_5algos_145pad_inplace_int32, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pw_6pandas_5algos_145pad_inplace_int32(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyArrayObject *__pyx_v_values = 0;
  PyArrayObject *__pyx_v_mask = 0;
  PyObject *__pyx_v_limit = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("pad_inplace_int32 (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_values,&__pyx_n_s_mask,&__pyx_n_s_limit,0};
    PyObject* values[3] = {0,0,0};

    /* "pandas/src/generated.pyx":1100
 * def pad_inplace_int32(ndarray[int32_t] values,
 *                          ndarray[uint8_t, cast=True] mask,
 *                          limit=None):             # <<<<<<<<<<<<<<
 *     cdef Py_ssize_t i, N
 *     cdef int32_t val
 */
    values[2] = ((PyObject *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_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 (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_mask)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("pad_inplace_int32", 0, 2, 3, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1098; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_limit);
          if (value) { values[2] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "pad_inplace_int32") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1098; __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_mask = ((PyArrayObject *)values[1]);
    __pyx_v_limit = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("pad_inplace_int32", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1098; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas.algos.pad_inplace_int32", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1098; __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[2]; __pyx_lineno = 1099; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_144pad_inplace_int32(__pyx_self, __pyx_v_values, __pyx_v_mask, __pyx_v_limit);

  /* "pandas/src/generated.pyx":1098
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def pad_inplace_int32(ndarray[int32_t] values,             # <<<<<<<<<<<<<<
 *                          ndarray[uint8_t, cast=True] mask,
 *                          limit=None):
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pandas_5algos_144pad_inplace_int32(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_mask, PyObject *__pyx_v_limit) {
  Py_ssize_t __pyx_v_i;
  Py_ssize_t __pyx_v_N;
  __pyx_t_5numpy_int32_t __pyx_v_val;
  int __pyx_v_lim;
  int __pyx_v_fill_count;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_mask;
  __Pyx_Buffer __pyx_pybuffer_mask;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_values;
  __Pyx_Buffer __pyx_pybuffer_values;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  Py_ssize_t __pyx_t_1;
  int __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  long __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;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("pad_inplace_int32", 0);
  __pyx_pybuffer_values.pybuffer.buf = NULL;
  __pyx_pybuffer_values.refcount = 0;
  __pyx_pybuffernd_values.data = NULL;
  __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values;
  __pyx_pybuffer_mask.pybuffer.buf = NULL;
  __pyx_pybuffer_mask.refcount = 0;
  __pyx_pybuffernd_mask.data = NULL;
  __pyx_pybuffernd_mask.rcbuffer = &__pyx_pybuffer_mask;
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1098; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0];
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_mask.rcbuffer->pybuffer, (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[2]; __pyx_lineno = 1098; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_mask.diminfo[0].strides = __pyx_pybuffernd_mask.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_mask.diminfo[0].shape = __pyx_pybuffernd_mask.rcbuffer->pybuffer.shape[0];

  /* "pandas/src/generated.pyx":1103
 *     cdef Py_ssize_t i, N
 *     cdef int32_t val
 *     cdef int lim, fill_count = 0             # <<<<<<<<<<<<<<
 * 
 *     N = len(values)
 */
  __pyx_v_fill_count = 0;

  /* "pandas/src/generated.pyx":1105
 *     cdef int lim, fill_count = 0
 * 
 *     N = len(values)             # <<<<<<<<<<<<<<
 * 
 *     # GH 2778
 */
  __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_values)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1105; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_N = __pyx_t_1;

  /* "pandas/src/generated.pyx":1108
 * 
 *     # GH 2778
 *     if N == 0:             # <<<<<<<<<<<<<<
 *         return
 * 
 */
  __pyx_t_2 = ((__pyx_v_N == 0) != 0);
  if (__pyx_t_2) {

    /* "pandas/src/generated.pyx":1109
 *     # GH 2778
 *     if N == 0:
 *         return             # <<<<<<<<<<<<<<
 * 
 *     if limit is None:
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_r = Py_None; __Pyx_INCREF(Py_None);
    goto __pyx_L0;
  }

  /* "pandas/src/generated.pyx":1111
 *         return
 * 
 *     if limit is None:             # <<<<<<<<<<<<<<
 *         lim = N
 *     else:
 */
  __pyx_t_2 = (__pyx_v_limit == Py_None);
  __pyx_t_3 = (__pyx_t_2 != 0);
  if (__pyx_t_3) {

    /* "pandas/src/generated.pyx":1112
 * 
 *     if limit is None:
 *         lim = N             # <<<<<<<<<<<<<<
 *     else:
 *         if limit < 0:
 */
    __pyx_v_lim = __pyx_v_N;
    goto __pyx_L4;
  }
  /*else*/ {

    /* "pandas/src/generated.pyx":1114
 *         lim = N
 *     else:
 *         if limit < 0:             # <<<<<<<<<<<<<<
 *             raise ValueError('Limit must be non-negative')
 *         lim = limit
 */
    __pyx_t_4 = PyObject_RichCompare(__pyx_v_limit, __pyx_int_0, Py_LT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1114; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1114; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (__pyx_t_3) {

      /* "pandas/src/generated.pyx":1115
 *     else:
 *         if limit < 0:
 *             raise ValueError('Limit must be non-negative')             # <<<<<<<<<<<<<<
 *         lim = limit
 * 
 */
      __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__77, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1115; __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[2]; __pyx_lineno = 1115; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }

    /* "pandas/src/generated.pyx":1116
 *         if limit < 0:
 *             raise ValueError('Limit must be non-negative')
 *         lim = limit             # <<<<<<<<<<<<<<
 * 
 *     val = values[0]
 */
    __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_v_limit); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1116; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_v_lim = __pyx_t_5;
  }
  __pyx_L4:;

  /* "pandas/src/generated.pyx":1118
 *         lim = limit
 * 
 *     val = values[0]             # <<<<<<<<<<<<<<
 *     for i in range(N):
 *         if mask[i]:
 */
  __pyx_t_6 = 0;
  __pyx_v_val = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_values.diminfo[0].strides));

  /* "pandas/src/generated.pyx":1119
 * 
 *     val = values[0]
 *     for i in range(N):             # <<<<<<<<<<<<<<
 *         if mask[i]:
 *             if fill_count >= lim:
 */
  __pyx_t_1 = __pyx_v_N;
  for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_1; __pyx_t_7+=1) {
    __pyx_v_i = __pyx_t_7;

    /* "pandas/src/generated.pyx":1120
 *     val = values[0]
 *     for i in range(N):
 *         if mask[i]:             # <<<<<<<<<<<<<<
 *             if fill_count >= lim:
 *                 continue
 */
    __pyx_t_8 = __pyx_v_i;
    __pyx_t_3 = ((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_uint8_t *, __pyx_pybuffernd_mask.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_mask.diminfo[0].strides)) != 0);
    if (__pyx_t_3) {

      /* "pandas/src/generated.pyx":1121
 *     for i in range(N):
 *         if mask[i]:
 *             if fill_count >= lim:             # <<<<<<<<<<<<<<
 *                 continue
 *             fill_count += 1
 */
      __pyx_t_3 = ((__pyx_v_fill_count >= __pyx_v_lim) != 0);
      if (__pyx_t_3) {

        /* "pandas/src/generated.pyx":1122
 *         if mask[i]:
 *             if fill_count >= lim:
 *                 continue             # <<<<<<<<<<<<<<
 *             fill_count += 1
 *             values[i] = val
 */
        goto __pyx_L6_continue;
      }

      /* "pandas/src/generated.pyx":1123
 *             if fill_count >= lim:
 *                 continue
 *             fill_count += 1             # <<<<<<<<<<<<<<
 *             values[i] = val
 *         else:
 */
      __pyx_v_fill_count = (__pyx_v_fill_count + 1);

      /* "pandas/src/generated.pyx":1124
 *                 continue
 *             fill_count += 1
 *             values[i] = val             # <<<<<<<<<<<<<<
 *         else:
 *             fill_count = 0
 */
      __pyx_t_9 = __pyx_v_i;
      *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_9, __pyx_pybuffernd_values.diminfo[0].strides) = __pyx_v_val;
      goto __pyx_L8;
    }
    /*else*/ {

      /* "pandas/src/generated.pyx":1126
 *             values[i] = val
 *         else:
 *             fill_count = 0             # <<<<<<<<<<<<<<
 *             val = values[i]
 * 
 */
      __pyx_v_fill_count = 0;

      /* "pandas/src/generated.pyx":1127
 *         else:
 *             fill_count = 0
 *             val = values[i]             # <<<<<<<<<<<<<<
 * 
 * @cython.boundscheck(False)
 */
      __pyx_t_10 = __pyx_v_i;
      __pyx_v_val = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_10, __pyx_pybuffernd_values.diminfo[0].strides));
    }
    __pyx_L8:;
    __pyx_L6_continue:;
  }

  /* "pandas/src/generated.pyx":1098
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def pad_inplace_int32(ndarray[int32_t] values,             # <<<<<<<<<<<<<<
 *                          ndarray[uint8_t, cast=True] mask,
 *                          limit=None):
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
    __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_mask.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas.algos.pad_inplace_int32", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_mask.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer);
  __pyx_L2:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/src/generated.pyx":1131
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def pad_inplace_int64(ndarray[int64_t] values,             # <<<<<<<<<<<<<<
 *                          ndarray[uint8_t, cast=True] mask,
 *                          limit=None):
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pandas_5algos_147pad_inplace_int64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_5algos_147pad_inplace_int64 = {__Pyx_NAMESTR("pad_inplace_int64"), (PyCFunction)__pyx_pw_6pandas_5algos_147pad_inplace_int64, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pw_6pandas_5algos_147pad_inplace_int64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyArrayObject *__pyx_v_values = 0;
  PyArrayObject *__pyx_v_mask = 0;
  PyObject *__pyx_v_limit = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("pad_inplace_int64 (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_values,&__pyx_n_s_mask,&__pyx_n_s_limit,0};
    PyObject* values[3] = {0,0,0};

    /* "pandas/src/generated.pyx":1133
 * def pad_inplace_int64(ndarray[int64_t] values,
 *                          ndarray[uint8_t, cast=True] mask,
 *                          limit=None):             # <<<<<<<<<<<<<<
 *     cdef Py_ssize_t i, N
 *     cdef int64_t val
 */
    values[2] = ((PyObject *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_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 (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_mask)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("pad_inplace_int64", 0, 2, 3, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1131; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_limit);
          if (value) { values[2] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "pad_inplace_int64") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1131; __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_mask = ((PyArrayObject *)values[1]);
    __pyx_v_limit = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("pad_inplace_int64", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1131; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas.algos.pad_inplace_int64", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1131; __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[2]; __pyx_lineno = 1132; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_146pad_inplace_int64(__pyx_self, __pyx_v_values, __pyx_v_mask, __pyx_v_limit);

  /* "pandas/src/generated.pyx":1131
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def pad_inplace_int64(ndarray[int64_t] values,             # <<<<<<<<<<<<<<
 *                          ndarray[uint8_t, cast=True] mask,
 *                          limit=None):
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pandas_5algos_146pad_inplace_int64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_mask, PyObject *__pyx_v_limit) {
  Py_ssize_t __pyx_v_i;
  Py_ssize_t __pyx_v_N;
  __pyx_t_5numpy_int64_t __pyx_v_val;
  int __pyx_v_lim;
  int __pyx_v_fill_count;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_mask;
  __Pyx_Buffer __pyx_pybuffer_mask;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_values;
  __Pyx_Buffer __pyx_pybuffer_values;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  Py_ssize_t __pyx_t_1;
  int __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  long __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;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("pad_inplace_int64", 0);
  __pyx_pybuffer_values.pybuffer.buf = NULL;
  __pyx_pybuffer_values.refcount = 0;
  __pyx_pybuffernd_values.data = NULL;
  __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values;
  __pyx_pybuffer_mask.pybuffer.buf = NULL;
  __pyx_pybuffer_mask.refcount = 0;
  __pyx_pybuffernd_mask.data = NULL;
  __pyx_pybuffernd_mask.rcbuffer = &__pyx_pybuffer_mask;
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1131; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0];
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_mask.rcbuffer->pybuffer, (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[2]; __pyx_lineno = 1131; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_mask.diminfo[0].strides = __pyx_pybuffernd_mask.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_mask.diminfo[0].shape = __pyx_pybuffernd_mask.rcbuffer->pybuffer.shape[0];

  /* "pandas/src/generated.pyx":1136
 *     cdef Py_ssize_t i, N
 *     cdef int64_t val
 *     cdef int lim, fill_count = 0             # <<<<<<<<<<<<<<
 * 
 *     N = len(values)
 */
  __pyx_v_fill_count = 0;

  /* "pandas/src/generated.pyx":1138
 *     cdef int lim, fill_count = 0
 * 
 *     N = len(values)             # <<<<<<<<<<<<<<
 * 
 *     # GH 2778
 */
  __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_values)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1138; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_N = __pyx_t_1;

  /* "pandas/src/generated.pyx":1141
 * 
 *     # GH 2778
 *     if N == 0:             # <<<<<<<<<<<<<<
 *         return
 * 
 */
  __pyx_t_2 = ((__pyx_v_N == 0) != 0);
  if (__pyx_t_2) {

    /* "pandas/src/generated.pyx":1142
 *     # GH 2778
 *     if N == 0:
 *         return             # <<<<<<<<<<<<<<
 * 
 *     if limit is None:
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_r = Py_None; __Pyx_INCREF(Py_None);
    goto __pyx_L0;
  }

  /* "pandas/src/generated.pyx":1144
 *         return
 * 
 *     if limit is None:             # <<<<<<<<<<<<<<
 *         lim = N
 *     else:
 */
  __pyx_t_2 = (__pyx_v_limit == Py_None);
  __pyx_t_3 = (__pyx_t_2 != 0);
  if (__pyx_t_3) {

    /* "pandas/src/generated.pyx":1145
 * 
 *     if limit is None:
 *         lim = N             # <<<<<<<<<<<<<<
 *     else:
 *         if limit < 0:
 */
    __pyx_v_lim = __pyx_v_N;
    goto __pyx_L4;
  }
  /*else*/ {

    /* "pandas/src/generated.pyx":1147
 *         lim = N
 *     else:
 *         if limit < 0:             # <<<<<<<<<<<<<<
 *             raise ValueError('Limit must be non-negative')
 *         lim = limit
 */
    __pyx_t_4 = PyObject_RichCompare(__pyx_v_limit, __pyx_int_0, Py_LT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1147; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1147; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (__pyx_t_3) {

      /* "pandas/src/generated.pyx":1148
 *     else:
 *         if limit < 0:
 *             raise ValueError('Limit must be non-negative')             # <<<<<<<<<<<<<<
 *         lim = limit
 * 
 */
      __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__78, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1148; __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[2]; __pyx_lineno = 1148; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }

    /* "pandas/src/generated.pyx":1149
 *         if limit < 0:
 *             raise ValueError('Limit must be non-negative')
 *         lim = limit             # <<<<<<<<<<<<<<
 * 
 *     val = values[0]
 */
    __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_v_limit); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1149; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_v_lim = __pyx_t_5;
  }
  __pyx_L4:;

  /* "pandas/src/generated.pyx":1151
 *         lim = limit
 * 
 *     val = values[0]             # <<<<<<<<<<<<<<
 *     for i in range(N):
 *         if mask[i]:
 */
  __pyx_t_6 = 0;
  __pyx_v_val = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_values.diminfo[0].strides));

  /* "pandas/src/generated.pyx":1152
 * 
 *     val = values[0]
 *     for i in range(N):             # <<<<<<<<<<<<<<
 *         if mask[i]:
 *             if fill_count >= lim:
 */
  __pyx_t_1 = __pyx_v_N;
  for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_1; __pyx_t_7+=1) {
    __pyx_v_i = __pyx_t_7;

    /* "pandas/src/generated.pyx":1153
 *     val = values[0]
 *     for i in range(N):
 *         if mask[i]:             # <<<<<<<<<<<<<<
 *             if fill_count >= lim:
 *                 continue
 */
    __pyx_t_8 = __pyx_v_i;
    __pyx_t_3 = ((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_uint8_t *, __pyx_pybuffernd_mask.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_mask.diminfo[0].strides)) != 0);
    if (__pyx_t_3) {

      /* "pandas/src/generated.pyx":1154
 *     for i in range(N):
 *         if mask[i]:
 *             if fill_count >= lim:             # <<<<<<<<<<<<<<
 *                 continue
 *             fill_count += 1
 */
      __pyx_t_3 = ((__pyx_v_fill_count >= __pyx_v_lim) != 0);
      if (__pyx_t_3) {

        /* "pandas/src/generated.pyx":1155
 *         if mask[i]:
 *             if fill_count >= lim:
 *                 continue             # <<<<<<<<<<<<<<
 *             fill_count += 1
 *             values[i] = val
 */
        goto __pyx_L6_continue;
      }

      /* "pandas/src/generated.pyx":1156
 *             if fill_count >= lim:
 *                 continue
 *             fill_count += 1             # <<<<<<<<<<<<<<
 *             values[i] = val
 *         else:
 */
      __pyx_v_fill_count = (__pyx_v_fill_count + 1);

      /* "pandas/src/generated.pyx":1157
 *                 continue
 *             fill_count += 1
 *             values[i] = val             # <<<<<<<<<<<<<<
 *         else:
 *             fill_count = 0
 */
      __pyx_t_9 = __pyx_v_i;
      *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_9, __pyx_pybuffernd_values.diminfo[0].strides) = __pyx_v_val;
      goto __pyx_L8;
    }
    /*else*/ {

      /* "pandas/src/generated.pyx":1159
 *             values[i] = val
 *         else:
 *             fill_count = 0             # <<<<<<<<<<<<<<
 *             val = values[i]
 * 
 */
      __pyx_v_fill_count = 0;

      /* "pandas/src/generated.pyx":1160
 *         else:
 *             fill_count = 0
 *             val = values[i]             # <<<<<<<<<<<<<<
 * 
 * @cython.boundscheck(False)
 */
      __pyx_t_10 = __pyx_v_i;
      __pyx_v_val = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_10, __pyx_pybuffernd_values.diminfo[0].strides));
    }
    __pyx_L8:;
    __pyx_L6_continue:;
  }

  /* "pandas/src/generated.pyx":1131
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def pad_inplace_int64(ndarray[int64_t] values,             # <<<<<<<<<<<<<<
 *                          ndarray[uint8_t, cast=True] mask,
 *                          limit=None):
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
    __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_mask.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas.algos.pad_inplace_int64", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_mask.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer);
  __pyx_L2:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/src/generated.pyx":1164
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def pad_inplace_bool(ndarray[uint8_t] values,             # <<<<<<<<<<<<<<
 *                          ndarray[uint8_t, cast=True] mask,
 *                          limit=None):
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pandas_5algos_149pad_inplace_bool(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_5algos_149pad_inplace_bool = {__Pyx_NAMESTR("pad_inplace_bool"), (PyCFunction)__pyx_pw_6pandas_5algos_149pad_inplace_bool, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pw_6pandas_5algos_149pad_inplace_bool(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyArrayObject *__pyx_v_values = 0;
  PyArrayObject *__pyx_v_mask = 0;
  PyObject *__pyx_v_limit = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("pad_inplace_bool (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_values,&__pyx_n_s_mask,&__pyx_n_s_limit,0};
    PyObject* values[3] = {0,0,0};

    /* "pandas/src/generated.pyx":1166
 * def pad_inplace_bool(ndarray[uint8_t] values,
 *                          ndarray[uint8_t, cast=True] mask,
 *                          limit=None):             # <<<<<<<<<<<<<<
 *     cdef Py_ssize_t i, N
 *     cdef uint8_t val
 */
    values[2] = ((PyObject *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_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 (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_mask)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("pad_inplace_bool", 0, 2, 3, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1164; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_limit);
          if (value) { values[2] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "pad_inplace_bool") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1164; __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_mask = ((PyArrayObject *)values[1]);
    __pyx_v_limit = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("pad_inplace_bool", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1164; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas.algos.pad_inplace_bool", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1164; __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[2]; __pyx_lineno = 1165; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_148pad_inplace_bool(__pyx_self, __pyx_v_values, __pyx_v_mask, __pyx_v_limit);

  /* "pandas/src/generated.pyx":1164
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def pad_inplace_bool(ndarray[uint8_t] values,             # <<<<<<<<<<<<<<
 *                          ndarray[uint8_t, cast=True] mask,
 *                          limit=None):
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pandas_5algos_148pad_inplace_bool(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_mask, PyObject *__pyx_v_limit) {
  Py_ssize_t __pyx_v_i;
  Py_ssize_t __pyx_v_N;
  __pyx_t_5numpy_uint8_t __pyx_v_val;
  int __pyx_v_lim;
  int __pyx_v_fill_count;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_mask;
  __Pyx_Buffer __pyx_pybuffer_mask;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_values;
  __Pyx_Buffer __pyx_pybuffer_values;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  Py_ssize_t __pyx_t_1;
  int __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  long __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;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("pad_inplace_bool", 0);
  __pyx_pybuffer_values.pybuffer.buf = NULL;
  __pyx_pybuffer_values.refcount = 0;
  __pyx_pybuffernd_values.data = NULL;
  __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values;
  __pyx_pybuffer_mask.pybuffer.buf = NULL;
  __pyx_pybuffer_mask.refcount = 0;
  __pyx_pybuffernd_mask.data = NULL;
  __pyx_pybuffernd_mask.rcbuffer = &__pyx_pybuffer_mask;
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1164; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0];
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_mask.rcbuffer->pybuffer, (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[2]; __pyx_lineno = 1164; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_mask.diminfo[0].strides = __pyx_pybuffernd_mask.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_mask.diminfo[0].shape = __pyx_pybuffernd_mask.rcbuffer->pybuffer.shape[0];

  /* "pandas/src/generated.pyx":1169
 *     cdef Py_ssize_t i, N
 *     cdef uint8_t val
 *     cdef int lim, fill_count = 0             # <<<<<<<<<<<<<<
 * 
 *     N = len(values)
 */
  __pyx_v_fill_count = 0;

  /* "pandas/src/generated.pyx":1171
 *     cdef int lim, fill_count = 0
 * 
 *     N = len(values)             # <<<<<<<<<<<<<<
 * 
 *     # GH 2778
 */
  __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_values)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1171; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_N = __pyx_t_1;

  /* "pandas/src/generated.pyx":1174
 * 
 *     # GH 2778
 *     if N == 0:             # <<<<<<<<<<<<<<
 *         return
 * 
 */
  __pyx_t_2 = ((__pyx_v_N == 0) != 0);
  if (__pyx_t_2) {

    /* "pandas/src/generated.pyx":1175
 *     # GH 2778
 *     if N == 0:
 *         return             # <<<<<<<<<<<<<<
 * 
 *     if limit is None:
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_r = Py_None; __Pyx_INCREF(Py_None);
    goto __pyx_L0;
  }

  /* "pandas/src/generated.pyx":1177
 *         return
 * 
 *     if limit is None:             # <<<<<<<<<<<<<<
 *         lim = N
 *     else:
 */
  __pyx_t_2 = (__pyx_v_limit == Py_None);
  __pyx_t_3 = (__pyx_t_2 != 0);
  if (__pyx_t_3) {

    /* "pandas/src/generated.pyx":1178
 * 
 *     if limit is None:
 *         lim = N             # <<<<<<<<<<<<<<
 *     else:
 *         if limit < 0:
 */
    __pyx_v_lim = __pyx_v_N;
    goto __pyx_L4;
  }
  /*else*/ {

    /* "pandas/src/generated.pyx":1180
 *         lim = N
 *     else:
 *         if limit < 0:             # <<<<<<<<<<<<<<
 *             raise ValueError('Limit must be non-negative')
 *         lim = limit
 */
    __pyx_t_4 = PyObject_RichCompare(__pyx_v_limit, __pyx_int_0, Py_LT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1180; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1180; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (__pyx_t_3) {

      /* "pandas/src/generated.pyx":1181
 *     else:
 *         if limit < 0:
 *             raise ValueError('Limit must be non-negative')             # <<<<<<<<<<<<<<
 *         lim = limit
 * 
 */
      __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__79, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1181; __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[2]; __pyx_lineno = 1181; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }

    /* "pandas/src/generated.pyx":1182
 *         if limit < 0:
 *             raise ValueError('Limit must be non-negative')
 *         lim = limit             # <<<<<<<<<<<<<<
 * 
 *     val = values[0]
 */
    __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_v_limit); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1182; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_v_lim = __pyx_t_5;
  }
  __pyx_L4:;

  /* "pandas/src/generated.pyx":1184
 *         lim = limit
 * 
 *     val = values[0]             # <<<<<<<<<<<<<<
 *     for i in range(N):
 *         if mask[i]:
 */
  __pyx_t_6 = 0;
  __pyx_v_val = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_uint8_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_values.diminfo[0].strides));

  /* "pandas/src/generated.pyx":1185
 * 
 *     val = values[0]
 *     for i in range(N):             # <<<<<<<<<<<<<<
 *         if mask[i]:
 *             if fill_count >= lim:
 */
  __pyx_t_1 = __pyx_v_N;
  for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_1; __pyx_t_7+=1) {
    __pyx_v_i = __pyx_t_7;

    /* "pandas/src/generated.pyx":1186
 *     val = values[0]
 *     for i in range(N):
 *         if mask[i]:             # <<<<<<<<<<<<<<
 *             if fill_count >= lim:
 *                 continue
 */
    __pyx_t_8 = __pyx_v_i;
    __pyx_t_3 = ((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_uint8_t *, __pyx_pybuffernd_mask.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_mask.diminfo[0].strides)) != 0);
    if (__pyx_t_3) {

      /* "pandas/src/generated.pyx":1187
 *     for i in range(N):
 *         if mask[i]:
 *             if fill_count >= lim:             # <<<<<<<<<<<<<<
 *                 continue
 *             fill_count += 1
 */
      __pyx_t_3 = ((__pyx_v_fill_count >= __pyx_v_lim) != 0);
      if (__pyx_t_3) {

        /* "pandas/src/generated.pyx":1188
 *         if mask[i]:
 *             if fill_count >= lim:
 *                 continue             # <<<<<<<<<<<<<<
 *             fill_count += 1
 *             values[i] = val
 */
        goto __pyx_L6_continue;
      }

      /* "pandas/src/generated.pyx":1189
 *             if fill_count >= lim:
 *                 continue
 *             fill_count += 1             # <<<<<<<<<<<<<<
 *             values[i] = val
 *         else:
 */
      __pyx_v_fill_count = (__pyx_v_fill_count + 1);

      /* "pandas/src/generated.pyx":1190
 *                 continue
 *             fill_count += 1
 *             values[i] = val             # <<<<<<<<<<<<<<
 *         else:
 *             fill_count = 0
 */
      __pyx_t_9 = __pyx_v_i;
      *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_uint8_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_9, __pyx_pybuffernd_values.diminfo[0].strides) = __pyx_v_val;
      goto __pyx_L8;
    }
    /*else*/ {

      /* "pandas/src/generated.pyx":1192
 *             values[i] = val
 *         else:
 *             fill_count = 0             # <<<<<<<<<<<<<<
 *             val = values[i]
 * 
 */
      __pyx_v_fill_count = 0;

      /* "pandas/src/generated.pyx":1193
 *         else:
 *             fill_count = 0
 *             val = values[i]             # <<<<<<<<<<<<<<
 * 
 * 
 */
      __pyx_t_10 = __pyx_v_i;
      __pyx_v_val = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_uint8_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_10, __pyx_pybuffernd_values.diminfo[0].strides));
    }
    __pyx_L8:;
    __pyx_L6_continue:;
  }

  /* "pandas/src/generated.pyx":1164
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def pad_inplace_bool(ndarray[uint8_t] values,             # <<<<<<<<<<<<<<
 *                          ndarray[uint8_t, cast=True] mask,
 *                          limit=None):
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
    __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_mask.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas.algos.pad_inplace_bool", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_mask.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer);
  __pyx_L2:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/src/generated.pyx":1198
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def backfill_inplace_float64(ndarray[float64_t] values,             # <<<<<<<<<<<<<<
 *                               ndarray[uint8_t, cast=True] mask,
 *                               limit=None):
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pandas_5algos_151backfill_inplace_float64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_5algos_151backfill_inplace_float64 = {__Pyx_NAMESTR("backfill_inplace_float64"), (PyCFunction)__pyx_pw_6pandas_5algos_151backfill_inplace_float64, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pw_6pandas_5algos_151backfill_inplace_float64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyArrayObject *__pyx_v_values = 0;
  PyArrayObject *__pyx_v_mask = 0;
  PyObject *__pyx_v_limit = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("backfill_inplace_float64 (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_values,&__pyx_n_s_mask,&__pyx_n_s_limit,0};
    PyObject* values[3] = {0,0,0};

    /* "pandas/src/generated.pyx":1200
 * def backfill_inplace_float64(ndarray[float64_t] values,
 *                               ndarray[uint8_t, cast=True] mask,
 *                               limit=None):             # <<<<<<<<<<<<<<
 *     cdef Py_ssize_t i, N
 *     cdef float64_t val
 */
    values[2] = ((PyObject *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_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 (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_mask)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("backfill_inplace_float64", 0, 2, 3, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1198; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_limit);
          if (value) { values[2] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "backfill_inplace_float64") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1198; __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_mask = ((PyArrayObject *)values[1]);
    __pyx_v_limit = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("backfill_inplace_float64", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1198; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas.algos.backfill_inplace_float64", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1198; __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[2]; __pyx_lineno = 1199; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_150backfill_inplace_float64(__pyx_self, __pyx_v_values, __pyx_v_mask, __pyx_v_limit);

  /* "pandas/src/generated.pyx":1198
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def backfill_inplace_float64(ndarray[float64_t] values,             # <<<<<<<<<<<<<<
 *                               ndarray[uint8_t, cast=True] mask,
 *                               limit=None):
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pandas_5algos_150backfill_inplace_float64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_mask, PyObject *__pyx_v_limit) {
  Py_ssize_t __pyx_v_i;
  Py_ssize_t __pyx_v_N;
  __pyx_t_5numpy_float64_t __pyx_v_val;
  int __pyx_v_lim;
  int __pyx_v_fill_count;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_mask;
  __Pyx_Buffer __pyx_pybuffer_mask;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_values;
  __Pyx_Buffer __pyx_pybuffer_values;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  Py_ssize_t __pyx_t_1;
  int __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  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;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("backfill_inplace_float64", 0);
  __pyx_pybuffer_values.pybuffer.buf = NULL;
  __pyx_pybuffer_values.refcount = 0;
  __pyx_pybuffernd_values.data = NULL;
  __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values;
  __pyx_pybuffer_mask.pybuffer.buf = NULL;
  __pyx_pybuffer_mask.refcount = 0;
  __pyx_pybuffernd_mask.data = NULL;
  __pyx_pybuffernd_mask.rcbuffer = &__pyx_pybuffer_mask;
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1198; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0];
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_mask.rcbuffer->pybuffer, (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[2]; __pyx_lineno = 1198; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_mask.diminfo[0].strides = __pyx_pybuffernd_mask.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_mask.diminfo[0].shape = __pyx_pybuffernd_mask.rcbuffer->pybuffer.shape[0];

  /* "pandas/src/generated.pyx":1203
 *     cdef Py_ssize_t i, N
 *     cdef float64_t val
 *     cdef int lim, fill_count = 0             # <<<<<<<<<<<<<<
 * 
 *     N = len(values)
 */
  __pyx_v_fill_count = 0;

  /* "pandas/src/generated.pyx":1205
 *     cdef int lim, fill_count = 0
 * 
 *     N = len(values)             # <<<<<<<<<<<<<<
 * 
 *     # GH 2778
 */
  __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_values)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1205; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_N = __pyx_t_1;

  /* "pandas/src/generated.pyx":1208
 * 
 *     # GH 2778
 *     if N == 0:             # <<<<<<<<<<<<<<
 *         return
 * 
 */
  __pyx_t_2 = ((__pyx_v_N == 0) != 0);
  if (__pyx_t_2) {

    /* "pandas/src/generated.pyx":1209
 *     # GH 2778
 *     if N == 0:
 *         return             # <<<<<<<<<<<<<<
 * 
 *     if limit is None:
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_r = Py_None; __Pyx_INCREF(Py_None);
    goto __pyx_L0;
  }

  /* "pandas/src/generated.pyx":1211
 *         return
 * 
 *     if limit is None:             # <<<<<<<<<<<<<<
 *         lim = N
 *     else:
 */
  __pyx_t_2 = (__pyx_v_limit == Py_None);
  __pyx_t_3 = (__pyx_t_2 != 0);
  if (__pyx_t_3) {

    /* "pandas/src/generated.pyx":1212
 * 
 *     if limit is None:
 *         lim = N             # <<<<<<<<<<<<<<
 *     else:
 *         if limit < 0:
 */
    __pyx_v_lim = __pyx_v_N;
    goto __pyx_L4;
  }
  /*else*/ {

    /* "pandas/src/generated.pyx":1214
 *         lim = N
 *     else:
 *         if limit < 0:             # <<<<<<<<<<<<<<
 *             raise ValueError('Limit must be non-negative')
 *         lim = limit
 */
    __pyx_t_4 = PyObject_RichCompare(__pyx_v_limit, __pyx_int_0, Py_LT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1214; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1214; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (__pyx_t_3) {

      /* "pandas/src/generated.pyx":1215
 *     else:
 *         if limit < 0:
 *             raise ValueError('Limit must be non-negative')             # <<<<<<<<<<<<<<
 *         lim = limit
 * 
 */
      __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__80, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1215; __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[2]; __pyx_lineno = 1215; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }

    /* "pandas/src/generated.pyx":1216
 *         if limit < 0:
 *             raise ValueError('Limit must be non-negative')
 *         lim = limit             # <<<<<<<<<<<<<<
 * 
 *     val = values[N - 1]
 */
    __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_v_limit); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1216; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_v_lim = __pyx_t_5;
  }
  __pyx_L4:;

  /* "pandas/src/generated.pyx":1218
 *         lim = limit
 * 
 *     val = values[N - 1]             # <<<<<<<<<<<<<<
 *     for i in range(N - 1, -1 , -1):
 *         if mask[i]:
 */
  __pyx_t_1 = (__pyx_v_N - 1);
  __pyx_v_val = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_1, __pyx_pybuffernd_values.diminfo[0].strides));

  /* "pandas/src/generated.pyx":1219
 * 
 *     val = values[N - 1]
 *     for i in range(N - 1, -1 , -1):             # <<<<<<<<<<<<<<
 *         if mask[i]:
 *             if fill_count >= lim:
 */
  for (__pyx_t_6 = (__pyx_v_N - 1); __pyx_t_6 > -1; __pyx_t_6-=1) {
    __pyx_v_i = __pyx_t_6;

    /* "pandas/src/generated.pyx":1220
 *     val = values[N - 1]
 *     for i in range(N - 1, -1 , -1):
 *         if mask[i]:             # <<<<<<<<<<<<<<
 *             if fill_count >= lim:
 *                 continue
 */
    __pyx_t_7 = __pyx_v_i;
    __pyx_t_3 = ((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_uint8_t *, __pyx_pybuffernd_mask.rcbuffer->pybuffer.buf, __pyx_t_7, __pyx_pybuffernd_mask.diminfo[0].strides)) != 0);
    if (__pyx_t_3) {

      /* "pandas/src/generated.pyx":1221
 *     for i in range(N - 1, -1 , -1):
 *         if mask[i]:
 *             if fill_count >= lim:             # <<<<<<<<<<<<<<
 *                 continue
 *             fill_count += 1
 */
      __pyx_t_3 = ((__pyx_v_fill_count >= __pyx_v_lim) != 0);
      if (__pyx_t_3) {

        /* "pandas/src/generated.pyx":1222
 *         if mask[i]:
 *             if fill_count >= lim:
 *                 continue             # <<<<<<<<<<<<<<
 *             fill_count += 1
 *             values[i] = val
 */
        goto __pyx_L6_continue;
      }

      /* "pandas/src/generated.pyx":1223
 *             if fill_count >= lim:
 *                 continue
 *             fill_count += 1             # <<<<<<<<<<<<<<
 *             values[i] = val
 *         else:
 */
      __pyx_v_fill_count = (__pyx_v_fill_count + 1);

      /* "pandas/src/generated.pyx":1224
 *                 continue
 *             fill_count += 1
 *             values[i] = val             # <<<<<<<<<<<<<<
 *         else:
 *             fill_count = 0
 */
      __pyx_t_8 = __pyx_v_i;
      *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_values.diminfo[0].strides) = __pyx_v_val;
      goto __pyx_L8;
    }
    /*else*/ {

      /* "pandas/src/generated.pyx":1226
 *             values[i] = val
 *         else:
 *             fill_count = 0             # <<<<<<<<<<<<<<
 *             val = values[i]
 * @cython.boundscheck(False)
 */
      __pyx_v_fill_count = 0;

      /* "pandas/src/generated.pyx":1227
 *         else:
 *             fill_count = 0
 *             val = values[i]             # <<<<<<<<<<<<<<
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 */
      __pyx_t_9 = __pyx_v_i;
      __pyx_v_val = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_9, __pyx_pybuffernd_values.diminfo[0].strides));
    }
    __pyx_L8:;
    __pyx_L6_continue:;
  }

  /* "pandas/src/generated.pyx":1198
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def backfill_inplace_float64(ndarray[float64_t] values,             # <<<<<<<<<<<<<<
 *                               ndarray[uint8_t, cast=True] mask,
 *                               limit=None):
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
    __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_mask.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas.algos.backfill_inplace_float64", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_mask.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer);
  __pyx_L2:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/src/generated.pyx":1230
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def backfill_inplace_float32(ndarray[float32_t] values,             # <<<<<<<<<<<<<<
 *                               ndarray[uint8_t, cast=True] mask,
 *                               limit=None):
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pandas_5algos_153backfill_inplace_float32(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_5algos_153backfill_inplace_float32 = {__Pyx_NAMESTR("backfill_inplace_float32"), (PyCFunction)__pyx_pw_6pandas_5algos_153backfill_inplace_float32, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pw_6pandas_5algos_153backfill_inplace_float32(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyArrayObject *__pyx_v_values = 0;
  PyArrayObject *__pyx_v_mask = 0;
  PyObject *__pyx_v_limit = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("backfill_inplace_float32 (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_values,&__pyx_n_s_mask,&__pyx_n_s_limit,0};
    PyObject* values[3] = {0,0,0};

    /* "pandas/src/generated.pyx":1232
 * def backfill_inplace_float32(ndarray[float32_t] values,
 *                               ndarray[uint8_t, cast=True] mask,
 *                               limit=None):             # <<<<<<<<<<<<<<
 *     cdef Py_ssize_t i, N
 *     cdef float32_t val
 */
    values[2] = ((PyObject *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_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 (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_mask)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("backfill_inplace_float32", 0, 2, 3, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1230; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_limit);
          if (value) { values[2] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "backfill_inplace_float32") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1230; __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_mask = ((PyArrayObject *)values[1]);
    __pyx_v_limit = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("backfill_inplace_float32", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1230; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas.algos.backfill_inplace_float32", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1230; __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[2]; __pyx_lineno = 1231; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_152backfill_inplace_float32(__pyx_self, __pyx_v_values, __pyx_v_mask, __pyx_v_limit);

  /* "pandas/src/generated.pyx":1230
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def backfill_inplace_float32(ndarray[float32_t] values,             # <<<<<<<<<<<<<<
 *                               ndarray[uint8_t, cast=True] mask,
 *                               limit=None):
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pandas_5algos_152backfill_inplace_float32(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_mask, PyObject *__pyx_v_limit) {
  Py_ssize_t __pyx_v_i;
  Py_ssize_t __pyx_v_N;
  __pyx_t_5numpy_float32_t __pyx_v_val;
  int __pyx_v_lim;
  int __pyx_v_fill_count;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_mask;
  __Pyx_Buffer __pyx_pybuffer_mask;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_values;
  __Pyx_Buffer __pyx_pybuffer_values;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  Py_ssize_t __pyx_t_1;
  int __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  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;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("backfill_inplace_float32", 0);
  __pyx_pybuffer_values.pybuffer.buf = NULL;
  __pyx_pybuffer_values.refcount = 0;
  __pyx_pybuffernd_values.data = NULL;
  __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values;
  __pyx_pybuffer_mask.pybuffer.buf = NULL;
  __pyx_pybuffer_mask.refcount = 0;
  __pyx_pybuffernd_mask.data = NULL;
  __pyx_pybuffernd_mask.rcbuffer = &__pyx_pybuffer_mask;
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1230; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0];
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_mask.rcbuffer->pybuffer, (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[2]; __pyx_lineno = 1230; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_mask.diminfo[0].strides = __pyx_pybuffernd_mask.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_mask.diminfo[0].shape = __pyx_pybuffernd_mask.rcbuffer->pybuffer.shape[0];

  /* "pandas/src/generated.pyx":1235
 *     cdef Py_ssize_t i, N
 *     cdef float32_t val
 *     cdef int lim, fill_count = 0             # <<<<<<<<<<<<<<
 * 
 *     N = len(values)
 */
  __pyx_v_fill_count = 0;

  /* "pandas/src/generated.pyx":1237
 *     cdef int lim, fill_count = 0
 * 
 *     N = len(values)             # <<<<<<<<<<<<<<
 * 
 *     # GH 2778
 */
  __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_values)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1237; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_N = __pyx_t_1;

  /* "pandas/src/generated.pyx":1240
 * 
 *     # GH 2778
 *     if N == 0:             # <<<<<<<<<<<<<<
 *         return
 * 
 */
  __pyx_t_2 = ((__pyx_v_N == 0) != 0);
  if (__pyx_t_2) {

    /* "pandas/src/generated.pyx":1241
 *     # GH 2778
 *     if N == 0:
 *         return             # <<<<<<<<<<<<<<
 * 
 *     if limit is None:
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_r = Py_None; __Pyx_INCREF(Py_None);
    goto __pyx_L0;
  }

  /* "pandas/src/generated.pyx":1243
 *         return
 * 
 *     if limit is None:             # <<<<<<<<<<<<<<
 *         lim = N
 *     else:
 */
  __pyx_t_2 = (__pyx_v_limit == Py_None);
  __pyx_t_3 = (__pyx_t_2 != 0);
  if (__pyx_t_3) {

    /* "pandas/src/generated.pyx":1244
 * 
 *     if limit is None:
 *         lim = N             # <<<<<<<<<<<<<<
 *     else:
 *         if limit < 0:
 */
    __pyx_v_lim = __pyx_v_N;
    goto __pyx_L4;
  }
  /*else*/ {

    /* "pandas/src/generated.pyx":1246
 *         lim = N
 *     else:
 *         if limit < 0:             # <<<<<<<<<<<<<<
 *             raise ValueError('Limit must be non-negative')
 *         lim = limit
 */
    __pyx_t_4 = PyObject_RichCompare(__pyx_v_limit, __pyx_int_0, Py_LT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1246; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1246; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (__pyx_t_3) {

      /* "pandas/src/generated.pyx":1247
 *     else:
 *         if limit < 0:
 *             raise ValueError('Limit must be non-negative')             # <<<<<<<<<<<<<<
 *         lim = limit
 * 
 */
      __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__81, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1247; __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[2]; __pyx_lineno = 1247; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }

    /* "pandas/src/generated.pyx":1248
 *         if limit < 0:
 *             raise ValueError('Limit must be non-negative')
 *         lim = limit             # <<<<<<<<<<<<<<
 * 
 *     val = values[N - 1]
 */
    __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_v_limit); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1248; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_v_lim = __pyx_t_5;
  }
  __pyx_L4:;

  /* "pandas/src/generated.pyx":1250
 *         lim = limit
 * 
 *     val = values[N - 1]             # <<<<<<<<<<<<<<
 *     for i in range(N - 1, -1 , -1):
 *         if mask[i]:
 */
  __pyx_t_1 = (__pyx_v_N - 1);
  __pyx_v_val = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_1, __pyx_pybuffernd_values.diminfo[0].strides));

  /* "pandas/src/generated.pyx":1251
 * 
 *     val = values[N - 1]
 *     for i in range(N - 1, -1 , -1):             # <<<<<<<<<<<<<<
 *         if mask[i]:
 *             if fill_count >= lim:
 */
  for (__pyx_t_6 = (__pyx_v_N - 1); __pyx_t_6 > -1; __pyx_t_6-=1) {
    __pyx_v_i = __pyx_t_6;

    /* "pandas/src/generated.pyx":1252
 *     val = values[N - 1]
 *     for i in range(N - 1, -1 , -1):
 *         if mask[i]:             # <<<<<<<<<<<<<<
 *             if fill_count >= lim:
 *                 continue
 */
    __pyx_t_7 = __pyx_v_i;
    __pyx_t_3 = ((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_uint8_t *, __pyx_pybuffernd_mask.rcbuffer->pybuffer.buf, __pyx_t_7, __pyx_pybuffernd_mask.diminfo[0].strides)) != 0);
    if (__pyx_t_3) {

      /* "pandas/src/generated.pyx":1253
 *     for i in range(N - 1, -1 , -1):
 *         if mask[i]:
 *             if fill_count >= lim:             # <<<<<<<<<<<<<<
 *                 continue
 *             fill_count += 1
 */
      __pyx_t_3 = ((__pyx_v_fill_count >= __pyx_v_lim) != 0);
      if (__pyx_t_3) {

        /* "pandas/src/generated.pyx":1254
 *         if mask[i]:
 *             if fill_count >= lim:
 *                 continue             # <<<<<<<<<<<<<<
 *             fill_count += 1
 *             values[i] = val
 */
        goto __pyx_L6_continue;
      }

      /* "pandas/src/generated.pyx":1255
 *             if fill_count >= lim:
 *                 continue
 *             fill_count += 1             # <<<<<<<<<<<<<<
 *             values[i] = val
 *         else:
 */
      __pyx_v_fill_count = (__pyx_v_fill_count + 1);

      /* "pandas/src/generated.pyx":1256
 *                 continue
 *             fill_count += 1
 *             values[i] = val             # <<<<<<<<<<<<<<
 *         else:
 *             fill_count = 0
 */
      __pyx_t_8 = __pyx_v_i;
      *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_values.diminfo[0].strides) = __pyx_v_val;
      goto __pyx_L8;
    }
    /*else*/ {

      /* "pandas/src/generated.pyx":1258
 *             values[i] = val
 *         else:
 *             fill_count = 0             # <<<<<<<<<<<<<<
 *             val = values[i]
 * @cython.boundscheck(False)
 */
      __pyx_v_fill_count = 0;

      /* "pandas/src/generated.pyx":1259
 *         else:
 *             fill_count = 0
 *             val = values[i]             # <<<<<<<<<<<<<<
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 */
      __pyx_t_9 = __pyx_v_i;
      __pyx_v_val = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_9, __pyx_pybuffernd_values.diminfo[0].strides));
    }
    __pyx_L8:;
    __pyx_L6_continue:;
  }

  /* "pandas/src/generated.pyx":1230
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def backfill_inplace_float32(ndarray[float32_t] values,             # <<<<<<<<<<<<<<
 *                               ndarray[uint8_t, cast=True] mask,
 *                               limit=None):
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
    __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_mask.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas.algos.backfill_inplace_float32", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_mask.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer);
  __pyx_L2:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/src/generated.pyx":1262
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def backfill_inplace_object(ndarray[object] values,             # <<<<<<<<<<<<<<
 *                               ndarray[uint8_t, cast=True] mask,
 *                               limit=None):
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pandas_5algos_155backfill_inplace_object(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_5algos_155backfill_inplace_object = {__Pyx_NAMESTR("backfill_inplace_object"), (PyCFunction)__pyx_pw_6pandas_5algos_155backfill_inplace_object, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pw_6pandas_5algos_155backfill_inplace_object(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyArrayObject *__pyx_v_values = 0;
  PyArrayObject *__pyx_v_mask = 0;
  PyObject *__pyx_v_limit = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("backfill_inplace_object (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_values,&__pyx_n_s_mask,&__pyx_n_s_limit,0};
    PyObject* values[3] = {0,0,0};

    /* "pandas/src/generated.pyx":1264
 * def backfill_inplace_object(ndarray[object] values,
 *                               ndarray[uint8_t, cast=True] mask,
 *                               limit=None):             # <<<<<<<<<<<<<<
 *     cdef Py_ssize_t i, N
 *     cdef object val
 */
    values[2] = ((PyObject *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_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 (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_mask)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("backfill_inplace_object", 0, 2, 3, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1262; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_limit);
          if (value) { values[2] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "backfill_inplace_object") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1262; __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_mask = ((PyArrayObject *)values[1]);
    __pyx_v_limit = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("backfill_inplace_object", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1262; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas.algos.backfill_inplace_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1262; __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[2]; __pyx_lineno = 1263; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_154backfill_inplace_object(__pyx_self, __pyx_v_values, __pyx_v_mask, __pyx_v_limit);

  /* "pandas/src/generated.pyx":1262
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def backfill_inplace_object(ndarray[object] values,             # <<<<<<<<<<<<<<
 *                               ndarray[uint8_t, cast=True] mask,
 *                               limit=None):
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pandas_5algos_154backfill_inplace_object(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_mask, PyObject *__pyx_v_limit) {
  Py_ssize_t __pyx_v_i;
  Py_ssize_t __pyx_v_N;
  PyObject *__pyx_v_val = 0;
  int __pyx_v_lim;
  int __pyx_v_fill_count;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_mask;
  __Pyx_Buffer __pyx_pybuffer_mask;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_values;
  __Pyx_Buffer __pyx_pybuffer_values;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  Py_ssize_t __pyx_t_1;
  int __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  Py_ssize_t __pyx_t_6;
  Py_ssize_t __pyx_t_7;
  Py_ssize_t __pyx_t_8;
  PyObject **__pyx_t_9;
  Py_ssize_t __pyx_t_10;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("backfill_inplace_object", 0);
  __pyx_pybuffer_values.pybuffer.buf = NULL;
  __pyx_pybuffer_values.refcount = 0;
  __pyx_pybuffernd_values.data = NULL;
  __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values;
  __pyx_pybuffer_mask.pybuffer.buf = NULL;
  __pyx_pybuffer_mask.refcount = 0;
  __pyx_pybuffernd_mask.data = NULL;
  __pyx_pybuffernd_mask.rcbuffer = &__pyx_pybuffer_mask;
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (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 = 1262; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0];
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_mask.rcbuffer->pybuffer, (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[2]; __pyx_lineno = 1262; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_mask.diminfo[0].strides = __pyx_pybuffernd_mask.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_mask.diminfo[0].shape = __pyx_pybuffernd_mask.rcbuffer->pybuffer.shape[0];

  /* "pandas/src/generated.pyx":1267
 *     cdef Py_ssize_t i, N
 *     cdef object val
 *     cdef int lim, fill_count = 0             # <<<<<<<<<<<<<<
 * 
 *     N = len(values)
 */
  __pyx_v_fill_count = 0;

  /* "pandas/src/generated.pyx":1269
 *     cdef int lim, fill_count = 0
 * 
 *     N = len(values)             # <<<<<<<<<<<<<<
 * 
 *     # GH 2778
 */
  __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_values)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1269; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_N = __pyx_t_1;

  /* "pandas/src/generated.pyx":1272
 * 
 *     # GH 2778
 *     if N == 0:             # <<<<<<<<<<<<<<
 *         return
 * 
 */
  __pyx_t_2 = ((__pyx_v_N == 0) != 0);
  if (__pyx_t_2) {

    /* "pandas/src/generated.pyx":1273
 *     # GH 2778
 *     if N == 0:
 *         return             # <<<<<<<<<<<<<<
 * 
 *     if limit is None:
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_r = Py_None; __Pyx_INCREF(Py_None);
    goto __pyx_L0;
  }

  /* "pandas/src/generated.pyx":1275
 *         return
 * 
 *     if limit is None:             # <<<<<<<<<<<<<<
 *         lim = N
 *     else:
 */
  __pyx_t_2 = (__pyx_v_limit == Py_None);
  __pyx_t_3 = (__pyx_t_2 != 0);
  if (__pyx_t_3) {

    /* "pandas/src/generated.pyx":1276
 * 
 *     if limit is None:
 *         lim = N             # <<<<<<<<<<<<<<
 *     else:
 *         if limit < 0:
 */
    __pyx_v_lim = __pyx_v_N;
    goto __pyx_L4;
  }
  /*else*/ {

    /* "pandas/src/generated.pyx":1278
 *         lim = N
 *     else:
 *         if limit < 0:             # <<<<<<<<<<<<<<
 *             raise ValueError('Limit must be non-negative')
 *         lim = limit
 */
    __pyx_t_4 = PyObject_RichCompare(__pyx_v_limit, __pyx_int_0, Py_LT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1278; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1278; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (__pyx_t_3) {

      /* "pandas/src/generated.pyx":1279
 *     else:
 *         if limit < 0:
 *             raise ValueError('Limit must be non-negative')             # <<<<<<<<<<<<<<
 *         lim = limit
 * 
 */
      __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__82, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1279; __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[2]; __pyx_lineno = 1279; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }

    /* "pandas/src/generated.pyx":1280
 *         if limit < 0:
 *             raise ValueError('Limit must be non-negative')
 *         lim = limit             # <<<<<<<<<<<<<<
 * 
 *     val = values[N - 1]
 */
    __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_v_limit); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1280; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_v_lim = __pyx_t_5;
  }
  __pyx_L4:;

  /* "pandas/src/generated.pyx":1282
 *         lim = limit
 * 
 *     val = values[N - 1]             # <<<<<<<<<<<<<<
 *     for i in range(N - 1, -1 , -1):
 *         if mask[i]:
 */
  __pyx_t_1 = (__pyx_v_N - 1);
  __pyx_t_4 = (PyObject *) *__Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_1, __pyx_pybuffernd_values.diminfo[0].strides);
  __Pyx_INCREF((PyObject*)__pyx_t_4);
  __pyx_v_val = __pyx_t_4;
  __pyx_t_4 = 0;

  /* "pandas/src/generated.pyx":1283
 * 
 *     val = values[N - 1]
 *     for i in range(N - 1, -1 , -1):             # <<<<<<<<<<<<<<
 *         if mask[i]:
 *             if fill_count >= lim:
 */
  for (__pyx_t_6 = (__pyx_v_N - 1); __pyx_t_6 > -1; __pyx_t_6-=1) {
    __pyx_v_i = __pyx_t_6;

    /* "pandas/src/generated.pyx":1284
 *     val = values[N - 1]
 *     for i in range(N - 1, -1 , -1):
 *         if mask[i]:             # <<<<<<<<<<<<<<
 *             if fill_count >= lim:
 *                 continue
 */
    __pyx_t_7 = __pyx_v_i;
    __pyx_t_3 = ((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_uint8_t *, __pyx_pybuffernd_mask.rcbuffer->pybuffer.buf, __pyx_t_7, __pyx_pybuffernd_mask.diminfo[0].strides)) != 0);
    if (__pyx_t_3) {

      /* "pandas/src/generated.pyx":1285
 *     for i in range(N - 1, -1 , -1):
 *         if mask[i]:
 *             if fill_count >= lim:             # <<<<<<<<<<<<<<
 *                 continue
 *             fill_count += 1
 */
      __pyx_t_3 = ((__pyx_v_fill_count >= __pyx_v_lim) != 0);
      if (__pyx_t_3) {

        /* "pandas/src/generated.pyx":1286
 *         if mask[i]:
 *             if fill_count >= lim:
 *                 continue             # <<<<<<<<<<<<<<
 *             fill_count += 1
 *             values[i] = val
 */
        goto __pyx_L6_continue;
      }

      /* "pandas/src/generated.pyx":1287
 *             if fill_count >= lim:
 *                 continue
 *             fill_count += 1             # <<<<<<<<<<<<<<
 *             values[i] = val
 *         else:
 */
      __pyx_v_fill_count = (__pyx_v_fill_count + 1);

      /* "pandas/src/generated.pyx":1288
 *                 continue
 *             fill_count += 1
 *             values[i] = val             # <<<<<<<<<<<<<<
 *         else:
 *             fill_count = 0
 */
      __pyx_t_8 = __pyx_v_i;
      __pyx_t_9 = __Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_values.diminfo[0].strides);
      __Pyx_GOTREF(*__pyx_t_9);
      __Pyx_INCREF(__pyx_v_val); __Pyx_DECREF(*__pyx_t_9);
      *__pyx_t_9 = __pyx_v_val;
      __Pyx_GIVEREF(*__pyx_t_9);
      goto __pyx_L8;
    }
    /*else*/ {

      /* "pandas/src/generated.pyx":1290
 *             values[i] = val
 *         else:
 *             fill_count = 0             # <<<<<<<<<<<<<<
 *             val = values[i]
 * @cython.boundscheck(False)
 */
      __pyx_v_fill_count = 0;

      /* "pandas/src/generated.pyx":1291
 *         else:
 *             fill_count = 0
 *             val = values[i]             # <<<<<<<<<<<<<<
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 */
      __pyx_t_10 = __pyx_v_i;
      __pyx_t_4 = (PyObject *) *__Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_10, __pyx_pybuffernd_values.diminfo[0].strides);
      __Pyx_INCREF((PyObject*)__pyx_t_4);
      __Pyx_DECREF_SET(__pyx_v_val, __pyx_t_4);
      __pyx_t_4 = 0;
    }
    __pyx_L8:;
    __pyx_L6_continue:;
  }

  /* "pandas/src/generated.pyx":1262
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def backfill_inplace_object(ndarray[object] values,             # <<<<<<<<<<<<<<
 *                               ndarray[uint8_t, cast=True] mask,
 *                               limit=None):
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
    __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_mask.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas.algos.backfill_inplace_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_mask.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer);
  __pyx_L2:;
  __Pyx_XDECREF(__pyx_v_val);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/src/generated.pyx":1294
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def backfill_inplace_int32(ndarray[int32_t] values,             # <<<<<<<<<<<<<<
 *                               ndarray[uint8_t, cast=True] mask,
 *                               limit=None):
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pandas_5algos_157backfill_inplace_int32(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_5algos_157backfill_inplace_int32 = {__Pyx_NAMESTR("backfill_inplace_int32"), (PyCFunction)__pyx_pw_6pandas_5algos_157backfill_inplace_int32, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pw_6pandas_5algos_157backfill_inplace_int32(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyArrayObject *__pyx_v_values = 0;
  PyArrayObject *__pyx_v_mask = 0;
  PyObject *__pyx_v_limit = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("backfill_inplace_int32 (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_values,&__pyx_n_s_mask,&__pyx_n_s_limit,0};
    PyObject* values[3] = {0,0,0};

    /* "pandas/src/generated.pyx":1296
 * def backfill_inplace_int32(ndarray[int32_t] values,
 *                               ndarray[uint8_t, cast=True] mask,
 *                               limit=None):             # <<<<<<<<<<<<<<
 *     cdef Py_ssize_t i, N
 *     cdef int32_t val
 */
    values[2] = ((PyObject *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_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 (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_mask)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("backfill_inplace_int32", 0, 2, 3, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1294; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_limit);
          if (value) { values[2] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "backfill_inplace_int32") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1294; __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_mask = ((PyArrayObject *)values[1]);
    __pyx_v_limit = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("backfill_inplace_int32", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1294; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas.algos.backfill_inplace_int32", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1294; __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[2]; __pyx_lineno = 1295; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_156backfill_inplace_int32(__pyx_self, __pyx_v_values, __pyx_v_mask, __pyx_v_limit);

  /* "pandas/src/generated.pyx":1294
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def backfill_inplace_int32(ndarray[int32_t] values,             # <<<<<<<<<<<<<<
 *                               ndarray[uint8_t, cast=True] mask,
 *                               limit=None):
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pandas_5algos_156backfill_inplace_int32(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_mask, PyObject *__pyx_v_limit) {
  Py_ssize_t __pyx_v_i;
  Py_ssize_t __pyx_v_N;
  __pyx_t_5numpy_int32_t __pyx_v_val;
  int __pyx_v_lim;
  int __pyx_v_fill_count;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_mask;
  __Pyx_Buffer __pyx_pybuffer_mask;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_values;
  __Pyx_Buffer __pyx_pybuffer_values;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  Py_ssize_t __pyx_t_1;
  int __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  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;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("backfill_inplace_int32", 0);
  __pyx_pybuffer_values.pybuffer.buf = NULL;
  __pyx_pybuffer_values.refcount = 0;
  __pyx_pybuffernd_values.data = NULL;
  __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values;
  __pyx_pybuffer_mask.pybuffer.buf = NULL;
  __pyx_pybuffer_mask.refcount = 0;
  __pyx_pybuffernd_mask.data = NULL;
  __pyx_pybuffernd_mask.rcbuffer = &__pyx_pybuffer_mask;
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1294; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0];
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_mask.rcbuffer->pybuffer, (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[2]; __pyx_lineno = 1294; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_mask.diminfo[0].strides = __pyx_pybuffernd_mask.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_mask.diminfo[0].shape = __pyx_pybuffernd_mask.rcbuffer->pybuffer.shape[0];

  /* "pandas/src/generated.pyx":1299
 *     cdef Py_ssize_t i, N
 *     cdef int32_t val
 *     cdef int lim, fill_count = 0             # <<<<<<<<<<<<<<
 * 
 *     N = len(values)
 */
  __pyx_v_fill_count = 0;

  /* "pandas/src/generated.pyx":1301
 *     cdef int lim, fill_count = 0
 * 
 *     N = len(values)             # <<<<<<<<<<<<<<
 * 
 *     # GH 2778
 */
  __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_values)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1301; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_N = __pyx_t_1;

  /* "pandas/src/generated.pyx":1304
 * 
 *     # GH 2778
 *     if N == 0:             # <<<<<<<<<<<<<<
 *         return
 * 
 */
  __pyx_t_2 = ((__pyx_v_N == 0) != 0);
  if (__pyx_t_2) {

    /* "pandas/src/generated.pyx":1305
 *     # GH 2778
 *     if N == 0:
 *         return             # <<<<<<<<<<<<<<
 * 
 *     if limit is None:
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_r = Py_None; __Pyx_INCREF(Py_None);
    goto __pyx_L0;
  }

  /* "pandas/src/generated.pyx":1307
 *         return
 * 
 *     if limit is None:             # <<<<<<<<<<<<<<
 *         lim = N
 *     else:
 */
  __pyx_t_2 = (__pyx_v_limit == Py_None);
  __pyx_t_3 = (__pyx_t_2 != 0);
  if (__pyx_t_3) {

    /* "pandas/src/generated.pyx":1308
 * 
 *     if limit is None:
 *         lim = N             # <<<<<<<<<<<<<<
 *     else:
 *         if limit < 0:
 */
    __pyx_v_lim = __pyx_v_N;
    goto __pyx_L4;
  }
  /*else*/ {

    /* "pandas/src/generated.pyx":1310
 *         lim = N
 *     else:
 *         if limit < 0:             # <<<<<<<<<<<<<<
 *             raise ValueError('Limit must be non-negative')
 *         lim = limit
 */
    __pyx_t_4 = PyObject_RichCompare(__pyx_v_limit, __pyx_int_0, Py_LT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1310; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1310; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (__pyx_t_3) {

      /* "pandas/src/generated.pyx":1311
 *     else:
 *         if limit < 0:
 *             raise ValueError('Limit must be non-negative')             # <<<<<<<<<<<<<<
 *         lim = limit
 * 
 */
      __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__83, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1311; __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[2]; __pyx_lineno = 1311; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }

    /* "pandas/src/generated.pyx":1312
 *         if limit < 0:
 *             raise ValueError('Limit must be non-negative')
 *         lim = limit             # <<<<<<<<<<<<<<
 * 
 *     val = values[N - 1]
 */
    __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_v_limit); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1312; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_v_lim = __pyx_t_5;
  }
  __pyx_L4:;

  /* "pandas/src/generated.pyx":1314
 *         lim = limit
 * 
 *     val = values[N - 1]             # <<<<<<<<<<<<<<
 *     for i in range(N - 1, -1 , -1):
 *         if mask[i]:
 */
  __pyx_t_1 = (__pyx_v_N - 1);
  __pyx_v_val = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_1, __pyx_pybuffernd_values.diminfo[0].strides));

  /* "pandas/src/generated.pyx":1315
 * 
 *     val = values[N - 1]
 *     for i in range(N - 1, -1 , -1):             # <<<<<<<<<<<<<<
 *         if mask[i]:
 *             if fill_count >= lim:
 */
  for (__pyx_t_6 = (__pyx_v_N - 1); __pyx_t_6 > -1; __pyx_t_6-=1) {
    __pyx_v_i = __pyx_t_6;

    /* "pandas/src/generated.pyx":1316
 *     val = values[N - 1]
 *     for i in range(N - 1, -1 , -1):
 *         if mask[i]:             # <<<<<<<<<<<<<<
 *             if fill_count >= lim:
 *                 continue
 */
    __pyx_t_7 = __pyx_v_i;
    __pyx_t_3 = ((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_uint8_t *, __pyx_pybuffernd_mask.rcbuffer->pybuffer.buf, __pyx_t_7, __pyx_pybuffernd_mask.diminfo[0].strides)) != 0);
    if (__pyx_t_3) {

      /* "pandas/src/generated.pyx":1317
 *     for i in range(N - 1, -1 , -1):
 *         if mask[i]:
 *             if fill_count >= lim:             # <<<<<<<<<<<<<<
 *                 continue
 *             fill_count += 1
 */
      __pyx_t_3 = ((__pyx_v_fill_count >= __pyx_v_lim) != 0);
      if (__pyx_t_3) {

        /* "pandas/src/generated.pyx":1318
 *         if mask[i]:
 *             if fill_count >= lim:
 *                 continue             # <<<<<<<<<<<<<<
 *             fill_count += 1
 *             values[i] = val
 */
        goto __pyx_L6_continue;
      }

      /* "pandas/src/generated.pyx":1319
 *             if fill_count >= lim:
 *                 continue
 *             fill_count += 1             # <<<<<<<<<<<<<<
 *             values[i] = val
 *         else:
 */
      __pyx_v_fill_count = (__pyx_v_fill_count + 1);

      /* "pandas/src/generated.pyx":1320
 *                 continue
 *             fill_count += 1
 *             values[i] = val             # <<<<<<<<<<<<<<
 *         else:
 *             fill_count = 0
 */
      __pyx_t_8 = __pyx_v_i;
      *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_values.diminfo[0].strides) = __pyx_v_val;
      goto __pyx_L8;
    }
    /*else*/ {

      /* "pandas/src/generated.pyx":1322
 *             values[i] = val
 *         else:
 *             fill_count = 0             # <<<<<<<<<<<<<<
 *             val = values[i]
 * @cython.boundscheck(False)
 */
      __pyx_v_fill_count = 0;

      /* "pandas/src/generated.pyx":1323
 *         else:
 *             fill_count = 0
 *             val = values[i]             # <<<<<<<<<<<<<<
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 */
      __pyx_t_9 = __pyx_v_i;
      __pyx_v_val = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_9, __pyx_pybuffernd_values.diminfo[0].strides));
    }
    __pyx_L8:;
    __pyx_L6_continue:;
  }

  /* "pandas/src/generated.pyx":1294
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def backfill_inplace_int32(ndarray[int32_t] values,             # <<<<<<<<<<<<<<
 *                               ndarray[uint8_t, cast=True] mask,
 *                               limit=None):
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
    __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_mask.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas.algos.backfill_inplace_int32", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_mask.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer);
  __pyx_L2:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/src/generated.pyx":1326
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def backfill_inplace_int64(ndarray[int64_t] values,             # <<<<<<<<<<<<<<
 *                               ndarray[uint8_t, cast=True] mask,
 *                               limit=None):
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pandas_5algos_159backfill_inplace_int64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_5algos_159backfill_inplace_int64 = {__Pyx_NAMESTR("backfill_inplace_int64"), (PyCFunction)__pyx_pw_6pandas_5algos_159backfill_inplace_int64, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pw_6pandas_5algos_159backfill_inplace_int64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyArrayObject *__pyx_v_values = 0;
  PyArrayObject *__pyx_v_mask = 0;
  PyObject *__pyx_v_limit = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("backfill_inplace_int64 (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_values,&__pyx_n_s_mask,&__pyx_n_s_limit,0};
    PyObject* values[3] = {0,0,0};

    /* "pandas/src/generated.pyx":1328
 * def backfill_inplace_int64(ndarray[int64_t] values,
 *                               ndarray[uint8_t, cast=True] mask,
 *                               limit=None):             # <<<<<<<<<<<<<<
 *     cdef Py_ssize_t i, N
 *     cdef int64_t val
 */
    values[2] = ((PyObject *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_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 (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_mask)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("backfill_inplace_int64", 0, 2, 3, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1326; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_limit);
          if (value) { values[2] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "backfill_inplace_int64") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1326; __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_mask = ((PyArrayObject *)values[1]);
    __pyx_v_limit = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("backfill_inplace_int64", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1326; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas.algos.backfill_inplace_int64", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1326; __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[2]; __pyx_lineno = 1327; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_158backfill_inplace_int64(__pyx_self, __pyx_v_values, __pyx_v_mask, __pyx_v_limit);

  /* "pandas/src/generated.pyx":1326
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def backfill_inplace_int64(ndarray[int64_t] values,             # <<<<<<<<<<<<<<
 *                               ndarray[uint8_t, cast=True] mask,
 *                               limit=None):
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pandas_5algos_158backfill_inplace_int64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_mask, PyObject *__pyx_v_limit) {
  Py_ssize_t __pyx_v_i;
  Py_ssize_t __pyx_v_N;
  __pyx_t_5numpy_int64_t __pyx_v_val;
  int __pyx_v_lim;
  int __pyx_v_fill_count;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_mask;
  __Pyx_Buffer __pyx_pybuffer_mask;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_values;
  __Pyx_Buffer __pyx_pybuffer_values;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  Py_ssize_t __pyx_t_1;
  int __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  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;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("backfill_inplace_int64", 0);
  __pyx_pybuffer_values.pybuffer.buf = NULL;
  __pyx_pybuffer_values.refcount = 0;
  __pyx_pybuffernd_values.data = NULL;
  __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values;
  __pyx_pybuffer_mask.pybuffer.buf = NULL;
  __pyx_pybuffer_mask.refcount = 0;
  __pyx_pybuffernd_mask.data = NULL;
  __pyx_pybuffernd_mask.rcbuffer = &__pyx_pybuffer_mask;
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1326; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0];
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_mask.rcbuffer->pybuffer, (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[2]; __pyx_lineno = 1326; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_mask.diminfo[0].strides = __pyx_pybuffernd_mask.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_mask.diminfo[0].shape = __pyx_pybuffernd_mask.rcbuffer->pybuffer.shape[0];

  /* "pandas/src/generated.pyx":1331
 *     cdef Py_ssize_t i, N
 *     cdef int64_t val
 *     cdef int lim, fill_count = 0             # <<<<<<<<<<<<<<
 * 
 *     N = len(values)
 */
  __pyx_v_fill_count = 0;

  /* "pandas/src/generated.pyx":1333
 *     cdef int lim, fill_count = 0
 * 
 *     N = len(values)             # <<<<<<<<<<<<<<
 * 
 *     # GH 2778
 */
  __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_values)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1333; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_N = __pyx_t_1;

  /* "pandas/src/generated.pyx":1336
 * 
 *     # GH 2778
 *     if N == 0:             # <<<<<<<<<<<<<<
 *         return
 * 
 */
  __pyx_t_2 = ((__pyx_v_N == 0) != 0);
  if (__pyx_t_2) {

    /* "pandas/src/generated.pyx":1337
 *     # GH 2778
 *     if N == 0:
 *         return             # <<<<<<<<<<<<<<
 * 
 *     if limit is None:
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_r = Py_None; __Pyx_INCREF(Py_None);
    goto __pyx_L0;
  }

  /* "pandas/src/generated.pyx":1339
 *         return
 * 
 *     if limit is None:             # <<<<<<<<<<<<<<
 *         lim = N
 *     else:
 */
  __pyx_t_2 = (__pyx_v_limit == Py_None);
  __pyx_t_3 = (__pyx_t_2 != 0);
  if (__pyx_t_3) {

    /* "pandas/src/generated.pyx":1340
 * 
 *     if limit is None:
 *         lim = N             # <<<<<<<<<<<<<<
 *     else:
 *         if limit < 0:
 */
    __pyx_v_lim = __pyx_v_N;
    goto __pyx_L4;
  }
  /*else*/ {

    /* "pandas/src/generated.pyx":1342
 *         lim = N
 *     else:
 *         if limit < 0:             # <<<<<<<<<<<<<<
 *             raise ValueError('Limit must be non-negative')
 *         lim = limit
 */
    __pyx_t_4 = PyObject_RichCompare(__pyx_v_limit, __pyx_int_0, Py_LT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1342; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1342; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (__pyx_t_3) {

      /* "pandas/src/generated.pyx":1343
 *     else:
 *         if limit < 0:
 *             raise ValueError('Limit must be non-negative')             # <<<<<<<<<<<<<<
 *         lim = limit
 * 
 */
      __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__84, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1343; __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[2]; __pyx_lineno = 1343; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }

    /* "pandas/src/generated.pyx":1344
 *         if limit < 0:
 *             raise ValueError('Limit must be non-negative')
 *         lim = limit             # <<<<<<<<<<<<<<
 * 
 *     val = values[N - 1]
 */
    __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_v_limit); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1344; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_v_lim = __pyx_t_5;
  }
  __pyx_L4:;

  /* "pandas/src/generated.pyx":1346
 *         lim = limit
 * 
 *     val = values[N - 1]             # <<<<<<<<<<<<<<
 *     for i in range(N - 1, -1 , -1):
 *         if mask[i]:
 */
  __pyx_t_1 = (__pyx_v_N - 1);
  __pyx_v_val = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_1, __pyx_pybuffernd_values.diminfo[0].strides));

  /* "pandas/src/generated.pyx":1347
 * 
 *     val = values[N - 1]
 *     for i in range(N - 1, -1 , -1):             # <<<<<<<<<<<<<<
 *         if mask[i]:
 *             if fill_count >= lim:
 */
  for (__pyx_t_6 = (__pyx_v_N - 1); __pyx_t_6 > -1; __pyx_t_6-=1) {
    __pyx_v_i = __pyx_t_6;

    /* "pandas/src/generated.pyx":1348
 *     val = values[N - 1]
 *     for i in range(N - 1, -1 , -1):
 *         if mask[i]:             # <<<<<<<<<<<<<<
 *             if fill_count >= lim:
 *                 continue
 */
    __pyx_t_7 = __pyx_v_i;
    __pyx_t_3 = ((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_uint8_t *, __pyx_pybuffernd_mask.rcbuffer->pybuffer.buf, __pyx_t_7, __pyx_pybuffernd_mask.diminfo[0].strides)) != 0);
    if (__pyx_t_3) {

      /* "pandas/src/generated.pyx":1349
 *     for i in range(N - 1, -1 , -1):
 *         if mask[i]:
 *             if fill_count >= lim:             # <<<<<<<<<<<<<<
 *                 continue
 *             fill_count += 1
 */
      __pyx_t_3 = ((__pyx_v_fill_count >= __pyx_v_lim) != 0);
      if (__pyx_t_3) {

        /* "pandas/src/generated.pyx":1350
 *         if mask[i]:
 *             if fill_count >= lim:
 *                 continue             # <<<<<<<<<<<<<<
 *             fill_count += 1
 *             values[i] = val
 */
        goto __pyx_L6_continue;
      }

      /* "pandas/src/generated.pyx":1351
 *             if fill_count >= lim:
 *                 continue
 *             fill_count += 1             # <<<<<<<<<<<<<<
 *             values[i] = val
 *         else:
 */
      __pyx_v_fill_count = (__pyx_v_fill_count + 1);

      /* "pandas/src/generated.pyx":1352
 *                 continue
 *             fill_count += 1
 *             values[i] = val             # <<<<<<<<<<<<<<
 *         else:
 *             fill_count = 0
 */
      __pyx_t_8 = __pyx_v_i;
      *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_values.diminfo[0].strides) = __pyx_v_val;
      goto __pyx_L8;
    }
    /*else*/ {

      /* "pandas/src/generated.pyx":1354
 *             values[i] = val
 *         else:
 *             fill_count = 0             # <<<<<<<<<<<<<<
 *             val = values[i]
 * @cython.boundscheck(False)
 */
      __pyx_v_fill_count = 0;

      /* "pandas/src/generated.pyx":1355
 *         else:
 *             fill_count = 0
 *             val = values[i]             # <<<<<<<<<<<<<<
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 */
      __pyx_t_9 = __pyx_v_i;
      __pyx_v_val = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_9, __pyx_pybuffernd_values.diminfo[0].strides));
    }
    __pyx_L8:;
    __pyx_L6_continue:;
  }

  /* "pandas/src/generated.pyx":1326
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def backfill_inplace_int64(ndarray[int64_t] values,             # <<<<<<<<<<<<<<
 *                               ndarray[uint8_t, cast=True] mask,
 *                               limit=None):
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
    __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_mask.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas.algos.backfill_inplace_int64", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_mask.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer);
  __pyx_L2:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/src/generated.pyx":1358
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def backfill_inplace_bool(ndarray[uint8_t] values,             # <<<<<<<<<<<<<<
 *                               ndarray[uint8_t, cast=True] mask,
 *                               limit=None):
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pandas_5algos_161backfill_inplace_bool(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_5algos_161backfill_inplace_bool = {__Pyx_NAMESTR("backfill_inplace_bool"), (PyCFunction)__pyx_pw_6pandas_5algos_161backfill_inplace_bool, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pw_6pandas_5algos_161backfill_inplace_bool(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyArrayObject *__pyx_v_values = 0;
  PyArrayObject *__pyx_v_mask = 0;
  PyObject *__pyx_v_limit = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("backfill_inplace_bool (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_values,&__pyx_n_s_mask,&__pyx_n_s_limit,0};
    PyObject* values[3] = {0,0,0};

    /* "pandas/src/generated.pyx":1360
 * def backfill_inplace_bool(ndarray[uint8_t] values,
 *                               ndarray[uint8_t, cast=True] mask,
 *                               limit=None):             # <<<<<<<<<<<<<<
 *     cdef Py_ssize_t i, N
 *     cdef uint8_t val
 */
    values[2] = ((PyObject *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_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 (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_mask)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("backfill_inplace_bool", 0, 2, 3, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1358; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_limit);
          if (value) { values[2] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "backfill_inplace_bool") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1358; __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_mask = ((PyArrayObject *)values[1]);
    __pyx_v_limit = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("backfill_inplace_bool", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1358; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas.algos.backfill_inplace_bool", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1358; __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[2]; __pyx_lineno = 1359; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_160backfill_inplace_bool(__pyx_self, __pyx_v_values, __pyx_v_mask, __pyx_v_limit);

  /* "pandas/src/generated.pyx":1358
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def backfill_inplace_bool(ndarray[uint8_t] values,             # <<<<<<<<<<<<<<
 *                               ndarray[uint8_t, cast=True] mask,
 *                               limit=None):
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pandas_5algos_160backfill_inplace_bool(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_mask, PyObject *__pyx_v_limit) {
  Py_ssize_t __pyx_v_i;
  Py_ssize_t __pyx_v_N;
  __pyx_t_5numpy_uint8_t __pyx_v_val;
  int __pyx_v_lim;
  int __pyx_v_fill_count;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_mask;
  __Pyx_Buffer __pyx_pybuffer_mask;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_values;
  __Pyx_Buffer __pyx_pybuffer_values;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  Py_ssize_t __pyx_t_1;
  int __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  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;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("backfill_inplace_bool", 0);
  __pyx_pybuffer_values.pybuffer.buf = NULL;
  __pyx_pybuffer_values.refcount = 0;
  __pyx_pybuffernd_values.data = NULL;
  __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values;
  __pyx_pybuffer_mask.pybuffer.buf = NULL;
  __pyx_pybuffer_mask.refcount = 0;
  __pyx_pybuffernd_mask.data = NULL;
  __pyx_pybuffernd_mask.rcbuffer = &__pyx_pybuffer_mask;
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1358; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0];
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_mask.rcbuffer->pybuffer, (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[2]; __pyx_lineno = 1358; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_mask.diminfo[0].strides = __pyx_pybuffernd_mask.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_mask.diminfo[0].shape = __pyx_pybuffernd_mask.rcbuffer->pybuffer.shape[0];

  /* "pandas/src/generated.pyx":1363
 *     cdef Py_ssize_t i, N
 *     cdef uint8_t val
 *     cdef int lim, fill_count = 0             # <<<<<<<<<<<<<<
 * 
 *     N = len(values)
 */
  __pyx_v_fill_count = 0;

  /* "pandas/src/generated.pyx":1365
 *     cdef int lim, fill_count = 0
 * 
 *     N = len(values)             # <<<<<<<<<<<<<<
 * 
 *     # GH 2778
 */
  __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_values)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1365; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_N = __pyx_t_1;

  /* "pandas/src/generated.pyx":1368
 * 
 *     # GH 2778
 *     if N == 0:             # <<<<<<<<<<<<<<
 *         return
 * 
 */
  __pyx_t_2 = ((__pyx_v_N == 0) != 0);
  if (__pyx_t_2) {

    /* "pandas/src/generated.pyx":1369
 *     # GH 2778
 *     if N == 0:
 *         return             # <<<<<<<<<<<<<<
 * 
 *     if limit is None:
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_r = Py_None; __Pyx_INCREF(Py_None);
    goto __pyx_L0;
  }

  /* "pandas/src/generated.pyx":1371
 *         return
 * 
 *     if limit is None:             # <<<<<<<<<<<<<<
 *         lim = N
 *     else:
 */
  __pyx_t_2 = (__pyx_v_limit == Py_None);
  __pyx_t_3 = (__pyx_t_2 != 0);
  if (__pyx_t_3) {

    /* "pandas/src/generated.pyx":1372
 * 
 *     if limit is None:
 *         lim = N             # <<<<<<<<<<<<<<
 *     else:
 *         if limit < 0:
 */
    __pyx_v_lim = __pyx_v_N;
    goto __pyx_L4;
  }
  /*else*/ {

    /* "pandas/src/generated.pyx":1374
 *         lim = N
 *     else:
 *         if limit < 0:             # <<<<<<<<<<<<<<
 *             raise ValueError('Limit must be non-negative')
 *         lim = limit
 */
    __pyx_t_4 = PyObject_RichCompare(__pyx_v_limit, __pyx_int_0, Py_LT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1374; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1374; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (__pyx_t_3) {

      /* "pandas/src/generated.pyx":1375
 *     else:
 *         if limit < 0:
 *             raise ValueError('Limit must be non-negative')             # <<<<<<<<<<<<<<
 *         lim = limit
 * 
 */
      __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__85, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1375; __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[2]; __pyx_lineno = 1375; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }

    /* "pandas/src/generated.pyx":1376
 *         if limit < 0:
 *             raise ValueError('Limit must be non-negative')
 *         lim = limit             # <<<<<<<<<<<<<<
 * 
 *     val = values[N - 1]
 */
    __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_v_limit); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1376; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_v_lim = __pyx_t_5;
  }
  __pyx_L4:;

  /* "pandas/src/generated.pyx":1378
 *         lim = limit
 * 
 *     val = values[N - 1]             # <<<<<<<<<<<<<<
 *     for i in range(N - 1, -1 , -1):
 *         if mask[i]:
 */
  __pyx_t_1 = (__pyx_v_N - 1);
  __pyx_v_val = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_uint8_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_1, __pyx_pybuffernd_values.diminfo[0].strides));

  /* "pandas/src/generated.pyx":1379
 * 
 *     val = values[N - 1]
 *     for i in range(N - 1, -1 , -1):             # <<<<<<<<<<<<<<
 *         if mask[i]:
 *             if fill_count >= lim:
 */
  for (__pyx_t_6 = (__pyx_v_N - 1); __pyx_t_6 > -1; __pyx_t_6-=1) {
    __pyx_v_i = __pyx_t_6;

    /* "pandas/src/generated.pyx":1380
 *     val = values[N - 1]
 *     for i in range(N - 1, -1 , -1):
 *         if mask[i]:             # <<<<<<<<<<<<<<
 *             if fill_count >= lim:
 *                 continue
 */
    __pyx_t_7 = __pyx_v_i;
    __pyx_t_3 = ((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_uint8_t *, __pyx_pybuffernd_mask.rcbuffer->pybuffer.buf, __pyx_t_7, __pyx_pybuffernd_mask.diminfo[0].strides)) != 0);
    if (__pyx_t_3) {

      /* "pandas/src/generated.pyx":1381
 *     for i in range(N - 1, -1 , -1):
 *         if mask[i]:
 *             if fill_count >= lim:             # <<<<<<<<<<<<<<
 *                 continue
 *             fill_count += 1
 */
      __pyx_t_3 = ((__pyx_v_fill_count >= __pyx_v_lim) != 0);
      if (__pyx_t_3) {

        /* "pandas/src/generated.pyx":1382
 *         if mask[i]:
 *             if fill_count >= lim:
 *                 continue             # <<<<<<<<<<<<<<
 *             fill_count += 1
 *             values[i] = val
 */
        goto __pyx_L6_continue;
      }

      /* "pandas/src/generated.pyx":1383
 *             if fill_count >= lim:
 *                 continue
 *             fill_count += 1             # <<<<<<<<<<<<<<
 *             values[i] = val
 *         else:
 */
      __pyx_v_fill_count = (__pyx_v_fill_count + 1);

      /* "pandas/src/generated.pyx":1384
 *                 continue
 *             fill_count += 1
 *             values[i] = val             # <<<<<<<<<<<<<<
 *         else:
 *             fill_count = 0
 */
      __pyx_t_8 = __pyx_v_i;
      *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_uint8_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_values.diminfo[0].strides) = __pyx_v_val;
      goto __pyx_L8;
    }
    /*else*/ {

      /* "pandas/src/generated.pyx":1386
 *             values[i] = val
 *         else:
 *             fill_count = 0             # <<<<<<<<<<<<<<
 *             val = values[i]
 * 
 */
      __pyx_v_fill_count = 0;

      /* "pandas/src/generated.pyx":1387
 *         else:
 *             fill_count = 0
 *             val = values[i]             # <<<<<<<<<<<<<<
 * 
 * @cython.boundscheck(False)
 */
      __pyx_t_9 = __pyx_v_i;
      __pyx_v_val = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_uint8_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_9, __pyx_pybuffernd_values.diminfo[0].strides));
    }
    __pyx_L8:;
    __pyx_L6_continue:;
  }

  /* "pandas/src/generated.pyx":1358
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def backfill_inplace_bool(ndarray[uint8_t] values,             # <<<<<<<<<<<<<<
 *                               ndarray[uint8_t, cast=True] mask,
 *                               limit=None):
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
    __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_mask.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas.algos.backfill_inplace_bool", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_mask.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer);
  __pyx_L2:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/src/generated.pyx":1391
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def pad_2d_inplace_float64(ndarray[float64_t, ndim=2] values,             # <<<<<<<<<<<<<<
 *                             ndarray[uint8_t, ndim=2] mask,
 *                             limit=None):
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pandas_5algos_163pad_2d_inplace_float64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_5algos_163pad_2d_inplace_float64 = {__Pyx_NAMESTR("pad_2d_inplace_float64"), (PyCFunction)__pyx_pw_6pandas_5algos_163pad_2d_inplace_float64, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pw_6pandas_5algos_163pad_2d_inplace_float64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyArrayObject *__pyx_v_values = 0;
  PyArrayObject *__pyx_v_mask = 0;
  PyObject *__pyx_v_limit = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("pad_2d_inplace_float64 (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_values,&__pyx_n_s_mask,&__pyx_n_s_limit,0};
    PyObject* values[3] = {0,0,0};

    /* "pandas/src/generated.pyx":1393
 * def pad_2d_inplace_float64(ndarray[float64_t, ndim=2] values,
 *                             ndarray[uint8_t, ndim=2] mask,
 *                             limit=None):             # <<<<<<<<<<<<<<
 *     cdef Py_ssize_t i, j, N, K
 *     cdef float64_t val
 */
    values[2] = ((PyObject *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_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 (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_mask)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("pad_2d_inplace_float64", 0, 2, 3, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1391; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_limit);
          if (value) { values[2] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "pad_2d_inplace_float64") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1391; __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_mask = ((PyArrayObject *)values[1]);
    __pyx_v_limit = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("pad_2d_inplace_float64", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1391; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas.algos.pad_2d_inplace_float64", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1391; __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[2]; __pyx_lineno = 1392; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_162pad_2d_inplace_float64(__pyx_self, __pyx_v_values, __pyx_v_mask, __pyx_v_limit);

  /* "pandas/src/generated.pyx":1391
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def pad_2d_inplace_float64(ndarray[float64_t, ndim=2] values,             # <<<<<<<<<<<<<<
 *                             ndarray[uint8_t, ndim=2] mask,
 *                             limit=None):
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pandas_5algos_162pad_2d_inplace_float64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_mask, PyObject *__pyx_v_limit) {
  Py_ssize_t __pyx_v_i;
  Py_ssize_t __pyx_v_j;
  Py_ssize_t __pyx_v_N;
  Py_ssize_t __pyx_v_K;
  __pyx_t_5numpy_float64_t __pyx_v_val;
  int __pyx_v_lim;
  int __pyx_v_fill_count;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_mask;
  __Pyx_Buffer __pyx_pybuffer_mask;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_values;
  __Pyx_Buffer __pyx_pybuffer_values;
  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;
  int __pyx_t_8;
  int __pyx_t_9;
  int __pyx_t_10;
  Py_ssize_t __pyx_t_11;
  long __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;
  Py_ssize_t __pyx_t_20;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("pad_2d_inplace_float64", 0);
  __pyx_pybuffer_values.pybuffer.buf = NULL;
  __pyx_pybuffer_values.refcount = 0;
  __pyx_pybuffernd_values.data = NULL;
  __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values;
  __pyx_pybuffer_mask.pybuffer.buf = NULL;
  __pyx_pybuffer_mask.refcount = 0;
  __pyx_pybuffernd_mask.data = NULL;
  __pyx_pybuffernd_mask.rcbuffer = &__pyx_pybuffer_mask;
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1391; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_values.diminfo[1].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_values.diminfo[1].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[1];
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_mask.rcbuffer->pybuffer, (PyObject*)__pyx_v_mask, &__Pyx_TypeInfo_nn___pyx_t_5numpy_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1391; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_mask.diminfo[0].strides = __pyx_pybuffernd_mask.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_mask.diminfo[0].shape = __pyx_pybuffernd_mask.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_mask.diminfo[1].strides = __pyx_pybuffernd_mask.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_mask.diminfo[1].shape = __pyx_pybuffernd_mask.rcbuffer->pybuffer.shape[1];

  /* "pandas/src/generated.pyx":1396
 *     cdef Py_ssize_t i, j, N, K
 *     cdef float64_t val
 *     cdef int lim, fill_count = 0             # <<<<<<<<<<<<<<
 * 
 *     K, N = (<object> values).shape
 */
  __pyx_v_fill_count = 0;

  /* "pandas/src/generated.pyx":1398
 *     cdef int lim, fill_count = 0
 * 
 *     K, N = (<object> values).shape             # <<<<<<<<<<<<<<
 * 
 *     # GH 2778
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_values), __pyx_n_s_shape); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1398; __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 CYTHON_COMPILING_IN_CPYTHON
    Py_ssize_t size = Py_SIZE(sequence);
    #else
    Py_ssize_t size = PySequence_Size(sequence);
    #endif
    if (unlikely(size != 2)) {
      if (size > 2) __Pyx_RaiseTooManyValuesError(2);
      else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
      {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1398; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    #if CYTHON_COMPILING_IN_CPYTHON
    if (likely(PyTuple_CheckExact(sequence))) {
      __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); 
      __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1); 
    } else {
      __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);
    #else
    __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1398; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1398; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    #endif
    __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[2]; __pyx_lineno = 1398; __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_L3_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_L3_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_3);
    if (__Pyx_IternextUnpackEndCheck(__pyx_t_5(__pyx_t_4), 2) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1398; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_5 = NULL;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    goto __pyx_L4_unpacking_done;
    __pyx_L3_unpacking_failed:;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_5 = NULL;
    if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
    {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1398; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_L4_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[2]; __pyx_lineno = 1398; __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[2]; __pyx_lineno = 1398; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_v_K = __pyx_t_6;
  __pyx_v_N = __pyx_t_7;

  /* "pandas/src/generated.pyx":1401
 * 
 *     # GH 2778
 *     if N == 0:             # <<<<<<<<<<<<<<
 *         return
 * 
 */
  __pyx_t_8 = ((__pyx_v_N == 0) != 0);
  if (__pyx_t_8) {

    /* "pandas/src/generated.pyx":1402
 *     # GH 2778
 *     if N == 0:
 *         return             # <<<<<<<<<<<<<<
 * 
 *     if limit is None:
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_r = Py_None; __Pyx_INCREF(Py_None);
    goto __pyx_L0;
  }

  /* "pandas/src/generated.pyx":1404
 *         return
 * 
 *     if limit is None:             # <<<<<<<<<<<<<<
 *         lim = N
 *     else:
 */
  __pyx_t_8 = (__pyx_v_limit == Py_None);
  __pyx_t_9 = (__pyx_t_8 != 0);
  if (__pyx_t_9) {

    /* "pandas/src/generated.pyx":1405
 * 
 *     if limit is None:
 *         lim = N             # <<<<<<<<<<<<<<
 *     else:
 *         if limit < 0:
 */
    __pyx_v_lim = __pyx_v_N;
    goto __pyx_L6;
  }
  /*else*/ {

    /* "pandas/src/generated.pyx":1407
 *         lim = N
 *     else:
 *         if limit < 0:             # <<<<<<<<<<<<<<
 *             raise ValueError('Limit must be non-negative')
 *         lim = limit
 */
    __pyx_t_1 = PyObject_RichCompare(__pyx_v_limit, __pyx_int_0, Py_LT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1407; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1407; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (__pyx_t_9) {

      /* "pandas/src/generated.pyx":1408
 *     else:
 *         if limit < 0:
 *             raise ValueError('Limit must be non-negative')             # <<<<<<<<<<<<<<
 *         lim = limit
 * 
 */
      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__86, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1408; __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[2]; __pyx_lineno = 1408; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }

    /* "pandas/src/generated.pyx":1409
 *         if limit < 0:
 *             raise ValueError('Limit must be non-negative')
 *         lim = limit             # <<<<<<<<<<<<<<
 * 
 *     for j in range(K):
 */
    __pyx_t_10 = __Pyx_PyInt_As_int(__pyx_v_limit); if (unlikely((__pyx_t_10 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1409; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_v_lim = __pyx_t_10;
  }
  __pyx_L6:;

  /* "pandas/src/generated.pyx":1411
 *         lim = limit
 * 
 *     for j in range(K):             # <<<<<<<<<<<<<<
 *         fill_count = 0
 *         val = values[j, 0]
 */
  __pyx_t_7 = __pyx_v_K;
  for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_7; __pyx_t_6+=1) {
    __pyx_v_j = __pyx_t_6;

    /* "pandas/src/generated.pyx":1412
 * 
 *     for j in range(K):
 *         fill_count = 0             # <<<<<<<<<<<<<<
 *         val = values[j, 0]
 *         for i in range(N):
 */
    __pyx_v_fill_count = 0;

    /* "pandas/src/generated.pyx":1413
 *     for j in range(K):
 *         fill_count = 0
 *         val = values[j, 0]             # <<<<<<<<<<<<<<
 *         for i in range(N):
 *             if mask[j, i]:
 */
    __pyx_t_11 = __pyx_v_j;
    __pyx_t_12 = 0;
    __pyx_v_val = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_values.diminfo[0].strides, __pyx_t_12, __pyx_pybuffernd_values.diminfo[1].strides));

    /* "pandas/src/generated.pyx":1414
 *         fill_count = 0
 *         val = values[j, 0]
 *         for i in range(N):             # <<<<<<<<<<<<<<
 *             if mask[j, i]:
 *                 if fill_count >= lim:
 */
    __pyx_t_13 = __pyx_v_N;
    for (__pyx_t_14 = 0; __pyx_t_14 < __pyx_t_13; __pyx_t_14+=1) {
      __pyx_v_i = __pyx_t_14;

      /* "pandas/src/generated.pyx":1415
 *         val = values[j, 0]
 *         for i in range(N):
 *             if mask[j, i]:             # <<<<<<<<<<<<<<
 *                 if fill_count >= lim:
 *                     continue
 */
      __pyx_t_15 = __pyx_v_j;
      __pyx_t_16 = __pyx_v_i;
      __pyx_t_9 = ((*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_uint8_t *, __pyx_pybuffernd_mask.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_mask.diminfo[0].strides, __pyx_t_16, __pyx_pybuffernd_mask.diminfo[1].strides)) != 0);
      if (__pyx_t_9) {

        /* "pandas/src/generated.pyx":1416
 *         for i in range(N):
 *             if mask[j, i]:
 *                 if fill_count >= lim:             # <<<<<<<<<<<<<<
 *                     continue
 *                 fill_count += 1
 */
        __pyx_t_9 = ((__pyx_v_fill_count >= __pyx_v_lim) != 0);
        if (__pyx_t_9) {

          /* "pandas/src/generated.pyx":1417
 *             if mask[j, i]:
 *                 if fill_count >= lim:
 *                     continue             # <<<<<<<<<<<<<<
 *                 fill_count += 1
 *                 values[j, i] = val
 */
          goto __pyx_L10_continue;
        }

        /* "pandas/src/generated.pyx":1418
 *                 if fill_count >= lim:
 *                     continue
 *                 fill_count += 1             # <<<<<<<<<<<<<<
 *                 values[j, i] = val
 *             else:
 */
        __pyx_v_fill_count = (__pyx_v_fill_count + 1);

        /* "pandas/src/generated.pyx":1419
 *                     continue
 *                 fill_count += 1
 *                 values[j, i] = val             # <<<<<<<<<<<<<<
 *             else:
 *                 fill_count = 0
 */
        __pyx_t_17 = __pyx_v_j;
        __pyx_t_18 = __pyx_v_i;
        *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_values.diminfo[0].strides, __pyx_t_18, __pyx_pybuffernd_values.diminfo[1].strides) = __pyx_v_val;
        goto __pyx_L12;
      }
      /*else*/ {

        /* "pandas/src/generated.pyx":1421
 *                 values[j, i] = val
 *             else:
 *                 fill_count = 0             # <<<<<<<<<<<<<<
 *                 val = values[j, i]
 * @cython.boundscheck(False)
 */
        __pyx_v_fill_count = 0;

        /* "pandas/src/generated.pyx":1422
 *             else:
 *                 fill_count = 0
 *                 val = values[j, i]             # <<<<<<<<<<<<<<
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 */
        __pyx_t_19 = __pyx_v_j;
        __pyx_t_20 = __pyx_v_i;
        __pyx_v_val = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_19, __pyx_pybuffernd_values.diminfo[0].strides, __pyx_t_20, __pyx_pybuffernd_values.diminfo[1].strides));
      }
      __pyx_L12:;
      __pyx_L10_continue:;
    }
  }

  /* "pandas/src/generated.pyx":1391
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def pad_2d_inplace_float64(ndarray[float64_t, ndim=2] values,             # <<<<<<<<<<<<<<
 *                             ndarray[uint8_t, ndim=2] mask,
 *                             limit=None):
 */

  /* function exit code */
  __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_pybuffernd_mask.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas.algos.pad_2d_inplace_float64", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_mask.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer);
  __pyx_L2:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/src/generated.pyx":1425
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def pad_2d_inplace_float32(ndarray[float32_t, ndim=2] values,             # <<<<<<<<<<<<<<
 *                             ndarray[uint8_t, ndim=2] mask,
 *                             limit=None):
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pandas_5algos_165pad_2d_inplace_float32(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_5algos_165pad_2d_inplace_float32 = {__Pyx_NAMESTR("pad_2d_inplace_float32"), (PyCFunction)__pyx_pw_6pandas_5algos_165pad_2d_inplace_float32, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pw_6pandas_5algos_165pad_2d_inplace_float32(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyArrayObject *__pyx_v_values = 0;
  PyArrayObject *__pyx_v_mask = 0;
  PyObject *__pyx_v_limit = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("pad_2d_inplace_float32 (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_values,&__pyx_n_s_mask,&__pyx_n_s_limit,0};
    PyObject* values[3] = {0,0,0};

    /* "pandas/src/generated.pyx":1427
 * def pad_2d_inplace_float32(ndarray[float32_t, ndim=2] values,
 *                             ndarray[uint8_t, ndim=2] mask,
 *                             limit=None):             # <<<<<<<<<<<<<<
 *     cdef Py_ssize_t i, j, N, K
 *     cdef float32_t val
 */
    values[2] = ((PyObject *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_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 (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_mask)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("pad_2d_inplace_float32", 0, 2, 3, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1425; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_limit);
          if (value) { values[2] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "pad_2d_inplace_float32") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1425; __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_mask = ((PyArrayObject *)values[1]);
    __pyx_v_limit = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("pad_2d_inplace_float32", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1425; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas.algos.pad_2d_inplace_float32", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1425; __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[2]; __pyx_lineno = 1426; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_164pad_2d_inplace_float32(__pyx_self, __pyx_v_values, __pyx_v_mask, __pyx_v_limit);

  /* "pandas/src/generated.pyx":1425
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def pad_2d_inplace_float32(ndarray[float32_t, ndim=2] values,             # <<<<<<<<<<<<<<
 *                             ndarray[uint8_t, ndim=2] mask,
 *                             limit=None):
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pandas_5algos_164pad_2d_inplace_float32(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_mask, PyObject *__pyx_v_limit) {
  Py_ssize_t __pyx_v_i;
  Py_ssize_t __pyx_v_j;
  Py_ssize_t __pyx_v_N;
  Py_ssize_t __pyx_v_K;
  __pyx_t_5numpy_float32_t __pyx_v_val;
  int __pyx_v_lim;
  int __pyx_v_fill_count;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_mask;
  __Pyx_Buffer __pyx_pybuffer_mask;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_values;
  __Pyx_Buffer __pyx_pybuffer_values;
  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;
  int __pyx_t_8;
  int __pyx_t_9;
  int __pyx_t_10;
  Py_ssize_t __pyx_t_11;
  long __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;
  Py_ssize_t __pyx_t_20;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("pad_2d_inplace_float32", 0);
  __pyx_pybuffer_values.pybuffer.buf = NULL;
  __pyx_pybuffer_values.refcount = 0;
  __pyx_pybuffernd_values.data = NULL;
  __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values;
  __pyx_pybuffer_mask.pybuffer.buf = NULL;
  __pyx_pybuffer_mask.refcount = 0;
  __pyx_pybuffernd_mask.data = NULL;
  __pyx_pybuffernd_mask.rcbuffer = &__pyx_pybuffer_mask;
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1425; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_values.diminfo[1].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_values.diminfo[1].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[1];
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_mask.rcbuffer->pybuffer, (PyObject*)__pyx_v_mask, &__Pyx_TypeInfo_nn___pyx_t_5numpy_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1425; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_mask.diminfo[0].strides = __pyx_pybuffernd_mask.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_mask.diminfo[0].shape = __pyx_pybuffernd_mask.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_mask.diminfo[1].strides = __pyx_pybuffernd_mask.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_mask.diminfo[1].shape = __pyx_pybuffernd_mask.rcbuffer->pybuffer.shape[1];

  /* "pandas/src/generated.pyx":1430
 *     cdef Py_ssize_t i, j, N, K
 *     cdef float32_t val
 *     cdef int lim, fill_count = 0             # <<<<<<<<<<<<<<
 * 
 *     K, N = (<object> values).shape
 */
  __pyx_v_fill_count = 0;

  /* "pandas/src/generated.pyx":1432
 *     cdef int lim, fill_count = 0
 * 
 *     K, N = (<object> values).shape             # <<<<<<<<<<<<<<
 * 
 *     # GH 2778
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_values), __pyx_n_s_shape); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1432; __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 CYTHON_COMPILING_IN_CPYTHON
    Py_ssize_t size = Py_SIZE(sequence);
    #else
    Py_ssize_t size = PySequence_Size(sequence);
    #endif
    if (unlikely(size != 2)) {
      if (size > 2) __Pyx_RaiseTooManyValuesError(2);
      else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
      {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1432; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    #if CYTHON_COMPILING_IN_CPYTHON
    if (likely(PyTuple_CheckExact(sequence))) {
      __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); 
      __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1); 
    } else {
      __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);
    #else
    __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1432; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1432; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    #endif
    __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[2]; __pyx_lineno = 1432; __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_L3_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_L3_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_3);
    if (__Pyx_IternextUnpackEndCheck(__pyx_t_5(__pyx_t_4), 2) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1432; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_5 = NULL;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    goto __pyx_L4_unpacking_done;
    __pyx_L3_unpacking_failed:;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_5 = NULL;
    if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
    {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1432; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_L4_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[2]; __pyx_lineno = 1432; __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[2]; __pyx_lineno = 1432; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_v_K = __pyx_t_6;
  __pyx_v_N = __pyx_t_7;

  /* "pandas/src/generated.pyx":1435
 * 
 *     # GH 2778
 *     if N == 0:             # <<<<<<<<<<<<<<
 *         return
 * 
 */
  __pyx_t_8 = ((__pyx_v_N == 0) != 0);
  if (__pyx_t_8) {

    /* "pandas/src/generated.pyx":1436
 *     # GH 2778
 *     if N == 0:
 *         return             # <<<<<<<<<<<<<<
 * 
 *     if limit is None:
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_r = Py_None; __Pyx_INCREF(Py_None);
    goto __pyx_L0;
  }

  /* "pandas/src/generated.pyx":1438
 *         return
 * 
 *     if limit is None:             # <<<<<<<<<<<<<<
 *         lim = N
 *     else:
 */
  __pyx_t_8 = (__pyx_v_limit == Py_None);
  __pyx_t_9 = (__pyx_t_8 != 0);
  if (__pyx_t_9) {

    /* "pandas/src/generated.pyx":1439
 * 
 *     if limit is None:
 *         lim = N             # <<<<<<<<<<<<<<
 *     else:
 *         if limit < 0:
 */
    __pyx_v_lim = __pyx_v_N;
    goto __pyx_L6;
  }
  /*else*/ {

    /* "pandas/src/generated.pyx":1441
 *         lim = N
 *     else:
 *         if limit < 0:             # <<<<<<<<<<<<<<
 *             raise ValueError('Limit must be non-negative')
 *         lim = limit
 */
    __pyx_t_1 = PyObject_RichCompare(__pyx_v_limit, __pyx_int_0, Py_LT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1441; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1441; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (__pyx_t_9) {

      /* "pandas/src/generated.pyx":1442
 *     else:
 *         if limit < 0:
 *             raise ValueError('Limit must be non-negative')             # <<<<<<<<<<<<<<
 *         lim = limit
 * 
 */
      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__87, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1442; __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[2]; __pyx_lineno = 1442; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }

    /* "pandas/src/generated.pyx":1443
 *         if limit < 0:
 *             raise ValueError('Limit must be non-negative')
 *         lim = limit             # <<<<<<<<<<<<<<
 * 
 *     for j in range(K):
 */
    __pyx_t_10 = __Pyx_PyInt_As_int(__pyx_v_limit); if (unlikely((__pyx_t_10 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1443; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_v_lim = __pyx_t_10;
  }
  __pyx_L6:;

  /* "pandas/src/generated.pyx":1445
 *         lim = limit
 * 
 *     for j in range(K):             # <<<<<<<<<<<<<<
 *         fill_count = 0
 *         val = values[j, 0]
 */
  __pyx_t_7 = __pyx_v_K;
  for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_7; __pyx_t_6+=1) {
    __pyx_v_j = __pyx_t_6;

    /* "pandas/src/generated.pyx":1446
 * 
 *     for j in range(K):
 *         fill_count = 0             # <<<<<<<<<<<<<<
 *         val = values[j, 0]
 *         for i in range(N):
 */
    __pyx_v_fill_count = 0;

    /* "pandas/src/generated.pyx":1447
 *     for j in range(K):
 *         fill_count = 0
 *         val = values[j, 0]             # <<<<<<<<<<<<<<
 *         for i in range(N):
 *             if mask[j, i]:
 */
    __pyx_t_11 = __pyx_v_j;
    __pyx_t_12 = 0;
    __pyx_v_val = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_values.diminfo[0].strides, __pyx_t_12, __pyx_pybuffernd_values.diminfo[1].strides));

    /* "pandas/src/generated.pyx":1448
 *         fill_count = 0
 *         val = values[j, 0]
 *         for i in range(N):             # <<<<<<<<<<<<<<
 *             if mask[j, i]:
 *                 if fill_count >= lim:
 */
    __pyx_t_13 = __pyx_v_N;
    for (__pyx_t_14 = 0; __pyx_t_14 < __pyx_t_13; __pyx_t_14+=1) {
      __pyx_v_i = __pyx_t_14;

      /* "pandas/src/generated.pyx":1449
 *         val = values[j, 0]
 *         for i in range(N):
 *             if mask[j, i]:             # <<<<<<<<<<<<<<
 *                 if fill_count >= lim:
 *                     continue
 */
      __pyx_t_15 = __pyx_v_j;
      __pyx_t_16 = __pyx_v_i;
      __pyx_t_9 = ((*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_uint8_t *, __pyx_pybuffernd_mask.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_mask.diminfo[0].strides, __pyx_t_16, __pyx_pybuffernd_mask.diminfo[1].strides)) != 0);
      if (__pyx_t_9) {

        /* "pandas/src/generated.pyx":1450
 *         for i in range(N):
 *             if mask[j, i]:
 *                 if fill_count >= lim:             # <<<<<<<<<<<<<<
 *                     continue
 *                 fill_count += 1
 */
        __pyx_t_9 = ((__pyx_v_fill_count >= __pyx_v_lim) != 0);
        if (__pyx_t_9) {

          /* "pandas/src/generated.pyx":1451
 *             if mask[j, i]:
 *                 if fill_count >= lim:
 *                     continue             # <<<<<<<<<<<<<<
 *                 fill_count += 1
 *                 values[j, i] = val
 */
          goto __pyx_L10_continue;
        }

        /* "pandas/src/generated.pyx":1452
 *                 if fill_count >= lim:
 *                     continue
 *                 fill_count += 1             # <<<<<<<<<<<<<<
 *                 values[j, i] = val
 *             else:
 */
        __pyx_v_fill_count = (__pyx_v_fill_count + 1);

        /* "pandas/src/generated.pyx":1453
 *                     continue
 *                 fill_count += 1
 *                 values[j, i] = val             # <<<<<<<<<<<<<<
 *             else:
 *                 fill_count = 0
 */
        __pyx_t_17 = __pyx_v_j;
        __pyx_t_18 = __pyx_v_i;
        *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_values.diminfo[0].strides, __pyx_t_18, __pyx_pybuffernd_values.diminfo[1].strides) = __pyx_v_val;
        goto __pyx_L12;
      }
      /*else*/ {

        /* "pandas/src/generated.pyx":1455
 *                 values[j, i] = val
 *             else:
 *                 fill_count = 0             # <<<<<<<<<<<<<<
 *                 val = values[j, i]
 * @cython.boundscheck(False)
 */
        __pyx_v_fill_count = 0;

        /* "pandas/src/generated.pyx":1456
 *             else:
 *                 fill_count = 0
 *                 val = values[j, i]             # <<<<<<<<<<<<<<
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 */
        __pyx_t_19 = __pyx_v_j;
        __pyx_t_20 = __pyx_v_i;
        __pyx_v_val = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_19, __pyx_pybuffernd_values.diminfo[0].strides, __pyx_t_20, __pyx_pybuffernd_values.diminfo[1].strides));
      }
      __pyx_L12:;
      __pyx_L10_continue:;
    }
  }

  /* "pandas/src/generated.pyx":1425
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def pad_2d_inplace_float32(ndarray[float32_t, ndim=2] values,             # <<<<<<<<<<<<<<
 *                             ndarray[uint8_t, ndim=2] mask,
 *                             limit=None):
 */

  /* function exit code */
  __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_pybuffernd_mask.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas.algos.pad_2d_inplace_float32", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_mask.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer);
  __pyx_L2:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/src/generated.pyx":1459
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def pad_2d_inplace_object(ndarray[object, ndim=2] values,             # <<<<<<<<<<<<<<
 *                             ndarray[uint8_t, ndim=2] mask,
 *                             limit=None):
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pandas_5algos_167pad_2d_inplace_object(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_5algos_167pad_2d_inplace_object = {__Pyx_NAMESTR("pad_2d_inplace_object"), (PyCFunction)__pyx_pw_6pandas_5algos_167pad_2d_inplace_object, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pw_6pandas_5algos_167pad_2d_inplace_object(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyArrayObject *__pyx_v_values = 0;
  PyArrayObject *__pyx_v_mask = 0;
  PyObject *__pyx_v_limit = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("pad_2d_inplace_object (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_values,&__pyx_n_s_mask,&__pyx_n_s_limit,0};
    PyObject* values[3] = {0,0,0};

    /* "pandas/src/generated.pyx":1461
 * def pad_2d_inplace_object(ndarray[object, ndim=2] values,
 *                             ndarray[uint8_t, ndim=2] mask,
 *                             limit=None):             # <<<<<<<<<<<<<<
 *     cdef Py_ssize_t i, j, N, K
 *     cdef object val
 */
    values[2] = ((PyObject *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_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 (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_mask)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("pad_2d_inplace_object", 0, 2, 3, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1459; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_limit);
          if (value) { values[2] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "pad_2d_inplace_object") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1459; __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_mask = ((PyArrayObject *)values[1]);
    __pyx_v_limit = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("pad_2d_inplace_object", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1459; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas.algos.pad_2d_inplace_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1459; __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[2]; __pyx_lineno = 1460; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_166pad_2d_inplace_object(__pyx_self, __pyx_v_values, __pyx_v_mask, __pyx_v_limit);

  /* "pandas/src/generated.pyx":1459
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def pad_2d_inplace_object(ndarray[object, ndim=2] values,             # <<<<<<<<<<<<<<
 *                             ndarray[uint8_t, ndim=2] mask,
 *                             limit=None):
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pandas_5algos_166pad_2d_inplace_object(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_mask, PyObject *__pyx_v_limit) {
  Py_ssize_t __pyx_v_i;
  Py_ssize_t __pyx_v_j;
  Py_ssize_t __pyx_v_N;
  Py_ssize_t __pyx_v_K;
  PyObject *__pyx_v_val = 0;
  int __pyx_v_lim;
  int __pyx_v_fill_count;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_mask;
  __Pyx_Buffer __pyx_pybuffer_mask;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_values;
  __Pyx_Buffer __pyx_pybuffer_values;
  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;
  int __pyx_t_8;
  int __pyx_t_9;
  int __pyx_t_10;
  Py_ssize_t __pyx_t_11;
  long __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;
  PyObject **__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("pad_2d_inplace_object", 0);
  __pyx_pybuffer_values.pybuffer.buf = NULL;
  __pyx_pybuffer_values.refcount = 0;
  __pyx_pybuffernd_values.data = NULL;
  __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values;
  __pyx_pybuffer_mask.pybuffer.buf = NULL;
  __pyx_pybuffer_mask.refcount = 0;
  __pyx_pybuffernd_mask.data = NULL;
  __pyx_pybuffernd_mask.rcbuffer = &__pyx_pybuffer_mask;
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1459; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_values.diminfo[1].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_values.diminfo[1].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[1];
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_mask.rcbuffer->pybuffer, (PyObject*)__pyx_v_mask, &__Pyx_TypeInfo_nn___pyx_t_5numpy_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1459; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_mask.diminfo[0].strides = __pyx_pybuffernd_mask.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_mask.diminfo[0].shape = __pyx_pybuffernd_mask.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_mask.diminfo[1].strides = __pyx_pybuffernd_mask.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_mask.diminfo[1].shape = __pyx_pybuffernd_mask.rcbuffer->pybuffer.shape[1];

  /* "pandas/src/generated.pyx":1464
 *     cdef Py_ssize_t i, j, N, K
 *     cdef object val
 *     cdef int lim, fill_count = 0             # <<<<<<<<<<<<<<
 * 
 *     K, N = (<object> values).shape
 */
  __pyx_v_fill_count = 0;

  /* "pandas/src/generated.pyx":1466
 *     cdef int lim, fill_count = 0
 * 
 *     K, N = (<object> values).shape             # <<<<<<<<<<<<<<
 * 
 *     # GH 2778
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_values), __pyx_n_s_shape); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1466; __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 CYTHON_COMPILING_IN_CPYTHON
    Py_ssize_t size = Py_SIZE(sequence);
    #else
    Py_ssize_t size = PySequence_Size(sequence);
    #endif
    if (unlikely(size != 2)) {
      if (size > 2) __Pyx_RaiseTooManyValuesError(2);
      else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
      {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1466; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    #if CYTHON_COMPILING_IN_CPYTHON
    if (likely(PyTuple_CheckExact(sequence))) {
      __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); 
      __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1); 
    } else {
      __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);
    #else
    __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1466; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1466; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    #endif
    __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[2]; __pyx_lineno = 1466; __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_L3_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_L3_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_3);
    if (__Pyx_IternextUnpackEndCheck(__pyx_t_5(__pyx_t_4), 2) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1466; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_5 = NULL;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    goto __pyx_L4_unpacking_done;
    __pyx_L3_unpacking_failed:;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_5 = NULL;
    if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
    {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1466; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_L4_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[2]; __pyx_lineno = 1466; __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[2]; __pyx_lineno = 1466; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_v_K = __pyx_t_6;
  __pyx_v_N = __pyx_t_7;

  /* "pandas/src/generated.pyx":1469
 * 
 *     # GH 2778
 *     if N == 0:             # <<<<<<<<<<<<<<
 *         return
 * 
 */
  __pyx_t_8 = ((__pyx_v_N == 0) != 0);
  if (__pyx_t_8) {

    /* "pandas/src/generated.pyx":1470
 *     # GH 2778
 *     if N == 0:
 *         return             # <<<<<<<<<<<<<<
 * 
 *     if limit is None:
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_r = Py_None; __Pyx_INCREF(Py_None);
    goto __pyx_L0;
  }

  /* "pandas/src/generated.pyx":1472
 *         return
 * 
 *     if limit is None:             # <<<<<<<<<<<<<<
 *         lim = N
 *     else:
 */
  __pyx_t_8 = (__pyx_v_limit == Py_None);
  __pyx_t_9 = (__pyx_t_8 != 0);
  if (__pyx_t_9) {

    /* "pandas/src/generated.pyx":1473
 * 
 *     if limit is None:
 *         lim = N             # <<<<<<<<<<<<<<
 *     else:
 *         if limit < 0:
 */
    __pyx_v_lim = __pyx_v_N;
    goto __pyx_L6;
  }
  /*else*/ {

    /* "pandas/src/generated.pyx":1475
 *         lim = N
 *     else:
 *         if limit < 0:             # <<<<<<<<<<<<<<
 *             raise ValueError('Limit must be non-negative')
 *         lim = limit
 */
    __pyx_t_1 = PyObject_RichCompare(__pyx_v_limit, __pyx_int_0, Py_LT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1475; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1475; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (__pyx_t_9) {

      /* "pandas/src/generated.pyx":1476
 *     else:
 *         if limit < 0:
 *             raise ValueError('Limit must be non-negative')             # <<<<<<<<<<<<<<
 *         lim = limit
 * 
 */
      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__88, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1476; __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[2]; __pyx_lineno = 1476; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }

    /* "pandas/src/generated.pyx":1477
 *         if limit < 0:
 *             raise ValueError('Limit must be non-negative')
 *         lim = limit             # <<<<<<<<<<<<<<
 * 
 *     for j in range(K):
 */
    __pyx_t_10 = __Pyx_PyInt_As_int(__pyx_v_limit); if (unlikely((__pyx_t_10 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1477; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_v_lim = __pyx_t_10;
  }
  __pyx_L6:;

  /* "pandas/src/generated.pyx":1479
 *         lim = limit
 * 
 *     for j in range(K):             # <<<<<<<<<<<<<<
 *         fill_count = 0
 *         val = values[j, 0]
 */
  __pyx_t_7 = __pyx_v_K;
  for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_7; __pyx_t_6+=1) {
    __pyx_v_j = __pyx_t_6;

    /* "pandas/src/generated.pyx":1480
 * 
 *     for j in range(K):
 *         fill_count = 0             # <<<<<<<<<<<<<<
 *         val = values[j, 0]
 *         for i in range(N):
 */
    __pyx_v_fill_count = 0;

    /* "pandas/src/generated.pyx":1481
 *     for j in range(K):
 *         fill_count = 0
 *         val = values[j, 0]             # <<<<<<<<<<<<<<
 *         for i in range(N):
 *             if mask[j, i]:
 */
    __pyx_t_11 = __pyx_v_j;
    __pyx_t_12 = 0;
    __pyx_t_1 = (PyObject *) *__Pyx_BufPtrStrided2d(PyObject **, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_values.diminfo[0].strides, __pyx_t_12, __pyx_pybuffernd_values.diminfo[1].strides);
    __Pyx_INCREF((PyObject*)__pyx_t_1);
    __Pyx_XDECREF_SET(__pyx_v_val, __pyx_t_1);
    __pyx_t_1 = 0;

    /* "pandas/src/generated.pyx":1482
 *         fill_count = 0
 *         val = values[j, 0]
 *         for i in range(N):             # <<<<<<<<<<<<<<
 *             if mask[j, i]:
 *                 if fill_count >= lim:
 */
    __pyx_t_13 = __pyx_v_N;
    for (__pyx_t_14 = 0; __pyx_t_14 < __pyx_t_13; __pyx_t_14+=1) {
      __pyx_v_i = __pyx_t_14;

      /* "pandas/src/generated.pyx":1483
 *         val = values[j, 0]
 *         for i in range(N):
 *             if mask[j, i]:             # <<<<<<<<<<<<<<
 *                 if fill_count >= lim:
 *                     continue
 */
      __pyx_t_15 = __pyx_v_j;
      __pyx_t_16 = __pyx_v_i;
      __pyx_t_9 = ((*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_uint8_t *, __pyx_pybuffernd_mask.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_mask.diminfo[0].strides, __pyx_t_16, __pyx_pybuffernd_mask.diminfo[1].strides)) != 0);
      if (__pyx_t_9) {

        /* "pandas/src/generated.pyx":1484
 *         for i in range(N):
 *             if mask[j, i]:
 *                 if fill_count >= lim:             # <<<<<<<<<<<<<<
 *                     continue
 *                 fill_count += 1
 */
        __pyx_t_9 = ((__pyx_v_fill_count >= __pyx_v_lim) != 0);
        if (__pyx_t_9) {

          /* "pandas/src/generated.pyx":1485
 *             if mask[j, i]:
 *                 if fill_count >= lim:
 *                     continue             # <<<<<<<<<<<<<<
 *                 fill_count += 1
 *                 values[j, i] = val
 */
          goto __pyx_L10_continue;
        }

        /* "pandas/src/generated.pyx":1486
 *                 if fill_count >= lim:
 *                     continue
 *                 fill_count += 1             # <<<<<<<<<<<<<<
 *                 values[j, i] = val
 *             else:
 */
        __pyx_v_fill_count = (__pyx_v_fill_count + 1);

        /* "pandas/src/generated.pyx":1487
 *                     continue
 *                 fill_count += 1
 *                 values[j, i] = val             # <<<<<<<<<<<<<<
 *             else:
 *                 fill_count = 0
 */
        __pyx_t_17 = __pyx_v_j;
        __pyx_t_18 = __pyx_v_i;
        __pyx_t_19 = __Pyx_BufPtrStrided2d(PyObject **, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_values.diminfo[0].strides, __pyx_t_18, __pyx_pybuffernd_values.diminfo[1].strides);
        __Pyx_GOTREF(*__pyx_t_19);
        __Pyx_INCREF(__pyx_v_val); __Pyx_DECREF(*__pyx_t_19);
        *__pyx_t_19 = __pyx_v_val;
        __Pyx_GIVEREF(*__pyx_t_19);
        goto __pyx_L12;
      }
      /*else*/ {

        /* "pandas/src/generated.pyx":1489
 *                 values[j, i] = val
 *             else:
 *                 fill_count = 0             # <<<<<<<<<<<<<<
 *                 val = values[j, i]
 * @cython.boundscheck(False)
 */
        __pyx_v_fill_count = 0;

        /* "pandas/src/generated.pyx":1490
 *             else:
 *                 fill_count = 0
 *                 val = values[j, i]             # <<<<<<<<<<<<<<
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 */
        __pyx_t_20 = __pyx_v_j;
        __pyx_t_21 = __pyx_v_i;
        __pyx_t_1 = (PyObject *) *__Pyx_BufPtrStrided2d(PyObject **, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_values.diminfo[0].strides, __pyx_t_21, __pyx_pybuffernd_values.diminfo[1].strides);
        __Pyx_INCREF((PyObject*)__pyx_t_1);
        __Pyx_DECREF_SET(__pyx_v_val, __pyx_t_1);
        __pyx_t_1 = 0;
      }
      __pyx_L12:;
      __pyx_L10_continue:;
    }
  }

  /* "pandas/src/generated.pyx":1459
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def pad_2d_inplace_object(ndarray[object, ndim=2] values,             # <<<<<<<<<<<<<<
 *                             ndarray[uint8_t, ndim=2] mask,
 *                             limit=None):
 */

  /* function exit code */
  __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_pybuffernd_mask.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas.algos.pad_2d_inplace_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_mask.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer);
  __pyx_L2:;
  __Pyx_XDECREF(__pyx_v_val);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/src/generated.pyx":1493
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def pad_2d_inplace_int32(ndarray[int32_t, ndim=2] values,             # <<<<<<<<<<<<<<
 *                             ndarray[uint8_t, ndim=2] mask,
 *                             limit=None):
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pandas_5algos_169pad_2d_inplace_int32(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_5algos_169pad_2d_inplace_int32 = {__Pyx_NAMESTR("pad_2d_inplace_int32"), (PyCFunction)__pyx_pw_6pandas_5algos_169pad_2d_inplace_int32, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pw_6pandas_5algos_169pad_2d_inplace_int32(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyArrayObject *__pyx_v_values = 0;
  PyArrayObject *__pyx_v_mask = 0;
  PyObject *__pyx_v_limit = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("pad_2d_inplace_int32 (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_values,&__pyx_n_s_mask,&__pyx_n_s_limit,0};
    PyObject* values[3] = {0,0,0};

    /* "pandas/src/generated.pyx":1495
 * def pad_2d_inplace_int32(ndarray[int32_t, ndim=2] values,
 *                             ndarray[uint8_t, ndim=2] mask,
 *                             limit=None):             # <<<<<<<<<<<<<<
 *     cdef Py_ssize_t i, j, N, K
 *     cdef int32_t val
 */
    values[2] = ((PyObject *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_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 (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_mask)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("pad_2d_inplace_int32", 0, 2, 3, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1493; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_limit);
          if (value) { values[2] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "pad_2d_inplace_int32") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1493; __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_mask = ((PyArrayObject *)values[1]);
    __pyx_v_limit = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("pad_2d_inplace_int32", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1493; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas.algos.pad_2d_inplace_int32", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1493; __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[2]; __pyx_lineno = 1494; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_168pad_2d_inplace_int32(__pyx_self, __pyx_v_values, __pyx_v_mask, __pyx_v_limit);

  /* "pandas/src/generated.pyx":1493
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def pad_2d_inplace_int32(ndarray[int32_t, ndim=2] values,             # <<<<<<<<<<<<<<
 *                             ndarray[uint8_t, ndim=2] mask,
 *                             limit=None):
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pandas_5algos_168pad_2d_inplace_int32(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_mask, PyObject *__pyx_v_limit) {
  Py_ssize_t __pyx_v_i;
  Py_ssize_t __pyx_v_j;
  Py_ssize_t __pyx_v_N;
  Py_ssize_t __pyx_v_K;
  __pyx_t_5numpy_int32_t __pyx_v_val;
  int __pyx_v_lim;
  int __pyx_v_fill_count;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_mask;
  __Pyx_Buffer __pyx_pybuffer_mask;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_values;
  __Pyx_Buffer __pyx_pybuffer_values;
  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;
  int __pyx_t_8;
  int __pyx_t_9;
  int __pyx_t_10;
  Py_ssize_t __pyx_t_11;
  long __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;
  Py_ssize_t __pyx_t_20;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("pad_2d_inplace_int32", 0);
  __pyx_pybuffer_values.pybuffer.buf = NULL;
  __pyx_pybuffer_values.refcount = 0;
  __pyx_pybuffernd_values.data = NULL;
  __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values;
  __pyx_pybuffer_mask.pybuffer.buf = NULL;
  __pyx_pybuffer_mask.refcount = 0;
  __pyx_pybuffernd_mask.data = NULL;
  __pyx_pybuffernd_mask.rcbuffer = &__pyx_pybuffer_mask;
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1493; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_values.diminfo[1].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_values.diminfo[1].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[1];
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_mask.rcbuffer->pybuffer, (PyObject*)__pyx_v_mask, &__Pyx_TypeInfo_nn___pyx_t_5numpy_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1493; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_mask.diminfo[0].strides = __pyx_pybuffernd_mask.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_mask.diminfo[0].shape = __pyx_pybuffernd_mask.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_mask.diminfo[1].strides = __pyx_pybuffernd_mask.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_mask.diminfo[1].shape = __pyx_pybuffernd_mask.rcbuffer->pybuffer.shape[1];

  /* "pandas/src/generated.pyx":1498
 *     cdef Py_ssize_t i, j, N, K
 *     cdef int32_t val
 *     cdef int lim, fill_count = 0             # <<<<<<<<<<<<<<
 * 
 *     K, N = (<object> values).shape
 */
  __pyx_v_fill_count = 0;

  /* "pandas/src/generated.pyx":1500
 *     cdef int lim, fill_count = 0
 * 
 *     K, N = (<object> values).shape             # <<<<<<<<<<<<<<
 * 
 *     # GH 2778
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_values), __pyx_n_s_shape); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1500; __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 CYTHON_COMPILING_IN_CPYTHON
    Py_ssize_t size = Py_SIZE(sequence);
    #else
    Py_ssize_t size = PySequence_Size(sequence);
    #endif
    if (unlikely(size != 2)) {
      if (size > 2) __Pyx_RaiseTooManyValuesError(2);
      else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
      {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1500; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    #if CYTHON_COMPILING_IN_CPYTHON
    if (likely(PyTuple_CheckExact(sequence))) {
      __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); 
      __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1); 
    } else {
      __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);
    #else
    __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1500; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1500; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    #endif
    __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[2]; __pyx_lineno = 1500; __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_L3_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_L3_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_3);
    if (__Pyx_IternextUnpackEndCheck(__pyx_t_5(__pyx_t_4), 2) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1500; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_5 = NULL;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    goto __pyx_L4_unpacking_done;
    __pyx_L3_unpacking_failed:;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_5 = NULL;
    if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
    {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1500; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_L4_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[2]; __pyx_lineno = 1500; __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[2]; __pyx_lineno = 1500; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_v_K = __pyx_t_6;
  __pyx_v_N = __pyx_t_7;

  /* "pandas/src/generated.pyx":1503
 * 
 *     # GH 2778
 *     if N == 0:             # <<<<<<<<<<<<<<
 *         return
 * 
 */
  __pyx_t_8 = ((__pyx_v_N == 0) != 0);
  if (__pyx_t_8) {

    /* "pandas/src/generated.pyx":1504
 *     # GH 2778
 *     if N == 0:
 *         return             # <<<<<<<<<<<<<<
 * 
 *     if limit is None:
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_r = Py_None; __Pyx_INCREF(Py_None);
    goto __pyx_L0;
  }

  /* "pandas/src/generated.pyx":1506
 *         return
 * 
 *     if limit is None:             # <<<<<<<<<<<<<<
 *         lim = N
 *     else:
 */
  __pyx_t_8 = (__pyx_v_limit == Py_None);
  __pyx_t_9 = (__pyx_t_8 != 0);
  if (__pyx_t_9) {

    /* "pandas/src/generated.pyx":1507
 * 
 *     if limit is None:
 *         lim = N             # <<<<<<<<<<<<<<
 *     else:
 *         if limit < 0:
 */
    __pyx_v_lim = __pyx_v_N;
    goto __pyx_L6;
  }
  /*else*/ {

    /* "pandas/src/generated.pyx":1509
 *         lim = N
 *     else:
 *         if limit < 0:             # <<<<<<<<<<<<<<
 *             raise ValueError('Limit must be non-negative')
 *         lim = limit
 */
    __pyx_t_1 = PyObject_RichCompare(__pyx_v_limit, __pyx_int_0, Py_LT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1509; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1509; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (__pyx_t_9) {

      /* "pandas/src/generated.pyx":1510
 *     else:
 *         if limit < 0:
 *             raise ValueError('Limit must be non-negative')             # <<<<<<<<<<<<<<
 *         lim = limit
 * 
 */
      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__89, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1510; __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[2]; __pyx_lineno = 1510; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }

    /* "pandas/src/generated.pyx":1511
 *         if limit < 0:
 *             raise ValueError('Limit must be non-negative')
 *         lim = limit             # <<<<<<<<<<<<<<
 * 
 *     for j in range(K):
 */
    __pyx_t_10 = __Pyx_PyInt_As_int(__pyx_v_limit); if (unlikely((__pyx_t_10 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1511; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_v_lim = __pyx_t_10;
  }
  __pyx_L6:;

  /* "pandas/src/generated.pyx":1513
 *         lim = limit
 * 
 *     for j in range(K):             # <<<<<<<<<<<<<<
 *         fill_count = 0
 *         val = values[j, 0]
 */
  __pyx_t_7 = __pyx_v_K;
  for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_7; __pyx_t_6+=1) {
    __pyx_v_j = __pyx_t_6;

    /* "pandas/src/generated.pyx":1514
 * 
 *     for j in range(K):
 *         fill_count = 0             # <<<<<<<<<<<<<<
 *         val = values[j, 0]
 *         for i in range(N):
 */
    __pyx_v_fill_count = 0;

    /* "pandas/src/generated.pyx":1515
 *     for j in range(K):
 *         fill_count = 0
 *         val = values[j, 0]             # <<<<<<<<<<<<<<
 *         for i in range(N):
 *             if mask[j, i]:
 */
    __pyx_t_11 = __pyx_v_j;
    __pyx_t_12 = 0;
    __pyx_v_val = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_values.diminfo[0].strides, __pyx_t_12, __pyx_pybuffernd_values.diminfo[1].strides));

    /* "pandas/src/generated.pyx":1516
 *         fill_count = 0
 *         val = values[j, 0]
 *         for i in range(N):             # <<<<<<<<<<<<<<
 *             if mask[j, i]:
 *                 if fill_count >= lim:
 */
    __pyx_t_13 = __pyx_v_N;
    for (__pyx_t_14 = 0; __pyx_t_14 < __pyx_t_13; __pyx_t_14+=1) {
      __pyx_v_i = __pyx_t_14;

      /* "pandas/src/generated.pyx":1517
 *         val = values[j, 0]
 *         for i in range(N):
 *             if mask[j, i]:             # <<<<<<<<<<<<<<
 *                 if fill_count >= lim:
 *                     continue
 */
      __pyx_t_15 = __pyx_v_j;
      __pyx_t_16 = __pyx_v_i;
      __pyx_t_9 = ((*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_uint8_t *, __pyx_pybuffernd_mask.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_mask.diminfo[0].strides, __pyx_t_16, __pyx_pybuffernd_mask.diminfo[1].strides)) != 0);
      if (__pyx_t_9) {

        /* "pandas/src/generated.pyx":1518
 *         for i in range(N):
 *             if mask[j, i]:
 *                 if fill_count >= lim:             # <<<<<<<<<<<<<<
 *                     continue
 *                 fill_count += 1
 */
        __pyx_t_9 = ((__pyx_v_fill_count >= __pyx_v_lim) != 0);
        if (__pyx_t_9) {

          /* "pandas/src/generated.pyx":1519
 *             if mask[j, i]:
 *                 if fill_count >= lim:
 *                     continue             # <<<<<<<<<<<<<<
 *                 fill_count += 1
 *                 values[j, i] = val
 */
          goto __pyx_L10_continue;
        }

        /* "pandas/src/generated.pyx":1520
 *                 if fill_count >= lim:
 *                     continue
 *                 fill_count += 1             # <<<<<<<<<<<<<<
 *                 values[j, i] = val
 *             else:
 */
        __pyx_v_fill_count = (__pyx_v_fill_count + 1);

        /* "pandas/src/generated.pyx":1521
 *                     continue
 *                 fill_count += 1
 *                 values[j, i] = val             # <<<<<<<<<<<<<<
 *             else:
 *                 fill_count = 0
 */
        __pyx_t_17 = __pyx_v_j;
        __pyx_t_18 = __pyx_v_i;
        *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_values.diminfo[0].strides, __pyx_t_18, __pyx_pybuffernd_values.diminfo[1].strides) = __pyx_v_val;
        goto __pyx_L12;
      }
      /*else*/ {

        /* "pandas/src/generated.pyx":1523
 *                 values[j, i] = val
 *             else:
 *                 fill_count = 0             # <<<<<<<<<<<<<<
 *                 val = values[j, i]
 * @cython.boundscheck(False)
 */
        __pyx_v_fill_count = 0;

        /* "pandas/src/generated.pyx":1524
 *             else:
 *                 fill_count = 0
 *                 val = values[j, i]             # <<<<<<<<<<<<<<
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 */
        __pyx_t_19 = __pyx_v_j;
        __pyx_t_20 = __pyx_v_i;
        __pyx_v_val = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_19, __pyx_pybuffernd_values.diminfo[0].strides, __pyx_t_20, __pyx_pybuffernd_values.diminfo[1].strides));
      }
      __pyx_L12:;
      __pyx_L10_continue:;
    }
  }

  /* "pandas/src/generated.pyx":1493
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def pad_2d_inplace_int32(ndarray[int32_t, ndim=2] values,             # <<<<<<<<<<<<<<
 *                             ndarray[uint8_t, ndim=2] mask,
 *                             limit=None):
 */

  /* function exit code */
  __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_pybuffernd_mask.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas.algos.pad_2d_inplace_int32", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_mask.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer);
  __pyx_L2:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/src/generated.pyx":1527
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def pad_2d_inplace_int64(ndarray[int64_t, ndim=2] values,             # <<<<<<<<<<<<<<
 *                             ndarray[uint8_t, ndim=2] mask,
 *                             limit=None):
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pandas_5algos_171pad_2d_inplace_int64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_5algos_171pad_2d_inplace_int64 = {__Pyx_NAMESTR("pad_2d_inplace_int64"), (PyCFunction)__pyx_pw_6pandas_5algos_171pad_2d_inplace_int64, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pw_6pandas_5algos_171pad_2d_inplace_int64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyArrayObject *__pyx_v_values = 0;
  PyArrayObject *__pyx_v_mask = 0;
  PyObject *__pyx_v_limit = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("pad_2d_inplace_int64 (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_values,&__pyx_n_s_mask,&__pyx_n_s_limit,0};
    PyObject* values[3] = {0,0,0};

    /* "pandas/src/generated.pyx":1529
 * def pad_2d_inplace_int64(ndarray[int64_t, ndim=2] values,
 *                             ndarray[uint8_t, ndim=2] mask,
 *                             limit=None):             # <<<<<<<<<<<<<<
 *     cdef Py_ssize_t i, j, N, K
 *     cdef int64_t val
 */
    values[2] = ((PyObject *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_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 (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_mask)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("pad_2d_inplace_int64", 0, 2, 3, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1527; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_limit);
          if (value) { values[2] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "pad_2d_inplace_int64") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1527; __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_mask = ((PyArrayObject *)values[1]);
    __pyx_v_limit = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("pad_2d_inplace_int64", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1527; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas.algos.pad_2d_inplace_int64", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1527; __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[2]; __pyx_lineno = 1528; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_170pad_2d_inplace_int64(__pyx_self, __pyx_v_values, __pyx_v_mask, __pyx_v_limit);

  /* "pandas/src/generated.pyx":1527
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def pad_2d_inplace_int64(ndarray[int64_t, ndim=2] values,             # <<<<<<<<<<<<<<
 *                             ndarray[uint8_t, ndim=2] mask,
 *                             limit=None):
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pandas_5algos_170pad_2d_inplace_int64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_mask, PyObject *__pyx_v_limit) {
  Py_ssize_t __pyx_v_i;
  Py_ssize_t __pyx_v_j;
  Py_ssize_t __pyx_v_N;
  Py_ssize_t __pyx_v_K;
  __pyx_t_5numpy_int64_t __pyx_v_val;
  int __pyx_v_lim;
  int __pyx_v_fill_count;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_mask;
  __Pyx_Buffer __pyx_pybuffer_mask;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_values;
  __Pyx_Buffer __pyx_pybuffer_values;
  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;
  int __pyx_t_8;
  int __pyx_t_9;
  int __pyx_t_10;
  Py_ssize_t __pyx_t_11;
  long __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;
  Py_ssize_t __pyx_t_20;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("pad_2d_inplace_int64", 0);
  __pyx_pybuffer_values.pybuffer.buf = NULL;
  __pyx_pybuffer_values.refcount = 0;
  __pyx_pybuffernd_values.data = NULL;
  __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values;
  __pyx_pybuffer_mask.pybuffer.buf = NULL;
  __pyx_pybuffer_mask.refcount = 0;
  __pyx_pybuffernd_mask.data = NULL;
  __pyx_pybuffernd_mask.rcbuffer = &__pyx_pybuffer_mask;
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1527; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_values.diminfo[1].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_values.diminfo[1].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[1];
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_mask.rcbuffer->pybuffer, (PyObject*)__pyx_v_mask, &__Pyx_TypeInfo_nn___pyx_t_5numpy_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1527; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_mask.diminfo[0].strides = __pyx_pybuffernd_mask.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_mask.diminfo[0].shape = __pyx_pybuffernd_mask.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_mask.diminfo[1].strides = __pyx_pybuffernd_mask.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_mask.diminfo[1].shape = __pyx_pybuffernd_mask.rcbuffer->pybuffer.shape[1];

  /* "pandas/src/generated.pyx":1532
 *     cdef Py_ssize_t i, j, N, K
 *     cdef int64_t val
 *     cdef int lim, fill_count = 0             # <<<<<<<<<<<<<<
 * 
 *     K, N = (<object> values).shape
 */
  __pyx_v_fill_count = 0;

  /* "pandas/src/generated.pyx":1534
 *     cdef int lim, fill_count = 0
 * 
 *     K, N = (<object> values).shape             # <<<<<<<<<<<<<<
 * 
 *     # GH 2778
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_values), __pyx_n_s_shape); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1534; __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 CYTHON_COMPILING_IN_CPYTHON
    Py_ssize_t size = Py_SIZE(sequence);
    #else
    Py_ssize_t size = PySequence_Size(sequence);
    #endif
    if (unlikely(size != 2)) {
      if (size > 2) __Pyx_RaiseTooManyValuesError(2);
      else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
      {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1534; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    #if CYTHON_COMPILING_IN_CPYTHON
    if (likely(PyTuple_CheckExact(sequence))) {
      __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); 
      __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1); 
    } else {
      __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);
    #else
    __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1534; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1534; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    #endif
    __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[2]; __pyx_lineno = 1534; __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_L3_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_L3_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_3);
    if (__Pyx_IternextUnpackEndCheck(__pyx_t_5(__pyx_t_4), 2) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1534; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_5 = NULL;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    goto __pyx_L4_unpacking_done;
    __pyx_L3_unpacking_failed:;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_5 = NULL;
    if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
    {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1534; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_L4_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[2]; __pyx_lineno = 1534; __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[2]; __pyx_lineno = 1534; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_v_K = __pyx_t_6;
  __pyx_v_N = __pyx_t_7;

  /* "pandas/src/generated.pyx":1537
 * 
 *     # GH 2778
 *     if N == 0:             # <<<<<<<<<<<<<<
 *         return
 * 
 */
  __pyx_t_8 = ((__pyx_v_N == 0) != 0);
  if (__pyx_t_8) {

    /* "pandas/src/generated.pyx":1538
 *     # GH 2778
 *     if N == 0:
 *         return             # <<<<<<<<<<<<<<
 * 
 *     if limit is None:
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_r = Py_None; __Pyx_INCREF(Py_None);
    goto __pyx_L0;
  }

  /* "pandas/src/generated.pyx":1540
 *         return
 * 
 *     if limit is None:             # <<<<<<<<<<<<<<
 *         lim = N
 *     else:
 */
  __pyx_t_8 = (__pyx_v_limit == Py_None);
  __pyx_t_9 = (__pyx_t_8 != 0);
  if (__pyx_t_9) {

    /* "pandas/src/generated.pyx":1541
 * 
 *     if limit is None:
 *         lim = N             # <<<<<<<<<<<<<<
 *     else:
 *         if limit < 0:
 */
    __pyx_v_lim = __pyx_v_N;
    goto __pyx_L6;
  }
  /*else*/ {

    /* "pandas/src/generated.pyx":1543
 *         lim = N
 *     else:
 *         if limit < 0:             # <<<<<<<<<<<<<<
 *             raise ValueError('Limit must be non-negative')
 *         lim = limit
 */
    __pyx_t_1 = PyObject_RichCompare(__pyx_v_limit, __pyx_int_0, Py_LT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1543; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1543; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (__pyx_t_9) {

      /* "pandas/src/generated.pyx":1544
 *     else:
 *         if limit < 0:
 *             raise ValueError('Limit must be non-negative')             # <<<<<<<<<<<<<<
 *         lim = limit
 * 
 */
      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__90, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1544; __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[2]; __pyx_lineno = 1544; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }

    /* "pandas/src/generated.pyx":1545
 *         if limit < 0:
 *             raise ValueError('Limit must be non-negative')
 *         lim = limit             # <<<<<<<<<<<<<<
 * 
 *     for j in range(K):
 */
    __pyx_t_10 = __Pyx_PyInt_As_int(__pyx_v_limit); if (unlikely((__pyx_t_10 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1545; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_v_lim = __pyx_t_10;
  }
  __pyx_L6:;

  /* "pandas/src/generated.pyx":1547
 *         lim = limit
 * 
 *     for j in range(K):             # <<<<<<<<<<<<<<
 *         fill_count = 0
 *         val = values[j, 0]
 */
  __pyx_t_7 = __pyx_v_K;
  for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_7; __pyx_t_6+=1) {
    __pyx_v_j = __pyx_t_6;

    /* "pandas/src/generated.pyx":1548
 * 
 *     for j in range(K):
 *         fill_count = 0             # <<<<<<<<<<<<<<
 *         val = values[j, 0]
 *         for i in range(N):
 */
    __pyx_v_fill_count = 0;

    /* "pandas/src/generated.pyx":1549
 *     for j in range(K):
 *         fill_count = 0
 *         val = values[j, 0]             # <<<<<<<<<<<<<<
 *         for i in range(N):
 *             if mask[j, i]:
 */
    __pyx_t_11 = __pyx_v_j;
    __pyx_t_12 = 0;
    __pyx_v_val = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_values.diminfo[0].strides, __pyx_t_12, __pyx_pybuffernd_values.diminfo[1].strides));

    /* "pandas/src/generated.pyx":1550
 *         fill_count = 0
 *         val = values[j, 0]
 *         for i in range(N):             # <<<<<<<<<<<<<<
 *             if mask[j, i]:
 *                 if fill_count >= lim:
 */
    __pyx_t_13 = __pyx_v_N;
    for (__pyx_t_14 = 0; __pyx_t_14 < __pyx_t_13; __pyx_t_14+=1) {
      __pyx_v_i = __pyx_t_14;

      /* "pandas/src/generated.pyx":1551
 *         val = values[j, 0]
 *         for i in range(N):
 *             if mask[j, i]:             # <<<<<<<<<<<<<<
 *                 if fill_count >= lim:
 *                     continue
 */
      __pyx_t_15 = __pyx_v_j;
      __pyx_t_16 = __pyx_v_i;
      __pyx_t_9 = ((*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_uint8_t *, __pyx_pybuffernd_mask.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_mask.diminfo[0].strides, __pyx_t_16, __pyx_pybuffernd_mask.diminfo[1].strides)) != 0);
      if (__pyx_t_9) {

        /* "pandas/src/generated.pyx":1552
 *         for i in range(N):
 *             if mask[j, i]:
 *                 if fill_count >= lim:             # <<<<<<<<<<<<<<
 *                     continue
 *                 fill_count += 1
 */
        __pyx_t_9 = ((__pyx_v_fill_count >= __pyx_v_lim) != 0);
        if (__pyx_t_9) {

          /* "pandas/src/generated.pyx":1553
 *             if mask[j, i]:
 *                 if fill_count >= lim:
 *                     continue             # <<<<<<<<<<<<<<
 *                 fill_count += 1
 *                 values[j, i] = val
 */
          goto __pyx_L10_continue;
        }

        /* "pandas/src/generated.pyx":1554
 *                 if fill_count >= lim:
 *                     continue
 *                 fill_count += 1             # <<<<<<<<<<<<<<
 *                 values[j, i] = val
 *             else:
 */
        __pyx_v_fill_count = (__pyx_v_fill_count + 1);

        /* "pandas/src/generated.pyx":1555
 *                     continue
 *                 fill_count += 1
 *                 values[j, i] = val             # <<<<<<<<<<<<<<
 *             else:
 *                 fill_count = 0
 */
        __pyx_t_17 = __pyx_v_j;
        __pyx_t_18 = __pyx_v_i;
        *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_values.diminfo[0].strides, __pyx_t_18, __pyx_pybuffernd_values.diminfo[1].strides) = __pyx_v_val;
        goto __pyx_L12;
      }
      /*else*/ {

        /* "pandas/src/generated.pyx":1557
 *                 values[j, i] = val
 *             else:
 *                 fill_count = 0             # <<<<<<<<<<<<<<
 *                 val = values[j, i]
 * @cython.boundscheck(False)
 */
        __pyx_v_fill_count = 0;

        /* "pandas/src/generated.pyx":1558
 *             else:
 *                 fill_count = 0
 *                 val = values[j, i]             # <<<<<<<<<<<<<<
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 */
        __pyx_t_19 = __pyx_v_j;
        __pyx_t_20 = __pyx_v_i;
        __pyx_v_val = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_19, __pyx_pybuffernd_values.diminfo[0].strides, __pyx_t_20, __pyx_pybuffernd_values.diminfo[1].strides));
      }
      __pyx_L12:;
      __pyx_L10_continue:;
    }
  }

  /* "pandas/src/generated.pyx":1527
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def pad_2d_inplace_int64(ndarray[int64_t, ndim=2] values,             # <<<<<<<<<<<<<<
 *                             ndarray[uint8_t, ndim=2] mask,
 *                             limit=None):
 */

  /* function exit code */
  __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_pybuffernd_mask.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas.algos.pad_2d_inplace_int64", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_mask.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer);
  __pyx_L2:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/src/generated.pyx":1561
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def pad_2d_inplace_bool(ndarray[uint8_t, ndim=2] values,             # <<<<<<<<<<<<<<
 *                             ndarray[uint8_t, ndim=2] mask,
 *                             limit=None):
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pandas_5algos_173pad_2d_inplace_bool(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_5algos_173pad_2d_inplace_bool = {__Pyx_NAMESTR("pad_2d_inplace_bool"), (PyCFunction)__pyx_pw_6pandas_5algos_173pad_2d_inplace_bool, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pw_6pandas_5algos_173pad_2d_inplace_bool(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyArrayObject *__pyx_v_values = 0;
  PyArrayObject *__pyx_v_mask = 0;
  PyObject *__pyx_v_limit = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("pad_2d_inplace_bool (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_values,&__pyx_n_s_mask,&__pyx_n_s_limit,0};
    PyObject* values[3] = {0,0,0};

    /* "pandas/src/generated.pyx":1563
 * def pad_2d_inplace_bool(ndarray[uint8_t, ndim=2] values,
 *                             ndarray[uint8_t, ndim=2] mask,
 *                             limit=None):             # <<<<<<<<<<<<<<
 *     cdef Py_ssize_t i, j, N, K
 *     cdef uint8_t val
 */
    values[2] = ((PyObject *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_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 (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_mask)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("pad_2d_inplace_bool", 0, 2, 3, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1561; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_limit);
          if (value) { values[2] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "pad_2d_inplace_bool") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1561; __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_mask = ((PyArrayObject *)values[1]);
    __pyx_v_limit = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("pad_2d_inplace_bool", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1561; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas.algos.pad_2d_inplace_bool", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1561; __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[2]; __pyx_lineno = 1562; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_172pad_2d_inplace_bool(__pyx_self, __pyx_v_values, __pyx_v_mask, __pyx_v_limit);

  /* "pandas/src/generated.pyx":1561
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def pad_2d_inplace_bool(ndarray[uint8_t, ndim=2] values,             # <<<<<<<<<<<<<<
 *                             ndarray[uint8_t, ndim=2] mask,
 *                             limit=None):
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pandas_5algos_172pad_2d_inplace_bool(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_mask, PyObject *__pyx_v_limit) {
  Py_ssize_t __pyx_v_i;
  Py_ssize_t __pyx_v_j;
  Py_ssize_t __pyx_v_N;
  Py_ssize_t __pyx_v_K;
  __pyx_t_5numpy_uint8_t __pyx_v_val;
  int __pyx_v_lim;
  int __pyx_v_fill_count;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_mask;
  __Pyx_Buffer __pyx_pybuffer_mask;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_values;
  __Pyx_Buffer __pyx_pybuffer_values;
  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;
  int __pyx_t_8;
  int __pyx_t_9;
  int __pyx_t_10;
  Py_ssize_t __pyx_t_11;
  long __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;
  Py_ssize_t __pyx_t_20;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("pad_2d_inplace_bool", 0);
  __pyx_pybuffer_values.pybuffer.buf = NULL;
  __pyx_pybuffer_values.refcount = 0;
  __pyx_pybuffernd_values.data = NULL;
  __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values;
  __pyx_pybuffer_mask.pybuffer.buf = NULL;
  __pyx_pybuffer_mask.refcount = 0;
  __pyx_pybuffernd_mask.data = NULL;
  __pyx_pybuffernd_mask.rcbuffer = &__pyx_pybuffer_mask;
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1561; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_values.diminfo[1].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_values.diminfo[1].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[1];
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_mask.rcbuffer->pybuffer, (PyObject*)__pyx_v_mask, &__Pyx_TypeInfo_nn___pyx_t_5numpy_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1561; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_mask.diminfo[0].strides = __pyx_pybuffernd_mask.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_mask.diminfo[0].shape = __pyx_pybuffernd_mask.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_mask.diminfo[1].strides = __pyx_pybuffernd_mask.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_mask.diminfo[1].shape = __pyx_pybuffernd_mask.rcbuffer->pybuffer.shape[1];

  /* "pandas/src/generated.pyx":1566
 *     cdef Py_ssize_t i, j, N, K
 *     cdef uint8_t val
 *     cdef int lim, fill_count = 0             # <<<<<<<<<<<<<<
 * 
 *     K, N = (<object> values).shape
 */
  __pyx_v_fill_count = 0;

  /* "pandas/src/generated.pyx":1568
 *     cdef int lim, fill_count = 0
 * 
 *     K, N = (<object> values).shape             # <<<<<<<<<<<<<<
 * 
 *     # GH 2778
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_values), __pyx_n_s_shape); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1568; __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 CYTHON_COMPILING_IN_CPYTHON
    Py_ssize_t size = Py_SIZE(sequence);
    #else
    Py_ssize_t size = PySequence_Size(sequence);
    #endif
    if (unlikely(size != 2)) {
      if (size > 2) __Pyx_RaiseTooManyValuesError(2);
      else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
      {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1568; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    #if CYTHON_COMPILING_IN_CPYTHON
    if (likely(PyTuple_CheckExact(sequence))) {
      __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); 
      __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1); 
    } else {
      __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);
    #else
    __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1568; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1568; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    #endif
    __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[2]; __pyx_lineno = 1568; __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_L3_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_L3_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_3);
    if (__Pyx_IternextUnpackEndCheck(__pyx_t_5(__pyx_t_4), 2) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1568; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_5 = NULL;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    goto __pyx_L4_unpacking_done;
    __pyx_L3_unpacking_failed:;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_5 = NULL;
    if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
    {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1568; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_L4_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[2]; __pyx_lineno = 1568; __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[2]; __pyx_lineno = 1568; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_v_K = __pyx_t_6;
  __pyx_v_N = __pyx_t_7;

  /* "pandas/src/generated.pyx":1571
 * 
 *     # GH 2778
 *     if N == 0:             # <<<<<<<<<<<<<<
 *         return
 * 
 */
  __pyx_t_8 = ((__pyx_v_N == 0) != 0);
  if (__pyx_t_8) {

    /* "pandas/src/generated.pyx":1572
 *     # GH 2778
 *     if N == 0:
 *         return             # <<<<<<<<<<<<<<
 * 
 *     if limit is None:
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_r = Py_None; __Pyx_INCREF(Py_None);
    goto __pyx_L0;
  }

  /* "pandas/src/generated.pyx":1574
 *         return
 * 
 *     if limit is None:             # <<<<<<<<<<<<<<
 *         lim = N
 *     else:
 */
  __pyx_t_8 = (__pyx_v_limit == Py_None);
  __pyx_t_9 = (__pyx_t_8 != 0);
  if (__pyx_t_9) {

    /* "pandas/src/generated.pyx":1575
 * 
 *     if limit is None:
 *         lim = N             # <<<<<<<<<<<<<<
 *     else:
 *         if limit < 0:
 */
    __pyx_v_lim = __pyx_v_N;
    goto __pyx_L6;
  }
  /*else*/ {

    /* "pandas/src/generated.pyx":1577
 *         lim = N
 *     else:
 *         if limit < 0:             # <<<<<<<<<<<<<<
 *             raise ValueError('Limit must be non-negative')
 *         lim = limit
 */
    __pyx_t_1 = PyObject_RichCompare(__pyx_v_limit, __pyx_int_0, Py_LT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1577; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1577; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (__pyx_t_9) {

      /* "pandas/src/generated.pyx":1578
 *     else:
 *         if limit < 0:
 *             raise ValueError('Limit must be non-negative')             # <<<<<<<<<<<<<<
 *         lim = limit
 * 
 */
      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__91, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1578; __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[2]; __pyx_lineno = 1578; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }

    /* "pandas/src/generated.pyx":1579
 *         if limit < 0:
 *             raise ValueError('Limit must be non-negative')
 *         lim = limit             # <<<<<<<<<<<<<<
 * 
 *     for j in range(K):
 */
    __pyx_t_10 = __Pyx_PyInt_As_int(__pyx_v_limit); if (unlikely((__pyx_t_10 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1579; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_v_lim = __pyx_t_10;
  }
  __pyx_L6:;

  /* "pandas/src/generated.pyx":1581
 *         lim = limit
 * 
 *     for j in range(K):             # <<<<<<<<<<<<<<
 *         fill_count = 0
 *         val = values[j, 0]
 */
  __pyx_t_7 = __pyx_v_K;
  for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_7; __pyx_t_6+=1) {
    __pyx_v_j = __pyx_t_6;

    /* "pandas/src/generated.pyx":1582
 * 
 *     for j in range(K):
 *         fill_count = 0             # <<<<<<<<<<<<<<
 *         val = values[j, 0]
 *         for i in range(N):
 */
    __pyx_v_fill_count = 0;

    /* "pandas/src/generated.pyx":1583
 *     for j in range(K):
 *         fill_count = 0
 *         val = values[j, 0]             # <<<<<<<<<<<<<<
 *         for i in range(N):
 *             if mask[j, i]:
 */
    __pyx_t_11 = __pyx_v_j;
    __pyx_t_12 = 0;
    __pyx_v_val = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_uint8_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_values.diminfo[0].strides, __pyx_t_12, __pyx_pybuffernd_values.diminfo[1].strides));

    /* "pandas/src/generated.pyx":1584
 *         fill_count = 0
 *         val = values[j, 0]
 *         for i in range(N):             # <<<<<<<<<<<<<<
 *             if mask[j, i]:
 *                 if fill_count >= lim:
 */
    __pyx_t_13 = __pyx_v_N;
    for (__pyx_t_14 = 0; __pyx_t_14 < __pyx_t_13; __pyx_t_14+=1) {
      __pyx_v_i = __pyx_t_14;

      /* "pandas/src/generated.pyx":1585
 *         val = values[j, 0]
 *         for i in range(N):
 *             if mask[j, i]:             # <<<<<<<<<<<<<<
 *                 if fill_count >= lim:
 *                     continue
 */
      __pyx_t_15 = __pyx_v_j;
      __pyx_t_16 = __pyx_v_i;
      __pyx_t_9 = ((*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_uint8_t *, __pyx_pybuffernd_mask.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_mask.diminfo[0].strides, __pyx_t_16, __pyx_pybuffernd_mask.diminfo[1].strides)) != 0);
      if (__pyx_t_9) {

        /* "pandas/src/generated.pyx":1586
 *         for i in range(N):
 *             if mask[j, i]:
 *                 if fill_count >= lim:             # <<<<<<<<<<<<<<
 *                     continue
 *                 fill_count += 1
 */
        __pyx_t_9 = ((__pyx_v_fill_count >= __pyx_v_lim) != 0);
        if (__pyx_t_9) {

          /* "pandas/src/generated.pyx":1587
 *             if mask[j, i]:
 *                 if fill_count >= lim:
 *                     continue             # <<<<<<<<<<<<<<
 *                 fill_count += 1
 *                 values[j, i] = val
 */
          goto __pyx_L10_continue;
        }

        /* "pandas/src/generated.pyx":1588
 *                 if fill_count >= lim:
 *                     continue
 *                 fill_count += 1             # <<<<<<<<<<<<<<
 *                 values[j, i] = val
 *             else:
 */
        __pyx_v_fill_count = (__pyx_v_fill_count + 1);

        /* "pandas/src/generated.pyx":1589
 *                     continue
 *                 fill_count += 1
 *                 values[j, i] = val             # <<<<<<<<<<<<<<
 *             else:
 *                 fill_count = 0
 */
        __pyx_t_17 = __pyx_v_j;
        __pyx_t_18 = __pyx_v_i;
        *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_uint8_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_values.diminfo[0].strides, __pyx_t_18, __pyx_pybuffernd_values.diminfo[1].strides) = __pyx_v_val;
        goto __pyx_L12;
      }
      /*else*/ {

        /* "pandas/src/generated.pyx":1591
 *                 values[j, i] = val
 *             else:
 *                 fill_count = 0             # <<<<<<<<<<<<<<
 *                 val = values[j, i]
 * 
 */
        __pyx_v_fill_count = 0;

        /* "pandas/src/generated.pyx":1592
 *             else:
 *                 fill_count = 0
 *                 val = values[j, i]             # <<<<<<<<<<<<<<
 * 
 * @cython.boundscheck(False)
 */
        __pyx_t_19 = __pyx_v_j;
        __pyx_t_20 = __pyx_v_i;
        __pyx_v_val = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_uint8_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_19, __pyx_pybuffernd_values.diminfo[0].strides, __pyx_t_20, __pyx_pybuffernd_values.diminfo[1].strides));
      }
      __pyx_L12:;
      __pyx_L10_continue:;
    }
  }

  /* "pandas/src/generated.pyx":1561
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def pad_2d_inplace_bool(ndarray[uint8_t, ndim=2] values,             # <<<<<<<<<<<<<<
 *                             ndarray[uint8_t, ndim=2] mask,
 *                             limit=None):
 */

  /* function exit code */
  __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_pybuffernd_mask.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas.algos.pad_2d_inplace_bool", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_mask.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer);
  __pyx_L2:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/src/generated.pyx":1596
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def backfill_2d_inplace_float64(ndarray[float64_t, ndim=2] values,             # <<<<<<<<<<<<<<
 *                                  ndarray[uint8_t, ndim=2] mask,
 *                                  limit=None):
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pandas_5algos_175backfill_2d_inplace_float64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_5algos_175backfill_2d_inplace_float64 = {__Pyx_NAMESTR("backfill_2d_inplace_float64"), (PyCFunction)__pyx_pw_6pandas_5algos_175backfill_2d_inplace_float64, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pw_6pandas_5algos_175backfill_2d_inplace_float64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyArrayObject *__pyx_v_values = 0;
  PyArrayObject *__pyx_v_mask = 0;
  PyObject *__pyx_v_limit = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("backfill_2d_inplace_float64 (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_values,&__pyx_n_s_mask,&__pyx_n_s_limit,0};
    PyObject* values[3] = {0,0,0};

    /* "pandas/src/generated.pyx":1598
 * def backfill_2d_inplace_float64(ndarray[float64_t, ndim=2] values,
 *                                  ndarray[uint8_t, ndim=2] mask,
 *                                  limit=None):             # <<<<<<<<<<<<<<
 *     cdef Py_ssize_t i, j, N, K
 *     cdef float64_t val
 */
    values[2] = ((PyObject *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_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 (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_mask)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("backfill_2d_inplace_float64", 0, 2, 3, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1596; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_limit);
          if (value) { values[2] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "backfill_2d_inplace_float64") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1596; __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_mask = ((PyArrayObject *)values[1]);
    __pyx_v_limit = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("backfill_2d_inplace_float64", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1596; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas.algos.backfill_2d_inplace_float64", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1596; __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[2]; __pyx_lineno = 1597; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_174backfill_2d_inplace_float64(__pyx_self, __pyx_v_values, __pyx_v_mask, __pyx_v_limit);

  /* "pandas/src/generated.pyx":1596
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def backfill_2d_inplace_float64(ndarray[float64_t, ndim=2] values,             # <<<<<<<<<<<<<<
 *                                  ndarray[uint8_t, ndim=2] mask,
 *                                  limit=None):
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pandas_5algos_174backfill_2d_inplace_float64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_mask, PyObject *__pyx_v_limit) {
  Py_ssize_t __pyx_v_i;
  Py_ssize_t __pyx_v_j;
  Py_ssize_t __pyx_v_N;
  Py_ssize_t __pyx_v_K;
  __pyx_t_5numpy_float64_t __pyx_v_val;
  int __pyx_v_lim;
  int __pyx_v_fill_count;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_mask;
  __Pyx_Buffer __pyx_pybuffer_mask;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_values;
  __Pyx_Buffer __pyx_pybuffer_values;
  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;
  int __pyx_t_8;
  int __pyx_t_9;
  int __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;
  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("backfill_2d_inplace_float64", 0);
  __pyx_pybuffer_values.pybuffer.buf = NULL;
  __pyx_pybuffer_values.refcount = 0;
  __pyx_pybuffernd_values.data = NULL;
  __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values;
  __pyx_pybuffer_mask.pybuffer.buf = NULL;
  __pyx_pybuffer_mask.refcount = 0;
  __pyx_pybuffernd_mask.data = NULL;
  __pyx_pybuffernd_mask.rcbuffer = &__pyx_pybuffer_mask;
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1596; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_values.diminfo[1].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_values.diminfo[1].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[1];
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_mask.rcbuffer->pybuffer, (PyObject*)__pyx_v_mask, &__Pyx_TypeInfo_nn___pyx_t_5numpy_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1596; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_mask.diminfo[0].strides = __pyx_pybuffernd_mask.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_mask.diminfo[0].shape = __pyx_pybuffernd_mask.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_mask.diminfo[1].strides = __pyx_pybuffernd_mask.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_mask.diminfo[1].shape = __pyx_pybuffernd_mask.rcbuffer->pybuffer.shape[1];

  /* "pandas/src/generated.pyx":1601
 *     cdef Py_ssize_t i, j, N, K
 *     cdef float64_t val
 *     cdef int lim, fill_count = 0             # <<<<<<<<<<<<<<
 * 
 *     K, N = (<object> values).shape
 */
  __pyx_v_fill_count = 0;

  /* "pandas/src/generated.pyx":1603
 *     cdef int lim, fill_count = 0
 * 
 *     K, N = (<object> values).shape             # <<<<<<<<<<<<<<
 * 
 *     # GH 2778
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_values), __pyx_n_s_shape); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1603; __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 CYTHON_COMPILING_IN_CPYTHON
    Py_ssize_t size = Py_SIZE(sequence);
    #else
    Py_ssize_t size = PySequence_Size(sequence);
    #endif
    if (unlikely(size != 2)) {
      if (size > 2) __Pyx_RaiseTooManyValuesError(2);
      else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
      {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1603; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    #if CYTHON_COMPILING_IN_CPYTHON
    if (likely(PyTuple_CheckExact(sequence))) {
      __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); 
      __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1); 
    } else {
      __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);
    #else
    __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1603; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1603; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    #endif
    __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[2]; __pyx_lineno = 1603; __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_L3_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_L3_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_3);
    if (__Pyx_IternextUnpackEndCheck(__pyx_t_5(__pyx_t_4), 2) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1603; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_5 = NULL;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    goto __pyx_L4_unpacking_done;
    __pyx_L3_unpacking_failed:;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_5 = NULL;
    if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
    {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1603; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_L4_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[2]; __pyx_lineno = 1603; __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[2]; __pyx_lineno = 1603; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_v_K = __pyx_t_6;
  __pyx_v_N = __pyx_t_7;

  /* "pandas/src/generated.pyx":1606
 * 
 *     # GH 2778
 *     if N == 0:             # <<<<<<<<<<<<<<
 *         return
 * 
 */
  __pyx_t_8 = ((__pyx_v_N == 0) != 0);
  if (__pyx_t_8) {

    /* "pandas/src/generated.pyx":1607
 *     # GH 2778
 *     if N == 0:
 *         return             # <<<<<<<<<<<<<<
 * 
 *     if limit is None:
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_r = Py_None; __Pyx_INCREF(Py_None);
    goto __pyx_L0;
  }

  /* "pandas/src/generated.pyx":1609
 *         return
 * 
 *     if limit is None:             # <<<<<<<<<<<<<<
 *         lim = N
 *     else:
 */
  __pyx_t_8 = (__pyx_v_limit == Py_None);
  __pyx_t_9 = (__pyx_t_8 != 0);
  if (__pyx_t_9) {

    /* "pandas/src/generated.pyx":1610
 * 
 *     if limit is None:
 *         lim = N             # <<<<<<<<<<<<<<
 *     else:
 *         if limit < 0:
 */
    __pyx_v_lim = __pyx_v_N;
    goto __pyx_L6;
  }
  /*else*/ {

    /* "pandas/src/generated.pyx":1612
 *         lim = N
 *     else:
 *         if limit < 0:             # <<<<<<<<<<<<<<
 *             raise ValueError('Limit must be non-negative')
 *         lim = limit
 */
    __pyx_t_1 = PyObject_RichCompare(__pyx_v_limit, __pyx_int_0, Py_LT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1612; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1612; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (__pyx_t_9) {

      /* "pandas/src/generated.pyx":1613
 *     else:
 *         if limit < 0:
 *             raise ValueError('Limit must be non-negative')             # <<<<<<<<<<<<<<
 *         lim = limit
 * 
 */
      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__92, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1613; __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[2]; __pyx_lineno = 1613; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }

    /* "pandas/src/generated.pyx":1614
 *         if limit < 0:
 *             raise ValueError('Limit must be non-negative')
 *         lim = limit             # <<<<<<<<<<<<<<
 * 
 *     for j in range(K):
 */
    __pyx_t_10 = __Pyx_PyInt_As_int(__pyx_v_limit); if (unlikely((__pyx_t_10 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1614; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_v_lim = __pyx_t_10;
  }
  __pyx_L6:;

  /* "pandas/src/generated.pyx":1616
 *         lim = limit
 * 
 *     for j in range(K):             # <<<<<<<<<<<<<<
 *         fill_count = 0
 *         val = values[j, N - 1]
 */
  __pyx_t_7 = __pyx_v_K;
  for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_7; __pyx_t_6+=1) {
    __pyx_v_j = __pyx_t_6;

    /* "pandas/src/generated.pyx":1617
 * 
 *     for j in range(K):
 *         fill_count = 0             # <<<<<<<<<<<<<<
 *         val = values[j, N - 1]
 *         for i in range(N - 1, -1 , -1):
 */
    __pyx_v_fill_count = 0;

    /* "pandas/src/generated.pyx":1618
 *     for j in range(K):
 *         fill_count = 0
 *         val = values[j, N - 1]             # <<<<<<<<<<<<<<
 *         for i in range(N - 1, -1 , -1):
 *             if mask[j, i]:
 */
    __pyx_t_11 = __pyx_v_j;
    __pyx_t_12 = (__pyx_v_N - 1);
    __pyx_v_val = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_values.diminfo[0].strides, __pyx_t_12, __pyx_pybuffernd_values.diminfo[1].strides));

    /* "pandas/src/generated.pyx":1619
 *         fill_count = 0
 *         val = values[j, N - 1]
 *         for i in range(N - 1, -1 , -1):             # <<<<<<<<<<<<<<
 *             if mask[j, i]:
 *                 if fill_count >= lim:
 */
    for (__pyx_t_13 = (__pyx_v_N - 1); __pyx_t_13 > -1; __pyx_t_13-=1) {
      __pyx_v_i = __pyx_t_13;

      /* "pandas/src/generated.pyx":1620
 *         val = values[j, N - 1]
 *         for i in range(N - 1, -1 , -1):
 *             if mask[j, i]:             # <<<<<<<<<<<<<<
 *                 if fill_count >= lim:
 *                     continue
 */
      __pyx_t_14 = __pyx_v_j;
      __pyx_t_15 = __pyx_v_i;
      __pyx_t_9 = ((*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_uint8_t *, __pyx_pybuffernd_mask.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_mask.diminfo[0].strides, __pyx_t_15, __pyx_pybuffernd_mask.diminfo[1].strides)) != 0);
      if (__pyx_t_9) {

        /* "pandas/src/generated.pyx":1621
 *         for i in range(N - 1, -1 , -1):
 *             if mask[j, i]:
 *                 if fill_count >= lim:             # <<<<<<<<<<<<<<
 *                     continue
 *                 fill_count += 1
 */
        __pyx_t_9 = ((__pyx_v_fill_count >= __pyx_v_lim) != 0);
        if (__pyx_t_9) {

          /* "pandas/src/generated.pyx":1622
 *             if mask[j, i]:
 *                 if fill_count >= lim:
 *                     continue             # <<<<<<<<<<<<<<
 *                 fill_count += 1
 *                 values[j, i] = val
 */
          goto __pyx_L10_continue;
        }

        /* "pandas/src/generated.pyx":1623
 *                 if fill_count >= lim:
 *                     continue
 *                 fill_count += 1             # <<<<<<<<<<<<<<
 *                 values[j, i] = val
 *             else:
 */
        __pyx_v_fill_count = (__pyx_v_fill_count + 1);

        /* "pandas/src/generated.pyx":1624
 *                     continue
 *                 fill_count += 1
 *                 values[j, i] = val             # <<<<<<<<<<<<<<
 *             else:
 *                 fill_count = 0
 */
        __pyx_t_16 = __pyx_v_j;
        __pyx_t_17 = __pyx_v_i;
        *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_values.diminfo[0].strides, __pyx_t_17, __pyx_pybuffernd_values.diminfo[1].strides) = __pyx_v_val;
        goto __pyx_L12;
      }
      /*else*/ {

        /* "pandas/src/generated.pyx":1626
 *                 values[j, i] = val
 *             else:
 *                 fill_count = 0             # <<<<<<<<<<<<<<
 *                 val = values[j, i]
 * @cython.boundscheck(False)
 */
        __pyx_v_fill_count = 0;

        /* "pandas/src/generated.pyx":1627
 *             else:
 *                 fill_count = 0
 *                 val = values[j, i]             # <<<<<<<<<<<<<<
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 */
        __pyx_t_18 = __pyx_v_j;
        __pyx_t_19 = __pyx_v_i;
        __pyx_v_val = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_values.diminfo[0].strides, __pyx_t_19, __pyx_pybuffernd_values.diminfo[1].strides));
      }
      __pyx_L12:;
      __pyx_L10_continue:;
    }
  }

  /* "pandas/src/generated.pyx":1596
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def backfill_2d_inplace_float64(ndarray[float64_t, ndim=2] values,             # <<<<<<<<<<<<<<
 *                                  ndarray[uint8_t, ndim=2] mask,
 *                                  limit=None):
 */

  /* function exit code */
  __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_pybuffernd_mask.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas.algos.backfill_2d_inplace_float64", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_mask.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer);
  __pyx_L2:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/src/generated.pyx":1630
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def backfill_2d_inplace_float32(ndarray[float32_t, ndim=2] values,             # <<<<<<<<<<<<<<
 *                                  ndarray[uint8_t, ndim=2] mask,
 *                                  limit=None):
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pandas_5algos_177backfill_2d_inplace_float32(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_5algos_177backfill_2d_inplace_float32 = {__Pyx_NAMESTR("backfill_2d_inplace_float32"), (PyCFunction)__pyx_pw_6pandas_5algos_177backfill_2d_inplace_float32, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pw_6pandas_5algos_177backfill_2d_inplace_float32(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyArrayObject *__pyx_v_values = 0;
  PyArrayObject *__pyx_v_mask = 0;
  PyObject *__pyx_v_limit = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("backfill_2d_inplace_float32 (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_values,&__pyx_n_s_mask,&__pyx_n_s_limit,0};
    PyObject* values[3] = {0,0,0};

    /* "pandas/src/generated.pyx":1632
 * def backfill_2d_inplace_float32(ndarray[float32_t, ndim=2] values,
 *                                  ndarray[uint8_t, ndim=2] mask,
 *                                  limit=None):             # <<<<<<<<<<<<<<
 *     cdef Py_ssize_t i, j, N, K
 *     cdef float32_t val
 */
    values[2] = ((PyObject *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_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 (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_mask)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("backfill_2d_inplace_float32", 0, 2, 3, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1630; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_limit);
          if (value) { values[2] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "backfill_2d_inplace_float32") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1630; __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_mask = ((PyArrayObject *)values[1]);
    __pyx_v_limit = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("backfill_2d_inplace_float32", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1630; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas.algos.backfill_2d_inplace_float32", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1630; __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[2]; __pyx_lineno = 1631; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_176backfill_2d_inplace_float32(__pyx_self, __pyx_v_values, __pyx_v_mask, __pyx_v_limit);

  /* "pandas/src/generated.pyx":1630
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def backfill_2d_inplace_float32(ndarray[float32_t, ndim=2] values,             # <<<<<<<<<<<<<<
 *                                  ndarray[uint8_t, ndim=2] mask,
 *                                  limit=None):
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pandas_5algos_176backfill_2d_inplace_float32(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_mask, PyObject *__pyx_v_limit) {
  Py_ssize_t __pyx_v_i;
  Py_ssize_t __pyx_v_j;
  Py_ssize_t __pyx_v_N;
  Py_ssize_t __pyx_v_K;
  __pyx_t_5numpy_float32_t __pyx_v_val;
  int __pyx_v_lim;
  int __pyx_v_fill_count;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_mask;
  __Pyx_Buffer __pyx_pybuffer_mask;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_values;
  __Pyx_Buffer __pyx_pybuffer_values;
  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;
  int __pyx_t_8;
  int __pyx_t_9;
  int __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;
  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("backfill_2d_inplace_float32", 0);
  __pyx_pybuffer_values.pybuffer.buf = NULL;
  __pyx_pybuffer_values.refcount = 0;
  __pyx_pybuffernd_values.data = NULL;
  __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values;
  __pyx_pybuffer_mask.pybuffer.buf = NULL;
  __pyx_pybuffer_mask.refcount = 0;
  __pyx_pybuffernd_mask.data = NULL;
  __pyx_pybuffernd_mask.rcbuffer = &__pyx_pybuffer_mask;
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1630; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_values.diminfo[1].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_values.diminfo[1].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[1];
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_mask.rcbuffer->pybuffer, (PyObject*)__pyx_v_mask, &__Pyx_TypeInfo_nn___pyx_t_5numpy_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1630; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_mask.diminfo[0].strides = __pyx_pybuffernd_mask.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_mask.diminfo[0].shape = __pyx_pybuffernd_mask.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_mask.diminfo[1].strides = __pyx_pybuffernd_mask.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_mask.diminfo[1].shape = __pyx_pybuffernd_mask.rcbuffer->pybuffer.shape[1];

  /* "pandas/src/generated.pyx":1635
 *     cdef Py_ssize_t i, j, N, K
 *     cdef float32_t val
 *     cdef int lim, fill_count = 0             # <<<<<<<<<<<<<<
 * 
 *     K, N = (<object> values).shape
 */
  __pyx_v_fill_count = 0;

  /* "pandas/src/generated.pyx":1637
 *     cdef int lim, fill_count = 0
 * 
 *     K, N = (<object> values).shape             # <<<<<<<<<<<<<<
 * 
 *     # GH 2778
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_values), __pyx_n_s_shape); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1637; __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 CYTHON_COMPILING_IN_CPYTHON
    Py_ssize_t size = Py_SIZE(sequence);
    #else
    Py_ssize_t size = PySequence_Size(sequence);
    #endif
    if (unlikely(size != 2)) {
      if (size > 2) __Pyx_RaiseTooManyValuesError(2);
      else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
      {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1637; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    #if CYTHON_COMPILING_IN_CPYTHON
    if (likely(PyTuple_CheckExact(sequence))) {
      __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); 
      __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1); 
    } else {
      __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);
    #else
    __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1637; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1637; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    #endif
    __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[2]; __pyx_lineno = 1637; __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_L3_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_L3_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_3);
    if (__Pyx_IternextUnpackEndCheck(__pyx_t_5(__pyx_t_4), 2) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1637; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_5 = NULL;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    goto __pyx_L4_unpacking_done;
    __pyx_L3_unpacking_failed:;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_5 = NULL;
    if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
    {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1637; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_L4_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[2]; __pyx_lineno = 1637; __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[2]; __pyx_lineno = 1637; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_v_K = __pyx_t_6;
  __pyx_v_N = __pyx_t_7;

  /* "pandas/src/generated.pyx":1640
 * 
 *     # GH 2778
 *     if N == 0:             # <<<<<<<<<<<<<<
 *         return
 * 
 */
  __pyx_t_8 = ((__pyx_v_N == 0) != 0);
  if (__pyx_t_8) {

    /* "pandas/src/generated.pyx":1641
 *     # GH 2778
 *     if N == 0:
 *         return             # <<<<<<<<<<<<<<
 * 
 *     if limit is None:
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_r = Py_None; __Pyx_INCREF(Py_None);
    goto __pyx_L0;
  }

  /* "pandas/src/generated.pyx":1643
 *         return
 * 
 *     if limit is None:             # <<<<<<<<<<<<<<
 *         lim = N
 *     else:
 */
  __pyx_t_8 = (__pyx_v_limit == Py_None);
  __pyx_t_9 = (__pyx_t_8 != 0);
  if (__pyx_t_9) {

    /* "pandas/src/generated.pyx":1644
 * 
 *     if limit is None:
 *         lim = N             # <<<<<<<<<<<<<<
 *     else:
 *         if limit < 0:
 */
    __pyx_v_lim = __pyx_v_N;
    goto __pyx_L6;
  }
  /*else*/ {

    /* "pandas/src/generated.pyx":1646
 *         lim = N
 *     else:
 *         if limit < 0:             # <<<<<<<<<<<<<<
 *             raise ValueError('Limit must be non-negative')
 *         lim = limit
 */
    __pyx_t_1 = PyObject_RichCompare(__pyx_v_limit, __pyx_int_0, Py_LT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1646; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1646; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (__pyx_t_9) {

      /* "pandas/src/generated.pyx":1647
 *     else:
 *         if limit < 0:
 *             raise ValueError('Limit must be non-negative')             # <<<<<<<<<<<<<<
 *         lim = limit
 * 
 */
      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__93, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1647; __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[2]; __pyx_lineno = 1647; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }

    /* "pandas/src/generated.pyx":1648
 *         if limit < 0:
 *             raise ValueError('Limit must be non-negative')
 *         lim = limit             # <<<<<<<<<<<<<<
 * 
 *     for j in range(K):
 */
    __pyx_t_10 = __Pyx_PyInt_As_int(__pyx_v_limit); if (unlikely((__pyx_t_10 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1648; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_v_lim = __pyx_t_10;
  }
  __pyx_L6:;

  /* "pandas/src/generated.pyx":1650
 *         lim = limit
 * 
 *     for j in range(K):             # <<<<<<<<<<<<<<
 *         fill_count = 0
 *         val = values[j, N - 1]
 */
  __pyx_t_7 = __pyx_v_K;
  for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_7; __pyx_t_6+=1) {
    __pyx_v_j = __pyx_t_6;

    /* "pandas/src/generated.pyx":1651
 * 
 *     for j in range(K):
 *         fill_count = 0             # <<<<<<<<<<<<<<
 *         val = values[j, N - 1]
 *         for i in range(N - 1, -1 , -1):
 */
    __pyx_v_fill_count = 0;

    /* "pandas/src/generated.pyx":1652
 *     for j in range(K):
 *         fill_count = 0
 *         val = values[j, N - 1]             # <<<<<<<<<<<<<<
 *         for i in range(N - 1, -1 , -1):
 *             if mask[j, i]:
 */
    __pyx_t_11 = __pyx_v_j;
    __pyx_t_12 = (__pyx_v_N - 1);
    __pyx_v_val = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_values.diminfo[0].strides, __pyx_t_12, __pyx_pybuffernd_values.diminfo[1].strides));

    /* "pandas/src/generated.pyx":1653
 *         fill_count = 0
 *         val = values[j, N - 1]
 *         for i in range(N - 1, -1 , -1):             # <<<<<<<<<<<<<<
 *             if mask[j, i]:
 *                 if fill_count >= lim:
 */
    for (__pyx_t_13 = (__pyx_v_N - 1); __pyx_t_13 > -1; __pyx_t_13-=1) {
      __pyx_v_i = __pyx_t_13;

      /* "pandas/src/generated.pyx":1654
 *         val = values[j, N - 1]
 *         for i in range(N - 1, -1 , -1):
 *             if mask[j, i]:             # <<<<<<<<<<<<<<
 *                 if fill_count >= lim:
 *                     continue
 */
      __pyx_t_14 = __pyx_v_j;
      __pyx_t_15 = __pyx_v_i;
      __pyx_t_9 = ((*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_uint8_t *, __pyx_pybuffernd_mask.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_mask.diminfo[0].strides, __pyx_t_15, __pyx_pybuffernd_mask.diminfo[1].strides)) != 0);
      if (__pyx_t_9) {

        /* "pandas/src/generated.pyx":1655
 *         for i in range(N - 1, -1 , -1):
 *             if mask[j, i]:
 *                 if fill_count >= lim:             # <<<<<<<<<<<<<<
 *                     continue
 *                 fill_count += 1
 */
        __pyx_t_9 = ((__pyx_v_fill_count >= __pyx_v_lim) != 0);
        if (__pyx_t_9) {

          /* "pandas/src/generated.pyx":1656
 *             if mask[j, i]:
 *                 if fill_count >= lim:
 *                     continue             # <<<<<<<<<<<<<<
 *                 fill_count += 1
 *                 values[j, i] = val
 */
          goto __pyx_L10_continue;
        }

        /* "pandas/src/generated.pyx":1657
 *                 if fill_count >= lim:
 *                     continue
 *                 fill_count += 1             # <<<<<<<<<<<<<<
 *                 values[j, i] = val
 *             else:
 */
        __pyx_v_fill_count = (__pyx_v_fill_count + 1);

        /* "pandas/src/generated.pyx":1658
 *                     continue
 *                 fill_count += 1
 *                 values[j, i] = val             # <<<<<<<<<<<<<<
 *             else:
 *                 fill_count = 0
 */
        __pyx_t_16 = __pyx_v_j;
        __pyx_t_17 = __pyx_v_i;
        *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_values.diminfo[0].strides, __pyx_t_17, __pyx_pybuffernd_values.diminfo[1].strides) = __pyx_v_val;
        goto __pyx_L12;
      }
      /*else*/ {

        /* "pandas/src/generated.pyx":1660
 *                 values[j, i] = val
 *             else:
 *                 fill_count = 0             # <<<<<<<<<<<<<<
 *                 val = values[j, i]
 * @cython.boundscheck(False)
 */
        __pyx_v_fill_count = 0;

        /* "pandas/src/generated.pyx":1661
 *             else:
 *                 fill_count = 0
 *                 val = values[j, i]             # <<<<<<<<<<<<<<
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 */
        __pyx_t_18 = __pyx_v_j;
        __pyx_t_19 = __pyx_v_i;
        __pyx_v_val = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_values.diminfo[0].strides, __pyx_t_19, __pyx_pybuffernd_values.diminfo[1].strides));
      }
      __pyx_L12:;
      __pyx_L10_continue:;
    }
  }

  /* "pandas/src/generated.pyx":1630
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def backfill_2d_inplace_float32(ndarray[float32_t, ndim=2] values,             # <<<<<<<<<<<<<<
 *                                  ndarray[uint8_t, ndim=2] mask,
 *                                  limit=None):
 */

  /* function exit code */
  __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_pybuffernd_mask.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas.algos.backfill_2d_inplace_float32", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_mask.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer);
  __pyx_L2:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/src/generated.pyx":1664
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def backfill_2d_inplace_object(ndarray[object, ndim=2] values,             # <<<<<<<<<<<<<<
 *                                  ndarray[uint8_t, ndim=2] mask,
 *                                  limit=None):
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pandas_5algos_179backfill_2d_inplace_object(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_5algos_179backfill_2d_inplace_object = {__Pyx_NAMESTR("backfill_2d_inplace_object"), (PyCFunction)__pyx_pw_6pandas_5algos_179backfill_2d_inplace_object, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pw_6pandas_5algos_179backfill_2d_inplace_object(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyArrayObject *__pyx_v_values = 0;
  PyArrayObject *__pyx_v_mask = 0;
  PyObject *__pyx_v_limit = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("backfill_2d_inplace_object (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_values,&__pyx_n_s_mask,&__pyx_n_s_limit,0};
    PyObject* values[3] = {0,0,0};

    /* "pandas/src/generated.pyx":1666
 * def backfill_2d_inplace_object(ndarray[object, ndim=2] values,
 *                                  ndarray[uint8_t, ndim=2] mask,
 *                                  limit=None):             # <<<<<<<<<<<<<<
 *     cdef Py_ssize_t i, j, N, K
 *     cdef object val
 */
    values[2] = ((PyObject *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_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 (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_mask)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("backfill_2d_inplace_object", 0, 2, 3, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1664; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_limit);
          if (value) { values[2] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "backfill_2d_inplace_object") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1664; __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_mask = ((PyArrayObject *)values[1]);
    __pyx_v_limit = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("backfill_2d_inplace_object", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1664; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas.algos.backfill_2d_inplace_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1664; __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[2]; __pyx_lineno = 1665; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_178backfill_2d_inplace_object(__pyx_self, __pyx_v_values, __pyx_v_mask, __pyx_v_limit);

  /* "pandas/src/generated.pyx":1664
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def backfill_2d_inplace_object(ndarray[object, ndim=2] values,             # <<<<<<<<<<<<<<
 *                                  ndarray[uint8_t, ndim=2] mask,
 *                                  limit=None):
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pandas_5algos_178backfill_2d_inplace_object(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_mask, PyObject *__pyx_v_limit) {
  Py_ssize_t __pyx_v_i;
  Py_ssize_t __pyx_v_j;
  Py_ssize_t __pyx_v_N;
  Py_ssize_t __pyx_v_K;
  PyObject *__pyx_v_val = 0;
  int __pyx_v_lim;
  int __pyx_v_fill_count;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_mask;
  __Pyx_Buffer __pyx_pybuffer_mask;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_values;
  __Pyx_Buffer __pyx_pybuffer_values;
  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;
  int __pyx_t_8;
  int __pyx_t_9;
  int __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;
  Py_ssize_t __pyx_t_16;
  Py_ssize_t __pyx_t_17;
  PyObject **__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;
  __Pyx_RefNannySetupContext("backfill_2d_inplace_object", 0);
  __pyx_pybuffer_values.pybuffer.buf = NULL;
  __pyx_pybuffer_values.refcount = 0;
  __pyx_pybuffernd_values.data = NULL;
  __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values;
  __pyx_pybuffer_mask.pybuffer.buf = NULL;
  __pyx_pybuffer_mask.refcount = 0;
  __pyx_pybuffernd_mask.data = NULL;
  __pyx_pybuffernd_mask.rcbuffer = &__pyx_pybuffer_mask;
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1664; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_values.diminfo[1].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_values.diminfo[1].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[1];
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_mask.rcbuffer->pybuffer, (PyObject*)__pyx_v_mask, &__Pyx_TypeInfo_nn___pyx_t_5numpy_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1664; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_mask.diminfo[0].strides = __pyx_pybuffernd_mask.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_mask.diminfo[0].shape = __pyx_pybuffernd_mask.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_mask.diminfo[1].strides = __pyx_pybuffernd_mask.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_mask.diminfo[1].shape = __pyx_pybuffernd_mask.rcbuffer->pybuffer.shape[1];

  /* "pandas/src/generated.pyx":1669
 *     cdef Py_ssize_t i, j, N, K
 *     cdef object val
 *     cdef int lim, fill_count = 0             # <<<<<<<<<<<<<<
 * 
 *     K, N = (<object> values).shape
 */
  __pyx_v_fill_count = 0;

  /* "pandas/src/generated.pyx":1671
 *     cdef int lim, fill_count = 0
 * 
 *     K, N = (<object> values).shape             # <<<<<<<<<<<<<<
 * 
 *     # GH 2778
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_values), __pyx_n_s_shape); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1671; __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 CYTHON_COMPILING_IN_CPYTHON
    Py_ssize_t size = Py_SIZE(sequence);
    #else
    Py_ssize_t size = PySequence_Size(sequence);
    #endif
    if (unlikely(size != 2)) {
      if (size > 2) __Pyx_RaiseTooManyValuesError(2);
      else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
      {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1671; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    #if CYTHON_COMPILING_IN_CPYTHON
    if (likely(PyTuple_CheckExact(sequence))) {
      __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); 
      __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1); 
    } else {
      __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);
    #else
    __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1671; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1671; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    #endif
    __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[2]; __pyx_lineno = 1671; __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_L3_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_L3_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_3);
    if (__Pyx_IternextUnpackEndCheck(__pyx_t_5(__pyx_t_4), 2) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1671; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_5 = NULL;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    goto __pyx_L4_unpacking_done;
    __pyx_L3_unpacking_failed:;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_5 = NULL;
    if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
    {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1671; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_L4_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[2]; __pyx_lineno = 1671; __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[2]; __pyx_lineno = 1671; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_v_K = __pyx_t_6;
  __pyx_v_N = __pyx_t_7;

  /* "pandas/src/generated.pyx":1674
 * 
 *     # GH 2778
 *     if N == 0:             # <<<<<<<<<<<<<<
 *         return
 * 
 */
  __pyx_t_8 = ((__pyx_v_N == 0) != 0);
  if (__pyx_t_8) {

    /* "pandas/src/generated.pyx":1675
 *     # GH 2778
 *     if N == 0:
 *         return             # <<<<<<<<<<<<<<
 * 
 *     if limit is None:
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_r = Py_None; __Pyx_INCREF(Py_None);
    goto __pyx_L0;
  }

  /* "pandas/src/generated.pyx":1677
 *         return
 * 
 *     if limit is None:             # <<<<<<<<<<<<<<
 *         lim = N
 *     else:
 */
  __pyx_t_8 = (__pyx_v_limit == Py_None);
  __pyx_t_9 = (__pyx_t_8 != 0);
  if (__pyx_t_9) {

    /* "pandas/src/generated.pyx":1678
 * 
 *     if limit is None:
 *         lim = N             # <<<<<<<<<<<<<<
 *     else:
 *         if limit < 0:
 */
    __pyx_v_lim = __pyx_v_N;
    goto __pyx_L6;
  }
  /*else*/ {

    /* "pandas/src/generated.pyx":1680
 *         lim = N
 *     else:
 *         if limit < 0:             # <<<<<<<<<<<<<<
 *             raise ValueError('Limit must be non-negative')
 *         lim = limit
 */
    __pyx_t_1 = PyObject_RichCompare(__pyx_v_limit, __pyx_int_0, Py_LT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1680; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1680; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (__pyx_t_9) {

      /* "pandas/src/generated.pyx":1681
 *     else:
 *         if limit < 0:
 *             raise ValueError('Limit must be non-negative')             # <<<<<<<<<<<<<<
 *         lim = limit
 * 
 */
      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__94, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1681; __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[2]; __pyx_lineno = 1681; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }

    /* "pandas/src/generated.pyx":1682
 *         if limit < 0:
 *             raise ValueError('Limit must be non-negative')
 *         lim = limit             # <<<<<<<<<<<<<<
 * 
 *     for j in range(K):
 */
    __pyx_t_10 = __Pyx_PyInt_As_int(__pyx_v_limit); if (unlikely((__pyx_t_10 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1682; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_v_lim = __pyx_t_10;
  }
  __pyx_L6:;

  /* "pandas/src/generated.pyx":1684
 *         lim = limit
 * 
 *     for j in range(K):             # <<<<<<<<<<<<<<
 *         fill_count = 0
 *         val = values[j, N - 1]
 */
  __pyx_t_7 = __pyx_v_K;
  for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_7; __pyx_t_6+=1) {
    __pyx_v_j = __pyx_t_6;

    /* "pandas/src/generated.pyx":1685
 * 
 *     for j in range(K):
 *         fill_count = 0             # <<<<<<<<<<<<<<
 *         val = values[j, N - 1]
 *         for i in range(N - 1, -1 , -1):
 */
    __pyx_v_fill_count = 0;

    /* "pandas/src/generated.pyx":1686
 *     for j in range(K):
 *         fill_count = 0
 *         val = values[j, N - 1]             # <<<<<<<<<<<<<<
 *         for i in range(N - 1, -1 , -1):
 *             if mask[j, i]:
 */
    __pyx_t_11 = __pyx_v_j;
    __pyx_t_12 = (__pyx_v_N - 1);
    __pyx_t_1 = (PyObject *) *__Pyx_BufPtrStrided2d(PyObject **, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_values.diminfo[0].strides, __pyx_t_12, __pyx_pybuffernd_values.diminfo[1].strides);
    __Pyx_INCREF((PyObject*)__pyx_t_1);
    __Pyx_XDECREF_SET(__pyx_v_val, __pyx_t_1);
    __pyx_t_1 = 0;

    /* "pandas/src/generated.pyx":1687
 *         fill_count = 0
 *         val = values[j, N - 1]
 *         for i in range(N - 1, -1 , -1):             # <<<<<<<<<<<<<<
 *             if mask[j, i]:
 *                 if fill_count >= lim:
 */
    for (__pyx_t_13 = (__pyx_v_N - 1); __pyx_t_13 > -1; __pyx_t_13-=1) {
      __pyx_v_i = __pyx_t_13;

      /* "pandas/src/generated.pyx":1688
 *         val = values[j, N - 1]
 *         for i in range(N - 1, -1 , -1):
 *             if mask[j, i]:             # <<<<<<<<<<<<<<
 *                 if fill_count >= lim:
 *                     continue
 */
      __pyx_t_14 = __pyx_v_j;
      __pyx_t_15 = __pyx_v_i;
      __pyx_t_9 = ((*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_uint8_t *, __pyx_pybuffernd_mask.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_mask.diminfo[0].strides, __pyx_t_15, __pyx_pybuffernd_mask.diminfo[1].strides)) != 0);
      if (__pyx_t_9) {

        /* "pandas/src/generated.pyx":1689
 *         for i in range(N - 1, -1 , -1):
 *             if mask[j, i]:
 *                 if fill_count >= lim:             # <<<<<<<<<<<<<<
 *                     continue
 *                 fill_count += 1
 */
        __pyx_t_9 = ((__pyx_v_fill_count >= __pyx_v_lim) != 0);
        if (__pyx_t_9) {

          /* "pandas/src/generated.pyx":1690
 *             if mask[j, i]:
 *                 if fill_count >= lim:
 *                     continue             # <<<<<<<<<<<<<<
 *                 fill_count += 1
 *                 values[j, i] = val
 */
          goto __pyx_L10_continue;
        }

        /* "pandas/src/generated.pyx":1691
 *                 if fill_count >= lim:
 *                     continue
 *                 fill_count += 1             # <<<<<<<<<<<<<<
 *                 values[j, i] = val
 *             else:
 */
        __pyx_v_fill_count = (__pyx_v_fill_count + 1);

        /* "pandas/src/generated.pyx":1692
 *                     continue
 *                 fill_count += 1
 *                 values[j, i] = val             # <<<<<<<<<<<<<<
 *             else:
 *                 fill_count = 0
 */
        __pyx_t_16 = __pyx_v_j;
        __pyx_t_17 = __pyx_v_i;
        __pyx_t_18 = __Pyx_BufPtrStrided2d(PyObject **, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_values.diminfo[0].strides, __pyx_t_17, __pyx_pybuffernd_values.diminfo[1].strides);
        __Pyx_GOTREF(*__pyx_t_18);
        __Pyx_INCREF(__pyx_v_val); __Pyx_DECREF(*__pyx_t_18);
        *__pyx_t_18 = __pyx_v_val;
        __Pyx_GIVEREF(*__pyx_t_18);
        goto __pyx_L12;
      }
      /*else*/ {

        /* "pandas/src/generated.pyx":1694
 *                 values[j, i] = val
 *             else:
 *                 fill_count = 0             # <<<<<<<<<<<<<<
 *                 val = values[j, i]
 * @cython.boundscheck(False)
 */
        __pyx_v_fill_count = 0;

        /* "pandas/src/generated.pyx":1695
 *             else:
 *                 fill_count = 0
 *                 val = values[j, i]             # <<<<<<<<<<<<<<
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 */
        __pyx_t_19 = __pyx_v_j;
        __pyx_t_20 = __pyx_v_i;
        __pyx_t_1 = (PyObject *) *__Pyx_BufPtrStrided2d(PyObject **, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_19, __pyx_pybuffernd_values.diminfo[0].strides, __pyx_t_20, __pyx_pybuffernd_values.diminfo[1].strides);
        __Pyx_INCREF((PyObject*)__pyx_t_1);
        __Pyx_DECREF_SET(__pyx_v_val, __pyx_t_1);
        __pyx_t_1 = 0;
      }
      __pyx_L12:;
      __pyx_L10_continue:;
    }
  }

  /* "pandas/src/generated.pyx":1664
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def backfill_2d_inplace_object(ndarray[object, ndim=2] values,             # <<<<<<<<<<<<<<
 *                                  ndarray[uint8_t, ndim=2] mask,
 *                                  limit=None):
 */

  /* function exit code */
  __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_pybuffernd_mask.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas.algos.backfill_2d_inplace_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_mask.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer);
  __pyx_L2:;
  __Pyx_XDECREF(__pyx_v_val);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/src/generated.pyx":1698
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def backfill_2d_inplace_int32(ndarray[int32_t, ndim=2] values,             # <<<<<<<<<<<<<<
 *                                  ndarray[uint8_t, ndim=2] mask,
 *                                  limit=None):
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pandas_5algos_181backfill_2d_inplace_int32(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_5algos_181backfill_2d_inplace_int32 = {__Pyx_NAMESTR("backfill_2d_inplace_int32"), (PyCFunction)__pyx_pw_6pandas_5algos_181backfill_2d_inplace_int32, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pw_6pandas_5algos_181backfill_2d_inplace_int32(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyArrayObject *__pyx_v_values = 0;
  PyArrayObject *__pyx_v_mask = 0;
  PyObject *__pyx_v_limit = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("backfill_2d_inplace_int32 (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_values,&__pyx_n_s_mask,&__pyx_n_s_limit,0};
    PyObject* values[3] = {0,0,0};

    /* "pandas/src/generated.pyx":1700
 * def backfill_2d_inplace_int32(ndarray[int32_t, ndim=2] values,
 *                                  ndarray[uint8_t, ndim=2] mask,
 *                                  limit=None):             # <<<<<<<<<<<<<<
 *     cdef Py_ssize_t i, j, N, K
 *     cdef int32_t val
 */
    values[2] = ((PyObject *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_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 (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_mask)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("backfill_2d_inplace_int32", 0, 2, 3, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1698; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_limit);
          if (value) { values[2] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "backfill_2d_inplace_int32") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1698; __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_mask = ((PyArrayObject *)values[1]);
    __pyx_v_limit = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("backfill_2d_inplace_int32", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1698; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas.algos.backfill_2d_inplace_int32", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1698; __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[2]; __pyx_lineno = 1699; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_180backfill_2d_inplace_int32(__pyx_self, __pyx_v_values, __pyx_v_mask, __pyx_v_limit);

  /* "pandas/src/generated.pyx":1698
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def backfill_2d_inplace_int32(ndarray[int32_t, ndim=2] values,             # <<<<<<<<<<<<<<
 *                                  ndarray[uint8_t, ndim=2] mask,
 *                                  limit=None):
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pandas_5algos_180backfill_2d_inplace_int32(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_mask, PyObject *__pyx_v_limit) {
  Py_ssize_t __pyx_v_i;
  Py_ssize_t __pyx_v_j;
  Py_ssize_t __pyx_v_N;
  Py_ssize_t __pyx_v_K;
  __pyx_t_5numpy_int32_t __pyx_v_val;
  int __pyx_v_lim;
  int __pyx_v_fill_count;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_mask;
  __Pyx_Buffer __pyx_pybuffer_mask;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_values;
  __Pyx_Buffer __pyx_pybuffer_values;
  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;
  int __pyx_t_8;
  int __pyx_t_9;
  int __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;
  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("backfill_2d_inplace_int32", 0);
  __pyx_pybuffer_values.pybuffer.buf = NULL;
  __pyx_pybuffer_values.refcount = 0;
  __pyx_pybuffernd_values.data = NULL;
  __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values;
  __pyx_pybuffer_mask.pybuffer.buf = NULL;
  __pyx_pybuffer_mask.refcount = 0;
  __pyx_pybuffernd_mask.data = NULL;
  __pyx_pybuffernd_mask.rcbuffer = &__pyx_pybuffer_mask;
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1698; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_values.diminfo[1].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_values.diminfo[1].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[1];
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_mask.rcbuffer->pybuffer, (PyObject*)__pyx_v_mask, &__Pyx_TypeInfo_nn___pyx_t_5numpy_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1698; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_mask.diminfo[0].strides = __pyx_pybuffernd_mask.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_mask.diminfo[0].shape = __pyx_pybuffernd_mask.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_mask.diminfo[1].strides = __pyx_pybuffernd_mask.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_mask.diminfo[1].shape = __pyx_pybuffernd_mask.rcbuffer->pybuffer.shape[1];

  /* "pandas/src/generated.pyx":1703
 *     cdef Py_ssize_t i, j, N, K
 *     cdef int32_t val
 *     cdef int lim, fill_count = 0             # <<<<<<<<<<<<<<
 * 
 *     K, N = (<object> values).shape
 */
  __pyx_v_fill_count = 0;

  /* "pandas/src/generated.pyx":1705
 *     cdef int lim, fill_count = 0
 * 
 *     K, N = (<object> values).shape             # <<<<<<<<<<<<<<
 * 
 *     # GH 2778
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_values), __pyx_n_s_shape); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1705; __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 CYTHON_COMPILING_IN_CPYTHON
    Py_ssize_t size = Py_SIZE(sequence);
    #else
    Py_ssize_t size = PySequence_Size(sequence);
    #endif
    if (unlikely(size != 2)) {
      if (size > 2) __Pyx_RaiseTooManyValuesError(2);
      else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
      {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1705; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    #if CYTHON_COMPILING_IN_CPYTHON
    if (likely(PyTuple_CheckExact(sequence))) {
      __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); 
      __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1); 
    } else {
      __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);
    #else
    __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1705; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1705; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    #endif
    __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[2]; __pyx_lineno = 1705; __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_L3_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_L3_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_3);
    if (__Pyx_IternextUnpackEndCheck(__pyx_t_5(__pyx_t_4), 2) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1705; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_5 = NULL;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    goto __pyx_L4_unpacking_done;
    __pyx_L3_unpacking_failed:;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_5 = NULL;
    if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
    {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1705; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_L4_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[2]; __pyx_lineno = 1705; __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[2]; __pyx_lineno = 1705; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_v_K = __pyx_t_6;
  __pyx_v_N = __pyx_t_7;

  /* "pandas/src/generated.pyx":1708
 * 
 *     # GH 2778
 *     if N == 0:             # <<<<<<<<<<<<<<
 *         return
 * 
 */
  __pyx_t_8 = ((__pyx_v_N == 0) != 0);
  if (__pyx_t_8) {

    /* "pandas/src/generated.pyx":1709
 *     # GH 2778
 *     if N == 0:
 *         return             # <<<<<<<<<<<<<<
 * 
 *     if limit is None:
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_r = Py_None; __Pyx_INCREF(Py_None);
    goto __pyx_L0;
  }

  /* "pandas/src/generated.pyx":1711
 *         return
 * 
 *     if limit is None:             # <<<<<<<<<<<<<<
 *         lim = N
 *     else:
 */
  __pyx_t_8 = (__pyx_v_limit == Py_None);
  __pyx_t_9 = (__pyx_t_8 != 0);
  if (__pyx_t_9) {

    /* "pandas/src/generated.pyx":1712
 * 
 *     if limit is None:
 *         lim = N             # <<<<<<<<<<<<<<
 *     else:
 *         if limit < 0:
 */
    __pyx_v_lim = __pyx_v_N;
    goto __pyx_L6;
  }
  /*else*/ {

    /* "pandas/src/generated.pyx":1714
 *         lim = N
 *     else:
 *         if limit < 0:             # <<<<<<<<<<<<<<
 *             raise ValueError('Limit must be non-negative')
 *         lim = limit
 */
    __pyx_t_1 = PyObject_RichCompare(__pyx_v_limit, __pyx_int_0, Py_LT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1714; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1714; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (__pyx_t_9) {

      /* "pandas/src/generated.pyx":1715
 *     else:
 *         if limit < 0:
 *             raise ValueError('Limit must be non-negative')             # <<<<<<<<<<<<<<
 *         lim = limit
 * 
 */
      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__95, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1715; __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[2]; __pyx_lineno = 1715; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }

    /* "pandas/src/generated.pyx":1716
 *         if limit < 0:
 *             raise ValueError('Limit must be non-negative')
 *         lim = limit             # <<<<<<<<<<<<<<
 * 
 *     for j in range(K):
 */
    __pyx_t_10 = __Pyx_PyInt_As_int(__pyx_v_limit); if (unlikely((__pyx_t_10 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1716; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_v_lim = __pyx_t_10;
  }
  __pyx_L6:;

  /* "pandas/src/generated.pyx":1718
 *         lim = limit
 * 
 *     for j in range(K):             # <<<<<<<<<<<<<<
 *         fill_count = 0
 *         val = values[j, N - 1]
 */
  __pyx_t_7 = __pyx_v_K;
  for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_7; __pyx_t_6+=1) {
    __pyx_v_j = __pyx_t_6;

    /* "pandas/src/generated.pyx":1719
 * 
 *     for j in range(K):
 *         fill_count = 0             # <<<<<<<<<<<<<<
 *         val = values[j, N - 1]
 *         for i in range(N - 1, -1 , -1):
 */
    __pyx_v_fill_count = 0;

    /* "pandas/src/generated.pyx":1720
 *     for j in range(K):
 *         fill_count = 0
 *         val = values[j, N - 1]             # <<<<<<<<<<<<<<
 *         for i in range(N - 1, -1 , -1):
 *             if mask[j, i]:
 */
    __pyx_t_11 = __pyx_v_j;
    __pyx_t_12 = (__pyx_v_N - 1);
    __pyx_v_val = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_values.diminfo[0].strides, __pyx_t_12, __pyx_pybuffernd_values.diminfo[1].strides));

    /* "pandas/src/generated.pyx":1721
 *         fill_count = 0
 *         val = values[j, N - 1]
 *         for i in range(N - 1, -1 , -1):             # <<<<<<<<<<<<<<
 *             if mask[j, i]:
 *                 if fill_count >= lim:
 */
    for (__pyx_t_13 = (__pyx_v_N - 1); __pyx_t_13 > -1; __pyx_t_13-=1) {
      __pyx_v_i = __pyx_t_13;

      /* "pandas/src/generated.pyx":1722
 *         val = values[j, N - 1]
 *         for i in range(N - 1, -1 , -1):
 *             if mask[j, i]:             # <<<<<<<<<<<<<<
 *                 if fill_count >= lim:
 *                     continue
 */
      __pyx_t_14 = __pyx_v_j;
      __pyx_t_15 = __pyx_v_i;
      __pyx_t_9 = ((*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_uint8_t *, __pyx_pybuffernd_mask.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_mask.diminfo[0].strides, __pyx_t_15, __pyx_pybuffernd_mask.diminfo[1].strides)) != 0);
      if (__pyx_t_9) {

        /* "pandas/src/generated.pyx":1723
 *         for i in range(N - 1, -1 , -1):
 *             if mask[j, i]:
 *                 if fill_count >= lim:             # <<<<<<<<<<<<<<
 *                     continue
 *                 fill_count += 1
 */
        __pyx_t_9 = ((__pyx_v_fill_count >= __pyx_v_lim) != 0);
        if (__pyx_t_9) {

          /* "pandas/src/generated.pyx":1724
 *             if mask[j, i]:
 *                 if fill_count >= lim:
 *                     continue             # <<<<<<<<<<<<<<
 *                 fill_count += 1
 *                 values[j, i] = val
 */
          goto __pyx_L10_continue;
        }

        /* "pandas/src/generated.pyx":1725
 *                 if fill_count >= lim:
 *                     continue
 *                 fill_count += 1             # <<<<<<<<<<<<<<
 *                 values[j, i] = val
 *             else:
 */
        __pyx_v_fill_count = (__pyx_v_fill_count + 1);

        /* "pandas/src/generated.pyx":1726
 *                     continue
 *                 fill_count += 1
 *                 values[j, i] = val             # <<<<<<<<<<<<<<
 *             else:
 *                 fill_count = 0
 */
        __pyx_t_16 = __pyx_v_j;
        __pyx_t_17 = __pyx_v_i;
        *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_values.diminfo[0].strides, __pyx_t_17, __pyx_pybuffernd_values.diminfo[1].strides) = __pyx_v_val;
        goto __pyx_L12;
      }
      /*else*/ {

        /* "pandas/src/generated.pyx":1728
 *                 values[j, i] = val
 *             else:
 *                 fill_count = 0             # <<<<<<<<<<<<<<
 *                 val = values[j, i]
 * @cython.boundscheck(False)
 */
        __pyx_v_fill_count = 0;

        /* "pandas/src/generated.pyx":1729
 *             else:
 *                 fill_count = 0
 *                 val = values[j, i]             # <<<<<<<<<<<<<<
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 */
        __pyx_t_18 = __pyx_v_j;
        __pyx_t_19 = __pyx_v_i;
        __pyx_v_val = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_values.diminfo[0].strides, __pyx_t_19, __pyx_pybuffernd_values.diminfo[1].strides));
      }
      __pyx_L12:;
      __pyx_L10_continue:;
    }
  }

  /* "pandas/src/generated.pyx":1698
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def backfill_2d_inplace_int32(ndarray[int32_t, ndim=2] values,             # <<<<<<<<<<<<<<
 *                                  ndarray[uint8_t, ndim=2] mask,
 *                                  limit=None):
 */

  /* function exit code */
  __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_pybuffernd_mask.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas.algos.backfill_2d_inplace_int32", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_mask.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer);
  __pyx_L2:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/src/generated.pyx":1732
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def backfill_2d_inplace_int64(ndarray[int64_t, ndim=2] values,             # <<<<<<<<<<<<<<
 *                                  ndarray[uint8_t, ndim=2] mask,
 *                                  limit=None):
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pandas_5algos_183backfill_2d_inplace_int64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_5algos_183backfill_2d_inplace_int64 = {__Pyx_NAMESTR("backfill_2d_inplace_int64"), (PyCFunction)__pyx_pw_6pandas_5algos_183backfill_2d_inplace_int64, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pw_6pandas_5algos_183backfill_2d_inplace_int64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyArrayObject *__pyx_v_values = 0;
  PyArrayObject *__pyx_v_mask = 0;
  PyObject *__pyx_v_limit = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("backfill_2d_inplace_int64 (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_values,&__pyx_n_s_mask,&__pyx_n_s_limit,0};
    PyObject* values[3] = {0,0,0};

    /* "pandas/src/generated.pyx":1734
 * def backfill_2d_inplace_int64(ndarray[int64_t, ndim=2] values,
 *                                  ndarray[uint8_t, ndim=2] mask,
 *                                  limit=None):             # <<<<<<<<<<<<<<
 *     cdef Py_ssize_t i, j, N, K
 *     cdef int64_t val
 */
    values[2] = ((PyObject *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_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 (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_mask)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("backfill_2d_inplace_int64", 0, 2, 3, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1732; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_limit);
          if (value) { values[2] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "backfill_2d_inplace_int64") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1732; __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_mask = ((PyArrayObject *)values[1]);
    __pyx_v_limit = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("backfill_2d_inplace_int64", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1732; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas.algos.backfill_2d_inplace_int64", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1732; __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[2]; __pyx_lineno = 1733; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_182backfill_2d_inplace_int64(__pyx_self, __pyx_v_values, __pyx_v_mask, __pyx_v_limit);

  /* "pandas/src/generated.pyx":1732
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def backfill_2d_inplace_int64(ndarray[int64_t, ndim=2] values,             # <<<<<<<<<<<<<<
 *                                  ndarray[uint8_t, ndim=2] mask,
 *                                  limit=None):
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pandas_5algos_182backfill_2d_inplace_int64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_mask, PyObject *__pyx_v_limit) {
  Py_ssize_t __pyx_v_i;
  Py_ssize_t __pyx_v_j;
  Py_ssize_t __pyx_v_N;
  Py_ssize_t __pyx_v_K;
  __pyx_t_5numpy_int64_t __pyx_v_val;
  int __pyx_v_lim;
  int __pyx_v_fill_count;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_mask;
  __Pyx_Buffer __pyx_pybuffer_mask;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_values;
  __Pyx_Buffer __pyx_pybuffer_values;
  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;
  int __pyx_t_8;
  int __pyx_t_9;
  int __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;
  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("backfill_2d_inplace_int64", 0);
  __pyx_pybuffer_values.pybuffer.buf = NULL;
  __pyx_pybuffer_values.refcount = 0;
  __pyx_pybuffernd_values.data = NULL;
  __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values;
  __pyx_pybuffer_mask.pybuffer.buf = NULL;
  __pyx_pybuffer_mask.refcount = 0;
  __pyx_pybuffernd_mask.data = NULL;
  __pyx_pybuffernd_mask.rcbuffer = &__pyx_pybuffer_mask;
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1732; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_values.diminfo[1].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_values.diminfo[1].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[1];
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_mask.rcbuffer->pybuffer, (PyObject*)__pyx_v_mask, &__Pyx_TypeInfo_nn___pyx_t_5numpy_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1732; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_mask.diminfo[0].strides = __pyx_pybuffernd_mask.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_mask.diminfo[0].shape = __pyx_pybuffernd_mask.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_mask.diminfo[1].strides = __pyx_pybuffernd_mask.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_mask.diminfo[1].shape = __pyx_pybuffernd_mask.rcbuffer->pybuffer.shape[1];

  /* "pandas/src/generated.pyx":1737
 *     cdef Py_ssize_t i, j, N, K
 *     cdef int64_t val
 *     cdef int lim, fill_count = 0             # <<<<<<<<<<<<<<
 * 
 *     K, N = (<object> values).shape
 */
  __pyx_v_fill_count = 0;

  /* "pandas/src/generated.pyx":1739
 *     cdef int lim, fill_count = 0
 * 
 *     K, N = (<object> values).shape             # <<<<<<<<<<<<<<
 * 
 *     # GH 2778
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_values), __pyx_n_s_shape); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1739; __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 CYTHON_COMPILING_IN_CPYTHON
    Py_ssize_t size = Py_SIZE(sequence);
    #else
    Py_ssize_t size = PySequence_Size(sequence);
    #endif
    if (unlikely(size != 2)) {
      if (size > 2) __Pyx_RaiseTooManyValuesError(2);
      else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
      {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1739; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    #if CYTHON_COMPILING_IN_CPYTHON
    if (likely(PyTuple_CheckExact(sequence))) {
      __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); 
      __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1); 
    } else {
      __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);
    #else
    __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1739; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1739; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    #endif
    __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[2]; __pyx_lineno = 1739; __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_L3_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_L3_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_3);
    if (__Pyx_IternextUnpackEndCheck(__pyx_t_5(__pyx_t_4), 2) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1739; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_5 = NULL;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    goto __pyx_L4_unpacking_done;
    __pyx_L3_unpacking_failed:;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_5 = NULL;
    if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
    {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1739; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_L4_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[2]; __pyx_lineno = 1739; __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[2]; __pyx_lineno = 1739; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_v_K = __pyx_t_6;
  __pyx_v_N = __pyx_t_7;

  /* "pandas/src/generated.pyx":1742
 * 
 *     # GH 2778
 *     if N == 0:             # <<<<<<<<<<<<<<
 *         return
 * 
 */
  __pyx_t_8 = ((__pyx_v_N == 0) != 0);
  if (__pyx_t_8) {

    /* "pandas/src/generated.pyx":1743
 *     # GH 2778
 *     if N == 0:
 *         return             # <<<<<<<<<<<<<<
 * 
 *     if limit is None:
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_r = Py_None; __Pyx_INCREF(Py_None);
    goto __pyx_L0;
  }

  /* "pandas/src/generated.pyx":1745
 *         return
 * 
 *     if limit is None:             # <<<<<<<<<<<<<<
 *         lim = N
 *     else:
 */
  __pyx_t_8 = (__pyx_v_limit == Py_None);
  __pyx_t_9 = (__pyx_t_8 != 0);
  if (__pyx_t_9) {

    /* "pandas/src/generated.pyx":1746
 * 
 *     if limit is None:
 *         lim = N             # <<<<<<<<<<<<<<
 *     else:
 *         if limit < 0:
 */
    __pyx_v_lim = __pyx_v_N;
    goto __pyx_L6;
  }
  /*else*/ {

    /* "pandas/src/generated.pyx":1748
 *         lim = N
 *     else:
 *         if limit < 0:             # <<<<<<<<<<<<<<
 *             raise ValueError('Limit must be non-negative')
 *         lim = limit
 */
    __pyx_t_1 = PyObject_RichCompare(__pyx_v_limit, __pyx_int_0, Py_LT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1748; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1748; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (__pyx_t_9) {

      /* "pandas/src/generated.pyx":1749
 *     else:
 *         if limit < 0:
 *             raise ValueError('Limit must be non-negative')             # <<<<<<<<<<<<<<
 *         lim = limit
 * 
 */
      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__96, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1749; __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[2]; __pyx_lineno = 1749; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }

    /* "pandas/src/generated.pyx":1750
 *         if limit < 0:
 *             raise ValueError('Limit must be non-negative')
 *         lim = limit             # <<<<<<<<<<<<<<
 * 
 *     for j in range(K):
 */
    __pyx_t_10 = __Pyx_PyInt_As_int(__pyx_v_limit); if (unlikely((__pyx_t_10 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1750; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_v_lim = __pyx_t_10;
  }
  __pyx_L6:;

  /* "pandas/src/generated.pyx":1752
 *         lim = limit
 * 
 *     for j in range(K):             # <<<<<<<<<<<<<<
 *         fill_count = 0
 *         val = values[j, N - 1]
 */
  __pyx_t_7 = __pyx_v_K;
  for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_7; __pyx_t_6+=1) {
    __pyx_v_j = __pyx_t_6;

    /* "pandas/src/generated.pyx":1753
 * 
 *     for j in range(K):
 *         fill_count = 0             # <<<<<<<<<<<<<<
 *         val = values[j, N - 1]
 *         for i in range(N - 1, -1 , -1):
 */
    __pyx_v_fill_count = 0;

    /* "pandas/src/generated.pyx":1754
 *     for j in range(K):
 *         fill_count = 0
 *         val = values[j, N - 1]             # <<<<<<<<<<<<<<
 *         for i in range(N - 1, -1 , -1):
 *             if mask[j, i]:
 */
    __pyx_t_11 = __pyx_v_j;
    __pyx_t_12 = (__pyx_v_N - 1);
    __pyx_v_val = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_values.diminfo[0].strides, __pyx_t_12, __pyx_pybuffernd_values.diminfo[1].strides));

    /* "pandas/src/generated.pyx":1755
 *         fill_count = 0
 *         val = values[j, N - 1]
 *         for i in range(N - 1, -1 , -1):             # <<<<<<<<<<<<<<
 *             if mask[j, i]:
 *                 if fill_count >= lim:
 */
    for (__pyx_t_13 = (__pyx_v_N - 1); __pyx_t_13 > -1; __pyx_t_13-=1) {
      __pyx_v_i = __pyx_t_13;

      /* "pandas/src/generated.pyx":1756
 *         val = values[j, N - 1]
 *         for i in range(N - 1, -1 , -1):
 *             if mask[j, i]:             # <<<<<<<<<<<<<<
 *                 if fill_count >= lim:
 *                     continue
 */
      __pyx_t_14 = __pyx_v_j;
      __pyx_t_15 = __pyx_v_i;
      __pyx_t_9 = ((*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_uint8_t *, __pyx_pybuffernd_mask.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_mask.diminfo[0].strides, __pyx_t_15, __pyx_pybuffernd_mask.diminfo[1].strides)) != 0);
      if (__pyx_t_9) {

        /* "pandas/src/generated.pyx":1757
 *         for i in range(N - 1, -1 , -1):
 *             if mask[j, i]:
 *                 if fill_count >= lim:             # <<<<<<<<<<<<<<
 *                     continue
 *                 fill_count += 1
 */
        __pyx_t_9 = ((__pyx_v_fill_count >= __pyx_v_lim) != 0);
        if (__pyx_t_9) {

          /* "pandas/src/generated.pyx":1758
 *             if mask[j, i]:
 *                 if fill_count >= lim:
 *                     continue             # <<<<<<<<<<<<<<
 *                 fill_count += 1
 *                 values[j, i] = val
 */
          goto __pyx_L10_continue;
        }

        /* "pandas/src/generated.pyx":1759
 *                 if fill_count >= lim:
 *                     continue
 *                 fill_count += 1             # <<<<<<<<<<<<<<
 *                 values[j, i] = val
 *             else:
 */
        __pyx_v_fill_count = (__pyx_v_fill_count + 1);

        /* "pandas/src/generated.pyx":1760
 *                     continue
 *                 fill_count += 1
 *                 values[j, i] = val             # <<<<<<<<<<<<<<
 *             else:
 *                 fill_count = 0
 */
        __pyx_t_16 = __pyx_v_j;
        __pyx_t_17 = __pyx_v_i;
        *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_values.diminfo[0].strides, __pyx_t_17, __pyx_pybuffernd_values.diminfo[1].strides) = __pyx_v_val;
        goto __pyx_L12;
      }
      /*else*/ {

        /* "pandas/src/generated.pyx":1762
 *                 values[j, i] = val
 *             else:
 *                 fill_count = 0             # <<<<<<<<<<<<<<
 *                 val = values[j, i]
 * @cython.boundscheck(False)
 */
        __pyx_v_fill_count = 0;

        /* "pandas/src/generated.pyx":1763
 *             else:
 *                 fill_count = 0
 *                 val = values[j, i]             # <<<<<<<<<<<<<<
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 */
        __pyx_t_18 = __pyx_v_j;
        __pyx_t_19 = __pyx_v_i;
        __pyx_v_val = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_values.diminfo[0].strides, __pyx_t_19, __pyx_pybuffernd_values.diminfo[1].strides));
      }
      __pyx_L12:;
      __pyx_L10_continue:;
    }
  }

  /* "pandas/src/generated.pyx":1732
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def backfill_2d_inplace_int64(ndarray[int64_t, ndim=2] values,             # <<<<<<<<<<<<<<
 *                                  ndarray[uint8_t, ndim=2] mask,
 *                                  limit=None):
 */

  /* function exit code */
  __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_pybuffernd_mask.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas.algos.backfill_2d_inplace_int64", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_mask.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer);
  __pyx_L2:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/src/generated.pyx":1766
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def backfill_2d_inplace_bool(ndarray[uint8_t, ndim=2] values,             # <<<<<<<<<<<<<<
 *                                  ndarray[uint8_t, ndim=2] mask,
 *                                  limit=None):
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pandas_5algos_185backfill_2d_inplace_bool(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_5algos_185backfill_2d_inplace_bool = {__Pyx_NAMESTR("backfill_2d_inplace_bool"), (PyCFunction)__pyx_pw_6pandas_5algos_185backfill_2d_inplace_bool, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pw_6pandas_5algos_185backfill_2d_inplace_bool(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyArrayObject *__pyx_v_values = 0;
  PyArrayObject *__pyx_v_mask = 0;
  PyObject *__pyx_v_limit = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("backfill_2d_inplace_bool (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_values,&__pyx_n_s_mask,&__pyx_n_s_limit,0};
    PyObject* values[3] = {0,0,0};

    /* "pandas/src/generated.pyx":1768
 * def backfill_2d_inplace_bool(ndarray[uint8_t, ndim=2] values,
 *                                  ndarray[uint8_t, ndim=2] mask,
 *                                  limit=None):             # <<<<<<<<<<<<<<
 *     cdef Py_ssize_t i, j, N, K
 *     cdef uint8_t val
 */
    values[2] = ((PyObject *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_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 (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_mask)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("backfill_2d_inplace_bool", 0, 2, 3, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1766; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_limit);
          if (value) { values[2] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "backfill_2d_inplace_bool") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1766; __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_mask = ((PyArrayObject *)values[1]);
    __pyx_v_limit = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("backfill_2d_inplace_bool", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1766; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas.algos.backfill_2d_inplace_bool", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1766; __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[2]; __pyx_lineno = 1767; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_184backfill_2d_inplace_bool(__pyx_self, __pyx_v_values, __pyx_v_mask, __pyx_v_limit);

  /* "pandas/src/generated.pyx":1766
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def backfill_2d_inplace_bool(ndarray[uint8_t, ndim=2] values,             # <<<<<<<<<<<<<<
 *                                  ndarray[uint8_t, ndim=2] mask,
 *                                  limit=None):
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pandas_5algos_184backfill_2d_inplace_bool(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_mask, PyObject *__pyx_v_limit) {
  Py_ssize_t __pyx_v_i;
  Py_ssize_t __pyx_v_j;
  Py_ssize_t __pyx_v_N;
  Py_ssize_t __pyx_v_K;
  __pyx_t_5numpy_uint8_t __pyx_v_val;
  int __pyx_v_lim;
  int __pyx_v_fill_count;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_mask;
  __Pyx_Buffer __pyx_pybuffer_mask;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_values;
  __Pyx_Buffer __pyx_pybuffer_values;
  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;
  int __pyx_t_8;
  int __pyx_t_9;
  int __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;
  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("backfill_2d_inplace_bool", 0);
  __pyx_pybuffer_values.pybuffer.buf = NULL;
  __pyx_pybuffer_values.refcount = 0;
  __pyx_pybuffernd_values.data = NULL;
  __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values;
  __pyx_pybuffer_mask.pybuffer.buf = NULL;
  __pyx_pybuffer_mask.refcount = 0;
  __pyx_pybuffernd_mask.data = NULL;
  __pyx_pybuffernd_mask.rcbuffer = &__pyx_pybuffer_mask;
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1766; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_values.diminfo[1].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_values.diminfo[1].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[1];
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_mask.rcbuffer->pybuffer, (PyObject*)__pyx_v_mask, &__Pyx_TypeInfo_nn___pyx_t_5numpy_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1766; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_mask.diminfo[0].strides = __pyx_pybuffernd_mask.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_mask.diminfo[0].shape = __pyx_pybuffernd_mask.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_mask.diminfo[1].strides = __pyx_pybuffernd_mask.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_mask.diminfo[1].shape = __pyx_pybuffernd_mask.rcbuffer->pybuffer.shape[1];

  /* "pandas/src/generated.pyx":1771
 *     cdef Py_ssize_t i, j, N, K
 *     cdef uint8_t val
 *     cdef int lim, fill_count = 0             # <<<<<<<<<<<<<<
 * 
 *     K, N = (<object> values).shape
 */
  __pyx_v_fill_count = 0;

  /* "pandas/src/generated.pyx":1773
 *     cdef int lim, fill_count = 0
 * 
 *     K, N = (<object> values).shape             # <<<<<<<<<<<<<<
 * 
 *     # GH 2778
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_values), __pyx_n_s_shape); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1773; __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 CYTHON_COMPILING_IN_CPYTHON
    Py_ssize_t size = Py_SIZE(sequence);
    #else
    Py_ssize_t size = PySequence_Size(sequence);
    #endif
    if (unlikely(size != 2)) {
      if (size > 2) __Pyx_RaiseTooManyValuesError(2);
      else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
      {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1773; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    #if CYTHON_COMPILING_IN_CPYTHON
    if (likely(PyTuple_CheckExact(sequence))) {
      __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); 
      __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1); 
    } else {
      __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);
    #else
    __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1773; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1773; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    #endif
    __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[2]; __pyx_lineno = 1773; __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_L3_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_L3_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_3);
    if (__Pyx_IternextUnpackEndCheck(__pyx_t_5(__pyx_t_4), 2) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1773; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_5 = NULL;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    goto __pyx_L4_unpacking_done;
    __pyx_L3_unpacking_failed:;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_5 = NULL;
    if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
    {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1773; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_L4_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[2]; __pyx_lineno = 1773; __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[2]; __pyx_lineno = 1773; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_v_K = __pyx_t_6;
  __pyx_v_N = __pyx_t_7;

  /* "pandas/src/generated.pyx":1776
 * 
 *     # GH 2778
 *     if N == 0:             # <<<<<<<<<<<<<<
 *         return
 * 
 */
  __pyx_t_8 = ((__pyx_v_N == 0) != 0);
  if (__pyx_t_8) {

    /* "pandas/src/generated.pyx":1777
 *     # GH 2778
 *     if N == 0:
 *         return             # <<<<<<<<<<<<<<
 * 
 *     if limit is None:
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_r = Py_None; __Pyx_INCREF(Py_None);
    goto __pyx_L0;
  }

  /* "pandas/src/generated.pyx":1779
 *         return
 * 
 *     if limit is None:             # <<<<<<<<<<<<<<
 *         lim = N
 *     else:
 */
  __pyx_t_8 = (__pyx_v_limit == Py_None);
  __pyx_t_9 = (__pyx_t_8 != 0);
  if (__pyx_t_9) {

    /* "pandas/src/generated.pyx":1780
 * 
 *     if limit is None:
 *         lim = N             # <<<<<<<<<<<<<<
 *     else:
 *         if limit < 0:
 */
    __pyx_v_lim = __pyx_v_N;
    goto __pyx_L6;
  }
  /*else*/ {

    /* "pandas/src/generated.pyx":1782
 *         lim = N
 *     else:
 *         if limit < 0:             # <<<<<<<<<<<<<<
 *             raise ValueError('Limit must be non-negative')
 *         lim = limit
 */
    __pyx_t_1 = PyObject_RichCompare(__pyx_v_limit, __pyx_int_0, Py_LT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1782; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1782; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (__pyx_t_9) {

      /* "pandas/src/generated.pyx":1783
 *     else:
 *         if limit < 0:
 *             raise ValueError('Limit must be non-negative')             # <<<<<<<<<<<<<<
 *         lim = limit
 * 
 */
      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__97, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1783; __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[2]; __pyx_lineno = 1783; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }

    /* "pandas/src/generated.pyx":1784
 *         if limit < 0:
 *             raise ValueError('Limit must be non-negative')
 *         lim = limit             # <<<<<<<<<<<<<<
 * 
 *     for j in range(K):
 */
    __pyx_t_10 = __Pyx_PyInt_As_int(__pyx_v_limit); if (unlikely((__pyx_t_10 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1784; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_v_lim = __pyx_t_10;
  }
  __pyx_L6:;

  /* "pandas/src/generated.pyx":1786
 *         lim = limit
 * 
 *     for j in range(K):             # <<<<<<<<<<<<<<
 *         fill_count = 0
 *         val = values[j, N - 1]
 */
  __pyx_t_7 = __pyx_v_K;
  for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_7; __pyx_t_6+=1) {
    __pyx_v_j = __pyx_t_6;

    /* "pandas/src/generated.pyx":1787
 * 
 *     for j in range(K):
 *         fill_count = 0             # <<<<<<<<<<<<<<
 *         val = values[j, N - 1]
 *         for i in range(N - 1, -1 , -1):
 */
    __pyx_v_fill_count = 0;

    /* "pandas/src/generated.pyx":1788
 *     for j in range(K):
 *         fill_count = 0
 *         val = values[j, N - 1]             # <<<<<<<<<<<<<<
 *         for i in range(N - 1, -1 , -1):
 *             if mask[j, i]:
 */
    __pyx_t_11 = __pyx_v_j;
    __pyx_t_12 = (__pyx_v_N - 1);
    __pyx_v_val = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_uint8_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_values.diminfo[0].strides, __pyx_t_12, __pyx_pybuffernd_values.diminfo[1].strides));

    /* "pandas/src/generated.pyx":1789
 *         fill_count = 0
 *         val = values[j, N - 1]
 *         for i in range(N - 1, -1 , -1):             # <<<<<<<<<<<<<<
 *             if mask[j, i]:
 *                 if fill_count >= lim:
 */
    for (__pyx_t_13 = (__pyx_v_N - 1); __pyx_t_13 > -1; __pyx_t_13-=1) {
      __pyx_v_i = __pyx_t_13;

      /* "pandas/src/generated.pyx":1790
 *         val = values[j, N - 1]
 *         for i in range(N - 1, -1 , -1):
 *             if mask[j, i]:             # <<<<<<<<<<<<<<
 *                 if fill_count >= lim:
 *                     continue
 */
      __pyx_t_14 = __pyx_v_j;
      __pyx_t_15 = __pyx_v_i;
      __pyx_t_9 = ((*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_uint8_t *, __pyx_pybuffernd_mask.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_mask.diminfo[0].strides, __pyx_t_15, __pyx_pybuffernd_mask.diminfo[1].strides)) != 0);
      if (__pyx_t_9) {

        /* "pandas/src/generated.pyx":1791
 *         for i in range(N - 1, -1 , -1):
 *             if mask[j, i]:
 *                 if fill_count >= lim:             # <<<<<<<<<<<<<<
 *                     continue
 *                 fill_count += 1
 */
        __pyx_t_9 = ((__pyx_v_fill_count >= __pyx_v_lim) != 0);
        if (__pyx_t_9) {

          /* "pandas/src/generated.pyx":1792
 *             if mask[j, i]:
 *                 if fill_count >= lim:
 *                     continue             # <<<<<<<<<<<<<<
 *                 fill_count += 1
 *                 values[j, i] = val
 */
          goto __pyx_L10_continue;
        }

        /* "pandas/src/generated.pyx":1793
 *                 if fill_count >= lim:
 *                     continue
 *                 fill_count += 1             # <<<<<<<<<<<<<<
 *                 values[j, i] = val
 *             else:
 */
        __pyx_v_fill_count = (__pyx_v_fill_count + 1);

        /* "pandas/src/generated.pyx":1794
 *                     continue
 *                 fill_count += 1
 *                 values[j, i] = val             # <<<<<<<<<<<<<<
 *             else:
 *                 fill_count = 0
 */
        __pyx_t_16 = __pyx_v_j;
        __pyx_t_17 = __pyx_v_i;
        *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_uint8_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_values.diminfo[0].strides, __pyx_t_17, __pyx_pybuffernd_values.diminfo[1].strides) = __pyx_v_val;
        goto __pyx_L12;
      }
      /*else*/ {

        /* "pandas/src/generated.pyx":1796
 *                 values[j, i] = val
 *             else:
 *                 fill_count = 0             # <<<<<<<<<<<<<<
 *                 val = values[j, i]
 * 
 */
        __pyx_v_fill_count = 0;

        /* "pandas/src/generated.pyx":1797
 *             else:
 *                 fill_count = 0
 *                 val = values[j, i]             # <<<<<<<<<<<<<<
 * 
 * @cython.boundscheck(False)
 */
        __pyx_t_18 = __pyx_v_j;
        __pyx_t_19 = __pyx_v_i;
        __pyx_v_val = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_uint8_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_values.diminfo[0].strides, __pyx_t_19, __pyx_pybuffernd_values.diminfo[1].strides));
      }
      __pyx_L12:;
      __pyx_L10_continue:;
    }
  }

  /* "pandas/src/generated.pyx":1766
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def backfill_2d_inplace_bool(ndarray[uint8_t, ndim=2] values,             # <<<<<<<<<<<<<<
 *                                  ndarray[uint8_t, ndim=2] mask,
 *                                  limit=None):
 */

  /* function exit code */
  __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_pybuffernd_mask.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas.algos.backfill_2d_inplace_bool", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_mask.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer);
  __pyx_L2:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/src/generated.pyx":1801
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def is_monotonic_float64(ndarray[float64_t] arr):             # <<<<<<<<<<<<<<
 *     '''
 *     Returns
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pandas_5algos_187is_monotonic_float64(PyObject *__pyx_self, PyObject *__pyx_v_arr); /*proto*/
static char __pyx_doc_6pandas_5algos_186is_monotonic_float64[] = "\n    Returns\n    -------\n    is_monotonic, is_unique\n    ";
static PyMethodDef __pyx_mdef_6pandas_5algos_187is_monotonic_float64 = {__Pyx_NAMESTR("is_monotonic_float64"), (PyCFunction)__pyx_pw_6pandas_5algos_187is_monotonic_float64, METH_O, __Pyx_DOCSTR(__pyx_doc_6pandas_5algos_186is_monotonic_float64)};
static PyObject *__pyx_pw_6pandas_5algos_187is_monotonic_float64(PyObject *__pyx_self, PyObject *__pyx_v_arr) {
  CYTHON_UNUSED int __pyx_lineno = 0;
  CYTHON_UNUSED const char *__pyx_filename = NULL;
  CYTHON_UNUSED int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("is_monotonic_float64 (wrapper)", 0);
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_arr), __pyx_ptype_5numpy_ndarray, 1, "arr", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1801; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_186is_monotonic_float64(__pyx_self, ((PyArrayObject *)__pyx_v_arr));

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pandas_5algos_186is_monotonic_float64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_arr) {
  Py_ssize_t __pyx_v_i;
  Py_ssize_t __pyx_v_n;
  __pyx_t_5numpy_float64_t __pyx_v_prev;
  __pyx_t_5numpy_float64_t __pyx_v_cur;
  int __pyx_v_is_unique;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_arr;
  __Pyx_Buffer __pyx_pybuffer_arr;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  Py_ssize_t __pyx_t_1;
  int __pyx_t_2;
  long __pyx_t_3;
  Py_ssize_t __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;
  __Pyx_RefNannySetupContext("is_monotonic_float64", 0);
  __pyx_pybuffer_arr.pybuffer.buf = NULL;
  __pyx_pybuffer_arr.refcount = 0;
  __pyx_pybuffernd_arr.data = NULL;
  __pyx_pybuffernd_arr.rcbuffer = &__pyx_pybuffer_arr;
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_arr.rcbuffer->pybuffer, (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[2]; __pyx_lineno = 1801; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_arr.diminfo[0].strides = __pyx_pybuffernd_arr.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_arr.diminfo[0].shape = __pyx_pybuffernd_arr.rcbuffer->pybuffer.shape[0];

  /* "pandas/src/generated.pyx":1810
 *         Py_ssize_t i, n
 *         float64_t prev, cur
 *         bint is_unique = 1             # <<<<<<<<<<<<<<
 * 
 *     n = len(arr)
 */
  __pyx_v_is_unique = 1;

  /* "pandas/src/generated.pyx":1812
 *         bint is_unique = 1
 * 
 *     n = len(arr)             # <<<<<<<<<<<<<<
 * 
 *     if n < 2:
 */
  __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_arr)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1812; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_n = __pyx_t_1;

  /* "pandas/src/generated.pyx":1814
 *     n = len(arr)
 * 
 *     if n < 2:             # <<<<<<<<<<<<<<
 *         return True, True
 * 
 */
  __pyx_t_2 = ((__pyx_v_n < 2) != 0);
  if (__pyx_t_2) {

    /* "pandas/src/generated.pyx":1815
 * 
 *     if n < 2:
 *         return True, True             # <<<<<<<<<<<<<<
 * 
 *     prev = arr[0]
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(__pyx_tuple__98);
    __pyx_r = __pyx_tuple__98;
    goto __pyx_L0;
  }

  /* "pandas/src/generated.pyx":1817
 *         return True, True
 * 
 *     prev = arr[0]             # <<<<<<<<<<<<<<
 *     for i in range(1, n):
 *         cur = arr[i]
 */
  __pyx_t_3 = 0;
  __pyx_v_prev = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_arr.rcbuffer->pybuffer.buf, __pyx_t_3, __pyx_pybuffernd_arr.diminfo[0].strides));

  /* "pandas/src/generated.pyx":1818
 * 
 *     prev = arr[0]
 *     for i in range(1, n):             # <<<<<<<<<<<<<<
 *         cur = arr[i]
 *         if cur < prev:
 */
  __pyx_t_1 = __pyx_v_n;
  for (__pyx_t_4 = 1; __pyx_t_4 < __pyx_t_1; __pyx_t_4+=1) {
    __pyx_v_i = __pyx_t_4;

    /* "pandas/src/generated.pyx":1819
 *     prev = arr[0]
 *     for i in range(1, n):
 *         cur = arr[i]             # <<<<<<<<<<<<<<
 *         if cur < prev:
 *             return False, None
 */
    __pyx_t_5 = __pyx_v_i;
    __pyx_v_cur = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_arr.rcbuffer->pybuffer.buf, __pyx_t_5, __pyx_pybuffernd_arr.diminfo[0].strides));

    /* "pandas/src/generated.pyx":1820
 *     for i in range(1, n):
 *         cur = arr[i]
 *         if cur < prev:             # <<<<<<<<<<<<<<
 *             return False, None
 *         elif cur == prev:
 */
    __pyx_t_2 = ((__pyx_v_cur < __pyx_v_prev) != 0);
    if (__pyx_t_2) {

      /* "pandas/src/generated.pyx":1821
 *         cur = arr[i]
 *         if cur < prev:
 *             return False, None             # <<<<<<<<<<<<<<
 *         elif cur == prev:
 *             is_unique = 0
 */
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(__pyx_tuple__99);
      __pyx_r = __pyx_tuple__99;
      goto __pyx_L0;
    }

    /* "pandas/src/generated.pyx":1822
 *         if cur < prev:
 *             return False, None
 *         elif cur == prev:             # <<<<<<<<<<<<<<
 *             is_unique = 0
 *         prev = cur
 */
    __pyx_t_2 = ((__pyx_v_cur == __pyx_v_prev) != 0);
    if (__pyx_t_2) {

      /* "pandas/src/generated.pyx":1823
 *             return False, None
 *         elif cur == prev:
 *             is_unique = 0             # <<<<<<<<<<<<<<
 *         prev = cur
 *     return True, is_unique
 */
      __pyx_v_is_unique = 0;
      goto __pyx_L6;
    }
    __pyx_L6:;

    /* "pandas/src/generated.pyx":1824
 *         elif cur == prev:
 *             is_unique = 0
 *         prev = cur             # <<<<<<<<<<<<<<
 *     return True, is_unique
 * @cython.boundscheck(False)
 */
    __pyx_v_prev = __pyx_v_cur;
  }

  /* "pandas/src/generated.pyx":1825
 *             is_unique = 0
 *         prev = cur
 *     return True, is_unique             # <<<<<<<<<<<<<<
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_6 = __Pyx_PyBool_FromLong(__pyx_v_is_unique); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1825; __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 = 1825; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_INCREF(Py_True);
  PyTuple_SET_ITEM(__pyx_t_7, 0, Py_True);
  __Pyx_GIVEREF(Py_True);
  PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_6);
  __Pyx_GIVEREF(__pyx_t_6);
  __pyx_t_6 = 0;
  __pyx_r = __pyx_t_7;
  __pyx_t_7 = 0;
  goto __pyx_L0;

  /* "pandas/src/generated.pyx":1801
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def is_monotonic_float64(ndarray[float64_t] arr):             # <<<<<<<<<<<<<<
 *     '''
 *     Returns
 */

  /* function exit code */
  __pyx_L1_error:;
  __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_pybuffernd_arr.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas.algos.is_monotonic_float64", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_arr.rcbuffer->pybuffer);
  __pyx_L2:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/src/generated.pyx":1828
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def is_monotonic_float32(ndarray[float32_t] arr):             # <<<<<<<<<<<<<<
 *     '''
 *     Returns
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pandas_5algos_189is_monotonic_float32(PyObject *__pyx_self, PyObject *__pyx_v_arr); /*proto*/
static char __pyx_doc_6pandas_5algos_188is_monotonic_float32[] = "\n    Returns\n    -------\n    is_monotonic, is_unique\n    ";
static PyMethodDef __pyx_mdef_6pandas_5algos_189is_monotonic_float32 = {__Pyx_NAMESTR("is_monotonic_float32"), (PyCFunction)__pyx_pw_6pandas_5algos_189is_monotonic_float32, METH_O, __Pyx_DOCSTR(__pyx_doc_6pandas_5algos_188is_monotonic_float32)};
static PyObject *__pyx_pw_6pandas_5algos_189is_monotonic_float32(PyObject *__pyx_self, PyObject *__pyx_v_arr) {
  CYTHON_UNUSED int __pyx_lineno = 0;
  CYTHON_UNUSED const char *__pyx_filename = NULL;
  CYTHON_UNUSED int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("is_monotonic_float32 (wrapper)", 0);
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_arr), __pyx_ptype_5numpy_ndarray, 1, "arr", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1828; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_188is_monotonic_float32(__pyx_self, ((PyArrayObject *)__pyx_v_arr));

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pandas_5algos_188is_monotonic_float32(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_arr) {
  Py_ssize_t __pyx_v_i;
  Py_ssize_t __pyx_v_n;
  __pyx_t_5numpy_float32_t __pyx_v_prev;
  __pyx_t_5numpy_float32_t __pyx_v_cur;
  int __pyx_v_is_unique;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_arr;
  __Pyx_Buffer __pyx_pybuffer_arr;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  Py_ssize_t __pyx_t_1;
  int __pyx_t_2;
  long __pyx_t_3;
  Py_ssize_t __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;
  __Pyx_RefNannySetupContext("is_monotonic_float32", 0);
  __pyx_pybuffer_arr.pybuffer.buf = NULL;
  __pyx_pybuffer_arr.refcount = 0;
  __pyx_pybuffernd_arr.data = NULL;
  __pyx_pybuffernd_arr.rcbuffer = &__pyx_pybuffer_arr;
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_arr.rcbuffer->pybuffer, (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[2]; __pyx_lineno = 1828; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_arr.diminfo[0].strides = __pyx_pybuffernd_arr.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_arr.diminfo[0].shape = __pyx_pybuffernd_arr.rcbuffer->pybuffer.shape[0];

  /* "pandas/src/generated.pyx":1837
 *         Py_ssize_t i, n
 *         float32_t prev, cur
 *         bint is_unique = 1             # <<<<<<<<<<<<<<
 * 
 *     n = len(arr)
 */
  __pyx_v_is_unique = 1;

  /* "pandas/src/generated.pyx":1839
 *         bint is_unique = 1
 * 
 *     n = len(arr)             # <<<<<<<<<<<<<<
 * 
 *     if n < 2:
 */
  __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_arr)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1839; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_n = __pyx_t_1;

  /* "pandas/src/generated.pyx":1841
 *     n = len(arr)
 * 
 *     if n < 2:             # <<<<<<<<<<<<<<
 *         return True, True
 * 
 */
  __pyx_t_2 = ((__pyx_v_n < 2) != 0);
  if (__pyx_t_2) {

    /* "pandas/src/generated.pyx":1842
 * 
 *     if n < 2:
 *         return True, True             # <<<<<<<<<<<<<<
 * 
 *     prev = arr[0]
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(__pyx_tuple__100);
    __pyx_r = __pyx_tuple__100;
    goto __pyx_L0;
  }

  /* "pandas/src/generated.pyx":1844
 *         return True, True
 * 
 *     prev = arr[0]             # <<<<<<<<<<<<<<
 *     for i in range(1, n):
 *         cur = arr[i]
 */
  __pyx_t_3 = 0;
  __pyx_v_prev = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_arr.rcbuffer->pybuffer.buf, __pyx_t_3, __pyx_pybuffernd_arr.diminfo[0].strides));

  /* "pandas/src/generated.pyx":1845
 * 
 *     prev = arr[0]
 *     for i in range(1, n):             # <<<<<<<<<<<<<<
 *         cur = arr[i]
 *         if cur < prev:
 */
  __pyx_t_1 = __pyx_v_n;
  for (__pyx_t_4 = 1; __pyx_t_4 < __pyx_t_1; __pyx_t_4+=1) {
    __pyx_v_i = __pyx_t_4;

    /* "pandas/src/generated.pyx":1846
 *     prev = arr[0]
 *     for i in range(1, n):
 *         cur = arr[i]             # <<<<<<<<<<<<<<
 *         if cur < prev:
 *             return False, None
 */
    __pyx_t_5 = __pyx_v_i;
    __pyx_v_cur = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_arr.rcbuffer->pybuffer.buf, __pyx_t_5, __pyx_pybuffernd_arr.diminfo[0].strides));

    /* "pandas/src/generated.pyx":1847
 *     for i in range(1, n):
 *         cur = arr[i]
 *         if cur < prev:             # <<<<<<<<<<<<<<
 *             return False, None
 *         elif cur == prev:
 */
    __pyx_t_2 = ((__pyx_v_cur < __pyx_v_prev) != 0);
    if (__pyx_t_2) {

      /* "pandas/src/generated.pyx":1848
 *         cur = arr[i]
 *         if cur < prev:
 *             return False, None             # <<<<<<<<<<<<<<
 *         elif cur == prev:
 *             is_unique = 0
 */
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(__pyx_tuple__101);
      __pyx_r = __pyx_tuple__101;
      goto __pyx_L0;
    }

    /* "pandas/src/generated.pyx":1849
 *         if cur < prev:
 *             return False, None
 *         elif cur == prev:             # <<<<<<<<<<<<<<
 *             is_unique = 0
 *         prev = cur
 */
    __pyx_t_2 = ((__pyx_v_cur == __pyx_v_prev) != 0);
    if (__pyx_t_2) {

      /* "pandas/src/generated.pyx":1850
 *             return False, None
 *         elif cur == prev:
 *             is_unique = 0             # <<<<<<<<<<<<<<
 *         prev = cur
 *     return True, is_unique
 */
      __pyx_v_is_unique = 0;
      goto __pyx_L6;
    }
    __pyx_L6:;

    /* "pandas/src/generated.pyx":1851
 *         elif cur == prev:
 *             is_unique = 0
 *         prev = cur             # <<<<<<<<<<<<<<
 *     return True, is_unique
 * @cython.boundscheck(False)
 */
    __pyx_v_prev = __pyx_v_cur;
  }

  /* "pandas/src/generated.pyx":1852
 *             is_unique = 0
 *         prev = cur
 *     return True, is_unique             # <<<<<<<<<<<<<<
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_6 = __Pyx_PyBool_FromLong(__pyx_v_is_unique); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1852; __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 = 1852; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_INCREF(Py_True);
  PyTuple_SET_ITEM(__pyx_t_7, 0, Py_True);
  __Pyx_GIVEREF(Py_True);
  PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_6);
  __Pyx_GIVEREF(__pyx_t_6);
  __pyx_t_6 = 0;
  __pyx_r = __pyx_t_7;
  __pyx_t_7 = 0;
  goto __pyx_L0;

  /* "pandas/src/generated.pyx":1828
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def is_monotonic_float32(ndarray[float32_t] arr):             # <<<<<<<<<<<<<<
 *     '''
 *     Returns
 */

  /* function exit code */
  __pyx_L1_error:;
  __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_pybuffernd_arr.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas.algos.is_monotonic_float32", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_arr.rcbuffer->pybuffer);
  __pyx_L2:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/src/generated.pyx":1855
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def is_monotonic_object(ndarray[object] arr):             # <<<<<<<<<<<<<<
 *     '''
 *     Returns
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pandas_5algos_191is_monotonic_object(PyObject *__pyx_self, PyObject *__pyx_v_arr); /*proto*/
static char __pyx_doc_6pandas_5algos_190is_monotonic_object[] = "\n    Returns\n    -------\n    is_monotonic, is_unique\n    ";
static PyMethodDef __pyx_mdef_6pandas_5algos_191is_monotonic_object = {__Pyx_NAMESTR("is_monotonic_object"), (PyCFunction)__pyx_pw_6pandas_5algos_191is_monotonic_object, METH_O, __Pyx_DOCSTR(__pyx_doc_6pandas_5algos_190is_monotonic_object)};
static PyObject *__pyx_pw_6pandas_5algos_191is_monotonic_object(PyObject *__pyx_self, PyObject *__pyx_v_arr) {
  CYTHON_UNUSED int __pyx_lineno = 0;
  CYTHON_UNUSED const char *__pyx_filename = NULL;
  CYTHON_UNUSED int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("is_monotonic_object (wrapper)", 0);
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_arr), __pyx_ptype_5numpy_ndarray, 1, "arr", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1855; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_190is_monotonic_object(__pyx_self, ((PyArrayObject *)__pyx_v_arr));

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pandas_5algos_190is_monotonic_object(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_arr) {
  Py_ssize_t __pyx_v_i;
  Py_ssize_t __pyx_v_n;
  PyObject *__pyx_v_prev = 0;
  PyObject *__pyx_v_cur = 0;
  int __pyx_v_is_unique;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_arr;
  __Pyx_Buffer __pyx_pybuffer_arr;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  Py_ssize_t __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  long __pyx_t_4;
  Py_ssize_t __pyx_t_5;
  Py_ssize_t __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("is_monotonic_object", 0);
  __pyx_pybuffer_arr.pybuffer.buf = NULL;
  __pyx_pybuffer_arr.refcount = 0;
  __pyx_pybuffernd_arr.data = NULL;
  __pyx_pybuffernd_arr.rcbuffer = &__pyx_pybuffer_arr;
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_arr.rcbuffer->pybuffer, (PyObject*)__pyx_v_arr, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1855; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_arr.diminfo[0].strides = __pyx_pybuffernd_arr.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_arr.diminfo[0].shape = __pyx_pybuffernd_arr.rcbuffer->pybuffer.shape[0];

  /* "pandas/src/generated.pyx":1864
 *         Py_ssize_t i, n
 *         object prev, cur
 *         bint is_unique = 1             # <<<<<<<<<<<<<<
 * 
 *     n = len(arr)
 */
  __pyx_v_is_unique = 1;

  /* "pandas/src/generated.pyx":1866
 *         bint is_unique = 1
 * 
 *     n = len(arr)             # <<<<<<<<<<<<<<
 * 
 *     if n < 2:
 */
  __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_arr)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1866; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_n = __pyx_t_1;

  /* "pandas/src/generated.pyx":1868
 *     n = len(arr)
 * 
 *     if n < 2:             # <<<<<<<<<<<<<<
 *         return True, True
 * 
 */
  __pyx_t_2 = ((__pyx_v_n < 2) != 0);
  if (__pyx_t_2) {

    /* "pandas/src/generated.pyx":1869
 * 
 *     if n < 2:
 *         return True, True             # <<<<<<<<<<<<<<
 * 
 *     prev = arr[0]
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(__pyx_tuple__102);
    __pyx_r = __pyx_tuple__102;
    goto __pyx_L0;
  }

  /* "pandas/src/generated.pyx":1871
 *         return True, True
 * 
 *     prev = arr[0]             # <<<<<<<<<<<<<<
 *     for i in range(1, n):
 *         cur = arr[i]
 */
  __pyx_t_4 = 0;
  __pyx_t_3 = (PyObject *) *__Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_arr.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_arr.diminfo[0].strides);
  __Pyx_INCREF((PyObject*)__pyx_t_3);
  __pyx_v_prev = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "pandas/src/generated.pyx":1872
 * 
 *     prev = arr[0]
 *     for i in range(1, n):             # <<<<<<<<<<<<<<
 *         cur = arr[i]
 *         if cur < prev:
 */
  __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;

    /* "pandas/src/generated.pyx":1873
 *     prev = arr[0]
 *     for i in range(1, n):
 *         cur = arr[i]             # <<<<<<<<<<<<<<
 *         if cur < prev:
 *             return False, None
 */
    __pyx_t_6 = __pyx_v_i;
    __pyx_t_3 = (PyObject *) *__Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_arr.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_arr.diminfo[0].strides);
    __Pyx_INCREF((PyObject*)__pyx_t_3);
    __Pyx_XDECREF_SET(__pyx_v_cur, __pyx_t_3);
    __pyx_t_3 = 0;

    /* "pandas/src/generated.pyx":1874
 *     for i in range(1, n):
 *         cur = arr[i]
 *         if cur < prev:             # <<<<<<<<<<<<<<
 *             return False, None
 *         elif cur == prev:
 */
    __pyx_t_3 = PyObject_RichCompare(__pyx_v_cur, __pyx_v_prev, Py_LT); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1874; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1874; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (__pyx_t_2) {

      /* "pandas/src/generated.pyx":1875
 *         cur = arr[i]
 *         if cur < prev:
 *             return False, None             # <<<<<<<<<<<<<<
 *         elif cur == prev:
 *             is_unique = 0
 */
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(__pyx_tuple__103);
      __pyx_r = __pyx_tuple__103;
      goto __pyx_L0;
    }

    /* "pandas/src/generated.pyx":1876
 *         if cur < prev:
 *             return False, None
 *         elif cur == prev:             # <<<<<<<<<<<<<<
 *             is_unique = 0
 *         prev = cur
 */
    __pyx_t_3 = PyObject_RichCompare(__pyx_v_cur, __pyx_v_prev, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1876; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1876; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (__pyx_t_2) {

      /* "pandas/src/generated.pyx":1877
 *             return False, None
 *         elif cur == prev:
 *             is_unique = 0             # <<<<<<<<<<<<<<
 *         prev = cur
 *     return True, is_unique
 */
      __pyx_v_is_unique = 0;
      goto __pyx_L6;
    }
    __pyx_L6:;

    /* "pandas/src/generated.pyx":1878
 *         elif cur == prev:
 *             is_unique = 0
 *         prev = cur             # <<<<<<<<<<<<<<
 *     return True, is_unique
 * @cython.boundscheck(False)
 */
    __Pyx_INCREF(__pyx_v_cur);
    __Pyx_DECREF_SET(__pyx_v_prev, __pyx_v_cur);
  }

  /* "pandas/src/generated.pyx":1879
 *             is_unique = 0
 *         prev = cur
 *     return True, is_unique             # <<<<<<<<<<<<<<
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_3 = __Pyx_PyBool_FromLong(__pyx_v_is_unique); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1879; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1879; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_INCREF(Py_True);
  PyTuple_SET_ITEM(__pyx_t_7, 0, Py_True);
  __Pyx_GIVEREF(Py_True);
  PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_3);
  __pyx_t_3 = 0;
  __pyx_r = __pyx_t_7;
  __pyx_t_7 = 0;
  goto __pyx_L0;

  /* "pandas/src/generated.pyx":1855
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def is_monotonic_object(ndarray[object] arr):             # <<<<<<<<<<<<<<
 *     '''
 *     Returns
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_7);
  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
    __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_arr.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas.algos.is_monotonic_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_arr.rcbuffer->pybuffer);
  __pyx_L2:;
  __Pyx_XDECREF(__pyx_v_prev);
  __Pyx_XDECREF(__pyx_v_cur);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/src/generated.pyx":1882
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def is_monotonic_int32(ndarray[int32_t] arr):             # <<<<<<<<<<<<<<
 *     '''
 *     Returns
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pandas_5algos_193is_monotonic_int32(PyObject *__pyx_self, PyObject *__pyx_v_arr); /*proto*/
static char __pyx_doc_6pandas_5algos_192is_monotonic_int32[] = "\n    Returns\n    -------\n    is_monotonic, is_unique\n    ";
static PyMethodDef __pyx_mdef_6pandas_5algos_193is_monotonic_int32 = {__Pyx_NAMESTR("is_monotonic_int32"), (PyCFunction)__pyx_pw_6pandas_5algos_193is_monotonic_int32, METH_O, __Pyx_DOCSTR(__pyx_doc_6pandas_5algos_192is_monotonic_int32)};
static PyObject *__pyx_pw_6pandas_5algos_193is_monotonic_int32(PyObject *__pyx_self, PyObject *__pyx_v_arr) {
  CYTHON_UNUSED int __pyx_lineno = 0;
  CYTHON_UNUSED const char *__pyx_filename = NULL;
  CYTHON_UNUSED int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("is_monotonic_int32 (wrapper)", 0);
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_arr), __pyx_ptype_5numpy_ndarray, 1, "arr", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1882; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_192is_monotonic_int32(__pyx_self, ((PyArrayObject *)__pyx_v_arr));

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pandas_5algos_192is_monotonic_int32(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_arr) {
  Py_ssize_t __pyx_v_i;
  Py_ssize_t __pyx_v_n;
  __pyx_t_5numpy_int32_t __pyx_v_prev;
  __pyx_t_5numpy_int32_t __pyx_v_cur;
  int __pyx_v_is_unique;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_arr;
  __Pyx_Buffer __pyx_pybuffer_arr;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  Py_ssize_t __pyx_t_1;
  int __pyx_t_2;
  long __pyx_t_3;
  Py_ssize_t __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;
  __Pyx_RefNannySetupContext("is_monotonic_int32", 0);
  __pyx_pybuffer_arr.pybuffer.buf = NULL;
  __pyx_pybuffer_arr.refcount = 0;
  __pyx_pybuffernd_arr.data = NULL;
  __pyx_pybuffernd_arr.rcbuffer = &__pyx_pybuffer_arr;
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_arr.rcbuffer->pybuffer, (PyObject*)__pyx_v_arr, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1882; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_arr.diminfo[0].strides = __pyx_pybuffernd_arr.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_arr.diminfo[0].shape = __pyx_pybuffernd_arr.rcbuffer->pybuffer.shape[0];

  /* "pandas/src/generated.pyx":1891
 *         Py_ssize_t i, n
 *         int32_t prev, cur
 *         bint is_unique = 1             # <<<<<<<<<<<<<<
 * 
 *     n = len(arr)
 */
  __pyx_v_is_unique = 1;

  /* "pandas/src/generated.pyx":1893
 *         bint is_unique = 1
 * 
 *     n = len(arr)             # <<<<<<<<<<<<<<
 * 
 *     if n < 2:
 */
  __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_arr)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1893; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_n = __pyx_t_1;

  /* "pandas/src/generated.pyx":1895
 *     n = len(arr)
 * 
 *     if n < 2:             # <<<<<<<<<<<<<<
 *         return True, True
 * 
 */
  __pyx_t_2 = ((__pyx_v_n < 2) != 0);
  if (__pyx_t_2) {

    /* "pandas/src/generated.pyx":1896
 * 
 *     if n < 2:
 *         return True, True             # <<<<<<<<<<<<<<
 * 
 *     prev = arr[0]
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(__pyx_tuple__104);
    __pyx_r = __pyx_tuple__104;
    goto __pyx_L0;
  }

  /* "pandas/src/generated.pyx":1898
 *         return True, True
 * 
 *     prev = arr[0]             # <<<<<<<<<<<<<<
 *     for i in range(1, n):
 *         cur = arr[i]
 */
  __pyx_t_3 = 0;
  __pyx_v_prev = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_arr.rcbuffer->pybuffer.buf, __pyx_t_3, __pyx_pybuffernd_arr.diminfo[0].strides));

  /* "pandas/src/generated.pyx":1899
 * 
 *     prev = arr[0]
 *     for i in range(1, n):             # <<<<<<<<<<<<<<
 *         cur = arr[i]
 *         if cur < prev:
 */
  __pyx_t_1 = __pyx_v_n;
  for (__pyx_t_4 = 1; __pyx_t_4 < __pyx_t_1; __pyx_t_4+=1) {
    __pyx_v_i = __pyx_t_4;

    /* "pandas/src/generated.pyx":1900
 *     prev = arr[0]
 *     for i in range(1, n):
 *         cur = arr[i]             # <<<<<<<<<<<<<<
 *         if cur < prev:
 *             return False, None
 */
    __pyx_t_5 = __pyx_v_i;
    __pyx_v_cur = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_arr.rcbuffer->pybuffer.buf, __pyx_t_5, __pyx_pybuffernd_arr.diminfo[0].strides));

    /* "pandas/src/generated.pyx":1901
 *     for i in range(1, n):
 *         cur = arr[i]
 *         if cur < prev:             # <<<<<<<<<<<<<<
 *             return False, None
 *         elif cur == prev:
 */
    __pyx_t_2 = ((__pyx_v_cur < __pyx_v_prev) != 0);
    if (__pyx_t_2) {

      /* "pandas/src/generated.pyx":1902
 *         cur = arr[i]
 *         if cur < prev:
 *             return False, None             # <<<<<<<<<<<<<<
 *         elif cur == prev:
 *             is_unique = 0
 */
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(__pyx_tuple__105);
      __pyx_r = __pyx_tuple__105;
      goto __pyx_L0;
    }

    /* "pandas/src/generated.pyx":1903
 *         if cur < prev:
 *             return False, None
 *         elif cur == prev:             # <<<<<<<<<<<<<<
 *             is_unique = 0
 *         prev = cur
 */
    __pyx_t_2 = ((__pyx_v_cur == __pyx_v_prev) != 0);
    if (__pyx_t_2) {

      /* "pandas/src/generated.pyx":1904
 *             return False, None
 *         elif cur == prev:
 *             is_unique = 0             # <<<<<<<<<<<<<<
 *         prev = cur
 *     return True, is_unique
 */
      __pyx_v_is_unique = 0;
      goto __pyx_L6;
    }
    __pyx_L6:;

    /* "pandas/src/generated.pyx":1905
 *         elif cur == prev:
 *             is_unique = 0
 *         prev = cur             # <<<<<<<<<<<<<<
 *     return True, is_unique
 * @cython.boundscheck(False)
 */
    __pyx_v_prev = __pyx_v_cur;
  }

  /* "pandas/src/generated.pyx":1906
 *             is_unique = 0
 *         prev = cur
 *     return True, is_unique             # <<<<<<<<<<<<<<
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_6 = __Pyx_PyBool_FromLong(__pyx_v_is_unique); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1906; __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 = 1906; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_INCREF(Py_True);
  PyTuple_SET_ITEM(__pyx_t_7, 0, Py_True);
  __Pyx_GIVEREF(Py_True);
  PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_6);
  __Pyx_GIVEREF(__pyx_t_6);
  __pyx_t_6 = 0;
  __pyx_r = __pyx_t_7;
  __pyx_t_7 = 0;
  goto __pyx_L0;

  /* "pandas/src/generated.pyx":1882
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def is_monotonic_int32(ndarray[int32_t] arr):             # <<<<<<<<<<<<<<
 *     '''
 *     Returns
 */

  /* function exit code */
  __pyx_L1_error:;
  __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_pybuffernd_arr.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas.algos.is_monotonic_int32", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_arr.rcbuffer->pybuffer);
  __pyx_L2:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/src/generated.pyx":1909
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def is_monotonic_int64(ndarray[int64_t] arr):             # <<<<<<<<<<<<<<
 *     '''
 *     Returns
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pandas_5algos_195is_monotonic_int64(PyObject *__pyx_self, PyObject *__pyx_v_arr); /*proto*/
static char __pyx_doc_6pandas_5algos_194is_monotonic_int64[] = "\n    Returns\n    -------\n    is_monotonic, is_unique\n    ";
static PyMethodDef __pyx_mdef_6pandas_5algos_195is_monotonic_int64 = {__Pyx_NAMESTR("is_monotonic_int64"), (PyCFunction)__pyx_pw_6pandas_5algos_195is_monotonic_int64, METH_O, __Pyx_DOCSTR(__pyx_doc_6pandas_5algos_194is_monotonic_int64)};
static PyObject *__pyx_pw_6pandas_5algos_195is_monotonic_int64(PyObject *__pyx_self, PyObject *__pyx_v_arr) {
  CYTHON_UNUSED int __pyx_lineno = 0;
  CYTHON_UNUSED const char *__pyx_filename = NULL;
  CYTHON_UNUSED int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("is_monotonic_int64 (wrapper)", 0);
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_arr), __pyx_ptype_5numpy_ndarray, 1, "arr", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1909; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_194is_monotonic_int64(__pyx_self, ((PyArrayObject *)__pyx_v_arr));

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pandas_5algos_194is_monotonic_int64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_arr) {
  Py_ssize_t __pyx_v_i;
  Py_ssize_t __pyx_v_n;
  __pyx_t_5numpy_int64_t __pyx_v_prev;
  __pyx_t_5numpy_int64_t __pyx_v_cur;
  int __pyx_v_is_unique;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_arr;
  __Pyx_Buffer __pyx_pybuffer_arr;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  Py_ssize_t __pyx_t_1;
  int __pyx_t_2;
  long __pyx_t_3;
  Py_ssize_t __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;
  __Pyx_RefNannySetupContext("is_monotonic_int64", 0);
  __pyx_pybuffer_arr.pybuffer.buf = NULL;
  __pyx_pybuffer_arr.refcount = 0;
  __pyx_pybuffernd_arr.data = NULL;
  __pyx_pybuffernd_arr.rcbuffer = &__pyx_pybuffer_arr;
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_arr.rcbuffer->pybuffer, (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[2]; __pyx_lineno = 1909; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_arr.diminfo[0].strides = __pyx_pybuffernd_arr.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_arr.diminfo[0].shape = __pyx_pybuffernd_arr.rcbuffer->pybuffer.shape[0];

  /* "pandas/src/generated.pyx":1918
 *         Py_ssize_t i, n
 *         int64_t prev, cur
 *         bint is_unique = 1             # <<<<<<<<<<<<<<
 * 
 *     n = len(arr)
 */
  __pyx_v_is_unique = 1;

  /* "pandas/src/generated.pyx":1920
 *         bint is_unique = 1
 * 
 *     n = len(arr)             # <<<<<<<<<<<<<<
 * 
 *     if n < 2:
 */
  __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_arr)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1920; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_n = __pyx_t_1;

  /* "pandas/src/generated.pyx":1922
 *     n = len(arr)
 * 
 *     if n < 2:             # <<<<<<<<<<<<<<
 *         return True, True
 * 
 */
  __pyx_t_2 = ((__pyx_v_n < 2) != 0);
  if (__pyx_t_2) {

    /* "pandas/src/generated.pyx":1923
 * 
 *     if n < 2:
 *         return True, True             # <<<<<<<<<<<<<<
 * 
 *     prev = arr[0]
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(__pyx_tuple__106);
    __pyx_r = __pyx_tuple__106;
    goto __pyx_L0;
  }

  /* "pandas/src/generated.pyx":1925
 *         return True, True
 * 
 *     prev = arr[0]             # <<<<<<<<<<<<<<
 *     for i in range(1, n):
 *         cur = arr[i]
 */
  __pyx_t_3 = 0;
  __pyx_v_prev = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_arr.rcbuffer->pybuffer.buf, __pyx_t_3, __pyx_pybuffernd_arr.diminfo[0].strides));

  /* "pandas/src/generated.pyx":1926
 * 
 *     prev = arr[0]
 *     for i in range(1, n):             # <<<<<<<<<<<<<<
 *         cur = arr[i]
 *         if cur < prev:
 */
  __pyx_t_1 = __pyx_v_n;
  for (__pyx_t_4 = 1; __pyx_t_4 < __pyx_t_1; __pyx_t_4+=1) {
    __pyx_v_i = __pyx_t_4;

    /* "pandas/src/generated.pyx":1927
 *     prev = arr[0]
 *     for i in range(1, n):
 *         cur = arr[i]             # <<<<<<<<<<<<<<
 *         if cur < prev:
 *             return False, None
 */
    __pyx_t_5 = __pyx_v_i;
    __pyx_v_cur = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_arr.rcbuffer->pybuffer.buf, __pyx_t_5, __pyx_pybuffernd_arr.diminfo[0].strides));

    /* "pandas/src/generated.pyx":1928
 *     for i in range(1, n):
 *         cur = arr[i]
 *         if cur < prev:             # <<<<<<<<<<<<<<
 *             return False, None
 *         elif cur == prev:
 */
    __pyx_t_2 = ((__pyx_v_cur < __pyx_v_prev) != 0);
    if (__pyx_t_2) {

      /* "pandas/src/generated.pyx":1929
 *         cur = arr[i]
 *         if cur < prev:
 *             return False, None             # <<<<<<<<<<<<<<
 *         elif cur == prev:
 *             is_unique = 0
 */
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(__pyx_tuple__107);
      __pyx_r = __pyx_tuple__107;
      goto __pyx_L0;
    }

    /* "pandas/src/generated.pyx":1930
 *         if cur < prev:
 *             return False, None
 *         elif cur == prev:             # <<<<<<<<<<<<<<
 *             is_unique = 0
 *         prev = cur
 */
    __pyx_t_2 = ((__pyx_v_cur == __pyx_v_prev) != 0);
    if (__pyx_t_2) {

      /* "pandas/src/generated.pyx":1931
 *             return False, None
 *         elif cur == prev:
 *             is_unique = 0             # <<<<<<<<<<<<<<
 *         prev = cur
 *     return True, is_unique
 */
      __pyx_v_is_unique = 0;
      goto __pyx_L6;
    }
    __pyx_L6:;

    /* "pandas/src/generated.pyx":1932
 *         elif cur == prev:
 *             is_unique = 0
 *         prev = cur             # <<<<<<<<<<<<<<
 *     return True, is_unique
 * @cython.boundscheck(False)
 */
    __pyx_v_prev = __pyx_v_cur;
  }

  /* "pandas/src/generated.pyx":1933
 *             is_unique = 0
 *         prev = cur
 *     return True, is_unique             # <<<<<<<<<<<<<<
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_6 = __Pyx_PyBool_FromLong(__pyx_v_is_unique); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1933; __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 = 1933; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_INCREF(Py_True);
  PyTuple_SET_ITEM(__pyx_t_7, 0, Py_True);
  __Pyx_GIVEREF(Py_True);
  PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_6);
  __Pyx_GIVEREF(__pyx_t_6);
  __pyx_t_6 = 0;
  __pyx_r = __pyx_t_7;
  __pyx_t_7 = 0;
  goto __pyx_L0;

  /* "pandas/src/generated.pyx":1909
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def is_monotonic_int64(ndarray[int64_t] arr):             # <<<<<<<<<<<<<<
 *     '''
 *     Returns
 */

  /* function exit code */
  __pyx_L1_error:;
  __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_pybuffernd_arr.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas.algos.is_monotonic_int64", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_arr.rcbuffer->pybuffer);
  __pyx_L2:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/src/generated.pyx":1936
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def is_monotonic_bool(ndarray[uint8_t] arr):             # <<<<<<<<<<<<<<
 *     '''
 *     Returns
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pandas_5algos_197is_monotonic_bool(PyObject *__pyx_self, PyObject *__pyx_v_arr); /*proto*/
static char __pyx_doc_6pandas_5algos_196is_monotonic_bool[] = "\n    Returns\n    -------\n    is_monotonic, is_unique\n    ";
static PyMethodDef __pyx_mdef_6pandas_5algos_197is_monotonic_bool = {__Pyx_NAMESTR("is_monotonic_bool"), (PyCFunction)__pyx_pw_6pandas_5algos_197is_monotonic_bool, METH_O, __Pyx_DOCSTR(__pyx_doc_6pandas_5algos_196is_monotonic_bool)};
static PyObject *__pyx_pw_6pandas_5algos_197is_monotonic_bool(PyObject *__pyx_self, PyObject *__pyx_v_arr) {
  CYTHON_UNUSED int __pyx_lineno = 0;
  CYTHON_UNUSED const char *__pyx_filename = NULL;
  CYTHON_UNUSED int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("is_monotonic_bool (wrapper)", 0);
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_arr), __pyx_ptype_5numpy_ndarray, 1, "arr", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1936; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_196is_monotonic_bool(__pyx_self, ((PyArrayObject *)__pyx_v_arr));

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pandas_5algos_196is_monotonic_bool(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_arr) {
  Py_ssize_t __pyx_v_i;
  Py_ssize_t __pyx_v_n;
  __pyx_t_5numpy_uint8_t __pyx_v_prev;
  __pyx_t_5numpy_uint8_t __pyx_v_cur;
  int __pyx_v_is_unique;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_arr;
  __Pyx_Buffer __pyx_pybuffer_arr;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  Py_ssize_t __pyx_t_1;
  int __pyx_t_2;
  long __pyx_t_3;
  Py_ssize_t __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;
  __Pyx_RefNannySetupContext("is_monotonic_bool", 0);
  __pyx_pybuffer_arr.pybuffer.buf = NULL;
  __pyx_pybuffer_arr.refcount = 0;
  __pyx_pybuffernd_arr.data = NULL;
  __pyx_pybuffernd_arr.rcbuffer = &__pyx_pybuffer_arr;
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_arr.rcbuffer->pybuffer, (PyObject*)__pyx_v_arr, &__Pyx_TypeInfo_nn___pyx_t_5numpy_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1936; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_arr.diminfo[0].strides = __pyx_pybuffernd_arr.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_arr.diminfo[0].shape = __pyx_pybuffernd_arr.rcbuffer->pybuffer.shape[0];

  /* "pandas/src/generated.pyx":1945
 *         Py_ssize_t i, n
 *         uint8_t prev, cur
 *         bint is_unique = 1             # <<<<<<<<<<<<<<
 * 
 *     n = len(arr)
 */
  __pyx_v_is_unique = 1;

  /* "pandas/src/generated.pyx":1947
 *         bint is_unique = 1
 * 
 *     n = len(arr)             # <<<<<<<<<<<<<<
 * 
 *     if n < 2:
 */
  __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_arr)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1947; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_n = __pyx_t_1;

  /* "pandas/src/generated.pyx":1949
 *     n = len(arr)
 * 
 *     if n < 2:             # <<<<<<<<<<<<<<
 *         return True, True
 * 
 */
  __pyx_t_2 = ((__pyx_v_n < 2) != 0);
  if (__pyx_t_2) {

    /* "pandas/src/generated.pyx":1950
 * 
 *     if n < 2:
 *         return True, True             # <<<<<<<<<<<<<<
 * 
 *     prev = arr[0]
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(__pyx_tuple__108);
    __pyx_r = __pyx_tuple__108;
    goto __pyx_L0;
  }

  /* "pandas/src/generated.pyx":1952
 *         return True, True
 * 
 *     prev = arr[0]             # <<<<<<<<<<<<<<
 *     for i in range(1, n):
 *         cur = arr[i]
 */
  __pyx_t_3 = 0;
  __pyx_v_prev = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_uint8_t *, __pyx_pybuffernd_arr.rcbuffer->pybuffer.buf, __pyx_t_3, __pyx_pybuffernd_arr.diminfo[0].strides));

  /* "pandas/src/generated.pyx":1953
 * 
 *     prev = arr[0]
 *     for i in range(1, n):             # <<<<<<<<<<<<<<
 *         cur = arr[i]
 *         if cur < prev:
 */
  __pyx_t_1 = __pyx_v_n;
  for (__pyx_t_4 = 1; __pyx_t_4 < __pyx_t_1; __pyx_t_4+=1) {
    __pyx_v_i = __pyx_t_4;

    /* "pandas/src/generated.pyx":1954
 *     prev = arr[0]
 *     for i in range(1, n):
 *         cur = arr[i]             # <<<<<<<<<<<<<<
 *         if cur < prev:
 *             return False, None
 */
    __pyx_t_5 = __pyx_v_i;
    __pyx_v_cur = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_uint8_t *, __pyx_pybuffernd_arr.rcbuffer->pybuffer.buf, __pyx_t_5, __pyx_pybuffernd_arr.diminfo[0].strides));

    /* "pandas/src/generated.pyx":1955
 *     for i in range(1, n):
 *         cur = arr[i]
 *         if cur < prev:             # <<<<<<<<<<<<<<
 *             return False, None
 *         elif cur == prev:
 */
    __pyx_t_2 = ((__pyx_v_cur < __pyx_v_prev) != 0);
    if (__pyx_t_2) {

      /* "pandas/src/generated.pyx":1956
 *         cur = arr[i]
 *         if cur < prev:
 *             return False, None             # <<<<<<<<<<<<<<
 *         elif cur == prev:
 *             is_unique = 0
 */
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(__pyx_tuple__109);
      __pyx_r = __pyx_tuple__109;
      goto __pyx_L0;
    }

    /* "pandas/src/generated.pyx":1957
 *         if cur < prev:
 *             return False, None
 *         elif cur == prev:             # <<<<<<<<<<<<<<
 *             is_unique = 0
 *         prev = cur
 */
    __pyx_t_2 = ((__pyx_v_cur == __pyx_v_prev) != 0);
    if (__pyx_t_2) {

      /* "pandas/src/generated.pyx":1958
 *             return False, None
 *         elif cur == prev:
 *             is_unique = 0             # <<<<<<<<<<<<<<
 *         prev = cur
 *     return True, is_unique
 */
      __pyx_v_is_unique = 0;
      goto __pyx_L6;
    }
    __pyx_L6:;

    /* "pandas/src/generated.pyx":1959
 *         elif cur == prev:
 *             is_unique = 0
 *         prev = cur             # <<<<<<<<<<<<<<
 *     return True, is_unique
 * 
 */
    __pyx_v_prev = __pyx_v_cur;
  }

  /* "pandas/src/generated.pyx":1960
 *             is_unique = 0
 *         prev = cur
 *     return True, is_unique             # <<<<<<<<<<<<<<
 * 
 * @cython.wraparound(False)
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_6 = __Pyx_PyBool_FromLong(__pyx_v_is_unique); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1960; __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 = 1960; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_INCREF(Py_True);
  PyTuple_SET_ITEM(__pyx_t_7, 0, Py_True);
  __Pyx_GIVEREF(Py_True);
  PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_6);
  __Pyx_GIVEREF(__pyx_t_6);
  __pyx_t_6 = 0;
  __pyx_r = __pyx_t_7;
  __pyx_t_7 = 0;
  goto __pyx_L0;

  /* "pandas/src/generated.pyx":1936
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def is_monotonic_bool(ndarray[uint8_t] arr):             # <<<<<<<<<<<<<<
 *     '''
 *     Returns
 */

  /* function exit code */
  __pyx_L1_error:;
  __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_pybuffernd_arr.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas.algos.is_monotonic_bool", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_arr.rcbuffer->pybuffer);
  __pyx_L2:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/src/generated.pyx":1964
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def groupby_float64(ndarray[float64_t] index, ndarray labels):             # <<<<<<<<<<<<<<
 *     cdef dict result = {}
 *     cdef Py_ssize_t i, length
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pandas_5algos_199groupby_float64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_5algos_199groupby_float64 = {__Pyx_NAMESTR("groupby_float64"), (PyCFunction)__pyx_pw_6pandas_5algos_199groupby_float64, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pw_6pandas_5algos_199groupby_float64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyArrayObject *__pyx_v_index = 0;
  PyArrayObject *__pyx_v_labels = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("groupby_float64 (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_index,&__pyx_n_s_labels,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_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 (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_index)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_labels)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("groupby_float64", 1, 2, 2, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1964; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "groupby_float64") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1964; __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_labels = ((PyArrayObject *)values[1]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("groupby_float64", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1964; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas.algos.groupby_float64", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_index), __pyx_ptype_5numpy_ndarray, 1, "index", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1964; __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[2]; __pyx_lineno = 1964; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_198groupby_float64(__pyx_self, __pyx_v_index, __pyx_v_labels);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pandas_5algos_198groupby_float64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_index, PyArrayObject *__pyx_v_labels) {
  PyObject *__pyx_v_result = 0;
  Py_ssize_t __pyx_v_i;
  Py_ssize_t __pyx_v_length;
  PyObject *__pyx_v_members = 0;
  PyObject *__pyx_v_idx = 0;
  PyObject *__pyx_v_key = 0;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_index;
  __Pyx_Buffer __pyx_pybuffer_index;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  int __pyx_t_3;
  Py_ssize_t __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("groupby_float64", 0);
  __pyx_pybuffer_index.pybuffer.buf = NULL;
  __pyx_pybuffer_index.refcount = 0;
  __pyx_pybuffernd_index.data = NULL;
  __pyx_pybuffernd_index.rcbuffer = &__pyx_pybuffer_index;
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_index.rcbuffer->pybuffer, (PyObject*)__pyx_v_index, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1964; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_index.diminfo[0].strides = __pyx_pybuffernd_index.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_index.diminfo[0].shape = __pyx_pybuffernd_index.rcbuffer->pybuffer.shape[0];

  /* "pandas/src/generated.pyx":1965
 * @cython.boundscheck(False)
 * def groupby_float64(ndarray[float64_t] index, ndarray labels):
 *     cdef dict result = {}             # <<<<<<<<<<<<<<
 *     cdef Py_ssize_t i, length
 *     cdef list members
 */
  __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1965; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_result = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pandas/src/generated.pyx":1970
 *     cdef object idx, key
 * 
 *     length = len(index)             # <<<<<<<<<<<<<<
 * 
 *     if not length == len(labels):
 */
  __pyx_t_2 = PyObject_Length(((PyObject *)__pyx_v_index)); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1970; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_length = __pyx_t_2;

  /* "pandas/src/generated.pyx":1972
 *     length = len(index)
 * 
 *     if not length == len(labels):             # <<<<<<<<<<<<<<
 *        raise AssertionError("len(index) != len(labels)")
 * 
 */
  __pyx_t_2 = PyObject_Length(((PyObject *)__pyx_v_labels)); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1972; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_3 = ((!((__pyx_v_length == __pyx_t_2) != 0)) != 0);
  if (__pyx_t_3) {

    /* "pandas/src/generated.pyx":1973
 * 
 *     if not length == len(labels):
 *        raise AssertionError("len(index) != len(labels)")             # <<<<<<<<<<<<<<
 * 
 *     for i in range(length):
 */
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_AssertionError, __pyx_tuple__110, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1973; __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[2]; __pyx_lineno = 1973; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }

  /* "pandas/src/generated.pyx":1975
 *        raise AssertionError("len(index) != len(labels)")
 * 
 *     for i in range(length):             # <<<<<<<<<<<<<<
 *         key = util.get_value_1d(labels, i)
 * 
 */
  __pyx_t_2 = __pyx_v_length;
  for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_2; __pyx_t_4+=1) {
    __pyx_v_i = __pyx_t_4;

    /* "pandas/src/generated.pyx":1976
 * 
 *     for i in range(length):
 *         key = util.get_value_1d(labels, i)             # <<<<<<<<<<<<<<
 * 
 *         if _checknull(key):
 */
    __pyx_t_1 = get_value_1d(__pyx_v_labels, __pyx_v_i); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1976; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_XDECREF_SET(__pyx_v_key, __pyx_t_1);
    __pyx_t_1 = 0;

    /* "pandas/src/generated.pyx":1978
 *         key = util.get_value_1d(labels, i)
 * 
 *         if _checknull(key):             # <<<<<<<<<<<<<<
 *             continue
 * 
 */
    __pyx_t_3 = (__pyx_f_4util__checknull(__pyx_v_key) != 0);
    if (__pyx_t_3) {

      /* "pandas/src/generated.pyx":1979
 * 
 *         if _checknull(key):
 *             continue             # <<<<<<<<<<<<<<
 * 
 *         idx = index[i]
 */
      goto __pyx_L4_continue;
    }

    /* "pandas/src/generated.pyx":1981
 *             continue
 * 
 *         idx = index[i]             # <<<<<<<<<<<<<<
 *         if key in result:
 *             members = result[key]
 */
    __pyx_t_5 = __pyx_v_i;
    __pyx_t_1 = PyFloat_FromDouble((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_index.rcbuffer->pybuffer.buf, __pyx_t_5, __pyx_pybuffernd_index.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1981; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_XDECREF_SET(__pyx_v_idx, __pyx_t_1);
    __pyx_t_1 = 0;

    /* "pandas/src/generated.pyx":1982
 * 
 *         idx = index[i]
 *         if key in result:             # <<<<<<<<<<<<<<
 *             members = result[key]
 *             members.append(idx)
 */
    __pyx_t_3 = (__Pyx_PyDict_Contains(__pyx_v_key, __pyx_v_result, Py_EQ)); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1982; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_6 = (__pyx_t_3 != 0);
    if (__pyx_t_6) {

      /* "pandas/src/generated.pyx":1983
 *         idx = index[i]
 *         if key in result:
 *             members = result[key]             # <<<<<<<<<<<<<<
 *             members.append(idx)
 *         else:
 */
      __pyx_t_1 = __Pyx_PyDict_GetItem(__pyx_v_result, __pyx_v_key); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1983; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
      __Pyx_GOTREF(__pyx_t_1);
      if (!(likely(PyList_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "list", Py_TYPE(__pyx_t_1)->tp_name), 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1983; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_XDECREF_SET(__pyx_v_members, ((PyObject*)__pyx_t_1));
      __pyx_t_1 = 0;

      /* "pandas/src/generated.pyx":1984
 *         if key in result:
 *             members = result[key]
 *             members.append(idx)             # <<<<<<<<<<<<<<
 *         else:
 *             result[key] = [idx]
 */
      if (unlikely(__pyx_v_members == Py_None)) {
        PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "append");
        {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1984; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_t_7 = __Pyx_PyList_Append(__pyx_v_members, __pyx_v_idx); if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1984; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      goto __pyx_L7;
    }
    /*else*/ {

      /* "pandas/src/generated.pyx":1986
 *             members.append(idx)
 *         else:
 *             result[key] = [idx]             # <<<<<<<<<<<<<<
 * 
 *     return result
 */
      __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1986; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_INCREF(__pyx_v_idx);
      PyList_SET_ITEM(__pyx_t_1, 0, __pyx_v_idx);
      __Pyx_GIVEREF(__pyx_v_idx);
      if (unlikely(PyDict_SetItem(__pyx_v_result, __pyx_v_key, __pyx_t_1) < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1986; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    }
    __pyx_L7:;
    __pyx_L4_continue:;
  }

  /* "pandas/src/generated.pyx":1988
 *             result[key] = [idx]
 * 
 *     return result             # <<<<<<<<<<<<<<
 * 
 * @cython.wraparound(False)
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_result);
  __pyx_r = __pyx_v_result;
  goto __pyx_L0;

  /* "pandas/src/generated.pyx":1964
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def groupby_float64(ndarray[float64_t] index, ndarray labels):             # <<<<<<<<<<<<<<
 *     cdef dict result = {}
 *     cdef Py_ssize_t i, length
 */

  /* function exit code */
  __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_pybuffernd_index.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas.algos.groupby_float64", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_index.rcbuffer->pybuffer);
  __pyx_L2:;
  __Pyx_XDECREF(__pyx_v_result);
  __Pyx_XDECREF(__pyx_v_members);
  __Pyx_XDECREF(__pyx_v_idx);
  __Pyx_XDECREF(__pyx_v_key);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/src/generated.pyx":1992
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def groupby_float32(ndarray[float32_t] index, ndarray labels):             # <<<<<<<<<<<<<<
 *     cdef dict result = {}
 *     cdef Py_ssize_t i, length
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pandas_5algos_201groupby_float32(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_5algos_201groupby_float32 = {__Pyx_NAMESTR("groupby_float32"), (PyCFunction)__pyx_pw_6pandas_5algos_201groupby_float32, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pw_6pandas_5algos_201groupby_float32(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyArrayObject *__pyx_v_index = 0;
  PyArrayObject *__pyx_v_labels = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("groupby_float32 (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_index,&__pyx_n_s_labels,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_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 (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_index)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_labels)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("groupby_float32", 1, 2, 2, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1992; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "groupby_float32") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1992; __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_labels = ((PyArrayObject *)values[1]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("groupby_float32", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1992; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas.algos.groupby_float32", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_index), __pyx_ptype_5numpy_ndarray, 1, "index", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1992; __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[2]; __pyx_lineno = 1992; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_200groupby_float32(__pyx_self, __pyx_v_index, __pyx_v_labels);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pandas_5algos_200groupby_float32(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_index, PyArrayObject *__pyx_v_labels) {
  PyObject *__pyx_v_result = 0;
  Py_ssize_t __pyx_v_i;
  Py_ssize_t __pyx_v_length;
  PyObject *__pyx_v_members = 0;
  PyObject *__pyx_v_idx = 0;
  PyObject *__pyx_v_key = 0;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_index;
  __Pyx_Buffer __pyx_pybuffer_index;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  int __pyx_t_3;
  Py_ssize_t __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("groupby_float32", 0);
  __pyx_pybuffer_index.pybuffer.buf = NULL;
  __pyx_pybuffer_index.refcount = 0;
  __pyx_pybuffernd_index.data = NULL;
  __pyx_pybuffernd_index.rcbuffer = &__pyx_pybuffer_index;
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_index.rcbuffer->pybuffer, (PyObject*)__pyx_v_index, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1992; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_index.diminfo[0].strides = __pyx_pybuffernd_index.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_index.diminfo[0].shape = __pyx_pybuffernd_index.rcbuffer->pybuffer.shape[0];

  /* "pandas/src/generated.pyx":1993
 * @cython.boundscheck(False)
 * def groupby_float32(ndarray[float32_t] index, ndarray labels):
 *     cdef dict result = {}             # <<<<<<<<<<<<<<
 *     cdef Py_ssize_t i, length
 *     cdef list members
 */
  __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1993; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_result = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pandas/src/generated.pyx":1998
 *     cdef object idx, key
 * 
 *     length = len(index)             # <<<<<<<<<<<<<<
 * 
 *     if not length == len(labels):
 */
  __pyx_t_2 = PyObject_Length(((PyObject *)__pyx_v_index)); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1998; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_length = __pyx_t_2;

  /* "pandas/src/generated.pyx":2000
 *     length = len(index)
 * 
 *     if not length == len(labels):             # <<<<<<<<<<<<<<
 *        raise AssertionError("len(index) != len(labels)")
 * 
 */
  __pyx_t_2 = PyObject_Length(((PyObject *)__pyx_v_labels)); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2000; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_3 = ((!((__pyx_v_length == __pyx_t_2) != 0)) != 0);
  if (__pyx_t_3) {

    /* "pandas/src/generated.pyx":2001
 * 
 *     if not length == len(labels):
 *        raise AssertionError("len(index) != len(labels)")             # <<<<<<<<<<<<<<
 * 
 *     for i in range(length):
 */
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_AssertionError, __pyx_tuple__111, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2001; __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[2]; __pyx_lineno = 2001; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }

  /* "pandas/src/generated.pyx":2003
 *        raise AssertionError("len(index) != len(labels)")
 * 
 *     for i in range(length):             # <<<<<<<<<<<<<<
 *         key = util.get_value_1d(labels, i)
 * 
 */
  __pyx_t_2 = __pyx_v_length;
  for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_2; __pyx_t_4+=1) {
    __pyx_v_i = __pyx_t_4;

    /* "pandas/src/generated.pyx":2004
 * 
 *     for i in range(length):
 *         key = util.get_value_1d(labels, i)             # <<<<<<<<<<<<<<
 * 
 *         if _checknull(key):
 */
    __pyx_t_1 = get_value_1d(__pyx_v_labels, __pyx_v_i); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2004; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_XDECREF_SET(__pyx_v_key, __pyx_t_1);
    __pyx_t_1 = 0;

    /* "pandas/src/generated.pyx":2006
 *         key = util.get_value_1d(labels, i)
 * 
 *         if _checknull(key):             # <<<<<<<<<<<<<<
 *             continue
 * 
 */
    __pyx_t_3 = (__pyx_f_4util__checknull(__pyx_v_key) != 0);
    if (__pyx_t_3) {

      /* "pandas/src/generated.pyx":2007
 * 
 *         if _checknull(key):
 *             continue             # <<<<<<<<<<<<<<
 * 
 *         idx = index[i]
 */
      goto __pyx_L4_continue;
    }

    /* "pandas/src/generated.pyx":2009
 *             continue
 * 
 *         idx = index[i]             # <<<<<<<<<<<<<<
 *         if key in result:
 *             members = result[key]
 */
    __pyx_t_5 = __pyx_v_i;
    __pyx_t_1 = PyFloat_FromDouble((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_index.rcbuffer->pybuffer.buf, __pyx_t_5, __pyx_pybuffernd_index.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2009; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_XDECREF_SET(__pyx_v_idx, __pyx_t_1);
    __pyx_t_1 = 0;

    /* "pandas/src/generated.pyx":2010
 * 
 *         idx = index[i]
 *         if key in result:             # <<<<<<<<<<<<<<
 *             members = result[key]
 *             members.append(idx)
 */
    __pyx_t_3 = (__Pyx_PyDict_Contains(__pyx_v_key, __pyx_v_result, Py_EQ)); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2010; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_6 = (__pyx_t_3 != 0);
    if (__pyx_t_6) {

      /* "pandas/src/generated.pyx":2011
 *         idx = index[i]
 *         if key in result:
 *             members = result[key]             # <<<<<<<<<<<<<<
 *             members.append(idx)
 *         else:
 */
      __pyx_t_1 = __Pyx_PyDict_GetItem(__pyx_v_result, __pyx_v_key); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2011; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
      __Pyx_GOTREF(__pyx_t_1);
      if (!(likely(PyList_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "list", Py_TYPE(__pyx_t_1)->tp_name), 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2011; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_XDECREF_SET(__pyx_v_members, ((PyObject*)__pyx_t_1));
      __pyx_t_1 = 0;

      /* "pandas/src/generated.pyx":2012
 *         if key in result:
 *             members = result[key]
 *             members.append(idx)             # <<<<<<<<<<<<<<
 *         else:
 *             result[key] = [idx]
 */
      if (unlikely(__pyx_v_members == Py_None)) {
        PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "append");
        {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2012; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_t_7 = __Pyx_PyList_Append(__pyx_v_members, __pyx_v_idx); if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2012; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      goto __pyx_L7;
    }
    /*else*/ {

      /* "pandas/src/generated.pyx":2014
 *             members.append(idx)
 *         else:
 *             result[key] = [idx]             # <<<<<<<<<<<<<<
 * 
 *     return result
 */
      __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2014; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_INCREF(__pyx_v_idx);
      PyList_SET_ITEM(__pyx_t_1, 0, __pyx_v_idx);
      __Pyx_GIVEREF(__pyx_v_idx);
      if (unlikely(PyDict_SetItem(__pyx_v_result, __pyx_v_key, __pyx_t_1) < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2014; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    }
    __pyx_L7:;
    __pyx_L4_continue:;
  }

  /* "pandas/src/generated.pyx":2016
 *             result[key] = [idx]
 * 
 *     return result             # <<<<<<<<<<<<<<
 * 
 * @cython.wraparound(False)
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_result);
  __pyx_r = __pyx_v_result;
  goto __pyx_L0;

  /* "pandas/src/generated.pyx":1992
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def groupby_float32(ndarray[float32_t] index, ndarray labels):             # <<<<<<<<<<<<<<
 *     cdef dict result = {}
 *     cdef Py_ssize_t i, length
 */

  /* function exit code */
  __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_pybuffernd_index.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas.algos.groupby_float32", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_index.rcbuffer->pybuffer);
  __pyx_L2:;
  __Pyx_XDECREF(__pyx_v_result);
  __Pyx_XDECREF(__pyx_v_members);
  __Pyx_XDECREF(__pyx_v_idx);
  __Pyx_XDECREF(__pyx_v_key);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/src/generated.pyx":2020
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def groupby_object(ndarray[object] index, ndarray labels):             # <<<<<<<<<<<<<<
 *     cdef dict result = {}
 *     cdef Py_ssize_t i, length
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pandas_5algos_203groupby_object(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_5algos_203groupby_object = {__Pyx_NAMESTR("groupby_object"), (PyCFunction)__pyx_pw_6pandas_5algos_203groupby_object, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pw_6pandas_5algos_203groupby_object(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyArrayObject *__pyx_v_index = 0;
  PyArrayObject *__pyx_v_labels = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("groupby_object (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_index,&__pyx_n_s_labels,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_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 (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_index)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_labels)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("groupby_object", 1, 2, 2, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2020; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "groupby_object") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2020; __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_labels = ((PyArrayObject *)values[1]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("groupby_object", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2020; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas.algos.groupby_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_index), __pyx_ptype_5numpy_ndarray, 1, "index", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2020; __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[2]; __pyx_lineno = 2020; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_202groupby_object(__pyx_self, __pyx_v_index, __pyx_v_labels);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pandas_5algos_202groupby_object(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_index, PyArrayObject *__pyx_v_labels) {
  PyObject *__pyx_v_result = 0;
  Py_ssize_t __pyx_v_i;
  Py_ssize_t __pyx_v_length;
  PyObject *__pyx_v_members = 0;
  PyObject *__pyx_v_idx = 0;
  PyObject *__pyx_v_key = 0;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_index;
  __Pyx_Buffer __pyx_pybuffer_index;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  int __pyx_t_3;
  Py_ssize_t __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("groupby_object", 0);
  __pyx_pybuffer_index.pybuffer.buf = NULL;
  __pyx_pybuffer_index.refcount = 0;
  __pyx_pybuffernd_index.data = NULL;
  __pyx_pybuffernd_index.rcbuffer = &__pyx_pybuffer_index;
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_index.rcbuffer->pybuffer, (PyObject*)__pyx_v_index, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2020; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_index.diminfo[0].strides = __pyx_pybuffernd_index.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_index.diminfo[0].shape = __pyx_pybuffernd_index.rcbuffer->pybuffer.shape[0];

  /* "pandas/src/generated.pyx":2021
 * @cython.boundscheck(False)
 * def groupby_object(ndarray[object] index, ndarray labels):
 *     cdef dict result = {}             # <<<<<<<<<<<<<<
 *     cdef Py_ssize_t i, length
 *     cdef list members
 */
  __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2021; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_result = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pandas/src/generated.pyx":2026
 *     cdef object idx, key
 * 
 *     length = len(index)             # <<<<<<<<<<<<<<
 * 
 *     if not length == len(labels):
 */
  __pyx_t_2 = PyObject_Length(((PyObject *)__pyx_v_index)); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2026; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_length = __pyx_t_2;

  /* "pandas/src/generated.pyx":2028
 *     length = len(index)
 * 
 *     if not length == len(labels):             # <<<<<<<<<<<<<<
 *        raise AssertionError("len(index) != len(labels)")
 * 
 */
  __pyx_t_2 = PyObject_Length(((PyObject *)__pyx_v_labels)); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2028; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_3 = ((!((__pyx_v_length == __pyx_t_2) != 0)) != 0);
  if (__pyx_t_3) {

    /* "pandas/src/generated.pyx":2029
 * 
 *     if not length == len(labels):
 *        raise AssertionError("len(index) != len(labels)")             # <<<<<<<<<<<<<<
 * 
 *     for i in range(length):
 */
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_AssertionError, __pyx_tuple__112, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2029; __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[2]; __pyx_lineno = 2029; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }

  /* "pandas/src/generated.pyx":2031
 *        raise AssertionError("len(index) != len(labels)")
 * 
 *     for i in range(length):             # <<<<<<<<<<<<<<
 *         key = util.get_value_1d(labels, i)
 * 
 */
  __pyx_t_2 = __pyx_v_length;
  for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_2; __pyx_t_4+=1) {
    __pyx_v_i = __pyx_t_4;

    /* "pandas/src/generated.pyx":2032
 * 
 *     for i in range(length):
 *         key = util.get_value_1d(labels, i)             # <<<<<<<<<<<<<<
 * 
 *         if _checknull(key):
 */
    __pyx_t_1 = get_value_1d(__pyx_v_labels, __pyx_v_i); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2032; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_XDECREF_SET(__pyx_v_key, __pyx_t_1);
    __pyx_t_1 = 0;

    /* "pandas/src/generated.pyx":2034
 *         key = util.get_value_1d(labels, i)
 * 
 *         if _checknull(key):             # <<<<<<<<<<<<<<
 *             continue
 * 
 */
    __pyx_t_3 = (__pyx_f_4util__checknull(__pyx_v_key) != 0);
    if (__pyx_t_3) {

      /* "pandas/src/generated.pyx":2035
 * 
 *         if _checknull(key):
 *             continue             # <<<<<<<<<<<<<<
 * 
 *         idx = index[i]
 */
      goto __pyx_L4_continue;
    }

    /* "pandas/src/generated.pyx":2037
 *             continue
 * 
 *         idx = index[i]             # <<<<<<<<<<<<<<
 *         if key in result:
 *             members = result[key]
 */
    __pyx_t_5 = __pyx_v_i;
    __pyx_t_1 = (PyObject *) *__Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_index.rcbuffer->pybuffer.buf, __pyx_t_5, __pyx_pybuffernd_index.diminfo[0].strides);
    __Pyx_INCREF((PyObject*)__pyx_t_1);
    __Pyx_XDECREF_SET(__pyx_v_idx, __pyx_t_1);
    __pyx_t_1 = 0;

    /* "pandas/src/generated.pyx":2038
 * 
 *         idx = index[i]
 *         if key in result:             # <<<<<<<<<<<<<<
 *             members = result[key]
 *             members.append(idx)
 */
    __pyx_t_3 = (__Pyx_PyDict_Contains(__pyx_v_key, __pyx_v_result, Py_EQ)); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2038; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_6 = (__pyx_t_3 != 0);
    if (__pyx_t_6) {

      /* "pandas/src/generated.pyx":2039
 *         idx = index[i]
 *         if key in result:
 *             members = result[key]             # <<<<<<<<<<<<<<
 *             members.append(idx)
 *         else:
 */
      __pyx_t_1 = __Pyx_PyDict_GetItem(__pyx_v_result, __pyx_v_key); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2039; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
      __Pyx_GOTREF(__pyx_t_1);
      if (!(likely(PyList_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "list", Py_TYPE(__pyx_t_1)->tp_name), 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2039; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_XDECREF_SET(__pyx_v_members, ((PyObject*)__pyx_t_1));
      __pyx_t_1 = 0;

      /* "pandas/src/generated.pyx":2040
 *         if key in result:
 *             members = result[key]
 *             members.append(idx)             # <<<<<<<<<<<<<<
 *         else:
 *             result[key] = [idx]
 */
      if (unlikely(__pyx_v_members == Py_None)) {
        PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "append");
        {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2040; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_t_7 = __Pyx_PyList_Append(__pyx_v_members, __pyx_v_idx); if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2040; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      goto __pyx_L7;
    }
    /*else*/ {

      /* "pandas/src/generated.pyx":2042
 *             members.append(idx)
 *         else:
 *             result[key] = [idx]             # <<<<<<<<<<<<<<
 * 
 *     return result
 */
      __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2042; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_INCREF(__pyx_v_idx);
      PyList_SET_ITEM(__pyx_t_1, 0, __pyx_v_idx);
      __Pyx_GIVEREF(__pyx_v_idx);
      if (unlikely(PyDict_SetItem(__pyx_v_result, __pyx_v_key, __pyx_t_1) < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2042; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    }
    __pyx_L7:;
    __pyx_L4_continue:;
  }

  /* "pandas/src/generated.pyx":2044
 *             result[key] = [idx]
 * 
 *     return result             # <<<<<<<<<<<<<<
 * 
 * @cython.wraparound(False)
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_result);
  __pyx_r = __pyx_v_result;
  goto __pyx_L0;

  /* "pandas/src/generated.pyx":2020
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def groupby_object(ndarray[object] index, ndarray labels):             # <<<<<<<<<<<<<<
 *     cdef dict result = {}
 *     cdef Py_ssize_t i, length
 */

  /* function exit code */
  __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_pybuffernd_index.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas.algos.groupby_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_index.rcbuffer->pybuffer);
  __pyx_L2:;
  __Pyx_XDECREF(__pyx_v_result);
  __Pyx_XDECREF(__pyx_v_members);
  __Pyx_XDECREF(__pyx_v_idx);
  __Pyx_XDECREF(__pyx_v_key);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/src/generated.pyx":2048
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def groupby_int32(ndarray[int32_t] index, ndarray labels):             # <<<<<<<<<<<<<<
 *     cdef dict result = {}
 *     cdef Py_ssize_t i, length
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pandas_5algos_205groupby_int32(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_5algos_205groupby_int32 = {__Pyx_NAMESTR("groupby_int32"), (PyCFunction)__pyx_pw_6pandas_5algos_205groupby_int32, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pw_6pandas_5algos_205groupby_int32(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyArrayObject *__pyx_v_index = 0;
  PyArrayObject *__pyx_v_labels = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("groupby_int32 (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_index,&__pyx_n_s_labels,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_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 (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_index)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_labels)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("groupby_int32", 1, 2, 2, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2048; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "groupby_int32") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2048; __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_labels = ((PyArrayObject *)values[1]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("groupby_int32", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2048; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas.algos.groupby_int32", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_index), __pyx_ptype_5numpy_ndarray, 1, "index", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2048; __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[2]; __pyx_lineno = 2048; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_204groupby_int32(__pyx_self, __pyx_v_index, __pyx_v_labels);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pandas_5algos_204groupby_int32(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_index, PyArrayObject *__pyx_v_labels) {
  PyObject *__pyx_v_result = 0;
  Py_ssize_t __pyx_v_i;
  Py_ssize_t __pyx_v_length;
  PyObject *__pyx_v_members = 0;
  PyObject *__pyx_v_idx = 0;
  PyObject *__pyx_v_key = 0;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_index;
  __Pyx_Buffer __pyx_pybuffer_index;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  int __pyx_t_3;
  Py_ssize_t __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("groupby_int32", 0);
  __pyx_pybuffer_index.pybuffer.buf = NULL;
  __pyx_pybuffer_index.refcount = 0;
  __pyx_pybuffernd_index.data = NULL;
  __pyx_pybuffernd_index.rcbuffer = &__pyx_pybuffer_index;
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_index.rcbuffer->pybuffer, (PyObject*)__pyx_v_index, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2048; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_index.diminfo[0].strides = __pyx_pybuffernd_index.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_index.diminfo[0].shape = __pyx_pybuffernd_index.rcbuffer->pybuffer.shape[0];

  /* "pandas/src/generated.pyx":2049
 * @cython.boundscheck(False)
 * def groupby_int32(ndarray[int32_t] index, ndarray labels):
 *     cdef dict result = {}             # <<<<<<<<<<<<<<
 *     cdef Py_ssize_t i, length
 *     cdef list members
 */
  __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2049; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_result = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pandas/src/generated.pyx":2054
 *     cdef object idx, key
 * 
 *     length = len(index)             # <<<<<<<<<<<<<<
 * 
 *     if not length == len(labels):
 */
  __pyx_t_2 = PyObject_Length(((PyObject *)__pyx_v_index)); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2054; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_length = __pyx_t_2;

  /* "pandas/src/generated.pyx":2056
 *     length = len(index)
 * 
 *     if not length == len(labels):             # <<<<<<<<<<<<<<
 *        raise AssertionError("len(index) != len(labels)")
 * 
 */
  __pyx_t_2 = PyObject_Length(((PyObject *)__pyx_v_labels)); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2056; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_3 = ((!((__pyx_v_length == __pyx_t_2) != 0)) != 0);
  if (__pyx_t_3) {

    /* "pandas/src/generated.pyx":2057
 * 
 *     if not length == len(labels):
 *        raise AssertionError("len(index) != len(labels)")             # <<<<<<<<<<<<<<
 * 
 *     for i in range(length):
 */
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_AssertionError, __pyx_tuple__113, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2057; __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[2]; __pyx_lineno = 2057; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }

  /* "pandas/src/generated.pyx":2059
 *        raise AssertionError("len(index) != len(labels)")
 * 
 *     for i in range(length):             # <<<<<<<<<<<<<<
 *         key = util.get_value_1d(labels, i)
 * 
 */
  __pyx_t_2 = __pyx_v_length;
  for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_2; __pyx_t_4+=1) {
    __pyx_v_i = __pyx_t_4;

    /* "pandas/src/generated.pyx":2060
 * 
 *     for i in range(length):
 *         key = util.get_value_1d(labels, i)             # <<<<<<<<<<<<<<
 * 
 *         if _checknull(key):
 */
    __pyx_t_1 = get_value_1d(__pyx_v_labels, __pyx_v_i); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2060; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_XDECREF_SET(__pyx_v_key, __pyx_t_1);
    __pyx_t_1 = 0;

    /* "pandas/src/generated.pyx":2062
 *         key = util.get_value_1d(labels, i)
 * 
 *         if _checknull(key):             # <<<<<<<<<<<<<<
 *             continue
 * 
 */
    __pyx_t_3 = (__pyx_f_4util__checknull(__pyx_v_key) != 0);
    if (__pyx_t_3) {

      /* "pandas/src/generated.pyx":2063
 * 
 *         if _checknull(key):
 *             continue             # <<<<<<<<<<<<<<
 * 
 *         idx = index[i]
 */
      goto __pyx_L4_continue;
    }

    /* "pandas/src/generated.pyx":2065
 *             continue
 * 
 *         idx = index[i]             # <<<<<<<<<<<<<<
 *         if key in result:
 *             members = result[key]
 */
    __pyx_t_5 = __pyx_v_i;
    __pyx_t_1 = __Pyx_PyInt_From_npy_int32((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_index.rcbuffer->pybuffer.buf, __pyx_t_5, __pyx_pybuffernd_index.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2065; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_XDECREF_SET(__pyx_v_idx, __pyx_t_1);
    __pyx_t_1 = 0;

    /* "pandas/src/generated.pyx":2066
 * 
 *         idx = index[i]
 *         if key in result:             # <<<<<<<<<<<<<<
 *             members = result[key]
 *             members.append(idx)
 */
    __pyx_t_3 = (__Pyx_PyDict_Contains(__pyx_v_key, __pyx_v_result, Py_EQ)); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2066; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_6 = (__pyx_t_3 != 0);
    if (__pyx_t_6) {

      /* "pandas/src/generated.pyx":2067
 *         idx = index[i]
 *         if key in result:
 *             members = result[key]             # <<<<<<<<<<<<<<
 *             members.append(idx)
 *         else:
 */
      __pyx_t_1 = __Pyx_PyDict_GetItem(__pyx_v_result, __pyx_v_key); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2067; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
      __Pyx_GOTREF(__pyx_t_1);
      if (!(likely(PyList_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "list", Py_TYPE(__pyx_t_1)->tp_name), 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2067; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_XDECREF_SET(__pyx_v_members, ((PyObject*)__pyx_t_1));
      __pyx_t_1 = 0;

      /* "pandas/src/generated.pyx":2068
 *         if key in result:
 *             members = result[key]
 *             members.append(idx)             # <<<<<<<<<<<<<<
 *         else:
 *             result[key] = [idx]
 */
      if (unlikely(__pyx_v_members == Py_None)) {
        PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "append");
        {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2068; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_t_7 = __Pyx_PyList_Append(__pyx_v_members, __pyx_v_idx); if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2068; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      goto __pyx_L7;
    }
    /*else*/ {

      /* "pandas/src/generated.pyx":2070
 *             members.append(idx)
 *         else:
 *             result[key] = [idx]             # <<<<<<<<<<<<<<
 * 
 *     return result
 */
      __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2070; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_INCREF(__pyx_v_idx);
      PyList_SET_ITEM(__pyx_t_1, 0, __pyx_v_idx);
      __Pyx_GIVEREF(__pyx_v_idx);
      if (unlikely(PyDict_SetItem(__pyx_v_result, __pyx_v_key, __pyx_t_1) < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2070; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    }
    __pyx_L7:;
    __pyx_L4_continue:;
  }

  /* "pandas/src/generated.pyx":2072
 *             result[key] = [idx]
 * 
 *     return result             # <<<<<<<<<<<<<<
 * 
 * @cython.wraparound(False)
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_result);
  __pyx_r = __pyx_v_result;
  goto __pyx_L0;

  /* "pandas/src/generated.pyx":2048
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def groupby_int32(ndarray[int32_t] index, ndarray labels):             # <<<<<<<<<<<<<<
 *     cdef dict result = {}
 *     cdef Py_ssize_t i, length
 */

  /* function exit code */
  __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_pybuffernd_index.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas.algos.groupby_int32", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_index.rcbuffer->pybuffer);
  __pyx_L2:;
  __Pyx_XDECREF(__pyx_v_result);
  __Pyx_XDECREF(__pyx_v_members);
  __Pyx_XDECREF(__pyx_v_idx);
  __Pyx_XDECREF(__pyx_v_key);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/src/generated.pyx":2076
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def groupby_int64(ndarray[int64_t] index, ndarray labels):             # <<<<<<<<<<<<<<
 *     cdef dict result = {}
 *     cdef Py_ssize_t i, length
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pandas_5algos_207groupby_int64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_5algos_207groupby_int64 = {__Pyx_NAMESTR("groupby_int64"), (PyCFunction)__pyx_pw_6pandas_5algos_207groupby_int64, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pw_6pandas_5algos_207groupby_int64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyArrayObject *__pyx_v_index = 0;
  PyArrayObject *__pyx_v_labels = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("groupby_int64 (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_index,&__pyx_n_s_labels,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_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 (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_index)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_labels)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("groupby_int64", 1, 2, 2, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2076; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "groupby_int64") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2076; __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_labels = ((PyArrayObject *)values[1]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("groupby_int64", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2076; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas.algos.groupby_int64", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_index), __pyx_ptype_5numpy_ndarray, 1, "index", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2076; __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[2]; __pyx_lineno = 2076; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_206groupby_int64(__pyx_self, __pyx_v_index, __pyx_v_labels);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pandas_5algos_206groupby_int64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_index, PyArrayObject *__pyx_v_labels) {
  PyObject *__pyx_v_result = 0;
  Py_ssize_t __pyx_v_i;
  Py_ssize_t __pyx_v_length;
  PyObject *__pyx_v_members = 0;
  PyObject *__pyx_v_idx = 0;
  PyObject *__pyx_v_key = 0;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_index;
  __Pyx_Buffer __pyx_pybuffer_index;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  int __pyx_t_3;
  Py_ssize_t __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("groupby_int64", 0);
  __pyx_pybuffer_index.pybuffer.buf = NULL;
  __pyx_pybuffer_index.refcount = 0;
  __pyx_pybuffernd_index.data = NULL;
  __pyx_pybuffernd_index.rcbuffer = &__pyx_pybuffer_index;
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_index.rcbuffer->pybuffer, (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[2]; __pyx_lineno = 2076; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_index.diminfo[0].strides = __pyx_pybuffernd_index.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_index.diminfo[0].shape = __pyx_pybuffernd_index.rcbuffer->pybuffer.shape[0];

  /* "pandas/src/generated.pyx":2077
 * @cython.boundscheck(False)
 * def groupby_int64(ndarray[int64_t] index, ndarray labels):
 *     cdef dict result = {}             # <<<<<<<<<<<<<<
 *     cdef Py_ssize_t i, length
 *     cdef list members
 */
  __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2077; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_result = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pandas/src/generated.pyx":2082
 *     cdef object idx, key
 * 
 *     length = len(index)             # <<<<<<<<<<<<<<
 * 
 *     if not length == len(labels):
 */
  __pyx_t_2 = PyObject_Length(((PyObject *)__pyx_v_index)); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2082; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_length = __pyx_t_2;

  /* "pandas/src/generated.pyx":2084
 *     length = len(index)
 * 
 *     if not length == len(labels):             # <<<<<<<<<<<<<<
 *        raise AssertionError("len(index) != len(labels)")
 * 
 */
  __pyx_t_2 = PyObject_Length(((PyObject *)__pyx_v_labels)); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2084; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_3 = ((!((__pyx_v_length == __pyx_t_2) != 0)) != 0);
  if (__pyx_t_3) {

    /* "pandas/src/generated.pyx":2085
 * 
 *     if not length == len(labels):
 *        raise AssertionError("len(index) != len(labels)")             # <<<<<<<<<<<<<<
 * 
 *     for i in range(length):
 */
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_AssertionError, __pyx_tuple__114, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2085; __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[2]; __pyx_lineno = 2085; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }

  /* "pandas/src/generated.pyx":2087
 *        raise AssertionError("len(index) != len(labels)")
 * 
 *     for i in range(length):             # <<<<<<<<<<<<<<
 *         key = util.get_value_1d(labels, i)
 * 
 */
  __pyx_t_2 = __pyx_v_length;
  for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_2; __pyx_t_4+=1) {
    __pyx_v_i = __pyx_t_4;

    /* "pandas/src/generated.pyx":2088
 * 
 *     for i in range(length):
 *         key = util.get_value_1d(labels, i)             # <<<<<<<<<<<<<<
 * 
 *         if _checknull(key):
 */
    __pyx_t_1 = get_value_1d(__pyx_v_labels, __pyx_v_i); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2088; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_XDECREF_SET(__pyx_v_key, __pyx_t_1);
    __pyx_t_1 = 0;

    /* "pandas/src/generated.pyx":2090
 *         key = util.get_value_1d(labels, i)
 * 
 *         if _checknull(key):             # <<<<<<<<<<<<<<
 *             continue
 * 
 */
    __pyx_t_3 = (__pyx_f_4util__checknull(__pyx_v_key) != 0);
    if (__pyx_t_3) {

      /* "pandas/src/generated.pyx":2091
 * 
 *         if _checknull(key):
 *             continue             # <<<<<<<<<<<<<<
 * 
 *         idx = index[i]
 */
      goto __pyx_L4_continue;
    }

    /* "pandas/src/generated.pyx":2093
 *             continue
 * 
 *         idx = index[i]             # <<<<<<<<<<<<<<
 *         if key in result:
 *             members = result[key]
 */
    __pyx_t_5 = __pyx_v_i;
    __pyx_t_1 = __Pyx_PyInt_From_npy_int64((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_index.rcbuffer->pybuffer.buf, __pyx_t_5, __pyx_pybuffernd_index.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2093; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_XDECREF_SET(__pyx_v_idx, __pyx_t_1);
    __pyx_t_1 = 0;

    /* "pandas/src/generated.pyx":2094
 * 
 *         idx = index[i]
 *         if key in result:             # <<<<<<<<<<<<<<
 *             members = result[key]
 *             members.append(idx)
 */
    __pyx_t_3 = (__Pyx_PyDict_Contains(__pyx_v_key, __pyx_v_result, Py_EQ)); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2094; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_6 = (__pyx_t_3 != 0);
    if (__pyx_t_6) {

      /* "pandas/src/generated.pyx":2095
 *         idx = index[i]
 *         if key in result:
 *             members = result[key]             # <<<<<<<<<<<<<<
 *             members.append(idx)
 *         else:
 */
      __pyx_t_1 = __Pyx_PyDict_GetItem(__pyx_v_result, __pyx_v_key); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2095; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
      __Pyx_GOTREF(__pyx_t_1);
      if (!(likely(PyList_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "list", Py_TYPE(__pyx_t_1)->tp_name), 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2095; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_XDECREF_SET(__pyx_v_members, ((PyObject*)__pyx_t_1));
      __pyx_t_1 = 0;

      /* "pandas/src/generated.pyx":2096
 *         if key in result:
 *             members = result[key]
 *             members.append(idx)             # <<<<<<<<<<<<<<
 *         else:
 *             result[key] = [idx]
 */
      if (unlikely(__pyx_v_members == Py_None)) {
        PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "append");
        {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2096; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_t_7 = __Pyx_PyList_Append(__pyx_v_members, __pyx_v_idx); if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2096; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      goto __pyx_L7;
    }
    /*else*/ {

      /* "pandas/src/generated.pyx":2098
 *             members.append(idx)
 *         else:
 *             result[key] = [idx]             # <<<<<<<<<<<<<<
 * 
 *     return result
 */
      __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2098; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_INCREF(__pyx_v_idx);
      PyList_SET_ITEM(__pyx_t_1, 0, __pyx_v_idx);
      __Pyx_GIVEREF(__pyx_v_idx);
      if (unlikely(PyDict_SetItem(__pyx_v_result, __pyx_v_key, __pyx_t_1) < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2098; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    }
    __pyx_L7:;
    __pyx_L4_continue:;
  }

  /* "pandas/src/generated.pyx":2100
 *             result[key] = [idx]
 * 
 *     return result             # <<<<<<<<<<<<<<
 * 
 * @cython.wraparound(False)
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_result);
  __pyx_r = __pyx_v_result;
  goto __pyx_L0;

  /* "pandas/src/generated.pyx":2076
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def groupby_int64(ndarray[int64_t] index, ndarray labels):             # <<<<<<<<<<<<<<
 *     cdef dict result = {}
 *     cdef Py_ssize_t i, length
 */

  /* function exit code */
  __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_pybuffernd_index.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas.algos.groupby_int64", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_index.rcbuffer->pybuffer);
  __pyx_L2:;
  __Pyx_XDECREF(__pyx_v_result);
  __Pyx_XDECREF(__pyx_v_members);
  __Pyx_XDECREF(__pyx_v_idx);
  __Pyx_XDECREF(__pyx_v_key);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/src/generated.pyx":2104
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def groupby_bool(ndarray[uint8_t] index, ndarray labels):             # <<<<<<<<<<<<<<
 *     cdef dict result = {}
 *     cdef Py_ssize_t i, length
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pandas_5algos_209groupby_bool(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_5algos_209groupby_bool = {__Pyx_NAMESTR("groupby_bool"), (PyCFunction)__pyx_pw_6pandas_5algos_209groupby_bool, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pw_6pandas_5algos_209groupby_bool(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyArrayObject *__pyx_v_index = 0;
  PyArrayObject *__pyx_v_labels = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("groupby_bool (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_index,&__pyx_n_s_labels,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_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 (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_index)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_labels)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("groupby_bool", 1, 2, 2, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2104; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "groupby_bool") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2104; __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_labels = ((PyArrayObject *)values[1]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("groupby_bool", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2104; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas.algos.groupby_bool", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_index), __pyx_ptype_5numpy_ndarray, 1, "index", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2104; __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[2]; __pyx_lineno = 2104; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_208groupby_bool(__pyx_self, __pyx_v_index, __pyx_v_labels);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pandas_5algos_208groupby_bool(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_index, PyArrayObject *__pyx_v_labels) {
  PyObject *__pyx_v_result = 0;
  Py_ssize_t __pyx_v_i;
  Py_ssize_t __pyx_v_length;
  PyObject *__pyx_v_members = 0;
  PyObject *__pyx_v_idx = 0;
  PyObject *__pyx_v_key = 0;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_index;
  __Pyx_Buffer __pyx_pybuffer_index;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  int __pyx_t_3;
  Py_ssize_t __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("groupby_bool", 0);
  __pyx_pybuffer_index.pybuffer.buf = NULL;
  __pyx_pybuffer_index.refcount = 0;
  __pyx_pybuffernd_index.data = NULL;
  __pyx_pybuffernd_index.rcbuffer = &__pyx_pybuffer_index;
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_index.rcbuffer->pybuffer, (PyObject*)__pyx_v_index, &__Pyx_TypeInfo_nn___pyx_t_5numpy_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2104; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_index.diminfo[0].strides = __pyx_pybuffernd_index.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_index.diminfo[0].shape = __pyx_pybuffernd_index.rcbuffer->pybuffer.shape[0];

  /* "pandas/src/generated.pyx":2105
 * @cython.boundscheck(False)
 * def groupby_bool(ndarray[uint8_t] index, ndarray labels):
 *     cdef dict result = {}             # <<<<<<<<<<<<<<
 *     cdef Py_ssize_t i, length
 *     cdef list members
 */
  __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2105; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_result = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pandas/src/generated.pyx":2110
 *     cdef object idx, key
 * 
 *     length = len(index)             # <<<<<<<<<<<<<<
 * 
 *     if not length == len(labels):
 */
  __pyx_t_2 = PyObject_Length(((PyObject *)__pyx_v_index)); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_length = __pyx_t_2;

  /* "pandas/src/generated.pyx":2112
 *     length = len(index)
 * 
 *     if not length == len(labels):             # <<<<<<<<<<<<<<
 *        raise AssertionError("len(index) != len(labels)")
 * 
 */
  __pyx_t_2 = PyObject_Length(((PyObject *)__pyx_v_labels)); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2112; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_3 = ((!((__pyx_v_length == __pyx_t_2) != 0)) != 0);
  if (__pyx_t_3) {

    /* "pandas/src/generated.pyx":2113
 * 
 *     if not length == len(labels):
 *        raise AssertionError("len(index) != len(labels)")             # <<<<<<<<<<<<<<
 * 
 *     for i in range(length):
 */
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_AssertionError, __pyx_tuple__115, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2113; __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[2]; __pyx_lineno = 2113; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }

  /* "pandas/src/generated.pyx":2115
 *        raise AssertionError("len(index) != len(labels)")
 * 
 *     for i in range(length):             # <<<<<<<<<<<<<<
 *         key = util.get_value_1d(labels, i)
 * 
 */
  __pyx_t_2 = __pyx_v_length;
  for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_2; __pyx_t_4+=1) {
    __pyx_v_i = __pyx_t_4;

    /* "pandas/src/generated.pyx":2116
 * 
 *     for i in range(length):
 *         key = util.get_value_1d(labels, i)             # <<<<<<<<<<<<<<
 * 
 *         if _checknull(key):
 */
    __pyx_t_1 = get_value_1d(__pyx_v_labels, __pyx_v_i); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2116; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_XDECREF_SET(__pyx_v_key, __pyx_t_1);
    __pyx_t_1 = 0;

    /* "pandas/src/generated.pyx":2118
 *         key = util.get_value_1d(labels, i)
 * 
 *         if _checknull(key):             # <<<<<<<<<<<<<<
 *             continue
 * 
 */
    __pyx_t_3 = (__pyx_f_4util__checknull(__pyx_v_key) != 0);
    if (__pyx_t_3) {

      /* "pandas/src/generated.pyx":2119
 * 
 *         if _checknull(key):
 *             continue             # <<<<<<<<<<<<<<
 * 
 *         idx = index[i]
 */
      goto __pyx_L4_continue;
    }

    /* "pandas/src/generated.pyx":2121
 *             continue
 * 
 *         idx = index[i]             # <<<<<<<<<<<<<<
 *         if key in result:
 *             members = result[key]
 */
    __pyx_t_5 = __pyx_v_i;
    __pyx_t_1 = __Pyx_PyInt_From_npy_uint8((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_uint8_t *, __pyx_pybuffernd_index.rcbuffer->pybuffer.buf, __pyx_t_5, __pyx_pybuffernd_index.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2121; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_XDECREF_SET(__pyx_v_idx, __pyx_t_1);
    __pyx_t_1 = 0;

    /* "pandas/src/generated.pyx":2122
 * 
 *         idx = index[i]
 *         if key in result:             # <<<<<<<<<<<<<<
 *             members = result[key]
 *             members.append(idx)
 */
    __pyx_t_3 = (__Pyx_PyDict_Contains(__pyx_v_key, __pyx_v_result, Py_EQ)); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2122; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_6 = (__pyx_t_3 != 0);
    if (__pyx_t_6) {

      /* "pandas/src/generated.pyx":2123
 *         idx = index[i]
 *         if key in result:
 *             members = result[key]             # <<<<<<<<<<<<<<
 *             members.append(idx)
 *         else:
 */
      __pyx_t_1 = __Pyx_PyDict_GetItem(__pyx_v_result, __pyx_v_key); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2123; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
      __Pyx_GOTREF(__pyx_t_1);
      if (!(likely(PyList_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "list", Py_TYPE(__pyx_t_1)->tp_name), 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2123; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_XDECREF_SET(__pyx_v_members, ((PyObject*)__pyx_t_1));
      __pyx_t_1 = 0;

      /* "pandas/src/generated.pyx":2124
 *         if key in result:
 *             members = result[key]
 *             members.append(idx)             # <<<<<<<<<<<<<<
 *         else:
 *             result[key] = [idx]
 */
      if (unlikely(__pyx_v_members == Py_None)) {
        PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "append");
        {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2124; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_t_7 = __Pyx_PyList_Append(__pyx_v_members, __pyx_v_idx); if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2124; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      goto __pyx_L7;
    }
    /*else*/ {

      /* "pandas/src/generated.pyx":2126
 *             members.append(idx)
 *         else:
 *             result[key] = [idx]             # <<<<<<<<<<<<<<
 * 
 *     return result
 */
      __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2126; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_INCREF(__pyx_v_idx);
      PyList_SET_ITEM(__pyx_t_1, 0, __pyx_v_idx);
      __Pyx_GIVEREF(__pyx_v_idx);
      if (unlikely(PyDict_SetItem(__pyx_v_result, __pyx_v_key, __pyx_t_1) < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2126; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    }
    __pyx_L7:;
    __pyx_L4_continue:;
  }

  /* "pandas/src/generated.pyx":2128
 *             result[key] = [idx]
 * 
 *     return result             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_result);
  __pyx_r = __pyx_v_result;
  goto __pyx_L0;

  /* "pandas/src/generated.pyx":2104
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def groupby_bool(ndarray[uint8_t] index, ndarray labels):             # <<<<<<<<<<<<<<
 *     cdef dict result = {}
 *     cdef Py_ssize_t i, length
 */

  /* function exit code */
  __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_pybuffernd_index.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas.algos.groupby_bool", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_index.rcbuffer->pybuffer);
  __pyx_L2:;
  __Pyx_XDECREF(__pyx_v_result);
  __Pyx_XDECREF(__pyx_v_members);
  __Pyx_XDECREF(__pyx_v_idx);
  __Pyx_XDECREF(__pyx_v_key);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/src/generated.pyx":2133
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def arrmap_float64(ndarray[float64_t] index, object func):             # <<<<<<<<<<<<<<
 *     cdef Py_ssize_t length = index.shape[0]
 *     cdef Py_ssize_t i = 0
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pandas_5algos_211arrmap_float64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_5algos_211arrmap_float64 = {__Pyx_NAMESTR("arrmap_float64"), (PyCFunction)__pyx_pw_6pandas_5algos_211arrmap_float64, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pw_6pandas_5algos_211arrmap_float64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyArrayObject *__pyx_v_index = 0;
  PyObject *__pyx_v_func = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("arrmap_float64 (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_index,&__pyx_n_s_func,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_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 (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_index)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_func)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("arrmap_float64", 1, 2, 2, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2133; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "arrmap_float64") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2133; __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_float64", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2133; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas.algos.arrmap_float64", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_index), __pyx_ptype_5numpy_ndarray, 1, "index", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2133; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_210arrmap_float64(__pyx_self, __pyx_v_index, __pyx_v_func);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pandas_5algos_210arrmap_float64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_index, PyObject *__pyx_v_func) {
  Py_ssize_t __pyx_v_length;
  Py_ssize_t __pyx_v_i;
  PyArrayObject *__pyx_v_result = 0;
  PyObject *__pyx_v_maybe_convert_objects = NULL;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_index;
  __Pyx_Buffer __pyx_pybuffer_index;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_result;
  __Pyx_Buffer __pyx_pybuffer_result;
  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;
  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;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("arrmap_float64", 0);
  __pyx_pybuffer_result.pybuffer.buf = NULL;
  __pyx_pybuffer_result.refcount = 0;
  __pyx_pybuffernd_result.data = NULL;
  __pyx_pybuffernd_result.rcbuffer = &__pyx_pybuffer_result;
  __pyx_pybuffer_index.pybuffer.buf = NULL;
  __pyx_pybuffer_index.refcount = 0;
  __pyx_pybuffernd_index.data = NULL;
  __pyx_pybuffernd_index.rcbuffer = &__pyx_pybuffer_index;
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_index.rcbuffer->pybuffer, (PyObject*)__pyx_v_index, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2133; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_index.diminfo[0].strides = __pyx_pybuffernd_index.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_index.diminfo[0].shape = __pyx_pybuffernd_index.rcbuffer->pybuffer.shape[0];

  /* "pandas/src/generated.pyx":2134
 * @cython.boundscheck(False)
 * def arrmap_float64(ndarray[float64_t] index, object func):
 *     cdef Py_ssize_t length = index.shape[0]             # <<<<<<<<<<<<<<
 *     cdef Py_ssize_t i = 0
 * 
 */
  __pyx_v_length = (__pyx_v_index->dimensions[0]);

  /* "pandas/src/generated.pyx":2135
 * def arrmap_float64(ndarray[float64_t] index, object func):
 *     cdef Py_ssize_t length = index.shape[0]
 *     cdef Py_ssize_t i = 0             # <<<<<<<<<<<<<<
 * 
 *     cdef ndarray[object] result = np.empty(length, dtype=np.object_)
 */
  __pyx_v_i = 0;

  /* "pandas/src/generated.pyx":2137
 *     cdef Py_ssize_t i = 0
 * 
 *     cdef ndarray[object] result = np.empty(length, dtype=np.object_)             # <<<<<<<<<<<<<<
 * 
 *     from pandas.lib import maybe_convert_objects
 */
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2137; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_empty); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2137; __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_length); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2137; __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[2]; __pyx_lineno = 2137; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__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[2]; __pyx_lineno = 2137; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2137; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_object_2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2137; __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, __pyx_n_s_dtype, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2137; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2137; __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_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__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 = 2137; __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_pybuffernd_result.rcbuffer->pybuffer, (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_pybuffernd_result.rcbuffer->pybuffer.buf = NULL;
      {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2137; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    } else {__pyx_pybuffernd_result.diminfo[0].strides = __pyx_pybuffernd_result.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_result.diminfo[0].shape = __pyx_pybuffernd_result.rcbuffer->pybuffer.shape[0];
    }
  }
  __pyx_t_6 = 0;
  __pyx_v_result = ((PyArrayObject *)__pyx_t_5);
  __pyx_t_5 = 0;

  /* "pandas/src/generated.pyx":2139
 *     cdef ndarray[object] result = np.empty(length, dtype=np.object_)
 * 
 *     from pandas.lib import maybe_convert_objects             # <<<<<<<<<<<<<<
 * 
 *     for i in range(length):
 */
  __pyx_t_5 = PyList_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2139; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_INCREF(__pyx_n_s_maybe_convert_objects);
  PyList_SET_ITEM(__pyx_t_5, 0, __pyx_n_s_maybe_convert_objects);
  __Pyx_GIVEREF(__pyx_n_s_maybe_convert_objects);
  __pyx_t_1 = __Pyx_Import(__pyx_n_s_pandas_lib, __pyx_t_5, -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2139; __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_ImportFrom(__pyx_t_1, __pyx_n_s_maybe_convert_objects); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2139; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_INCREF(__pyx_t_5);
  __pyx_v_maybe_convert_objects = __pyx_t_5;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pandas/src/generated.pyx":2141
 *     from pandas.lib import maybe_convert_objects
 * 
 *     for i in range(length):             # <<<<<<<<<<<<<<
 *         result[i] = func(index[i])
 * 
 */
  __pyx_t_7 = __pyx_v_length;
  for (__pyx_t_8 = 0; __pyx_t_8 < __pyx_t_7; __pyx_t_8+=1) {
    __pyx_v_i = __pyx_t_8;

    /* "pandas/src/generated.pyx":2142
 * 
 *     for i in range(length):
 *         result[i] = func(index[i])             # <<<<<<<<<<<<<<
 * 
 *     return maybe_convert_objects(result)
 */
    __pyx_t_9 = __pyx_v_i;
    __pyx_t_1 = PyFloat_FromDouble((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_index.rcbuffer->pybuffer.buf, __pyx_t_9, __pyx_pybuffernd_index.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2142; __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[2]; __pyx_lineno = 2142; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__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 = __Pyx_PyObject_Call(__pyx_v_func, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2142; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_10 = __pyx_v_i;
    __pyx_t_11 = __Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_10, __pyx_pybuffernd_result.diminfo[0].strides);
    __Pyx_GOTREF(*__pyx_t_11);
    __Pyx_INCREF(__pyx_t_1); __Pyx_DECREF(*__pyx_t_11);
    *__pyx_t_11 = __pyx_t_1;
    __Pyx_GIVEREF(*__pyx_t_11);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "pandas/src/generated.pyx":2144
 *         result[i] = func(index[i])
 * 
 *     return maybe_convert_objects(result)             # <<<<<<<<<<<<<<
 * 
 * @cython.wraparound(False)
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2144; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__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_t_5 = __Pyx_PyObject_Call(__pyx_v_maybe_convert_objects, __pyx_t_1, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2144; __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;

  /* "pandas/src/generated.pyx":2133
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def arrmap_float64(ndarray[float64_t] index, object func):             # <<<<<<<<<<<<<<
 *     cdef Py_ssize_t length = index.shape[0]
 *     cdef Py_ssize_t i = 0
 */

  /* function exit code */
  __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_pybuffernd_index.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas.algos.arrmap_float64", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_index.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer);
  __pyx_L2:;
  __Pyx_XDECREF((PyObject *)__pyx_v_result);
  __Pyx_XDECREF(__pyx_v_maybe_convert_objects);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/src/generated.pyx":2148
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def arrmap_float32(ndarray[float32_t] index, object func):             # <<<<<<<<<<<<<<
 *     cdef Py_ssize_t length = index.shape[0]
 *     cdef Py_ssize_t i = 0
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pandas_5algos_213arrmap_float32(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_5algos_213arrmap_float32 = {__Pyx_NAMESTR("arrmap_float32"), (PyCFunction)__pyx_pw_6pandas_5algos_213arrmap_float32, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pw_6pandas_5algos_213arrmap_float32(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyArrayObject *__pyx_v_index = 0;
  PyObject *__pyx_v_func = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("arrmap_float32 (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_index,&__pyx_n_s_func,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_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 (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_index)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_func)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("arrmap_float32", 1, 2, 2, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2148; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "arrmap_float32") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2148; __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_float32", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2148; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas.algos.arrmap_float32", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_index), __pyx_ptype_5numpy_ndarray, 1, "index", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2148; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_212arrmap_float32(__pyx_self, __pyx_v_index, __pyx_v_func);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pandas_5algos_212arrmap_float32(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_index, PyObject *__pyx_v_func) {
  Py_ssize_t __pyx_v_length;
  Py_ssize_t __pyx_v_i;
  PyArrayObject *__pyx_v_result = 0;
  PyObject *__pyx_v_maybe_convert_objects = NULL;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_index;
  __Pyx_Buffer __pyx_pybuffer_index;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_result;
  __Pyx_Buffer __pyx_pybuffer_result;
  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;
  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;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("arrmap_float32", 0);
  __pyx_pybuffer_result.pybuffer.buf = NULL;
  __pyx_pybuffer_result.refcount = 0;
  __pyx_pybuffernd_result.data = NULL;
  __pyx_pybuffernd_result.rcbuffer = &__pyx_pybuffer_result;
  __pyx_pybuffer_index.pybuffer.buf = NULL;
  __pyx_pybuffer_index.refcount = 0;
  __pyx_pybuffernd_index.data = NULL;
  __pyx_pybuffernd_index.rcbuffer = &__pyx_pybuffer_index;
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_index.rcbuffer->pybuffer, (PyObject*)__pyx_v_index, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2148; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_index.diminfo[0].strides = __pyx_pybuffernd_index.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_index.diminfo[0].shape = __pyx_pybuffernd_index.rcbuffer->pybuffer.shape[0];

  /* "pandas/src/generated.pyx":2149
 * @cython.boundscheck(False)
 * def arrmap_float32(ndarray[float32_t] index, object func):
 *     cdef Py_ssize_t length = index.shape[0]             # <<<<<<<<<<<<<<
 *     cdef Py_ssize_t i = 0
 * 
 */
  __pyx_v_length = (__pyx_v_index->dimensions[0]);

  /* "pandas/src/generated.pyx":2150
 * def arrmap_float32(ndarray[float32_t] index, object func):
 *     cdef Py_ssize_t length = index.shape[0]
 *     cdef Py_ssize_t i = 0             # <<<<<<<<<<<<<<
 * 
 *     cdef ndarray[object] result = np.empty(length, dtype=np.object_)
 */
  __pyx_v_i = 0;

  /* "pandas/src/generated.pyx":2152
 *     cdef Py_ssize_t i = 0
 * 
 *     cdef ndarray[object] result = np.empty(length, dtype=np.object_)             # <<<<<<<<<<<<<<
 * 
 *     from pandas.lib import maybe_convert_objects
 */
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2152; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_empty); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2152; __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_length); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2152; __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[2]; __pyx_lineno = 2152; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__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[2]; __pyx_lineno = 2152; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2152; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_object_2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2152; __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, __pyx_n_s_dtype, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2152; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2152; __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_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__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 = 2152; __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_pybuffernd_result.rcbuffer->pybuffer, (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_pybuffernd_result.rcbuffer->pybuffer.buf = NULL;
      {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2152; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    } else {__pyx_pybuffernd_result.diminfo[0].strides = __pyx_pybuffernd_result.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_result.diminfo[0].shape = __pyx_pybuffernd_result.rcbuffer->pybuffer.shape[0];
    }
  }
  __pyx_t_6 = 0;
  __pyx_v_result = ((PyArrayObject *)__pyx_t_5);
  __pyx_t_5 = 0;

  /* "pandas/src/generated.pyx":2154
 *     cdef ndarray[object] result = np.empty(length, dtype=np.object_)
 * 
 *     from pandas.lib import maybe_convert_objects             # <<<<<<<<<<<<<<
 * 
 *     for i in range(length):
 */
  __pyx_t_5 = PyList_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2154; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_INCREF(__pyx_n_s_maybe_convert_objects);
  PyList_SET_ITEM(__pyx_t_5, 0, __pyx_n_s_maybe_convert_objects);
  __Pyx_GIVEREF(__pyx_n_s_maybe_convert_objects);
  __pyx_t_1 = __Pyx_Import(__pyx_n_s_pandas_lib, __pyx_t_5, -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2154; __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_ImportFrom(__pyx_t_1, __pyx_n_s_maybe_convert_objects); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2154; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_INCREF(__pyx_t_5);
  __pyx_v_maybe_convert_objects = __pyx_t_5;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pandas/src/generated.pyx":2156
 *     from pandas.lib import maybe_convert_objects
 * 
 *     for i in range(length):             # <<<<<<<<<<<<<<
 *         result[i] = func(index[i])
 * 
 */
  __pyx_t_7 = __pyx_v_length;
  for (__pyx_t_8 = 0; __pyx_t_8 < __pyx_t_7; __pyx_t_8+=1) {
    __pyx_v_i = __pyx_t_8;

    /* "pandas/src/generated.pyx":2157
 * 
 *     for i in range(length):
 *         result[i] = func(index[i])             # <<<<<<<<<<<<<<
 * 
 *     return maybe_convert_objects(result)
 */
    __pyx_t_9 = __pyx_v_i;
    __pyx_t_1 = PyFloat_FromDouble((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_index.rcbuffer->pybuffer.buf, __pyx_t_9, __pyx_pybuffernd_index.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2157; __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[2]; __pyx_lineno = 2157; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__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 = __Pyx_PyObject_Call(__pyx_v_func, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2157; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_10 = __pyx_v_i;
    __pyx_t_11 = __Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_10, __pyx_pybuffernd_result.diminfo[0].strides);
    __Pyx_GOTREF(*__pyx_t_11);
    __Pyx_INCREF(__pyx_t_1); __Pyx_DECREF(*__pyx_t_11);
    *__pyx_t_11 = __pyx_t_1;
    __Pyx_GIVEREF(*__pyx_t_11);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "pandas/src/generated.pyx":2159
 *         result[i] = func(index[i])
 * 
 *     return maybe_convert_objects(result)             # <<<<<<<<<<<<<<
 * 
 * @cython.wraparound(False)
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2159; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__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_t_5 = __Pyx_PyObject_Call(__pyx_v_maybe_convert_objects, __pyx_t_1, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2159; __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;

  /* "pandas/src/generated.pyx":2148
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def arrmap_float32(ndarray[float32_t] index, object func):             # <<<<<<<<<<<<<<
 *     cdef Py_ssize_t length = index.shape[0]
 *     cdef Py_ssize_t i = 0
 */

  /* function exit code */
  __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_pybuffernd_index.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas.algos.arrmap_float32", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_index.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer);
  __pyx_L2:;
  __Pyx_XDECREF((PyObject *)__pyx_v_result);
  __Pyx_XDECREF(__pyx_v_maybe_convert_objects);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/src/generated.pyx":2163
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def arrmap_object(ndarray[object] index, object func):             # <<<<<<<<<<<<<<
 *     cdef Py_ssize_t length = index.shape[0]
 *     cdef Py_ssize_t i = 0
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pandas_5algos_215arrmap_object(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_5algos_215arrmap_object = {__Pyx_NAMESTR("arrmap_object"), (PyCFunction)__pyx_pw_6pandas_5algos_215arrmap_object, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pw_6pandas_5algos_215arrmap_object(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyArrayObject *__pyx_v_index = 0;
  PyObject *__pyx_v_func = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("arrmap_object (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_index,&__pyx_n_s_func,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_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 (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_index)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_func)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("arrmap_object", 1, 2, 2, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2163; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "arrmap_object") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2163; __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_object", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2163; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas.algos.arrmap_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_index), __pyx_ptype_5numpy_ndarray, 1, "index", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2163; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_214arrmap_object(__pyx_self, __pyx_v_index, __pyx_v_func);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pandas_5algos_214arrmap_object(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_index, PyObject *__pyx_v_func) {
  Py_ssize_t __pyx_v_length;
  Py_ssize_t __pyx_v_i;
  PyArrayObject *__pyx_v_result = 0;
  PyObject *__pyx_v_maybe_convert_objects = NULL;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_index;
  __Pyx_Buffer __pyx_pybuffer_index;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_result;
  __Pyx_Buffer __pyx_pybuffer_result;
  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;
  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;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("arrmap_object", 0);
  __pyx_pybuffer_result.pybuffer.buf = NULL;
  __pyx_pybuffer_result.refcount = 0;
  __pyx_pybuffernd_result.data = NULL;
  __pyx_pybuffernd_result.rcbuffer = &__pyx_pybuffer_result;
  __pyx_pybuffer_index.pybuffer.buf = NULL;
  __pyx_pybuffer_index.refcount = 0;
  __pyx_pybuffernd_index.data = NULL;
  __pyx_pybuffernd_index.rcbuffer = &__pyx_pybuffer_index;
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_index.rcbuffer->pybuffer, (PyObject*)__pyx_v_index, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2163; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_index.diminfo[0].strides = __pyx_pybuffernd_index.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_index.diminfo[0].shape = __pyx_pybuffernd_index.rcbuffer->pybuffer.shape[0];

  /* "pandas/src/generated.pyx":2164
 * @cython.boundscheck(False)
 * def arrmap_object(ndarray[object] index, object func):
 *     cdef Py_ssize_t length = index.shape[0]             # <<<<<<<<<<<<<<
 *     cdef Py_ssize_t i = 0
 * 
 */
  __pyx_v_length = (__pyx_v_index->dimensions[0]);

  /* "pandas/src/generated.pyx":2165
 * def arrmap_object(ndarray[object] index, object func):
 *     cdef Py_ssize_t length = index.shape[0]
 *     cdef Py_ssize_t i = 0             # <<<<<<<<<<<<<<
 * 
 *     cdef ndarray[object] result = np.empty(length, dtype=np.object_)
 */
  __pyx_v_i = 0;

  /* "pandas/src/generated.pyx":2167
 *     cdef Py_ssize_t i = 0
 * 
 *     cdef ndarray[object] result = np.empty(length, dtype=np.object_)             # <<<<<<<<<<<<<<
 * 
 *     from pandas.lib import maybe_convert_objects
 */
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2167; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_empty); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2167; __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_length); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2167; __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[2]; __pyx_lineno = 2167; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__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[2]; __pyx_lineno = 2167; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2167; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_object_2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2167; __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, __pyx_n_s_dtype, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2167; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2167; __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_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__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 = 2167; __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_pybuffernd_result.rcbuffer->pybuffer, (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_pybuffernd_result.rcbuffer->pybuffer.buf = NULL;
      {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2167; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    } else {__pyx_pybuffernd_result.diminfo[0].strides = __pyx_pybuffernd_result.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_result.diminfo[0].shape = __pyx_pybuffernd_result.rcbuffer->pybuffer.shape[0];
    }
  }
  __pyx_t_6 = 0;
  __pyx_v_result = ((PyArrayObject *)__pyx_t_5);
  __pyx_t_5 = 0;

  /* "pandas/src/generated.pyx":2169
 *     cdef ndarray[object] result = np.empty(length, dtype=np.object_)
 * 
 *     from pandas.lib import maybe_convert_objects             # <<<<<<<<<<<<<<
 * 
 *     for i in range(length):
 */
  __pyx_t_5 = PyList_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2169; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_INCREF(__pyx_n_s_maybe_convert_objects);
  PyList_SET_ITEM(__pyx_t_5, 0, __pyx_n_s_maybe_convert_objects);
  __Pyx_GIVEREF(__pyx_n_s_maybe_convert_objects);
  __pyx_t_1 = __Pyx_Import(__pyx_n_s_pandas_lib, __pyx_t_5, -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2169; __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_ImportFrom(__pyx_t_1, __pyx_n_s_maybe_convert_objects); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2169; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_INCREF(__pyx_t_5);
  __pyx_v_maybe_convert_objects = __pyx_t_5;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pandas/src/generated.pyx":2171
 *     from pandas.lib import maybe_convert_objects
 * 
 *     for i in range(length):             # <<<<<<<<<<<<<<
 *         result[i] = func(index[i])
 * 
 */
  __pyx_t_7 = __pyx_v_length;
  for (__pyx_t_8 = 0; __pyx_t_8 < __pyx_t_7; __pyx_t_8+=1) {
    __pyx_v_i = __pyx_t_8;

    /* "pandas/src/generated.pyx":2172
 * 
 *     for i in range(length):
 *         result[i] = func(index[i])             # <<<<<<<<<<<<<<
 * 
 *     return maybe_convert_objects(result)
 */
    __pyx_t_9 = __pyx_v_i;
    __pyx_t_1 = (PyObject *) *__Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_index.rcbuffer->pybuffer.buf, __pyx_t_9, __pyx_pybuffernd_index.diminfo[0].strides);
    __Pyx_INCREF((PyObject*)__pyx_t_1);
    __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2172; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__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 = __Pyx_PyObject_Call(__pyx_v_func, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2172; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_10 = __pyx_v_i;
    __pyx_t_11 = __Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_10, __pyx_pybuffernd_result.diminfo[0].strides);
    __Pyx_GOTREF(*__pyx_t_11);
    __Pyx_INCREF(__pyx_t_1); __Pyx_DECREF(*__pyx_t_11);
    *__pyx_t_11 = __pyx_t_1;
    __Pyx_GIVEREF(*__pyx_t_11);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "pandas/src/generated.pyx":2174
 *         result[i] = func(index[i])
 * 
 *     return maybe_convert_objects(result)             # <<<<<<<<<<<<<<
 * 
 * @cython.wraparound(False)
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2174; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__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_t_5 = __Pyx_PyObject_Call(__pyx_v_maybe_convert_objects, __pyx_t_1, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2174; __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;

  /* "pandas/src/generated.pyx":2163
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def arrmap_object(ndarray[object] index, object func):             # <<<<<<<<<<<<<<
 *     cdef Py_ssize_t length = index.shape[0]
 *     cdef Py_ssize_t i = 0
 */

  /* function exit code */
  __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_pybuffernd_index.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas.algos.arrmap_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_index.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer);
  __pyx_L2:;
  __Pyx_XDECREF((PyObject *)__pyx_v_result);
  __Pyx_XDECREF(__pyx_v_maybe_convert_objects);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/src/generated.pyx":2178
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def arrmap_int32(ndarray[int32_t] index, object func):             # <<<<<<<<<<<<<<
 *     cdef Py_ssize_t length = index.shape[0]
 *     cdef Py_ssize_t i = 0
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pandas_5algos_217arrmap_int32(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_5algos_217arrmap_int32 = {__Pyx_NAMESTR("arrmap_int32"), (PyCFunction)__pyx_pw_6pandas_5algos_217arrmap_int32, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pw_6pandas_5algos_217arrmap_int32(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyArrayObject *__pyx_v_index = 0;
  PyObject *__pyx_v_func = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("arrmap_int32 (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_index,&__pyx_n_s_func,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_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 (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_index)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_func)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("arrmap_int32", 1, 2, 2, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2178; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "arrmap_int32") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2178; __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_int32", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2178; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas.algos.arrmap_int32", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_index), __pyx_ptype_5numpy_ndarray, 1, "index", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2178; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_216arrmap_int32(__pyx_self, __pyx_v_index, __pyx_v_func);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pandas_5algos_216arrmap_int32(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_index, PyObject *__pyx_v_func) {
  Py_ssize_t __pyx_v_length;
  Py_ssize_t __pyx_v_i;
  PyArrayObject *__pyx_v_result = 0;
  PyObject *__pyx_v_maybe_convert_objects = NULL;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_index;
  __Pyx_Buffer __pyx_pybuffer_index;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_result;
  __Pyx_Buffer __pyx_pybuffer_result;
  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;
  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;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("arrmap_int32", 0);
  __pyx_pybuffer_result.pybuffer.buf = NULL;
  __pyx_pybuffer_result.refcount = 0;
  __pyx_pybuffernd_result.data = NULL;
  __pyx_pybuffernd_result.rcbuffer = &__pyx_pybuffer_result;
  __pyx_pybuffer_index.pybuffer.buf = NULL;
  __pyx_pybuffer_index.refcount = 0;
  __pyx_pybuffernd_index.data = NULL;
  __pyx_pybuffernd_index.rcbuffer = &__pyx_pybuffer_index;
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_index.rcbuffer->pybuffer, (PyObject*)__pyx_v_index, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2178; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_index.diminfo[0].strides = __pyx_pybuffernd_index.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_index.diminfo[0].shape = __pyx_pybuffernd_index.rcbuffer->pybuffer.shape[0];

  /* "pandas/src/generated.pyx":2179
 * @cython.boundscheck(False)
 * def arrmap_int32(ndarray[int32_t] index, object func):
 *     cdef Py_ssize_t length = index.shape[0]             # <<<<<<<<<<<<<<
 *     cdef Py_ssize_t i = 0
 * 
 */
  __pyx_v_length = (__pyx_v_index->dimensions[0]);

  /* "pandas/src/generated.pyx":2180
 * def arrmap_int32(ndarray[int32_t] index, object func):
 *     cdef Py_ssize_t length = index.shape[0]
 *     cdef Py_ssize_t i = 0             # <<<<<<<<<<<<<<
 * 
 *     cdef ndarray[object] result = np.empty(length, dtype=np.object_)
 */
  __pyx_v_i = 0;

  /* "pandas/src/generated.pyx":2182
 *     cdef Py_ssize_t i = 0
 * 
 *     cdef ndarray[object] result = np.empty(length, dtype=np.object_)             # <<<<<<<<<<<<<<
 * 
 *     from pandas.lib import maybe_convert_objects
 */
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2182; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_empty); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2182; __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_length); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2182; __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[2]; __pyx_lineno = 2182; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__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[2]; __pyx_lineno = 2182; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2182; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_object_2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2182; __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, __pyx_n_s_dtype, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2182; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2182; __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_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__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 = 2182; __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_pybuffernd_result.rcbuffer->pybuffer, (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_pybuffernd_result.rcbuffer->pybuffer.buf = NULL;
      {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2182; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    } else {__pyx_pybuffernd_result.diminfo[0].strides = __pyx_pybuffernd_result.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_result.diminfo[0].shape = __pyx_pybuffernd_result.rcbuffer->pybuffer.shape[0];
    }
  }
  __pyx_t_6 = 0;
  __pyx_v_result = ((PyArrayObject *)__pyx_t_5);
  __pyx_t_5 = 0;

  /* "pandas/src/generated.pyx":2184
 *     cdef ndarray[object] result = np.empty(length, dtype=np.object_)
 * 
 *     from pandas.lib import maybe_convert_objects             # <<<<<<<<<<<<<<
 * 
 *     for i in range(length):
 */
  __pyx_t_5 = PyList_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2184; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_INCREF(__pyx_n_s_maybe_convert_objects);
  PyList_SET_ITEM(__pyx_t_5, 0, __pyx_n_s_maybe_convert_objects);
  __Pyx_GIVEREF(__pyx_n_s_maybe_convert_objects);
  __pyx_t_1 = __Pyx_Import(__pyx_n_s_pandas_lib, __pyx_t_5, -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2184; __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_ImportFrom(__pyx_t_1, __pyx_n_s_maybe_convert_objects); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2184; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_INCREF(__pyx_t_5);
  __pyx_v_maybe_convert_objects = __pyx_t_5;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pandas/src/generated.pyx":2186
 *     from pandas.lib import maybe_convert_objects
 * 
 *     for i in range(length):             # <<<<<<<<<<<<<<
 *         result[i] = func(index[i])
 * 
 */
  __pyx_t_7 = __pyx_v_length;
  for (__pyx_t_8 = 0; __pyx_t_8 < __pyx_t_7; __pyx_t_8+=1) {
    __pyx_v_i = __pyx_t_8;

    /* "pandas/src/generated.pyx":2187
 * 
 *     for i in range(length):
 *         result[i] = func(index[i])             # <<<<<<<<<<<<<<
 * 
 *     return maybe_convert_objects(result)
 */
    __pyx_t_9 = __pyx_v_i;
    __pyx_t_1 = __Pyx_PyInt_From_npy_int32((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_index.rcbuffer->pybuffer.buf, __pyx_t_9, __pyx_pybuffernd_index.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2187; __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[2]; __pyx_lineno = 2187; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__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 = __Pyx_PyObject_Call(__pyx_v_func, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2187; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_10 = __pyx_v_i;
    __pyx_t_11 = __Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_10, __pyx_pybuffernd_result.diminfo[0].strides);
    __Pyx_GOTREF(*__pyx_t_11);
    __Pyx_INCREF(__pyx_t_1); __Pyx_DECREF(*__pyx_t_11);
    *__pyx_t_11 = __pyx_t_1;
    __Pyx_GIVEREF(*__pyx_t_11);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "pandas/src/generated.pyx":2189
 *         result[i] = func(index[i])
 * 
 *     return maybe_convert_objects(result)             # <<<<<<<<<<<<<<
 * 
 * @cython.wraparound(False)
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2189; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__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_t_5 = __Pyx_PyObject_Call(__pyx_v_maybe_convert_objects, __pyx_t_1, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2189; __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;

  /* "pandas/src/generated.pyx":2178
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def arrmap_int32(ndarray[int32_t] index, object func):             # <<<<<<<<<<<<<<
 *     cdef Py_ssize_t length = index.shape[0]
 *     cdef Py_ssize_t i = 0
 */

  /* function exit code */
  __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_pybuffernd_index.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas.algos.arrmap_int32", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_index.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer);
  __pyx_L2:;
  __Pyx_XDECREF((PyObject *)__pyx_v_result);
  __Pyx_XDECREF(__pyx_v_maybe_convert_objects);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/src/generated.pyx":2193
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def arrmap_int64(ndarray[int64_t] index, object func):             # <<<<<<<<<<<<<<
 *     cdef Py_ssize_t length = index.shape[0]
 *     cdef Py_ssize_t i = 0
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pandas_5algos_219arrmap_int64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_5algos_219arrmap_int64 = {__Pyx_NAMESTR("arrmap_int64"), (PyCFunction)__pyx_pw_6pandas_5algos_219arrmap_int64, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pw_6pandas_5algos_219arrmap_int64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyArrayObject *__pyx_v_index = 0;
  PyObject *__pyx_v_func = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("arrmap_int64 (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_index,&__pyx_n_s_func,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_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 (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_index)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_func)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("arrmap_int64", 1, 2, 2, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2193; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "arrmap_int64") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2193; __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_int64", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2193; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas.algos.arrmap_int64", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_index), __pyx_ptype_5numpy_ndarray, 1, "index", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2193; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_218arrmap_int64(__pyx_self, __pyx_v_index, __pyx_v_func);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pandas_5algos_218arrmap_int64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_index, PyObject *__pyx_v_func) {
  Py_ssize_t __pyx_v_length;
  Py_ssize_t __pyx_v_i;
  PyArrayObject *__pyx_v_result = 0;
  PyObject *__pyx_v_maybe_convert_objects = NULL;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_index;
  __Pyx_Buffer __pyx_pybuffer_index;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_result;
  __Pyx_Buffer __pyx_pybuffer_result;
  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;
  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;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("arrmap_int64", 0);
  __pyx_pybuffer_result.pybuffer.buf = NULL;
  __pyx_pybuffer_result.refcount = 0;
  __pyx_pybuffernd_result.data = NULL;
  __pyx_pybuffernd_result.rcbuffer = &__pyx_pybuffer_result;
  __pyx_pybuffer_index.pybuffer.buf = NULL;
  __pyx_pybuffer_index.refcount = 0;
  __pyx_pybuffernd_index.data = NULL;
  __pyx_pybuffernd_index.rcbuffer = &__pyx_pybuffer_index;
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_index.rcbuffer->pybuffer, (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[2]; __pyx_lineno = 2193; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_index.diminfo[0].strides = __pyx_pybuffernd_index.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_index.diminfo[0].shape = __pyx_pybuffernd_index.rcbuffer->pybuffer.shape[0];

  /* "pandas/src/generated.pyx":2194
 * @cython.boundscheck(False)
 * def arrmap_int64(ndarray[int64_t] index, object func):
 *     cdef Py_ssize_t length = index.shape[0]             # <<<<<<<<<<<<<<
 *     cdef Py_ssize_t i = 0
 * 
 */
  __pyx_v_length = (__pyx_v_index->dimensions[0]);

  /* "pandas/src/generated.pyx":2195
 * def arrmap_int64(ndarray[int64_t] index, object func):
 *     cdef Py_ssize_t length = index.shape[0]
 *     cdef Py_ssize_t i = 0             # <<<<<<<<<<<<<<
 * 
 *     cdef ndarray[object] result = np.empty(length, dtype=np.object_)
 */
  __pyx_v_i = 0;

  /* "pandas/src/generated.pyx":2197
 *     cdef Py_ssize_t i = 0
 * 
 *     cdef ndarray[object] result = np.empty(length, dtype=np.object_)             # <<<<<<<<<<<<<<
 * 
 *     from pandas.lib import maybe_convert_objects
 */
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2197; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_empty); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2197; __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_length); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2197; __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[2]; __pyx_lineno = 2197; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__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[2]; __pyx_lineno = 2197; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2197; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_object_2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2197; __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, __pyx_n_s_dtype, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2197; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2197; __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_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__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 = 2197; __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_pybuffernd_result.rcbuffer->pybuffer, (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_pybuffernd_result.rcbuffer->pybuffer.buf = NULL;
      {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2197; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    } else {__pyx_pybuffernd_result.diminfo[0].strides = __pyx_pybuffernd_result.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_result.diminfo[0].shape = __pyx_pybuffernd_result.rcbuffer->pybuffer.shape[0];
    }
  }
  __pyx_t_6 = 0;
  __pyx_v_result = ((PyArrayObject *)__pyx_t_5);
  __pyx_t_5 = 0;

  /* "pandas/src/generated.pyx":2199
 *     cdef ndarray[object] result = np.empty(length, dtype=np.object_)
 * 
 *     from pandas.lib import maybe_convert_objects             # <<<<<<<<<<<<<<
 * 
 *     for i in range(length):
 */
  __pyx_t_5 = PyList_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2199; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_INCREF(__pyx_n_s_maybe_convert_objects);
  PyList_SET_ITEM(__pyx_t_5, 0, __pyx_n_s_maybe_convert_objects);
  __Pyx_GIVEREF(__pyx_n_s_maybe_convert_objects);
  __pyx_t_1 = __Pyx_Import(__pyx_n_s_pandas_lib, __pyx_t_5, -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2199; __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_ImportFrom(__pyx_t_1, __pyx_n_s_maybe_convert_objects); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2199; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_INCREF(__pyx_t_5);
  __pyx_v_maybe_convert_objects = __pyx_t_5;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pandas/src/generated.pyx":2201
 *     from pandas.lib import maybe_convert_objects
 * 
 *     for i in range(length):             # <<<<<<<<<<<<<<
 *         result[i] = func(index[i])
 * 
 */
  __pyx_t_7 = __pyx_v_length;
  for (__pyx_t_8 = 0; __pyx_t_8 < __pyx_t_7; __pyx_t_8+=1) {
    __pyx_v_i = __pyx_t_8;

    /* "pandas/src/generated.pyx":2202
 * 
 *     for i in range(length):
 *         result[i] = func(index[i])             # <<<<<<<<<<<<<<
 * 
 *     return maybe_convert_objects(result)
 */
    __pyx_t_9 = __pyx_v_i;
    __pyx_t_1 = __Pyx_PyInt_From_npy_int64((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_index.rcbuffer->pybuffer.buf, __pyx_t_9, __pyx_pybuffernd_index.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2202; __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[2]; __pyx_lineno = 2202; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__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 = __Pyx_PyObject_Call(__pyx_v_func, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2202; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_10 = __pyx_v_i;
    __pyx_t_11 = __Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_10, __pyx_pybuffernd_result.diminfo[0].strides);
    __Pyx_GOTREF(*__pyx_t_11);
    __Pyx_INCREF(__pyx_t_1); __Pyx_DECREF(*__pyx_t_11);
    *__pyx_t_11 = __pyx_t_1;
    __Pyx_GIVEREF(*__pyx_t_11);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "pandas/src/generated.pyx":2204
 *         result[i] = func(index[i])
 * 
 *     return maybe_convert_objects(result)             # <<<<<<<<<<<<<<
 * 
 * @cython.wraparound(False)
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2204; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__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_t_5 = __Pyx_PyObject_Call(__pyx_v_maybe_convert_objects, __pyx_t_1, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2204; __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;

  /* "pandas/src/generated.pyx":2193
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def arrmap_int64(ndarray[int64_t] index, object func):             # <<<<<<<<<<<<<<
 *     cdef Py_ssize_t length = index.shape[0]
 *     cdef Py_ssize_t i = 0
 */

  /* function exit code */
  __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_pybuffernd_index.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas.algos.arrmap_int64", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_index.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer);
  __pyx_L2:;
  __Pyx_XDECREF((PyObject *)__pyx_v_result);
  __Pyx_XDECREF(__pyx_v_maybe_convert_objects);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/src/generated.pyx":2208
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def arrmap_bool(ndarray[uint8_t] index, object func):             # <<<<<<<<<<<<<<
 *     cdef Py_ssize_t length = index.shape[0]
 *     cdef Py_ssize_t i = 0
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pandas_5algos_221arrmap_bool(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_5algos_221arrmap_bool = {__Pyx_NAMESTR("arrmap_bool"), (PyCFunction)__pyx_pw_6pandas_5algos_221arrmap_bool, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pw_6pandas_5algos_221arrmap_bool(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyArrayObject *__pyx_v_index = 0;
  PyObject *__pyx_v_func = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("arrmap_bool (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_index,&__pyx_n_s_func,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_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 (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_index)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_func)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("arrmap_bool", 1, 2, 2, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2208; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "arrmap_bool") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2208; __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_bool", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2208; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas.algos.arrmap_bool", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_index), __pyx_ptype_5numpy_ndarray, 1, "index", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2208; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_220arrmap_bool(__pyx_self, __pyx_v_index, __pyx_v_func);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pandas_5algos_220arrmap_bool(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_index, PyObject *__pyx_v_func) {
  Py_ssize_t __pyx_v_length;
  Py_ssize_t __pyx_v_i;
  PyArrayObject *__pyx_v_result = 0;
  PyObject *__pyx_v_maybe_convert_objects = NULL;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_index;
  __Pyx_Buffer __pyx_pybuffer_index;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_result;
  __Pyx_Buffer __pyx_pybuffer_result;
  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;
  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;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("arrmap_bool", 0);
  __pyx_pybuffer_result.pybuffer.buf = NULL;
  __pyx_pybuffer_result.refcount = 0;
  __pyx_pybuffernd_result.data = NULL;
  __pyx_pybuffernd_result.rcbuffer = &__pyx_pybuffer_result;
  __pyx_pybuffer_index.pybuffer.buf = NULL;
  __pyx_pybuffer_index.refcount = 0;
  __pyx_pybuffernd_index.data = NULL;
  __pyx_pybuffernd_index.rcbuffer = &__pyx_pybuffer_index;
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_index.rcbuffer->pybuffer, (PyObject*)__pyx_v_index, &__Pyx_TypeInfo_nn___pyx_t_5numpy_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2208; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_index.diminfo[0].strides = __pyx_pybuffernd_index.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_index.diminfo[0].shape = __pyx_pybuffernd_index.rcbuffer->pybuffer.shape[0];

  /* "pandas/src/generated.pyx":2209
 * @cython.boundscheck(False)
 * def arrmap_bool(ndarray[uint8_t] index, object func):
 *     cdef Py_ssize_t length = index.shape[0]             # <<<<<<<<<<<<<<
 *     cdef Py_ssize_t i = 0
 * 
 */
  __pyx_v_length = (__pyx_v_index->dimensions[0]);

  /* "pandas/src/generated.pyx":2210
 * def arrmap_bool(ndarray[uint8_t] index, object func):
 *     cdef Py_ssize_t length = index.shape[0]
 *     cdef Py_ssize_t i = 0             # <<<<<<<<<<<<<<
 * 
 *     cdef ndarray[object] result = np.empty(length, dtype=np.object_)
 */
  __pyx_v_i = 0;

  /* "pandas/src/generated.pyx":2212
 *     cdef Py_ssize_t i = 0
 * 
 *     cdef ndarray[object] result = np.empty(length, dtype=np.object_)             # <<<<<<<<<<<<<<
 * 
 *     from pandas.lib import maybe_convert_objects
 */
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2212; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_empty); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2212; __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_length); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2212; __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[2]; __pyx_lineno = 2212; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__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[2]; __pyx_lineno = 2212; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2212; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_object_2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2212; __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, __pyx_n_s_dtype, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2212; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2212; __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_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__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 = 2212; __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_pybuffernd_result.rcbuffer->pybuffer, (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_pybuffernd_result.rcbuffer->pybuffer.buf = NULL;
      {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2212; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    } else {__pyx_pybuffernd_result.diminfo[0].strides = __pyx_pybuffernd_result.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_result.diminfo[0].shape = __pyx_pybuffernd_result.rcbuffer->pybuffer.shape[0];
    }
  }
  __pyx_t_6 = 0;
  __pyx_v_result = ((PyArrayObject *)__pyx_t_5);
  __pyx_t_5 = 0;

  /* "pandas/src/generated.pyx":2214
 *     cdef ndarray[object] result = np.empty(length, dtype=np.object_)
 * 
 *     from pandas.lib import maybe_convert_objects             # <<<<<<<<<<<<<<
 * 
 *     for i in range(length):
 */
  __pyx_t_5 = PyList_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2214; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_INCREF(__pyx_n_s_maybe_convert_objects);
  PyList_SET_ITEM(__pyx_t_5, 0, __pyx_n_s_maybe_convert_objects);
  __Pyx_GIVEREF(__pyx_n_s_maybe_convert_objects);
  __pyx_t_1 = __Pyx_Import(__pyx_n_s_pandas_lib, __pyx_t_5, -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2214; __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_ImportFrom(__pyx_t_1, __pyx_n_s_maybe_convert_objects); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2214; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_INCREF(__pyx_t_5);
  __pyx_v_maybe_convert_objects = __pyx_t_5;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pandas/src/generated.pyx":2216
 *     from pandas.lib import maybe_convert_objects
 * 
 *     for i in range(length):             # <<<<<<<<<<<<<<
 *         result[i] = func(index[i])
 * 
 */
  __pyx_t_7 = __pyx_v_length;
  for (__pyx_t_8 = 0; __pyx_t_8 < __pyx_t_7; __pyx_t_8+=1) {
    __pyx_v_i = __pyx_t_8;

    /* "pandas/src/generated.pyx":2217
 * 
 *     for i in range(length):
 *         result[i] = func(index[i])             # <<<<<<<<<<<<<<
 * 
 *     return maybe_convert_objects(result)
 */
    __pyx_t_9 = __pyx_v_i;
    __pyx_t_1 = __Pyx_PyInt_From_npy_uint8((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_uint8_t *, __pyx_pybuffernd_index.rcbuffer->pybuffer.buf, __pyx_t_9, __pyx_pybuffernd_index.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2217; __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[2]; __pyx_lineno = 2217; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__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 = __Pyx_PyObject_Call(__pyx_v_func, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2217; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_10 = __pyx_v_i;
    __pyx_t_11 = __Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_10, __pyx_pybuffernd_result.diminfo[0].strides);
    __Pyx_GOTREF(*__pyx_t_11);
    __Pyx_INCREF(__pyx_t_1); __Pyx_DECREF(*__pyx_t_11);
    *__pyx_t_11 = __pyx_t_1;
    __Pyx_GIVEREF(*__pyx_t_11);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "pandas/src/generated.pyx":2219
 *         result[i] = func(index[i])
 * 
 *     return maybe_convert_objects(result)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2219; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__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_t_5 = __Pyx_PyObject_Call(__pyx_v_maybe_convert_objects, __pyx_t_1, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2219; __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;

  /* "pandas/src/generated.pyx":2208
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def arrmap_bool(ndarray[uint8_t] index, object func):             # <<<<<<<<<<<<<<
 *     cdef Py_ssize_t length = index.shape[0]
 *     cdef Py_ssize_t i = 0
 */

  /* function exit code */
  __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_pybuffernd_index.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas.algos.arrmap_bool", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_index.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer);
  __pyx_L2:;
  __Pyx_XDECREF((PyObject *)__pyx_v_result);
  __Pyx_XDECREF(__pyx_v_maybe_convert_objects);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/src/generated.pyx":2223
 * 
 * @cython.wraparound(False)
 * def take_1d_bool_bool(ndarray[uint8_t] values,             # <<<<<<<<<<<<<<
 *                               ndarray[int64_t] indexer,
 *                               ndarray[uint8_t] out,
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pandas_5algos_223take_1d_bool_bool(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_5algos_223take_1d_bool_bool = {__Pyx_NAMESTR("take_1d_bool_bool"), (PyCFunction)__pyx_pw_6pandas_5algos_223take_1d_bool_bool, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pw_6pandas_5algos_223take_1d_bool_bool(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyArrayObject *__pyx_v_values = 0;
  PyArrayObject *__pyx_v_indexer = 0;
  PyArrayObject *__pyx_v_out = 0;
  PyObject *__pyx_v_fill_value = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("take_1d_bool_bool (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_values,&__pyx_n_s_indexer,&__pyx_n_s_out,&__pyx_n_s_fill_value,0};
    PyObject* values[4] = {0,0,0,0};
    values[3] = __pyx_k__116;
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_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 (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_indexer)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("take_1d_bool_bool", 0, 3, 4, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2223; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_out)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("take_1d_bool_bool", 0, 3, 4, 2); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2223; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  3:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_fill_value);
          if (value) { values[3] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "take_1d_bool_bool") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2223; __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_values = ((PyArrayObject *)values[0]);
    __pyx_v_indexer = ((PyArrayObject *)values[1]);
    __pyx_v_out = ((PyArrayObject *)values[2]);
    __pyx_v_fill_value = values[3];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("take_1d_bool_bool", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2223; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas.algos.take_1d_bool_bool", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2223; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_indexer), __pyx_ptype_5numpy_ndarray, 1, "indexer", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2224; __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[2]; __pyx_lineno = 2225; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_222take_1d_bool_bool(__pyx_self, __pyx_v_values, __pyx_v_indexer, __pyx_v_out, __pyx_v_fill_value);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pandas_5algos_222take_1d_bool_bool(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_indexer, PyArrayObject *__pyx_v_out, PyObject *__pyx_v_fill_value) {
  Py_ssize_t __pyx_v_i;
  Py_ssize_t __pyx_v_n;
  Py_ssize_t __pyx_v_idx;
  __pyx_t_5numpy_uint8_t __pyx_v_fv;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_indexer;
  __Pyx_Buffer __pyx_pybuffer_indexer;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_out;
  __Pyx_Buffer __pyx_pybuffer_out;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_values;
  __Pyx_Buffer __pyx_pybuffer_values;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  Py_ssize_t __pyx_t_1;
  __pyx_t_5numpy_uint8_t __pyx_t_2;
  Py_ssize_t __pyx_t_3;
  int __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;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("take_1d_bool_bool", 0);
  __pyx_pybuffer_values.pybuffer.buf = NULL;
  __pyx_pybuffer_values.refcount = 0;
  __pyx_pybuffernd_values.data = NULL;
  __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values;
  __pyx_pybuffer_indexer.pybuffer.buf = NULL;
  __pyx_pybuffer_indexer.refcount = 0;
  __pyx_pybuffernd_indexer.data = NULL;
  __pyx_pybuffernd_indexer.rcbuffer = &__pyx_pybuffer_indexer;
  __pyx_pybuffer_out.pybuffer.buf = NULL;
  __pyx_pybuffer_out.refcount = 0;
  __pyx_pybuffernd_out.data = NULL;
  __pyx_pybuffernd_out.rcbuffer = &__pyx_pybuffer_out;
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2223; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0];
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer, (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[2]; __pyx_lineno = 2223; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_indexer.diminfo[0].strides = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_indexer.diminfo[0].shape = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.shape[0];
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_out.rcbuffer->pybuffer, (PyObject*)__pyx_v_out, &__Pyx_TypeInfo_nn___pyx_t_5numpy_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2223; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_out.diminfo[0].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_out.diminfo[0].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[0];

  /* "pandas/src/generated.pyx":2231
 *         uint8_t fv
 * 
 *     n = len(indexer)             # <<<<<<<<<<<<<<
 * 
 *     fv = fill_value
 */
  __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_indexer)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2231; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_n = __pyx_t_1;

  /* "pandas/src/generated.pyx":2233
 *     n = len(indexer)
 * 
 *     fv = fill_value             # <<<<<<<<<<<<<<
 *     for i from 0 <= i < n:
 *         idx = indexer[i]
 */
  __pyx_t_2 = __Pyx_PyInt_As_npy_uint8(__pyx_v_fill_value); if (unlikely((__pyx_t_2 == (npy_uint8)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2233; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_fv = __pyx_t_2;

  /* "pandas/src/generated.pyx":2234
 * 
 *     fv = fill_value
 *     for i from 0 <= i < n:             # <<<<<<<<<<<<<<
 *         idx = indexer[i]
 *         if idx == -1:
 */
  __pyx_t_1 = __pyx_v_n;
  for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_1; __pyx_v_i++) {

    /* "pandas/src/generated.pyx":2235
 *     fv = fill_value
 *     for i from 0 <= i < n:
 *         idx = indexer[i]             # <<<<<<<<<<<<<<
 *         if idx == -1:
 *             out[i] = fv
 */
    __pyx_t_3 = __pyx_v_i;
    __pyx_t_4 = -1;
    if (__pyx_t_3 < 0) {
      __pyx_t_4 = 0;
    } else if (unlikely(__pyx_t_3 >= __pyx_pybuffernd_indexer.diminfo[0].shape)) __pyx_t_4 = 0;
    if (unlikely(__pyx_t_4 != -1)) {
      __Pyx_RaiseBufferIndexError(__pyx_t_4);
      {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2235; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_v_idx = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_3, __pyx_pybuffernd_indexer.diminfo[0].strides));

    /* "pandas/src/generated.pyx":2236
 *     for i from 0 <= i < n:
 *         idx = indexer[i]
 *         if idx == -1:             # <<<<<<<<<<<<<<
 *             out[i] = fv
 *         else:
 */
    __pyx_t_5 = ((__pyx_v_idx == -1) != 0);
    if (__pyx_t_5) {

      /* "pandas/src/generated.pyx":2237
 *         idx = indexer[i]
 *         if idx == -1:
 *             out[i] = fv             # <<<<<<<<<<<<<<
 *         else:
 *             out[i] = values[idx]
 */
      __pyx_t_6 = __pyx_v_i;
      __pyx_t_4 = -1;
      if (__pyx_t_6 < 0) {
        __pyx_t_4 = 0;
      } else if (unlikely(__pyx_t_6 >= __pyx_pybuffernd_out.diminfo[0].shape)) __pyx_t_4 = 0;
      if (unlikely(__pyx_t_4 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_4);
        {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2237; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_uint8_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_out.diminfo[0].strides) = __pyx_v_fv;
      goto __pyx_L5;
    }
    /*else*/ {

      /* "pandas/src/generated.pyx":2239
 *             out[i] = fv
 *         else:
 *             out[i] = values[idx]             # <<<<<<<<<<<<<<
 * 
 * @cython.wraparound(False)
 */
      __pyx_t_7 = __pyx_v_idx;
      __pyx_t_4 = -1;
      if (__pyx_t_7 < 0) {
        __pyx_t_4 = 0;
      } else if (unlikely(__pyx_t_7 >= __pyx_pybuffernd_values.diminfo[0].shape)) __pyx_t_4 = 0;
      if (unlikely(__pyx_t_4 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_4);
        {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2239; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_t_8 = __pyx_v_i;
      __pyx_t_4 = -1;
      if (__pyx_t_8 < 0) {
        __pyx_t_4 = 0;
      } else if (unlikely(__pyx_t_8 >= __pyx_pybuffernd_out.diminfo[0].shape)) __pyx_t_4 = 0;
      if (unlikely(__pyx_t_4 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_4);
        {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2239; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_uint8_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_out.diminfo[0].strides) = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_uint8_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_7, __pyx_pybuffernd_values.diminfo[0].strides));
    }
    __pyx_L5:;
  }

  /* "pandas/src/generated.pyx":2223
 * 
 * @cython.wraparound(False)
 * def take_1d_bool_bool(ndarray[uint8_t] values,             # <<<<<<<<<<<<<<
 *                               ndarray[int64_t] indexer,
 *                               ndarray[uint8_t] out,
 */

  /* function exit code */
  __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_pybuffernd_indexer.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas.algos.take_1d_bool_bool", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer);
  __pyx_L2:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/src/generated.pyx":2242
 * 
 * @cython.wraparound(False)
 * def take_1d_bool_object(ndarray[uint8_t] values,             # <<<<<<<<<<<<<<
 *                               ndarray[int64_t] indexer,
 *                               ndarray[object] out,
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pandas_5algos_225take_1d_bool_object(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_5algos_225take_1d_bool_object = {__Pyx_NAMESTR("take_1d_bool_object"), (PyCFunction)__pyx_pw_6pandas_5algos_225take_1d_bool_object, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pw_6pandas_5algos_225take_1d_bool_object(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyArrayObject *__pyx_v_values = 0;
  PyArrayObject *__pyx_v_indexer = 0;
  PyArrayObject *__pyx_v_out = 0;
  PyObject *__pyx_v_fill_value = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("take_1d_bool_object (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_values,&__pyx_n_s_indexer,&__pyx_n_s_out,&__pyx_n_s_fill_value,0};
    PyObject* values[4] = {0,0,0,0};
    values[3] = __pyx_k__117;
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_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 (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_indexer)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("take_1d_bool_object", 0, 3, 4, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2242; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_out)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("take_1d_bool_object", 0, 3, 4, 2); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2242; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  3:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_fill_value);
          if (value) { values[3] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "take_1d_bool_object") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2242; __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_values = ((PyArrayObject *)values[0]);
    __pyx_v_indexer = ((PyArrayObject *)values[1]);
    __pyx_v_out = ((PyArrayObject *)values[2]);
    __pyx_v_fill_value = values[3];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("take_1d_bool_object", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2242; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas.algos.take_1d_bool_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2242; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_indexer), __pyx_ptype_5numpy_ndarray, 1, "indexer", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2243; __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[2]; __pyx_lineno = 2244; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_224take_1d_bool_object(__pyx_self, __pyx_v_values, __pyx_v_indexer, __pyx_v_out, __pyx_v_fill_value);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pandas_5algos_224take_1d_bool_object(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_indexer, PyArrayObject *__pyx_v_out, PyObject *__pyx_v_fill_value) {
  Py_ssize_t __pyx_v_i;
  Py_ssize_t __pyx_v_n;
  Py_ssize_t __pyx_v_idx;
  PyObject *__pyx_v_fv = 0;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_indexer;
  __Pyx_Buffer __pyx_pybuffer_indexer;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_out;
  __Pyx_Buffer __pyx_pybuffer_out;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_values;
  __Pyx_Buffer __pyx_pybuffer_values;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  Py_ssize_t __pyx_t_1;
  Py_ssize_t __pyx_t_2;
  int __pyx_t_3;
  int __pyx_t_4;
  Py_ssize_t __pyx_t_5;
  PyObject **__pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  Py_ssize_t __pyx_t_8;
  Py_ssize_t __pyx_t_9;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("take_1d_bool_object", 0);
  __pyx_pybuffer_values.pybuffer.buf = NULL;
  __pyx_pybuffer_values.refcount = 0;
  __pyx_pybuffernd_values.data = NULL;
  __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values;
  __pyx_pybuffer_indexer.pybuffer.buf = NULL;
  __pyx_pybuffer_indexer.refcount = 0;
  __pyx_pybuffernd_indexer.data = NULL;
  __pyx_pybuffernd_indexer.rcbuffer = &__pyx_pybuffer_indexer;
  __pyx_pybuffer_out.pybuffer.buf = NULL;
  __pyx_pybuffer_out.refcount = 0;
  __pyx_pybuffernd_out.data = NULL;
  __pyx_pybuffernd_out.rcbuffer = &__pyx_pybuffer_out;
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2242; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0];
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer, (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[2]; __pyx_lineno = 2242; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_indexer.diminfo[0].strides = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_indexer.diminfo[0].shape = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.shape[0];
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_out.rcbuffer->pybuffer, (PyObject*)__pyx_v_out, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2242; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_out.diminfo[0].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_out.diminfo[0].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[0];

  /* "pandas/src/generated.pyx":2250
 *         object fv
 * 
 *     n = len(indexer)             # <<<<<<<<<<<<<<
 * 
 *     fv = fill_value
 */
  __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_indexer)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2250; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_n = __pyx_t_1;

  /* "pandas/src/generated.pyx":2252
 *     n = len(indexer)
 * 
 *     fv = fill_value             # <<<<<<<<<<<<<<
 *     for i from 0 <= i < n:
 *         idx = indexer[i]
 */
  __Pyx_INCREF(__pyx_v_fill_value);
  __pyx_v_fv = __pyx_v_fill_value;

  /* "pandas/src/generated.pyx":2253
 * 
 *     fv = fill_value
 *     for i from 0 <= i < n:             # <<<<<<<<<<<<<<
 *         idx = indexer[i]
 *         if idx == -1:
 */
  __pyx_t_1 = __pyx_v_n;
  for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_1; __pyx_v_i++) {

    /* "pandas/src/generated.pyx":2254
 *     fv = fill_value
 *     for i from 0 <= i < n:
 *         idx = indexer[i]             # <<<<<<<<<<<<<<
 *         if idx == -1:
 *             out[i] = fv
 */
    __pyx_t_2 = __pyx_v_i;
    __pyx_t_3 = -1;
    if (__pyx_t_2 < 0) {
      __pyx_t_3 = 0;
    } else if (unlikely(__pyx_t_2 >= __pyx_pybuffernd_indexer.diminfo[0].shape)) __pyx_t_3 = 0;
    if (unlikely(__pyx_t_3 != -1)) {
      __Pyx_RaiseBufferIndexError(__pyx_t_3);
      {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2254; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_v_idx = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_2, __pyx_pybuffernd_indexer.diminfo[0].strides));

    /* "pandas/src/generated.pyx":2255
 *     for i from 0 <= i < n:
 *         idx = indexer[i]
 *         if idx == -1:             # <<<<<<<<<<<<<<
 *             out[i] = fv
 *         else:
 */
    __pyx_t_4 = ((__pyx_v_idx == -1) != 0);
    if (__pyx_t_4) {

      /* "pandas/src/generated.pyx":2256
 *         idx = indexer[i]
 *         if idx == -1:
 *             out[i] = fv             # <<<<<<<<<<<<<<
 *         else:
 *             out[i] = True if values[idx] > 0 else False
 */
      __pyx_t_5 = __pyx_v_i;
      __pyx_t_3 = -1;
      if (__pyx_t_5 < 0) {
        __pyx_t_3 = 0;
      } else if (unlikely(__pyx_t_5 >= __pyx_pybuffernd_out.diminfo[0].shape)) __pyx_t_3 = 0;
      if (unlikely(__pyx_t_3 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_3);
        {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2256; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_t_6 = __Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_5, __pyx_pybuffernd_out.diminfo[0].strides);
      __Pyx_GOTREF(*__pyx_t_6);
      __Pyx_INCREF(__pyx_v_fv); __Pyx_DECREF(*__pyx_t_6);
      *__pyx_t_6 = __pyx_v_fv;
      __Pyx_GIVEREF(*__pyx_t_6);
      goto __pyx_L5;
    }
    /*else*/ {

      /* "pandas/src/generated.pyx":2258
 *             out[i] = fv
 *         else:
 *             out[i] = True if values[idx] > 0 else False             # <<<<<<<<<<<<<<
 * 
 * @cython.wraparound(False)
 */
      __pyx_t_8 = __pyx_v_idx;
      __pyx_t_3 = -1;
      if (__pyx_t_8 < 0) {
        __pyx_t_3 = 0;
      } else if (unlikely(__pyx_t_8 >= __pyx_pybuffernd_values.diminfo[0].shape)) __pyx_t_3 = 0;
      if (unlikely(__pyx_t_3 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_3);
        {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2258; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      if ((((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_uint8_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_values.diminfo[0].strides)) > 0) != 0)) {
        __Pyx_INCREF(Py_True);
        __pyx_t_7 = Py_True;
      } else {
        __Pyx_INCREF(Py_False);
        __pyx_t_7 = Py_False;
      }
      __pyx_t_9 = __pyx_v_i;
      __pyx_t_3 = -1;
      if (__pyx_t_9 < 0) {
        __pyx_t_3 = 0;
      } else if (unlikely(__pyx_t_9 >= __pyx_pybuffernd_out.diminfo[0].shape)) __pyx_t_3 = 0;
      if (unlikely(__pyx_t_3 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_3);
        {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2258; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_t_6 = __Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_9, __pyx_pybuffernd_out.diminfo[0].strides);
      __Pyx_GOTREF(*__pyx_t_6);
      __Pyx_INCREF(__pyx_t_7); __Pyx_DECREF(*__pyx_t_6);
      *__pyx_t_6 = __pyx_t_7;
      __Pyx_GIVEREF(*__pyx_t_6);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    }
    __pyx_L5:;
  }

  /* "pandas/src/generated.pyx":2242
 * 
 * @cython.wraparound(False)
 * def take_1d_bool_object(ndarray[uint8_t] values,             # <<<<<<<<<<<<<<
 *                               ndarray[int64_t] indexer,
 *                               ndarray[object] out,
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_7);
  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
    __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas.algos.take_1d_bool_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer);
  __pyx_L2:;
  __Pyx_XDECREF(__pyx_v_fv);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/src/generated.pyx":2261
 * 
 * @cython.wraparound(False)
 * def take_1d_int8_int8(ndarray[int8_t] values,             # <<<<<<<<<<<<<<
 *                               ndarray[int64_t] indexer,
 *                               ndarray[int8_t] out,
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pandas_5algos_227take_1d_int8_int8(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_5algos_227take_1d_int8_int8 = {__Pyx_NAMESTR("take_1d_int8_int8"), (PyCFunction)__pyx_pw_6pandas_5algos_227take_1d_int8_int8, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pw_6pandas_5algos_227take_1d_int8_int8(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyArrayObject *__pyx_v_values = 0;
  PyArrayObject *__pyx_v_indexer = 0;
  PyArrayObject *__pyx_v_out = 0;
  PyObject *__pyx_v_fill_value = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("take_1d_int8_int8 (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_values,&__pyx_n_s_indexer,&__pyx_n_s_out,&__pyx_n_s_fill_value,0};
    PyObject* values[4] = {0,0,0,0};
    values[3] = __pyx_k__118;
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_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 (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_indexer)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("take_1d_int8_int8", 0, 3, 4, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2261; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_out)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("take_1d_int8_int8", 0, 3, 4, 2); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2261; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  3:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_fill_value);
          if (value) { values[3] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "take_1d_int8_int8") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2261; __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_values = ((PyArrayObject *)values[0]);
    __pyx_v_indexer = ((PyArrayObject *)values[1]);
    __pyx_v_out = ((PyArrayObject *)values[2]);
    __pyx_v_fill_value = values[3];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("take_1d_int8_int8", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2261; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas.algos.take_1d_int8_int8", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2261; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_indexer), __pyx_ptype_5numpy_ndarray, 1, "indexer", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2262; __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[2]; __pyx_lineno = 2263; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_226take_1d_int8_int8(__pyx_self, __pyx_v_values, __pyx_v_indexer, __pyx_v_out, __pyx_v_fill_value);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pandas_5algos_226take_1d_int8_int8(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_indexer, PyArrayObject *__pyx_v_out, PyObject *__pyx_v_fill_value) {
  Py_ssize_t __pyx_v_i;
  Py_ssize_t __pyx_v_n;
  Py_ssize_t __pyx_v_idx;
  __pyx_t_5numpy_int8_t __pyx_v_fv;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_indexer;
  __Pyx_Buffer __pyx_pybuffer_indexer;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_out;
  __Pyx_Buffer __pyx_pybuffer_out;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_values;
  __Pyx_Buffer __pyx_pybuffer_values;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  Py_ssize_t __pyx_t_1;
  __pyx_t_5numpy_int8_t __pyx_t_2;
  Py_ssize_t __pyx_t_3;
  int __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;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("take_1d_int8_int8", 0);
  __pyx_pybuffer_values.pybuffer.buf = NULL;
  __pyx_pybuffer_values.refcount = 0;
  __pyx_pybuffernd_values.data = NULL;
  __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values;
  __pyx_pybuffer_indexer.pybuffer.buf = NULL;
  __pyx_pybuffer_indexer.refcount = 0;
  __pyx_pybuffernd_indexer.data = NULL;
  __pyx_pybuffernd_indexer.rcbuffer = &__pyx_pybuffer_indexer;
  __pyx_pybuffer_out.pybuffer.buf = NULL;
  __pyx_pybuffer_out.refcount = 0;
  __pyx_pybuffernd_out.data = NULL;
  __pyx_pybuffernd_out.rcbuffer = &__pyx_pybuffer_out;
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int8_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2261; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0];
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer, (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[2]; __pyx_lineno = 2261; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_indexer.diminfo[0].strides = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_indexer.diminfo[0].shape = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.shape[0];
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_out.rcbuffer->pybuffer, (PyObject*)__pyx_v_out, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int8_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2261; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_out.diminfo[0].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_out.diminfo[0].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[0];

  /* "pandas/src/generated.pyx":2269
 *         int8_t fv
 * 
 *     n = len(indexer)             # <<<<<<<<<<<<<<
 * 
 *     fv = fill_value
 */
  __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_indexer)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2269; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_n = __pyx_t_1;

  /* "pandas/src/generated.pyx":2271
 *     n = len(indexer)
 * 
 *     fv = fill_value             # <<<<<<<<<<<<<<
 *     for i from 0 <= i < n:
 *         idx = indexer[i]
 */
  __pyx_t_2 = __Pyx_PyInt_As_npy_int8(__pyx_v_fill_value); if (unlikely((__pyx_t_2 == (npy_int8)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2271; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_fv = __pyx_t_2;

  /* "pandas/src/generated.pyx":2272
 * 
 *     fv = fill_value
 *     for i from 0 <= i < n:             # <<<<<<<<<<<<<<
 *         idx = indexer[i]
 *         if idx == -1:
 */
  __pyx_t_1 = __pyx_v_n;
  for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_1; __pyx_v_i++) {

    /* "pandas/src/generated.pyx":2273
 *     fv = fill_value
 *     for i from 0 <= i < n:
 *         idx = indexer[i]             # <<<<<<<<<<<<<<
 *         if idx == -1:
 *             out[i] = fv
 */
    __pyx_t_3 = __pyx_v_i;
    __pyx_t_4 = -1;
    if (__pyx_t_3 < 0) {
      __pyx_t_4 = 0;
    } else if (unlikely(__pyx_t_3 >= __pyx_pybuffernd_indexer.diminfo[0].shape)) __pyx_t_4 = 0;
    if (unlikely(__pyx_t_4 != -1)) {
      __Pyx_RaiseBufferIndexError(__pyx_t_4);
      {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2273; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_v_idx = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_3, __pyx_pybuffernd_indexer.diminfo[0].strides));

    /* "pandas/src/generated.pyx":2274
 *     for i from 0 <= i < n:
 *         idx = indexer[i]
 *         if idx == -1:             # <<<<<<<<<<<<<<
 *             out[i] = fv
 *         else:
 */
    __pyx_t_5 = ((__pyx_v_idx == -1) != 0);
    if (__pyx_t_5) {

      /* "pandas/src/generated.pyx":2275
 *         idx = indexer[i]
 *         if idx == -1:
 *             out[i] = fv             # <<<<<<<<<<<<<<
 *         else:
 *             out[i] = values[idx]
 */
      __pyx_t_6 = __pyx_v_i;
      __pyx_t_4 = -1;
      if (__pyx_t_6 < 0) {
        __pyx_t_4 = 0;
      } else if (unlikely(__pyx_t_6 >= __pyx_pybuffernd_out.diminfo[0].shape)) __pyx_t_4 = 0;
      if (unlikely(__pyx_t_4 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_4);
        {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2275; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int8_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_out.diminfo[0].strides) = __pyx_v_fv;
      goto __pyx_L5;
    }
    /*else*/ {

      /* "pandas/src/generated.pyx":2277
 *             out[i] = fv
 *         else:
 *             out[i] = values[idx]             # <<<<<<<<<<<<<<
 * 
 * @cython.wraparound(False)
 */
      __pyx_t_7 = __pyx_v_idx;
      __pyx_t_4 = -1;
      if (__pyx_t_7 < 0) {
        __pyx_t_4 = 0;
      } else if (unlikely(__pyx_t_7 >= __pyx_pybuffernd_values.diminfo[0].shape)) __pyx_t_4 = 0;
      if (unlikely(__pyx_t_4 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_4);
        {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2277; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_t_8 = __pyx_v_i;
      __pyx_t_4 = -1;
      if (__pyx_t_8 < 0) {
        __pyx_t_4 = 0;
      } else if (unlikely(__pyx_t_8 >= __pyx_pybuffernd_out.diminfo[0].shape)) __pyx_t_4 = 0;
      if (unlikely(__pyx_t_4 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_4);
        {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2277; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int8_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_out.diminfo[0].strides) = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int8_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_7, __pyx_pybuffernd_values.diminfo[0].strides));
    }
    __pyx_L5:;
  }

  /* "pandas/src/generated.pyx":2261
 * 
 * @cython.wraparound(False)
 * def take_1d_int8_int8(ndarray[int8_t] values,             # <<<<<<<<<<<<<<
 *                               ndarray[int64_t] indexer,
 *                               ndarray[int8_t] out,
 */

  /* function exit code */
  __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_pybuffernd_indexer.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas.algos.take_1d_int8_int8", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer);
  __pyx_L2:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/src/generated.pyx":2280
 * 
 * @cython.wraparound(False)
 * def take_1d_int8_int32(ndarray[int8_t] values,             # <<<<<<<<<<<<<<
 *                               ndarray[int64_t] indexer,
 *                               ndarray[int32_t] out,
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pandas_5algos_229take_1d_int8_int32(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_5algos_229take_1d_int8_int32 = {__Pyx_NAMESTR("take_1d_int8_int32"), (PyCFunction)__pyx_pw_6pandas_5algos_229take_1d_int8_int32, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pw_6pandas_5algos_229take_1d_int8_int32(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyArrayObject *__pyx_v_values = 0;
  PyArrayObject *__pyx_v_indexer = 0;
  PyArrayObject *__pyx_v_out = 0;
  PyObject *__pyx_v_fill_value = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("take_1d_int8_int32 (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_values,&__pyx_n_s_indexer,&__pyx_n_s_out,&__pyx_n_s_fill_value,0};
    PyObject* values[4] = {0,0,0,0};
    values[3] = __pyx_k__119;
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_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 (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_indexer)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("take_1d_int8_int32", 0, 3, 4, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2280; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_out)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("take_1d_int8_int32", 0, 3, 4, 2); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2280; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  3:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_fill_value);
          if (value) { values[3] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "take_1d_int8_int32") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2280; __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_values = ((PyArrayObject *)values[0]);
    __pyx_v_indexer = ((PyArrayObject *)values[1]);
    __pyx_v_out = ((PyArrayObject *)values[2]);
    __pyx_v_fill_value = values[3];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("take_1d_int8_int32", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2280; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas.algos.take_1d_int8_int32", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2280; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_indexer), __pyx_ptype_5numpy_ndarray, 1, "indexer", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2281; __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[2]; __pyx_lineno = 2282; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_228take_1d_int8_int32(__pyx_self, __pyx_v_values, __pyx_v_indexer, __pyx_v_out, __pyx_v_fill_value);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pandas_5algos_228take_1d_int8_int32(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_indexer, PyArrayObject *__pyx_v_out, PyObject *__pyx_v_fill_value) {
  Py_ssize_t __pyx_v_i;
  Py_ssize_t __pyx_v_n;
  Py_ssize_t __pyx_v_idx;
  __pyx_t_5numpy_int32_t __pyx_v_fv;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_indexer;
  __Pyx_Buffer __pyx_pybuffer_indexer;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_out;
  __Pyx_Buffer __pyx_pybuffer_out;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_values;
  __Pyx_Buffer __pyx_pybuffer_values;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  Py_ssize_t __pyx_t_1;
  __pyx_t_5numpy_int32_t __pyx_t_2;
  Py_ssize_t __pyx_t_3;
  int __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;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("take_1d_int8_int32", 0);
  __pyx_pybuffer_values.pybuffer.buf = NULL;
  __pyx_pybuffer_values.refcount = 0;
  __pyx_pybuffernd_values.data = NULL;
  __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values;
  __pyx_pybuffer_indexer.pybuffer.buf = NULL;
  __pyx_pybuffer_indexer.refcount = 0;
  __pyx_pybuffernd_indexer.data = NULL;
  __pyx_pybuffernd_indexer.rcbuffer = &__pyx_pybuffer_indexer;
  __pyx_pybuffer_out.pybuffer.buf = NULL;
  __pyx_pybuffer_out.refcount = 0;
  __pyx_pybuffernd_out.data = NULL;
  __pyx_pybuffernd_out.rcbuffer = &__pyx_pybuffer_out;
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int8_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2280; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0];
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer, (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[2]; __pyx_lineno = 2280; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_indexer.diminfo[0].strides = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_indexer.diminfo[0].shape = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.shape[0];
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_out.rcbuffer->pybuffer, (PyObject*)__pyx_v_out, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2280; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_out.diminfo[0].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_out.diminfo[0].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[0];

  /* "pandas/src/generated.pyx":2288
 *         int32_t fv
 * 
 *     n = len(indexer)             # <<<<<<<<<<<<<<
 * 
 *     fv = fill_value
 */
  __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_indexer)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2288; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_n = __pyx_t_1;

  /* "pandas/src/generated.pyx":2290
 *     n = len(indexer)
 * 
 *     fv = fill_value             # <<<<<<<<<<<<<<
 *     for i from 0 <= i < n:
 *         idx = indexer[i]
 */
  __pyx_t_2 = __Pyx_PyInt_As_npy_int32(__pyx_v_fill_value); if (unlikely((__pyx_t_2 == (npy_int32)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2290; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_fv = __pyx_t_2;

  /* "pandas/src/generated.pyx":2291
 * 
 *     fv = fill_value
 *     for i from 0 <= i < n:             # <<<<<<<<<<<<<<
 *         idx = indexer[i]
 *         if idx == -1:
 */
  __pyx_t_1 = __pyx_v_n;
  for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_1; __pyx_v_i++) {

    /* "pandas/src/generated.pyx":2292
 *     fv = fill_value
 *     for i from 0 <= i < n:
 *         idx = indexer[i]             # <<<<<<<<<<<<<<
 *         if idx == -1:
 *             out[i] = fv
 */
    __pyx_t_3 = __pyx_v_i;
    __pyx_t_4 = -1;
    if (__pyx_t_3 < 0) {
      __pyx_t_4 = 0;
    } else if (unlikely(__pyx_t_3 >= __pyx_pybuffernd_indexer.diminfo[0].shape)) __pyx_t_4 = 0;
    if (unlikely(__pyx_t_4 != -1)) {
      __Pyx_RaiseBufferIndexError(__pyx_t_4);
      {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2292; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_v_idx = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_3, __pyx_pybuffernd_indexer.diminfo[0].strides));

    /* "pandas/src/generated.pyx":2293
 *     for i from 0 <= i < n:
 *         idx = indexer[i]
 *         if idx == -1:             # <<<<<<<<<<<<<<
 *             out[i] = fv
 *         else:
 */
    __pyx_t_5 = ((__pyx_v_idx == -1) != 0);
    if (__pyx_t_5) {

      /* "pandas/src/generated.pyx":2294
 *         idx = indexer[i]
 *         if idx == -1:
 *             out[i] = fv             # <<<<<<<<<<<<<<
 *         else:
 *             out[i] = values[idx]
 */
      __pyx_t_6 = __pyx_v_i;
      __pyx_t_4 = -1;
      if (__pyx_t_6 < 0) {
        __pyx_t_4 = 0;
      } else if (unlikely(__pyx_t_6 >= __pyx_pybuffernd_out.diminfo[0].shape)) __pyx_t_4 = 0;
      if (unlikely(__pyx_t_4 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_4);
        {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2294; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_out.diminfo[0].strides) = __pyx_v_fv;
      goto __pyx_L5;
    }
    /*else*/ {

      /* "pandas/src/generated.pyx":2296
 *             out[i] = fv
 *         else:
 *             out[i] = values[idx]             # <<<<<<<<<<<<<<
 * 
 * @cython.wraparound(False)
 */
      __pyx_t_7 = __pyx_v_idx;
      __pyx_t_4 = -1;
      if (__pyx_t_7 < 0) {
        __pyx_t_4 = 0;
      } else if (unlikely(__pyx_t_7 >= __pyx_pybuffernd_values.diminfo[0].shape)) __pyx_t_4 = 0;
      if (unlikely(__pyx_t_4 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_4);
        {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2296; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_t_8 = __pyx_v_i;
      __pyx_t_4 = -1;
      if (__pyx_t_8 < 0) {
        __pyx_t_4 = 0;
      } else if (unlikely(__pyx_t_8 >= __pyx_pybuffernd_out.diminfo[0].shape)) __pyx_t_4 = 0;
      if (unlikely(__pyx_t_4 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_4);
        {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2296; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_out.diminfo[0].strides) = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int8_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_7, __pyx_pybuffernd_values.diminfo[0].strides));
    }
    __pyx_L5:;
  }

  /* "pandas/src/generated.pyx":2280
 * 
 * @cython.wraparound(False)
 * def take_1d_int8_int32(ndarray[int8_t] values,             # <<<<<<<<<<<<<<
 *                               ndarray[int64_t] indexer,
 *                               ndarray[int32_t] out,
 */

  /* function exit code */
  __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_pybuffernd_indexer.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas.algos.take_1d_int8_int32", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer);
  __pyx_L2:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/src/generated.pyx":2299
 * 
 * @cython.wraparound(False)
 * def take_1d_int8_int64(ndarray[int8_t] values,             # <<<<<<<<<<<<<<
 *                               ndarray[int64_t] indexer,
 *                               ndarray[int64_t] out,
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pandas_5algos_231take_1d_int8_int64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_5algos_231take_1d_int8_int64 = {__Pyx_NAMESTR("take_1d_int8_int64"), (PyCFunction)__pyx_pw_6pandas_5algos_231take_1d_int8_int64, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pw_6pandas_5algos_231take_1d_int8_int64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyArrayObject *__pyx_v_values = 0;
  PyArrayObject *__pyx_v_indexer = 0;
  PyArrayObject *__pyx_v_out = 0;
  PyObject *__pyx_v_fill_value = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("take_1d_int8_int64 (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_values,&__pyx_n_s_indexer,&__pyx_n_s_out,&__pyx_n_s_fill_value,0};
    PyObject* values[4] = {0,0,0,0};
    values[3] = __pyx_k__120;
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_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 (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_indexer)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("take_1d_int8_int64", 0, 3, 4, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2299; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_out)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("take_1d_int8_int64", 0, 3, 4, 2); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2299; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  3:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_fill_value);
          if (value) { values[3] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "take_1d_int8_int64") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2299; __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_values = ((PyArrayObject *)values[0]);
    __pyx_v_indexer = ((PyArrayObject *)values[1]);
    __pyx_v_out = ((PyArrayObject *)values[2]);
    __pyx_v_fill_value = values[3];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("take_1d_int8_int64", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2299; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas.algos.take_1d_int8_int64", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2299; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_indexer), __pyx_ptype_5numpy_ndarray, 1, "indexer", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2300; __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[2]; __pyx_lineno = 2301; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_230take_1d_int8_int64(__pyx_self, __pyx_v_values, __pyx_v_indexer, __pyx_v_out, __pyx_v_fill_value);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pandas_5algos_230take_1d_int8_int64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_indexer, PyArrayObject *__pyx_v_out, PyObject *__pyx_v_fill_value) {
  Py_ssize_t __pyx_v_i;
  Py_ssize_t __pyx_v_n;
  Py_ssize_t __pyx_v_idx;
  __pyx_t_5numpy_int64_t __pyx_v_fv;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_indexer;
  __Pyx_Buffer __pyx_pybuffer_indexer;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_out;
  __Pyx_Buffer __pyx_pybuffer_out;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_values;
  __Pyx_Buffer __pyx_pybuffer_values;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  Py_ssize_t __pyx_t_1;
  __pyx_t_5numpy_int64_t __pyx_t_2;
  Py_ssize_t __pyx_t_3;
  int __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;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("take_1d_int8_int64", 0);
  __pyx_pybuffer_values.pybuffer.buf = NULL;
  __pyx_pybuffer_values.refcount = 0;
  __pyx_pybuffernd_values.data = NULL;
  __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values;
  __pyx_pybuffer_indexer.pybuffer.buf = NULL;
  __pyx_pybuffer_indexer.refcount = 0;
  __pyx_pybuffernd_indexer.data = NULL;
  __pyx_pybuffernd_indexer.rcbuffer = &__pyx_pybuffer_indexer;
  __pyx_pybuffer_out.pybuffer.buf = NULL;
  __pyx_pybuffer_out.refcount = 0;
  __pyx_pybuffernd_out.data = NULL;
  __pyx_pybuffernd_out.rcbuffer = &__pyx_pybuffer_out;
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int8_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2299; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0];
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer, (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[2]; __pyx_lineno = 2299; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_indexer.diminfo[0].strides = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_indexer.diminfo[0].shape = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.shape[0];
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_out.rcbuffer->pybuffer, (PyObject*)__pyx_v_out, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2299; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_out.diminfo[0].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_out.diminfo[0].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[0];

  /* "pandas/src/generated.pyx":2307
 *         int64_t fv
 * 
 *     n = len(indexer)             # <<<<<<<<<<<<<<
 * 
 *     fv = fill_value
 */
  __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_indexer)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2307; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_n = __pyx_t_1;

  /* "pandas/src/generated.pyx":2309
 *     n = len(indexer)
 * 
 *     fv = fill_value             # <<<<<<<<<<<<<<
 *     for i from 0 <= i < n:
 *         idx = indexer[i]
 */
  __pyx_t_2 = __Pyx_PyInt_As_npy_int64(__pyx_v_fill_value); if (unlikely((__pyx_t_2 == (npy_int64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2309; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_fv = __pyx_t_2;

  /* "pandas/src/generated.pyx":2310
 * 
 *     fv = fill_value
 *     for i from 0 <= i < n:             # <<<<<<<<<<<<<<
 *         idx = indexer[i]
 *         if idx == -1:
 */
  __pyx_t_1 = __pyx_v_n;
  for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_1; __pyx_v_i++) {

    /* "pandas/src/generated.pyx":2311
 *     fv = fill_value
 *     for i from 0 <= i < n:
 *         idx = indexer[i]             # <<<<<<<<<<<<<<
 *         if idx == -1:
 *             out[i] = fv
 */
    __pyx_t_3 = __pyx_v_i;
    __pyx_t_4 = -1;
    if (__pyx_t_3 < 0) {
      __pyx_t_4 = 0;
    } else if (unlikely(__pyx_t_3 >= __pyx_pybuffernd_indexer.diminfo[0].shape)) __pyx_t_4 = 0;
    if (unlikely(__pyx_t_4 != -1)) {
      __Pyx_RaiseBufferIndexError(__pyx_t_4);
      {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2311; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_v_idx = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_3, __pyx_pybuffernd_indexer.diminfo[0].strides));

    /* "pandas/src/generated.pyx":2312
 *     for i from 0 <= i < n:
 *         idx = indexer[i]
 *         if idx == -1:             # <<<<<<<<<<<<<<
 *             out[i] = fv
 *         else:
 */
    __pyx_t_5 = ((__pyx_v_idx == -1) != 0);
    if (__pyx_t_5) {

      /* "pandas/src/generated.pyx":2313
 *         idx = indexer[i]
 *         if idx == -1:
 *             out[i] = fv             # <<<<<<<<<<<<<<
 *         else:
 *             out[i] = values[idx]
 */
      __pyx_t_6 = __pyx_v_i;
      __pyx_t_4 = -1;
      if (__pyx_t_6 < 0) {
        __pyx_t_4 = 0;
      } else if (unlikely(__pyx_t_6 >= __pyx_pybuffernd_out.diminfo[0].shape)) __pyx_t_4 = 0;
      if (unlikely(__pyx_t_4 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_4);
        {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2313; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_out.diminfo[0].strides) = __pyx_v_fv;
      goto __pyx_L5;
    }
    /*else*/ {

      /* "pandas/src/generated.pyx":2315
 *             out[i] = fv
 *         else:
 *             out[i] = values[idx]             # <<<<<<<<<<<<<<
 * 
 * @cython.wraparound(False)
 */
      __pyx_t_7 = __pyx_v_idx;
      __pyx_t_4 = -1;
      if (__pyx_t_7 < 0) {
        __pyx_t_4 = 0;
      } else if (unlikely(__pyx_t_7 >= __pyx_pybuffernd_values.diminfo[0].shape)) __pyx_t_4 = 0;
      if (unlikely(__pyx_t_4 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_4);
        {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2315; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_t_8 = __pyx_v_i;
      __pyx_t_4 = -1;
      if (__pyx_t_8 < 0) {
        __pyx_t_4 = 0;
      } else if (unlikely(__pyx_t_8 >= __pyx_pybuffernd_out.diminfo[0].shape)) __pyx_t_4 = 0;
      if (unlikely(__pyx_t_4 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_4);
        {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2315; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_out.diminfo[0].strides) = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int8_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_7, __pyx_pybuffernd_values.diminfo[0].strides));
    }
    __pyx_L5:;
  }

  /* "pandas/src/generated.pyx":2299
 * 
 * @cython.wraparound(False)
 * def take_1d_int8_int64(ndarray[int8_t] values,             # <<<<<<<<<<<<<<
 *                               ndarray[int64_t] indexer,
 *                               ndarray[int64_t] out,
 */

  /* function exit code */
  __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_pybuffernd_indexer.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas.algos.take_1d_int8_int64", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer);
  __pyx_L2:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/src/generated.pyx":2318
 * 
 * @cython.wraparound(False)
 * def take_1d_int8_float64(ndarray[int8_t] values,             # <<<<<<<<<<<<<<
 *                               ndarray[int64_t] indexer,
 *                               ndarray[float64_t] out,
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pandas_5algos_233take_1d_int8_float64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_5algos_233take_1d_int8_float64 = {__Pyx_NAMESTR("take_1d_int8_float64"), (PyCFunction)__pyx_pw_6pandas_5algos_233take_1d_int8_float64, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pw_6pandas_5algos_233take_1d_int8_float64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyArrayObject *__pyx_v_values = 0;
  PyArrayObject *__pyx_v_indexer = 0;
  PyArrayObject *__pyx_v_out = 0;
  PyObject *__pyx_v_fill_value = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("take_1d_int8_float64 (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_values,&__pyx_n_s_indexer,&__pyx_n_s_out,&__pyx_n_s_fill_value,0};
    PyObject* values[4] = {0,0,0,0};
    values[3] = __pyx_k__121;
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_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 (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_indexer)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("take_1d_int8_float64", 0, 3, 4, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2318; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_out)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("take_1d_int8_float64", 0, 3, 4, 2); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2318; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  3:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_fill_value);
          if (value) { values[3] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "take_1d_int8_float64") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2318; __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_values = ((PyArrayObject *)values[0]);
    __pyx_v_indexer = ((PyArrayObject *)values[1]);
    __pyx_v_out = ((PyArrayObject *)values[2]);
    __pyx_v_fill_value = values[3];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("take_1d_int8_float64", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2318; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas.algos.take_1d_int8_float64", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2318; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_indexer), __pyx_ptype_5numpy_ndarray, 1, "indexer", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2319; __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[2]; __pyx_lineno = 2320; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_232take_1d_int8_float64(__pyx_self, __pyx_v_values, __pyx_v_indexer, __pyx_v_out, __pyx_v_fill_value);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pandas_5algos_232take_1d_int8_float64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_indexer, PyArrayObject *__pyx_v_out, PyObject *__pyx_v_fill_value) {
  Py_ssize_t __pyx_v_i;
  Py_ssize_t __pyx_v_n;
  Py_ssize_t __pyx_v_idx;
  __pyx_t_5numpy_float64_t __pyx_v_fv;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_indexer;
  __Pyx_Buffer __pyx_pybuffer_indexer;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_out;
  __Pyx_Buffer __pyx_pybuffer_out;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_values;
  __Pyx_Buffer __pyx_pybuffer_values;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  Py_ssize_t __pyx_t_1;
  __pyx_t_5numpy_float64_t __pyx_t_2;
  Py_ssize_t __pyx_t_3;
  int __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;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("take_1d_int8_float64", 0);
  __pyx_pybuffer_values.pybuffer.buf = NULL;
  __pyx_pybuffer_values.refcount = 0;
  __pyx_pybuffernd_values.data = NULL;
  __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values;
  __pyx_pybuffer_indexer.pybuffer.buf = NULL;
  __pyx_pybuffer_indexer.refcount = 0;
  __pyx_pybuffernd_indexer.data = NULL;
  __pyx_pybuffernd_indexer.rcbuffer = &__pyx_pybuffer_indexer;
  __pyx_pybuffer_out.pybuffer.buf = NULL;
  __pyx_pybuffer_out.refcount = 0;
  __pyx_pybuffernd_out.data = NULL;
  __pyx_pybuffernd_out.rcbuffer = &__pyx_pybuffer_out;
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int8_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2318; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0];
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer, (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[2]; __pyx_lineno = 2318; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_indexer.diminfo[0].strides = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_indexer.diminfo[0].shape = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.shape[0];
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_out.rcbuffer->pybuffer, (PyObject*)__pyx_v_out, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2318; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_out.diminfo[0].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_out.diminfo[0].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[0];

  /* "pandas/src/generated.pyx":2326
 *         float64_t fv
 * 
 *     n = len(indexer)             # <<<<<<<<<<<<<<
 * 
 *     fv = fill_value
 */
  __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_indexer)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2326; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_n = __pyx_t_1;

  /* "pandas/src/generated.pyx":2328
 *     n = len(indexer)
 * 
 *     fv = fill_value             # <<<<<<<<<<<<<<
 *     for i from 0 <= i < n:
 *         idx = indexer[i]
 */
  __pyx_t_2 = __pyx_PyFloat_AsDouble(__pyx_v_fill_value); if (unlikely((__pyx_t_2 == (npy_float64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2328; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_fv = __pyx_t_2;

  /* "pandas/src/generated.pyx":2329
 * 
 *     fv = fill_value
 *     for i from 0 <= i < n:             # <<<<<<<<<<<<<<
 *         idx = indexer[i]
 *         if idx == -1:
 */
  __pyx_t_1 = __pyx_v_n;
  for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_1; __pyx_v_i++) {

    /* "pandas/src/generated.pyx":2330
 *     fv = fill_value
 *     for i from 0 <= i < n:
 *         idx = indexer[i]             # <<<<<<<<<<<<<<
 *         if idx == -1:
 *             out[i] = fv
 */
    __pyx_t_3 = __pyx_v_i;
    __pyx_t_4 = -1;
    if (__pyx_t_3 < 0) {
      __pyx_t_4 = 0;
    } else if (unlikely(__pyx_t_3 >= __pyx_pybuffernd_indexer.diminfo[0].shape)) __pyx_t_4 = 0;
    if (unlikely(__pyx_t_4 != -1)) {
      __Pyx_RaiseBufferIndexError(__pyx_t_4);
      {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2330; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_v_idx = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_3, __pyx_pybuffernd_indexer.diminfo[0].strides));

    /* "pandas/src/generated.pyx":2331
 *     for i from 0 <= i < n:
 *         idx = indexer[i]
 *         if idx == -1:             # <<<<<<<<<<<<<<
 *             out[i] = fv
 *         else:
 */
    __pyx_t_5 = ((__pyx_v_idx == -1) != 0);
    if (__pyx_t_5) {

      /* "pandas/src/generated.pyx":2332
 *         idx = indexer[i]
 *         if idx == -1:
 *             out[i] = fv             # <<<<<<<<<<<<<<
 *         else:
 *             out[i] = values[idx]
 */
      __pyx_t_6 = __pyx_v_i;
      __pyx_t_4 = -1;
      if (__pyx_t_6 < 0) {
        __pyx_t_4 = 0;
      } else if (unlikely(__pyx_t_6 >= __pyx_pybuffernd_out.diminfo[0].shape)) __pyx_t_4 = 0;
      if (unlikely(__pyx_t_4 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_4);
        {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2332; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_out.diminfo[0].strides) = __pyx_v_fv;
      goto __pyx_L5;
    }
    /*else*/ {

      /* "pandas/src/generated.pyx":2334
 *             out[i] = fv
 *         else:
 *             out[i] = values[idx]             # <<<<<<<<<<<<<<
 * 
 * @cython.wraparound(False)
 */
      __pyx_t_7 = __pyx_v_idx;
      __pyx_t_4 = -1;
      if (__pyx_t_7 < 0) {
        __pyx_t_4 = 0;
      } else if (unlikely(__pyx_t_7 >= __pyx_pybuffernd_values.diminfo[0].shape)) __pyx_t_4 = 0;
      if (unlikely(__pyx_t_4 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_4);
        {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2334; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_t_8 = __pyx_v_i;
      __pyx_t_4 = -1;
      if (__pyx_t_8 < 0) {
        __pyx_t_4 = 0;
      } else if (unlikely(__pyx_t_8 >= __pyx_pybuffernd_out.diminfo[0].shape)) __pyx_t_4 = 0;
      if (unlikely(__pyx_t_4 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_4);
        {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2334; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_out.diminfo[0].strides) = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int8_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_7, __pyx_pybuffernd_values.diminfo[0].strides));
    }
    __pyx_L5:;
  }

  /* "pandas/src/generated.pyx":2318
 * 
 * @cython.wraparound(False)
 * def take_1d_int8_float64(ndarray[int8_t] values,             # <<<<<<<<<<<<<<
 *                               ndarray[int64_t] indexer,
 *                               ndarray[float64_t] out,
 */

  /* function exit code */
  __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_pybuffernd_indexer.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas.algos.take_1d_int8_float64", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer);
  __pyx_L2:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/src/generated.pyx":2337
 * 
 * @cython.wraparound(False)
 * def take_1d_int16_int16(ndarray[int16_t] values,             # <<<<<<<<<<<<<<
 *                               ndarray[int64_t] indexer,
 *                               ndarray[int16_t] out,
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pandas_5algos_235take_1d_int16_int16(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_5algos_235take_1d_int16_int16 = {__Pyx_NAMESTR("take_1d_int16_int16"), (PyCFunction)__pyx_pw_6pandas_5algos_235take_1d_int16_int16, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pw_6pandas_5algos_235take_1d_int16_int16(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyArrayObject *__pyx_v_values = 0;
  PyArrayObject *__pyx_v_indexer = 0;
  PyArrayObject *__pyx_v_out = 0;
  PyObject *__pyx_v_fill_value = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("take_1d_int16_int16 (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_values,&__pyx_n_s_indexer,&__pyx_n_s_out,&__pyx_n_s_fill_value,0};
    PyObject* values[4] = {0,0,0,0};
    values[3] = __pyx_k__122;
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_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 (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_indexer)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("take_1d_int16_int16", 0, 3, 4, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2337; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_out)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("take_1d_int16_int16", 0, 3, 4, 2); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2337; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  3:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_fill_value);
          if (value) { values[3] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "take_1d_int16_int16") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2337; __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_values = ((PyArrayObject *)values[0]);
    __pyx_v_indexer = ((PyArrayObject *)values[1]);
    __pyx_v_out = ((PyArrayObject *)values[2]);
    __pyx_v_fill_value = values[3];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("take_1d_int16_int16", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2337; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas.algos.take_1d_int16_int16", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2337; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_indexer), __pyx_ptype_5numpy_ndarray, 1, "indexer", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2338; __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[2]; __pyx_lineno = 2339; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_234take_1d_int16_int16(__pyx_self, __pyx_v_values, __pyx_v_indexer, __pyx_v_out, __pyx_v_fill_value);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pandas_5algos_234take_1d_int16_int16(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_indexer, PyArrayObject *__pyx_v_out, PyObject *__pyx_v_fill_value) {
  Py_ssize_t __pyx_v_i;
  Py_ssize_t __pyx_v_n;
  Py_ssize_t __pyx_v_idx;
  __pyx_t_5numpy_int16_t __pyx_v_fv;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_indexer;
  __Pyx_Buffer __pyx_pybuffer_indexer;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_out;
  __Pyx_Buffer __pyx_pybuffer_out;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_values;
  __Pyx_Buffer __pyx_pybuffer_values;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  Py_ssize_t __pyx_t_1;
  __pyx_t_5numpy_int16_t __pyx_t_2;
  Py_ssize_t __pyx_t_3;
  int __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;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("take_1d_int16_int16", 0);
  __pyx_pybuffer_values.pybuffer.buf = NULL;
  __pyx_pybuffer_values.refcount = 0;
  __pyx_pybuffernd_values.data = NULL;
  __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values;
  __pyx_pybuffer_indexer.pybuffer.buf = NULL;
  __pyx_pybuffer_indexer.refcount = 0;
  __pyx_pybuffernd_indexer.data = NULL;
  __pyx_pybuffernd_indexer.rcbuffer = &__pyx_pybuffer_indexer;
  __pyx_pybuffer_out.pybuffer.buf = NULL;
  __pyx_pybuffer_out.refcount = 0;
  __pyx_pybuffernd_out.data = NULL;
  __pyx_pybuffernd_out.rcbuffer = &__pyx_pybuffer_out;
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int16_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2337; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0];
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer, (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[2]; __pyx_lineno = 2337; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_indexer.diminfo[0].strides = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_indexer.diminfo[0].shape = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.shape[0];
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_out.rcbuffer->pybuffer, (PyObject*)__pyx_v_out, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int16_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2337; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_out.diminfo[0].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_out.diminfo[0].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[0];

  /* "pandas/src/generated.pyx":2345
 *         int16_t fv
 * 
 *     n = len(indexer)             # <<<<<<<<<<<<<<
 * 
 *     fv = fill_value
 */
  __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_indexer)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2345; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_n = __pyx_t_1;

  /* "pandas/src/generated.pyx":2347
 *     n = len(indexer)
 * 
 *     fv = fill_value             # <<<<<<<<<<<<<<
 *     for i from 0 <= i < n:
 *         idx = indexer[i]
 */
  __pyx_t_2 = __Pyx_PyInt_As_npy_int16(__pyx_v_fill_value); if (unlikely((__pyx_t_2 == (npy_int16)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2347; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_fv = __pyx_t_2;

  /* "pandas/src/generated.pyx":2348
 * 
 *     fv = fill_value
 *     for i from 0 <= i < n:             # <<<<<<<<<<<<<<
 *         idx = indexer[i]
 *         if idx == -1:
 */
  __pyx_t_1 = __pyx_v_n;
  for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_1; __pyx_v_i++) {

    /* "pandas/src/generated.pyx":2349
 *     fv = fill_value
 *     for i from 0 <= i < n:
 *         idx = indexer[i]             # <<<<<<<<<<<<<<
 *         if idx == -1:
 *             out[i] = fv
 */
    __pyx_t_3 = __pyx_v_i;
    __pyx_t_4 = -1;
    if (__pyx_t_3 < 0) {
      __pyx_t_4 = 0;
    } else if (unlikely(__pyx_t_3 >= __pyx_pybuffernd_indexer.diminfo[0].shape)) __pyx_t_4 = 0;
    if (unlikely(__pyx_t_4 != -1)) {
      __Pyx_RaiseBufferIndexError(__pyx_t_4);
      {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2349; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_v_idx = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_3, __pyx_pybuffernd_indexer.diminfo[0].strides));

    /* "pandas/src/generated.pyx":2350
 *     for i from 0 <= i < n:
 *         idx = indexer[i]
 *         if idx == -1:             # <<<<<<<<<<<<<<
 *             out[i] = fv
 *         else:
 */
    __pyx_t_5 = ((__pyx_v_idx == -1) != 0);
    if (__pyx_t_5) {

      /* "pandas/src/generated.pyx":2351
 *         idx = indexer[i]
 *         if idx == -1:
 *             out[i] = fv             # <<<<<<<<<<<<<<
 *         else:
 *             out[i] = values[idx]
 */
      __pyx_t_6 = __pyx_v_i;
      __pyx_t_4 = -1;
      if (__pyx_t_6 < 0) {
        __pyx_t_4 = 0;
      } else if (unlikely(__pyx_t_6 >= __pyx_pybuffernd_out.diminfo[0].shape)) __pyx_t_4 = 0;
      if (unlikely(__pyx_t_4 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_4);
        {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2351; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int16_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_out.diminfo[0].strides) = __pyx_v_fv;
      goto __pyx_L5;
    }
    /*else*/ {

      /* "pandas/src/generated.pyx":2353
 *             out[i] = fv
 *         else:
 *             out[i] = values[idx]             # <<<<<<<<<<<<<<
 * 
 * @cython.wraparound(False)
 */
      __pyx_t_7 = __pyx_v_idx;
      __pyx_t_4 = -1;
      if (__pyx_t_7 < 0) {
        __pyx_t_4 = 0;
      } else if (unlikely(__pyx_t_7 >= __pyx_pybuffernd_values.diminfo[0].shape)) __pyx_t_4 = 0;
      if (unlikely(__pyx_t_4 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_4);
        {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2353; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_t_8 = __pyx_v_i;
      __pyx_t_4 = -1;
      if (__pyx_t_8 < 0) {
        __pyx_t_4 = 0;
      } else if (unlikely(__pyx_t_8 >= __pyx_pybuffernd_out.diminfo[0].shape)) __pyx_t_4 = 0;
      if (unlikely(__pyx_t_4 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_4);
        {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2353; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int16_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_out.diminfo[0].strides) = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int16_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_7, __pyx_pybuffernd_values.diminfo[0].strides));
    }
    __pyx_L5:;
  }

  /* "pandas/src/generated.pyx":2337
 * 
 * @cython.wraparound(False)
 * def take_1d_int16_int16(ndarray[int16_t] values,             # <<<<<<<<<<<<<<
 *                               ndarray[int64_t] indexer,
 *                               ndarray[int16_t] out,
 */

  /* function exit code */
  __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_pybuffernd_indexer.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas.algos.take_1d_int16_int16", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer);
  __pyx_L2:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/src/generated.pyx":2356
 * 
 * @cython.wraparound(False)
 * def take_1d_int16_int32(ndarray[int16_t] values,             # <<<<<<<<<<<<<<
 *                               ndarray[int64_t] indexer,
 *                               ndarray[int32_t] out,
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pandas_5algos_237take_1d_int16_int32(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_5algos_237take_1d_int16_int32 = {__Pyx_NAMESTR("take_1d_int16_int32"), (PyCFunction)__pyx_pw_6pandas_5algos_237take_1d_int16_int32, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pw_6pandas_5algos_237take_1d_int16_int32(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyArrayObject *__pyx_v_values = 0;
  PyArrayObject *__pyx_v_indexer = 0;
  PyArrayObject *__pyx_v_out = 0;
  PyObject *__pyx_v_fill_value = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("take_1d_int16_int32 (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_values,&__pyx_n_s_indexer,&__pyx_n_s_out,&__pyx_n_s_fill_value,0};
    PyObject* values[4] = {0,0,0,0};
    values[3] = __pyx_k__123;
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_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 (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_indexer)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("take_1d_int16_int32", 0, 3, 4, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2356; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_out)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("take_1d_int16_int32", 0, 3, 4, 2); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2356; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  3:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_fill_value);
          if (value) { values[3] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "take_1d_int16_int32") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2356; __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_values = ((PyArrayObject *)values[0]);
    __pyx_v_indexer = ((PyArrayObject *)values[1]);
    __pyx_v_out = ((PyArrayObject *)values[2]);
    __pyx_v_fill_value = values[3];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("take_1d_int16_int32", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2356; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas.algos.take_1d_int16_int32", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2356; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_indexer), __pyx_ptype_5numpy_ndarray, 1, "indexer", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2357; __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[2]; __pyx_lineno = 2358; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_236take_1d_int16_int32(__pyx_self, __pyx_v_values, __pyx_v_indexer, __pyx_v_out, __pyx_v_fill_value);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pandas_5algos_236take_1d_int16_int32(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_indexer, PyArrayObject *__pyx_v_out, PyObject *__pyx_v_fill_value) {
  Py_ssize_t __pyx_v_i;
  Py_ssize_t __pyx_v_n;
  Py_ssize_t __pyx_v_idx;
  __pyx_t_5numpy_int32_t __pyx_v_fv;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_indexer;
  __Pyx_Buffer __pyx_pybuffer_indexer;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_out;
  __Pyx_Buffer __pyx_pybuffer_out;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_values;
  __Pyx_Buffer __pyx_pybuffer_values;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  Py_ssize_t __pyx_t_1;
  __pyx_t_5numpy_int32_t __pyx_t_2;
  Py_ssize_t __pyx_t_3;
  int __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;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("take_1d_int16_int32", 0);
  __pyx_pybuffer_values.pybuffer.buf = NULL;
  __pyx_pybuffer_values.refcount = 0;
  __pyx_pybuffernd_values.data = NULL;
  __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values;
  __pyx_pybuffer_indexer.pybuffer.buf = NULL;
  __pyx_pybuffer_indexer.refcount = 0;
  __pyx_pybuffernd_indexer.data = NULL;
  __pyx_pybuffernd_indexer.rcbuffer = &__pyx_pybuffer_indexer;
  __pyx_pybuffer_out.pybuffer.buf = NULL;
  __pyx_pybuffer_out.refcount = 0;
  __pyx_pybuffernd_out.data = NULL;
  __pyx_pybuffernd_out.rcbuffer = &__pyx_pybuffer_out;
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int16_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2356; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0];
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer, (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[2]; __pyx_lineno = 2356; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_indexer.diminfo[0].strides = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_indexer.diminfo[0].shape = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.shape[0];
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_out.rcbuffer->pybuffer, (PyObject*)__pyx_v_out, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2356; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_out.diminfo[0].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_out.diminfo[0].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[0];

  /* "pandas/src/generated.pyx":2364
 *         int32_t fv
 * 
 *     n = len(indexer)             # <<<<<<<<<<<<<<
 * 
 *     fv = fill_value
 */
  __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_indexer)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2364; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_n = __pyx_t_1;

  /* "pandas/src/generated.pyx":2366
 *     n = len(indexer)
 * 
 *     fv = fill_value             # <<<<<<<<<<<<<<
 *     for i from 0 <= i < n:
 *         idx = indexer[i]
 */
  __pyx_t_2 = __Pyx_PyInt_As_npy_int32(__pyx_v_fill_value); if (unlikely((__pyx_t_2 == (npy_int32)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2366; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_fv = __pyx_t_2;

  /* "pandas/src/generated.pyx":2367
 * 
 *     fv = fill_value
 *     for i from 0 <= i < n:             # <<<<<<<<<<<<<<
 *         idx = indexer[i]
 *         if idx == -1:
 */
  __pyx_t_1 = __pyx_v_n;
  for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_1; __pyx_v_i++) {

    /* "pandas/src/generated.pyx":2368
 *     fv = fill_value
 *     for i from 0 <= i < n:
 *         idx = indexer[i]             # <<<<<<<<<<<<<<
 *         if idx == -1:
 *             out[i] = fv
 */
    __pyx_t_3 = __pyx_v_i;
    __pyx_t_4 = -1;
    if (__pyx_t_3 < 0) {
      __pyx_t_4 = 0;
    } else if (unlikely(__pyx_t_3 >= __pyx_pybuffernd_indexer.diminfo[0].shape)) __pyx_t_4 = 0;
    if (unlikely(__pyx_t_4 != -1)) {
      __Pyx_RaiseBufferIndexError(__pyx_t_4);
      {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2368; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_v_idx = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_3, __pyx_pybuffernd_indexer.diminfo[0].strides));

    /* "pandas/src/generated.pyx":2369
 *     for i from 0 <= i < n:
 *         idx = indexer[i]
 *         if idx == -1:             # <<<<<<<<<<<<<<
 *             out[i] = fv
 *         else:
 */
    __pyx_t_5 = ((__pyx_v_idx == -1) != 0);
    if (__pyx_t_5) {

      /* "pandas/src/generated.pyx":2370
 *         idx = indexer[i]
 *         if idx == -1:
 *             out[i] = fv             # <<<<<<<<<<<<<<
 *         else:
 *             out[i] = values[idx]
 */
      __pyx_t_6 = __pyx_v_i;
      __pyx_t_4 = -1;
      if (__pyx_t_6 < 0) {
        __pyx_t_4 = 0;
      } else if (unlikely(__pyx_t_6 >= __pyx_pybuffernd_out.diminfo[0].shape)) __pyx_t_4 = 0;
      if (unlikely(__pyx_t_4 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_4);
        {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2370; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_out.diminfo[0].strides) = __pyx_v_fv;
      goto __pyx_L5;
    }
    /*else*/ {

      /* "pandas/src/generated.pyx":2372
 *             out[i] = fv
 *         else:
 *             out[i] = values[idx]             # <<<<<<<<<<<<<<
 * 
 * @cython.wraparound(False)
 */
      __pyx_t_7 = __pyx_v_idx;
      __pyx_t_4 = -1;
      if (__pyx_t_7 < 0) {
        __pyx_t_4 = 0;
      } else if (unlikely(__pyx_t_7 >= __pyx_pybuffernd_values.diminfo[0].shape)) __pyx_t_4 = 0;
      if (unlikely(__pyx_t_4 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_4);
        {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2372; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_t_8 = __pyx_v_i;
      __pyx_t_4 = -1;
      if (__pyx_t_8 < 0) {
        __pyx_t_4 = 0;
      } else if (unlikely(__pyx_t_8 >= __pyx_pybuffernd_out.diminfo[0].shape)) __pyx_t_4 = 0;
      if (unlikely(__pyx_t_4 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_4);
        {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2372; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_out.diminfo[0].strides) = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int16_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_7, __pyx_pybuffernd_values.diminfo[0].strides));
    }
    __pyx_L5:;
  }

  /* "pandas/src/generated.pyx":2356
 * 
 * @cython.wraparound(False)
 * def take_1d_int16_int32(ndarray[int16_t] values,             # <<<<<<<<<<<<<<
 *                               ndarray[int64_t] indexer,
 *                               ndarray[int32_t] out,
 */

  /* function exit code */
  __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_pybuffernd_indexer.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas.algos.take_1d_int16_int32", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer);
  __pyx_L2:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/src/generated.pyx":2375
 * 
 * @cython.wraparound(False)
 * def take_1d_int16_int64(ndarray[int16_t] values,             # <<<<<<<<<<<<<<
 *                               ndarray[int64_t] indexer,
 *                               ndarray[int64_t] out,
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pandas_5algos_239take_1d_int16_int64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_5algos_239take_1d_int16_int64 = {__Pyx_NAMESTR("take_1d_int16_int64"), (PyCFunction)__pyx_pw_6pandas_5algos_239take_1d_int16_int64, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pw_6pandas_5algos_239take_1d_int16_int64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyArrayObject *__pyx_v_values = 0;
  PyArrayObject *__pyx_v_indexer = 0;
  PyArrayObject *__pyx_v_out = 0;
  PyObject *__pyx_v_fill_value = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("take_1d_int16_int64 (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_values,&__pyx_n_s_indexer,&__pyx_n_s_out,&__pyx_n_s_fill_value,0};
    PyObject* values[4] = {0,0,0,0};
    values[3] = __pyx_k__124;
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_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 (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_indexer)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("take_1d_int16_int64", 0, 3, 4, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2375; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_out)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("take_1d_int16_int64", 0, 3, 4, 2); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2375; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  3:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_fill_value);
          if (value) { values[3] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "take_1d_int16_int64") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2375; __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_values = ((PyArrayObject *)values[0]);
    __pyx_v_indexer = ((PyArrayObject *)values[1]);
    __pyx_v_out = ((PyArrayObject *)values[2]);
    __pyx_v_fill_value = values[3];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("take_1d_int16_int64", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2375; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas.algos.take_1d_int16_int64", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2375; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_indexer), __pyx_ptype_5numpy_ndarray, 1, "indexer", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2376; __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[2]; __pyx_lineno = 2377; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_238take_1d_int16_int64(__pyx_self, __pyx_v_values, __pyx_v_indexer, __pyx_v_out, __pyx_v_fill_value);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pandas_5algos_238take_1d_int16_int64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_indexer, PyArrayObject *__pyx_v_out, PyObject *__pyx_v_fill_value) {
  Py_ssize_t __pyx_v_i;
  Py_ssize_t __pyx_v_n;
  Py_ssize_t __pyx_v_idx;
  __pyx_t_5numpy_int64_t __pyx_v_fv;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_indexer;
  __Pyx_Buffer __pyx_pybuffer_indexer;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_out;
  __Pyx_Buffer __pyx_pybuffer_out;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_values;
  __Pyx_Buffer __pyx_pybuffer_values;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  Py_ssize_t __pyx_t_1;
  __pyx_t_5numpy_int64_t __pyx_t_2;
  Py_ssize_t __pyx_t_3;
  int __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;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("take_1d_int16_int64", 0);
  __pyx_pybuffer_values.pybuffer.buf = NULL;
  __pyx_pybuffer_values.refcount = 0;
  __pyx_pybuffernd_values.data = NULL;
  __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values;
  __pyx_pybuffer_indexer.pybuffer.buf = NULL;
  __pyx_pybuffer_indexer.refcount = 0;
  __pyx_pybuffernd_indexer.data = NULL;
  __pyx_pybuffernd_indexer.rcbuffer = &__pyx_pybuffer_indexer;
  __pyx_pybuffer_out.pybuffer.buf = NULL;
  __pyx_pybuffer_out.refcount = 0;
  __pyx_pybuffernd_out.data = NULL;
  __pyx_pybuffernd_out.rcbuffer = &__pyx_pybuffer_out;
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int16_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2375; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0];
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer, (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[2]; __pyx_lineno = 2375; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_indexer.diminfo[0].strides = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_indexer.diminfo[0].shape = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.shape[0];
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_out.rcbuffer->pybuffer, (PyObject*)__pyx_v_out, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2375; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_out.diminfo[0].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_out.diminfo[0].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[0];

  /* "pandas/src/generated.pyx":2383
 *         int64_t fv
 * 
 *     n = len(indexer)             # <<<<<<<<<<<<<<
 * 
 *     fv = fill_value
 */
  __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_indexer)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2383; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_n = __pyx_t_1;

  /* "pandas/src/generated.pyx":2385
 *     n = len(indexer)
 * 
 *     fv = fill_value             # <<<<<<<<<<<<<<
 *     for i from 0 <= i < n:
 *         idx = indexer[i]
 */
  __pyx_t_2 = __Pyx_PyInt_As_npy_int64(__pyx_v_fill_value); if (unlikely((__pyx_t_2 == (npy_int64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2385; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_fv = __pyx_t_2;

  /* "pandas/src/generated.pyx":2386
 * 
 *     fv = fill_value
 *     for i from 0 <= i < n:             # <<<<<<<<<<<<<<
 *         idx = indexer[i]
 *         if idx == -1:
 */
  __pyx_t_1 = __pyx_v_n;
  for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_1; __pyx_v_i++) {

    /* "pandas/src/generated.pyx":2387
 *     fv = fill_value
 *     for i from 0 <= i < n:
 *         idx = indexer[i]             # <<<<<<<<<<<<<<
 *         if idx == -1:
 *             out[i] = fv
 */
    __pyx_t_3 = __pyx_v_i;
    __pyx_t_4 = -1;
    if (__pyx_t_3 < 0) {
      __pyx_t_4 = 0;
    } else if (unlikely(__pyx_t_3 >= __pyx_pybuffernd_indexer.diminfo[0].shape)) __pyx_t_4 = 0;
    if (unlikely(__pyx_t_4 != -1)) {
      __Pyx_RaiseBufferIndexError(__pyx_t_4);
      {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2387; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_v_idx = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_3, __pyx_pybuffernd_indexer.diminfo[0].strides));

    /* "pandas/src/generated.pyx":2388
 *     for i from 0 <= i < n:
 *         idx = indexer[i]
 *         if idx == -1:             # <<<<<<<<<<<<<<
 *             out[i] = fv
 *         else:
 */
    __pyx_t_5 = ((__pyx_v_idx == -1) != 0);
    if (__pyx_t_5) {

      /* "pandas/src/generated.pyx":2389
 *         idx = indexer[i]
 *         if idx == -1:
 *             out[i] = fv             # <<<<<<<<<<<<<<
 *         else:
 *             out[i] = values[idx]
 */
      __pyx_t_6 = __pyx_v_i;
      __pyx_t_4 = -1;
      if (__pyx_t_6 < 0) {
        __pyx_t_4 = 0;
      } else if (unlikely(__pyx_t_6 >= __pyx_pybuffernd_out.diminfo[0].shape)) __pyx_t_4 = 0;
      if (unlikely(__pyx_t_4 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_4);
        {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2389; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_out.diminfo[0].strides) = __pyx_v_fv;
      goto __pyx_L5;
    }
    /*else*/ {

      /* "pandas/src/generated.pyx":2391
 *             out[i] = fv
 *         else:
 *             out[i] = values[idx]             # <<<<<<<<<<<<<<
 * 
 * @cython.wraparound(False)
 */
      __pyx_t_7 = __pyx_v_idx;
      __pyx_t_4 = -1;
      if (__pyx_t_7 < 0) {
        __pyx_t_4 = 0;
      } else if (unlikely(__pyx_t_7 >= __pyx_pybuffernd_values.diminfo[0].shape)) __pyx_t_4 = 0;
      if (unlikely(__pyx_t_4 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_4);
        {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2391; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_t_8 = __pyx_v_i;
      __pyx_t_4 = -1;
      if (__pyx_t_8 < 0) {
        __pyx_t_4 = 0;
      } else if (unlikely(__pyx_t_8 >= __pyx_pybuffernd_out.diminfo[0].shape)) __pyx_t_4 = 0;
      if (unlikely(__pyx_t_4 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_4);
        {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2391; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_out.diminfo[0].strides) = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int16_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_7, __pyx_pybuffernd_values.diminfo[0].strides));
    }
    __pyx_L5:;
  }

  /* "pandas/src/generated.pyx":2375
 * 
 * @cython.wraparound(False)
 * def take_1d_int16_int64(ndarray[int16_t] values,             # <<<<<<<<<<<<<<
 *                               ndarray[int64_t] indexer,
 *                               ndarray[int64_t] out,
 */

  /* function exit code */
  __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_pybuffernd_indexer.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas.algos.take_1d_int16_int64", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer);
  __pyx_L2:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/src/generated.pyx":2394
 * 
 * @cython.wraparound(False)
 * def take_1d_int16_float64(ndarray[int16_t] values,             # <<<<<<<<<<<<<<
 *                               ndarray[int64_t] indexer,
 *                               ndarray[float64_t] out,
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pandas_5algos_241take_1d_int16_float64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_5algos_241take_1d_int16_float64 = {__Pyx_NAMESTR("take_1d_int16_float64"), (PyCFunction)__pyx_pw_6pandas_5algos_241take_1d_int16_float64, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pw_6pandas_5algos_241take_1d_int16_float64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyArrayObject *__pyx_v_values = 0;
  PyArrayObject *__pyx_v_indexer = 0;
  PyArrayObject *__pyx_v_out = 0;
  PyObject *__pyx_v_fill_value = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("take_1d_int16_float64 (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_values,&__pyx_n_s_indexer,&__pyx_n_s_out,&__pyx_n_s_fill_value,0};
    PyObject* values[4] = {0,0,0,0};
    values[3] = __pyx_k__125;
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_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 (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_indexer)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("take_1d_int16_float64", 0, 3, 4, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2394; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_out)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("take_1d_int16_float64", 0, 3, 4, 2); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2394; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  3:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_fill_value);
          if (value) { values[3] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "take_1d_int16_float64") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2394; __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_values = ((PyArrayObject *)values[0]);
    __pyx_v_indexer = ((PyArrayObject *)values[1]);
    __pyx_v_out = ((PyArrayObject *)values[2]);
    __pyx_v_fill_value = values[3];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("take_1d_int16_float64", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2394; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas.algos.take_1d_int16_float64", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2394; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_indexer), __pyx_ptype_5numpy_ndarray, 1, "indexer", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2395; __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[2]; __pyx_lineno = 2396; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_240take_1d_int16_float64(__pyx_self, __pyx_v_values, __pyx_v_indexer, __pyx_v_out, __pyx_v_fill_value);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pandas_5algos_240take_1d_int16_float64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_indexer, PyArrayObject *__pyx_v_out, PyObject *__pyx_v_fill_value) {
  Py_ssize_t __pyx_v_i;
  Py_ssize_t __pyx_v_n;
  Py_ssize_t __pyx_v_idx;
  __pyx_t_5numpy_float64_t __pyx_v_fv;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_indexer;
  __Pyx_Buffer __pyx_pybuffer_indexer;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_out;
  __Pyx_Buffer __pyx_pybuffer_out;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_values;
  __Pyx_Buffer __pyx_pybuffer_values;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  Py_ssize_t __pyx_t_1;
  __pyx_t_5numpy_float64_t __pyx_t_2;
  Py_ssize_t __pyx_t_3;
  int __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;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("take_1d_int16_float64", 0);
  __pyx_pybuffer_values.pybuffer.buf = NULL;
  __pyx_pybuffer_values.refcount = 0;
  __pyx_pybuffernd_values.data = NULL;
  __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values;
  __pyx_pybuffer_indexer.pybuffer.buf = NULL;
  __pyx_pybuffer_indexer.refcount = 0;
  __pyx_pybuffernd_indexer.data = NULL;
  __pyx_pybuffernd_indexer.rcbuffer = &__pyx_pybuffer_indexer;
  __pyx_pybuffer_out.pybuffer.buf = NULL;
  __pyx_pybuffer_out.refcount = 0;
  __pyx_pybuffernd_out.data = NULL;
  __pyx_pybuffernd_out.rcbuffer = &__pyx_pybuffer_out;
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int16_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2394; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0];
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer, (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[2]; __pyx_lineno = 2394; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_indexer.diminfo[0].strides = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_indexer.diminfo[0].shape = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.shape[0];
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_out.rcbuffer->pybuffer, (PyObject*)__pyx_v_out, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2394; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_out.diminfo[0].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_out.diminfo[0].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[0];

  /* "pandas/src/generated.pyx":2402
 *         float64_t fv
 * 
 *     n = len(indexer)             # <<<<<<<<<<<<<<
 * 
 *     fv = fill_value
 */
  __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_indexer)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2402; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_n = __pyx_t_1;

  /* "pandas/src/generated.pyx":2404
 *     n = len(indexer)
 * 
 *     fv = fill_value             # <<<<<<<<<<<<<<
 *     for i from 0 <= i < n:
 *         idx = indexer[i]
 */
  __pyx_t_2 = __pyx_PyFloat_AsDouble(__pyx_v_fill_value); if (unlikely((__pyx_t_2 == (npy_float64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2404; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_fv = __pyx_t_2;

  /* "pandas/src/generated.pyx":2405
 * 
 *     fv = fill_value
 *     for i from 0 <= i < n:             # <<<<<<<<<<<<<<
 *         idx = indexer[i]
 *         if idx == -1:
 */
  __pyx_t_1 = __pyx_v_n;
  for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_1; __pyx_v_i++) {

    /* "pandas/src/generated.pyx":2406
 *     fv = fill_value
 *     for i from 0 <= i < n:
 *         idx = indexer[i]             # <<<<<<<<<<<<<<
 *         if idx == -1:
 *             out[i] = fv
 */
    __pyx_t_3 = __pyx_v_i;
    __pyx_t_4 = -1;
    if (__pyx_t_3 < 0) {
      __pyx_t_4 = 0;
    } else if (unlikely(__pyx_t_3 >= __pyx_pybuffernd_indexer.diminfo[0].shape)) __pyx_t_4 = 0;
    if (unlikely(__pyx_t_4 != -1)) {
      __Pyx_RaiseBufferIndexError(__pyx_t_4);
      {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2406; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_v_idx = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_3, __pyx_pybuffernd_indexer.diminfo[0].strides));

    /* "pandas/src/generated.pyx":2407
 *     for i from 0 <= i < n:
 *         idx = indexer[i]
 *         if idx == -1:             # <<<<<<<<<<<<<<
 *             out[i] = fv
 *         else:
 */
    __pyx_t_5 = ((__pyx_v_idx == -1) != 0);
    if (__pyx_t_5) {

      /* "pandas/src/generated.pyx":2408
 *         idx = indexer[i]
 *         if idx == -1:
 *             out[i] = fv             # <<<<<<<<<<<<<<
 *         else:
 *             out[i] = values[idx]
 */
      __pyx_t_6 = __pyx_v_i;
      __pyx_t_4 = -1;
      if (__pyx_t_6 < 0) {
        __pyx_t_4 = 0;
      } else if (unlikely(__pyx_t_6 >= __pyx_pybuffernd_out.diminfo[0].shape)) __pyx_t_4 = 0;
      if (unlikely(__pyx_t_4 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_4);
        {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2408; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_out.diminfo[0].strides) = __pyx_v_fv;
      goto __pyx_L5;
    }
    /*else*/ {

      /* "pandas/src/generated.pyx":2410
 *             out[i] = fv
 *         else:
 *             out[i] = values[idx]             # <<<<<<<<<<<<<<
 * 
 * @cython.wraparound(False)
 */
      __pyx_t_7 = __pyx_v_idx;
      __pyx_t_4 = -1;
      if (__pyx_t_7 < 0) {
        __pyx_t_4 = 0;
      } else if (unlikely(__pyx_t_7 >= __pyx_pybuffernd_values.diminfo[0].shape)) __pyx_t_4 = 0;
      if (unlikely(__pyx_t_4 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_4);
        {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2410; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_t_8 = __pyx_v_i;
      __pyx_t_4 = -1;
      if (__pyx_t_8 < 0) {
        __pyx_t_4 = 0;
      } else if (unlikely(__pyx_t_8 >= __pyx_pybuffernd_out.diminfo[0].shape)) __pyx_t_4 = 0;
      if (unlikely(__pyx_t_4 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_4);
        {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2410; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_out.diminfo[0].strides) = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int16_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_7, __pyx_pybuffernd_values.diminfo[0].strides));
    }
    __pyx_L5:;
  }

  /* "pandas/src/generated.pyx":2394
 * 
 * @cython.wraparound(False)
 * def take_1d_int16_float64(ndarray[int16_t] values,             # <<<<<<<<<<<<<<
 *                               ndarray[int64_t] indexer,
 *                               ndarray[float64_t] out,
 */

  /* function exit code */
  __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_pybuffernd_indexer.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas.algos.take_1d_int16_float64", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer);
  __pyx_L2:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/src/generated.pyx":2413
 * 
 * @cython.wraparound(False)
 * def take_1d_int32_int32(ndarray[int32_t] values,             # <<<<<<<<<<<<<<
 *                               ndarray[int64_t] indexer,
 *                               ndarray[int32_t] out,
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pandas_5algos_243take_1d_int32_int32(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_5algos_243take_1d_int32_int32 = {__Pyx_NAMESTR("take_1d_int32_int32"), (PyCFunction)__pyx_pw_6pandas_5algos_243take_1d_int32_int32, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pw_6pandas_5algos_243take_1d_int32_int32(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyArrayObject *__pyx_v_values = 0;
  PyArrayObject *__pyx_v_indexer = 0;
  PyArrayObject *__pyx_v_out = 0;
  PyObject *__pyx_v_fill_value = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("take_1d_int32_int32 (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_values,&__pyx_n_s_indexer,&__pyx_n_s_out,&__pyx_n_s_fill_value,0};
    PyObject* values[4] = {0,0,0,0};
    values[3] = __pyx_k__126;
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_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 (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_indexer)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("take_1d_int32_int32", 0, 3, 4, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2413; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_out)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("take_1d_int32_int32", 0, 3, 4, 2); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2413; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  3:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_fill_value);
          if (value) { values[3] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "take_1d_int32_int32") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2413; __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_values = ((PyArrayObject *)values[0]);
    __pyx_v_indexer = ((PyArrayObject *)values[1]);
    __pyx_v_out = ((PyArrayObject *)values[2]);
    __pyx_v_fill_value = values[3];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("take_1d_int32_int32", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2413; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas.algos.take_1d_int32_int32", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2413; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_indexer), __pyx_ptype_5numpy_ndarray, 1, "indexer", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2414; __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[2]; __pyx_lineno = 2415; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_242take_1d_int32_int32(__pyx_self, __pyx_v_values, __pyx_v_indexer, __pyx_v_out, __pyx_v_fill_value);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pandas_5algos_242take_1d_int32_int32(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_indexer, PyArrayObject *__pyx_v_out, PyObject *__pyx_v_fill_value) {
  Py_ssize_t __pyx_v_i;
  Py_ssize_t __pyx_v_n;
  Py_ssize_t __pyx_v_idx;
  __pyx_t_5numpy_int32_t __pyx_v_fv;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_indexer;
  __Pyx_Buffer __pyx_pybuffer_indexer;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_out;
  __Pyx_Buffer __pyx_pybuffer_out;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_values;
  __Pyx_Buffer __pyx_pybuffer_values;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  Py_ssize_t __pyx_t_1;
  __pyx_t_5numpy_int32_t __pyx_t_2;
  Py_ssize_t __pyx_t_3;
  int __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;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("take_1d_int32_int32", 0);
  __pyx_pybuffer_values.pybuffer.buf = NULL;
  __pyx_pybuffer_values.refcount = 0;
  __pyx_pybuffernd_values.data = NULL;
  __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values;
  __pyx_pybuffer_indexer.pybuffer.buf = NULL;
  __pyx_pybuffer_indexer.refcount = 0;
  __pyx_pybuffernd_indexer.data = NULL;
  __pyx_pybuffernd_indexer.rcbuffer = &__pyx_pybuffer_indexer;
  __pyx_pybuffer_out.pybuffer.buf = NULL;
  __pyx_pybuffer_out.refcount = 0;
  __pyx_pybuffernd_out.data = NULL;
  __pyx_pybuffernd_out.rcbuffer = &__pyx_pybuffer_out;
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (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[2]; __pyx_lineno = 2413; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0];
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer, (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[2]; __pyx_lineno = 2413; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_indexer.diminfo[0].strides = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_indexer.diminfo[0].shape = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.shape[0];
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_out.rcbuffer->pybuffer, (PyObject*)__pyx_v_out, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2413; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_out.diminfo[0].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_out.diminfo[0].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[0];

  /* "pandas/src/generated.pyx":2421
 *         int32_t fv
 * 
 *     n = len(indexer)             # <<<<<<<<<<<<<<
 * 
 *     fv = fill_value
 */
  __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_indexer)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2421; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_n = __pyx_t_1;

  /* "pandas/src/generated.pyx":2423
 *     n = len(indexer)
 * 
 *     fv = fill_value             # <<<<<<<<<<<<<<
 *     for i from 0 <= i < n:
 *         idx = indexer[i]
 */
  __pyx_t_2 = __Pyx_PyInt_As_npy_int32(__pyx_v_fill_value); if (unlikely((__pyx_t_2 == (npy_int32)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2423; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_fv = __pyx_t_2;

  /* "pandas/src/generated.pyx":2424
 * 
 *     fv = fill_value
 *     for i from 0 <= i < n:             # <<<<<<<<<<<<<<
 *         idx = indexer[i]
 *         if idx == -1:
 */
  __pyx_t_1 = __pyx_v_n;
  for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_1; __pyx_v_i++) {

    /* "pandas/src/generated.pyx":2425
 *     fv = fill_value
 *     for i from 0 <= i < n:
 *         idx = indexer[i]             # <<<<<<<<<<<<<<
 *         if idx == -1:
 *             out[i] = fv
 */
    __pyx_t_3 = __pyx_v_i;
    __pyx_t_4 = -1;
    if (__pyx_t_3 < 0) {
      __pyx_t_4 = 0;
    } else if (unlikely(__pyx_t_3 >= __pyx_pybuffernd_indexer.diminfo[0].shape)) __pyx_t_4 = 0;
    if (unlikely(__pyx_t_4 != -1)) {
      __Pyx_RaiseBufferIndexError(__pyx_t_4);
      {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2425; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_v_idx = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_3, __pyx_pybuffernd_indexer.diminfo[0].strides));

    /* "pandas/src/generated.pyx":2426
 *     for i from 0 <= i < n:
 *         idx = indexer[i]
 *         if idx == -1:             # <<<<<<<<<<<<<<
 *             out[i] = fv
 *         else:
 */
    __pyx_t_5 = ((__pyx_v_idx == -1) != 0);
    if (__pyx_t_5) {

      /* "pandas/src/generated.pyx":2427
 *         idx = indexer[i]
 *         if idx == -1:
 *             out[i] = fv             # <<<<<<<<<<<<<<
 *         else:
 *             out[i] = values[idx]
 */
      __pyx_t_6 = __pyx_v_i;
      __pyx_t_4 = -1;
      if (__pyx_t_6 < 0) {
        __pyx_t_4 = 0;
      } else if (unlikely(__pyx_t_6 >= __pyx_pybuffernd_out.diminfo[0].shape)) __pyx_t_4 = 0;
      if (unlikely(__pyx_t_4 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_4);
        {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2427; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_out.diminfo[0].strides) = __pyx_v_fv;
      goto __pyx_L5;
    }
    /*else*/ {

      /* "pandas/src/generated.pyx":2429
 *             out[i] = fv
 *         else:
 *             out[i] = values[idx]             # <<<<<<<<<<<<<<
 * 
 * @cython.wraparound(False)
 */
      __pyx_t_7 = __pyx_v_idx;
      __pyx_t_4 = -1;
      if (__pyx_t_7 < 0) {
        __pyx_t_4 = 0;
      } else if (unlikely(__pyx_t_7 >= __pyx_pybuffernd_values.diminfo[0].shape)) __pyx_t_4 = 0;
      if (unlikely(__pyx_t_4 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_4);
        {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2429; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_t_8 = __pyx_v_i;
      __pyx_t_4 = -1;
      if (__pyx_t_8 < 0) {
        __pyx_t_4 = 0;
      } else if (unlikely(__pyx_t_8 >= __pyx_pybuffernd_out.diminfo[0].shape)) __pyx_t_4 = 0;
      if (unlikely(__pyx_t_4 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_4);
        {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2429; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_out.diminfo[0].strides) = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_7, __pyx_pybuffernd_values.diminfo[0].strides));
    }
    __pyx_L5:;
  }

  /* "pandas/src/generated.pyx":2413
 * 
 * @cython.wraparound(False)
 * def take_1d_int32_int32(ndarray[int32_t] values,             # <<<<<<<<<<<<<<
 *                               ndarray[int64_t] indexer,
 *                               ndarray[int32_t] out,
 */

  /* function exit code */
  __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_pybuffernd_indexer.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas.algos.take_1d_int32_int32", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer);
  __pyx_L2:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/src/generated.pyx":2432
 * 
 * @cython.wraparound(False)
 * def take_1d_int32_int64(ndarray[int32_t] values,             # <<<<<<<<<<<<<<
 *                               ndarray[int64_t] indexer,
 *                               ndarray[int64_t] out,
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pandas_5algos_245take_1d_int32_int64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_5algos_245take_1d_int32_int64 = {__Pyx_NAMESTR("take_1d_int32_int64"), (PyCFunction)__pyx_pw_6pandas_5algos_245take_1d_int32_int64, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pw_6pandas_5algos_245take_1d_int32_int64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyArrayObject *__pyx_v_values = 0;
  PyArrayObject *__pyx_v_indexer = 0;
  PyArrayObject *__pyx_v_out = 0;
  PyObject *__pyx_v_fill_value = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("take_1d_int32_int64 (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_values,&__pyx_n_s_indexer,&__pyx_n_s_out,&__pyx_n_s_fill_value,0};
    PyObject* values[4] = {0,0,0,0};
    values[3] = __pyx_k__127;
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_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 (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_indexer)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("take_1d_int32_int64", 0, 3, 4, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2432; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_out)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("take_1d_int32_int64", 0, 3, 4, 2); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2432; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  3:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_fill_value);
          if (value) { values[3] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "take_1d_int32_int64") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2432; __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_values = ((PyArrayObject *)values[0]);
    __pyx_v_indexer = ((PyArrayObject *)values[1]);
    __pyx_v_out = ((PyArrayObject *)values[2]);
    __pyx_v_fill_value = values[3];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("take_1d_int32_int64", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2432; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas.algos.take_1d_int32_int64", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2432; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_indexer), __pyx_ptype_5numpy_ndarray, 1, "indexer", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2433; __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[2]; __pyx_lineno = 2434; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_244take_1d_int32_int64(__pyx_self, __pyx_v_values, __pyx_v_indexer, __pyx_v_out, __pyx_v_fill_value);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pandas_5algos_244take_1d_int32_int64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_indexer, PyArrayObject *__pyx_v_out, PyObject *__pyx_v_fill_value) {
  Py_ssize_t __pyx_v_i;
  Py_ssize_t __pyx_v_n;
  Py_ssize_t __pyx_v_idx;
  __pyx_t_5numpy_int64_t __pyx_v_fv;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_indexer;
  __Pyx_Buffer __pyx_pybuffer_indexer;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_out;
  __Pyx_Buffer __pyx_pybuffer_out;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_values;
  __Pyx_Buffer __pyx_pybuffer_values;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  Py_ssize_t __pyx_t_1;
  __pyx_t_5numpy_int64_t __pyx_t_2;
  Py_ssize_t __pyx_t_3;
  int __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;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("take_1d_int32_int64", 0);
  __pyx_pybuffer_values.pybuffer.buf = NULL;
  __pyx_pybuffer_values.refcount = 0;
  __pyx_pybuffernd_values.data = NULL;
  __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values;
  __pyx_pybuffer_indexer.pybuffer.buf = NULL;
  __pyx_pybuffer_indexer.refcount = 0;
  __pyx_pybuffernd_indexer.data = NULL;
  __pyx_pybuffernd_indexer.rcbuffer = &__pyx_pybuffer_indexer;
  __pyx_pybuffer_out.pybuffer.buf = NULL;
  __pyx_pybuffer_out.refcount = 0;
  __pyx_pybuffernd_out.data = NULL;
  __pyx_pybuffernd_out.rcbuffer = &__pyx_pybuffer_out;
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (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[2]; __pyx_lineno = 2432; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0];
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer, (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[2]; __pyx_lineno = 2432; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_indexer.diminfo[0].strides = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_indexer.diminfo[0].shape = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.shape[0];
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_out.rcbuffer->pybuffer, (PyObject*)__pyx_v_out, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2432; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_out.diminfo[0].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_out.diminfo[0].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[0];

  /* "pandas/src/generated.pyx":2440
 *         int64_t fv
 * 
 *     n = len(indexer)             # <<<<<<<<<<<<<<
 * 
 *     fv = fill_value
 */
  __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_indexer)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2440; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_n = __pyx_t_1;

  /* "pandas/src/generated.pyx":2442
 *     n = len(indexer)
 * 
 *     fv = fill_value             # <<<<<<<<<<<<<<
 *     for i from 0 <= i < n:
 *         idx = indexer[i]
 */
  __pyx_t_2 = __Pyx_PyInt_As_npy_int64(__pyx_v_fill_value); if (unlikely((__pyx_t_2 == (npy_int64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2442; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_fv = __pyx_t_2;

  /* "pandas/src/generated.pyx":2443
 * 
 *     fv = fill_value
 *     for i from 0 <= i < n:             # <<<<<<<<<<<<<<
 *         idx = indexer[i]
 *         if idx == -1:
 */
  __pyx_t_1 = __pyx_v_n;
  for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_1; __pyx_v_i++) {

    /* "pandas/src/generated.pyx":2444
 *     fv = fill_value
 *     for i from 0 <= i < n:
 *         idx = indexer[i]             # <<<<<<<<<<<<<<
 *         if idx == -1:
 *             out[i] = fv
 */
    __pyx_t_3 = __pyx_v_i;
    __pyx_t_4 = -1;
    if (__pyx_t_3 < 0) {
      __pyx_t_4 = 0;
    } else if (unlikely(__pyx_t_3 >= __pyx_pybuffernd_indexer.diminfo[0].shape)) __pyx_t_4 = 0;
    if (unlikely(__pyx_t_4 != -1)) {
      __Pyx_RaiseBufferIndexError(__pyx_t_4);
      {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2444; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_v_idx = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_3, __pyx_pybuffernd_indexer.diminfo[0].strides));

    /* "pandas/src/generated.pyx":2445
 *     for i from 0 <= i < n:
 *         idx = indexer[i]
 *         if idx == -1:             # <<<<<<<<<<<<<<
 *             out[i] = fv
 *         else:
 */
    __pyx_t_5 = ((__pyx_v_idx == -1) != 0);
    if (__pyx_t_5) {

      /* "pandas/src/generated.pyx":2446
 *         idx = indexer[i]
 *         if idx == -1:
 *             out[i] = fv             # <<<<<<<<<<<<<<
 *         else:
 *             out[i] = values[idx]
 */
      __pyx_t_6 = __pyx_v_i;
      __pyx_t_4 = -1;
      if (__pyx_t_6 < 0) {
        __pyx_t_4 = 0;
      } else if (unlikely(__pyx_t_6 >= __pyx_pybuffernd_out.diminfo[0].shape)) __pyx_t_4 = 0;
      if (unlikely(__pyx_t_4 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_4);
        {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2446; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_out.diminfo[0].strides) = __pyx_v_fv;
      goto __pyx_L5;
    }
    /*else*/ {

      /* "pandas/src/generated.pyx":2448
 *             out[i] = fv
 *         else:
 *             out[i] = values[idx]             # <<<<<<<<<<<<<<
 * 
 * @cython.wraparound(False)
 */
      __pyx_t_7 = __pyx_v_idx;
      __pyx_t_4 = -1;
      if (__pyx_t_7 < 0) {
        __pyx_t_4 = 0;
      } else if (unlikely(__pyx_t_7 >= __pyx_pybuffernd_values.diminfo[0].shape)) __pyx_t_4 = 0;
      if (unlikely(__pyx_t_4 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_4);
        {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2448; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_t_8 = __pyx_v_i;
      __pyx_t_4 = -1;
      if (__pyx_t_8 < 0) {
        __pyx_t_4 = 0;
      } else if (unlikely(__pyx_t_8 >= __pyx_pybuffernd_out.diminfo[0].shape)) __pyx_t_4 = 0;
      if (unlikely(__pyx_t_4 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_4);
        {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2448; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_out.diminfo[0].strides) = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_7, __pyx_pybuffernd_values.diminfo[0].strides));
    }
    __pyx_L5:;
  }

  /* "pandas/src/generated.pyx":2432
 * 
 * @cython.wraparound(False)
 * def take_1d_int32_int64(ndarray[int32_t] values,             # <<<<<<<<<<<<<<
 *                               ndarray[int64_t] indexer,
 *                               ndarray[int64_t] out,
 */

  /* function exit code */
  __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_pybuffernd_indexer.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas.algos.take_1d_int32_int64", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer);
  __pyx_L2:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/src/generated.pyx":2451
 * 
 * @cython.wraparound(False)
 * def take_1d_int32_float64(ndarray[int32_t] values,             # <<<<<<<<<<<<<<
 *                               ndarray[int64_t] indexer,
 *                               ndarray[float64_t] out,
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pandas_5algos_247take_1d_int32_float64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_5algos_247take_1d_int32_float64 = {__Pyx_NAMESTR("take_1d_int32_float64"), (PyCFunction)__pyx_pw_6pandas_5algos_247take_1d_int32_float64, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pw_6pandas_5algos_247take_1d_int32_float64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyArrayObject *__pyx_v_values = 0;
  PyArrayObject *__pyx_v_indexer = 0;
  PyArrayObject *__pyx_v_out = 0;
  PyObject *__pyx_v_fill_value = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("take_1d_int32_float64 (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_values,&__pyx_n_s_indexer,&__pyx_n_s_out,&__pyx_n_s_fill_value,0};
    PyObject* values[4] = {0,0,0,0};
    values[3] = __pyx_k__128;
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_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 (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_indexer)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("take_1d_int32_float64", 0, 3, 4, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2451; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_out)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("take_1d_int32_float64", 0, 3, 4, 2); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2451; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  3:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_fill_value);
          if (value) { values[3] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "take_1d_int32_float64") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2451; __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_values = ((PyArrayObject *)values[0]);
    __pyx_v_indexer = ((PyArrayObject *)values[1]);
    __pyx_v_out = ((PyArrayObject *)values[2]);
    __pyx_v_fill_value = values[3];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("take_1d_int32_float64", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2451; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas.algos.take_1d_int32_float64", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2451; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_indexer), __pyx_ptype_5numpy_ndarray, 1, "indexer", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2452; __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[2]; __pyx_lineno = 2453; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_246take_1d_int32_float64(__pyx_self, __pyx_v_values, __pyx_v_indexer, __pyx_v_out, __pyx_v_fill_value);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pandas_5algos_246take_1d_int32_float64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_indexer, PyArrayObject *__pyx_v_out, PyObject *__pyx_v_fill_value) {
  Py_ssize_t __pyx_v_i;
  Py_ssize_t __pyx_v_n;
  Py_ssize_t __pyx_v_idx;
  __pyx_t_5numpy_float64_t __pyx_v_fv;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_indexer;
  __Pyx_Buffer __pyx_pybuffer_indexer;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_out;
  __Pyx_Buffer __pyx_pybuffer_out;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_values;
  __Pyx_Buffer __pyx_pybuffer_values;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  Py_ssize_t __pyx_t_1;
  __pyx_t_5numpy_float64_t __pyx_t_2;
  Py_ssize_t __pyx_t_3;
  int __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;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("take_1d_int32_float64", 0);
  __pyx_pybuffer_values.pybuffer.buf = NULL;
  __pyx_pybuffer_values.refcount = 0;
  __pyx_pybuffernd_values.data = NULL;
  __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values;
  __pyx_pybuffer_indexer.pybuffer.buf = NULL;
  __pyx_pybuffer_indexer.refcount = 0;
  __pyx_pybuffernd_indexer.data = NULL;
  __pyx_pybuffernd_indexer.rcbuffer = &__pyx_pybuffer_indexer;
  __pyx_pybuffer_out.pybuffer.buf = NULL;
  __pyx_pybuffer_out.refcount = 0;
  __pyx_pybuffernd_out.data = NULL;
  __pyx_pybuffernd_out.rcbuffer = &__pyx_pybuffer_out;
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (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[2]; __pyx_lineno = 2451; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0];
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer, (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[2]; __pyx_lineno = 2451; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_indexer.diminfo[0].strides = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_indexer.diminfo[0].shape = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.shape[0];
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_out.rcbuffer->pybuffer, (PyObject*)__pyx_v_out, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2451; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_out.diminfo[0].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_out.diminfo[0].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[0];

  /* "pandas/src/generated.pyx":2459
 *         float64_t fv
 * 
 *     n = len(indexer)             # <<<<<<<<<<<<<<
 * 
 *     fv = fill_value
 */
  __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_indexer)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2459; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_n = __pyx_t_1;

  /* "pandas/src/generated.pyx":2461
 *     n = len(indexer)
 * 
 *     fv = fill_value             # <<<<<<<<<<<<<<
 *     for i from 0 <= i < n:
 *         idx = indexer[i]
 */
  __pyx_t_2 = __pyx_PyFloat_AsDouble(__pyx_v_fill_value); if (unlikely((__pyx_t_2 == (npy_float64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2461; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_fv = __pyx_t_2;

  /* "pandas/src/generated.pyx":2462
 * 
 *     fv = fill_value
 *     for i from 0 <= i < n:             # <<<<<<<<<<<<<<
 *         idx = indexer[i]
 *         if idx == -1:
 */
  __pyx_t_1 = __pyx_v_n;
  for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_1; __pyx_v_i++) {

    /* "pandas/src/generated.pyx":2463
 *     fv = fill_value
 *     for i from 0 <= i < n:
 *         idx = indexer[i]             # <<<<<<<<<<<<<<
 *         if idx == -1:
 *             out[i] = fv
 */
    __pyx_t_3 = __pyx_v_i;
    __pyx_t_4 = -1;
    if (__pyx_t_3 < 0) {
      __pyx_t_4 = 0;
    } else if (unlikely(__pyx_t_3 >= __pyx_pybuffernd_indexer.diminfo[0].shape)) __pyx_t_4 = 0;
    if (unlikely(__pyx_t_4 != -1)) {
      __Pyx_RaiseBufferIndexError(__pyx_t_4);
      {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2463; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_v_idx = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_3, __pyx_pybuffernd_indexer.diminfo[0].strides));

    /* "pandas/src/generated.pyx":2464
 *     for i from 0 <= i < n:
 *         idx = indexer[i]
 *         if idx == -1:             # <<<<<<<<<<<<<<
 *             out[i] = fv
 *         else:
 */
    __pyx_t_5 = ((__pyx_v_idx == -1) != 0);
    if (__pyx_t_5) {

      /* "pandas/src/generated.pyx":2465
 *         idx = indexer[i]
 *         if idx == -1:
 *             out[i] = fv             # <<<<<<<<<<<<<<
 *         else:
 *             out[i] = values[idx]
 */
      __pyx_t_6 = __pyx_v_i;
      __pyx_t_4 = -1;
      if (__pyx_t_6 < 0) {
        __pyx_t_4 = 0;
      } else if (unlikely(__pyx_t_6 >= __pyx_pybuffernd_out.diminfo[0].shape)) __pyx_t_4 = 0;
      if (unlikely(__pyx_t_4 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_4);
        {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2465; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_out.diminfo[0].strides) = __pyx_v_fv;
      goto __pyx_L5;
    }
    /*else*/ {

      /* "pandas/src/generated.pyx":2467
 *             out[i] = fv
 *         else:
 *             out[i] = values[idx]             # <<<<<<<<<<<<<<
 * 
 * @cython.wraparound(False)
 */
      __pyx_t_7 = __pyx_v_idx;
      __pyx_t_4 = -1;
      if (__pyx_t_7 < 0) {
        __pyx_t_4 = 0;
      } else if (unlikely(__pyx_t_7 >= __pyx_pybuffernd_values.diminfo[0].shape)) __pyx_t_4 = 0;
      if (unlikely(__pyx_t_4 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_4);
        {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2467; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_t_8 = __pyx_v_i;
      __pyx_t_4 = -1;
      if (__pyx_t_8 < 0) {
        __pyx_t_4 = 0;
      } else if (unlikely(__pyx_t_8 >= __pyx_pybuffernd_out.diminfo[0].shape)) __pyx_t_4 = 0;
      if (unlikely(__pyx_t_4 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_4);
        {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2467; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_out.diminfo[0].strides) = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_7, __pyx_pybuffernd_values.diminfo[0].strides));
    }
    __pyx_L5:;
  }

  /* "pandas/src/generated.pyx":2451
 * 
 * @cython.wraparound(False)
 * def take_1d_int32_float64(ndarray[int32_t] values,             # <<<<<<<<<<<<<<
 *                               ndarray[int64_t] indexer,
 *                               ndarray[float64_t] out,
 */

  /* function exit code */
  __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_pybuffernd_indexer.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas.algos.take_1d_int32_float64", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer);
  __pyx_L2:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/src/generated.pyx":2470
 * 
 * @cython.wraparound(False)
 * def take_1d_int64_int64(ndarray[int64_t] values,             # <<<<<<<<<<<<<<
 *                               ndarray[int64_t] indexer,
 *                               ndarray[int64_t] out,
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pandas_5algos_249take_1d_int64_int64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_5algos_249take_1d_int64_int64 = {__Pyx_NAMESTR("take_1d_int64_int64"), (PyCFunction)__pyx_pw_6pandas_5algos_249take_1d_int64_int64, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pw_6pandas_5algos_249take_1d_int64_int64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyArrayObject *__pyx_v_values = 0;
  PyArrayObject *__pyx_v_indexer = 0;
  PyArrayObject *__pyx_v_out = 0;
  PyObject *__pyx_v_fill_value = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("take_1d_int64_int64 (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_values,&__pyx_n_s_indexer,&__pyx_n_s_out,&__pyx_n_s_fill_value,0};
    PyObject* values[4] = {0,0,0,0};
    values[3] = __pyx_k__129;
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_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 (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_indexer)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("take_1d_int64_int64", 0, 3, 4, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2470; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_out)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("take_1d_int64_int64", 0, 3, 4, 2); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2470; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  3:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_fill_value);
          if (value) { values[3] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "take_1d_int64_int64") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2470; __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_values = ((PyArrayObject *)values[0]);
    __pyx_v_indexer = ((PyArrayObject *)values[1]);
    __pyx_v_out = ((PyArrayObject *)values[2]);
    __pyx_v_fill_value = values[3];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("take_1d_int64_int64", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2470; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas.algos.take_1d_int64_int64", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2470; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_indexer), __pyx_ptype_5numpy_ndarray, 1, "indexer", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2471; __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[2]; __pyx_lineno = 2472; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_248take_1d_int64_int64(__pyx_self, __pyx_v_values, __pyx_v_indexer, __pyx_v_out, __pyx_v_fill_value);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pandas_5algos_248take_1d_int64_int64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_indexer, PyArrayObject *__pyx_v_out, PyObject *__pyx_v_fill_value) {
  Py_ssize_t __pyx_v_i;
  Py_ssize_t __pyx_v_n;
  Py_ssize_t __pyx_v_idx;
  __pyx_t_5numpy_int64_t __pyx_v_fv;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_indexer;
  __Pyx_Buffer __pyx_pybuffer_indexer;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_out;
  __Pyx_Buffer __pyx_pybuffer_out;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_values;
  __Pyx_Buffer __pyx_pybuffer_values;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  Py_ssize_t __pyx_t_1;
  __pyx_t_5numpy_int64_t __pyx_t_2;
  Py_ssize_t __pyx_t_3;
  int __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;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("take_1d_int64_int64", 0);
  __pyx_pybuffer_values.pybuffer.buf = NULL;
  __pyx_pybuffer_values.refcount = 0;
  __pyx_pybuffernd_values.data = NULL;
  __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values;
  __pyx_pybuffer_indexer.pybuffer.buf = NULL;
  __pyx_pybuffer_indexer.refcount = 0;
  __pyx_pybuffernd_indexer.data = NULL;
  __pyx_pybuffernd_indexer.rcbuffer = &__pyx_pybuffer_indexer;
  __pyx_pybuffer_out.pybuffer.buf = NULL;
  __pyx_pybuffer_out.refcount = 0;
  __pyx_pybuffernd_out.data = NULL;
  __pyx_pybuffernd_out.rcbuffer = &__pyx_pybuffer_out;
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (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[2]; __pyx_lineno = 2470; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0];
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer, (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[2]; __pyx_lineno = 2470; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_indexer.diminfo[0].strides = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_indexer.diminfo[0].shape = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.shape[0];
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_out.rcbuffer->pybuffer, (PyObject*)__pyx_v_out, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2470; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_out.diminfo[0].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_out.diminfo[0].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[0];

  /* "pandas/src/generated.pyx":2478
 *         int64_t fv
 * 
 *     n = len(indexer)             # <<<<<<<<<<<<<<
 * 
 *     fv = fill_value
 */
  __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_indexer)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2478; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_n = __pyx_t_1;

  /* "pandas/src/generated.pyx":2480
 *     n = len(indexer)
 * 
 *     fv = fill_value             # <<<<<<<<<<<<<<
 *     for i from 0 <= i < n:
 *         idx = indexer[i]
 */
  __pyx_t_2 = __Pyx_PyInt_As_npy_int64(__pyx_v_fill_value); if (unlikely((__pyx_t_2 == (npy_int64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2480; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_fv = __pyx_t_2;

  /* "pandas/src/generated.pyx":2481
 * 
 *     fv = fill_value
 *     for i from 0 <= i < n:             # <<<<<<<<<<<<<<
 *         idx = indexer[i]
 *         if idx == -1:
 */
  __pyx_t_1 = __pyx_v_n;
  for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_1; __pyx_v_i++) {

    /* "pandas/src/generated.pyx":2482
 *     fv = fill_value
 *     for i from 0 <= i < n:
 *         idx = indexer[i]             # <<<<<<<<<<<<<<
 *         if idx == -1:
 *             out[i] = fv
 */
    __pyx_t_3 = __pyx_v_i;
    __pyx_t_4 = -1;
    if (__pyx_t_3 < 0) {
      __pyx_t_4 = 0;
    } else if (unlikely(__pyx_t_3 >= __pyx_pybuffernd_indexer.diminfo[0].shape)) __pyx_t_4 = 0;
    if (unlikely(__pyx_t_4 != -1)) {
      __Pyx_RaiseBufferIndexError(__pyx_t_4);
      {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2482; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_v_idx = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_3, __pyx_pybuffernd_indexer.diminfo[0].strides));

    /* "pandas/src/generated.pyx":2483
 *     for i from 0 <= i < n:
 *         idx = indexer[i]
 *         if idx == -1:             # <<<<<<<<<<<<<<
 *             out[i] = fv
 *         else:
 */
    __pyx_t_5 = ((__pyx_v_idx == -1) != 0);
    if (__pyx_t_5) {

      /* "pandas/src/generated.pyx":2484
 *         idx = indexer[i]
 *         if idx == -1:
 *             out[i] = fv             # <<<<<<<<<<<<<<
 *         else:
 *             out[i] = values[idx]
 */
      __pyx_t_6 = __pyx_v_i;
      __pyx_t_4 = -1;
      if (__pyx_t_6 < 0) {
        __pyx_t_4 = 0;
      } else if (unlikely(__pyx_t_6 >= __pyx_pybuffernd_out.diminfo[0].shape)) __pyx_t_4 = 0;
      if (unlikely(__pyx_t_4 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_4);
        {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2484; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_out.diminfo[0].strides) = __pyx_v_fv;
      goto __pyx_L5;
    }
    /*else*/ {

      /* "pandas/src/generated.pyx":2486
 *             out[i] = fv
 *         else:
 *             out[i] = values[idx]             # <<<<<<<<<<<<<<
 * 
 * @cython.wraparound(False)
 */
      __pyx_t_7 = __pyx_v_idx;
      __pyx_t_4 = -1;
      if (__pyx_t_7 < 0) {
        __pyx_t_4 = 0;
      } else if (unlikely(__pyx_t_7 >= __pyx_pybuffernd_values.diminfo[0].shape)) __pyx_t_4 = 0;
      if (unlikely(__pyx_t_4 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_4);
        {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2486; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_t_8 = __pyx_v_i;
      __pyx_t_4 = -1;
      if (__pyx_t_8 < 0) {
        __pyx_t_4 = 0;
      } else if (unlikely(__pyx_t_8 >= __pyx_pybuffernd_out.diminfo[0].shape)) __pyx_t_4 = 0;
      if (unlikely(__pyx_t_4 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_4);
        {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2486; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_out.diminfo[0].strides) = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_7, __pyx_pybuffernd_values.diminfo[0].strides));
    }
    __pyx_L5:;
  }

  /* "pandas/src/generated.pyx":2470
 * 
 * @cython.wraparound(False)
 * def take_1d_int64_int64(ndarray[int64_t] values,             # <<<<<<<<<<<<<<
 *                               ndarray[int64_t] indexer,
 *                               ndarray[int64_t] out,
 */

  /* function exit code */
  __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_pybuffernd_indexer.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas.algos.take_1d_int64_int64", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer);
  __pyx_L2:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/src/generated.pyx":2489
 * 
 * @cython.wraparound(False)
 * def take_1d_int64_float64(ndarray[int64_t] values,             # <<<<<<<<<<<<<<
 *                               ndarray[int64_t] indexer,
 *                               ndarray[float64_t] out,
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pandas_5algos_251take_1d_int64_float64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_5algos_251take_1d_int64_float64 = {__Pyx_NAMESTR("take_1d_int64_float64"), (PyCFunction)__pyx_pw_6pandas_5algos_251take_1d_int64_float64, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pw_6pandas_5algos_251take_1d_int64_float64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyArrayObject *__pyx_v_values = 0;
  PyArrayObject *__pyx_v_indexer = 0;
  PyArrayObject *__pyx_v_out = 0;
  PyObject *__pyx_v_fill_value = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("take_1d_int64_float64 (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_values,&__pyx_n_s_indexer,&__pyx_n_s_out,&__pyx_n_s_fill_value,0};
    PyObject* values[4] = {0,0,0,0};
    values[3] = __pyx_k__130;
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_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 (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_indexer)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("take_1d_int64_float64", 0, 3, 4, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2489; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_out)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("take_1d_int64_float64", 0, 3, 4, 2); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2489; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  3:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_fill_value);
          if (value) { values[3] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "take_1d_int64_float64") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2489; __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_values = ((PyArrayObject *)values[0]);
    __pyx_v_indexer = ((PyArrayObject *)values[1]);
    __pyx_v_out = ((PyArrayObject *)values[2]);
    __pyx_v_fill_value = values[3];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("take_1d_int64_float64", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2489; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas.algos.take_1d_int64_float64", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2489; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_indexer), __pyx_ptype_5numpy_ndarray, 1, "indexer", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2490; __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[2]; __pyx_lineno = 2491; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_250take_1d_int64_float64(__pyx_self, __pyx_v_values, __pyx_v_indexer, __pyx_v_out, __pyx_v_fill_value);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pandas_5algos_250take_1d_int64_float64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_indexer, PyArrayObject *__pyx_v_out, PyObject *__pyx_v_fill_value) {
  Py_ssize_t __pyx_v_i;
  Py_ssize_t __pyx_v_n;
  Py_ssize_t __pyx_v_idx;
  __pyx_t_5numpy_float64_t __pyx_v_fv;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_indexer;
  __Pyx_Buffer __pyx_pybuffer_indexer;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_out;
  __Pyx_Buffer __pyx_pybuffer_out;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_values;
  __Pyx_Buffer __pyx_pybuffer_values;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  Py_ssize_t __pyx_t_1;
  __pyx_t_5numpy_float64_t __pyx_t_2;
  Py_ssize_t __pyx_t_3;
  int __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;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("take_1d_int64_float64", 0);
  __pyx_pybuffer_values.pybuffer.buf = NULL;
  __pyx_pybuffer_values.refcount = 0;
  __pyx_pybuffernd_values.data = NULL;
  __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values;
  __pyx_pybuffer_indexer.pybuffer.buf = NULL;
  __pyx_pybuffer_indexer.refcount = 0;
  __pyx_pybuffernd_indexer.data = NULL;
  __pyx_pybuffernd_indexer.rcbuffer = &__pyx_pybuffer_indexer;
  __pyx_pybuffer_out.pybuffer.buf = NULL;
  __pyx_pybuffer_out.refcount = 0;
  __pyx_pybuffernd_out.data = NULL;
  __pyx_pybuffernd_out.rcbuffer = &__pyx_pybuffer_out;
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (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[2]; __pyx_lineno = 2489; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0];
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer, (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[2]; __pyx_lineno = 2489; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_indexer.diminfo[0].strides = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_indexer.diminfo[0].shape = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.shape[0];
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_out.rcbuffer->pybuffer, (PyObject*)__pyx_v_out, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2489; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_out.diminfo[0].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_out.diminfo[0].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[0];

  /* "pandas/src/generated.pyx":2497
 *         float64_t fv
 * 
 *     n = len(indexer)             # <<<<<<<<<<<<<<
 * 
 *     fv = fill_value
 */
  __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_indexer)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2497; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_n = __pyx_t_1;

  /* "pandas/src/generated.pyx":2499
 *     n = len(indexer)
 * 
 *     fv = fill_value             # <<<<<<<<<<<<<<
 *     for i from 0 <= i < n:
 *         idx = indexer[i]
 */
  __pyx_t_2 = __pyx_PyFloat_AsDouble(__pyx_v_fill_value); if (unlikely((__pyx_t_2 == (npy_float64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2499; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_fv = __pyx_t_2;

  /* "pandas/src/generated.pyx":2500
 * 
 *     fv = fill_value
 *     for i from 0 <= i < n:             # <<<<<<<<<<<<<<
 *         idx = indexer[i]
 *         if idx == -1:
 */
  __pyx_t_1 = __pyx_v_n;
  for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_1; __pyx_v_i++) {

    /* "pandas/src/generated.pyx":2501
 *     fv = fill_value
 *     for i from 0 <= i < n:
 *         idx = indexer[i]             # <<<<<<<<<<<<<<
 *         if idx == -1:
 *             out[i] = fv
 */
    __pyx_t_3 = __pyx_v_i;
    __pyx_t_4 = -1;
    if (__pyx_t_3 < 0) {
      __pyx_t_4 = 0;
    } else if (unlikely(__pyx_t_3 >= __pyx_pybuffernd_indexer.diminfo[0].shape)) __pyx_t_4 = 0;
    if (unlikely(__pyx_t_4 != -1)) {
      __Pyx_RaiseBufferIndexError(__pyx_t_4);
      {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2501; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_v_idx = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_3, __pyx_pybuffernd_indexer.diminfo[0].strides));

    /* "pandas/src/generated.pyx":2502
 *     for i from 0 <= i < n:
 *         idx = indexer[i]
 *         if idx == -1:             # <<<<<<<<<<<<<<
 *             out[i] = fv
 *         else:
 */
    __pyx_t_5 = ((__pyx_v_idx == -1) != 0);
    if (__pyx_t_5) {

      /* "pandas/src/generated.pyx":2503
 *         idx = indexer[i]
 *         if idx == -1:
 *             out[i] = fv             # <<<<<<<<<<<<<<
 *         else:
 *             out[i] = values[idx]
 */
      __pyx_t_6 = __pyx_v_i;
      __pyx_t_4 = -1;
      if (__pyx_t_6 < 0) {
        __pyx_t_4 = 0;
      } else if (unlikely(__pyx_t_6 >= __pyx_pybuffernd_out.diminfo[0].shape)) __pyx_t_4 = 0;
      if (unlikely(__pyx_t_4 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_4);
        {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2503; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_out.diminfo[0].strides) = __pyx_v_fv;
      goto __pyx_L5;
    }
    /*else*/ {

      /* "pandas/src/generated.pyx":2505
 *             out[i] = fv
 *         else:
 *             out[i] = values[idx]             # <<<<<<<<<<<<<<
 * 
 * @cython.wraparound(False)
 */
      __pyx_t_7 = __pyx_v_idx;
      __pyx_t_4 = -1;
      if (__pyx_t_7 < 0) {
        __pyx_t_4 = 0;
      } else if (unlikely(__pyx_t_7 >= __pyx_pybuffernd_values.diminfo[0].shape)) __pyx_t_4 = 0;
      if (unlikely(__pyx_t_4 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_4);
        {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2505; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_t_8 = __pyx_v_i;
      __pyx_t_4 = -1;
      if (__pyx_t_8 < 0) {
        __pyx_t_4 = 0;
      } else if (unlikely(__pyx_t_8 >= __pyx_pybuffernd_out.diminfo[0].shape)) __pyx_t_4 = 0;
      if (unlikely(__pyx_t_4 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_4);
        {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2505; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_out.diminfo[0].strides) = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_7, __pyx_pybuffernd_values.diminfo[0].strides));
    }
    __pyx_L5:;
  }

  /* "pandas/src/generated.pyx":2489
 * 
 * @cython.wraparound(False)
 * def take_1d_int64_float64(ndarray[int64_t] values,             # <<<<<<<<<<<<<<
 *                               ndarray[int64_t] indexer,
 *                               ndarray[float64_t] out,
 */

  /* function exit code */
  __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_pybuffernd_indexer.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas.algos.take_1d_int64_float64", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer);
  __pyx_L2:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/src/generated.pyx":2508
 * 
 * @cython.wraparound(False)
 * def take_1d_float32_float32(ndarray[float32_t] values,             # <<<<<<<<<<<<<<
 *                               ndarray[int64_t] indexer,
 *                               ndarray[float32_t] out,
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pandas_5algos_253take_1d_float32_float32(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_5algos_253take_1d_float32_float32 = {__Pyx_NAMESTR("take_1d_float32_float32"), (PyCFunction)__pyx_pw_6pandas_5algos_253take_1d_float32_float32, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pw_6pandas_5algos_253take_1d_float32_float32(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyArrayObject *__pyx_v_values = 0;
  PyArrayObject *__pyx_v_indexer = 0;
  PyArrayObject *__pyx_v_out = 0;
  PyObject *__pyx_v_fill_value = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("take_1d_float32_float32 (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_values,&__pyx_n_s_indexer,&__pyx_n_s_out,&__pyx_n_s_fill_value,0};
    PyObject* values[4] = {0,0,0,0};
    values[3] = __pyx_k__131;
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_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 (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_indexer)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("take_1d_float32_float32", 0, 3, 4, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2508; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_out)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("take_1d_float32_float32", 0, 3, 4, 2); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2508; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  3:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_fill_value);
          if (value) { values[3] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "take_1d_float32_float32") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2508; __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_values = ((PyArrayObject *)values[0]);
    __pyx_v_indexer = ((PyArrayObject *)values[1]);
    __pyx_v_out = ((PyArrayObject *)values[2]);
    __pyx_v_fill_value = values[3];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("take_1d_float32_float32", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2508; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas.algos.take_1d_float32_float32", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2508; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_indexer), __pyx_ptype_5numpy_ndarray, 1, "indexer", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2509; __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[2]; __pyx_lineno = 2510; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_252take_1d_float32_float32(__pyx_self, __pyx_v_values, __pyx_v_indexer, __pyx_v_out, __pyx_v_fill_value);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pandas_5algos_252take_1d_float32_float32(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_indexer, PyArrayObject *__pyx_v_out, PyObject *__pyx_v_fill_value) {
  Py_ssize_t __pyx_v_i;
  Py_ssize_t __pyx_v_n;
  Py_ssize_t __pyx_v_idx;
  __pyx_t_5numpy_float32_t __pyx_v_fv;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_indexer;
  __Pyx_Buffer __pyx_pybuffer_indexer;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_out;
  __Pyx_Buffer __pyx_pybuffer_out;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_values;
  __Pyx_Buffer __pyx_pybuffer_values;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  Py_ssize_t __pyx_t_1;
  __pyx_t_5numpy_float32_t __pyx_t_2;
  Py_ssize_t __pyx_t_3;
  int __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;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("take_1d_float32_float32", 0);
  __pyx_pybuffer_values.pybuffer.buf = NULL;
  __pyx_pybuffer_values.refcount = 0;
  __pyx_pybuffernd_values.data = NULL;
  __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values;
  __pyx_pybuffer_indexer.pybuffer.buf = NULL;
  __pyx_pybuffer_indexer.refcount = 0;
  __pyx_pybuffernd_indexer.data = NULL;
  __pyx_pybuffernd_indexer.rcbuffer = &__pyx_pybuffer_indexer;
  __pyx_pybuffer_out.pybuffer.buf = NULL;
  __pyx_pybuffer_out.refcount = 0;
  __pyx_pybuffernd_out.data = NULL;
  __pyx_pybuffernd_out.rcbuffer = &__pyx_pybuffer_out;
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2508; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0];
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer, (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[2]; __pyx_lineno = 2508; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_indexer.diminfo[0].strides = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_indexer.diminfo[0].shape = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.shape[0];
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_out.rcbuffer->pybuffer, (PyObject*)__pyx_v_out, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2508; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_out.diminfo[0].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_out.diminfo[0].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[0];

  /* "pandas/src/generated.pyx":2516
 *         float32_t fv
 * 
 *     n = len(indexer)             # <<<<<<<<<<<<<<
 * 
 *     fv = fill_value
 */
  __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_indexer)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2516; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_n = __pyx_t_1;

  /* "pandas/src/generated.pyx":2518
 *     n = len(indexer)
 * 
 *     fv = fill_value             # <<<<<<<<<<<<<<
 *     for i from 0 <= i < n:
 *         idx = indexer[i]
 */
  __pyx_t_2 = __pyx_PyFloat_AsFloat(__pyx_v_fill_value); if (unlikely((__pyx_t_2 == (npy_float32)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2518; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_fv = __pyx_t_2;

  /* "pandas/src/generated.pyx":2519
 * 
 *     fv = fill_value
 *     for i from 0 <= i < n:             # <<<<<<<<<<<<<<
 *         idx = indexer[i]
 *         if idx == -1:
 */
  __pyx_t_1 = __pyx_v_n;
  for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_1; __pyx_v_i++) {

    /* "pandas/src/generated.pyx":2520
 *     fv = fill_value
 *     for i from 0 <= i < n:
 *         idx = indexer[i]             # <<<<<<<<<<<<<<
 *         if idx == -1:
 *             out[i] = fv
 */
    __pyx_t_3 = __pyx_v_i;
    __pyx_t_4 = -1;
    if (__pyx_t_3 < 0) {
      __pyx_t_4 = 0;
    } else if (unlikely(__pyx_t_3 >= __pyx_pybuffernd_indexer.diminfo[0].shape)) __pyx_t_4 = 0;
    if (unlikely(__pyx_t_4 != -1)) {
      __Pyx_RaiseBufferIndexError(__pyx_t_4);
      {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2520; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_v_idx = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_3, __pyx_pybuffernd_indexer.diminfo[0].strides));

    /* "pandas/src/generated.pyx":2521
 *     for i from 0 <= i < n:
 *         idx = indexer[i]
 *         if idx == -1:             # <<<<<<<<<<<<<<
 *             out[i] = fv
 *         else:
 */
    __pyx_t_5 = ((__pyx_v_idx == -1) != 0);
    if (__pyx_t_5) {

      /* "pandas/src/generated.pyx":2522
 *         idx = indexer[i]
 *         if idx == -1:
 *             out[i] = fv             # <<<<<<<<<<<<<<
 *         else:
 *             out[i] = values[idx]
 */
      __pyx_t_6 = __pyx_v_i;
      __pyx_t_4 = -1;
      if (__pyx_t_6 < 0) {
        __pyx_t_4 = 0;
      } else if (unlikely(__pyx_t_6 >= __pyx_pybuffernd_out.diminfo[0].shape)) __pyx_t_4 = 0;
      if (unlikely(__pyx_t_4 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_4);
        {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2522; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_out.diminfo[0].strides) = __pyx_v_fv;
      goto __pyx_L5;
    }
    /*else*/ {

      /* "pandas/src/generated.pyx":2524
 *             out[i] = fv
 *         else:
 *             out[i] = values[idx]             # <<<<<<<<<<<<<<
 * 
 * @cython.wraparound(False)
 */
      __pyx_t_7 = __pyx_v_idx;
      __pyx_t_4 = -1;
      if (__pyx_t_7 < 0) {
        __pyx_t_4 = 0;
      } else if (unlikely(__pyx_t_7 >= __pyx_pybuffernd_values.diminfo[0].shape)) __pyx_t_4 = 0;
      if (unlikely(__pyx_t_4 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_4);
        {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2524; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_t_8 = __pyx_v_i;
      __pyx_t_4 = -1;
      if (__pyx_t_8 < 0) {
        __pyx_t_4 = 0;
      } else if (unlikely(__pyx_t_8 >= __pyx_pybuffernd_out.diminfo[0].shape)) __pyx_t_4 = 0;
      if (unlikely(__pyx_t_4 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_4);
        {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2524; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_out.diminfo[0].strides) = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_7, __pyx_pybuffernd_values.diminfo[0].strides));
    }
    __pyx_L5:;
  }

  /* "pandas/src/generated.pyx":2508
 * 
 * @cython.wraparound(False)
 * def take_1d_float32_float32(ndarray[float32_t] values,             # <<<<<<<<<<<<<<
 *                               ndarray[int64_t] indexer,
 *                               ndarray[float32_t] out,
 */

  /* function exit code */
  __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_pybuffernd_indexer.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas.algos.take_1d_float32_float32", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer);
  __pyx_L2:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/src/generated.pyx":2527
 * 
 * @cython.wraparound(False)
 * def take_1d_float32_float64(ndarray[float32_t] values,             # <<<<<<<<<<<<<<
 *                               ndarray[int64_t] indexer,
 *                               ndarray[float64_t] out,
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pandas_5algos_255take_1d_float32_float64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_5algos_255take_1d_float32_float64 = {__Pyx_NAMESTR("take_1d_float32_float64"), (PyCFunction)__pyx_pw_6pandas_5algos_255take_1d_float32_float64, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pw_6pandas_5algos_255take_1d_float32_float64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyArrayObject *__pyx_v_values = 0;
  PyArrayObject *__pyx_v_indexer = 0;
  PyArrayObject *__pyx_v_out = 0;
  PyObject *__pyx_v_fill_value = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("take_1d_float32_float64 (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_values,&__pyx_n_s_indexer,&__pyx_n_s_out,&__pyx_n_s_fill_value,0};
    PyObject* values[4] = {0,0,0,0};
    values[3] = __pyx_k__132;
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_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 (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_indexer)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("take_1d_float32_float64", 0, 3, 4, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2527; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_out)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("take_1d_float32_float64", 0, 3, 4, 2); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2527; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  3:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_fill_value);
          if (value) { values[3] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "take_1d_float32_float64") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2527; __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_values = ((PyArrayObject *)values[0]);
    __pyx_v_indexer = ((PyArrayObject *)values[1]);
    __pyx_v_out = ((PyArrayObject *)values[2]);
    __pyx_v_fill_value = values[3];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("take_1d_float32_float64", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2527; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas.algos.take_1d_float32_float64", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2527; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_indexer), __pyx_ptype_5numpy_ndarray, 1, "indexer", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2528; __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[2]; __pyx_lineno = 2529; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_254take_1d_float32_float64(__pyx_self, __pyx_v_values, __pyx_v_indexer, __pyx_v_out, __pyx_v_fill_value);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pandas_5algos_254take_1d_float32_float64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_indexer, PyArrayObject *__pyx_v_out, PyObject *__pyx_v_fill_value) {
  Py_ssize_t __pyx_v_i;
  Py_ssize_t __pyx_v_n;
  Py_ssize_t __pyx_v_idx;
  __pyx_t_5numpy_float64_t __pyx_v_fv;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_indexer;
  __Pyx_Buffer __pyx_pybuffer_indexer;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_out;
  __Pyx_Buffer __pyx_pybuffer_out;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_values;
  __Pyx_Buffer __pyx_pybuffer_values;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  Py_ssize_t __pyx_t_1;
  __pyx_t_5numpy_float64_t __pyx_t_2;
  Py_ssize_t __pyx_t_3;
  int __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;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("take_1d_float32_float64", 0);
  __pyx_pybuffer_values.pybuffer.buf = NULL;
  __pyx_pybuffer_values.refcount = 0;
  __pyx_pybuffernd_values.data = NULL;
  __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values;
  __pyx_pybuffer_indexer.pybuffer.buf = NULL;
  __pyx_pybuffer_indexer.refcount = 0;
  __pyx_pybuffernd_indexer.data = NULL;
  __pyx_pybuffernd_indexer.rcbuffer = &__pyx_pybuffer_indexer;
  __pyx_pybuffer_out.pybuffer.buf = NULL;
  __pyx_pybuffer_out.refcount = 0;
  __pyx_pybuffernd_out.data = NULL;
  __pyx_pybuffernd_out.rcbuffer = &__pyx_pybuffer_out;
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2527; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0];
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer, (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[2]; __pyx_lineno = 2527; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_indexer.diminfo[0].strides = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_indexer.diminfo[0].shape = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.shape[0];
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_out.rcbuffer->pybuffer, (PyObject*)__pyx_v_out, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2527; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_out.diminfo[0].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_out.diminfo[0].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[0];

  /* "pandas/src/generated.pyx":2535
 *         float64_t fv
 * 
 *     n = len(indexer)             # <<<<<<<<<<<<<<
 * 
 *     fv = fill_value
 */
  __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_indexer)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2535; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_n = __pyx_t_1;

  /* "pandas/src/generated.pyx":2537
 *     n = len(indexer)
 * 
 *     fv = fill_value             # <<<<<<<<<<<<<<
 *     for i from 0 <= i < n:
 *         idx = indexer[i]
 */
  __pyx_t_2 = __pyx_PyFloat_AsDouble(__pyx_v_fill_value); if (unlikely((__pyx_t_2 == (npy_float64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2537; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_fv = __pyx_t_2;

  /* "pandas/src/generated.pyx":2538
 * 
 *     fv = fill_value
 *     for i from 0 <= i < n:             # <<<<<<<<<<<<<<
 *         idx = indexer[i]
 *         if idx == -1:
 */
  __pyx_t_1 = __pyx_v_n;
  for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_1; __pyx_v_i++) {

    /* "pandas/src/generated.pyx":2539
 *     fv = fill_value
 *     for i from 0 <= i < n:
 *         idx = indexer[i]             # <<<<<<<<<<<<<<
 *         if idx == -1:
 *             out[i] = fv
 */
    __pyx_t_3 = __pyx_v_i;
    __pyx_t_4 = -1;
    if (__pyx_t_3 < 0) {
      __pyx_t_4 = 0;
    } else if (unlikely(__pyx_t_3 >= __pyx_pybuffernd_indexer.diminfo[0].shape)) __pyx_t_4 = 0;
    if (unlikely(__pyx_t_4 != -1)) {
      __Pyx_RaiseBufferIndexError(__pyx_t_4);
      {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2539; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_v_idx = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_3, __pyx_pybuffernd_indexer.diminfo[0].strides));

    /* "pandas/src/generated.pyx":2540
 *     for i from 0 <= i < n:
 *         idx = indexer[i]
 *         if idx == -1:             # <<<<<<<<<<<<<<
 *             out[i] = fv
 *         else:
 */
    __pyx_t_5 = ((__pyx_v_idx == -1) != 0);
    if (__pyx_t_5) {

      /* "pandas/src/generated.pyx":2541
 *         idx = indexer[i]
 *         if idx == -1:
 *             out[i] = fv             # <<<<<<<<<<<<<<
 *         else:
 *             out[i] = values[idx]
 */
      __pyx_t_6 = __pyx_v_i;
      __pyx_t_4 = -1;
      if (__pyx_t_6 < 0) {
        __pyx_t_4 = 0;
      } else if (unlikely(__pyx_t_6 >= __pyx_pybuffernd_out.diminfo[0].shape)) __pyx_t_4 = 0;
      if (unlikely(__pyx_t_4 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_4);
        {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2541; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_out.diminfo[0].strides) = __pyx_v_fv;
      goto __pyx_L5;
    }
    /*else*/ {

      /* "pandas/src/generated.pyx":2543
 *             out[i] = fv
 *         else:
 *             out[i] = values[idx]             # <<<<<<<<<<<<<<
 * 
 * @cython.wraparound(False)
 */
      __pyx_t_7 = __pyx_v_idx;
      __pyx_t_4 = -1;
      if (__pyx_t_7 < 0) {
        __pyx_t_4 = 0;
      } else if (unlikely(__pyx_t_7 >= __pyx_pybuffernd_values.diminfo[0].shape)) __pyx_t_4 = 0;
      if (unlikely(__pyx_t_4 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_4);
        {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2543; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_t_8 = __pyx_v_i;
      __pyx_t_4 = -1;
      if (__pyx_t_8 < 0) {
        __pyx_t_4 = 0;
      } else if (unlikely(__pyx_t_8 >= __pyx_pybuffernd_out.diminfo[0].shape)) __pyx_t_4 = 0;
      if (unlikely(__pyx_t_4 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_4);
        {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2543; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_out.diminfo[0].strides) = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_7, __pyx_pybuffernd_values.diminfo[0].strides));
    }
    __pyx_L5:;
  }

  /* "pandas/src/generated.pyx":2527
 * 
 * @cython.wraparound(False)
 * def take_1d_float32_float64(ndarray[float32_t] values,             # <<<<<<<<<<<<<<
 *                               ndarray[int64_t] indexer,
 *                               ndarray[float64_t] out,
 */

  /* function exit code */
  __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_pybuffernd_indexer.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas.algos.take_1d_float32_float64", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer);
  __pyx_L2:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/src/generated.pyx":2546
 * 
 * @cython.wraparound(False)
 * def take_1d_float64_float64(ndarray[float64_t] values,             # <<<<<<<<<<<<<<
 *                               ndarray[int64_t] indexer,
 *                               ndarray[float64_t] out,
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pandas_5algos_257take_1d_float64_float64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_5algos_257take_1d_float64_float64 = {__Pyx_NAMESTR("take_1d_float64_float64"), (PyCFunction)__pyx_pw_6pandas_5algos_257take_1d_float64_float64, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pw_6pandas_5algos_257take_1d_float64_float64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyArrayObject *__pyx_v_values = 0;
  PyArrayObject *__pyx_v_indexer = 0;
  PyArrayObject *__pyx_v_out = 0;
  PyObject *__pyx_v_fill_value = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("take_1d_float64_float64 (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_values,&__pyx_n_s_indexer,&__pyx_n_s_out,&__pyx_n_s_fill_value,0};
    PyObject* values[4] = {0,0,0,0};
    values[3] = __pyx_k__133;
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_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 (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_indexer)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("take_1d_float64_float64", 0, 3, 4, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2546; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_out)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("take_1d_float64_float64", 0, 3, 4, 2); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2546; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  3:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_fill_value);
          if (value) { values[3] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "take_1d_float64_float64") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2546; __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_values = ((PyArrayObject *)values[0]);
    __pyx_v_indexer = ((PyArrayObject *)values[1]);
    __pyx_v_out = ((PyArrayObject *)values[2]);
    __pyx_v_fill_value = values[3];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("take_1d_float64_float64", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2546; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas.algos.take_1d_float64_float64", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2546; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_indexer), __pyx_ptype_5numpy_ndarray, 1, "indexer", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2547; __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[2]; __pyx_lineno = 2548; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_256take_1d_float64_float64(__pyx_self, __pyx_v_values, __pyx_v_indexer, __pyx_v_out, __pyx_v_fill_value);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pandas_5algos_256take_1d_float64_float64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_indexer, PyArrayObject *__pyx_v_out, PyObject *__pyx_v_fill_value) {
  Py_ssize_t __pyx_v_i;
  Py_ssize_t __pyx_v_n;
  Py_ssize_t __pyx_v_idx;
  __pyx_t_5numpy_float64_t __pyx_v_fv;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_indexer;
  __Pyx_Buffer __pyx_pybuffer_indexer;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_out;
  __Pyx_Buffer __pyx_pybuffer_out;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_values;
  __Pyx_Buffer __pyx_pybuffer_values;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  Py_ssize_t __pyx_t_1;
  __pyx_t_5numpy_float64_t __pyx_t_2;
  Py_ssize_t __pyx_t_3;
  int __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;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("take_1d_float64_float64", 0);
  __pyx_pybuffer_values.pybuffer.buf = NULL;
  __pyx_pybuffer_values.refcount = 0;
  __pyx_pybuffernd_values.data = NULL;
  __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values;
  __pyx_pybuffer_indexer.pybuffer.buf = NULL;
  __pyx_pybuffer_indexer.refcount = 0;
  __pyx_pybuffernd_indexer.data = NULL;
  __pyx_pybuffernd_indexer.rcbuffer = &__pyx_pybuffer_indexer;
  __pyx_pybuffer_out.pybuffer.buf = NULL;
  __pyx_pybuffer_out.refcount = 0;
  __pyx_pybuffernd_out.data = NULL;
  __pyx_pybuffernd_out.rcbuffer = &__pyx_pybuffer_out;
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (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[2]; __pyx_lineno = 2546; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0];
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer, (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[2]; __pyx_lineno = 2546; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_indexer.diminfo[0].strides = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_indexer.diminfo[0].shape = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.shape[0];
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_out.rcbuffer->pybuffer, (PyObject*)__pyx_v_out, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2546; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_out.diminfo[0].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_out.diminfo[0].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[0];

  /* "pandas/src/generated.pyx":2554
 *         float64_t fv
 * 
 *     n = len(indexer)             # <<<<<<<<<<<<<<
 * 
 *     fv = fill_value
 */
  __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_indexer)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2554; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_n = __pyx_t_1;

  /* "pandas/src/generated.pyx":2556
 *     n = len(indexer)
 * 
 *     fv = fill_value             # <<<<<<<<<<<<<<
 *     for i from 0 <= i < n:
 *         idx = indexer[i]
 */
  __pyx_t_2 = __pyx_PyFloat_AsDouble(__pyx_v_fill_value); if (unlikely((__pyx_t_2 == (npy_float64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2556; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_fv = __pyx_t_2;

  /* "pandas/src/generated.pyx":2557
 * 
 *     fv = fill_value
 *     for i from 0 <= i < n:             # <<<<<<<<<<<<<<
 *         idx = indexer[i]
 *         if idx == -1:
 */
  __pyx_t_1 = __pyx_v_n;
  for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_1; __pyx_v_i++) {

    /* "pandas/src/generated.pyx":2558
 *     fv = fill_value
 *     for i from 0 <= i < n:
 *         idx = indexer[i]             # <<<<<<<<<<<<<<
 *         if idx == -1:
 *             out[i] = fv
 */
    __pyx_t_3 = __pyx_v_i;
    __pyx_t_4 = -1;
    if (__pyx_t_3 < 0) {
      __pyx_t_4 = 0;
    } else if (unlikely(__pyx_t_3 >= __pyx_pybuffernd_indexer.diminfo[0].shape)) __pyx_t_4 = 0;
    if (unlikely(__pyx_t_4 != -1)) {
      __Pyx_RaiseBufferIndexError(__pyx_t_4);
      {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2558; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_v_idx = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_3, __pyx_pybuffernd_indexer.diminfo[0].strides));

    /* "pandas/src/generated.pyx":2559
 *     for i from 0 <= i < n:
 *         idx = indexer[i]
 *         if idx == -1:             # <<<<<<<<<<<<<<
 *             out[i] = fv
 *         else:
 */
    __pyx_t_5 = ((__pyx_v_idx == -1) != 0);
    if (__pyx_t_5) {

      /* "pandas/src/generated.pyx":2560
 *         idx = indexer[i]
 *         if idx == -1:
 *             out[i] = fv             # <<<<<<<<<<<<<<
 *         else:
 *             out[i] = values[idx]
 */
      __pyx_t_6 = __pyx_v_i;
      __pyx_t_4 = -1;
      if (__pyx_t_6 < 0) {
        __pyx_t_4 = 0;
      } else if (unlikely(__pyx_t_6 >= __pyx_pybuffernd_out.diminfo[0].shape)) __pyx_t_4 = 0;
      if (unlikely(__pyx_t_4 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_4);
        {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2560; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_out.diminfo[0].strides) = __pyx_v_fv;
      goto __pyx_L5;
    }
    /*else*/ {

      /* "pandas/src/generated.pyx":2562
 *             out[i] = fv
 *         else:
 *             out[i] = values[idx]             # <<<<<<<<<<<<<<
 * 
 * @cython.wraparound(False)
 */
      __pyx_t_7 = __pyx_v_idx;
      __pyx_t_4 = -1;
      if (__pyx_t_7 < 0) {
        __pyx_t_4 = 0;
      } else if (unlikely(__pyx_t_7 >= __pyx_pybuffernd_values.diminfo[0].shape)) __pyx_t_4 = 0;
      if (unlikely(__pyx_t_4 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_4);
        {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2562; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_t_8 = __pyx_v_i;
      __pyx_t_4 = -1;
      if (__pyx_t_8 < 0) {
        __pyx_t_4 = 0;
      } else if (unlikely(__pyx_t_8 >= __pyx_pybuffernd_out.diminfo[0].shape)) __pyx_t_4 = 0;
      if (unlikely(__pyx_t_4 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_4);
        {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2562; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_out.diminfo[0].strides) = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_7, __pyx_pybuffernd_values.diminfo[0].strides));
    }
    __pyx_L5:;
  }

  /* "pandas/src/generated.pyx":2546
 * 
 * @cython.wraparound(False)
 * def take_1d_float64_float64(ndarray[float64_t] values,             # <<<<<<<<<<<<<<
 *                               ndarray[int64_t] indexer,
 *                               ndarray[float64_t] out,
 */

  /* function exit code */
  __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_pybuffernd_indexer.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas.algos.take_1d_float64_float64", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer);
  __pyx_L2:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/src/generated.pyx":2565
 * 
 * @cython.wraparound(False)
 * def take_1d_object_object(ndarray[object] values,             # <<<<<<<<<<<<<<
 *                               ndarray[int64_t] indexer,
 *                               ndarray[object] out,
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pandas_5algos_259take_1d_object_object(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_5algos_259take_1d_object_object = {__Pyx_NAMESTR("take_1d_object_object"), (PyCFunction)__pyx_pw_6pandas_5algos_259take_1d_object_object, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pw_6pandas_5algos_259take_1d_object_object(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyArrayObject *__pyx_v_values = 0;
  PyArrayObject *__pyx_v_indexer = 0;
  PyArrayObject *__pyx_v_out = 0;
  PyObject *__pyx_v_fill_value = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("take_1d_object_object (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_values,&__pyx_n_s_indexer,&__pyx_n_s_out,&__pyx_n_s_fill_value,0};
    PyObject* values[4] = {0,0,0,0};
    values[3] = __pyx_k__134;
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_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 (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_indexer)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("take_1d_object_object", 0, 3, 4, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2565; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_out)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("take_1d_object_object", 0, 3, 4, 2); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2565; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  3:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_fill_value);
          if (value) { values[3] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "take_1d_object_object") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2565; __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_values = ((PyArrayObject *)values[0]);
    __pyx_v_indexer = ((PyArrayObject *)values[1]);
    __pyx_v_out = ((PyArrayObject *)values[2]);
    __pyx_v_fill_value = values[3];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("take_1d_object_object", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2565; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas.algos.take_1d_object_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2565; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_indexer), __pyx_ptype_5numpy_ndarray, 1, "indexer", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2566; __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[2]; __pyx_lineno = 2567; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_258take_1d_object_object(__pyx_self, __pyx_v_values, __pyx_v_indexer, __pyx_v_out, __pyx_v_fill_value);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pandas_5algos_258take_1d_object_object(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_indexer, PyArrayObject *__pyx_v_out, PyObject *__pyx_v_fill_value) {
  Py_ssize_t __pyx_v_i;
  Py_ssize_t __pyx_v_n;
  Py_ssize_t __pyx_v_idx;
  PyObject *__pyx_v_fv = 0;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_indexer;
  __Pyx_Buffer __pyx_pybuffer_indexer;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_out;
  __Pyx_Buffer __pyx_pybuffer_out;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_values;
  __Pyx_Buffer __pyx_pybuffer_values;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  Py_ssize_t __pyx_t_1;
  Py_ssize_t __pyx_t_2;
  int __pyx_t_3;
  int __pyx_t_4;
  Py_ssize_t __pyx_t_5;
  PyObject **__pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  Py_ssize_t __pyx_t_8;
  Py_ssize_t __pyx_t_9;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("take_1d_object_object", 0);
  __pyx_pybuffer_values.pybuffer.buf = NULL;
  __pyx_pybuffer_values.refcount = 0;
  __pyx_pybuffernd_values.data = NULL;
  __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values;
  __pyx_pybuffer_indexer.pybuffer.buf = NULL;
  __pyx_pybuffer_indexer.refcount = 0;
  __pyx_pybuffernd_indexer.data = NULL;
  __pyx_pybuffernd_indexer.rcbuffer = &__pyx_pybuffer_indexer;
  __pyx_pybuffer_out.pybuffer.buf = NULL;
  __pyx_pybuffer_out.refcount = 0;
  __pyx_pybuffernd_out.data = NULL;
  __pyx_pybuffernd_out.rcbuffer = &__pyx_pybuffer_out;
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2565; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0];
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer, (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[2]; __pyx_lineno = 2565; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_indexer.diminfo[0].strides = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_indexer.diminfo[0].shape = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.shape[0];
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_out.rcbuffer->pybuffer, (PyObject*)__pyx_v_out, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2565; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_out.diminfo[0].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_out.diminfo[0].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[0];

  /* "pandas/src/generated.pyx":2573
 *         object fv
 * 
 *     n = len(indexer)             # <<<<<<<<<<<<<<
 * 
 *     fv = fill_value
 */
  __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_indexer)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2573; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_n = __pyx_t_1;

  /* "pandas/src/generated.pyx":2575
 *     n = len(indexer)
 * 
 *     fv = fill_value             # <<<<<<<<<<<<<<
 *     for i from 0 <= i < n:
 *         idx = indexer[i]
 */
  __Pyx_INCREF(__pyx_v_fill_value);
  __pyx_v_fv = __pyx_v_fill_value;

  /* "pandas/src/generated.pyx":2576
 * 
 *     fv = fill_value
 *     for i from 0 <= i < n:             # <<<<<<<<<<<<<<
 *         idx = indexer[i]
 *         if idx == -1:
 */
  __pyx_t_1 = __pyx_v_n;
  for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_1; __pyx_v_i++) {

    /* "pandas/src/generated.pyx":2577
 *     fv = fill_value
 *     for i from 0 <= i < n:
 *         idx = indexer[i]             # <<<<<<<<<<<<<<
 *         if idx == -1:
 *             out[i] = fv
 */
    __pyx_t_2 = __pyx_v_i;
    __pyx_t_3 = -1;
    if (__pyx_t_2 < 0) {
      __pyx_t_3 = 0;
    } else if (unlikely(__pyx_t_2 >= __pyx_pybuffernd_indexer.diminfo[0].shape)) __pyx_t_3 = 0;
    if (unlikely(__pyx_t_3 != -1)) {
      __Pyx_RaiseBufferIndexError(__pyx_t_3);
      {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2577; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_v_idx = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_2, __pyx_pybuffernd_indexer.diminfo[0].strides));

    /* "pandas/src/generated.pyx":2578
 *     for i from 0 <= i < n:
 *         idx = indexer[i]
 *         if idx == -1:             # <<<<<<<<<<<<<<
 *             out[i] = fv
 *         else:
 */
    __pyx_t_4 = ((__pyx_v_idx == -1) != 0);
    if (__pyx_t_4) {

      /* "pandas/src/generated.pyx":2579
 *         idx = indexer[i]
 *         if idx == -1:
 *             out[i] = fv             # <<<<<<<<<<<<<<
 *         else:
 *             out[i] = values[idx]
 */
      __pyx_t_5 = __pyx_v_i;
      __pyx_t_3 = -1;
      if (__pyx_t_5 < 0) {
        __pyx_t_3 = 0;
      } else if (unlikely(__pyx_t_5 >= __pyx_pybuffernd_out.diminfo[0].shape)) __pyx_t_3 = 0;
      if (unlikely(__pyx_t_3 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_3);
        {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2579; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_t_6 = __Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_5, __pyx_pybuffernd_out.diminfo[0].strides);
      __Pyx_GOTREF(*__pyx_t_6);
      __Pyx_INCREF(__pyx_v_fv); __Pyx_DECREF(*__pyx_t_6);
      *__pyx_t_6 = __pyx_v_fv;
      __Pyx_GIVEREF(*__pyx_t_6);
      goto __pyx_L5;
    }
    /*else*/ {

      /* "pandas/src/generated.pyx":2581
 *             out[i] = fv
 *         else:
 *             out[i] = values[idx]             # <<<<<<<<<<<<<<
 * 
 * 
 */
      __pyx_t_8 = __pyx_v_idx;
      __pyx_t_3 = -1;
      if (__pyx_t_8 < 0) {
        __pyx_t_3 = 0;
      } else if (unlikely(__pyx_t_8 >= __pyx_pybuffernd_values.diminfo[0].shape)) __pyx_t_3 = 0;
      if (unlikely(__pyx_t_3 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_3);
        {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2581; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_t_7 = (PyObject *) *__Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_values.diminfo[0].strides);
      __Pyx_INCREF((PyObject*)__pyx_t_7);
      __pyx_t_9 = __pyx_v_i;
      __pyx_t_3 = -1;
      if (__pyx_t_9 < 0) {
        __pyx_t_3 = 0;
      } else if (unlikely(__pyx_t_9 >= __pyx_pybuffernd_out.diminfo[0].shape)) __pyx_t_3 = 0;
      if (unlikely(__pyx_t_3 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_3);
        {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2581; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_t_6 = __Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_9, __pyx_pybuffernd_out.diminfo[0].strides);
      __Pyx_GOTREF(*__pyx_t_6);
      __Pyx_INCREF(__pyx_t_7); __Pyx_DECREF(*__pyx_t_6);
      *__pyx_t_6 = __pyx_t_7;
      __Pyx_GIVEREF(*__pyx_t_6);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    }
    __pyx_L5:;
  }

  /* "pandas/src/generated.pyx":2565
 * 
 * @cython.wraparound(False)
 * def take_1d_object_object(ndarray[object] values,             # <<<<<<<<<<<<<<
 *                               ndarray[int64_t] indexer,
 *                               ndarray[object] out,
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_7);
  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
    __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas.algos.take_1d_object_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer);
  __pyx_L2:;
  __Pyx_XDECREF(__pyx_v_fv);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/src/generated.pyx":2586
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def take_2d_axis0_bool_bool(uint8_t[:, :] values,             # <<<<<<<<<<<<<<
 *                                     ndarray[int64_t] indexer,
 *                                     uint8_t[:, :] out,
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pandas_5algos_261take_2d_axis0_bool_bool(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_5algos_261take_2d_axis0_bool_bool = {__Pyx_NAMESTR("take_2d_axis0_bool_bool"), (PyCFunction)__pyx_pw_6pandas_5algos_261take_2d_axis0_bool_bool, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pw_6pandas_5algos_261take_2d_axis0_bool_bool(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  __Pyx_memviewslice __pyx_v_values = { 0, 0, { 0 }, { 0 }, { 0 } };
  PyArrayObject *__pyx_v_indexer = 0;
  __Pyx_memviewslice __pyx_v_out = { 0, 0, { 0 }, { 0 }, { 0 } };
  PyObject *__pyx_v_fill_value = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("take_2d_axis0_bool_bool (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_values,&__pyx_n_s_indexer,&__pyx_n_s_out,&__pyx_n_s_fill_value,0};
    PyObject* values[4] = {0,0,0,0};
    values[3] = __pyx_k__135;
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_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 (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_indexer)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("take_2d_axis0_bool_bool", 0, 3, 4, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2586; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_out)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("take_2d_axis0_bool_bool", 0, 3, 4, 2); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2586; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  3:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_fill_value);
          if (value) { values[3] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "take_2d_axis0_bool_bool") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2586; __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_values = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_uint8_t(values[0]); if (unlikely(!__pyx_v_values.memview)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2586; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_v_indexer = ((PyArrayObject *)values[1]);
    __pyx_v_out = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_uint8_t(values[2]); if (unlikely(!__pyx_v_out.memview)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2588; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_v_fill_value = values[3];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("take_2d_axis0_bool_bool", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2586; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas.algos.take_2d_axis0_bool_bool", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_indexer), __pyx_ptype_5numpy_ndarray, 1, "indexer", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2587; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_260take_2d_axis0_bool_bool(__pyx_self, __pyx_v_values, __pyx_v_indexer, __pyx_v_out, __pyx_v_fill_value);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pandas_5algos_260take_2d_axis0_bool_bool(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_values, PyArrayObject *__pyx_v_indexer, __Pyx_memviewslice __pyx_v_out, PyObject *__pyx_v_fill_value) {
  Py_ssize_t __pyx_v_i;
  Py_ssize_t __pyx_v_j;
  Py_ssize_t __pyx_v_k;
  Py_ssize_t __pyx_v_n;
  Py_ssize_t __pyx_v_idx;
  __pyx_t_5numpy_uint8_t __pyx_v_fv;
  __pyx_t_5numpy_uint8_t *__pyx_v_v;
  __pyx_t_5numpy_uint8_t *__pyx_v_o;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_indexer;
  __Pyx_Buffer __pyx_pybuffer_indexer;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  Py_ssize_t __pyx_t_1;
  __pyx_t_5numpy_uint8_t __pyx_t_2;
  int __pyx_t_3;
  int __pyx_t_4;
  int __pyx_t_5;
  int __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;
  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;
  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_axis0_bool_bool", 0);
  __pyx_pybuffer_indexer.pybuffer.buf = NULL;
  __pyx_pybuffer_indexer.refcount = 0;
  __pyx_pybuffernd_indexer.data = NULL;
  __pyx_pybuffernd_indexer.rcbuffer = &__pyx_pybuffer_indexer;
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer, (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[2]; __pyx_lineno = 2586; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_indexer.diminfo[0].strides = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_indexer.diminfo[0].shape = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.shape[0];

  /* "pandas/src/generated.pyx":2594
 *         uint8_t fv
 * 
 *     n = len(indexer)             # <<<<<<<<<<<<<<
 *     k = values.shape[1]
 * 
 */
  __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_indexer)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2594; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_n = __pyx_t_1;

  /* "pandas/src/generated.pyx":2595
 * 
 *     n = len(indexer)
 *     k = values.shape[1]             # <<<<<<<<<<<<<<
 * 
 *     fv = fill_value
 */
  __pyx_v_k = (__pyx_v_values.shape[1]);

  /* "pandas/src/generated.pyx":2597
 *     k = values.shape[1]
 * 
 *     fv = fill_value             # <<<<<<<<<<<<<<
 * 
 *     IF True:
 */
  __pyx_t_2 = __Pyx_PyInt_As_npy_uint8(__pyx_v_fill_value); if (unlikely((__pyx_t_2 == (npy_uint8)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2597; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_fv = __pyx_t_2;

  /* "pandas/src/generated.pyx":2605
 * 
 *         #GH3130
 *         if (values.strides[1] == out.strides[1] and             # <<<<<<<<<<<<<<
 *             values.strides[1] == sizeof(uint8_t) and
 *             sizeof(uint8_t) * n >= 256):
 */
  __pyx_t_3 = (((__pyx_v_values.strides[1]) == (__pyx_v_out.strides[1])) != 0);
  if (__pyx_t_3) {

    /* "pandas/src/generated.pyx":2606
 *         #GH3130
 *         if (values.strides[1] == out.strides[1] and
 *             values.strides[1] == sizeof(uint8_t) and             # <<<<<<<<<<<<<<
 *             sizeof(uint8_t) * n >= 256):
 * 
 */
    __pyx_t_4 = (((__pyx_v_values.strides[1]) == (sizeof(__pyx_t_5numpy_uint8_t))) != 0);
    if (__pyx_t_4) {

      /* "pandas/src/generated.pyx":2607
 *         if (values.strides[1] == out.strides[1] and
 *             values.strides[1] == sizeof(uint8_t) and
 *             sizeof(uint8_t) * n >= 256):             # <<<<<<<<<<<<<<
 * 
 *             for i from 0 <= i < n:
 */
      __pyx_t_5 = ((((sizeof(__pyx_t_5numpy_uint8_t)) * __pyx_v_n) >= 256) != 0);
      __pyx_t_6 = __pyx_t_5;
    } else {
      __pyx_t_6 = __pyx_t_4;
    }
    __pyx_t_4 = __pyx_t_6;
  } else {
    __pyx_t_4 = __pyx_t_3;
  }
  if (__pyx_t_4) {

    /* "pandas/src/generated.pyx":2609
 *             sizeof(uint8_t) * n >= 256):
 * 
 *             for i from 0 <= i < n:             # <<<<<<<<<<<<<<
 *                 idx = indexer[i]
 *                 if idx == -1:
 */
    __pyx_t_1 = __pyx_v_n;
    for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_1; __pyx_v_i++) {

      /* "pandas/src/generated.pyx":2610
 * 
 *             for i from 0 <= i < n:
 *                 idx = indexer[i]             # <<<<<<<<<<<<<<
 *                 if idx == -1:
 *                     for j from 0 <= j < k:
 */
      __pyx_t_7 = __pyx_v_i;
      __pyx_v_idx = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_7, __pyx_pybuffernd_indexer.diminfo[0].strides));

      /* "pandas/src/generated.pyx":2611
 *             for i from 0 <= i < n:
 *                 idx = indexer[i]
 *                 if idx == -1:             # <<<<<<<<<<<<<<
 *                     for j from 0 <= j < k:
 *                         out[i, j] = fv
 */
      __pyx_t_4 = ((__pyx_v_idx == -1) != 0);
      if (__pyx_t_4) {

        /* "pandas/src/generated.pyx":2612
 *                 idx = indexer[i]
 *                 if idx == -1:
 *                     for j from 0 <= j < k:             # <<<<<<<<<<<<<<
 *                         out[i, j] = fv
 *                 else:
 */
        __pyx_t_8 = __pyx_v_k;
        for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_8; __pyx_v_j++) {

          /* "pandas/src/generated.pyx":2613
 *                 if idx == -1:
 *                     for j from 0 <= j < k:
 *                         out[i, j] = fv             # <<<<<<<<<<<<<<
 *                 else:
 *                     v = &values[idx, 0]
 */
          __pyx_t_9 = __pyx_v_i;
          __pyx_t_10 = __pyx_v_j;
          *((__pyx_t_5numpy_uint8_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_out.data + __pyx_t_9 * __pyx_v_out.strides[0]) ) + __pyx_t_10 * __pyx_v_out.strides[1]) )) = __pyx_v_fv;
        }
        goto __pyx_L6;
      }
      /*else*/ {

        /* "pandas/src/generated.pyx":2615
 *                         out[i, j] = fv
 *                 else:
 *                     v = &values[idx, 0]             # <<<<<<<<<<<<<<
 *                     o = &out[i, 0]
 *                     memmove(o, v, <size_t>(sizeof(uint8_t) * k))
 */
        __pyx_t_8 = __pyx_v_idx;
        __pyx_t_11 = 0;
        __pyx_v_v = (&(*((__pyx_t_5numpy_uint8_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_values.data + __pyx_t_8 * __pyx_v_values.strides[0]) ) + __pyx_t_11 * __pyx_v_values.strides[1]) ))));

        /* "pandas/src/generated.pyx":2616
 *                 else:
 *                     v = &values[idx, 0]
 *                     o = &out[i, 0]             # <<<<<<<<<<<<<<
 *                     memmove(o, v, <size_t>(sizeof(uint8_t) * k))
 *             return
 */
        __pyx_t_12 = __pyx_v_i;
        __pyx_t_13 = 0;
        __pyx_v_o = (&(*((__pyx_t_5numpy_uint8_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_out.data + __pyx_t_12 * __pyx_v_out.strides[0]) ) + __pyx_t_13 * __pyx_v_out.strides[1]) ))));

        /* "pandas/src/generated.pyx":2617
 *                     v = &values[idx, 0]
 *                     o = &out[i, 0]
 *                     memmove(o, v, <size_t>(sizeof(uint8_t) * k))             # <<<<<<<<<<<<<<
 *             return
 * 
 */
        memmove(__pyx_v_o, __pyx_v_v, ((size_t)((sizeof(__pyx_t_5numpy_uint8_t)) * __pyx_v_k)));
      }
      __pyx_L6:;
    }

    /* "pandas/src/generated.pyx":2618
 *                     o = &out[i, 0]
 *                     memmove(o, v, <size_t>(sizeof(uint8_t) * k))
 *             return             # <<<<<<<<<<<<<<
 * 
 *     for i from 0 <= i < n:
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_r = Py_None; __Pyx_INCREF(Py_None);
    goto __pyx_L0;
  }

  /* "pandas/src/generated.pyx":2620
 *             return
 * 
 *     for i from 0 <= i < n:             # <<<<<<<<<<<<<<
 *         idx = indexer[i]
 *         if idx == -1:
 */
  __pyx_t_1 = __pyx_v_n;
  for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_1; __pyx_v_i++) {

    /* "pandas/src/generated.pyx":2621
 * 
 *     for i from 0 <= i < n:
 *         idx = indexer[i]             # <<<<<<<<<<<<<<
 *         if idx == -1:
 *             for j from 0 <= j < k:
 */
    __pyx_t_14 = __pyx_v_i;
    __pyx_v_idx = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_indexer.diminfo[0].strides));

    /* "pandas/src/generated.pyx":2622
 *     for i from 0 <= i < n:
 *         idx = indexer[i]
 *         if idx == -1:             # <<<<<<<<<<<<<<
 *             for j from 0 <= j < k:
 *                 out[i, j] = fv
 */
    __pyx_t_4 = ((__pyx_v_idx == -1) != 0);
    if (__pyx_t_4) {

      /* "pandas/src/generated.pyx":2623
 *         idx = indexer[i]
 *         if idx == -1:
 *             for j from 0 <= j < k:             # <<<<<<<<<<<<<<
 *                 out[i, j] = fv
 *         else:
 */
      __pyx_t_15 = __pyx_v_k;
      for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_15; __pyx_v_j++) {

        /* "pandas/src/generated.pyx":2624
 *         if idx == -1:
 *             for j from 0 <= j < k:
 *                 out[i, j] = fv             # <<<<<<<<<<<<<<
 *         else:
 *             for j from 0 <= j < k:
 */
        __pyx_t_16 = __pyx_v_i;
        __pyx_t_17 = __pyx_v_j;
        *((__pyx_t_5numpy_uint8_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_out.data + __pyx_t_16 * __pyx_v_out.strides[0]) ) + __pyx_t_17 * __pyx_v_out.strides[1]) )) = __pyx_v_fv;
      }
      goto __pyx_L11;
    }
    /*else*/ {

      /* "pandas/src/generated.pyx":2626
 *                 out[i, j] = fv
 *         else:
 *             for j from 0 <= j < k:             # <<<<<<<<<<<<<<
 *                 out[i, j] = values[idx, j]
 * 
 */
      __pyx_t_15 = __pyx_v_k;
      for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_15; __pyx_v_j++) {

        /* "pandas/src/generated.pyx":2627
 *         else:
 *             for j from 0 <= j < k:
 *                 out[i, j] = values[idx, j]             # <<<<<<<<<<<<<<
 * 
 * @cython.wraparound(False)
 */
        __pyx_t_18 = __pyx_v_idx;
        __pyx_t_19 = __pyx_v_j;
        __pyx_t_20 = __pyx_v_i;
        __pyx_t_21 = __pyx_v_j;
        *((__pyx_t_5numpy_uint8_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_out.data + __pyx_t_20 * __pyx_v_out.strides[0]) ) + __pyx_t_21 * __pyx_v_out.strides[1]) )) = (*((__pyx_t_5numpy_uint8_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_values.data + __pyx_t_18 * __pyx_v_values.strides[0]) ) + __pyx_t_19 * __pyx_v_values.strides[1]) )));
      }
    }
    __pyx_L11:;
  }

  /* "pandas/src/generated.pyx":2586
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def take_2d_axis0_bool_bool(uint8_t[:, :] values,             # <<<<<<<<<<<<<<
 *                                     ndarray[int64_t] indexer,
 *                                     uint8_t[:, :] out,
 */

  /* function exit code */
  __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_pybuffernd_indexer.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas.algos.take_2d_axis0_bool_bool", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer);
  __pyx_L2:;
  __PYX_XDEC_MEMVIEW(&__pyx_v_values, 1);
  __PYX_XDEC_MEMVIEW(&__pyx_v_out, 1);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/src/generated.pyx":2631
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def take_2d_axis0_bool_object(uint8_t[:, :] values,             # <<<<<<<<<<<<<<
 *                                     ndarray[int64_t] indexer,
 *                                     object[:, :] out,
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pandas_5algos_263take_2d_axis0_bool_object(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_5algos_263take_2d_axis0_bool_object = {__Pyx_NAMESTR("take_2d_axis0_bool_object"), (PyCFunction)__pyx_pw_6pandas_5algos_263take_2d_axis0_bool_object, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pw_6pandas_5algos_263take_2d_axis0_bool_object(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  __Pyx_memviewslice __pyx_v_values = { 0, 0, { 0 }, { 0 }, { 0 } };
  PyArrayObject *__pyx_v_indexer = 0;
  __Pyx_memviewslice __pyx_v_out = { 0, 0, { 0 }, { 0 }, { 0 } };
  PyObject *__pyx_v_fill_value = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("take_2d_axis0_bool_object (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_values,&__pyx_n_s_indexer,&__pyx_n_s_out,&__pyx_n_s_fill_value,0};
    PyObject* values[4] = {0,0,0,0};
    values[3] = __pyx_k__136;
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_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 (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_indexer)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("take_2d_axis0_bool_object", 0, 3, 4, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2631; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_out)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("take_2d_axis0_bool_object", 0, 3, 4, 2); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2631; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  3:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_fill_value);
          if (value) { values[3] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "take_2d_axis0_bool_object") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2631; __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_values = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_uint8_t(values[0]); if (unlikely(!__pyx_v_values.memview)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2631; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_v_indexer = ((PyArrayObject *)values[1]);
    __pyx_v_out = __Pyx_PyObject_to_MemoryviewSlice_dsds_object(values[2]); if (unlikely(!__pyx_v_out.memview)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2633; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_v_fill_value = values[3];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("take_2d_axis0_bool_object", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2631; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas.algos.take_2d_axis0_bool_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_indexer), __pyx_ptype_5numpy_ndarray, 1, "indexer", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2632; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_262take_2d_axis0_bool_object(__pyx_self, __pyx_v_values, __pyx_v_indexer, __pyx_v_out, __pyx_v_fill_value);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pandas_5algos_262take_2d_axis0_bool_object(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_values, PyArrayObject *__pyx_v_indexer, __Pyx_memviewslice __pyx_v_out, PyObject *__pyx_v_fill_value) {
  Py_ssize_t __pyx_v_i;
  Py_ssize_t __pyx_v_j;
  Py_ssize_t __pyx_v_k;
  Py_ssize_t __pyx_v_n;
  Py_ssize_t __pyx_v_idx;
  PyObject *__pyx_v_fv = 0;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_indexer;
  __Pyx_Buffer __pyx_pybuffer_indexer;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  Py_ssize_t __pyx_t_1;
  Py_ssize_t __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;
  PyObject **__pyx_t_7;
  PyObject *__pyx_t_8 = NULL;
  Py_ssize_t __pyx_t_9;
  Py_ssize_t __pyx_t_10;
  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("take_2d_axis0_bool_object", 0);
  __pyx_pybuffer_indexer.pybuffer.buf = NULL;
  __pyx_pybuffer_indexer.refcount = 0;
  __pyx_pybuffernd_indexer.data = NULL;
  __pyx_pybuffernd_indexer.rcbuffer = &__pyx_pybuffer_indexer;
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer, (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[2]; __pyx_lineno = 2631; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_indexer.diminfo[0].strides = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_indexer.diminfo[0].shape = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.shape[0];

  /* "pandas/src/generated.pyx":2639
 *         object fv
 * 
 *     n = len(indexer)             # <<<<<<<<<<<<<<
 *     k = values.shape[1]
 * 
 */
  __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_indexer)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2639; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_n = __pyx_t_1;

  /* "pandas/src/generated.pyx":2640
 * 
 *     n = len(indexer)
 *     k = values.shape[1]             # <<<<<<<<<<<<<<
 * 
 *     fv = fill_value
 */
  __pyx_v_k = (__pyx_v_values.shape[1]);

  /* "pandas/src/generated.pyx":2642
 *     k = values.shape[1]
 * 
 *     fv = fill_value             # <<<<<<<<<<<<<<
 * 
 *     IF False:
 */
  __Pyx_INCREF(__pyx_v_fill_value);
  __pyx_v_fv = __pyx_v_fill_value;

  /* "pandas/src/generated.pyx":2665
 *             return
 * 
 *     for i from 0 <= i < n:             # <<<<<<<<<<<<<<
 *         idx = indexer[i]
 *         if idx == -1:
 */
  __pyx_t_1 = __pyx_v_n;
  for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_1; __pyx_v_i++) {

    /* "pandas/src/generated.pyx":2666
 * 
 *     for i from 0 <= i < n:
 *         idx = indexer[i]             # <<<<<<<<<<<<<<
 *         if idx == -1:
 *             for j from 0 <= j < k:
 */
    __pyx_t_2 = __pyx_v_i;
    __pyx_v_idx = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_2, __pyx_pybuffernd_indexer.diminfo[0].strides));

    /* "pandas/src/generated.pyx":2667
 *     for i from 0 <= i < n:
 *         idx = indexer[i]
 *         if idx == -1:             # <<<<<<<<<<<<<<
 *             for j from 0 <= j < k:
 *                 out[i, j] = fv
 */
    __pyx_t_3 = ((__pyx_v_idx == -1) != 0);
    if (__pyx_t_3) {

      /* "pandas/src/generated.pyx":2668
 *         idx = indexer[i]
 *         if idx == -1:
 *             for j from 0 <= j < k:             # <<<<<<<<<<<<<<
 *                 out[i, j] = fv
 *         else:
 */
      __pyx_t_4 = __pyx_v_k;
      for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_4; __pyx_v_j++) {

        /* "pandas/src/generated.pyx":2669
 *         if idx == -1:
 *             for j from 0 <= j < k:
 *                 out[i, j] = fv             # <<<<<<<<<<<<<<
 *         else:
 *             for j from 0 <= j < k:
 */
        __pyx_t_5 = __pyx_v_i;
        __pyx_t_6 = __pyx_v_j;
        __pyx_t_7 = ((PyObject * *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_out.data + __pyx_t_5 * __pyx_v_out.strides[0]) ) + __pyx_t_6 * __pyx_v_out.strides[1]) ));
        __Pyx_GOTREF(*__pyx_t_7);
        __Pyx_INCREF(__pyx_v_fv); __Pyx_DECREF(*__pyx_t_7);
        *__pyx_t_7 = __pyx_v_fv;
        __Pyx_GIVEREF(*__pyx_t_7);
      }
      goto __pyx_L5;
    }
    /*else*/ {

      /* "pandas/src/generated.pyx":2671
 *                 out[i, j] = fv
 *         else:
 *             for j from 0 <= j < k:             # <<<<<<<<<<<<<<
 *                 out[i, j] = True if values[idx, j] > 0 else False
 * 
 */
      __pyx_t_4 = __pyx_v_k;
      for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_4; __pyx_v_j++) {

        /* "pandas/src/generated.pyx":2672
 *         else:
 *             for j from 0 <= j < k:
 *                 out[i, j] = True if values[idx, j] > 0 else False             # <<<<<<<<<<<<<<
 * 
 * @cython.wraparound(False)
 */
        __pyx_t_9 = __pyx_v_idx;
        __pyx_t_10 = __pyx_v_j;
        if ((((*((__pyx_t_5numpy_uint8_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_values.data + __pyx_t_9 * __pyx_v_values.strides[0]) ) + __pyx_t_10 * __pyx_v_values.strides[1]) ))) > 0) != 0)) {
          __Pyx_INCREF(Py_True);
          __pyx_t_8 = Py_True;
        } else {
          __Pyx_INCREF(Py_False);
          __pyx_t_8 = Py_False;
        }
        __pyx_t_11 = __pyx_v_i;
        __pyx_t_12 = __pyx_v_j;
        __pyx_t_7 = ((PyObject * *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_out.data + __pyx_t_11 * __pyx_v_out.strides[0]) ) + __pyx_t_12 * __pyx_v_out.strides[1]) ));
        __Pyx_GOTREF(*__pyx_t_7);
        __Pyx_INCREF(__pyx_t_8); __Pyx_DECREF(*__pyx_t_7);
        *__pyx_t_7 = __pyx_t_8;
        __Pyx_GIVEREF(*__pyx_t_7);
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      }
    }
    __pyx_L5:;
  }

  /* "pandas/src/generated.pyx":2631
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def take_2d_axis0_bool_object(uint8_t[:, :] values,             # <<<<<<<<<<<<<<
 *                                     ndarray[int64_t] indexer,
 *                                     object[:, :] out,
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_8);
  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
    __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas.algos.take_2d_axis0_bool_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer);
  __pyx_L2:;
  __Pyx_XDECREF(__pyx_v_fv);
  __PYX_XDEC_MEMVIEW(&__pyx_v_values, 1);
  __PYX_XDEC_MEMVIEW(&__pyx_v_out, 1);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/src/generated.pyx":2676
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def take_2d_axis0_int8_int8(int8_t[:, :] values,             # <<<<<<<<<<<<<<
 *                                     ndarray[int64_t] indexer,
 *                                     int8_t[:, :] out,
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pandas_5algos_265take_2d_axis0_int8_int8(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_5algos_265take_2d_axis0_int8_int8 = {__Pyx_NAMESTR("take_2d_axis0_int8_int8"), (PyCFunction)__pyx_pw_6pandas_5algos_265take_2d_axis0_int8_int8, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pw_6pandas_5algos_265take_2d_axis0_int8_int8(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  __Pyx_memviewslice __pyx_v_values = { 0, 0, { 0 }, { 0 }, { 0 } };
  PyArrayObject *__pyx_v_indexer = 0;
  __Pyx_memviewslice __pyx_v_out = { 0, 0, { 0 }, { 0 }, { 0 } };
  PyObject *__pyx_v_fill_value = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("take_2d_axis0_int8_int8 (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_values,&__pyx_n_s_indexer,&__pyx_n_s_out,&__pyx_n_s_fill_value,0};
    PyObject* values[4] = {0,0,0,0};
    values[3] = __pyx_k__137;
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_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 (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_indexer)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("take_2d_axis0_int8_int8", 0, 3, 4, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2676; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_out)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("take_2d_axis0_int8_int8", 0, 3, 4, 2); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2676; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  3:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_fill_value);
          if (value) { values[3] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "take_2d_axis0_int8_int8") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2676; __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_values = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_int8_t(values[0]); if (unlikely(!__pyx_v_values.memview)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2676; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_v_indexer = ((PyArrayObject *)values[1]);
    __pyx_v_out = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_int8_t(values[2]); if (unlikely(!__pyx_v_out.memview)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2678; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_v_fill_value = values[3];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("take_2d_axis0_int8_int8", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2676; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas.algos.take_2d_axis0_int8_int8", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_indexer), __pyx_ptype_5numpy_ndarray, 1, "indexer", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2677; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_264take_2d_axis0_int8_int8(__pyx_self, __pyx_v_values, __pyx_v_indexer, __pyx_v_out, __pyx_v_fill_value);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pandas_5algos_264take_2d_axis0_int8_int8(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_values, PyArrayObject *__pyx_v_indexer, __Pyx_memviewslice __pyx_v_out, PyObject *__pyx_v_fill_value) {
  Py_ssize_t __pyx_v_i;
  Py_ssize_t __pyx_v_j;
  Py_ssize_t __pyx_v_k;
  Py_ssize_t __pyx_v_n;
  Py_ssize_t __pyx_v_idx;
  __pyx_t_5numpy_int8_t __pyx_v_fv;
  __pyx_t_5numpy_int8_t *__pyx_v_v;
  __pyx_t_5numpy_int8_t *__pyx_v_o;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_indexer;
  __Pyx_Buffer __pyx_pybuffer_indexer;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  Py_ssize_t __pyx_t_1;
  __pyx_t_5numpy_int8_t __pyx_t_2;
  int __pyx_t_3;
  int __pyx_t_4;
  int __pyx_t_5;
  int __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;
  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;
  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_axis0_int8_int8", 0);
  __pyx_pybuffer_indexer.pybuffer.buf = NULL;
  __pyx_pybuffer_indexer.refcount = 0;
  __pyx_pybuffernd_indexer.data = NULL;
  __pyx_pybuffernd_indexer.rcbuffer = &__pyx_pybuffer_indexer;
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer, (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[2]; __pyx_lineno = 2676; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_indexer.diminfo[0].strides = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_indexer.diminfo[0].shape = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.shape[0];

  /* "pandas/src/generated.pyx":2684
 *         int8_t fv
 * 
 *     n = len(indexer)             # <<<<<<<<<<<<<<
 *     k = values.shape[1]
 * 
 */
  __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_indexer)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2684; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_n = __pyx_t_1;

  /* "pandas/src/generated.pyx":2685
 * 
 *     n = len(indexer)
 *     k = values.shape[1]             # <<<<<<<<<<<<<<
 * 
 *     fv = fill_value
 */
  __pyx_v_k = (__pyx_v_values.shape[1]);

  /* "pandas/src/generated.pyx":2687
 *     k = values.shape[1]
 * 
 *     fv = fill_value             # <<<<<<<<<<<<<<
 * 
 *     IF True:
 */
  __pyx_t_2 = __Pyx_PyInt_As_npy_int8(__pyx_v_fill_value); if (unlikely((__pyx_t_2 == (npy_int8)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2687; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_fv = __pyx_t_2;

  /* "pandas/src/generated.pyx":2695
 * 
 *         #GH3130
 *         if (values.strides[1] == out.strides[1] and             # <<<<<<<<<<<<<<
 *             values.strides[1] == sizeof(int8_t) and
 *             sizeof(int8_t) * n >= 256):
 */
  __pyx_t_3 = (((__pyx_v_values.strides[1]) == (__pyx_v_out.strides[1])) != 0);
  if (__pyx_t_3) {

    /* "pandas/src/generated.pyx":2696
 *         #GH3130
 *         if (values.strides[1] == out.strides[1] and
 *             values.strides[1] == sizeof(int8_t) and             # <<<<<<<<<<<<<<
 *             sizeof(int8_t) * n >= 256):
 * 
 */
    __pyx_t_4 = (((__pyx_v_values.strides[1]) == (sizeof(__pyx_t_5numpy_int8_t))) != 0);
    if (__pyx_t_4) {

      /* "pandas/src/generated.pyx":2697
 *         if (values.strides[1] == out.strides[1] and
 *             values.strides[1] == sizeof(int8_t) and
 *             sizeof(int8_t) * n >= 256):             # <<<<<<<<<<<<<<
 * 
 *             for i from 0 <= i < n:
 */
      __pyx_t_5 = ((((sizeof(__pyx_t_5numpy_int8_t)) * __pyx_v_n) >= 256) != 0);
      __pyx_t_6 = __pyx_t_5;
    } else {
      __pyx_t_6 = __pyx_t_4;
    }
    __pyx_t_4 = __pyx_t_6;
  } else {
    __pyx_t_4 = __pyx_t_3;
  }
  if (__pyx_t_4) {

    /* "pandas/src/generated.pyx":2699
 *             sizeof(int8_t) * n >= 256):
 * 
 *             for i from 0 <= i < n:             # <<<<<<<<<<<<<<
 *                 idx = indexer[i]
 *                 if idx == -1:
 */
    __pyx_t_1 = __pyx_v_n;
    for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_1; __pyx_v_i++) {

      /* "pandas/src/generated.pyx":2700
 * 
 *             for i from 0 <= i < n:
 *                 idx = indexer[i]             # <<<<<<<<<<<<<<
 *                 if idx == -1:
 *                     for j from 0 <= j < k:
 */
      __pyx_t_7 = __pyx_v_i;
      __pyx_v_idx = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_7, __pyx_pybuffernd_indexer.diminfo[0].strides));

      /* "pandas/src/generated.pyx":2701
 *             for i from 0 <= i < n:
 *                 idx = indexer[i]
 *                 if idx == -1:             # <<<<<<<<<<<<<<
 *                     for j from 0 <= j < k:
 *                         out[i, j] = fv
 */
      __pyx_t_4 = ((__pyx_v_idx == -1) != 0);
      if (__pyx_t_4) {

        /* "pandas/src/generated.pyx":2702
 *                 idx = indexer[i]
 *                 if idx == -1:
 *                     for j from 0 <= j < k:             # <<<<<<<<<<<<<<
 *                         out[i, j] = fv
 *                 else:
 */
        __pyx_t_8 = __pyx_v_k;
        for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_8; __pyx_v_j++) {

          /* "pandas/src/generated.pyx":2703
 *                 if idx == -1:
 *                     for j from 0 <= j < k:
 *                         out[i, j] = fv             # <<<<<<<<<<<<<<
 *                 else:
 *                     v = &values[idx, 0]
 */
          __pyx_t_9 = __pyx_v_i;
          __pyx_t_10 = __pyx_v_j;
          *((__pyx_t_5numpy_int8_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_out.data + __pyx_t_9 * __pyx_v_out.strides[0]) ) + __pyx_t_10 * __pyx_v_out.strides[1]) )) = __pyx_v_fv;
        }
        goto __pyx_L6;
      }
      /*else*/ {

        /* "pandas/src/generated.pyx":2705
 *                         out[i, j] = fv
 *                 else:
 *                     v = &values[idx, 0]             # <<<<<<<<<<<<<<
 *                     o = &out[i, 0]
 *                     memmove(o, v, <size_t>(sizeof(int8_t) * k))
 */
        __pyx_t_8 = __pyx_v_idx;
        __pyx_t_11 = 0;
        __pyx_v_v = (&(*((__pyx_t_5numpy_int8_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_values.data + __pyx_t_8 * __pyx_v_values.strides[0]) ) + __pyx_t_11 * __pyx_v_values.strides[1]) ))));

        /* "pandas/src/generated.pyx":2706
 *                 else:
 *                     v = &values[idx, 0]
 *                     o = &out[i, 0]             # <<<<<<<<<<<<<<
 *                     memmove(o, v, <size_t>(sizeof(int8_t) * k))
 *             return
 */
        __pyx_t_12 = __pyx_v_i;
        __pyx_t_13 = 0;
        __pyx_v_o = (&(*((__pyx_t_5numpy_int8_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_out.data + __pyx_t_12 * __pyx_v_out.strides[0]) ) + __pyx_t_13 * __pyx_v_out.strides[1]) ))));

        /* "pandas/src/generated.pyx":2707
 *                     v = &values[idx, 0]
 *                     o = &out[i, 0]
 *                     memmove(o, v, <size_t>(sizeof(int8_t) * k))             # <<<<<<<<<<<<<<
 *             return
 * 
 */
        memmove(__pyx_v_o, __pyx_v_v, ((size_t)((sizeof(__pyx_t_5numpy_int8_t)) * __pyx_v_k)));
      }
      __pyx_L6:;
    }

    /* "pandas/src/generated.pyx":2708
 *                     o = &out[i, 0]
 *                     memmove(o, v, <size_t>(sizeof(int8_t) * k))
 *             return             # <<<<<<<<<<<<<<
 * 
 *     for i from 0 <= i < n:
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_r = Py_None; __Pyx_INCREF(Py_None);
    goto __pyx_L0;
  }

  /* "pandas/src/generated.pyx":2710
 *             return
 * 
 *     for i from 0 <= i < n:             # <<<<<<<<<<<<<<
 *         idx = indexer[i]
 *         if idx == -1:
 */
  __pyx_t_1 = __pyx_v_n;
  for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_1; __pyx_v_i++) {

    /* "pandas/src/generated.pyx":2711
 * 
 *     for i from 0 <= i < n:
 *         idx = indexer[i]             # <<<<<<<<<<<<<<
 *         if idx == -1:
 *             for j from 0 <= j < k:
 */
    __pyx_t_14 = __pyx_v_i;
    __pyx_v_idx = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_indexer.diminfo[0].strides));

    /* "pandas/src/generated.pyx":2712
 *     for i from 0 <= i < n:
 *         idx = indexer[i]
 *         if idx == -1:             # <<<<<<<<<<<<<<
 *             for j from 0 <= j < k:
 *                 out[i, j] = fv
 */
    __pyx_t_4 = ((__pyx_v_idx == -1) != 0);
    if (__pyx_t_4) {

      /* "pandas/src/generated.pyx":2713
 *         idx = indexer[i]
 *         if idx == -1:
 *             for j from 0 <= j < k:             # <<<<<<<<<<<<<<
 *                 out[i, j] = fv
 *         else:
 */
      __pyx_t_15 = __pyx_v_k;
      for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_15; __pyx_v_j++) {

        /* "pandas/src/generated.pyx":2714
 *         if idx == -1:
 *             for j from 0 <= j < k:
 *                 out[i, j] = fv             # <<<<<<<<<<<<<<
 *         else:
 *             for j from 0 <= j < k:
 */
        __pyx_t_16 = __pyx_v_i;
        __pyx_t_17 = __pyx_v_j;
        *((__pyx_t_5numpy_int8_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_out.data + __pyx_t_16 * __pyx_v_out.strides[0]) ) + __pyx_t_17 * __pyx_v_out.strides[1]) )) = __pyx_v_fv;
      }
      goto __pyx_L11;
    }
    /*else*/ {

      /* "pandas/src/generated.pyx":2716
 *                 out[i, j] = fv
 *         else:
 *             for j from 0 <= j < k:             # <<<<<<<<<<<<<<
 *                 out[i, j] = values[idx, j]
 * 
 */
      __pyx_t_15 = __pyx_v_k;
      for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_15; __pyx_v_j++) {

        /* "pandas/src/generated.pyx":2717
 *         else:
 *             for j from 0 <= j < k:
 *                 out[i, j] = values[idx, j]             # <<<<<<<<<<<<<<
 * 
 * @cython.wraparound(False)
 */
        __pyx_t_18 = __pyx_v_idx;
        __pyx_t_19 = __pyx_v_j;
        __pyx_t_20 = __pyx_v_i;
        __pyx_t_21 = __pyx_v_j;
        *((__pyx_t_5numpy_int8_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_out.data + __pyx_t_20 * __pyx_v_out.strides[0]) ) + __pyx_t_21 * __pyx_v_out.strides[1]) )) = (*((__pyx_t_5numpy_int8_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_values.data + __pyx_t_18 * __pyx_v_values.strides[0]) ) + __pyx_t_19 * __pyx_v_values.strides[1]) )));
      }
    }
    __pyx_L11:;
  }

  /* "pandas/src/generated.pyx":2676
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def take_2d_axis0_int8_int8(int8_t[:, :] values,             # <<<<<<<<<<<<<<
 *                                     ndarray[int64_t] indexer,
 *                                     int8_t[:, :] out,
 */

  /* function exit code */
  __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_pybuffernd_indexer.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas.algos.take_2d_axis0_int8_int8", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer);
  __pyx_L2:;
  __PYX_XDEC_MEMVIEW(&__pyx_v_values, 1);
  __PYX_XDEC_MEMVIEW(&__pyx_v_out, 1);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/src/generated.pyx":2721
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def take_2d_axis0_int8_int32(int8_t[:, :] values,             # <<<<<<<<<<<<<<
 *                                     ndarray[int64_t] indexer,
 *                                     int32_t[:, :] out,
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pandas_5algos_267take_2d_axis0_int8_int32(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_5algos_267take_2d_axis0_int8_int32 = {__Pyx_NAMESTR("take_2d_axis0_int8_int32"), (PyCFunction)__pyx_pw_6pandas_5algos_267take_2d_axis0_int8_int32, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pw_6pandas_5algos_267take_2d_axis0_int8_int32(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  __Pyx_memviewslice __pyx_v_values = { 0, 0, { 0 }, { 0 }, { 0 } };
  PyArrayObject *__pyx_v_indexer = 0;
  __Pyx_memviewslice __pyx_v_out = { 0, 0, { 0 }, { 0 }, { 0 } };
  PyObject *__pyx_v_fill_value = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("take_2d_axis0_int8_int32 (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_values,&__pyx_n_s_indexer,&__pyx_n_s_out,&__pyx_n_s_fill_value,0};
    PyObject* values[4] = {0,0,0,0};
    values[3] = __pyx_k__138;
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_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 (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_indexer)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("take_2d_axis0_int8_int32", 0, 3, 4, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2721; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_out)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("take_2d_axis0_int8_int32", 0, 3, 4, 2); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2721; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  3:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_fill_value);
          if (value) { values[3] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "take_2d_axis0_int8_int32") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2721; __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_values = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_int8_t(values[0]); if (unlikely(!__pyx_v_values.memview)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2721; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_v_indexer = ((PyArrayObject *)values[1]);
    __pyx_v_out = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_int32_t(values[2]); if (unlikely(!__pyx_v_out.memview)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2723; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_v_fill_value = values[3];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("take_2d_axis0_int8_int32", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2721; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas.algos.take_2d_axis0_int8_int32", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_indexer), __pyx_ptype_5numpy_ndarray, 1, "indexer", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2722; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_266take_2d_axis0_int8_int32(__pyx_self, __pyx_v_values, __pyx_v_indexer, __pyx_v_out, __pyx_v_fill_value);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pandas_5algos_266take_2d_axis0_int8_int32(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_values, PyArrayObject *__pyx_v_indexer, __Pyx_memviewslice __pyx_v_out, PyObject *__pyx_v_fill_value) {
  Py_ssize_t __pyx_v_i;
  Py_ssize_t __pyx_v_j;
  Py_ssize_t __pyx_v_k;
  Py_ssize_t __pyx_v_n;
  Py_ssize_t __pyx_v_idx;
  __pyx_t_5numpy_int32_t __pyx_v_fv;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_indexer;
  __Pyx_Buffer __pyx_pybuffer_indexer;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  Py_ssize_t __pyx_t_1;
  __pyx_t_5numpy_int32_t __pyx_t_2;
  Py_ssize_t __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;
  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;
  __Pyx_RefNannySetupContext("take_2d_axis0_int8_int32", 0);
  __pyx_pybuffer_indexer.pybuffer.buf = NULL;
  __pyx_pybuffer_indexer.refcount = 0;
  __pyx_pybuffernd_indexer.data = NULL;
  __pyx_pybuffernd_indexer.rcbuffer = &__pyx_pybuffer_indexer;
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer, (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[2]; __pyx_lineno = 2721; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_indexer.diminfo[0].strides = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_indexer.diminfo[0].shape = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.shape[0];

  /* "pandas/src/generated.pyx":2729
 *         int32_t fv
 * 
 *     n = len(indexer)             # <<<<<<<<<<<<<<
 *     k = values.shape[1]
 * 
 */
  __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_indexer)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2729; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_n = __pyx_t_1;

  /* "pandas/src/generated.pyx":2730
 * 
 *     n = len(indexer)
 *     k = values.shape[1]             # <<<<<<<<<<<<<<
 * 
 *     fv = fill_value
 */
  __pyx_v_k = (__pyx_v_values.shape[1]);

  /* "pandas/src/generated.pyx":2732
 *     k = values.shape[1]
 * 
 *     fv = fill_value             # <<<<<<<<<<<<<<
 * 
 *     IF False:
 */
  __pyx_t_2 = __Pyx_PyInt_As_npy_int32(__pyx_v_fill_value); if (unlikely((__pyx_t_2 == (npy_int32)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2732; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_fv = __pyx_t_2;

  /* "pandas/src/generated.pyx":2755
 *             return
 * 
 *     for i from 0 <= i < n:             # <<<<<<<<<<<<<<
 *         idx = indexer[i]
 *         if idx == -1:
 */
  __pyx_t_1 = __pyx_v_n;
  for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_1; __pyx_v_i++) {

    /* "pandas/src/generated.pyx":2756
 * 
 *     for i from 0 <= i < n:
 *         idx = indexer[i]             # <<<<<<<<<<<<<<
 *         if idx == -1:
 *             for j from 0 <= j < k:
 */
    __pyx_t_3 = __pyx_v_i;
    __pyx_v_idx = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_3, __pyx_pybuffernd_indexer.diminfo[0].strides));

    /* "pandas/src/generated.pyx":2757
 *     for i from 0 <= i < n:
 *         idx = indexer[i]
 *         if idx == -1:             # <<<<<<<<<<<<<<
 *             for j from 0 <= j < k:
 *                 out[i, j] = fv
 */
    __pyx_t_4 = ((__pyx_v_idx == -1) != 0);
    if (__pyx_t_4) {

      /* "pandas/src/generated.pyx":2758
 *         idx = indexer[i]
 *         if idx == -1:
 *             for j from 0 <= j < k:             # <<<<<<<<<<<<<<
 *                 out[i, j] = fv
 *         else:
 */
      __pyx_t_5 = __pyx_v_k;
      for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_5; __pyx_v_j++) {

        /* "pandas/src/generated.pyx":2759
 *         if idx == -1:
 *             for j from 0 <= j < k:
 *                 out[i, j] = fv             # <<<<<<<<<<<<<<
 *         else:
 *             for j from 0 <= j < k:
 */
        __pyx_t_6 = __pyx_v_i;
        __pyx_t_7 = __pyx_v_j;
        *((__pyx_t_5numpy_int32_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_out.data + __pyx_t_6 * __pyx_v_out.strides[0]) ) + __pyx_t_7 * __pyx_v_out.strides[1]) )) = __pyx_v_fv;
      }
      goto __pyx_L5;
    }
    /*else*/ {

      /* "pandas/src/generated.pyx":2761
 *                 out[i, j] = fv
 *         else:
 *             for j from 0 <= j < k:             # <<<<<<<<<<<<<<
 *                 out[i, j] = values[idx, j]
 * 
 */
      __pyx_t_5 = __pyx_v_k;
      for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_5; __pyx_v_j++) {

        /* "pandas/src/generated.pyx":2762
 *         else:
 *             for j from 0 <= j < k:
 *                 out[i, j] = values[idx, j]             # <<<<<<<<<<<<<<
 * 
 * @cython.wraparound(False)
 */
        __pyx_t_8 = __pyx_v_idx;
        __pyx_t_9 = __pyx_v_j;
        __pyx_t_10 = __pyx_v_i;
        __pyx_t_11 = __pyx_v_j;
        *((__pyx_t_5numpy_int32_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_out.data + __pyx_t_10 * __pyx_v_out.strides[0]) ) + __pyx_t_11 * __pyx_v_out.strides[1]) )) = (*((__pyx_t_5numpy_int8_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_values.data + __pyx_t_8 * __pyx_v_values.strides[0]) ) + __pyx_t_9 * __pyx_v_values.strides[1]) )));
      }
    }
    __pyx_L5:;
  }

  /* "pandas/src/generated.pyx":2721
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def take_2d_axis0_int8_int32(int8_t[:, :] values,             # <<<<<<<<<<<<<<
 *                                     ndarray[int64_t] indexer,
 *                                     int32_t[:, :] out,
 */

  /* function exit code */
  __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_pybuffernd_indexer.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas.algos.take_2d_axis0_int8_int32", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer);
  __pyx_L2:;
  __PYX_XDEC_MEMVIEW(&__pyx_v_values, 1);
  __PYX_XDEC_MEMVIEW(&__pyx_v_out, 1);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/src/generated.pyx":2766
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def take_2d_axis0_int8_int64(int8_t[:, :] values,             # <<<<<<<<<<<<<<
 *                                     ndarray[int64_t] indexer,
 *                                     int64_t[:, :] out,
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pandas_5algos_269take_2d_axis0_int8_int64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_5algos_269take_2d_axis0_int8_int64 = {__Pyx_NAMESTR("take_2d_axis0_int8_int64"), (PyCFunction)__pyx_pw_6pandas_5algos_269take_2d_axis0_int8_int64, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pw_6pandas_5algos_269take_2d_axis0_int8_int64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  __Pyx_memviewslice __pyx_v_values = { 0, 0, { 0 }, { 0 }, { 0 } };
  PyArrayObject *__pyx_v_indexer = 0;
  __Pyx_memviewslice __pyx_v_out = { 0, 0, { 0 }, { 0 }, { 0 } };
  PyObject *__pyx_v_fill_value = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("take_2d_axis0_int8_int64 (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_values,&__pyx_n_s_indexer,&__pyx_n_s_out,&__pyx_n_s_fill_value,0};
    PyObject* values[4] = {0,0,0,0};
    values[3] = __pyx_k__139;
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_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 (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_indexer)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("take_2d_axis0_int8_int64", 0, 3, 4, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2766; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_out)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("take_2d_axis0_int8_int64", 0, 3, 4, 2); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2766; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  3:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_fill_value);
          if (value) { values[3] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "take_2d_axis0_int8_int64") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2766; __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_values = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_int8_t(values[0]); if (unlikely(!__pyx_v_values.memview)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2766; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_v_indexer = ((PyArrayObject *)values[1]);
    __pyx_v_out = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_int64_t(values[2]); if (unlikely(!__pyx_v_out.memview)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2768; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_v_fill_value = values[3];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("take_2d_axis0_int8_int64", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2766; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas.algos.take_2d_axis0_int8_int64", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_indexer), __pyx_ptype_5numpy_ndarray, 1, "indexer", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2767; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_268take_2d_axis0_int8_int64(__pyx_self, __pyx_v_values, __pyx_v_indexer, __pyx_v_out, __pyx_v_fill_value);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pandas_5algos_268take_2d_axis0_int8_int64(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_values, PyArrayObject *__pyx_v_indexer, __Pyx_memviewslice __pyx_v_out, PyObject *__pyx_v_fill_value) {
  Py_ssize_t __pyx_v_i;
  Py_ssize_t __pyx_v_j;
  Py_ssize_t __pyx_v_k;
  Py_ssize_t __pyx_v_n;
  Py_ssize_t __pyx_v_idx;
  __pyx_t_5numpy_int64_t __pyx_v_fv;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_indexer;
  __Pyx_Buffer __pyx_pybuffer_indexer;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  Py_ssize_t __pyx_t_1;
  __pyx_t_5numpy_int64_t __pyx_t_2;
  Py_ssize_t __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;
  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;
  __Pyx_RefNannySetupContext("take_2d_axis0_int8_int64", 0);
  __pyx_pybuffer_indexer.pybuffer.buf = NULL;
  __pyx_pybuffer_indexer.refcount = 0;
  __pyx_pybuffernd_indexer.data = NULL;
  __pyx_pybuffernd_indexer.rcbuffer = &__pyx_pybuffer_indexer;
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer, (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[2]; __pyx_lineno = 2766; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_indexer.diminfo[0].strides = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_indexer.diminfo[0].shape = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.shape[0];

  /* "pandas/src/generated.pyx":2774
 *         int64_t fv
 * 
 *     n = len(indexer)             # <<<<<<<<<<<<<<
 *     k = values.shape[1]
 * 
 */
  __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_indexer)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2774; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_n = __pyx_t_1;

  /* "pandas/src/generated.pyx":2775
 * 
 *     n = len(indexer)
 *     k = values.shape[1]             # <<<<<<<<<<<<<<
 * 
 *     fv = fill_value
 */
  __pyx_v_k = (__pyx_v_values.shape[1]);

  /* "pandas/src/generated.pyx":2777
 *     k = values.shape[1]
 * 
 *     fv = fill_value             # <<<<<<<<<<<<<<
 * 
 *     IF False:
 */
  __pyx_t_2 = __Pyx_PyInt_As_npy_int64(__pyx_v_fill_value); if (unlikely((__pyx_t_2 == (npy_int64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2777; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_fv = __pyx_t_2;

  /* "pandas/src/generated.pyx":2800
 *             return
 * 
 *     for i from 0 <= i < n:             # <<<<<<<<<<<<<<
 *         idx = indexer[i]
 *         if idx == -1:
 */
  __pyx_t_1 = __pyx_v_n;
  for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_1; __pyx_v_i++) {

    /* "pandas/src/generated.pyx":2801
 * 
 *     for i from 0 <= i < n:
 *         idx = indexer[i]             # <<<<<<<<<<<<<<
 *         if idx == -1:
 *             for j from 0 <= j < k:
 */
    __pyx_t_3 = __pyx_v_i;
    __pyx_v_idx = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_3, __pyx_pybuffernd_indexer.diminfo[0].strides));

    /* "pandas/src/generated.pyx":2802
 *     for i from 0 <= i < n:
 *         idx = indexer[i]
 *         if idx == -1:             # <<<<<<<<<<<<<<
 *             for j from 0 <= j < k:
 *                 out[i, j] = fv
 */
    __pyx_t_4 = ((__pyx_v_idx == -1) != 0);
    if (__pyx_t_4) {

      /* "pandas/src/generated.pyx":2803
 *         idx = indexer[i]
 *         if idx == -1:
 *             for j from 0 <= j < k:             # <<<<<<<<<<<<<<
 *                 out[i, j] = fv
 *         else:
 */
      __pyx_t_5 = __pyx_v_k;
      for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_5; __pyx_v_j++) {

        /* "pandas/src/generated.pyx":2804
 *         if idx == -1:
 *             for j from 0 <= j < k:
 *                 out[i, j] = fv             # <<<<<<<<<<<<<<
 *         else:
 *             for j from 0 <= j < k:
 */
        __pyx_t_6 = __pyx_v_i;
        __pyx_t_7 = __pyx_v_j;
        *((__pyx_t_5numpy_int64_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_out.data + __pyx_t_6 * __pyx_v_out.strides[0]) ) + __pyx_t_7 * __pyx_v_out.strides[1]) )) = __pyx_v_fv;
      }
      goto __pyx_L5;
    }
    /*else*/ {

      /* "pandas/src/generated.pyx":2806
 *                 out[i, j] = fv
 *         else:
 *             for j from 0 <= j < k:             # <<<<<<<<<<<<<<
 *                 out[i, j] = values[idx, j]
 * 
 */
      __pyx_t_5 = __pyx_v_k;
      for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_5; __pyx_v_j++) {

        /* "pandas/src/generated.pyx":2807
 *         else:
 *             for j from 0 <= j < k:
 *                 out[i, j] = values[idx, j]             # <<<<<<<<<<<<<<
 * 
 * @cython.wraparound(False)
 */
        __pyx_t_8 = __pyx_v_idx;
        __pyx_t_9 = __pyx_v_j;
        __pyx_t_10 = __pyx_v_i;
        __pyx_t_11 = __pyx_v_j;
        *((__pyx_t_5numpy_int64_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_out.data + __pyx_t_10 * __pyx_v_out.strides[0]) ) + __pyx_t_11 * __pyx_v_out.strides[1]) )) = (*((__pyx_t_5numpy_int8_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_values.data + __pyx_t_8 * __pyx_v_values.strides[0]) ) + __pyx_t_9 * __pyx_v_values.strides[1]) )));
      }
    }
    __pyx_L5:;
  }

  /* "pandas/src/generated.pyx":2766
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def take_2d_axis0_int8_int64(int8_t[:, :] values,             # <<<<<<<<<<<<<<
 *                                     ndarray[int64_t] indexer,
 *                                     int64_t[:, :] out,
 */

  /* function exit code */
  __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_pybuffernd_indexer.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas.algos.take_2d_axis0_int8_int64", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer);
  __pyx_L2:;
  __PYX_XDEC_MEMVIEW(&__pyx_v_values, 1);
  __PYX_XDEC_MEMVIEW(&__pyx_v_out, 1);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/src/generated.pyx":2811
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def take_2d_axis0_int8_float64(int8_t[:, :] values,             # <<<<<<<<<<<<<<
 *                                     ndarray[int64_t] indexer,
 *                                     float64_t[:, :] out,
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pandas_5algos_271take_2d_axis0_int8_float64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_5algos_271take_2d_axis0_int8_float64 = {__Pyx_NAMESTR("take_2d_axis0_int8_float64"), (PyCFunction)__pyx_pw_6pandas_5algos_271take_2d_axis0_int8_float64, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pw_6pandas_5algos_271take_2d_axis0_int8_float64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  __Pyx_memviewslice __pyx_v_values = { 0, 0, { 0 }, { 0 }, { 0 } };
  PyArrayObject *__pyx_v_indexer = 0;
  __Pyx_memviewslice __pyx_v_out = { 0, 0, { 0 }, { 0 }, { 0 } };
  PyObject *__pyx_v_fill_value = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("take_2d_axis0_int8_float64 (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_values,&__pyx_n_s_indexer,&__pyx_n_s_out,&__pyx_n_s_fill_value,0};
    PyObject* values[4] = {0,0,0,0};
    values[3] = __pyx_k__140;
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_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 (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_indexer)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("take_2d_axis0_int8_float64", 0, 3, 4, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2811; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_out)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("take_2d_axis0_int8_float64", 0, 3, 4, 2); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2811; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  3:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_fill_value);
          if (value) { values[3] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "take_2d_axis0_int8_float64") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2811; __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_values = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_int8_t(values[0]); if (unlikely(!__pyx_v_values.memview)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2811; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_v_indexer = ((PyArrayObject *)values[1]);
    __pyx_v_out = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_float64_t(values[2]); if (unlikely(!__pyx_v_out.memview)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2813; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_v_fill_value = values[3];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("take_2d_axis0_int8_float64", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2811; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas.algos.take_2d_axis0_int8_float64", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_indexer), __pyx_ptype_5numpy_ndarray, 1, "indexer", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2812; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_270take_2d_axis0_int8_float64(__pyx_self, __pyx_v_values, __pyx_v_indexer, __pyx_v_out, __pyx_v_fill_value);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pandas_5algos_270take_2d_axis0_int8_float64(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_values, PyArrayObject *__pyx_v_indexer, __Pyx_memviewslice __pyx_v_out, PyObject *__pyx_v_fill_value) {
  Py_ssize_t __pyx_v_i;
  Py_ssize_t __pyx_v_j;
  Py_ssize_t __pyx_v_k;
  Py_ssize_t __pyx_v_n;
  Py_ssize_t __pyx_v_idx;
  __pyx_t_5numpy_float64_t __pyx_v_fv;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_indexer;
  __Pyx_Buffer __pyx_pybuffer_indexer;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  Py_ssize_t __pyx_t_1;
  __pyx_t_5numpy_float64_t __pyx_t_2;
  Py_ssize_t __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;
  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;
  __Pyx_RefNannySetupContext("take_2d_axis0_int8_float64", 0);
  __pyx_pybuffer_indexer.pybuffer.buf = NULL;
  __pyx_pybuffer_indexer.refcount = 0;
  __pyx_pybuffernd_indexer.data = NULL;
  __pyx_pybuffernd_indexer.rcbuffer = &__pyx_pybuffer_indexer;
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer, (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[2]; __pyx_lineno = 2811; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_indexer.diminfo[0].strides = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_indexer.diminfo[0].shape = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.shape[0];

  /* "pandas/src/generated.pyx":2819
 *         float64_t fv
 * 
 *     n = len(indexer)             # <<<<<<<<<<<<<<
 *     k = values.shape[1]
 * 
 */
  __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_indexer)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2819; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_n = __pyx_t_1;

  /* "pandas/src/generated.pyx":2820
 * 
 *     n = len(indexer)
 *     k = values.shape[1]             # <<<<<<<<<<<<<<
 * 
 *     fv = fill_value
 */
  __pyx_v_k = (__pyx_v_values.shape[1]);

  /* "pandas/src/generated.pyx":2822
 *     k = values.shape[1]
 * 
 *     fv = fill_value             # <<<<<<<<<<<<<<
 * 
 *     IF False:
 */
  __pyx_t_2 = __pyx_PyFloat_AsDouble(__pyx_v_fill_value); if (unlikely((__pyx_t_2 == (npy_float64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2822; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_fv = __pyx_t_2;

  /* "pandas/src/generated.pyx":2845
 *             return
 * 
 *     for i from 0 <= i < n:             # <<<<<<<<<<<<<<
 *         idx = indexer[i]
 *         if idx == -1:
 */
  __pyx_t_1 = __pyx_v_n;
  for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_1; __pyx_v_i++) {

    /* "pandas/src/generated.pyx":2846
 * 
 *     for i from 0 <= i < n:
 *         idx = indexer[i]             # <<<<<<<<<<<<<<
 *         if idx == -1:
 *             for j from 0 <= j < k:
 */
    __pyx_t_3 = __pyx_v_i;
    __pyx_v_idx = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_3, __pyx_pybuffernd_indexer.diminfo[0].strides));

    /* "pandas/src/generated.pyx":2847
 *     for i from 0 <= i < n:
 *         idx = indexer[i]
 *         if idx == -1:             # <<<<<<<<<<<<<<
 *             for j from 0 <= j < k:
 *                 out[i, j] = fv
 */
    __pyx_t_4 = ((__pyx_v_idx == -1) != 0);
    if (__pyx_t_4) {

      /* "pandas/src/generated.pyx":2848
 *         idx = indexer[i]
 *         if idx == -1:
 *             for j from 0 <= j < k:             # <<<<<<<<<<<<<<
 *                 out[i, j] = fv
 *         else:
 */
      __pyx_t_5 = __pyx_v_k;
      for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_5; __pyx_v_j++) {

        /* "pandas/src/generated.pyx":2849
 *         if idx == -1:
 *             for j from 0 <= j < k:
 *                 out[i, j] = fv             # <<<<<<<<<<<<<<
 *         else:
 *             for j from 0 <= j < k:
 */
        __pyx_t_6 = __pyx_v_i;
        __pyx_t_7 = __pyx_v_j;
        *((__pyx_t_5numpy_float64_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_out.data + __pyx_t_6 * __pyx_v_out.strides[0]) ) + __pyx_t_7 * __pyx_v_out.strides[1]) )) = __pyx_v_fv;
      }
      goto __pyx_L5;
    }
    /*else*/ {

      /* "pandas/src/generated.pyx":2851
 *                 out[i, j] = fv
 *         else:
 *             for j from 0 <= j < k:             # <<<<<<<<<<<<<<
 *                 out[i, j] = values[idx, j]
 * 
 */
      __pyx_t_5 = __pyx_v_k;
      for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_5; __pyx_v_j++) {

        /* "pandas/src/generated.pyx":2852
 *         else:
 *             for j from 0 <= j < k:
 *                 out[i, j] = values[idx, j]             # <<<<<<<<<<<<<<
 * 
 * @cython.wraparound(False)
 */
        __pyx_t_8 = __pyx_v_idx;
        __pyx_t_9 = __pyx_v_j;
        __pyx_t_10 = __pyx_v_i;
        __pyx_t_11 = __pyx_v_j;
        *((__pyx_t_5numpy_float64_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_out.data + __pyx_t_10 * __pyx_v_out.strides[0]) ) + __pyx_t_11 * __pyx_v_out.strides[1]) )) = (*((__pyx_t_5numpy_int8_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_values.data + __pyx_t_8 * __pyx_v_values.strides[0]) ) + __pyx_t_9 * __pyx_v_values.strides[1]) )));
      }
    }
    __pyx_L5:;
  }

  /* "pandas/src/generated.pyx":2811
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def take_2d_axis0_int8_float64(int8_t[:, :] values,             # <<<<<<<<<<<<<<
 *                                     ndarray[int64_t] indexer,
 *                                     float64_t[:, :] out,
 */

  /* function exit code */
  __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_pybuffernd_indexer.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas.algos.take_2d_axis0_int8_float64", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer);
  __pyx_L2:;
  __PYX_XDEC_MEMVIEW(&__pyx_v_values, 1);
  __PYX_XDEC_MEMVIEW(&__pyx_v_out, 1);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/src/generated.pyx":2856
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def take_2d_axis0_int16_int16(int16_t[:, :] values,             # <<<<<<<<<<<<<<
 *                                     ndarray[int64_t] indexer,
 *                                     int16_t[:, :] out,
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pandas_5algos_273take_2d_axis0_int16_int16(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_5algos_273take_2d_axis0_int16_int16 = {__Pyx_NAMESTR("take_2d_axis0_int16_int16"), (PyCFunction)__pyx_pw_6pandas_5algos_273take_2d_axis0_int16_int16, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pw_6pandas_5algos_273take_2d_axis0_int16_int16(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  __Pyx_memviewslice __pyx_v_values = { 0, 0, { 0 }, { 0 }, { 0 } };
  PyArrayObject *__pyx_v_indexer = 0;
  __Pyx_memviewslice __pyx_v_out = { 0, 0, { 0 }, { 0 }, { 0 } };
  PyObject *__pyx_v_fill_value = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("take_2d_axis0_int16_int16 (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_values,&__pyx_n_s_indexer,&__pyx_n_s_out,&__pyx_n_s_fill_value,0};
    PyObject* values[4] = {0,0,0,0};
    values[3] = __pyx_k__141;
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_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 (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_indexer)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("take_2d_axis0_int16_int16", 0, 3, 4, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2856; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_out)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("take_2d_axis0_int16_int16", 0, 3, 4, 2); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2856; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  3:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_fill_value);
          if (value) { values[3] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "take_2d_axis0_int16_int16") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2856; __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_values = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_int16_t(values[0]); if (unlikely(!__pyx_v_values.memview)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2856; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_v_indexer = ((PyArrayObject *)values[1]);
    __pyx_v_out = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_int16_t(values[2]); if (unlikely(!__pyx_v_out.memview)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2858; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_v_fill_value = values[3];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("take_2d_axis0_int16_int16", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2856; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas.algos.take_2d_axis0_int16_int16", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_indexer), __pyx_ptype_5numpy_ndarray, 1, "indexer", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2857; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_272take_2d_axis0_int16_int16(__pyx_self, __pyx_v_values, __pyx_v_indexer, __pyx_v_out, __pyx_v_fill_value);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pandas_5algos_272take_2d_axis0_int16_int16(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_values, PyArrayObject *__pyx_v_indexer, __Pyx_memviewslice __pyx_v_out, PyObject *__pyx_v_fill_value) {
  Py_ssize_t __pyx_v_i;
  Py_ssize_t __pyx_v_j;
  Py_ssize_t __pyx_v_k;
  Py_ssize_t __pyx_v_n;
  Py_ssize_t __pyx_v_idx;
  __pyx_t_5numpy_int16_t __pyx_v_fv;
  __pyx_t_5numpy_int16_t *__pyx_v_v;
  __pyx_t_5numpy_int16_t *__pyx_v_o;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_indexer;
  __Pyx_Buffer __pyx_pybuffer_indexer;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  Py_ssize_t __pyx_t_1;
  __pyx_t_5numpy_int16_t __pyx_t_2;
  int __pyx_t_3;
  int __pyx_t_4;
  int __pyx_t_5;
  int __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;
  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;
  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_axis0_int16_int16", 0);
  __pyx_pybuffer_indexer.pybuffer.buf = NULL;
  __pyx_pybuffer_indexer.refcount = 0;
  __pyx_pybuffernd_indexer.data = NULL;
  __pyx_pybuffernd_indexer.rcbuffer = &__pyx_pybuffer_indexer;
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer, (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[2]; __pyx_lineno = 2856; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_indexer.diminfo[0].strides = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_indexer.diminfo[0].shape = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.shape[0];

  /* "pandas/src/generated.pyx":2864
 *         int16_t fv
 * 
 *     n = len(indexer)             # <<<<<<<<<<<<<<
 *     k = values.shape[1]
 * 
 */
  __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_indexer)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2864; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_n = __pyx_t_1;

  /* "pandas/src/generated.pyx":2865
 * 
 *     n = len(indexer)
 *     k = values.shape[1]             # <<<<<<<<<<<<<<
 * 
 *     fv = fill_value
 */
  __pyx_v_k = (__pyx_v_values.shape[1]);

  /* "pandas/src/generated.pyx":2867
 *     k = values.shape[1]
 * 
 *     fv = fill_value             # <<<<<<<<<<<<<<
 * 
 *     IF True:
 */
  __pyx_t_2 = __Pyx_PyInt_As_npy_int16(__pyx_v_fill_value); if (unlikely((__pyx_t_2 == (npy_int16)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2867; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_fv = __pyx_t_2;

  /* "pandas/src/generated.pyx":2875
 * 
 *         #GH3130
 *         if (values.strides[1] == out.strides[1] and             # <<<<<<<<<<<<<<
 *             values.strides[1] == sizeof(int16_t) and
 *             sizeof(int16_t) * n >= 256):
 */
  __pyx_t_3 = (((__pyx_v_values.strides[1]) == (__pyx_v_out.strides[1])) != 0);
  if (__pyx_t_3) {

    /* "pandas/src/generated.pyx":2876
 *         #GH3130
 *         if (values.strides[1] == out.strides[1] and
 *             values.strides[1] == sizeof(int16_t) and             # <<<<<<<<<<<<<<
 *             sizeof(int16_t) * n >= 256):
 * 
 */
    __pyx_t_4 = (((__pyx_v_values.strides[1]) == (sizeof(__pyx_t_5numpy_int16_t))) != 0);
    if (__pyx_t_4) {

      /* "pandas/src/generated.pyx":2877
 *         if (values.strides[1] == out.strides[1] and
 *             values.strides[1] == sizeof(int16_t) and
 *             sizeof(int16_t) * n >= 256):             # <<<<<<<<<<<<<<
 * 
 *             for i from 0 <= i < n:
 */
      __pyx_t_5 = ((((sizeof(__pyx_t_5numpy_int16_t)) * __pyx_v_n) >= 256) != 0);
      __pyx_t_6 = __pyx_t_5;
    } else {
      __pyx_t_6 = __pyx_t_4;
    }
    __pyx_t_4 = __pyx_t_6;
  } else {
    __pyx_t_4 = __pyx_t_3;
  }
  if (__pyx_t_4) {

    /* "pandas/src/generated.pyx":2879
 *             sizeof(int16_t) * n >= 256):
 * 
 *             for i from 0 <= i < n:             # <<<<<<<<<<<<<<
 *                 idx = indexer[i]
 *                 if idx == -1:
 */
    __pyx_t_1 = __pyx_v_n;
    for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_1; __pyx_v_i++) {

      /* "pandas/src/generated.pyx":2880
 * 
 *             for i from 0 <= i < n:
 *                 idx = indexer[i]             # <<<<<<<<<<<<<<
 *                 if idx == -1:
 *                     for j from 0 <= j < k:
 */
      __pyx_t_7 = __pyx_v_i;
      __pyx_v_idx = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_7, __pyx_pybuffernd_indexer.diminfo[0].strides));

      /* "pandas/src/generated.pyx":2881
 *             for i from 0 <= i < n:
 *                 idx = indexer[i]
 *                 if idx == -1:             # <<<<<<<<<<<<<<
 *                     for j from 0 <= j < k:
 *                         out[i, j] = fv
 */
      __pyx_t_4 = ((__pyx_v_idx == -1) != 0);
      if (__pyx_t_4) {

        /* "pandas/src/generated.pyx":2882
 *                 idx = indexer[i]
 *                 if idx == -1:
 *                     for j from 0 <= j < k:             # <<<<<<<<<<<<<<
 *                         out[i, j] = fv
 *                 else:
 */
        __pyx_t_8 = __pyx_v_k;
        for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_8; __pyx_v_j++) {

          /* "pandas/src/generated.pyx":2883
 *                 if idx == -1:
 *                     for j from 0 <= j < k:
 *                         out[i, j] = fv             # <<<<<<<<<<<<<<
 *                 else:
 *                     v = &values[idx, 0]
 */
          __pyx_t_9 = __pyx_v_i;
          __pyx_t_10 = __pyx_v_j;
          *((__pyx_t_5numpy_int16_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_out.data + __pyx_t_9 * __pyx_v_out.strides[0]) ) + __pyx_t_10 * __pyx_v_out.strides[1]) )) = __pyx_v_fv;
        }
        goto __pyx_L6;
      }
      /*else*/ {

        /* "pandas/src/generated.pyx":2885
 *                         out[i, j] = fv
 *                 else:
 *                     v = &values[idx, 0]             # <<<<<<<<<<<<<<
 *                     o = &out[i, 0]
 *                     memmove(o, v, <size_t>(sizeof(int16_t) * k))
 */
        __pyx_t_8 = __pyx_v_idx;
        __pyx_t_11 = 0;
        __pyx_v_v = (&(*((__pyx_t_5numpy_int16_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_values.data + __pyx_t_8 * __pyx_v_values.strides[0]) ) + __pyx_t_11 * __pyx_v_values.strides[1]) ))));

        /* "pandas/src/generated.pyx":2886
 *                 else:
 *                     v = &values[idx, 0]
 *                     o = &out[i, 0]             # <<<<<<<<<<<<<<
 *                     memmove(o, v, <size_t>(sizeof(int16_t) * k))
 *             return
 */
        __pyx_t_12 = __pyx_v_i;
        __pyx_t_13 = 0;
        __pyx_v_o = (&(*((__pyx_t_5numpy_int16_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_out.data + __pyx_t_12 * __pyx_v_out.strides[0]) ) + __pyx_t_13 * __pyx_v_out.strides[1]) ))));

        /* "pandas/src/generated.pyx":2887
 *                     v = &values[idx, 0]
 *                     o = &out[i, 0]
 *                     memmove(o, v, <size_t>(sizeof(int16_t) * k))             # <<<<<<<<<<<<<<
 *             return
 * 
 */
        memmove(__pyx_v_o, __pyx_v_v, ((size_t)((sizeof(__pyx_t_5numpy_int16_t)) * __pyx_v_k)));
      }
      __pyx_L6:;
    }

    /* "pandas/src/generated.pyx":2888
 *                     o = &out[i, 0]
 *                     memmove(o, v, <size_t>(sizeof(int16_t) * k))
 *             return             # <<<<<<<<<<<<<<
 * 
 *     for i from 0 <= i < n:
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_r = Py_None; __Pyx_INCREF(Py_None);
    goto __pyx_L0;
  }

  /* "pandas/src/generated.pyx":2890
 *             return
 * 
 *     for i from 0 <= i < n:             # <<<<<<<<<<<<<<
 *         idx = indexer[i]
 *         if idx == -1:
 */
  __pyx_t_1 = __pyx_v_n;
  for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_1; __pyx_v_i++) {

    /* "pandas/src/generated.pyx":2891
 * 
 *     for i from 0 <= i < n:
 *         idx = indexer[i]             # <<<<<<<<<<<<<<
 *         if idx == -1:
 *             for j from 0 <= j < k:
 */
    __pyx_t_14 = __pyx_v_i;
    __pyx_v_idx = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_indexer.diminfo[0].strides));

    /* "pandas/src/generated.pyx":2892
 *     for i from 0 <= i < n:
 *         idx = indexer[i]
 *         if idx == -1:             # <<<<<<<<<<<<<<
 *             for j from 0 <= j < k:
 *                 out[i, j] = fv
 */
    __pyx_t_4 = ((__pyx_v_idx == -1) != 0);
    if (__pyx_t_4) {

      /* "pandas/src/generated.pyx":2893
 *         idx = indexer[i]
 *         if idx == -1:
 *             for j from 0 <= j < k:             # <<<<<<<<<<<<<<
 *                 out[i, j] = fv
 *         else:
 */
      __pyx_t_15 = __pyx_v_k;
      for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_15; __pyx_v_j++) {

        /* "pandas/src/generated.pyx":2894
 *         if idx == -1:
 *             for j from 0 <= j < k:
 *                 out[i, j] = fv             # <<<<<<<<<<<<<<
 *         else:
 *             for j from 0 <= j < k:
 */
        __pyx_t_16 = __pyx_v_i;
        __pyx_t_17 = __pyx_v_j;
        *((__pyx_t_5numpy_int16_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_out.data + __pyx_t_16 * __pyx_v_out.strides[0]) ) + __pyx_t_17 * __pyx_v_out.strides[1]) )) = __pyx_v_fv;
      }
      goto __pyx_L11;
    }
    /*else*/ {

      /* "pandas/src/generated.pyx":2896
 *                 out[i, j] = fv
 *         else:
 *             for j from 0 <= j < k:             # <<<<<<<<<<<<<<
 *                 out[i, j] = values[idx, j]
 * 
 */
      __pyx_t_15 = __pyx_v_k;
      for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_15; __pyx_v_j++) {

        /* "pandas/src/generated.pyx":2897
 *         else:
 *             for j from 0 <= j < k:
 *                 out[i, j] = values[idx, j]             # <<<<<<<<<<<<<<
 * 
 * @cython.wraparound(False)
 */
        __pyx_t_18 = __pyx_v_idx;
        __pyx_t_19 = __pyx_v_j;
        __pyx_t_20 = __pyx_v_i;
        __pyx_t_21 = __pyx_v_j;
        *((__pyx_t_5numpy_int16_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_out.data + __pyx_t_20 * __pyx_v_out.strides[0]) ) + __pyx_t_21 * __pyx_v_out.strides[1]) )) = (*((__pyx_t_5numpy_int16_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_values.data + __pyx_t_18 * __pyx_v_values.strides[0]) ) + __pyx_t_19 * __pyx_v_values.strides[1]) )));
      }
    }
    __pyx_L11:;
  }

  /* "pandas/src/generated.pyx":2856
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def take_2d_axis0_int16_int16(int16_t[:, :] values,             # <<<<<<<<<<<<<<
 *                                     ndarray[int64_t] indexer,
 *                                     int16_t[:, :] out,
 */

  /* function exit code */
  __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_pybuffernd_indexer.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas.algos.take_2d_axis0_int16_int16", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer);
  __pyx_L2:;
  __PYX_XDEC_MEMVIEW(&__pyx_v_values, 1);
  __PYX_XDEC_MEMVIEW(&__pyx_v_out, 1);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/src/generated.pyx":2901
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def take_2d_axis0_int16_int32(int16_t[:, :] values,             # <<<<<<<<<<<<<<
 *                                     ndarray[int64_t] indexer,
 *                                     int32_t[:, :] out,
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pandas_5algos_275take_2d_axis0_int16_int32(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_5algos_275take_2d_axis0_int16_int32 = {__Pyx_NAMESTR("take_2d_axis0_int16_int32"), (PyCFunction)__pyx_pw_6pandas_5algos_275take_2d_axis0_int16_int32, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pw_6pandas_5algos_275take_2d_axis0_int16_int32(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  __Pyx_memviewslice __pyx_v_values = { 0, 0, { 0 }, { 0 }, { 0 } };
  PyArrayObject *__pyx_v_indexer = 0;
  __Pyx_memviewslice __pyx_v_out = { 0, 0, { 0 }, { 0 }, { 0 } };
  PyObject *__pyx_v_fill_value = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("take_2d_axis0_int16_int32 (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_values,&__pyx_n_s_indexer,&__pyx_n_s_out,&__pyx_n_s_fill_value,0};
    PyObject* values[4] = {0,0,0,0};
    values[3] = __pyx_k__142;
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_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 (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_indexer)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("take_2d_axis0_int16_int32", 0, 3, 4, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2901; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_out)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("take_2d_axis0_int16_int32", 0, 3, 4, 2); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2901; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  3:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_fill_value);
          if (value) { values[3] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "take_2d_axis0_int16_int32") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2901; __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_values = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_int16_t(values[0]); if (unlikely(!__pyx_v_values.memview)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2901; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_v_indexer = ((PyArrayObject *)values[1]);
    __pyx_v_out = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_int32_t(values[2]); if (unlikely(!__pyx_v_out.memview)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2903; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_v_fill_value = values[3];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("take_2d_axis0_int16_int32", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2901; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas.algos.take_2d_axis0_int16_int32", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_indexer), __pyx_ptype_5numpy_ndarray, 1, "indexer", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2902; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_274take_2d_axis0_int16_int32(__pyx_self, __pyx_v_values, __pyx_v_indexer, __pyx_v_out, __pyx_v_fill_value);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pandas_5algos_274take_2d_axis0_int16_int32(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_values, PyArrayObject *__pyx_v_indexer, __Pyx_memviewslice __pyx_v_out, PyObject *__pyx_v_fill_value) {
  Py_ssize_t __pyx_v_i;
  Py_ssize_t __pyx_v_j;
  Py_ssize_t __pyx_v_k;
  Py_ssize_t __pyx_v_n;
  Py_ssize_t __pyx_v_idx;
  __pyx_t_5numpy_int32_t __pyx_v_fv;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_indexer;
  __Pyx_Buffer __pyx_pybuffer_indexer;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  Py_ssize_t __pyx_t_1;
  __pyx_t_5numpy_int32_t __pyx_t_2;
  Py_ssize_t __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;
  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;
  __Pyx_RefNannySetupContext("take_2d_axis0_int16_int32", 0);
  __pyx_pybuffer_indexer.pybuffer.buf = NULL;
  __pyx_pybuffer_indexer.refcount = 0;
  __pyx_pybuffernd_indexer.data = NULL;
  __pyx_pybuffernd_indexer.rcbuffer = &__pyx_pybuffer_indexer;
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer, (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[2]; __pyx_lineno = 2901; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_indexer.diminfo[0].strides = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_indexer.diminfo[0].shape = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.shape[0];

  /* "pandas/src/generated.pyx":2909
 *         int32_t fv
 * 
 *     n = len(indexer)             # <<<<<<<<<<<<<<
 *     k = values.shape[1]
 * 
 */
  __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_indexer)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2909; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_n = __pyx_t_1;

  /* "pandas/src/generated.pyx":2910
 * 
 *     n = len(indexer)
 *     k = values.shape[1]             # <<<<<<<<<<<<<<
 * 
 *     fv = fill_value
 */
  __pyx_v_k = (__pyx_v_values.shape[1]);

  /* "pandas/src/generated.pyx":2912
 *     k = values.shape[1]
 * 
 *     fv = fill_value             # <<<<<<<<<<<<<<
 * 
 *     IF False:
 */
  __pyx_t_2 = __Pyx_PyInt_As_npy_int32(__pyx_v_fill_value); if (unlikely((__pyx_t_2 == (npy_int32)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2912; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_fv = __pyx_t_2;

  /* "pandas/src/generated.pyx":2935
 *             return
 * 
 *     for i from 0 <= i < n:             # <<<<<<<<<<<<<<
 *         idx = indexer[i]
 *         if idx == -1:
 */
  __pyx_t_1 = __pyx_v_n;
  for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_1; __pyx_v_i++) {

    /* "pandas/src/generated.pyx":2936
 * 
 *     for i from 0 <= i < n:
 *         idx = indexer[i]             # <<<<<<<<<<<<<<
 *         if idx == -1:
 *             for j from 0 <= j < k:
 */
    __pyx_t_3 = __pyx_v_i;
    __pyx_v_idx = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_3, __pyx_pybuffernd_indexer.diminfo[0].strides));

    /* "pandas/src/generated.pyx":2937
 *     for i from 0 <= i < n:
 *         idx = indexer[i]
 *         if idx == -1:             # <<<<<<<<<<<<<<
 *             for j from 0 <= j < k:
 *                 out[i, j] = fv
 */
    __pyx_t_4 = ((__pyx_v_idx == -1) != 0);
    if (__pyx_t_4) {

      /* "pandas/src/generated.pyx":2938
 *         idx = indexer[i]
 *         if idx == -1:
 *             for j from 0 <= j < k:             # <<<<<<<<<<<<<<
 *                 out[i, j] = fv
 *         else:
 */
      __pyx_t_5 = __pyx_v_k;
      for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_5; __pyx_v_j++) {

        /* "pandas/src/generated.pyx":2939
 *         if idx == -1:
 *             for j from 0 <= j < k:
 *                 out[i, j] = fv             # <<<<<<<<<<<<<<
 *         else:
 *             for j from 0 <= j < k:
 */
        __pyx_t_6 = __pyx_v_i;
        __pyx_t_7 = __pyx_v_j;
        *((__pyx_t_5numpy_int32_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_out.data + __pyx_t_6 * __pyx_v_out.strides[0]) ) + __pyx_t_7 * __pyx_v_out.strides[1]) )) = __pyx_v_fv;
      }
      goto __pyx_L5;
    }
    /*else*/ {

      /* "pandas/src/generated.pyx":2941
 *                 out[i, j] = fv
 *         else:
 *             for j from 0 <= j < k:             # <<<<<<<<<<<<<<
 *                 out[i, j] = values[idx, j]
 * 
 */
      __pyx_t_5 = __pyx_v_k;
      for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_5; __pyx_v_j++) {

        /* "pandas/src/generated.pyx":2942
 *         else:
 *             for j from 0 <= j < k:
 *                 out[i, j] = values[idx, j]             # <<<<<<<<<<<<<<
 * 
 * @cython.wraparound(False)
 */
        __pyx_t_8 = __pyx_v_idx;
        __pyx_t_9 = __pyx_v_j;
        __pyx_t_10 = __pyx_v_i;
        __pyx_t_11 = __pyx_v_j;
        *((__pyx_t_5numpy_int32_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_out.data + __pyx_t_10 * __pyx_v_out.strides[0]) ) + __pyx_t_11 * __pyx_v_out.strides[1]) )) = (*((__pyx_t_5numpy_int16_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_values.data + __pyx_t_8 * __pyx_v_values.strides[0]) ) + __pyx_t_9 * __pyx_v_values.strides[1]) )));
      }
    }
    __pyx_L5:;
  }

  /* "pandas/src/generated.pyx":2901
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def take_2d_axis0_int16_int32(int16_t[:, :] values,             # <<<<<<<<<<<<<<
 *                                     ndarray[int64_t] indexer,
 *                                     int32_t[:, :] out,
 */

  /* function exit code */
  __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_pybuffernd_indexer.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas.algos.take_2d_axis0_int16_int32", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer);
  __pyx_L2:;
  __PYX_XDEC_MEMVIEW(&__pyx_v_values, 1);
  __PYX_XDEC_MEMVIEW(&__pyx_v_out, 1);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/src/generated.pyx":2946
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def take_2d_axis0_int16_int64(int16_t[:, :] values,             # <<<<<<<<<<<<<<
 *                                     ndarray[int64_t] indexer,
 *                                     int64_t[:, :] out,
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pandas_5algos_277take_2d_axis0_int16_int64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_5algos_277take_2d_axis0_int16_int64 = {__Pyx_NAMESTR("take_2d_axis0_int16_int64"), (PyCFunction)__pyx_pw_6pandas_5algos_277take_2d_axis0_int16_int64, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pw_6pandas_5algos_277take_2d_axis0_int16_int64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  __Pyx_memviewslice __pyx_v_values = { 0, 0, { 0 }, { 0 }, { 0 } };
  PyArrayObject *__pyx_v_indexer = 0;
  __Pyx_memviewslice __pyx_v_out = { 0, 0, { 0 }, { 0 }, { 0 } };
  PyObject *__pyx_v_fill_value = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("take_2d_axis0_int16_int64 (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_values,&__pyx_n_s_indexer,&__pyx_n_s_out,&__pyx_n_s_fill_value,0};
    PyObject* values[4] = {0,0,0,0};
    values[3] = __pyx_k__143;
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_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 (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_indexer)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("take_2d_axis0_int16_int64", 0, 3, 4, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2946; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_out)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("take_2d_axis0_int16_int64", 0, 3, 4, 2); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2946; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  3:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_fill_value);
          if (value) { values[3] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "take_2d_axis0_int16_int64") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2946; __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_values = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_int16_t(values[0]); if (unlikely(!__pyx_v_values.memview)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2946; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_v_indexer = ((PyArrayObject *)values[1]);
    __pyx_v_out = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_int64_t(values[2]); if (unlikely(!__pyx_v_out.memview)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2948; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_v_fill_value = values[3];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("take_2d_axis0_int16_int64", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2946; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas.algos.take_2d_axis0_int16_int64", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_indexer), __pyx_ptype_5numpy_ndarray, 1, "indexer", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2947; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_276take_2d_axis0_int16_int64(__pyx_self, __pyx_v_values, __pyx_v_indexer, __pyx_v_out, __pyx_v_fill_value);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pandas_5algos_276take_2d_axis0_int16_int64(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_values, PyArrayObject *__pyx_v_indexer, __Pyx_memviewslice __pyx_v_out, PyObject *__pyx_v_fill_value) {
  Py_ssize_t __pyx_v_i;
  Py_ssize_t __pyx_v_j;
  Py_ssize_t __pyx_v_k;
  Py_ssize_t __pyx_v_n;
  Py_ssize_t __pyx_v_idx;
  __pyx_t_5numpy_int64_t __pyx_v_fv;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_indexer;
  __Pyx_Buffer __pyx_pybuffer_indexer;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  Py_ssize_t __pyx_t_1;
  __pyx_t_5numpy_int64_t __pyx_t_2;
  Py_ssize_t __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;
  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;
  __Pyx_RefNannySetupContext("take_2d_axis0_int16_int64", 0);
  __pyx_pybuffer_indexer.pybuffer.buf = NULL;
  __pyx_pybuffer_indexer.refcount = 0;
  __pyx_pybuffernd_indexer.data = NULL;
  __pyx_pybuffernd_indexer.rcbuffer = &__pyx_pybuffer_indexer;
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer, (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[2]; __pyx_lineno = 2946; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_indexer.diminfo[0].strides = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_indexer.diminfo[0].shape = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.shape[0];

  /* "pandas/src/generated.pyx":2954
 *         int64_t fv
 * 
 *     n = len(indexer)             # <<<<<<<<<<<<<<
 *     k = values.shape[1]
 * 
 */
  __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_indexer)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2954; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_n = __pyx_t_1;

  /* "pandas/src/generated.pyx":2955
 * 
 *     n = len(indexer)
 *     k = values.shape[1]             # <<<<<<<<<<<<<<
 * 
 *     fv = fill_value
 */
  __pyx_v_k = (__pyx_v_values.shape[1]);

  /* "pandas/src/generated.pyx":2957
 *     k = values.shape[1]
 * 
 *     fv = fill_value             # <<<<<<<<<<<<<<
 * 
 *     IF False:
 */
  __pyx_t_2 = __Pyx_PyInt_As_npy_int64(__pyx_v_fill_value); if (unlikely((__pyx_t_2 == (npy_int64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2957; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_fv = __pyx_t_2;

  /* "pandas/src/generated.pyx":2980
 *             return
 * 
 *     for i from 0 <= i < n:             # <<<<<<<<<<<<<<
 *         idx = indexer[i]
 *         if idx == -1:
 */
  __pyx_t_1 = __pyx_v_n;
  for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_1; __pyx_v_i++) {

    /* "pandas/src/generated.pyx":2981
 * 
 *     for i from 0 <= i < n:
 *         idx = indexer[i]             # <<<<<<<<<<<<<<
 *         if idx == -1:
 *             for j from 0 <= j < k:
 */
    __pyx_t_3 = __pyx_v_i;
    __pyx_v_idx = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_3, __pyx_pybuffernd_indexer.diminfo[0].strides));

    /* "pandas/src/generated.pyx":2982
 *     for i from 0 <= i < n:
 *         idx = indexer[i]
 *         if idx == -1:             # <<<<<<<<<<<<<<
 *             for j from 0 <= j < k:
 *                 out[i, j] = fv
 */
    __pyx_t_4 = ((__pyx_v_idx == -1) != 0);
    if (__pyx_t_4) {

      /* "pandas/src/generated.pyx":2983
 *         idx = indexer[i]
 *         if idx == -1:
 *             for j from 0 <= j < k:             # <<<<<<<<<<<<<<
 *                 out[i, j] = fv
 *         else:
 */
      __pyx_t_5 = __pyx_v_k;
      for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_5; __pyx_v_j++) {

        /* "pandas/src/generated.pyx":2984
 *         if idx == -1:
 *             for j from 0 <= j < k:
 *                 out[i, j] = fv             # <<<<<<<<<<<<<<
 *         else:
 *             for j from 0 <= j < k:
 */
        __pyx_t_6 = __pyx_v_i;
        __pyx_t_7 = __pyx_v_j;
        *((__pyx_t_5numpy_int64_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_out.data + __pyx_t_6 * __pyx_v_out.strides[0]) ) + __pyx_t_7 * __pyx_v_out.strides[1]) )) = __pyx_v_fv;
      }
      goto __pyx_L5;
    }
    /*else*/ {

      /* "pandas/src/generated.pyx":2986
 *                 out[i, j] = fv
 *         else:
 *             for j from 0 <= j < k:             # <<<<<<<<<<<<<<
 *                 out[i, j] = values[idx, j]
 * 
 */
      __pyx_t_5 = __pyx_v_k;
      for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_5; __pyx_v_j++) {

        /* "pandas/src/generated.pyx":2987
 *         else:
 *             for j from 0 <= j < k:
 *                 out[i, j] = values[idx, j]             # <<<<<<<<<<<<<<
 * 
 * @cython.wraparound(False)
 */
        __pyx_t_8 = __pyx_v_idx;
        __pyx_t_9 = __pyx_v_j;
        __pyx_t_10 = __pyx_v_i;
        __pyx_t_11 = __pyx_v_j;
        *((__pyx_t_5numpy_int64_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_out.data + __pyx_t_10 * __pyx_v_out.strides[0]) ) + __pyx_t_11 * __pyx_v_out.strides[1]) )) = (*((__pyx_t_5numpy_int16_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_values.data + __pyx_t_8 * __pyx_v_values.strides[0]) ) + __pyx_t_9 * __pyx_v_values.strides[1]) )));
      }
    }
    __pyx_L5:;
  }

  /* "pandas/src/generated.pyx":2946
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def take_2d_axis0_int16_int64(int16_t[:, :] values,             # <<<<<<<<<<<<<<
 *                                     ndarray[int64_t] indexer,
 *                                     int64_t[:, :] out,
 */

  /* function exit code */
  __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_pybuffernd_indexer.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas.algos.take_2d_axis0_int16_int64", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer);
  __pyx_L2:;
  __PYX_XDEC_MEMVIEW(&__pyx_v_values, 1);
  __PYX_XDEC_MEMVIEW(&__pyx_v_out, 1);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/src/generated.pyx":2991
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def take_2d_axis0_int16_float64(int16_t[:, :] values,             # <<<<<<<<<<<<<<
 *                                     ndarray[int64_t] indexer,
 *                                     float64_t[:, :] out,
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pandas_5algos_279take_2d_axis0_int16_float64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_5algos_279take_2d_axis0_int16_float64 = {__Pyx_NAMESTR("take_2d_axis0_int16_float64"), (PyCFunction)__pyx_pw_6pandas_5algos_279take_2d_axis0_int16_float64, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pw_6pandas_5algos_279take_2d_axis0_int16_float64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  __Pyx_memviewslice __pyx_v_values = { 0, 0, { 0 }, { 0 }, { 0 } };
  PyArrayObject *__pyx_v_indexer = 0;
  __Pyx_memviewslice __pyx_v_out = { 0, 0, { 0 }, { 0 }, { 0 } };
  PyObject *__pyx_v_fill_value = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("take_2d_axis0_int16_float64 (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_values,&__pyx_n_s_indexer,&__pyx_n_s_out,&__pyx_n_s_fill_value,0};
    PyObject* values[4] = {0,0,0,0};
    values[3] = __pyx_k__144;
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_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 (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_indexer)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("take_2d_axis0_int16_float64", 0, 3, 4, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2991; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_out)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("take_2d_axis0_int16_float64", 0, 3, 4, 2); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2991; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  3:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_fill_value);
          if (value) { values[3] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "take_2d_axis0_int16_float64") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2991; __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_values = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_int16_t(values[0]); if (unlikely(!__pyx_v_values.memview)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2991; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_v_indexer = ((PyArrayObject *)values[1]);
    __pyx_v_out = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_float64_t(values[2]); if (unlikely(!__pyx_v_out.memview)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2993; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_v_fill_value = values[3];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("take_2d_axis0_int16_float64", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2991; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas.algos.take_2d_axis0_int16_float64", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_indexer), __pyx_ptype_5numpy_ndarray, 1, "indexer", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2992; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_278take_2d_axis0_int16_float64(__pyx_self, __pyx_v_values, __pyx_v_indexer, __pyx_v_out, __pyx_v_fill_value);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pandas_5algos_278take_2d_axis0_int16_float64(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_values, PyArrayObject *__pyx_v_indexer, __Pyx_memviewslice __pyx_v_out, PyObject *__pyx_v_fill_value) {
  Py_ssize_t __pyx_v_i;
  Py_ssize_t __pyx_v_j;
  Py_ssize_t __pyx_v_k;
  Py_ssize_t __pyx_v_n;
  Py_ssize_t __pyx_v_idx;
  __pyx_t_5numpy_float64_t __pyx_v_fv;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_indexer;
  __Pyx_Buffer __pyx_pybuffer_indexer;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  Py_ssize_t __pyx_t_1;
  __pyx_t_5numpy_float64_t __pyx_t_2;
  Py_ssize_t __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;
  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;
  __Pyx_RefNannySetupContext("take_2d_axis0_int16_float64", 0);
  __pyx_pybuffer_indexer.pybuffer.buf = NULL;
  __pyx_pybuffer_indexer.refcount = 0;
  __pyx_pybuffernd_indexer.data = NULL;
  __pyx_pybuffernd_indexer.rcbuffer = &__pyx_pybuffer_indexer;
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer, (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[2]; __pyx_lineno = 2991; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_indexer.diminfo[0].strides = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_indexer.diminfo[0].shape = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.shape[0];

  /* "pandas/src/generated.pyx":2999
 *         float64_t fv
 * 
 *     n = len(indexer)             # <<<<<<<<<<<<<<
 *     k = values.shape[1]
 * 
 */
  __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_indexer)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2999; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_n = __pyx_t_1;

  /* "pandas/src/generated.pyx":3000
 * 
 *     n = len(indexer)
 *     k = values.shape[1]             # <<<<<<<<<<<<<<
 * 
 *     fv = fill_value
 */
  __pyx_v_k = (__pyx_v_values.shape[1]);

  /* "pandas/src/generated.pyx":3002
 *     k = values.shape[1]
 * 
 *     fv = fill_value             # <<<<<<<<<<<<<<
 * 
 *     IF False:
 */
  __pyx_t_2 = __pyx_PyFloat_AsDouble(__pyx_v_fill_value); if (unlikely((__pyx_t_2 == (npy_float64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3002; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_fv = __pyx_t_2;

  /* "pandas/src/generated.pyx":3025
 *             return
 * 
 *     for i from 0 <= i < n:             # <<<<<<<<<<<<<<
 *         idx = indexer[i]
 *         if idx == -1:
 */
  __pyx_t_1 = __pyx_v_n;
  for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_1; __pyx_v_i++) {

    /* "pandas/src/generated.pyx":3026
 * 
 *     for i from 0 <= i < n:
 *         idx = indexer[i]             # <<<<<<<<<<<<<<
 *         if idx == -1:
 *             for j from 0 <= j < k:
 */
    __pyx_t_3 = __pyx_v_i;
    __pyx_v_idx = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_3, __pyx_pybuffernd_indexer.diminfo[0].strides));

    /* "pandas/src/generated.pyx":3027
 *     for i from 0 <= i < n:
 *         idx = indexer[i]
 *         if idx == -1:             # <<<<<<<<<<<<<<
 *             for j from 0 <= j < k:
 *                 out[i, j] = fv
 */
    __pyx_t_4 = ((__pyx_v_idx == -1) != 0);
    if (__pyx_t_4) {

      /* "pandas/src/generated.pyx":3028
 *         idx = indexer[i]
 *         if idx == -1:
 *             for j from 0 <= j < k:             # <<<<<<<<<<<<<<
 *                 out[i, j] = fv
 *         else:
 */
      __pyx_t_5 = __pyx_v_k;
      for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_5; __pyx_v_j++) {

        /* "pandas/src/generated.pyx":3029
 *         if idx == -1:
 *             for j from 0 <= j < k:
 *                 out[i, j] = fv             # <<<<<<<<<<<<<<
 *         else:
 *             for j from 0 <= j < k:
 */
        __pyx_t_6 = __pyx_v_i;
        __pyx_t_7 = __pyx_v_j;
        *((__pyx_t_5numpy_float64_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_out.data + __pyx_t_6 * __pyx_v_out.strides[0]) ) + __pyx_t_7 * __pyx_v_out.strides[1]) )) = __pyx_v_fv;
      }
      goto __pyx_L5;
    }
    /*else*/ {

      /* "pandas/src/generated.pyx":3031
 *                 out[i, j] = fv
 *         else:
 *             for j from 0 <= j < k:             # <<<<<<<<<<<<<<
 *                 out[i, j] = values[idx, j]
 * 
 */
      __pyx_t_5 = __pyx_v_k;
      for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_5; __pyx_v_j++) {

        /* "pandas/src/generated.pyx":3032
 *         else:
 *             for j from 0 <= j < k:
 *                 out[i, j] = values[idx, j]             # <<<<<<<<<<<<<<
 * 
 * @cython.wraparound(False)
 */
        __pyx_t_8 = __pyx_v_idx;
        __pyx_t_9 = __pyx_v_j;
        __pyx_t_10 = __pyx_v_i;
        __pyx_t_11 = __pyx_v_j;
        *((__pyx_t_5numpy_float64_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_out.data + __pyx_t_10 * __pyx_v_out.strides[0]) ) + __pyx_t_11 * __pyx_v_out.strides[1]) )) = (*((__pyx_t_5numpy_int16_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_values.data + __pyx_t_8 * __pyx_v_values.strides[0]) ) + __pyx_t_9 * __pyx_v_values.strides[1]) )));
      }
    }
    __pyx_L5:;
  }

  /* "pandas/src/generated.pyx":2991
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def take_2d_axis0_int16_float64(int16_t[:, :] values,             # <<<<<<<<<<<<<<
 *                                     ndarray[int64_t] indexer,
 *                                     float64_t[:, :] out,
 */

  /* function exit code */
  __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_pybuffernd_indexer.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas.algos.take_2d_axis0_int16_float64", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer);
  __pyx_L2:;
  __PYX_XDEC_MEMVIEW(&__pyx_v_values, 1);
  __PYX_XDEC_MEMVIEW(&__pyx_v_out, 1);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/src/generated.pyx":3036
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def take_2d_axis0_int32_int32(int32_t[:, :] values,             # <<<<<<<<<<<<<<
 *                                     ndarray[int64_t] indexer,
 *                                     int32_t[:, :] out,
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pandas_5algos_281take_2d_axis0_int32_int32(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_5algos_281take_2d_axis0_int32_int32 = {__Pyx_NAMESTR("take_2d_axis0_int32_int32"), (PyCFunction)__pyx_pw_6pandas_5algos_281take_2d_axis0_int32_int32, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pw_6pandas_5algos_281take_2d_axis0_int32_int32(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  __Pyx_memviewslice __pyx_v_values = { 0, 0, { 0 }, { 0 }, { 0 } };
  PyArrayObject *__pyx_v_indexer = 0;
  __Pyx_memviewslice __pyx_v_out = { 0, 0, { 0 }, { 0 }, { 0 } };
  PyObject *__pyx_v_fill_value = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("take_2d_axis0_int32_int32 (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_values,&__pyx_n_s_indexer,&__pyx_n_s_out,&__pyx_n_s_fill_value,0};
    PyObject* values[4] = {0,0,0,0};
    values[3] = __pyx_k__145;
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_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 (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_indexer)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("take_2d_axis0_int32_int32", 0, 3, 4, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3036; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_out)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("take_2d_axis0_int32_int32", 0, 3, 4, 2); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3036; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  3:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_fill_value);
          if (value) { values[3] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "take_2d_axis0_int32_int32") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3036; __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_values = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_int32_t(values[0]); if (unlikely(!__pyx_v_values.memview)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3036; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_v_indexer = ((PyArrayObject *)values[1]);
    __pyx_v_out = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_int32_t(values[2]); if (unlikely(!__pyx_v_out.memview)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3038; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_v_fill_value = values[3];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("take_2d_axis0_int32_int32", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3036; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas.algos.take_2d_axis0_int32_int32", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_indexer), __pyx_ptype_5numpy_ndarray, 1, "indexer", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3037; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_280take_2d_axis0_int32_int32(__pyx_self, __pyx_v_values, __pyx_v_indexer, __pyx_v_out, __pyx_v_fill_value);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pandas_5algos_280take_2d_axis0_int32_int32(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_values, PyArrayObject *__pyx_v_indexer, __Pyx_memviewslice __pyx_v_out, PyObject *__pyx_v_fill_value) {
  Py_ssize_t __pyx_v_i;
  Py_ssize_t __pyx_v_j;
  Py_ssize_t __pyx_v_k;
  Py_ssize_t __pyx_v_n;
  Py_ssize_t __pyx_v_idx;
  __pyx_t_5numpy_int32_t __pyx_v_fv;
  __pyx_t_5numpy_int32_t *__pyx_v_v;
  __pyx_t_5numpy_int32_t *__pyx_v_o;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_indexer;
  __Pyx_Buffer __pyx_pybuffer_indexer;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  Py_ssize_t __pyx_t_1;
  __pyx_t_5numpy_int32_t __pyx_t_2;
  int __pyx_t_3;
  int __pyx_t_4;
  int __pyx_t_5;
  int __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;
  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;
  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_axis0_int32_int32", 0);
  __pyx_pybuffer_indexer.pybuffer.buf = NULL;
  __pyx_pybuffer_indexer.refcount = 0;
  __pyx_pybuffernd_indexer.data = NULL;
  __pyx_pybuffernd_indexer.rcbuffer = &__pyx_pybuffer_indexer;
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer, (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[2]; __pyx_lineno = 3036; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_indexer.diminfo[0].strides = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_indexer.diminfo[0].shape = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.shape[0];

  /* "pandas/src/generated.pyx":3044
 *         int32_t fv
 * 
 *     n = len(indexer)             # <<<<<<<<<<<<<<
 *     k = values.shape[1]
 * 
 */
  __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_indexer)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3044; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_n = __pyx_t_1;

  /* "pandas/src/generated.pyx":3045
 * 
 *     n = len(indexer)
 *     k = values.shape[1]             # <<<<<<<<<<<<<<
 * 
 *     fv = fill_value
 */
  __pyx_v_k = (__pyx_v_values.shape[1]);

  /* "pandas/src/generated.pyx":3047
 *     k = values.shape[1]
 * 
 *     fv = fill_value             # <<<<<<<<<<<<<<
 * 
 *     IF True:
 */
  __pyx_t_2 = __Pyx_PyInt_As_npy_int32(__pyx_v_fill_value); if (unlikely((__pyx_t_2 == (npy_int32)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3047; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_fv = __pyx_t_2;

  /* "pandas/src/generated.pyx":3055
 * 
 *         #GH3130
 *         if (values.strides[1] == out.strides[1] and             # <<<<<<<<<<<<<<
 *             values.strides[1] == sizeof(int32_t) and
 *             sizeof(int32_t) * n >= 256):
 */
  __pyx_t_3 = (((__pyx_v_values.strides[1]) == (__pyx_v_out.strides[1])) != 0);
  if (__pyx_t_3) {

    /* "pandas/src/generated.pyx":3056
 *         #GH3130
 *         if (values.strides[1] == out.strides[1] and
 *             values.strides[1] == sizeof(int32_t) and             # <<<<<<<<<<<<<<
 *             sizeof(int32_t) * n >= 256):
 * 
 */
    __pyx_t_4 = (((__pyx_v_values.strides[1]) == (sizeof(__pyx_t_5numpy_int32_t))) != 0);
    if (__pyx_t_4) {

      /* "pandas/src/generated.pyx":3057
 *         if (values.strides[1] == out.strides[1] and
 *             values.strides[1] == sizeof(int32_t) and
 *             sizeof(int32_t) * n >= 256):             # <<<<<<<<<<<<<<
 * 
 *             for i from 0 <= i < n:
 */
      __pyx_t_5 = ((((sizeof(__pyx_t_5numpy_int32_t)) * __pyx_v_n) >= 256) != 0);
      __pyx_t_6 = __pyx_t_5;
    } else {
      __pyx_t_6 = __pyx_t_4;
    }
    __pyx_t_4 = __pyx_t_6;
  } else {
    __pyx_t_4 = __pyx_t_3;
  }
  if (__pyx_t_4) {

    /* "pandas/src/generated.pyx":3059
 *             sizeof(int32_t) * n >= 256):
 * 
 *             for i from 0 <= i < n:             # <<<<<<<<<<<<<<
 *                 idx = indexer[i]
 *                 if idx == -1:
 */
    __pyx_t_1 = __pyx_v_n;
    for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_1; __pyx_v_i++) {

      /* "pandas/src/generated.pyx":3060
 * 
 *             for i from 0 <= i < n:
 *                 idx = indexer[i]             # <<<<<<<<<<<<<<
 *                 if idx == -1:
 *                     for j from 0 <= j < k:
 */
      __pyx_t_7 = __pyx_v_i;
      __pyx_v_idx = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_7, __pyx_pybuffernd_indexer.diminfo[0].strides));

      /* "pandas/src/generated.pyx":3061
 *             for i from 0 <= i < n:
 *                 idx = indexer[i]
 *                 if idx == -1:             # <<<<<<<<<<<<<<
 *                     for j from 0 <= j < k:
 *                         out[i, j] = fv
 */
      __pyx_t_4 = ((__pyx_v_idx == -1) != 0);
      if (__pyx_t_4) {

        /* "pandas/src/generated.pyx":3062
 *                 idx = indexer[i]
 *                 if idx == -1:
 *                     for j from 0 <= j < k:             # <<<<<<<<<<<<<<
 *                         out[i, j] = fv
 *                 else:
 */
        __pyx_t_8 = __pyx_v_k;
        for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_8; __pyx_v_j++) {

          /* "pandas/src/generated.pyx":3063
 *                 if idx == -1:
 *                     for j from 0 <= j < k:
 *                         out[i, j] = fv             # <<<<<<<<<<<<<<
 *                 else:
 *                     v = &values[idx, 0]
 */
          __pyx_t_9 = __pyx_v_i;
          __pyx_t_10 = __pyx_v_j;
          *((__pyx_t_5numpy_int32_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_out.data + __pyx_t_9 * __pyx_v_out.strides[0]) ) + __pyx_t_10 * __pyx_v_out.strides[1]) )) = __pyx_v_fv;
        }
        goto __pyx_L6;
      }
      /*else*/ {

        /* "pandas/src/generated.pyx":3065
 *                         out[i, j] = fv
 *                 else:
 *                     v = &values[idx, 0]             # <<<<<<<<<<<<<<
 *                     o = &out[i, 0]
 *                     memmove(o, v, <size_t>(sizeof(int32_t) * k))
 */
        __pyx_t_8 = __pyx_v_idx;
        __pyx_t_11 = 0;
        __pyx_v_v = (&(*((__pyx_t_5numpy_int32_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_values.data + __pyx_t_8 * __pyx_v_values.strides[0]) ) + __pyx_t_11 * __pyx_v_values.strides[1]) ))));

        /* "pandas/src/generated.pyx":3066
 *                 else:
 *                     v = &values[idx, 0]
 *                     o = &out[i, 0]             # <<<<<<<<<<<<<<
 *                     memmove(o, v, <size_t>(sizeof(int32_t) * k))
 *             return
 */
        __pyx_t_12 = __pyx_v_i;
        __pyx_t_13 = 0;
        __pyx_v_o = (&(*((__pyx_t_5numpy_int32_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_out.data + __pyx_t_12 * __pyx_v_out.strides[0]) ) + __pyx_t_13 * __pyx_v_out.strides[1]) ))));

        /* "pandas/src/generated.pyx":3067
 *                     v = &values[idx, 0]
 *                     o = &out[i, 0]
 *                     memmove(o, v, <size_t>(sizeof(int32_t) * k))             # <<<<<<<<<<<<<<
 *             return
 * 
 */
        memmove(__pyx_v_o, __pyx_v_v, ((size_t)((sizeof(__pyx_t_5numpy_int32_t)) * __pyx_v_k)));
      }
      __pyx_L6:;
    }

    /* "pandas/src/generated.pyx":3068
 *                     o = &out[i, 0]
 *                     memmove(o, v, <size_t>(sizeof(int32_t) * k))
 *             return             # <<<<<<<<<<<<<<
 * 
 *     for i from 0 <= i < n:
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_r = Py_None; __Pyx_INCREF(Py_None);
    goto __pyx_L0;
  }

  /* "pandas/src/generated.pyx":3070
 *             return
 * 
 *     for i from 0 <= i < n:             # <<<<<<<<<<<<<<
 *         idx = indexer[i]
 *         if idx == -1:
 */
  __pyx_t_1 = __pyx_v_n;
  for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_1; __pyx_v_i++) {

    /* "pandas/src/generated.pyx":3071
 * 
 *     for i from 0 <= i < n:
 *         idx = indexer[i]             # <<<<<<<<<<<<<<
 *         if idx == -1:
 *             for j from 0 <= j < k:
 */
    __pyx_t_14 = __pyx_v_i;
    __pyx_v_idx = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_indexer.diminfo[0].strides));

    /* "pandas/src/generated.pyx":3072
 *     for i from 0 <= i < n:
 *         idx = indexer[i]
 *         if idx == -1:             # <<<<<<<<<<<<<<
 *             for j from 0 <= j < k:
 *                 out[i, j] = fv
 */
    __pyx_t_4 = ((__pyx_v_idx == -1) != 0);
    if (__pyx_t_4) {

      /* "pandas/src/generated.pyx":3073
 *         idx = indexer[i]
 *         if idx == -1:
 *             for j from 0 <= j < k:             # <<<<<<<<<<<<<<
 *                 out[i, j] = fv
 *         else:
 */
      __pyx_t_15 = __pyx_v_k;
      for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_15; __pyx_v_j++) {

        /* "pandas/src/generated.pyx":3074
 *         if idx == -1:
 *             for j from 0 <= j < k:
 *                 out[i, j] = fv             # <<<<<<<<<<<<<<
 *         else:
 *             for j from 0 <= j < k:
 */
        __pyx_t_16 = __pyx_v_i;
        __pyx_t_17 = __pyx_v_j;
        *((__pyx_t_5numpy_int32_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_out.data + __pyx_t_16 * __pyx_v_out.strides[0]) ) + __pyx_t_17 * __pyx_v_out.strides[1]) )) = __pyx_v_fv;
      }
      goto __pyx_L11;
    }
    /*else*/ {

      /* "pandas/src/generated.pyx":3076
 *                 out[i, j] = fv
 *         else:
 *             for j from 0 <= j < k:             # <<<<<<<<<<<<<<
 *                 out[i, j] = values[idx, j]
 * 
 */
      __pyx_t_15 = __pyx_v_k;
      for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_15; __pyx_v_j++) {

        /* "pandas/src/generated.pyx":3077
 *         else:
 *             for j from 0 <= j < k:
 *                 out[i, j] = values[idx, j]             # <<<<<<<<<<<<<<
 * 
 * @cython.wraparound(False)
 */
        __pyx_t_18 = __pyx_v_idx;
        __pyx_t_19 = __pyx_v_j;
        __pyx_t_20 = __pyx_v_i;
        __pyx_t_21 = __pyx_v_j;
        *((__pyx_t_5numpy_int32_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_out.data + __pyx_t_20 * __pyx_v_out.strides[0]) ) + __pyx_t_21 * __pyx_v_out.strides[1]) )) = (*((__pyx_t_5numpy_int32_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_values.data + __pyx_t_18 * __pyx_v_values.strides[0]) ) + __pyx_t_19 * __pyx_v_values.strides[1]) )));
      }
    }
    __pyx_L11:;
  }

  /* "pandas/src/generated.pyx":3036
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def take_2d_axis0_int32_int32(int32_t[:, :] values,             # <<<<<<<<<<<<<<
 *                                     ndarray[int64_t] indexer,
 *                                     int32_t[:, :] out,
 */

  /* function exit code */
  __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_pybuffernd_indexer.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas.algos.take_2d_axis0_int32_int32", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer);
  __pyx_L2:;
  __PYX_XDEC_MEMVIEW(&__pyx_v_values, 1);
  __PYX_XDEC_MEMVIEW(&__pyx_v_out, 1);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/src/generated.pyx":3081
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def take_2d_axis0_int32_int64(int32_t[:, :] values,             # <<<<<<<<<<<<<<
 *                                     ndarray[int64_t] indexer,
 *                                     int64_t[:, :] out,
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pandas_5algos_283take_2d_axis0_int32_int64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_5algos_283take_2d_axis0_int32_int64 = {__Pyx_NAMESTR("take_2d_axis0_int32_int64"), (PyCFunction)__pyx_pw_6pandas_5algos_283take_2d_axis0_int32_int64, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pw_6pandas_5algos_283take_2d_axis0_int32_int64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  __Pyx_memviewslice __pyx_v_values = { 0, 0, { 0 }, { 0 }, { 0 } };
  PyArrayObject *__pyx_v_indexer = 0;
  __Pyx_memviewslice __pyx_v_out = { 0, 0, { 0 }, { 0 }, { 0 } };
  PyObject *__pyx_v_fill_value = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("take_2d_axis0_int32_int64 (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_values,&__pyx_n_s_indexer,&__pyx_n_s_out,&__pyx_n_s_fill_value,0};
    PyObject* values[4] = {0,0,0,0};
    values[3] = __pyx_k__146;
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_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 (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_indexer)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("take_2d_axis0_int32_int64", 0, 3, 4, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3081; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_out)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("take_2d_axis0_int32_int64", 0, 3, 4, 2); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3081; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  3:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_fill_value);
          if (value) { values[3] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "take_2d_axis0_int32_int64") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3081; __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_values = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_int32_t(values[0]); if (unlikely(!__pyx_v_values.memview)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3081; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_v_indexer = ((PyArrayObject *)values[1]);
    __pyx_v_out = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_int64_t(values[2]); if (unlikely(!__pyx_v_out.memview)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3083; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_v_fill_value = values[3];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("take_2d_axis0_int32_int64", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3081; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas.algos.take_2d_axis0_int32_int64", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_indexer), __pyx_ptype_5numpy_ndarray, 1, "indexer", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3082; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_282take_2d_axis0_int32_int64(__pyx_self, __pyx_v_values, __pyx_v_indexer, __pyx_v_out, __pyx_v_fill_value);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pandas_5algos_282take_2d_axis0_int32_int64(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_values, PyArrayObject *__pyx_v_indexer, __Pyx_memviewslice __pyx_v_out, PyObject *__pyx_v_fill_value) {
  Py_ssize_t __pyx_v_i;
  Py_ssize_t __pyx_v_j;
  Py_ssize_t __pyx_v_k;
  Py_ssize_t __pyx_v_n;
  Py_ssize_t __pyx_v_idx;
  __pyx_t_5numpy_int64_t __pyx_v_fv;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_indexer;
  __Pyx_Buffer __pyx_pybuffer_indexer;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  Py_ssize_t __pyx_t_1;
  __pyx_t_5numpy_int64_t __pyx_t_2;
  Py_ssize_t __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;
  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;
  __Pyx_RefNannySetupContext("take_2d_axis0_int32_int64", 0);
  __pyx_pybuffer_indexer.pybuffer.buf = NULL;
  __pyx_pybuffer_indexer.refcount = 0;
  __pyx_pybuffernd_indexer.data = NULL;
  __pyx_pybuffernd_indexer.rcbuffer = &__pyx_pybuffer_indexer;
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer, (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[2]; __pyx_lineno = 3081; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_indexer.diminfo[0].strides = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_indexer.diminfo[0].shape = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.shape[0];

  /* "pandas/src/generated.pyx":3089
 *         int64_t fv
 * 
 *     n = len(indexer)             # <<<<<<<<<<<<<<
 *     k = values.shape[1]
 * 
 */
  __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_indexer)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3089; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_n = __pyx_t_1;

  /* "pandas/src/generated.pyx":3090
 * 
 *     n = len(indexer)
 *     k = values.shape[1]             # <<<<<<<<<<<<<<
 * 
 *     fv = fill_value
 */
  __pyx_v_k = (__pyx_v_values.shape[1]);

  /* "pandas/src/generated.pyx":3092
 *     k = values.shape[1]
 * 
 *     fv = fill_value             # <<<<<<<<<<<<<<
 * 
 *     IF False:
 */
  __pyx_t_2 = __Pyx_PyInt_As_npy_int64(__pyx_v_fill_value); if (unlikely((__pyx_t_2 == (npy_int64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3092; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_fv = __pyx_t_2;

  /* "pandas/src/generated.pyx":3115
 *             return
 * 
 *     for i from 0 <= i < n:             # <<<<<<<<<<<<<<
 *         idx = indexer[i]
 *         if idx == -1:
 */
  __pyx_t_1 = __pyx_v_n;
  for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_1; __pyx_v_i++) {

    /* "pandas/src/generated.pyx":3116
 * 
 *     for i from 0 <= i < n:
 *         idx = indexer[i]             # <<<<<<<<<<<<<<
 *         if idx == -1:
 *             for j from 0 <= j < k:
 */
    __pyx_t_3 = __pyx_v_i;
    __pyx_v_idx = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_3, __pyx_pybuffernd_indexer.diminfo[0].strides));

    /* "pandas/src/generated.pyx":3117
 *     for i from 0 <= i < n:
 *         idx = indexer[i]
 *         if idx == -1:             # <<<<<<<<<<<<<<
 *             for j from 0 <= j < k:
 *                 out[i, j] = fv
 */
    __pyx_t_4 = ((__pyx_v_idx == -1) != 0);
    if (__pyx_t_4) {

      /* "pandas/src/generated.pyx":3118
 *         idx = indexer[i]
 *         if idx == -1:
 *             for j from 0 <= j < k:             # <<<<<<<<<<<<<<
 *                 out[i, j] = fv
 *         else:
 */
      __pyx_t_5 = __pyx_v_k;
      for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_5; __pyx_v_j++) {

        /* "pandas/src/generated.pyx":3119
 *         if idx == -1:
 *             for j from 0 <= j < k:
 *                 out[i, j] = fv             # <<<<<<<<<<<<<<
 *         else:
 *             for j from 0 <= j < k:
 */
        __pyx_t_6 = __pyx_v_i;
        __pyx_t_7 = __pyx_v_j;
        *((__pyx_t_5numpy_int64_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_out.data + __pyx_t_6 * __pyx_v_out.strides[0]) ) + __pyx_t_7 * __pyx_v_out.strides[1]) )) = __pyx_v_fv;
      }
      goto __pyx_L5;
    }
    /*else*/ {

      /* "pandas/src/generated.pyx":3121
 *                 out[i, j] = fv
 *         else:
 *             for j from 0 <= j < k:             # <<<<<<<<<<<<<<
 *                 out[i, j] = values[idx, j]
 * 
 */
      __pyx_t_5 = __pyx_v_k;
      for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_5; __pyx_v_j++) {

        /* "pandas/src/generated.pyx":3122
 *         else:
 *             for j from 0 <= j < k:
 *                 out[i, j] = values[idx, j]             # <<<<<<<<<<<<<<
 * 
 * @cython.wraparound(False)
 */
        __pyx_t_8 = __pyx_v_idx;
        __pyx_t_9 = __pyx_v_j;
        __pyx_t_10 = __pyx_v_i;
        __pyx_t_11 = __pyx_v_j;
        *((__pyx_t_5numpy_int64_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_out.data + __pyx_t_10 * __pyx_v_out.strides[0]) ) + __pyx_t_11 * __pyx_v_out.strides[1]) )) = (*((__pyx_t_5numpy_int32_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_values.data + __pyx_t_8 * __pyx_v_values.strides[0]) ) + __pyx_t_9 * __pyx_v_values.strides[1]) )));
      }
    }
    __pyx_L5:;
  }

  /* "pandas/src/generated.pyx":3081
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def take_2d_axis0_int32_int64(int32_t[:, :] values,             # <<<<<<<<<<<<<<
 *                                     ndarray[int64_t] indexer,
 *                                     int64_t[:, :] out,
 */

  /* function exit code */
  __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_pybuffernd_indexer.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas.algos.take_2d_axis0_int32_int64", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer);
  __pyx_L2:;
  __PYX_XDEC_MEMVIEW(&__pyx_v_values, 1);
  __PYX_XDEC_MEMVIEW(&__pyx_v_out, 1);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/src/generated.pyx":3126
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def take_2d_axis0_int32_float64(int32_t[:, :] values,             # <<<<<<<<<<<<<<
 *                                     ndarray[int64_t] indexer,
 *                                     float64_t[:, :] out,
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pandas_5algos_285take_2d_axis0_int32_float64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_5algos_285take_2d_axis0_int32_float64 = {__Pyx_NAMESTR("take_2d_axis0_int32_float64"), (PyCFunction)__pyx_pw_6pandas_5algos_285take_2d_axis0_int32_float64, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pw_6pandas_5algos_285take_2d_axis0_int32_float64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  __Pyx_memviewslice __pyx_v_values = { 0, 0, { 0 }, { 0 }, { 0 } };
  PyArrayObject *__pyx_v_indexer = 0;
  __Pyx_memviewslice __pyx_v_out = { 0, 0, { 0 }, { 0 }, { 0 } };
  PyObject *__pyx_v_fill_value = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("take_2d_axis0_int32_float64 (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_values,&__pyx_n_s_indexer,&__pyx_n_s_out,&__pyx_n_s_fill_value,0};
    PyObject* values[4] = {0,0,0,0};
    values[3] = __pyx_k__147;
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_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 (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_indexer)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("take_2d_axis0_int32_float64", 0, 3, 4, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3126; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_out)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("take_2d_axis0_int32_float64", 0, 3, 4, 2); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3126; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  3:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_fill_value);
          if (value) { values[3] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "take_2d_axis0_int32_float64") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3126; __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_values = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_int32_t(values[0]); if (unlikely(!__pyx_v_values.memview)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3126; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_v_indexer = ((PyArrayObject *)values[1]);
    __pyx_v_out = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_float64_t(values[2]); if (unlikely(!__pyx_v_out.memview)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3128; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_v_fill_value = values[3];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("take_2d_axis0_int32_float64", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3126; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas.algos.take_2d_axis0_int32_float64", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_indexer), __pyx_ptype_5numpy_ndarray, 1, "indexer", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3127; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_284take_2d_axis0_int32_float64(__pyx_self, __pyx_v_values, __pyx_v_indexer, __pyx_v_out, __pyx_v_fill_value);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pandas_5algos_284take_2d_axis0_int32_float64(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_values, PyArrayObject *__pyx_v_indexer, __Pyx_memviewslice __pyx_v_out, PyObject *__pyx_v_fill_value) {
  Py_ssize_t __pyx_v_i;
  Py_ssize_t __pyx_v_j;
  Py_ssize_t __pyx_v_k;
  Py_ssize_t __pyx_v_n;
  Py_ssize_t __pyx_v_idx;
  __pyx_t_5numpy_float64_t __pyx_v_fv;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_indexer;
  __Pyx_Buffer __pyx_pybuffer_indexer;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  Py_ssize_t __pyx_t_1;
  __pyx_t_5numpy_float64_t __pyx_t_2;
  Py_ssize_t __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;
  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;
  __Pyx_RefNannySetupContext("take_2d_axis0_int32_float64", 0);
  __pyx_pybuffer_indexer.pybuffer.buf = NULL;
  __pyx_pybuffer_indexer.refcount = 0;
  __pyx_pybuffernd_indexer.data = NULL;
  __pyx_pybuffernd_indexer.rcbuffer = &__pyx_pybuffer_indexer;
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer, (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[2]; __pyx_lineno = 3126; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_indexer.diminfo[0].strides = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_indexer.diminfo[0].shape = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.shape[0];

  /* "pandas/src/generated.pyx":3134
 *         float64_t fv
 * 
 *     n = len(indexer)             # <<<<<<<<<<<<<<
 *     k = values.shape[1]
 * 
 */
  __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_indexer)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3134; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_n = __pyx_t_1;

  /* "pandas/src/generated.pyx":3135
 * 
 *     n = len(indexer)
 *     k = values.shape[1]             # <<<<<<<<<<<<<<
 * 
 *     fv = fill_value
 */
  __pyx_v_k = (__pyx_v_values.shape[1]);

  /* "pandas/src/generated.pyx":3137
 *     k = values.shape[1]
 * 
 *     fv = fill_value             # <<<<<<<<<<<<<<
 * 
 *     IF False:
 */
  __pyx_t_2 = __pyx_PyFloat_AsDouble(__pyx_v_fill_value); if (unlikely((__pyx_t_2 == (npy_float64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3137; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_fv = __pyx_t_2;

  /* "pandas/src/generated.pyx":3160
 *             return
 * 
 *     for i from 0 <= i < n:             # <<<<<<<<<<<<<<
 *         idx = indexer[i]
 *         if idx == -1:
 */
  __pyx_t_1 = __pyx_v_n;
  for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_1; __pyx_v_i++) {

    /* "pandas/src/generated.pyx":3161
 * 
 *     for i from 0 <= i < n:
 *         idx = indexer[i]             # <<<<<<<<<<<<<<
 *         if idx == -1:
 *             for j from 0 <= j < k:
 */
    __pyx_t_3 = __pyx_v_i;
    __pyx_v_idx = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_3, __pyx_pybuffernd_indexer.diminfo[0].strides));

    /* "pandas/src/generated.pyx":3162
 *     for i from 0 <= i < n:
 *         idx = indexer[i]
 *         if idx == -1:             # <<<<<<<<<<<<<<
 *             for j from 0 <= j < k:
 *                 out[i, j] = fv
 */
    __pyx_t_4 = ((__pyx_v_idx == -1) != 0);
    if (__pyx_t_4) {

      /* "pandas/src/generated.pyx":3163
 *         idx = indexer[i]
 *         if idx == -1:
 *             for j from 0 <= j < k:             # <<<<<<<<<<<<<<
 *                 out[i, j] = fv
 *         else:
 */
      __pyx_t_5 = __pyx_v_k;
      for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_5; __pyx_v_j++) {

        /* "pandas/src/generated.pyx":3164
 *         if idx == -1:
 *             for j from 0 <= j < k:
 *                 out[i, j] = fv             # <<<<<<<<<<<<<<
 *         else:
 *             for j from 0 <= j < k:
 */
        __pyx_t_6 = __pyx_v_i;
        __pyx_t_7 = __pyx_v_j;
        *((__pyx_t_5numpy_float64_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_out.data + __pyx_t_6 * __pyx_v_out.strides[0]) ) + __pyx_t_7 * __pyx_v_out.strides[1]) )) = __pyx_v_fv;
      }
      goto __pyx_L5;
    }
    /*else*/ {

      /* "pandas/src/generated.pyx":3166
 *                 out[i, j] = fv
 *         else:
 *             for j from 0 <= j < k:             # <<<<<<<<<<<<<<
 *                 out[i, j] = values[idx, j]
 * 
 */
      __pyx_t_5 = __pyx_v_k;
      for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_5; __pyx_v_j++) {

        /* "pandas/src/generated.pyx":3167
 *         else:
 *             for j from 0 <= j < k:
 *                 out[i, j] = values[idx, j]             # <<<<<<<<<<<<<<
 * 
 * @cython.wraparound(False)
 */
        __pyx_t_8 = __pyx_v_idx;
        __pyx_t_9 = __pyx_v_j;
        __pyx_t_10 = __pyx_v_i;
        __pyx_t_11 = __pyx_v_j;
        *((__pyx_t_5numpy_float64_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_out.data + __pyx_t_10 * __pyx_v_out.strides[0]) ) + __pyx_t_11 * __pyx_v_out.strides[1]) )) = (*((__pyx_t_5numpy_int32_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_values.data + __pyx_t_8 * __pyx_v_values.strides[0]) ) + __pyx_t_9 * __pyx_v_values.strides[1]) )));
      }
    }
    __pyx_L5:;
  }

  /* "pandas/src/generated.pyx":3126
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def take_2d_axis0_int32_float64(int32_t[:, :] values,             # <<<<<<<<<<<<<<
 *                                     ndarray[int64_t] indexer,
 *                                     float64_t[:, :] out,
 */

  /* function exit code */
  __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_pybuffernd_indexer.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas.algos.take_2d_axis0_int32_float64", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer);
  __pyx_L2:;
  __PYX_XDEC_MEMVIEW(&__pyx_v_values, 1);
  __PYX_XDEC_MEMVIEW(&__pyx_v_out, 1);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/src/generated.pyx":3171
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def take_2d_axis0_int64_int64(int64_t[:, :] values,             # <<<<<<<<<<<<<<
 *                                     ndarray[int64_t] indexer,
 *                                     int64_t[:, :] out,
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pandas_5algos_287take_2d_axis0_int64_int64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_5algos_287take_2d_axis0_int64_int64 = {__Pyx_NAMESTR("take_2d_axis0_int64_int64"), (PyCFunction)__pyx_pw_6pandas_5algos_287take_2d_axis0_int64_int64, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pw_6pandas_5algos_287take_2d_axis0_int64_int64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  __Pyx_memviewslice __pyx_v_values = { 0, 0, { 0 }, { 0 }, { 0 } };
  PyArrayObject *__pyx_v_indexer = 0;
  __Pyx_memviewslice __pyx_v_out = { 0, 0, { 0 }, { 0 }, { 0 } };
  PyObject *__pyx_v_fill_value = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("take_2d_axis0_int64_int64 (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_values,&__pyx_n_s_indexer,&__pyx_n_s_out,&__pyx_n_s_fill_value,0};
    PyObject* values[4] = {0,0,0,0};
    values[3] = __pyx_k__148;
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_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 (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_indexer)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("take_2d_axis0_int64_int64", 0, 3, 4, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3171; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_out)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("take_2d_axis0_int64_int64", 0, 3, 4, 2); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3171; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  3:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_fill_value);
          if (value) { values[3] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "take_2d_axis0_int64_int64") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3171; __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_values = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_int64_t(values[0]); if (unlikely(!__pyx_v_values.memview)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3171; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_v_indexer = ((PyArrayObject *)values[1]);
    __pyx_v_out = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_int64_t(values[2]); if (unlikely(!__pyx_v_out.memview)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3173; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_v_fill_value = values[3];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("take_2d_axis0_int64_int64", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3171; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas.algos.take_2d_axis0_int64_int64", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_indexer), __pyx_ptype_5numpy_ndarray, 1, "indexer", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3172; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_286take_2d_axis0_int64_int64(__pyx_self, __pyx_v_values, __pyx_v_indexer, __pyx_v_out, __pyx_v_fill_value);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pandas_5algos_286take_2d_axis0_int64_int64(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_values, PyArrayObject *__pyx_v_indexer, __Pyx_memviewslice __pyx_v_out, PyObject *__pyx_v_fill_value) {
  Py_ssize_t __pyx_v_i;
  Py_ssize_t __pyx_v_j;
  Py_ssize_t __pyx_v_k;
  Py_ssize_t __pyx_v_n;
  Py_ssize_t __pyx_v_idx;
  __pyx_t_5numpy_int64_t __pyx_v_fv;
  __pyx_t_5numpy_int64_t *__pyx_v_v;
  __pyx_t_5numpy_int64_t *__pyx_v_o;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_indexer;
  __Pyx_Buffer __pyx_pybuffer_indexer;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  Py_ssize_t __pyx_t_1;
  __pyx_t_5numpy_int64_t __pyx_t_2;
  int __pyx_t_3;
  int __pyx_t_4;
  int __pyx_t_5;
  int __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;
  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;
  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_axis0_int64_int64", 0);
  __pyx_pybuffer_indexer.pybuffer.buf = NULL;
  __pyx_pybuffer_indexer.refcount = 0;
  __pyx_pybuffernd_indexer.data = NULL;
  __pyx_pybuffernd_indexer.rcbuffer = &__pyx_pybuffer_indexer;
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer, (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[2]; __pyx_lineno = 3171; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_indexer.diminfo[0].strides = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_indexer.diminfo[0].shape = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.shape[0];

  /* "pandas/src/generated.pyx":3179
 *         int64_t fv
 * 
 *     n = len(indexer)             # <<<<<<<<<<<<<<
 *     k = values.shape[1]
 * 
 */
  __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_indexer)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3179; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_n = __pyx_t_1;

  /* "pandas/src/generated.pyx":3180
 * 
 *     n = len(indexer)
 *     k = values.shape[1]             # <<<<<<<<<<<<<<
 * 
 *     fv = fill_value
 */
  __pyx_v_k = (__pyx_v_values.shape[1]);

  /* "pandas/src/generated.pyx":3182
 *     k = values.shape[1]
 * 
 *     fv = fill_value             # <<<<<<<<<<<<<<
 * 
 *     IF True:
 */
  __pyx_t_2 = __Pyx_PyInt_As_npy_int64(__pyx_v_fill_value); if (unlikely((__pyx_t_2 == (npy_int64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3182; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_fv = __pyx_t_2;

  /* "pandas/src/generated.pyx":3190
 * 
 *         #GH3130
 *         if (values.strides[1] == out.strides[1] and             # <<<<<<<<<<<<<<
 *             values.strides[1] == sizeof(int64_t) and
 *             sizeof(int64_t) * n >= 256):
 */
  __pyx_t_3 = (((__pyx_v_values.strides[1]) == (__pyx_v_out.strides[1])) != 0);
  if (__pyx_t_3) {

    /* "pandas/src/generated.pyx":3191
 *         #GH3130
 *         if (values.strides[1] == out.strides[1] and
 *             values.strides[1] == sizeof(int64_t) and             # <<<<<<<<<<<<<<
 *             sizeof(int64_t) * n >= 256):
 * 
 */
    __pyx_t_4 = (((__pyx_v_values.strides[1]) == (sizeof(__pyx_t_5numpy_int64_t))) != 0);
    if (__pyx_t_4) {

      /* "pandas/src/generated.pyx":3192
 *         if (values.strides[1] == out.strides[1] and
 *             values.strides[1] == sizeof(int64_t) and
 *             sizeof(int64_t) * n >= 256):             # <<<<<<<<<<<<<<
 * 
 *             for i from 0 <= i < n:
 */
      __pyx_t_5 = ((((sizeof(__pyx_t_5numpy_int64_t)) * __pyx_v_n) >= 256) != 0);
      __pyx_t_6 = __pyx_t_5;
    } else {
      __pyx_t_6 = __pyx_t_4;
    }
    __pyx_t_4 = __pyx_t_6;
  } else {
    __pyx_t_4 = __pyx_t_3;
  }
  if (__pyx_t_4) {

    /* "pandas/src/generated.pyx":3194
 *             sizeof(int64_t) * n >= 256):
 * 
 *             for i from 0 <= i < n:             # <<<<<<<<<<<<<<
 *                 idx = indexer[i]
 *                 if idx == -1:
 */
    __pyx_t_1 = __pyx_v_n;
    for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_1; __pyx_v_i++) {

      /* "pandas/src/generated.pyx":3195
 * 
 *             for i from 0 <= i < n:
 *                 idx = indexer[i]             # <<<<<<<<<<<<<<
 *                 if idx == -1:
 *                     for j from 0 <= j < k:
 */
      __pyx_t_7 = __pyx_v_i;
      __pyx_v_idx = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_7, __pyx_pybuffernd_indexer.diminfo[0].strides));

      /* "pandas/src/generated.pyx":3196
 *             for i from 0 <= i < n:
 *                 idx = indexer[i]
 *                 if idx == -1:             # <<<<<<<<<<<<<<
 *                     for j from 0 <= j < k:
 *                         out[i, j] = fv
 */
      __pyx_t_4 = ((__pyx_v_idx == -1) != 0);
      if (__pyx_t_4) {

        /* "pandas/src/generated.pyx":3197
 *                 idx = indexer[i]
 *                 if idx == -1:
 *                     for j from 0 <= j < k:             # <<<<<<<<<<<<<<
 *                         out[i, j] = fv
 *                 else:
 */
        __pyx_t_8 = __pyx_v_k;
        for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_8; __pyx_v_j++) {

          /* "pandas/src/generated.pyx":3198
 *                 if idx == -1:
 *                     for j from 0 <= j < k:
 *                         out[i, j] = fv             # <<<<<<<<<<<<<<
 *                 else:
 *                     v = &values[idx, 0]
 */
          __pyx_t_9 = __pyx_v_i;
          __pyx_t_10 = __pyx_v_j;
          *((__pyx_t_5numpy_int64_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_out.data + __pyx_t_9 * __pyx_v_out.strides[0]) ) + __pyx_t_10 * __pyx_v_out.strides[1]) )) = __pyx_v_fv;
        }
        goto __pyx_L6;
      }
      /*else*/ {

        /* "pandas/src/generated.pyx":3200
 *                         out[i, j] = fv
 *                 else:
 *                     v = &values[idx, 0]             # <<<<<<<<<<<<<<
 *                     o = &out[i, 0]
 *                     memmove(o, v, <size_t>(sizeof(int64_t) * k))
 */
        __pyx_t_8 = __pyx_v_idx;
        __pyx_t_11 = 0;
        __pyx_v_v = (&(*((__pyx_t_5numpy_int64_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_values.data + __pyx_t_8 * __pyx_v_values.strides[0]) ) + __pyx_t_11 * __pyx_v_values.strides[1]) ))));

        /* "pandas/src/generated.pyx":3201
 *                 else:
 *                     v = &values[idx, 0]
 *                     o = &out[i, 0]             # <<<<<<<<<<<<<<
 *                     memmove(o, v, <size_t>(sizeof(int64_t) * k))
 *             return
 */
        __pyx_t_12 = __pyx_v_i;
        __pyx_t_13 = 0;
        __pyx_v_o = (&(*((__pyx_t_5numpy_int64_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_out.data + __pyx_t_12 * __pyx_v_out.strides[0]) ) + __pyx_t_13 * __pyx_v_out.strides[1]) ))));

        /* "pandas/src/generated.pyx":3202
 *                     v = &values[idx, 0]
 *                     o = &out[i, 0]
 *                     memmove(o, v, <size_t>(sizeof(int64_t) * k))             # <<<<<<<<<<<<<<
 *             return
 * 
 */
        memmove(__pyx_v_o, __pyx_v_v, ((size_t)((sizeof(__pyx_t_5numpy_int64_t)) * __pyx_v_k)));
      }
      __pyx_L6:;
    }

    /* "pandas/src/generated.pyx":3203
 *                     o = &out[i, 0]
 *                     memmove(o, v, <size_t>(sizeof(int64_t) * k))
 *             return             # <<<<<<<<<<<<<<
 * 
 *     for i from 0 <= i < n:
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_r = Py_None; __Pyx_INCREF(Py_None);
    goto __pyx_L0;
  }

  /* "pandas/src/generated.pyx":3205
 *             return
 * 
 *     for i from 0 <= i < n:             # <<<<<<<<<<<<<<
 *         idx = indexer[i]
 *         if idx == -1:
 */
  __pyx_t_1 = __pyx_v_n;
  for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_1; __pyx_v_i++) {

    /* "pandas/src/generated.pyx":3206
 * 
 *     for i from 0 <= i < n:
 *         idx = indexer[i]             # <<<<<<<<<<<<<<
 *         if idx == -1:
 *             for j from 0 <= j < k:
 */
    __pyx_t_14 = __pyx_v_i;
    __pyx_v_idx = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_indexer.diminfo[0].strides));

    /* "pandas/src/generated.pyx":3207
 *     for i from 0 <= i < n:
 *         idx = indexer[i]
 *         if idx == -1:             # <<<<<<<<<<<<<<
 *             for j from 0 <= j < k:
 *                 out[i, j] = fv
 */
    __pyx_t_4 = ((__pyx_v_idx == -1) != 0);
    if (__pyx_t_4) {

      /* "pandas/src/generated.pyx":3208
 *         idx = indexer[i]
 *         if idx == -1:
 *             for j from 0 <= j < k:             # <<<<<<<<<<<<<<
 *                 out[i, j] = fv
 *         else:
 */
      __pyx_t_15 = __pyx_v_k;
      for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_15; __pyx_v_j++) {

        /* "pandas/src/generated.pyx":3209
 *         if idx == -1:
 *             for j from 0 <= j < k:
 *                 out[i, j] = fv             # <<<<<<<<<<<<<<
 *         else:
 *             for j from 0 <= j < k:
 */
        __pyx_t_16 = __pyx_v_i;
        __pyx_t_17 = __pyx_v_j;
        *((__pyx_t_5numpy_int64_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_out.data + __pyx_t_16 * __pyx_v_out.strides[0]) ) + __pyx_t_17 * __pyx_v_out.strides[1]) )) = __pyx_v_fv;
      }
      goto __pyx_L11;
    }
    /*else*/ {

      /* "pandas/src/generated.pyx":3211
 *                 out[i, j] = fv
 *         else:
 *             for j from 0 <= j < k:             # <<<<<<<<<<<<<<
 *                 out[i, j] = values[idx, j]
 * 
 */
      __pyx_t_15 = __pyx_v_k;
      for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_15; __pyx_v_j++) {

        /* "pandas/src/generated.pyx":3212
 *         else:
 *             for j from 0 <= j < k:
 *                 out[i, j] = values[idx, j]             # <<<<<<<<<<<<<<
 * 
 * @cython.wraparound(False)
 */
        __pyx_t_18 = __pyx_v_idx;
        __pyx_t_19 = __pyx_v_j;
        __pyx_t_20 = __pyx_v_i;
        __pyx_t_21 = __pyx_v_j;
        *((__pyx_t_5numpy_int64_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_out.data + __pyx_t_20 * __pyx_v_out.strides[0]) ) + __pyx_t_21 * __pyx_v_out.strides[1]) )) = (*((__pyx_t_5numpy_int64_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_values.data + __pyx_t_18 * __pyx_v_values.strides[0]) ) + __pyx_t_19 * __pyx_v_values.strides[1]) )));
      }
    }
    __pyx_L11:;
  }

  /* "pandas/src/generated.pyx":3171
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def take_2d_axis0_int64_int64(int64_t[:, :] values,             # <<<<<<<<<<<<<<
 *                                     ndarray[int64_t] indexer,
 *                                     int64_t[:, :] out,
 */

  /* function exit code */
  __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_pybuffernd_indexer.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas.algos.take_2d_axis0_int64_int64", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer);
  __pyx_L2:;
  __PYX_XDEC_MEMVIEW(&__pyx_v_values, 1);
  __PYX_XDEC_MEMVIEW(&__pyx_v_out, 1);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/src/generated.pyx":3216
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def take_2d_axis0_int64_float64(int64_t[:, :] values,             # <<<<<<<<<<<<<<
 *                                     ndarray[int64_t] indexer,
 *                                     float64_t[:, :] out,
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pandas_5algos_289take_2d_axis0_int64_float64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_5algos_289take_2d_axis0_int64_float64 = {__Pyx_NAMESTR("take_2d_axis0_int64_float64"), (PyCFunction)__pyx_pw_6pandas_5algos_289take_2d_axis0_int64_float64, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pw_6pandas_5algos_289take_2d_axis0_int64_float64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  __Pyx_memviewslice __pyx_v_values = { 0, 0, { 0 }, { 0 }, { 0 } };
  PyArrayObject *__pyx_v_indexer = 0;
  __Pyx_memviewslice __pyx_v_out = { 0, 0, { 0 }, { 0 }, { 0 } };
  PyObject *__pyx_v_fill_value = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("take_2d_axis0_int64_float64 (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_values,&__pyx_n_s_indexer,&__pyx_n_s_out,&__pyx_n_s_fill_value,0};
    PyObject* values[4] = {0,0,0,0};
    values[3] = __pyx_k__149;
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_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 (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_indexer)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("take_2d_axis0_int64_float64", 0, 3, 4, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3216; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_out)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("take_2d_axis0_int64_float64", 0, 3, 4, 2); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3216; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  3:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_fill_value);
          if (value) { values[3] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "take_2d_axis0_int64_float64") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3216; __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_values = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_int64_t(values[0]); if (unlikely(!__pyx_v_values.memview)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3216; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_v_indexer = ((PyArrayObject *)values[1]);
    __pyx_v_out = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_float64_t(values[2]); if (unlikely(!__pyx_v_out.memview)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3218; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_v_fill_value = values[3];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("take_2d_axis0_int64_float64", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3216; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas.algos.take_2d_axis0_int64_float64", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_indexer), __pyx_ptype_5numpy_ndarray, 1, "indexer", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3217; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_288take_2d_axis0_int64_float64(__pyx_self, __pyx_v_values, __pyx_v_indexer, __pyx_v_out, __pyx_v_fill_value);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pandas_5algos_288take_2d_axis0_int64_float64(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_values, PyArrayObject *__pyx_v_indexer, __Pyx_memviewslice __pyx_v_out, PyObject *__pyx_v_fill_value) {
  Py_ssize_t __pyx_v_i;
  Py_ssize_t __pyx_v_j;
  Py_ssize_t __pyx_v_k;
  Py_ssize_t __pyx_v_n;
  Py_ssize_t __pyx_v_idx;
  __pyx_t_5numpy_float64_t __pyx_v_fv;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_indexer;
  __Pyx_Buffer __pyx_pybuffer_indexer;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  Py_ssize_t __pyx_t_1;
  __pyx_t_5numpy_float64_t __pyx_t_2;
  Py_ssize_t __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;
  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;
  __Pyx_RefNannySetupContext("take_2d_axis0_int64_float64", 0);
  __pyx_pybuffer_indexer.pybuffer.buf = NULL;
  __pyx_pybuffer_indexer.refcount = 0;
  __pyx_pybuffernd_indexer.data = NULL;
  __pyx_pybuffernd_indexer.rcbuffer = &__pyx_pybuffer_indexer;
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer, (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[2]; __pyx_lineno = 3216; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_indexer.diminfo[0].strides = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_indexer.diminfo[0].shape = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.shape[0];

  /* "pandas/src/generated.pyx":3224
 *         float64_t fv
 * 
 *     n = len(indexer)             # <<<<<<<<<<<<<<
 *     k = values.shape[1]
 * 
 */
  __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_indexer)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3224; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_n = __pyx_t_1;

  /* "pandas/src/generated.pyx":3225
 * 
 *     n = len(indexer)
 *     k = values.shape[1]             # <<<<<<<<<<<<<<
 * 
 *     fv = fill_value
 */
  __pyx_v_k = (__pyx_v_values.shape[1]);

  /* "pandas/src/generated.pyx":3227
 *     k = values.shape[1]
 * 
 *     fv = fill_value             # <<<<<<<<<<<<<<
 * 
 *     IF False:
 */
  __pyx_t_2 = __pyx_PyFloat_AsDouble(__pyx_v_fill_value); if (unlikely((__pyx_t_2 == (npy_float64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3227; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_fv = __pyx_t_2;

  /* "pandas/src/generated.pyx":3250
 *             return
 * 
 *     for i from 0 <= i < n:             # <<<<<<<<<<<<<<
 *         idx = indexer[i]
 *         if idx == -1:
 */
  __pyx_t_1 = __pyx_v_n;
  for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_1; __pyx_v_i++) {

    /* "pandas/src/generated.pyx":3251
 * 
 *     for i from 0 <= i < n:
 *         idx = indexer[i]             # <<<<<<<<<<<<<<
 *         if idx == -1:
 *             for j from 0 <= j < k:
 */
    __pyx_t_3 = __pyx_v_i;
    __pyx_v_idx = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_3, __pyx_pybuffernd_indexer.diminfo[0].strides));

    /* "pandas/src/generated.pyx":3252
 *     for i from 0 <= i < n:
 *         idx = indexer[i]
 *         if idx == -1:             # <<<<<<<<<<<<<<
 *             for j from 0 <= j < k:
 *                 out[i, j] = fv
 */
    __pyx_t_4 = ((__pyx_v_idx == -1) != 0);
    if (__pyx_t_4) {

      /* "pandas/src/generated.pyx":3253
 *         idx = indexer[i]
 *         if idx == -1:
 *             for j from 0 <= j < k:             # <<<<<<<<<<<<<<
 *                 out[i, j] = fv
 *         else:
 */
      __pyx_t_5 = __pyx_v_k;
      for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_5; __pyx_v_j++) {

        /* "pandas/src/generated.pyx":3254
 *         if idx == -1:
 *             for j from 0 <= j < k:
 *                 out[i, j] = fv             # <<<<<<<<<<<<<<
 *         else:
 *             for j from 0 <= j < k:
 */
        __pyx_t_6 = __pyx_v_i;
        __pyx_t_7 = __pyx_v_j;
        *((__pyx_t_5numpy_float64_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_out.data + __pyx_t_6 * __pyx_v_out.strides[0]) ) + __pyx_t_7 * __pyx_v_out.strides[1]) )) = __pyx_v_fv;
      }
      goto __pyx_L5;
    }
    /*else*/ {

      /* "pandas/src/generated.pyx":3256
 *                 out[i, j] = fv
 *         else:
 *             for j from 0 <= j < k:             # <<<<<<<<<<<<<<
 *                 out[i, j] = values[idx, j]
 * 
 */
      __pyx_t_5 = __pyx_v_k;
      for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_5; __pyx_v_j++) {

        /* "pandas/src/generated.pyx":3257
 *         else:
 *             for j from 0 <= j < k:
 *                 out[i, j] = values[idx, j]             # <<<<<<<<<<<<<<
 * 
 * @cython.wraparound(False)
 */
        __pyx_t_8 = __pyx_v_idx;
        __pyx_t_9 = __pyx_v_j;
        __pyx_t_10 = __pyx_v_i;
        __pyx_t_11 = __pyx_v_j;
        *((__pyx_t_5numpy_float64_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_out.data + __pyx_t_10 * __pyx_v_out.strides[0]) ) + __pyx_t_11 * __pyx_v_out.strides[1]) )) = (*((__pyx_t_5numpy_int64_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_values.data + __pyx_t_8 * __pyx_v_values.strides[0]) ) + __pyx_t_9 * __pyx_v_values.strides[1]) )));
      }
    }
    __pyx_L5:;
  }

  /* "pandas/src/generated.pyx":3216
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def take_2d_axis0_int64_float64(int64_t[:, :] values,             # <<<<<<<<<<<<<<
 *                                     ndarray[int64_t] indexer,
 *                                     float64_t[:, :] out,
 */

  /* function exit code */
  __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_pybuffernd_indexer.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas.algos.take_2d_axis0_int64_float64", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer);
  __pyx_L2:;
  __PYX_XDEC_MEMVIEW(&__pyx_v_values, 1);
  __PYX_XDEC_MEMVIEW(&__pyx_v_out, 1);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/src/generated.pyx":3261
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def take_2d_axis0_float32_float32(float32_t[:, :] values,             # <<<<<<<<<<<<<<
 *                                     ndarray[int64_t] indexer,
 *                                     float32_t[:, :] out,
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pandas_5algos_291take_2d_axis0_float32_float32(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_5algos_291take_2d_axis0_float32_float32 = {__Pyx_NAMESTR("take_2d_axis0_float32_float32"), (PyCFunction)__pyx_pw_6pandas_5algos_291take_2d_axis0_float32_float32, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pw_6pandas_5algos_291take_2d_axis0_float32_float32(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  __Pyx_memviewslice __pyx_v_values = { 0, 0, { 0 }, { 0 }, { 0 } };
  PyArrayObject *__pyx_v_indexer = 0;
  __Pyx_memviewslice __pyx_v_out = { 0, 0, { 0 }, { 0 }, { 0 } };
  PyObject *__pyx_v_fill_value = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("take_2d_axis0_float32_float32 (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_values,&__pyx_n_s_indexer,&__pyx_n_s_out,&__pyx_n_s_fill_value,0};
    PyObject* values[4] = {0,0,0,0};
    values[3] = __pyx_k__150;
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_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 (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_indexer)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("take_2d_axis0_float32_float32", 0, 3, 4, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3261; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_out)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("take_2d_axis0_float32_float32", 0, 3, 4, 2); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3261; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  3:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_fill_value);
          if (value) { values[3] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "take_2d_axis0_float32_float32") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3261; __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_values = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_float32_t(values[0]); if (unlikely(!__pyx_v_values.memview)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3261; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_v_indexer = ((PyArrayObject *)values[1]);
    __pyx_v_out = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_float32_t(values[2]); if (unlikely(!__pyx_v_out.memview)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3263; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_v_fill_value = values[3];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("take_2d_axis0_float32_float32", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3261; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas.algos.take_2d_axis0_float32_float32", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_indexer), __pyx_ptype_5numpy_ndarray, 1, "indexer", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3262; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_290take_2d_axis0_float32_float32(__pyx_self, __pyx_v_values, __pyx_v_indexer, __pyx_v_out, __pyx_v_fill_value);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pandas_5algos_290take_2d_axis0_float32_float32(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_values, PyArrayObject *__pyx_v_indexer, __Pyx_memviewslice __pyx_v_out, PyObject *__pyx_v_fill_value) {
  Py_ssize_t __pyx_v_i;
  Py_ssize_t __pyx_v_j;
  Py_ssize_t __pyx_v_k;
  Py_ssize_t __pyx_v_n;
  Py_ssize_t __pyx_v_idx;
  __pyx_t_5numpy_float32_t __pyx_v_fv;
  __pyx_t_5numpy_float32_t *__pyx_v_v;
  __pyx_t_5numpy_float32_t *__pyx_v_o;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_indexer;
  __Pyx_Buffer __pyx_pybuffer_indexer;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  Py_ssize_t __pyx_t_1;
  __pyx_t_5numpy_float32_t __pyx_t_2;
  int __pyx_t_3;
  int __pyx_t_4;
  int __pyx_t_5;
  int __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;
  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;
  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_axis0_float32_float32", 0);
  __pyx_pybuffer_indexer.pybuffer.buf = NULL;
  __pyx_pybuffer_indexer.refcount = 0;
  __pyx_pybuffernd_indexer.data = NULL;
  __pyx_pybuffernd_indexer.rcbuffer = &__pyx_pybuffer_indexer;
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer, (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[2]; __pyx_lineno = 3261; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_indexer.diminfo[0].strides = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_indexer.diminfo[0].shape = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.shape[0];

  /* "pandas/src/generated.pyx":3269
 *         float32_t fv
 * 
 *     n = len(indexer)             # <<<<<<<<<<<<<<
 *     k = values.shape[1]
 * 
 */
  __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_indexer)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3269; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_n = __pyx_t_1;

  /* "pandas/src/generated.pyx":3270
 * 
 *     n = len(indexer)
 *     k = values.shape[1]             # <<<<<<<<<<<<<<
 * 
 *     fv = fill_value
 */
  __pyx_v_k = (__pyx_v_values.shape[1]);

  /* "pandas/src/generated.pyx":3272
 *     k = values.shape[1]
 * 
 *     fv = fill_value             # <<<<<<<<<<<<<<
 * 
 *     IF True:
 */
  __pyx_t_2 = __pyx_PyFloat_AsFloat(__pyx_v_fill_value); if (unlikely((__pyx_t_2 == (npy_float32)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3272; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_fv = __pyx_t_2;

  /* "pandas/src/generated.pyx":3280
 * 
 *         #GH3130
 *         if (values.strides[1] == out.strides[1] and             # <<<<<<<<<<<<<<
 *             values.strides[1] == sizeof(float32_t) and
 *             sizeof(float32_t) * n >= 256):
 */
  __pyx_t_3 = (((__pyx_v_values.strides[1]) == (__pyx_v_out.strides[1])) != 0);
  if (__pyx_t_3) {

    /* "pandas/src/generated.pyx":3281
 *         #GH3130
 *         if (values.strides[1] == out.strides[1] and
 *             values.strides[1] == sizeof(float32_t) and             # <<<<<<<<<<<<<<
 *             sizeof(float32_t) * n >= 256):
 * 
 */
    __pyx_t_4 = (((__pyx_v_values.strides[1]) == (sizeof(__pyx_t_5numpy_float32_t))) != 0);
    if (__pyx_t_4) {

      /* "pandas/src/generated.pyx":3282
 *         if (values.strides[1] == out.strides[1] and
 *             values.strides[1] == sizeof(float32_t) and
 *             sizeof(float32_t) * n >= 256):             # <<<<<<<<<<<<<<
 * 
 *             for i from 0 <= i < n:
 */
      __pyx_t_5 = ((((sizeof(__pyx_t_5numpy_float32_t)) * __pyx_v_n) >= 256) != 0);
      __pyx_t_6 = __pyx_t_5;
    } else {
      __pyx_t_6 = __pyx_t_4;
    }
    __pyx_t_4 = __pyx_t_6;
  } else {
    __pyx_t_4 = __pyx_t_3;
  }
  if (__pyx_t_4) {

    /* "pandas/src/generated.pyx":3284
 *             sizeof(float32_t) * n >= 256):
 * 
 *             for i from 0 <= i < n:             # <<<<<<<<<<<<<<
 *                 idx = indexer[i]
 *                 if idx == -1:
 */
    __pyx_t_1 = __pyx_v_n;
    for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_1; __pyx_v_i++) {

      /* "pandas/src/generated.pyx":3285
 * 
 *             for i from 0 <= i < n:
 *                 idx = indexer[i]             # <<<<<<<<<<<<<<
 *                 if idx == -1:
 *                     for j from 0 <= j < k:
 */
      __pyx_t_7 = __pyx_v_i;
      __pyx_v_idx = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_7, __pyx_pybuffernd_indexer.diminfo[0].strides));

      /* "pandas/src/generated.pyx":3286
 *             for i from 0 <= i < n:
 *                 idx = indexer[i]
 *                 if idx == -1:             # <<<<<<<<<<<<<<
 *                     for j from 0 <= j < k:
 *                         out[i, j] = fv
 */
      __pyx_t_4 = ((__pyx_v_idx == -1) != 0);
      if (__pyx_t_4) {

        /* "pandas/src/generated.pyx":3287
 *                 idx = indexer[i]
 *                 if idx == -1:
 *                     for j from 0 <= j < k:             # <<<<<<<<<<<<<<
 *                         out[i, j] = fv
 *                 else:
 */
        __pyx_t_8 = __pyx_v_k;
        for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_8; __pyx_v_j++) {

          /* "pandas/src/generated.pyx":3288
 *                 if idx == -1:
 *                     for j from 0 <= j < k:
 *                         out[i, j] = fv             # <<<<<<<<<<<<<<
 *                 else:
 *                     v = &values[idx, 0]
 */
          __pyx_t_9 = __pyx_v_i;
          __pyx_t_10 = __pyx_v_j;
          *((__pyx_t_5numpy_float32_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_out.data + __pyx_t_9 * __pyx_v_out.strides[0]) ) + __pyx_t_10 * __pyx_v_out.strides[1]) )) = __pyx_v_fv;
        }
        goto __pyx_L6;
      }
      /*else*/ {

        /* "pandas/src/generated.pyx":3290
 *                         out[i, j] = fv
 *                 else:
 *                     v = &values[idx, 0]             # <<<<<<<<<<<<<<
 *                     o = &out[i, 0]
 *                     memmove(o, v, <size_t>(sizeof(float32_t) * k))
 */
        __pyx_t_8 = __pyx_v_idx;
        __pyx_t_11 = 0;
        __pyx_v_v = (&(*((__pyx_t_5numpy_float32_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_values.data + __pyx_t_8 * __pyx_v_values.strides[0]) ) + __pyx_t_11 * __pyx_v_values.strides[1]) ))));

        /* "pandas/src/generated.pyx":3291
 *                 else:
 *                     v = &values[idx, 0]
 *                     o = &out[i, 0]             # <<<<<<<<<<<<<<
 *                     memmove(o, v, <size_t>(sizeof(float32_t) * k))
 *             return
 */
        __pyx_t_12 = __pyx_v_i;
        __pyx_t_13 = 0;
        __pyx_v_o = (&(*((__pyx_t_5numpy_float32_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_out.data + __pyx_t_12 * __pyx_v_out.strides[0]) ) + __pyx_t_13 * __pyx_v_out.strides[1]) ))));

        /* "pandas/src/generated.pyx":3292
 *                     v = &values[idx, 0]
 *                     o = &out[i, 0]
 *                     memmove(o, v, <size_t>(sizeof(float32_t) * k))             # <<<<<<<<<<<<<<
 *             return
 * 
 */
        memmove(__pyx_v_o, __pyx_v_v, ((size_t)((sizeof(__pyx_t_5numpy_float32_t)) * __pyx_v_k)));
      }
      __pyx_L6:;
    }

    /* "pandas/src/generated.pyx":3293
 *                     o = &out[i, 0]
 *                     memmove(o, v, <size_t>(sizeof(float32_t) * k))
 *             return             # <<<<<<<<<<<<<<
 * 
 *     for i from 0 <= i < n:
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_r = Py_None; __Pyx_INCREF(Py_None);
    goto __pyx_L0;
  }

  /* "pandas/src/generated.pyx":3295
 *             return
 * 
 *     for i from 0 <= i < n:             # <<<<<<<<<<<<<<
 *         idx = indexer[i]
 *         if idx == -1:
 */
  __pyx_t_1 = __pyx_v_n;
  for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_1; __pyx_v_i++) {

    /* "pandas/src/generated.pyx":3296
 * 
 *     for i from 0 <= i < n:
 *         idx = indexer[i]             # <<<<<<<<<<<<<<
 *         if idx == -1:
 *             for j from 0 <= j < k:
 */
    __pyx_t_14 = __pyx_v_i;
    __pyx_v_idx = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_indexer.diminfo[0].strides));

    /* "pandas/src/generated.pyx":3297
 *     for i from 0 <= i < n:
 *         idx = indexer[i]
 *         if idx == -1:             # <<<<<<<<<<<<<<
 *             for j from 0 <= j < k:
 *                 out[i, j] = fv
 */
    __pyx_t_4 = ((__pyx_v_idx == -1) != 0);
    if (__pyx_t_4) {

      /* "pandas/src/generated.pyx":3298
 *         idx = indexer[i]
 *         if idx == -1:
 *             for j from 0 <= j < k:             # <<<<<<<<<<<<<<
 *                 out[i, j] = fv
 *         else:
 */
      __pyx_t_15 = __pyx_v_k;
      for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_15; __pyx_v_j++) {

        /* "pandas/src/generated.pyx":3299
 *         if idx == -1:
 *             for j from 0 <= j < k:
 *                 out[i, j] = fv             # <<<<<<<<<<<<<<
 *         else:
 *             for j from 0 <= j < k:
 */
        __pyx_t_16 = __pyx_v_i;
        __pyx_t_17 = __pyx_v_j;
        *((__pyx_t_5numpy_float32_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_out.data + __pyx_t_16 * __pyx_v_out.strides[0]) ) + __pyx_t_17 * __pyx_v_out.strides[1]) )) = __pyx_v_fv;
      }
      goto __pyx_L11;
    }
    /*else*/ {

      /* "pandas/src/generated.pyx":3301
 *                 out[i, j] = fv
 *         else:
 *             for j from 0 <= j < k:             # <<<<<<<<<<<<<<
 *                 out[i, j] = values[idx, j]
 * 
 */
      __pyx_t_15 = __pyx_v_k;
      for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_15; __pyx_v_j++) {

        /* "pandas/src/generated.pyx":3302
 *         else:
 *             for j from 0 <= j < k:
 *                 out[i, j] = values[idx, j]             # <<<<<<<<<<<<<<
 * 
 * @cython.wraparound(False)
 */
        __pyx_t_18 = __pyx_v_idx;
        __pyx_t_19 = __pyx_v_j;
        __pyx_t_20 = __pyx_v_i;
        __pyx_t_21 = __pyx_v_j;
        *((__pyx_t_5numpy_float32_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_out.data + __pyx_t_20 * __pyx_v_out.strides[0]) ) + __pyx_t_21 * __pyx_v_out.strides[1]) )) = (*((__pyx_t_5numpy_float32_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_values.data + __pyx_t_18 * __pyx_v_values.strides[0]) ) + __pyx_t_19 * __pyx_v_values.strides[1]) )));
      }
    }
    __pyx_L11:;
  }

  /* "pandas/src/generated.pyx":3261
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def take_2d_axis0_float32_float32(float32_t[:, :] values,             # <<<<<<<<<<<<<<
 *                                     ndarray[int64_t] indexer,
 *                                     float32_t[:, :] out,
 */

  /* function exit code */
  __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_pybuffernd_indexer.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas.algos.take_2d_axis0_float32_float32", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer);
  __pyx_L2:;
  __PYX_XDEC_MEMVIEW(&__pyx_v_values, 1);
  __PYX_XDEC_MEMVIEW(&__pyx_v_out, 1);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/src/generated.pyx":3306
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def take_2d_axis0_float32_float64(float32_t[:, :] values,             # <<<<<<<<<<<<<<
 *                                     ndarray[int64_t] indexer,
 *                                     float64_t[:, :] out,
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pandas_5algos_293take_2d_axis0_float32_float64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_5algos_293take_2d_axis0_float32_float64 = {__Pyx_NAMESTR("take_2d_axis0_float32_float64"), (PyCFunction)__pyx_pw_6pandas_5algos_293take_2d_axis0_float32_float64, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pw_6pandas_5algos_293take_2d_axis0_float32_float64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  __Pyx_memviewslice __pyx_v_values = { 0, 0, { 0 }, { 0 }, { 0 } };
  PyArrayObject *__pyx_v_indexer = 0;
  __Pyx_memviewslice __pyx_v_out = { 0, 0, { 0 }, { 0 }, { 0 } };
  PyObject *__pyx_v_fill_value = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("take_2d_axis0_float32_float64 (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_values,&__pyx_n_s_indexer,&__pyx_n_s_out,&__pyx_n_s_fill_value,0};
    PyObject* values[4] = {0,0,0,0};
    values[3] = __pyx_k__151;
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_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 (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_indexer)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("take_2d_axis0_float32_float64", 0, 3, 4, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3306; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_out)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("take_2d_axis0_float32_float64", 0, 3, 4, 2); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3306; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  3:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_fill_value);
          if (value) { values[3] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "take_2d_axis0_float32_float64") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3306; __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_values = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_float32_t(values[0]); if (unlikely(!__pyx_v_values.memview)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3306; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_v_indexer = ((PyArrayObject *)values[1]);
    __pyx_v_out = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_float64_t(values[2]); if (unlikely(!__pyx_v_out.memview)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3308; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_v_fill_value = values[3];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("take_2d_axis0_float32_float64", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3306; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas.algos.take_2d_axis0_float32_float64", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_indexer), __pyx_ptype_5numpy_ndarray, 1, "indexer", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3307; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_292take_2d_axis0_float32_float64(__pyx_self, __pyx_v_values, __pyx_v_indexer, __pyx_v_out, __pyx_v_fill_value);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pandas_5algos_292take_2d_axis0_float32_float64(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_values, PyArrayObject *__pyx_v_indexer, __Pyx_memviewslice __pyx_v_out, PyObject *__pyx_v_fill_value) {
  Py_ssize_t __pyx_v_i;
  Py_ssize_t __pyx_v_j;
  Py_ssize_t __pyx_v_k;
  Py_ssize_t __pyx_v_n;
  Py_ssize_t __pyx_v_idx;
  __pyx_t_5numpy_float64_t __pyx_v_fv;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_indexer;
  __Pyx_Buffer __pyx_pybuffer_indexer;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  Py_ssize_t __pyx_t_1;
  __pyx_t_5numpy_float64_t __pyx_t_2;
  Py_ssize_t __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;
  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;
  __Pyx_RefNannySetupContext("take_2d_axis0_float32_float64", 0);
  __pyx_pybuffer_indexer.pybuffer.buf = NULL;
  __pyx_pybuffer_indexer.refcount = 0;
  __pyx_pybuffernd_indexer.data = NULL;
  __pyx_pybuffernd_indexer.rcbuffer = &__pyx_pybuffer_indexer;
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer, (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[2]; __pyx_lineno = 3306; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_indexer.diminfo[0].strides = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_indexer.diminfo[0].shape = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.shape[0];

  /* "pandas/src/generated.pyx":3314
 *         float64_t fv
 * 
 *     n = len(indexer)             # <<<<<<<<<<<<<<
 *     k = values.shape[1]
 * 
 */
  __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_indexer)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3314; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_n = __pyx_t_1;

  /* "pandas/src/generated.pyx":3315
 * 
 *     n = len(indexer)
 *     k = values.shape[1]             # <<<<<<<<<<<<<<
 * 
 *     fv = fill_value
 */
  __pyx_v_k = (__pyx_v_values.shape[1]);

  /* "pandas/src/generated.pyx":3317
 *     k = values.shape[1]
 * 
 *     fv = fill_value             # <<<<<<<<<<<<<<
 * 
 *     IF False:
 */
  __pyx_t_2 = __pyx_PyFloat_AsDouble(__pyx_v_fill_value); if (unlikely((__pyx_t_2 == (npy_float64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3317; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_fv = __pyx_t_2;

  /* "pandas/src/generated.pyx":3340
 *             return
 * 
 *     for i from 0 <= i < n:             # <<<<<<<<<<<<<<
 *         idx = indexer[i]
 *         if idx == -1:
 */
  __pyx_t_1 = __pyx_v_n;
  for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_1; __pyx_v_i++) {

    /* "pandas/src/generated.pyx":3341
 * 
 *     for i from 0 <= i < n:
 *         idx = indexer[i]             # <<<<<<<<<<<<<<
 *         if idx == -1:
 *             for j from 0 <= j < k:
 */
    __pyx_t_3 = __pyx_v_i;
    __pyx_v_idx = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_3, __pyx_pybuffernd_indexer.diminfo[0].strides));

    /* "pandas/src/generated.pyx":3342
 *     for i from 0 <= i < n:
 *         idx = indexer[i]
 *         if idx == -1:             # <<<<<<<<<<<<<<
 *             for j from 0 <= j < k:
 *                 out[i, j] = fv
 */
    __pyx_t_4 = ((__pyx_v_idx == -1) != 0);
    if (__pyx_t_4) {

      /* "pandas/src/generated.pyx":3343
 *         idx = indexer[i]
 *         if idx == -1:
 *             for j from 0 <= j < k:             # <<<<<<<<<<<<<<
 *                 out[i, j] = fv
 *         else:
 */
      __pyx_t_5 = __pyx_v_k;
      for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_5; __pyx_v_j++) {

        /* "pandas/src/generated.pyx":3344
 *         if idx == -1:
 *             for j from 0 <= j < k:
 *                 out[i, j] = fv             # <<<<<<<<<<<<<<
 *         else:
 *             for j from 0 <= j < k:
 */
        __pyx_t_6 = __pyx_v_i;
        __pyx_t_7 = __pyx_v_j;
        *((__pyx_t_5numpy_float64_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_out.data + __pyx_t_6 * __pyx_v_out.strides[0]) ) + __pyx_t_7 * __pyx_v_out.strides[1]) )) = __pyx_v_fv;
      }
      goto __pyx_L5;
    }
    /*else*/ {

      /* "pandas/src/generated.pyx":3346
 *                 out[i, j] = fv
 *         else:
 *             for j from 0 <= j < k:             # <<<<<<<<<<<<<<
 *                 out[i, j] = values[idx, j]
 * 
 */
      __pyx_t_5 = __pyx_v_k;
      for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_5; __pyx_v_j++) {

        /* "pandas/src/generated.pyx":3347
 *         else:
 *             for j from 0 <= j < k:
 *                 out[i, j] = values[idx, j]             # <<<<<<<<<<<<<<
 * 
 * @cython.wraparound(False)
 */
        __pyx_t_8 = __pyx_v_idx;
        __pyx_t_9 = __pyx_v_j;
        __pyx_t_10 = __pyx_v_i;
        __pyx_t_11 = __pyx_v_j;
        *((__pyx_t_5numpy_float64_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_out.data + __pyx_t_10 * __pyx_v_out.strides[0]) ) + __pyx_t_11 * __pyx_v_out.strides[1]) )) = (*((__pyx_t_5numpy_float32_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_values.data + __pyx_t_8 * __pyx_v_values.strides[0]) ) + __pyx_t_9 * __pyx_v_values.strides[1]) )));
      }
    }
    __pyx_L5:;
  }

  /* "pandas/src/generated.pyx":3306
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def take_2d_axis0_float32_float64(float32_t[:, :] values,             # <<<<<<<<<<<<<<
 *                                     ndarray[int64_t] indexer,
 *                                     float64_t[:, :] out,
 */

  /* function exit code */
  __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_pybuffernd_indexer.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas.algos.take_2d_axis0_float32_float64", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer);
  __pyx_L2:;
  __PYX_XDEC_MEMVIEW(&__pyx_v_values, 1);
  __PYX_XDEC_MEMVIEW(&__pyx_v_out, 1);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/src/generated.pyx":3351
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def take_2d_axis0_float64_float64(float64_t[:, :] values,             # <<<<<<<<<<<<<<
 *                                     ndarray[int64_t] indexer,
 *                                     float64_t[:, :] out,
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pandas_5algos_295take_2d_axis0_float64_float64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_5algos_295take_2d_axis0_float64_float64 = {__Pyx_NAMESTR("take_2d_axis0_float64_float64"), (PyCFunction)__pyx_pw_6pandas_5algos_295take_2d_axis0_float64_float64, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pw_6pandas_5algos_295take_2d_axis0_float64_float64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  __Pyx_memviewslice __pyx_v_values = { 0, 0, { 0 }, { 0 }, { 0 } };
  PyArrayObject *__pyx_v_indexer = 0;
  __Pyx_memviewslice __pyx_v_out = { 0, 0, { 0 }, { 0 }, { 0 } };
  PyObject *__pyx_v_fill_value = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("take_2d_axis0_float64_float64 (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_values,&__pyx_n_s_indexer,&__pyx_n_s_out,&__pyx_n_s_fill_value,0};
    PyObject* values[4] = {0,0,0,0};
    values[3] = __pyx_k__152;
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_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 (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_indexer)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("take_2d_axis0_float64_float64", 0, 3, 4, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3351; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_out)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("take_2d_axis0_float64_float64", 0, 3, 4, 2); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3351; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  3:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_fill_value);
          if (value) { values[3] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "take_2d_axis0_float64_float64") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3351; __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_values = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_float64_t(values[0]); if (unlikely(!__pyx_v_values.memview)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3351; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_v_indexer = ((PyArrayObject *)values[1]);
    __pyx_v_out = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_float64_t(values[2]); if (unlikely(!__pyx_v_out.memview)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3353; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_v_fill_value = values[3];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("take_2d_axis0_float64_float64", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3351; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas.algos.take_2d_axis0_float64_float64", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_indexer), __pyx_ptype_5numpy_ndarray, 1, "indexer", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3352; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_294take_2d_axis0_float64_float64(__pyx_self, __pyx_v_values, __pyx_v_indexer, __pyx_v_out, __pyx_v_fill_value);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pandas_5algos_294take_2d_axis0_float64_float64(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_values, PyArrayObject *__pyx_v_indexer, __Pyx_memviewslice __pyx_v_out, PyObject *__pyx_v_fill_value) {
  Py_ssize_t __pyx_v_i;
  Py_ssize_t __pyx_v_j;
  Py_ssize_t __pyx_v_k;
  Py_ssize_t __pyx_v_n;
  Py_ssize_t __pyx_v_idx;
  __pyx_t_5numpy_float64_t __pyx_v_fv;
  __pyx_t_5numpy_float64_t *__pyx_v_v;
  __pyx_t_5numpy_float64_t *__pyx_v_o;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_indexer;
  __Pyx_Buffer __pyx_pybuffer_indexer;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  Py_ssize_t __pyx_t_1;
  __pyx_t_5numpy_float64_t __pyx_t_2;
  int __pyx_t_3;
  int __pyx_t_4;
  int __pyx_t_5;
  int __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;
  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;
  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_axis0_float64_float64", 0);
  __pyx_pybuffer_indexer.pybuffer.buf = NULL;
  __pyx_pybuffer_indexer.refcount = 0;
  __pyx_pybuffernd_indexer.data = NULL;
  __pyx_pybuffernd_indexer.rcbuffer = &__pyx_pybuffer_indexer;
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer, (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[2]; __pyx_lineno = 3351; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_indexer.diminfo[0].strides = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_indexer.diminfo[0].shape = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.shape[0];

  /* "pandas/src/generated.pyx":3359
 *         float64_t fv
 * 
 *     n = len(indexer)             # <<<<<<<<<<<<<<
 *     k = values.shape[1]
 * 
 */
  __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_indexer)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3359; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_n = __pyx_t_1;

  /* "pandas/src/generated.pyx":3360
 * 
 *     n = len(indexer)
 *     k = values.shape[1]             # <<<<<<<<<<<<<<
 * 
 *     fv = fill_value
 */
  __pyx_v_k = (__pyx_v_values.shape[1]);

  /* "pandas/src/generated.pyx":3362
 *     k = values.shape[1]
 * 
 *     fv = fill_value             # <<<<<<<<<<<<<<
 * 
 *     IF True:
 */
  __pyx_t_2 = __pyx_PyFloat_AsDouble(__pyx_v_fill_value); if (unlikely((__pyx_t_2 == (npy_float64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3362; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_fv = __pyx_t_2;

  /* "pandas/src/generated.pyx":3370
 * 
 *         #GH3130
 *         if (values.strides[1] == out.strides[1] and             # <<<<<<<<<<<<<<
 *             values.strides[1] == sizeof(float64_t) and
 *             sizeof(float64_t) * n >= 256):
 */
  __pyx_t_3 = (((__pyx_v_values.strides[1]) == (__pyx_v_out.strides[1])) != 0);
  if (__pyx_t_3) {

    /* "pandas/src/generated.pyx":3371
 *         #GH3130
 *         if (values.strides[1] == out.strides[1] and
 *             values.strides[1] == sizeof(float64_t) and             # <<<<<<<<<<<<<<
 *             sizeof(float64_t) * n >= 256):
 * 
 */
    __pyx_t_4 = (((__pyx_v_values.strides[1]) == (sizeof(__pyx_t_5numpy_float64_t))) != 0);
    if (__pyx_t_4) {

      /* "pandas/src/generated.pyx":3372
 *         if (values.strides[1] == out.strides[1] and
 *             values.strides[1] == sizeof(float64_t) and
 *             sizeof(float64_t) * n >= 256):             # <<<<<<<<<<<<<<
 * 
 *             for i from 0 <= i < n:
 */
      __pyx_t_5 = ((((sizeof(__pyx_t_5numpy_float64_t)) * __pyx_v_n) >= 256) != 0);
      __pyx_t_6 = __pyx_t_5;
    } else {
      __pyx_t_6 = __pyx_t_4;
    }
    __pyx_t_4 = __pyx_t_6;
  } else {
    __pyx_t_4 = __pyx_t_3;
  }
  if (__pyx_t_4) {

    /* "pandas/src/generated.pyx":3374
 *             sizeof(float64_t) * n >= 256):
 * 
 *             for i from 0 <= i < n:             # <<<<<<<<<<<<<<
 *                 idx = indexer[i]
 *                 if idx == -1:
 */
    __pyx_t_1 = __pyx_v_n;
    for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_1; __pyx_v_i++) {

      /* "pandas/src/generated.pyx":3375
 * 
 *             for i from 0 <= i < n:
 *                 idx = indexer[i]             # <<<<<<<<<<<<<<
 *                 if idx == -1:
 *                     for j from 0 <= j < k:
 */
      __pyx_t_7 = __pyx_v_i;
      __pyx_v_idx = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_7, __pyx_pybuffernd_indexer.diminfo[0].strides));

      /* "pandas/src/generated.pyx":3376
 *             for i from 0 <= i < n:
 *                 idx = indexer[i]
 *                 if idx == -1:             # <<<<<<<<<<<<<<
 *                     for j from 0 <= j < k:
 *                         out[i, j] = fv
 */
      __pyx_t_4 = ((__pyx_v_idx == -1) != 0);
      if (__pyx_t_4) {

        /* "pandas/src/generated.pyx":3377
 *                 idx = indexer[i]
 *                 if idx == -1:
 *                     for j from 0 <= j < k:             # <<<<<<<<<<<<<<
 *                         out[i, j] = fv
 *                 else:
 */
        __pyx_t_8 = __pyx_v_k;
        for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_8; __pyx_v_j++) {

          /* "pandas/src/generated.pyx":3378
 *                 if idx == -1:
 *                     for j from 0 <= j < k:
 *                         out[i, j] = fv             # <<<<<<<<<<<<<<
 *                 else:
 *                     v = &values[idx, 0]
 */
          __pyx_t_9 = __pyx_v_i;
          __pyx_t_10 = __pyx_v_j;
          *((__pyx_t_5numpy_float64_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_out.data + __pyx_t_9 * __pyx_v_out.strides[0]) ) + __pyx_t_10 * __pyx_v_out.strides[1]) )) = __pyx_v_fv;
        }
        goto __pyx_L6;
      }
      /*else*/ {

        /* "pandas/src/generated.pyx":3380
 *                         out[i, j] = fv
 *                 else:
 *                     v = &values[idx, 0]             # <<<<<<<<<<<<<<
 *                     o = &out[i, 0]
 *                     memmove(o, v, <size_t>(sizeof(float64_t) * k))
 */
        __pyx_t_8 = __pyx_v_idx;
        __pyx_t_11 = 0;
        __pyx_v_v = (&(*((__pyx_t_5numpy_float64_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_values.data + __pyx_t_8 * __pyx_v_values.strides[0]) ) + __pyx_t_11 * __pyx_v_values.strides[1]) ))));

        /* "pandas/src/generated.pyx":3381
 *                 else:
 *                     v = &values[idx, 0]
 *                     o = &out[i, 0]             # <<<<<<<<<<<<<<
 *                     memmove(o, v, <size_t>(sizeof(float64_t) * k))
 *             return
 */
        __pyx_t_12 = __pyx_v_i;
        __pyx_t_13 = 0;
        __pyx_v_o = (&(*((__pyx_t_5numpy_float64_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_out.data + __pyx_t_12 * __pyx_v_out.strides[0]) ) + __pyx_t_13 * __pyx_v_out.strides[1]) ))));

        /* "pandas/src/generated.pyx":3382
 *                     v = &values[idx, 0]
 *                     o = &out[i, 0]
 *                     memmove(o, v, <size_t>(sizeof(float64_t) * k))             # <<<<<<<<<<<<<<
 *             return
 * 
 */
        memmove(__pyx_v_o, __pyx_v_v, ((size_t)((sizeof(__pyx_t_5numpy_float64_t)) * __pyx_v_k)));
      }
      __pyx_L6:;
    }

    /* "pandas/src/generated.pyx":3383
 *                     o = &out[i, 0]
 *                     memmove(o, v, <size_t>(sizeof(float64_t) * k))
 *             return             # <<<<<<<<<<<<<<
 * 
 *     for i from 0 <= i < n:
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_r = Py_None; __Pyx_INCREF(Py_None);
    goto __pyx_L0;
  }

  /* "pandas/src/generated.pyx":3385
 *             return
 * 
 *     for i from 0 <= i < n:             # <<<<<<<<<<<<<<
 *         idx = indexer[i]
 *         if idx == -1:
 */
  __pyx_t_1 = __pyx_v_n;
  for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_1; __pyx_v_i++) {

    /* "pandas/src/generated.pyx":3386
 * 
 *     for i from 0 <= i < n:
 *         idx = indexer[i]             # <<<<<<<<<<<<<<
 *         if idx == -1:
 *             for j from 0 <= j < k:
 */
    __pyx_t_14 = __pyx_v_i;
    __pyx_v_idx = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_indexer.diminfo[0].strides));

    /* "pandas/src/generated.pyx":3387
 *     for i from 0 <= i < n:
 *         idx = indexer[i]
 *         if idx == -1:             # <<<<<<<<<<<<<<
 *             for j from 0 <= j < k:
 *                 out[i, j] = fv
 */
    __pyx_t_4 = ((__pyx_v_idx == -1) != 0);
    if (__pyx_t_4) {

      /* "pandas/src/generated.pyx":3388
 *         idx = indexer[i]
 *         if idx == -1:
 *             for j from 0 <= j < k:             # <<<<<<<<<<<<<<
 *                 out[i, j] = fv
 *         else:
 */
      __pyx_t_15 = __pyx_v_k;
      for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_15; __pyx_v_j++) {

        /* "pandas/src/generated.pyx":3389
 *         if idx == -1:
 *             for j from 0 <= j < k:
 *                 out[i, j] = fv             # <<<<<<<<<<<<<<
 *         else:
 *             for j from 0 <= j < k:
 */
        __pyx_t_16 = __pyx_v_i;
        __pyx_t_17 = __pyx_v_j;
        *((__pyx_t_5numpy_float64_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_out.data + __pyx_t_16 * __pyx_v_out.strides[0]) ) + __pyx_t_17 * __pyx_v_out.strides[1]) )) = __pyx_v_fv;
      }
      goto __pyx_L11;
    }
    /*else*/ {

      /* "pandas/src/generated.pyx":3391
 *                 out[i, j] = fv
 *         else:
 *             for j from 0 <= j < k:             # <<<<<<<<<<<<<<
 *                 out[i, j] = values[idx, j]
 * 
 */
      __pyx_t_15 = __pyx_v_k;
      for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_15; __pyx_v_j++) {

        /* "pandas/src/generated.pyx":3392
 *         else:
 *             for j from 0 <= j < k:
 *                 out[i, j] = values[idx, j]             # <<<<<<<<<<<<<<
 * 
 * @cython.wraparound(False)
 */
        __pyx_t_18 = __pyx_v_idx;
        __pyx_t_19 = __pyx_v_j;
        __pyx_t_20 = __pyx_v_i;
        __pyx_t_21 = __pyx_v_j;
        *((__pyx_t_5numpy_float64_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_out.data + __pyx_t_20 * __pyx_v_out.strides[0]) ) + __pyx_t_21 * __pyx_v_out.strides[1]) )) = (*((__pyx_t_5numpy_float64_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_values.data + __pyx_t_18 * __pyx_v_values.strides[0]) ) + __pyx_t_19 * __pyx_v_values.strides[1]) )));
      }
    }
    __pyx_L11:;
  }

  /* "pandas/src/generated.pyx":3351
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def take_2d_axis0_float64_float64(float64_t[:, :] values,             # <<<<<<<<<<<<<<
 *                                     ndarray[int64_t] indexer,
 *                                     float64_t[:, :] out,
 */

  /* function exit code */
  __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_pybuffernd_indexer.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas.algos.take_2d_axis0_float64_float64", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer);
  __pyx_L2:;
  __PYX_XDEC_MEMVIEW(&__pyx_v_values, 1);
  __PYX_XDEC_MEMVIEW(&__pyx_v_out, 1);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/src/generated.pyx":3396
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def take_2d_axis0_object_object(object[:, :] values,             # <<<<<<<<<<<<<<
 *                                     ndarray[int64_t] indexer,
 *                                     object[:, :] out,
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pandas_5algos_297take_2d_axis0_object_object(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_5algos_297take_2d_axis0_object_object = {__Pyx_NAMESTR("take_2d_axis0_object_object"), (PyCFunction)__pyx_pw_6pandas_5algos_297take_2d_axis0_object_object, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pw_6pandas_5algos_297take_2d_axis0_object_object(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  __Pyx_memviewslice __pyx_v_values = { 0, 0, { 0 }, { 0 }, { 0 } };
  PyArrayObject *__pyx_v_indexer = 0;
  __Pyx_memviewslice __pyx_v_out = { 0, 0, { 0 }, { 0 }, { 0 } };
  PyObject *__pyx_v_fill_value = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("take_2d_axis0_object_object (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_values,&__pyx_n_s_indexer,&__pyx_n_s_out,&__pyx_n_s_fill_value,0};
    PyObject* values[4] = {0,0,0,0};
    values[3] = __pyx_k__153;
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_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 (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_indexer)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("take_2d_axis0_object_object", 0, 3, 4, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3396; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_out)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("take_2d_axis0_object_object", 0, 3, 4, 2); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3396; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  3:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_fill_value);
          if (value) { values[3] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "take_2d_axis0_object_object") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3396; __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_values = __Pyx_PyObject_to_MemoryviewSlice_dsds_object(values[0]); if (unlikely(!__pyx_v_values.memview)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3396; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_v_indexer = ((PyArrayObject *)values[1]);
    __pyx_v_out = __Pyx_PyObject_to_MemoryviewSlice_dsds_object(values[2]); if (unlikely(!__pyx_v_out.memview)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3398; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_v_fill_value = values[3];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("take_2d_axis0_object_object", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3396; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas.algos.take_2d_axis0_object_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_indexer), __pyx_ptype_5numpy_ndarray, 1, "indexer", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3397; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_296take_2d_axis0_object_object(__pyx_self, __pyx_v_values, __pyx_v_indexer, __pyx_v_out, __pyx_v_fill_value);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pandas_5algos_296take_2d_axis0_object_object(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_values, PyArrayObject *__pyx_v_indexer, __Pyx_memviewslice __pyx_v_out, PyObject *__pyx_v_fill_value) {
  Py_ssize_t __pyx_v_i;
  Py_ssize_t __pyx_v_j;
  Py_ssize_t __pyx_v_k;
  Py_ssize_t __pyx_v_n;
  Py_ssize_t __pyx_v_idx;
  PyObject *__pyx_v_fv = 0;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_indexer;
  __Pyx_Buffer __pyx_pybuffer_indexer;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  Py_ssize_t __pyx_t_1;
  Py_ssize_t __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;
  PyObject **__pyx_t_7;
  PyObject *__pyx_t_8 = NULL;
  Py_ssize_t __pyx_t_9;
  Py_ssize_t __pyx_t_10;
  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("take_2d_axis0_object_object", 0);
  __pyx_pybuffer_indexer.pybuffer.buf = NULL;
  __pyx_pybuffer_indexer.refcount = 0;
  __pyx_pybuffernd_indexer.data = NULL;
  __pyx_pybuffernd_indexer.rcbuffer = &__pyx_pybuffer_indexer;
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer, (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[2]; __pyx_lineno = 3396; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_indexer.diminfo[0].strides = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_indexer.diminfo[0].shape = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.shape[0];

  /* "pandas/src/generated.pyx":3404
 *         object fv
 * 
 *     n = len(indexer)             # <<<<<<<<<<<<<<
 *     k = values.shape[1]
 * 
 */
  __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_indexer)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3404; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_n = __pyx_t_1;

  /* "pandas/src/generated.pyx":3405
 * 
 *     n = len(indexer)
 *     k = values.shape[1]             # <<<<<<<<<<<<<<
 * 
 *     fv = fill_value
 */
  __pyx_v_k = (__pyx_v_values.shape[1]);

  /* "pandas/src/generated.pyx":3407
 *     k = values.shape[1]
 * 
 *     fv = fill_value             # <<<<<<<<<<<<<<
 * 
 *     IF False:
 */
  __Pyx_INCREF(__pyx_v_fill_value);
  __pyx_v_fv = __pyx_v_fill_value;

  /* "pandas/src/generated.pyx":3430
 *             return
 * 
 *     for i from 0 <= i < n:             # <<<<<<<<<<<<<<
 *         idx = indexer[i]
 *         if idx == -1:
 */
  __pyx_t_1 = __pyx_v_n;
  for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_1; __pyx_v_i++) {

    /* "pandas/src/generated.pyx":3431
 * 
 *     for i from 0 <= i < n:
 *         idx = indexer[i]             # <<<<<<<<<<<<<<
 *         if idx == -1:
 *             for j from 0 <= j < k:
 */
    __pyx_t_2 = __pyx_v_i;
    __pyx_v_idx = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_2, __pyx_pybuffernd_indexer.diminfo[0].strides));

    /* "pandas/src/generated.pyx":3432
 *     for i from 0 <= i < n:
 *         idx = indexer[i]
 *         if idx == -1:             # <<<<<<<<<<<<<<
 *             for j from 0 <= j < k:
 *                 out[i, j] = fv
 */
    __pyx_t_3 = ((__pyx_v_idx == -1) != 0);
    if (__pyx_t_3) {

      /* "pandas/src/generated.pyx":3433
 *         idx = indexer[i]
 *         if idx == -1:
 *             for j from 0 <= j < k:             # <<<<<<<<<<<<<<
 *                 out[i, j] = fv
 *         else:
 */
      __pyx_t_4 = __pyx_v_k;
      for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_4; __pyx_v_j++) {

        /* "pandas/src/generated.pyx":3434
 *         if idx == -1:
 *             for j from 0 <= j < k:
 *                 out[i, j] = fv             # <<<<<<<<<<<<<<
 *         else:
 *             for j from 0 <= j < k:
 */
        __pyx_t_5 = __pyx_v_i;
        __pyx_t_6 = __pyx_v_j;
        __pyx_t_7 = ((PyObject * *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_out.data + __pyx_t_5 * __pyx_v_out.strides[0]) ) + __pyx_t_6 * __pyx_v_out.strides[1]) ));
        __Pyx_GOTREF(*__pyx_t_7);
        __Pyx_INCREF(__pyx_v_fv); __Pyx_DECREF(*__pyx_t_7);
        *__pyx_t_7 = __pyx_v_fv;
        __Pyx_GIVEREF(*__pyx_t_7);
      }
      goto __pyx_L5;
    }
    /*else*/ {

      /* "pandas/src/generated.pyx":3436
 *                 out[i, j] = fv
 *         else:
 *             for j from 0 <= j < k:             # <<<<<<<<<<<<<<
 *                 out[i, j] = values[idx, j]
 * 
 */
      __pyx_t_4 = __pyx_v_k;
      for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_4; __pyx_v_j++) {

        /* "pandas/src/generated.pyx":3437
 *         else:
 *             for j from 0 <= j < k:
 *                 out[i, j] = values[idx, j]             # <<<<<<<<<<<<<<
 * 
 * 
 */
        __pyx_t_9 = __pyx_v_idx;
        __pyx_t_10 = __pyx_v_j;
        __pyx_t_8 = (PyObject *) *((PyObject * *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_values.data + __pyx_t_9 * __pyx_v_values.strides[0]) ) + __pyx_t_10 * __pyx_v_values.strides[1]) ));
        __Pyx_INCREF((PyObject*)__pyx_t_8);
        __pyx_t_11 = __pyx_v_i;
        __pyx_t_12 = __pyx_v_j;
        __pyx_t_7 = ((PyObject * *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_out.data + __pyx_t_11 * __pyx_v_out.strides[0]) ) + __pyx_t_12 * __pyx_v_out.strides[1]) ));
        __Pyx_GOTREF(*__pyx_t_7);
        __Pyx_INCREF(__pyx_t_8); __Pyx_DECREF(*__pyx_t_7);
        *__pyx_t_7 = __pyx_t_8;
        __Pyx_GIVEREF(*__pyx_t_7);
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      }
    }
    __pyx_L5:;
  }

  /* "pandas/src/generated.pyx":3396
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def take_2d_axis0_object_object(object[:, :] values,             # <<<<<<<<<<<<<<
 *                                     ndarray[int64_t] indexer,
 *                                     object[:, :] out,
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_8);
  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
    __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas.algos.take_2d_axis0_object_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer);
  __pyx_L2:;
  __Pyx_XDECREF(__pyx_v_fv);
  __PYX_XDEC_MEMVIEW(&__pyx_v_values, 1);
  __PYX_XDEC_MEMVIEW(&__pyx_v_out, 1);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/src/generated.pyx":3442
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def take_2d_axis1_bool_bool(uint8_t[:, :] values,             # <<<<<<<<<<<<<<
 *                                     ndarray[int64_t] indexer,
 *                                     uint8_t[:, :] out,
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pandas_5algos_299take_2d_axis1_bool_bool(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_5algos_299take_2d_axis1_bool_bool = {__Pyx_NAMESTR("take_2d_axis1_bool_bool"), (PyCFunction)__pyx_pw_6pandas_5algos_299take_2d_axis1_bool_bool, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pw_6pandas_5algos_299take_2d_axis1_bool_bool(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  __Pyx_memviewslice __pyx_v_values = { 0, 0, { 0 }, { 0 }, { 0 } };
  PyArrayObject *__pyx_v_indexer = 0;
  __Pyx_memviewslice __pyx_v_out = { 0, 0, { 0 }, { 0 }, { 0 } };
  PyObject *__pyx_v_fill_value = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("take_2d_axis1_bool_bool (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_values,&__pyx_n_s_indexer,&__pyx_n_s_out,&__pyx_n_s_fill_value,0};
    PyObject* values[4] = {0,0,0,0};
    values[3] = __pyx_k__154;
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_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 (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_indexer)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("take_2d_axis1_bool_bool", 0, 3, 4, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3442; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_out)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("take_2d_axis1_bool_bool", 0, 3, 4, 2); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3442; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  3:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_fill_value);
          if (value) { values[3] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "take_2d_axis1_bool_bool") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3442; __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_values = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_uint8_t(values[0]); if (unlikely(!__pyx_v_values.memview)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3442; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_v_indexer = ((PyArrayObject *)values[1]);
    __pyx_v_out = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_uint8_t(values[2]); if (unlikely(!__pyx_v_out.memview)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3444; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_v_fill_value = values[3];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("take_2d_axis1_bool_bool", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3442; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas.algos.take_2d_axis1_bool_bool", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_indexer), __pyx_ptype_5numpy_ndarray, 1, "indexer", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3443; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_298take_2d_axis1_bool_bool(__pyx_self, __pyx_v_values, __pyx_v_indexer, __pyx_v_out, __pyx_v_fill_value);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pandas_5algos_298take_2d_axis1_bool_bool(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_values, PyArrayObject *__pyx_v_indexer, __Pyx_memviewslice __pyx_v_out, PyObject *__pyx_v_fill_value) {
  Py_ssize_t __pyx_v_i;
  Py_ssize_t __pyx_v_j;
  Py_ssize_t __pyx_v_k;
  Py_ssize_t __pyx_v_n;
  Py_ssize_t __pyx_v_idx;
  __pyx_t_5numpy_uint8_t __pyx_v_fv;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_indexer;
  __Pyx_Buffer __pyx_pybuffer_indexer;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  int __pyx_t_3;
  int __pyx_t_4;
  int __pyx_t_5;
  __pyx_t_5numpy_uint8_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;
  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("take_2d_axis1_bool_bool", 0);
  __pyx_pybuffer_indexer.pybuffer.buf = NULL;
  __pyx_pybuffer_indexer.refcount = 0;
  __pyx_pybuffernd_indexer.data = NULL;
  __pyx_pybuffernd_indexer.rcbuffer = &__pyx_pybuffer_indexer;
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer, (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[2]; __pyx_lineno = 3442; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_indexer.diminfo[0].strides = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_indexer.diminfo[0].shape = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.shape[0];

  /* "pandas/src/generated.pyx":3450
 *         uint8_t fv
 * 
 *     n = len(values)             # <<<<<<<<<<<<<<
 *     k = len(indexer)
 * 
 */
  __pyx_t_1 = __pyx_memoryview_fromslice(__pyx_v_values, 2, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_5numpy_uint8_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_5numpy_uint8_t, 0);; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3450; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3450; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_n = __pyx_t_2;

  /* "pandas/src/generated.pyx":3451
 * 
 *     n = len(values)
 *     k = len(indexer)             # <<<<<<<<<<<<<<
 * 
 *     if n == 0 or k == 0:
 */
  __pyx_t_2 = PyObject_Length(((PyObject *)__pyx_v_indexer)); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3451; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_k = __pyx_t_2;

  /* "pandas/src/generated.pyx":3453
 *     k = len(indexer)
 * 
 *     if n == 0 or k == 0:             # <<<<<<<<<<<<<<
 *         return
 * 
 */
  __pyx_t_3 = ((__pyx_v_n == 0) != 0);
  if (!__pyx_t_3) {
    __pyx_t_4 = ((__pyx_v_k == 0) != 0);
    __pyx_t_5 = __pyx_t_4;
  } else {
    __pyx_t_5 = __pyx_t_3;
  }
  if (__pyx_t_5) {

    /* "pandas/src/generated.pyx":3454
 * 
 *     if n == 0 or k == 0:
 *         return             # <<<<<<<<<<<<<<
 * 
 *     fv = fill_value
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_r = Py_None; __Pyx_INCREF(Py_None);
    goto __pyx_L0;
  }

  /* "pandas/src/generated.pyx":3456
 *         return
 * 
 *     fv = fill_value             # <<<<<<<<<<<<<<
 * 
 *     for i from 0 <= i < n:
 */
  __pyx_t_6 = __Pyx_PyInt_As_npy_uint8(__pyx_v_fill_value); if (unlikely((__pyx_t_6 == (npy_uint8)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3456; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_fv = __pyx_t_6;

  /* "pandas/src/generated.pyx":3458
 *     fv = fill_value
 * 
 *     for i from 0 <= i < n:             # <<<<<<<<<<<<<<
 *         for j from 0 <= j < k:
 *             idx = indexer[j]
 */
  __pyx_t_2 = __pyx_v_n;
  for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_2; __pyx_v_i++) {

    /* "pandas/src/generated.pyx":3459
 * 
 *     for i from 0 <= i < n:
 *         for j from 0 <= j < k:             # <<<<<<<<<<<<<<
 *             idx = indexer[j]
 *             if idx == -1:
 */
    __pyx_t_7 = __pyx_v_k;
    for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_7; __pyx_v_j++) {

      /* "pandas/src/generated.pyx":3460
 *     for i from 0 <= i < n:
 *         for j from 0 <= j < k:
 *             idx = indexer[j]             # <<<<<<<<<<<<<<
 *             if idx == -1:
 *                 out[i, j] = fv
 */
      __pyx_t_8 = __pyx_v_j;
      __pyx_v_idx = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_indexer.diminfo[0].strides));

      /* "pandas/src/generated.pyx":3461
 *         for j from 0 <= j < k:
 *             idx = indexer[j]
 *             if idx == -1:             # <<<<<<<<<<<<<<
 *                 out[i, j] = fv
 *             else:
 */
      __pyx_t_5 = ((__pyx_v_idx == -1) != 0);
      if (__pyx_t_5) {

        /* "pandas/src/generated.pyx":3462
 *             idx = indexer[j]
 *             if idx == -1:
 *                 out[i, j] = fv             # <<<<<<<<<<<<<<
 *             else:
 *                 out[i, j] = values[i, idx]
 */
        __pyx_t_9 = __pyx_v_i;
        __pyx_t_10 = __pyx_v_j;
        *((__pyx_t_5numpy_uint8_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_out.data + __pyx_t_9 * __pyx_v_out.strides[0]) ) + __pyx_t_10 * __pyx_v_out.strides[1]) )) = __pyx_v_fv;
        goto __pyx_L8;
      }
      /*else*/ {

        /* "pandas/src/generated.pyx":3464
 *                 out[i, j] = fv
 *             else:
 *                 out[i, j] = values[i, idx]             # <<<<<<<<<<<<<<
 * 
 * @cython.wraparound(False)
 */
        __pyx_t_11 = __pyx_v_i;
        __pyx_t_12 = __pyx_v_idx;
        __pyx_t_13 = __pyx_v_i;
        __pyx_t_14 = __pyx_v_j;
        *((__pyx_t_5numpy_uint8_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_out.data + __pyx_t_13 * __pyx_v_out.strides[0]) ) + __pyx_t_14 * __pyx_v_out.strides[1]) )) = (*((__pyx_t_5numpy_uint8_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_values.data + __pyx_t_11 * __pyx_v_values.strides[0]) ) + __pyx_t_12 * __pyx_v_values.strides[1]) )));
      }
      __pyx_L8:;
    }
  }

  /* "pandas/src/generated.pyx":3442
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def take_2d_axis1_bool_bool(uint8_t[:, :] values,             # <<<<<<<<<<<<<<
 *                                     ndarray[int64_t] indexer,
 *                                     uint8_t[:, :] out,
 */

  /* function exit code */
  __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_pybuffernd_indexer.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas.algos.take_2d_axis1_bool_bool", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer);
  __pyx_L2:;
  __PYX_XDEC_MEMVIEW(&__pyx_v_values, 1);
  __PYX_XDEC_MEMVIEW(&__pyx_v_out, 1);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/src/generated.pyx":3468
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def take_2d_axis1_bool_object(uint8_t[:, :] values,             # <<<<<<<<<<<<<<
 *                                     ndarray[int64_t] indexer,
 *                                     object[:, :] out,
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pandas_5algos_301take_2d_axis1_bool_object(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_5algos_301take_2d_axis1_bool_object = {__Pyx_NAMESTR("take_2d_axis1_bool_object"), (PyCFunction)__pyx_pw_6pandas_5algos_301take_2d_axis1_bool_object, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pw_6pandas_5algos_301take_2d_axis1_bool_object(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  __Pyx_memviewslice __pyx_v_values = { 0, 0, { 0 }, { 0 }, { 0 } };
  PyArrayObject *__pyx_v_indexer = 0;
  __Pyx_memviewslice __pyx_v_out = { 0, 0, { 0 }, { 0 }, { 0 } };
  PyObject *__pyx_v_fill_value = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("take_2d_axis1_bool_object (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_values,&__pyx_n_s_indexer,&__pyx_n_s_out,&__pyx_n_s_fill_value,0};
    PyObject* values[4] = {0,0,0,0};
    values[3] = __pyx_k__155;
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_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 (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_indexer)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("take_2d_axis1_bool_object", 0, 3, 4, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3468; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_out)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("take_2d_axis1_bool_object", 0, 3, 4, 2); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3468; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  3:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_fill_value);
          if (value) { values[3] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "take_2d_axis1_bool_object") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3468; __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_values = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_uint8_t(values[0]); if (unlikely(!__pyx_v_values.memview)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3468; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_v_indexer = ((PyArrayObject *)values[1]);
    __pyx_v_out = __Pyx_PyObject_to_MemoryviewSlice_dsds_object(values[2]); if (unlikely(!__pyx_v_out.memview)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3470; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_v_fill_value = values[3];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("take_2d_axis1_bool_object", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3468; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas.algos.take_2d_axis1_bool_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_indexer), __pyx_ptype_5numpy_ndarray, 1, "indexer", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3469; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_300take_2d_axis1_bool_object(__pyx_self, __pyx_v_values, __pyx_v_indexer, __pyx_v_out, __pyx_v_fill_value);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pandas_5algos_300take_2d_axis1_bool_object(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_values, PyArrayObject *__pyx_v_indexer, __Pyx_memviewslice __pyx_v_out, PyObject *__pyx_v_fill_value) {
  Py_ssize_t __pyx_v_i;
  Py_ssize_t __pyx_v_j;
  Py_ssize_t __pyx_v_k;
  Py_ssize_t __pyx_v_n;
  Py_ssize_t __pyx_v_idx;
  PyObject *__pyx_v_fv = 0;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_indexer;
  __Pyx_Buffer __pyx_pybuffer_indexer;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  int __pyx_t_3;
  int __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;
  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("take_2d_axis1_bool_object", 0);
  __pyx_pybuffer_indexer.pybuffer.buf = NULL;
  __pyx_pybuffer_indexer.refcount = 0;
  __pyx_pybuffernd_indexer.data = NULL;
  __pyx_pybuffernd_indexer.rcbuffer = &__pyx_pybuffer_indexer;
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer, (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[2]; __pyx_lineno = 3468; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_indexer.diminfo[0].strides = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_indexer.diminfo[0].shape = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.shape[0];

  /* "pandas/src/generated.pyx":3476
 *         object fv
 * 
 *     n = len(values)             # <<<<<<<<<<<<<<
 *     k = len(indexer)
 * 
 */
  __pyx_t_1 = __pyx_memoryview_fromslice(__pyx_v_values, 2, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_5numpy_uint8_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_5numpy_uint8_t, 0);; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3476; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3476; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_n = __pyx_t_2;

  /* "pandas/src/generated.pyx":3477
 * 
 *     n = len(values)
 *     k = len(indexer)             # <<<<<<<<<<<<<<
 * 
 *     if n == 0 or k == 0:
 */
  __pyx_t_2 = PyObject_Length(((PyObject *)__pyx_v_indexer)); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3477; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_k = __pyx_t_2;

  /* "pandas/src/generated.pyx":3479
 *     k = len(indexer)
 * 
 *     if n == 0 or k == 0:             # <<<<<<<<<<<<<<
 *         return
 * 
 */
  __pyx_t_3 = ((__pyx_v_n == 0) != 0);
  if (!__pyx_t_3) {
    __pyx_t_4 = ((__pyx_v_k == 0) != 0);
    __pyx_t_5 = __pyx_t_4;
  } else {
    __pyx_t_5 = __pyx_t_3;
  }
  if (__pyx_t_5) {

    /* "pandas/src/generated.pyx":3480
 * 
 *     if n == 0 or k == 0:
 *         return             # <<<<<<<<<<<<<<
 * 
 *     fv = fill_value
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_r = Py_None; __Pyx_INCREF(Py_None);
    goto __pyx_L0;
  }

  /* "pandas/src/generated.pyx":3482
 *         return
 * 
 *     fv = fill_value             # <<<<<<<<<<<<<<
 * 
 *     for i from 0 <= i < n:
 */
  __Pyx_INCREF(__pyx_v_fill_value);
  __pyx_v_fv = __pyx_v_fill_value;

  /* "pandas/src/generated.pyx":3484
 *     fv = fill_value
 * 
 *     for i from 0 <= i < n:             # <<<<<<<<<<<<<<
 *         for j from 0 <= j < k:
 *             idx = indexer[j]
 */
  __pyx_t_2 = __pyx_v_n;
  for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_2; __pyx_v_i++) {

    /* "pandas/src/generated.pyx":3485
 * 
 *     for i from 0 <= i < n:
 *         for j from 0 <= j < k:             # <<<<<<<<<<<<<<
 *             idx = indexer[j]
 *             if idx == -1:
 */
    __pyx_t_6 = __pyx_v_k;
    for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_6; __pyx_v_j++) {

      /* "pandas/src/generated.pyx":3486
 *     for i from 0 <= i < n:
 *         for j from 0 <= j < k:
 *             idx = indexer[j]             # <<<<<<<<<<<<<<
 *             if idx == -1:
 *                 out[i, j] = fv
 */
      __pyx_t_7 = __pyx_v_j;
      __pyx_v_idx = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_7, __pyx_pybuffernd_indexer.diminfo[0].strides));

      /* "pandas/src/generated.pyx":3487
 *         for j from 0 <= j < k:
 *             idx = indexer[j]
 *             if idx == -1:             # <<<<<<<<<<<<<<
 *                 out[i, j] = fv
 *             else:
 */
      __pyx_t_5 = ((__pyx_v_idx == -1) != 0);
      if (__pyx_t_5) {

        /* "pandas/src/generated.pyx":3488
 *             idx = indexer[j]
 *             if idx == -1:
 *                 out[i, j] = fv             # <<<<<<<<<<<<<<
 *             else:
 *                 out[i, j] = True if values[i, idx] > 0 else False
 */
        __pyx_t_8 = __pyx_v_i;
        __pyx_t_9 = __pyx_v_j;
        __pyx_t_10 = ((PyObject * *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_out.data + __pyx_t_8 * __pyx_v_out.strides[0]) ) + __pyx_t_9 * __pyx_v_out.strides[1]) ));
        __Pyx_GOTREF(*__pyx_t_10);
        __Pyx_INCREF(__pyx_v_fv); __Pyx_DECREF(*__pyx_t_10);
        *__pyx_t_10 = __pyx_v_fv;
        __Pyx_GIVEREF(*__pyx_t_10);
        goto __pyx_L8;
      }
      /*else*/ {

        /* "pandas/src/generated.pyx":3490
 *                 out[i, j] = fv
 *             else:
 *                 out[i, j] = True if values[i, idx] > 0 else False             # <<<<<<<<<<<<<<
 * 
 * @cython.wraparound(False)
 */
        __pyx_t_11 = __pyx_v_i;
        __pyx_t_12 = __pyx_v_idx;
        if ((((*((__pyx_t_5numpy_uint8_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_values.data + __pyx_t_11 * __pyx_v_values.strides[0]) ) + __pyx_t_12 * __pyx_v_values.strides[1]) ))) > 0) != 0)) {
          __Pyx_INCREF(Py_True);
          __pyx_t_1 = Py_True;
        } else {
          __Pyx_INCREF(Py_False);
          __pyx_t_1 = Py_False;
        }
        __pyx_t_13 = __pyx_v_i;
        __pyx_t_14 = __pyx_v_j;
        __pyx_t_10 = ((PyObject * *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_out.data + __pyx_t_13 * __pyx_v_out.strides[0]) ) + __pyx_t_14 * __pyx_v_out.strides[1]) ));
        __Pyx_GOTREF(*__pyx_t_10);
        __Pyx_INCREF(__pyx_t_1); __Pyx_DECREF(*__pyx_t_10);
        *__pyx_t_10 = __pyx_t_1;
        __Pyx_GIVEREF(*__pyx_t_10);
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      }
      __pyx_L8:;
    }
  }

  /* "pandas/src/generated.pyx":3468
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def take_2d_axis1_bool_object(uint8_t[:, :] values,             # <<<<<<<<<<<<<<
 *                                     ndarray[int64_t] indexer,
 *                                     object[:, :] out,
 */

  /* function exit code */
  __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_pybuffernd_indexer.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas.algos.take_2d_axis1_bool_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer);
  __pyx_L2:;
  __Pyx_XDECREF(__pyx_v_fv);
  __PYX_XDEC_MEMVIEW(&__pyx_v_values, 1);
  __PYX_XDEC_MEMVIEW(&__pyx_v_out, 1);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/src/generated.pyx":3494
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def take_2d_axis1_int8_int8(int8_t[:, :] values,             # <<<<<<<<<<<<<<
 *                                     ndarray[int64_t] indexer,
 *                                     int8_t[:, :] out,
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pandas_5algos_303take_2d_axis1_int8_int8(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_5algos_303take_2d_axis1_int8_int8 = {__Pyx_NAMESTR("take_2d_axis1_int8_int8"), (PyCFunction)__pyx_pw_6pandas_5algos_303take_2d_axis1_int8_int8, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pw_6pandas_5algos_303take_2d_axis1_int8_int8(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  __Pyx_memviewslice __pyx_v_values = { 0, 0, { 0 }, { 0 }, { 0 } };
  PyArrayObject *__pyx_v_indexer = 0;
  __Pyx_memviewslice __pyx_v_out = { 0, 0, { 0 }, { 0 }, { 0 } };
  PyObject *__pyx_v_fill_value = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("take_2d_axis1_int8_int8 (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_values,&__pyx_n_s_indexer,&__pyx_n_s_out,&__pyx_n_s_fill_value,0};
    PyObject* values[4] = {0,0,0,0};
    values[3] = __pyx_k__156;
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_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 (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_indexer)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("take_2d_axis1_int8_int8", 0, 3, 4, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3494; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_out)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("take_2d_axis1_int8_int8", 0, 3, 4, 2); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3494; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  3:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_fill_value);
          if (value) { values[3] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "take_2d_axis1_int8_int8") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3494; __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_values = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_int8_t(values[0]); if (unlikely(!__pyx_v_values.memview)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3494; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_v_indexer = ((PyArrayObject *)values[1]);
    __pyx_v_out = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_int8_t(values[2]); if (unlikely(!__pyx_v_out.memview)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3496; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_v_fill_value = values[3];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("take_2d_axis1_int8_int8", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3494; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas.algos.take_2d_axis1_int8_int8", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_indexer), __pyx_ptype_5numpy_ndarray, 1, "indexer", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3495; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_302take_2d_axis1_int8_int8(__pyx_self, __pyx_v_values, __pyx_v_indexer, __pyx_v_out, __pyx_v_fill_value);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pandas_5algos_302take_2d_axis1_int8_int8(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_values, PyArrayObject *__pyx_v_indexer, __Pyx_memviewslice __pyx_v_out, PyObject *__pyx_v_fill_value) {
  Py_ssize_t __pyx_v_i;
  Py_ssize_t __pyx_v_j;
  Py_ssize_t __pyx_v_k;
  Py_ssize_t __pyx_v_n;
  Py_ssize_t __pyx_v_idx;
  __pyx_t_5numpy_int8_t __pyx_v_fv;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_indexer;
  __Pyx_Buffer __pyx_pybuffer_indexer;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  int __pyx_t_3;
  int __pyx_t_4;
  int __pyx_t_5;
  __pyx_t_5numpy_int8_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;
  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("take_2d_axis1_int8_int8", 0);
  __pyx_pybuffer_indexer.pybuffer.buf = NULL;
  __pyx_pybuffer_indexer.refcount = 0;
  __pyx_pybuffernd_indexer.data = NULL;
  __pyx_pybuffernd_indexer.rcbuffer = &__pyx_pybuffer_indexer;
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer, (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[2]; __pyx_lineno = 3494; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_indexer.diminfo[0].strides = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_indexer.diminfo[0].shape = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.shape[0];

  /* "pandas/src/generated.pyx":3502
 *         int8_t fv
 * 
 *     n = len(values)             # <<<<<<<<<<<<<<
 *     k = len(indexer)
 * 
 */
  __pyx_t_1 = __pyx_memoryview_fromslice(__pyx_v_values, 2, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_5numpy_int8_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_5numpy_int8_t, 0);; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3502; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3502; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_n = __pyx_t_2;

  /* "pandas/src/generated.pyx":3503
 * 
 *     n = len(values)
 *     k = len(indexer)             # <<<<<<<<<<<<<<
 * 
 *     if n == 0 or k == 0:
 */
  __pyx_t_2 = PyObject_Length(((PyObject *)__pyx_v_indexer)); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3503; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_k = __pyx_t_2;

  /* "pandas/src/generated.pyx":3505
 *     k = len(indexer)
 * 
 *     if n == 0 or k == 0:             # <<<<<<<<<<<<<<
 *         return
 * 
 */
  __pyx_t_3 = ((__pyx_v_n == 0) != 0);
  if (!__pyx_t_3) {
    __pyx_t_4 = ((__pyx_v_k == 0) != 0);
    __pyx_t_5 = __pyx_t_4;
  } else {
    __pyx_t_5 = __pyx_t_3;
  }
  if (__pyx_t_5) {

    /* "pandas/src/generated.pyx":3506
 * 
 *     if n == 0 or k == 0:
 *         return             # <<<<<<<<<<<<<<
 * 
 *     fv = fill_value
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_r = Py_None; __Pyx_INCREF(Py_None);
    goto __pyx_L0;
  }

  /* "pandas/src/generated.pyx":3508
 *         return
 * 
 *     fv = fill_value             # <<<<<<<<<<<<<<
 * 
 *     for i from 0 <= i < n:
 */
  __pyx_t_6 = __Pyx_PyInt_As_npy_int8(__pyx_v_fill_value); if (unlikely((__pyx_t_6 == (npy_int8)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3508; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_fv = __pyx_t_6;

  /* "pandas/src/generated.pyx":3510
 *     fv = fill_value
 * 
 *     for i from 0 <= i < n:             # <<<<<<<<<<<<<<
 *         for j from 0 <= j < k:
 *             idx = indexer[j]
 */
  __pyx_t_2 = __pyx_v_n;
  for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_2; __pyx_v_i++) {

    /* "pandas/src/generated.pyx":3511
 * 
 *     for i from 0 <= i < n:
 *         for j from 0 <= j < k:             # <<<<<<<<<<<<<<
 *             idx = indexer[j]
 *             if idx == -1:
 */
    __pyx_t_7 = __pyx_v_k;
    for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_7; __pyx_v_j++) {

      /* "pandas/src/generated.pyx":3512
 *     for i from 0 <= i < n:
 *         for j from 0 <= j < k:
 *             idx = indexer[j]             # <<<<<<<<<<<<<<
 *             if idx == -1:
 *                 out[i, j] = fv
 */
      __pyx_t_8 = __pyx_v_j;
      __pyx_v_idx = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_indexer.diminfo[0].strides));

      /* "pandas/src/generated.pyx":3513
 *         for j from 0 <= j < k:
 *             idx = indexer[j]
 *             if idx == -1:             # <<<<<<<<<<<<<<
 *                 out[i, j] = fv
 *             else:
 */
      __pyx_t_5 = ((__pyx_v_idx == -1) != 0);
      if (__pyx_t_5) {

        /* "pandas/src/generated.pyx":3514
 *             idx = indexer[j]
 *             if idx == -1:
 *                 out[i, j] = fv             # <<<<<<<<<<<<<<
 *             else:
 *                 out[i, j] = values[i, idx]
 */
        __pyx_t_9 = __pyx_v_i;
        __pyx_t_10 = __pyx_v_j;
        *((__pyx_t_5numpy_int8_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_out.data + __pyx_t_9 * __pyx_v_out.strides[0]) ) + __pyx_t_10 * __pyx_v_out.strides[1]) )) = __pyx_v_fv;
        goto __pyx_L8;
      }
      /*else*/ {

        /* "pandas/src/generated.pyx":3516
 *                 out[i, j] = fv
 *             else:
 *                 out[i, j] = values[i, idx]             # <<<<<<<<<<<<<<
 * 
 * @cython.wraparound(False)
 */
        __pyx_t_11 = __pyx_v_i;
        __pyx_t_12 = __pyx_v_idx;
        __pyx_t_13 = __pyx_v_i;
        __pyx_t_14 = __pyx_v_j;
        *((__pyx_t_5numpy_int8_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_out.data + __pyx_t_13 * __pyx_v_out.strides[0]) ) + __pyx_t_14 * __pyx_v_out.strides[1]) )) = (*((__pyx_t_5numpy_int8_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_values.data + __pyx_t_11 * __pyx_v_values.strides[0]) ) + __pyx_t_12 * __pyx_v_values.strides[1]) )));
      }
      __pyx_L8:;
    }
  }

  /* "pandas/src/generated.pyx":3494
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def take_2d_axis1_int8_int8(int8_t[:, :] values,             # <<<<<<<<<<<<<<
 *                                     ndarray[int64_t] indexer,
 *                                     int8_t[:, :] out,
 */

  /* function exit code */
  __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_pybuffernd_indexer.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas.algos.take_2d_axis1_int8_int8", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer);
  __pyx_L2:;
  __PYX_XDEC_MEMVIEW(&__pyx_v_values, 1);
  __PYX_XDEC_MEMVIEW(&__pyx_v_out, 1);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/src/generated.pyx":3520
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def take_2d_axis1_int8_int32(int8_t[:, :] values,             # <<<<<<<<<<<<<<
 *                                     ndarray[int64_t] indexer,
 *                                     int32_t[:, :] out,
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pandas_5algos_305take_2d_axis1_int8_int32(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_5algos_305take_2d_axis1_int8_int32 = {__Pyx_NAMESTR("take_2d_axis1_int8_int32"), (PyCFunction)__pyx_pw_6pandas_5algos_305take_2d_axis1_int8_int32, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pw_6pandas_5algos_305take_2d_axis1_int8_int32(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  __Pyx_memviewslice __pyx_v_values = { 0, 0, { 0 }, { 0 }, { 0 } };
  PyArrayObject *__pyx_v_indexer = 0;
  __Pyx_memviewslice __pyx_v_out = { 0, 0, { 0 }, { 0 }, { 0 } };
  PyObject *__pyx_v_fill_value = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("take_2d_axis1_int8_int32 (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_values,&__pyx_n_s_indexer,&__pyx_n_s_out,&__pyx_n_s_fill_value,0};
    PyObject* values[4] = {0,0,0,0};
    values[3] = __pyx_k__157;
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_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 (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_indexer)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("take_2d_axis1_int8_int32", 0, 3, 4, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3520; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_out)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("take_2d_axis1_int8_int32", 0, 3, 4, 2); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3520; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  3:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_fill_value);
          if (value) { values[3] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "take_2d_axis1_int8_int32") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3520; __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_values = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_int8_t(values[0]); if (unlikely(!__pyx_v_values.memview)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3520; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_v_indexer = ((PyArrayObject *)values[1]);
    __pyx_v_out = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_int32_t(values[2]); if (unlikely(!__pyx_v_out.memview)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3522; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_v_fill_value = values[3];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("take_2d_axis1_int8_int32", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3520; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas.algos.take_2d_axis1_int8_int32", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_indexer), __pyx_ptype_5numpy_ndarray, 1, "indexer", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3521; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_304take_2d_axis1_int8_int32(__pyx_self, __pyx_v_values, __pyx_v_indexer, __pyx_v_out, __pyx_v_fill_value);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pandas_5algos_304take_2d_axis1_int8_int32(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_values, PyArrayObject *__pyx_v_indexer, __Pyx_memviewslice __pyx_v_out, PyObject *__pyx_v_fill_value) {
  Py_ssize_t __pyx_v_i;
  Py_ssize_t __pyx_v_j;
  Py_ssize_t __pyx_v_k;
  Py_ssize_t __pyx_v_n;
  Py_ssize_t __pyx_v_idx;
  __pyx_t_5numpy_int32_t __pyx_v_fv;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_indexer;
  __Pyx_Buffer __pyx_pybuffer_indexer;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  int __pyx_t_3;
  int __pyx_t_4;
  int __pyx_t_5;
  __pyx_t_5numpy_int32_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;
  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("take_2d_axis1_int8_int32", 0);
  __pyx_pybuffer_indexer.pybuffer.buf = NULL;
  __pyx_pybuffer_indexer.refcount = 0;
  __pyx_pybuffernd_indexer.data = NULL;
  __pyx_pybuffernd_indexer.rcbuffer = &__pyx_pybuffer_indexer;
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer, (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[2]; __pyx_lineno = 3520; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_indexer.diminfo[0].strides = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_indexer.diminfo[0].shape = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.shape[0];

  /* "pandas/src/generated.pyx":3528
 *         int32_t fv
 * 
 *     n = len(values)             # <<<<<<<<<<<<<<
 *     k = len(indexer)
 * 
 */
  __pyx_t_1 = __pyx_memoryview_fromslice(__pyx_v_values, 2, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_5numpy_int8_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_5numpy_int8_t, 0);; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3528; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3528; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_n = __pyx_t_2;

  /* "pandas/src/generated.pyx":3529
 * 
 *     n = len(values)
 *     k = len(indexer)             # <<<<<<<<<<<<<<
 * 
 *     if n == 0 or k == 0:
 */
  __pyx_t_2 = PyObject_Length(((PyObject *)__pyx_v_indexer)); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3529; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_k = __pyx_t_2;

  /* "pandas/src/generated.pyx":3531
 *     k = len(indexer)
 * 
 *     if n == 0 or k == 0:             # <<<<<<<<<<<<<<
 *         return
 * 
 */
  __pyx_t_3 = ((__pyx_v_n == 0) != 0);
  if (!__pyx_t_3) {
    __pyx_t_4 = ((__pyx_v_k == 0) != 0);
    __pyx_t_5 = __pyx_t_4;
  } else {
    __pyx_t_5 = __pyx_t_3;
  }
  if (__pyx_t_5) {

    /* "pandas/src/generated.pyx":3532
 * 
 *     if n == 0 or k == 0:
 *         return             # <<<<<<<<<<<<<<
 * 
 *     fv = fill_value
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_r = Py_None; __Pyx_INCREF(Py_None);
    goto __pyx_L0;
  }

  /* "pandas/src/generated.pyx":3534
 *         return
 * 
 *     fv = fill_value             # <<<<<<<<<<<<<<
 * 
 *     for i from 0 <= i < n:
 */
  __pyx_t_6 = __Pyx_PyInt_As_npy_int32(__pyx_v_fill_value); if (unlikely((__pyx_t_6 == (npy_int32)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3534; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_fv = __pyx_t_6;

  /* "pandas/src/generated.pyx":3536
 *     fv = fill_value
 * 
 *     for i from 0 <= i < n:             # <<<<<<<<<<<<<<
 *         for j from 0 <= j < k:
 *             idx = indexer[j]
 */
  __pyx_t_2 = __pyx_v_n;
  for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_2; __pyx_v_i++) {

    /* "pandas/src/generated.pyx":3537
 * 
 *     for i from 0 <= i < n:
 *         for j from 0 <= j < k:             # <<<<<<<<<<<<<<
 *             idx = indexer[j]
 *             if idx == -1:
 */
    __pyx_t_7 = __pyx_v_k;
    for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_7; __pyx_v_j++) {

      /* "pandas/src/generated.pyx":3538
 *     for i from 0 <= i < n:
 *         for j from 0 <= j < k:
 *             idx = indexer[j]             # <<<<<<<<<<<<<<
 *             if idx == -1:
 *                 out[i, j] = fv
 */
      __pyx_t_8 = __pyx_v_j;
      __pyx_v_idx = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_indexer.diminfo[0].strides));

      /* "pandas/src/generated.pyx":3539
 *         for j from 0 <= j < k:
 *             idx = indexer[j]
 *             if idx == -1:             # <<<<<<<<<<<<<<
 *                 out[i, j] = fv
 *             else:
 */
      __pyx_t_5 = ((__pyx_v_idx == -1) != 0);
      if (__pyx_t_5) {

        /* "pandas/src/generated.pyx":3540
 *             idx = indexer[j]
 *             if idx == -1:
 *                 out[i, j] = fv             # <<<<<<<<<<<<<<
 *             else:
 *                 out[i, j] = values[i, idx]
 */
        __pyx_t_9 = __pyx_v_i;
        __pyx_t_10 = __pyx_v_j;
        *((__pyx_t_5numpy_int32_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_out.data + __pyx_t_9 * __pyx_v_out.strides[0]) ) + __pyx_t_10 * __pyx_v_out.strides[1]) )) = __pyx_v_fv;
        goto __pyx_L8;
      }
      /*else*/ {

        /* "pandas/src/generated.pyx":3542
 *                 out[i, j] = fv
 *             else:
 *                 out[i, j] = values[i, idx]             # <<<<<<<<<<<<<<
 * 
 * @cython.wraparound(False)
 */
        __pyx_t_11 = __pyx_v_i;
        __pyx_t_12 = __pyx_v_idx;
        __pyx_t_13 = __pyx_v_i;
        __pyx_t_14 = __pyx_v_j;
        *((__pyx_t_5numpy_int32_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_out.data + __pyx_t_13 * __pyx_v_out.strides[0]) ) + __pyx_t_14 * __pyx_v_out.strides[1]) )) = (*((__pyx_t_5numpy_int8_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_values.data + __pyx_t_11 * __pyx_v_values.strides[0]) ) + __pyx_t_12 * __pyx_v_values.strides[1]) )));
      }
      __pyx_L8:;
    }
  }

  /* "pandas/src/generated.pyx":3520
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def take_2d_axis1_int8_int32(int8_t[:, :] values,             # <<<<<<<<<<<<<<
 *                                     ndarray[int64_t] indexer,
 *                                     int32_t[:, :] out,
 */

  /* function exit code */
  __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_pybuffernd_indexer.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas.algos.take_2d_axis1_int8_int32", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer);
  __pyx_L2:;
  __PYX_XDEC_MEMVIEW(&__pyx_v_values, 1);
  __PYX_XDEC_MEMVIEW(&__pyx_v_out, 1);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/src/generated.pyx":3546
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def take_2d_axis1_int8_int64(int8_t[:, :] values,             # <<<<<<<<<<<<<<
 *                                     ndarray[int64_t] indexer,
 *                                     int64_t[:, :] out,
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pandas_5algos_307take_2d_axis1_int8_int64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_5algos_307take_2d_axis1_int8_int64 = {__Pyx_NAMESTR("take_2d_axis1_int8_int64"), (PyCFunction)__pyx_pw_6pandas_5algos_307take_2d_axis1_int8_int64, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pw_6pandas_5algos_307take_2d_axis1_int8_int64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  __Pyx_memviewslice __pyx_v_values = { 0, 0, { 0 }, { 0 }, { 0 } };
  PyArrayObject *__pyx_v_indexer = 0;
  __Pyx_memviewslice __pyx_v_out = { 0, 0, { 0 }, { 0 }, { 0 } };
  PyObject *__pyx_v_fill_value = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("take_2d_axis1_int8_int64 (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_values,&__pyx_n_s_indexer,&__pyx_n_s_out,&__pyx_n_s_fill_value,0};
    PyObject* values[4] = {0,0,0,0};
    values[3] = __pyx_k__158;
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_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 (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_indexer)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("take_2d_axis1_int8_int64", 0, 3, 4, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3546; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_out)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("take_2d_axis1_int8_int64", 0, 3, 4, 2); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3546; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  3:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_fill_value);
          if (value) { values[3] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "take_2d_axis1_int8_int64") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3546; __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_values = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_int8_t(values[0]); if (unlikely(!__pyx_v_values.memview)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3546; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_v_indexer = ((PyArrayObject *)values[1]);
    __pyx_v_out = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_int64_t(values[2]); if (unlikely(!__pyx_v_out.memview)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3548; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_v_fill_value = values[3];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("take_2d_axis1_int8_int64", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3546; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas.algos.take_2d_axis1_int8_int64", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_indexer), __pyx_ptype_5numpy_ndarray, 1, "indexer", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3547; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_306take_2d_axis1_int8_int64(__pyx_self, __pyx_v_values, __pyx_v_indexer, __pyx_v_out, __pyx_v_fill_value);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pandas_5algos_306take_2d_axis1_int8_int64(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_values, PyArrayObject *__pyx_v_indexer, __Pyx_memviewslice __pyx_v_out, PyObject *__pyx_v_fill_value) {
  Py_ssize_t __pyx_v_i;
  Py_ssize_t __pyx_v_j;
  Py_ssize_t __pyx_v_k;
  Py_ssize_t __pyx_v_n;
  Py_ssize_t __pyx_v_idx;
  __pyx_t_5numpy_int64_t __pyx_v_fv;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_indexer;
  __Pyx_Buffer __pyx_pybuffer_indexer;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  int __pyx_t_3;
  int __pyx_t_4;
  int __pyx_t_5;
  __pyx_t_5numpy_int64_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;
  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("take_2d_axis1_int8_int64", 0);
  __pyx_pybuffer_indexer.pybuffer.buf = NULL;
  __pyx_pybuffer_indexer.refcount = 0;
  __pyx_pybuffernd_indexer.data = NULL;
  __pyx_pybuffernd_indexer.rcbuffer = &__pyx_pybuffer_indexer;
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer, (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[2]; __pyx_lineno = 3546; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_indexer.diminfo[0].strides = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_indexer.diminfo[0].shape = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.shape[0];

  /* "pandas/src/generated.pyx":3554
 *         int64_t fv
 * 
 *     n = len(values)             # <<<<<<<<<<<<<<
 *     k = len(indexer)
 * 
 */
  __pyx_t_1 = __pyx_memoryview_fromslice(__pyx_v_values, 2, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_5numpy_int8_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_5numpy_int8_t, 0);; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3554; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3554; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_n = __pyx_t_2;

  /* "pandas/src/generated.pyx":3555
 * 
 *     n = len(values)
 *     k = len(indexer)             # <<<<<<<<<<<<<<
 * 
 *     if n == 0 or k == 0:
 */
  __pyx_t_2 = PyObject_Length(((PyObject *)__pyx_v_indexer)); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3555; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_k = __pyx_t_2;

  /* "pandas/src/generated.pyx":3557
 *     k = len(indexer)
 * 
 *     if n == 0 or k == 0:             # <<<<<<<<<<<<<<
 *         return
 * 
 */
  __pyx_t_3 = ((__pyx_v_n == 0) != 0);
  if (!__pyx_t_3) {
    __pyx_t_4 = ((__pyx_v_k == 0) != 0);
    __pyx_t_5 = __pyx_t_4;
  } else {
    __pyx_t_5 = __pyx_t_3;
  }
  if (__pyx_t_5) {

    /* "pandas/src/generated.pyx":3558
 * 
 *     if n == 0 or k == 0:
 *         return             # <<<<<<<<<<<<<<
 * 
 *     fv = fill_value
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_r = Py_None; __Pyx_INCREF(Py_None);
    goto __pyx_L0;
  }

  /* "pandas/src/generated.pyx":3560
 *         return
 * 
 *     fv = fill_value             # <<<<<<<<<<<<<<
 * 
 *     for i from 0 <= i < n:
 */
  __pyx_t_6 = __Pyx_PyInt_As_npy_int64(__pyx_v_fill_value); if (unlikely((__pyx_t_6 == (npy_int64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3560; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_fv = __pyx_t_6;

  /* "pandas/src/generated.pyx":3562
 *     fv = fill_value
 * 
 *     for i from 0 <= i < n:             # <<<<<<<<<<<<<<
 *         for j from 0 <= j < k:
 *             idx = indexer[j]
 */
  __pyx_t_2 = __pyx_v_n;
  for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_2; __pyx_v_i++) {

    /* "pandas/src/generated.pyx":3563
 * 
 *     for i from 0 <= i < n:
 *         for j from 0 <= j < k:             # <<<<<<<<<<<<<<
 *             idx = indexer[j]
 *             if idx == -1:
 */
    __pyx_t_7 = __pyx_v_k;
    for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_7; __pyx_v_j++) {

      /* "pandas/src/generated.pyx":3564
 *     for i from 0 <= i < n:
 *         for j from 0 <= j < k:
 *             idx = indexer[j]             # <<<<<<<<<<<<<<
 *             if idx == -1:
 *                 out[i, j] = fv
 */
      __pyx_t_8 = __pyx_v_j;
      __pyx_v_idx = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_indexer.diminfo[0].strides));

      /* "pandas/src/generated.pyx":3565
 *         for j from 0 <= j < k:
 *             idx = indexer[j]
 *             if idx == -1:             # <<<<<<<<<<<<<<
 *                 out[i, j] = fv
 *             else:
 */
      __pyx_t_5 = ((__pyx_v_idx == -1) != 0);
      if (__pyx_t_5) {

        /* "pandas/src/generated.pyx":3566
 *             idx = indexer[j]
 *             if idx == -1:
 *                 out[i, j] = fv             # <<<<<<<<<<<<<<
 *             else:
 *                 out[i, j] = values[i, idx]
 */
        __pyx_t_9 = __pyx_v_i;
        __pyx_t_10 = __pyx_v_j;
        *((__pyx_t_5numpy_int64_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_out.data + __pyx_t_9 * __pyx_v_out.strides[0]) ) + __pyx_t_10 * __pyx_v_out.strides[1]) )) = __pyx_v_fv;
        goto __pyx_L8;
      }
      /*else*/ {

        /* "pandas/src/generated.pyx":3568
 *                 out[i, j] = fv
 *             else:
 *                 out[i, j] = values[i, idx]             # <<<<<<<<<<<<<<
 * 
 * @cython.wraparound(False)
 */
        __pyx_t_11 = __pyx_v_i;
        __pyx_t_12 = __pyx_v_idx;
        __pyx_t_13 = __pyx_v_i;
        __pyx_t_14 = __pyx_v_j;
        *((__pyx_t_5numpy_int64_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_out.data + __pyx_t_13 * __pyx_v_out.strides[0]) ) + __pyx_t_14 * __pyx_v_out.strides[1]) )) = (*((__pyx_t_5numpy_int8_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_values.data + __pyx_t_11 * __pyx_v_values.strides[0]) ) + __pyx_t_12 * __pyx_v_values.strides[1]) )));
      }
      __pyx_L8:;
    }
  }

  /* "pandas/src/generated.pyx":3546
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def take_2d_axis1_int8_int64(int8_t[:, :] values,             # <<<<<<<<<<<<<<
 *                                     ndarray[int64_t] indexer,
 *                                     int64_t[:, :] out,
 */

  /* function exit code */
  __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_pybuffernd_indexer.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas.algos.take_2d_axis1_int8_int64", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer);
  __pyx_L2:;
  __PYX_XDEC_MEMVIEW(&__pyx_v_values, 1);
  __PYX_XDEC_MEMVIEW(&__pyx_v_out, 1);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/src/generated.pyx":3572
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def take_2d_axis1_int8_float64(int8_t[:, :] values,             # <<<<<<<<<<<<<<
 *                                     ndarray[int64_t] indexer,
 *                                     float64_t[:, :] out,
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pandas_5algos_309take_2d_axis1_int8_float64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_5algos_309take_2d_axis1_int8_float64 = {__Pyx_NAMESTR("take_2d_axis1_int8_float64"), (PyCFunction)__pyx_pw_6pandas_5algos_309take_2d_axis1_int8_float64, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pw_6pandas_5algos_309take_2d_axis1_int8_float64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  __Pyx_memviewslice __pyx_v_values = { 0, 0, { 0 }, { 0 }, { 0 } };
  PyArrayObject *__pyx_v_indexer = 0;
  __Pyx_memviewslice __pyx_v_out = { 0, 0, { 0 }, { 0 }, { 0 } };
  PyObject *__pyx_v_fill_value = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("take_2d_axis1_int8_float64 (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_values,&__pyx_n_s_indexer,&__pyx_n_s_out,&__pyx_n_s_fill_value,0};
    PyObject* values[4] = {0,0,0,0};
    values[3] = __pyx_k__159;
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_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 (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_indexer)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("take_2d_axis1_int8_float64", 0, 3, 4, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3572; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_out)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("take_2d_axis1_int8_float64", 0, 3, 4, 2); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3572; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  3:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_fill_value);
          if (value) { values[3] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "take_2d_axis1_int8_float64") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3572; __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_values = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_int8_t(values[0]); if (unlikely(!__pyx_v_values.memview)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3572; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_v_indexer = ((PyArrayObject *)values[1]);
    __pyx_v_out = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_float64_t(values[2]); if (unlikely(!__pyx_v_out.memview)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3574; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_v_fill_value = values[3];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("take_2d_axis1_int8_float64", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3572; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas.algos.take_2d_axis1_int8_float64", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_indexer), __pyx_ptype_5numpy_ndarray, 1, "indexer", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3573; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_308take_2d_axis1_int8_float64(__pyx_self, __pyx_v_values, __pyx_v_indexer, __pyx_v_out, __pyx_v_fill_value);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pandas_5algos_308take_2d_axis1_int8_float64(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_values, PyArrayObject *__pyx_v_indexer, __Pyx_memviewslice __pyx_v_out, PyObject *__pyx_v_fill_value) {
  Py_ssize_t __pyx_v_i;
  Py_ssize_t __pyx_v_j;
  Py_ssize_t __pyx_v_k;
  Py_ssize_t __pyx_v_n;
  Py_ssize_t __pyx_v_idx;
  __pyx_t_5numpy_float64_t __pyx_v_fv;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_indexer;
  __Pyx_Buffer __pyx_pybuffer_indexer;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  int __pyx_t_3;
  int __pyx_t_4;
  int __pyx_t_5;
  __pyx_t_5numpy_float64_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;
  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("take_2d_axis1_int8_float64", 0);
  __pyx_pybuffer_indexer.pybuffer.buf = NULL;
  __pyx_pybuffer_indexer.refcount = 0;
  __pyx_pybuffernd_indexer.data = NULL;
  __pyx_pybuffernd_indexer.rcbuffer = &__pyx_pybuffer_indexer;
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer, (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[2]; __pyx_lineno = 3572; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_indexer.diminfo[0].strides = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_indexer.diminfo[0].shape = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.shape[0];

  /* "pandas/src/generated.pyx":3580
 *         float64_t fv
 * 
 *     n = len(values)             # <<<<<<<<<<<<<<
 *     k = len(indexer)
 * 
 */
  __pyx_t_1 = __pyx_memoryview_fromslice(__pyx_v_values, 2, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_5numpy_int8_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_5numpy_int8_t, 0);; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3580; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3580; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_n = __pyx_t_2;

  /* "pandas/src/generated.pyx":3581
 * 
 *     n = len(values)
 *     k = len(indexer)             # <<<<<<<<<<<<<<
 * 
 *     if n == 0 or k == 0:
 */
  __pyx_t_2 = PyObject_Length(((PyObject *)__pyx_v_indexer)); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3581; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_k = __pyx_t_2;

  /* "pandas/src/generated.pyx":3583
 *     k = len(indexer)
 * 
 *     if n == 0 or k == 0:             # <<<<<<<<<<<<<<
 *         return
 * 
 */
  __pyx_t_3 = ((__pyx_v_n == 0) != 0);
  if (!__pyx_t_3) {
    __pyx_t_4 = ((__pyx_v_k == 0) != 0);
    __pyx_t_5 = __pyx_t_4;
  } else {
    __pyx_t_5 = __pyx_t_3;
  }
  if (__pyx_t_5) {

    /* "pandas/src/generated.pyx":3584
 * 
 *     if n == 0 or k == 0:
 *         return             # <<<<<<<<<<<<<<
 * 
 *     fv = fill_value
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_r = Py_None; __Pyx_INCREF(Py_None);
    goto __pyx_L0;
  }

  /* "pandas/src/generated.pyx":3586
 *         return
 * 
 *     fv = fill_value             # <<<<<<<<<<<<<<
 * 
 *     for i from 0 <= i < n:
 */
  __pyx_t_6 = __pyx_PyFloat_AsDouble(__pyx_v_fill_value); if (unlikely((__pyx_t_6 == (npy_float64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3586; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_fv = __pyx_t_6;

  /* "pandas/src/generated.pyx":3588
 *     fv = fill_value
 * 
 *     for i from 0 <= i < n:             # <<<<<<<<<<<<<<
 *         for j from 0 <= j < k:
 *             idx = indexer[j]
 */
  __pyx_t_2 = __pyx_v_n;
  for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_2; __pyx_v_i++) {

    /* "pandas/src/generated.pyx":3589
 * 
 *     for i from 0 <= i < n:
 *         for j from 0 <= j < k:             # <<<<<<<<<<<<<<
 *             idx = indexer[j]
 *             if idx == -1:
 */
    __pyx_t_7 = __pyx_v_k;
    for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_7; __pyx_v_j++) {

      /* "pandas/src/generated.pyx":3590
 *     for i from 0 <= i < n:
 *         for j from 0 <= j < k:
 *             idx = indexer[j]             # <<<<<<<<<<<<<<
 *             if idx == -1:
 *                 out[i, j] = fv
 */
      __pyx_t_8 = __pyx_v_j;
      __pyx_v_idx = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_indexer.diminfo[0].strides));

      /* "pandas/src/generated.pyx":3591
 *         for j from 0 <= j < k:
 *             idx = indexer[j]
 *             if idx == -1:             # <<<<<<<<<<<<<<
 *                 out[i, j] = fv
 *             else:
 */
      __pyx_t_5 = ((__pyx_v_idx == -1) != 0);
      if (__pyx_t_5) {

        /* "pandas/src/generated.pyx":3592
 *             idx = indexer[j]
 *             if idx == -1:
 *                 out[i, j] = fv             # <<<<<<<<<<<<<<
 *             else:
 *                 out[i, j] = values[i, idx]
 */
        __pyx_t_9 = __pyx_v_i;
        __pyx_t_10 = __pyx_v_j;
        *((__pyx_t_5numpy_float64_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_out.data + __pyx_t_9 * __pyx_v_out.strides[0]) ) + __pyx_t_10 * __pyx_v_out.strides[1]) )) = __pyx_v_fv;
        goto __pyx_L8;
      }
      /*else*/ {

        /* "pandas/src/generated.pyx":3594
 *                 out[i, j] = fv
 *             else:
 *                 out[i, j] = values[i, idx]             # <<<<<<<<<<<<<<
 * 
 * @cython.wraparound(False)
 */
        __pyx_t_11 = __pyx_v_i;
        __pyx_t_12 = __pyx_v_idx;
        __pyx_t_13 = __pyx_v_i;
        __pyx_t_14 = __pyx_v_j;
        *((__pyx_t_5numpy_float64_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_out.data + __pyx_t_13 * __pyx_v_out.strides[0]) ) + __pyx_t_14 * __pyx_v_out.strides[1]) )) = (*((__pyx_t_5numpy_int8_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_values.data + __pyx_t_11 * __pyx_v_values.strides[0]) ) + __pyx_t_12 * __pyx_v_values.strides[1]) )));
      }
      __pyx_L8:;
    }
  }

  /* "pandas/src/generated.pyx":3572
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def take_2d_axis1_int8_float64(int8_t[:, :] values,             # <<<<<<<<<<<<<<
 *                                     ndarray[int64_t] indexer,
 *                                     float64_t[:, :] out,
 */

  /* function exit code */
  __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_pybuffernd_indexer.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas.algos.take_2d_axis1_int8_float64", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer);
  __pyx_L2:;
  __PYX_XDEC_MEMVIEW(&__pyx_v_values, 1);
  __PYX_XDEC_MEMVIEW(&__pyx_v_out, 1);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/src/generated.pyx":3598
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def take_2d_axis1_int16_int16(int16_t[:, :] values,             # <<<<<<<<<<<<<<
 *                                     ndarray[int64_t] indexer,
 *                                     int16_t[:, :] out,
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pandas_5algos_311take_2d_axis1_int16_int16(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_5algos_311take_2d_axis1_int16_int16 = {__Pyx_NAMESTR("take_2d_axis1_int16_int16"), (PyCFunction)__pyx_pw_6pandas_5algos_311take_2d_axis1_int16_int16, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pw_6pandas_5algos_311take_2d_axis1_int16_int16(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  __Pyx_memviewslice __pyx_v_values = { 0, 0, { 0 }, { 0 }, { 0 } };
  PyArrayObject *__pyx_v_indexer = 0;
  __Pyx_memviewslice __pyx_v_out = { 0, 0, { 0 }, { 0 }, { 0 } };
  PyObject *__pyx_v_fill_value = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("take_2d_axis1_int16_int16 (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_values,&__pyx_n_s_indexer,&__pyx_n_s_out,&__pyx_n_s_fill_value,0};
    PyObject* values[4] = {0,0,0,0};
    values[3] = __pyx_k__160;
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_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 (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_indexer)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("take_2d_axis1_int16_int16", 0, 3, 4, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3598; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_out)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("take_2d_axis1_int16_int16", 0, 3, 4, 2); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3598; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  3:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_fill_value);
          if (value) { values[3] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "take_2d_axis1_int16_int16") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3598; __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_values = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_int16_t(values[0]); if (unlikely(!__pyx_v_values.memview)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3598; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_v_indexer = ((PyArrayObject *)values[1]);
    __pyx_v_out = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_int16_t(values[2]); if (unlikely(!__pyx_v_out.memview)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3600; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_v_fill_value = values[3];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("take_2d_axis1_int16_int16", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3598; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas.algos.take_2d_axis1_int16_int16", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_indexer), __pyx_ptype_5numpy_ndarray, 1, "indexer", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3599; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_310take_2d_axis1_int16_int16(__pyx_self, __pyx_v_values, __pyx_v_indexer, __pyx_v_out, __pyx_v_fill_value);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pandas_5algos_310take_2d_axis1_int16_int16(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_values, PyArrayObject *__pyx_v_indexer, __Pyx_memviewslice __pyx_v_out, PyObject *__pyx_v_fill_value) {
  Py_ssize_t __pyx_v_i;
  Py_ssize_t __pyx_v_j;
  Py_ssize_t __pyx_v_k;
  Py_ssize_t __pyx_v_n;
  Py_ssize_t __pyx_v_idx;
  __pyx_t_5numpy_int16_t __pyx_v_fv;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_indexer;
  __Pyx_Buffer __pyx_pybuffer_indexer;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  int __pyx_t_3;
  int __pyx_t_4;
  int __pyx_t_5;
  __pyx_t_5numpy_int16_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;
  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("take_2d_axis1_int16_int16", 0);
  __pyx_pybuffer_indexer.pybuffer.buf = NULL;
  __pyx_pybuffer_indexer.refcount = 0;
  __pyx_pybuffernd_indexer.data = NULL;
  __pyx_pybuffernd_indexer.rcbuffer = &__pyx_pybuffer_indexer;
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer, (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[2]; __pyx_lineno = 3598; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_indexer.diminfo[0].strides = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_indexer.diminfo[0].shape = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.shape[0];

  /* "pandas/src/generated.pyx":3606
 *         int16_t fv
 * 
 *     n = len(values)             # <<<<<<<<<<<<<<
 *     k = len(indexer)
 * 
 */
  __pyx_t_1 = __pyx_memoryview_fromslice(__pyx_v_values, 2, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_5numpy_int16_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_5numpy_int16_t, 0);; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3606; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3606; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_n = __pyx_t_2;

  /* "pandas/src/generated.pyx":3607
 * 
 *     n = len(values)
 *     k = len(indexer)             # <<<<<<<<<<<<<<
 * 
 *     if n == 0 or k == 0:
 */
  __pyx_t_2 = PyObject_Length(((PyObject *)__pyx_v_indexer)); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3607; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_k = __pyx_t_2;

  /* "pandas/src/generated.pyx":3609
 *     k = len(indexer)
 * 
 *     if n == 0 or k == 0:             # <<<<<<<<<<<<<<
 *         return
 * 
 */
  __pyx_t_3 = ((__pyx_v_n == 0) != 0);
  if (!__pyx_t_3) {
    __pyx_t_4 = ((__pyx_v_k == 0) != 0);
    __pyx_t_5 = __pyx_t_4;
  } else {
    __pyx_t_5 = __pyx_t_3;
  }
  if (__pyx_t_5) {

    /* "pandas/src/generated.pyx":3610
 * 
 *     if n == 0 or k == 0:
 *         return             # <<<<<<<<<<<<<<
 * 
 *     fv = fill_value
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_r = Py_None; __Pyx_INCREF(Py_None);
    goto __pyx_L0;
  }

  /* "pandas/src/generated.pyx":3612
 *         return
 * 
 *     fv = fill_value             # <<<<<<<<<<<<<<
 * 
 *     for i from 0 <= i < n:
 */
  __pyx_t_6 = __Pyx_PyInt_As_npy_int16(__pyx_v_fill_value); if (unlikely((__pyx_t_6 == (npy_int16)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3612; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_fv = __pyx_t_6;

  /* "pandas/src/generated.pyx":3614
 *     fv = fill_value
 * 
 *     for i from 0 <= i < n:             # <<<<<<<<<<<<<<
 *         for j from 0 <= j < k:
 *             idx = indexer[j]
 */
  __pyx_t_2 = __pyx_v_n;
  for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_2; __pyx_v_i++) {

    /* "pandas/src/generated.pyx":3615
 * 
 *     for i from 0 <= i < n:
 *         for j from 0 <= j < k:             # <<<<<<<<<<<<<<
 *             idx = indexer[j]
 *             if idx == -1:
 */
    __pyx_t_7 = __pyx_v_k;
    for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_7; __pyx_v_j++) {

      /* "pandas/src/generated.pyx":3616
 *     for i from 0 <= i < n:
 *         for j from 0 <= j < k:
 *             idx = indexer[j]             # <<<<<<<<<<<<<<
 *             if idx == -1:
 *                 out[i, j] = fv
 */
      __pyx_t_8 = __pyx_v_j;
      __pyx_v_idx = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_indexer.diminfo[0].strides));

      /* "pandas/src/generated.pyx":3617
 *         for j from 0 <= j < k:
 *             idx = indexer[j]
 *             if idx == -1:             # <<<<<<<<<<<<<<
 *                 out[i, j] = fv
 *             else:
 */
      __pyx_t_5 = ((__pyx_v_idx == -1) != 0);
      if (__pyx_t_5) {

        /* "pandas/src/generated.pyx":3618
 *             idx = indexer[j]
 *             if idx == -1:
 *                 out[i, j] = fv             # <<<<<<<<<<<<<<
 *             else:
 *                 out[i, j] = values[i, idx]
 */
        __pyx_t_9 = __pyx_v_i;
        __pyx_t_10 = __pyx_v_j;
        *((__pyx_t_5numpy_int16_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_out.data + __pyx_t_9 * __pyx_v_out.strides[0]) ) + __pyx_t_10 * __pyx_v_out.strides[1]) )) = __pyx_v_fv;
        goto __pyx_L8;
      }
      /*else*/ {

        /* "pandas/src/generated.pyx":3620
 *                 out[i, j] = fv
 *             else:
 *                 out[i, j] = values[i, idx]             # <<<<<<<<<<<<<<
 * 
 * @cython.wraparound(False)
 */
        __pyx_t_11 = __pyx_v_i;
        __pyx_t_12 = __pyx_v_idx;
        __pyx_t_13 = __pyx_v_i;
        __pyx_t_14 = __pyx_v_j;
        *((__pyx_t_5numpy_int16_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_out.data + __pyx_t_13 * __pyx_v_out.strides[0]) ) + __pyx_t_14 * __pyx_v_out.strides[1]) )) = (*((__pyx_t_5numpy_int16_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_values.data + __pyx_t_11 * __pyx_v_values.strides[0]) ) + __pyx_t_12 * __pyx_v_values.strides[1]) )));
      }
      __pyx_L8:;
    }
  }

  /* "pandas/src/generated.pyx":3598
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def take_2d_axis1_int16_int16(int16_t[:, :] values,             # <<<<<<<<<<<<<<
 *                                     ndarray[int64_t] indexer,
 *                                     int16_t[:, :] out,
 */

  /* function exit code */
  __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_pybuffernd_indexer.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas.algos.take_2d_axis1_int16_int16", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer);
  __pyx_L2:;
  __PYX_XDEC_MEMVIEW(&__pyx_v_values, 1);
  __PYX_XDEC_MEMVIEW(&__pyx_v_out, 1);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/src/generated.pyx":3624
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def take_2d_axis1_int16_int32(int16_t[:, :] values,             # <<<<<<<<<<<<<<
 *                                     ndarray[int64_t] indexer,
 *                                     int32_t[:, :] out,
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pandas_5algos_313take_2d_axis1_int16_int32(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_5algos_313take_2d_axis1_int16_int32 = {__Pyx_NAMESTR("take_2d_axis1_int16_int32"), (PyCFunction)__pyx_pw_6pandas_5algos_313take_2d_axis1_int16_int32, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pw_6pandas_5algos_313take_2d_axis1_int16_int32(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  __Pyx_memviewslice __pyx_v_values = { 0, 0, { 0 }, { 0 }, { 0 } };
  PyArrayObject *__pyx_v_indexer = 0;
  __Pyx_memviewslice __pyx_v_out = { 0, 0, { 0 }, { 0 }, { 0 } };
  PyObject *__pyx_v_fill_value = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("take_2d_axis1_int16_int32 (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_values,&__pyx_n_s_indexer,&__pyx_n_s_out,&__pyx_n_s_fill_value,0};
    PyObject* values[4] = {0,0,0,0};
    values[3] = __pyx_k__161;
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_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 (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_indexer)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("take_2d_axis1_int16_int32", 0, 3, 4, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3624; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_out)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("take_2d_axis1_int16_int32", 0, 3, 4, 2); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3624; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  3:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_fill_value);
          if (value) { values[3] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "take_2d_axis1_int16_int32") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3624; __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_values = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_int16_t(values[0]); if (unlikely(!__pyx_v_values.memview)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3624; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_v_indexer = ((PyArrayObject *)values[1]);
    __pyx_v_out = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_int32_t(values[2]); if (unlikely(!__pyx_v_out.memview)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3626; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_v_fill_value = values[3];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("take_2d_axis1_int16_int32", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3624; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas.algos.take_2d_axis1_int16_int32", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_indexer), __pyx_ptype_5numpy_ndarray, 1, "indexer", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3625; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_312take_2d_axis1_int16_int32(__pyx_self, __pyx_v_values, __pyx_v_indexer, __pyx_v_out, __pyx_v_fill_value);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pandas_5algos_312take_2d_axis1_int16_int32(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_values, PyArrayObject *__pyx_v_indexer, __Pyx_memviewslice __pyx_v_out, PyObject *__pyx_v_fill_value) {
  Py_ssize_t __pyx_v_i;
  Py_ssize_t __pyx_v_j;
  Py_ssize_t __pyx_v_k;
  Py_ssize_t __pyx_v_n;
  Py_ssize_t __pyx_v_idx;
  __pyx_t_5numpy_int32_t __pyx_v_fv;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_indexer;
  __Pyx_Buffer __pyx_pybuffer_indexer;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  int __pyx_t_3;
  int __pyx_t_4;
  int __pyx_t_5;
  __pyx_t_5numpy_int32_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;
  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("take_2d_axis1_int16_int32", 0);
  __pyx_pybuffer_indexer.pybuffer.buf = NULL;
  __pyx_pybuffer_indexer.refcount = 0;
  __pyx_pybuffernd_indexer.data = NULL;
  __pyx_pybuffernd_indexer.rcbuffer = &__pyx_pybuffer_indexer;
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer, (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[2]; __pyx_lineno = 3624; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_indexer.diminfo[0].strides = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_indexer.diminfo[0].shape = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.shape[0];

  /* "pandas/src/generated.pyx":3632
 *         int32_t fv
 * 
 *     n = len(values)             # <<<<<<<<<<<<<<
 *     k = len(indexer)
 * 
 */
  __pyx_t_1 = __pyx_memoryview_fromslice(__pyx_v_values, 2, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_5numpy_int16_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_5numpy_int16_t, 0);; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3632; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3632; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_n = __pyx_t_2;

  /* "pandas/src/generated.pyx":3633
 * 
 *     n = len(values)
 *     k = len(indexer)             # <<<<<<<<<<<<<<
 * 
 *     if n == 0 or k == 0:
 */
  __pyx_t_2 = PyObject_Length(((PyObject *)__pyx_v_indexer)); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3633; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_k = __pyx_t_2;

  /* "pandas/src/generated.pyx":3635
 *     k = len(indexer)
 * 
 *     if n == 0 or k == 0:             # <<<<<<<<<<<<<<
 *         return
 * 
 */
  __pyx_t_3 = ((__pyx_v_n == 0) != 0);
  if (!__pyx_t_3) {
    __pyx_t_4 = ((__pyx_v_k == 0) != 0);
    __pyx_t_5 = __pyx_t_4;
  } else {
    __pyx_t_5 = __pyx_t_3;
  }
  if (__pyx_t_5) {

    /* "pandas/src/generated.pyx":3636
 * 
 *     if n == 0 or k == 0:
 *         return             # <<<<<<<<<<<<<<
 * 
 *     fv = fill_value
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_r = Py_None; __Pyx_INCREF(Py_None);
    goto __pyx_L0;
  }

  /* "pandas/src/generated.pyx":3638
 *         return
 * 
 *     fv = fill_value             # <<<<<<<<<<<<<<
 * 
 *     for i from 0 <= i < n:
 */
  __pyx_t_6 = __Pyx_PyInt_As_npy_int32(__pyx_v_fill_value); if (unlikely((__pyx_t_6 == (npy_int32)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3638; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_fv = __pyx_t_6;

  /* "pandas/src/generated.pyx":3640
 *     fv = fill_value
 * 
 *     for i from 0 <= i < n:             # <<<<<<<<<<<<<<
 *         for j from 0 <= j < k:
 *             idx = indexer[j]
 */
  __pyx_t_2 = __pyx_v_n;
  for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_2; __pyx_v_i++) {

    /* "pandas/src/generated.pyx":3641
 * 
 *     for i from 0 <= i < n:
 *         for j from 0 <= j < k:             # <<<<<<<<<<<<<<
 *             idx = indexer[j]
 *             if idx == -1:
 */
    __pyx_t_7 = __pyx_v_k;
    for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_7; __pyx_v_j++) {

      /* "pandas/src/generated.pyx":3642
 *     for i from 0 <= i < n:
 *         for j from 0 <= j < k:
 *             idx = indexer[j]             # <<<<<<<<<<<<<<
 *             if idx == -1:
 *                 out[i, j] = fv
 */
      __pyx_t_8 = __pyx_v_j;
      __pyx_v_idx = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_indexer.diminfo[0].strides));

      /* "pandas/src/generated.pyx":3643
 *         for j from 0 <= j < k:
 *             idx = indexer[j]
 *             if idx == -1:             # <<<<<<<<<<<<<<
 *                 out[i, j] = fv
 *             else:
 */
      __pyx_t_5 = ((__pyx_v_idx == -1) != 0);
      if (__pyx_t_5) {

        /* "pandas/src/generated.pyx":3644
 *             idx = indexer[j]
 *             if idx == -1:
 *                 out[i, j] = fv             # <<<<<<<<<<<<<<
 *             else:
 *                 out[i, j] = values[i, idx]
 */
        __pyx_t_9 = __pyx_v_i;
        __pyx_t_10 = __pyx_v_j;
        *((__pyx_t_5numpy_int32_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_out.data + __pyx_t_9 * __pyx_v_out.strides[0]) ) + __pyx_t_10 * __pyx_v_out.strides[1]) )) = __pyx_v_fv;
        goto __pyx_L8;
      }
      /*else*/ {

        /* "pandas/src/generated.pyx":3646
 *                 out[i, j] = fv
 *             else:
 *                 out[i, j] = values[i, idx]             # <<<<<<<<<<<<<<
 * 
 * @cython.wraparound(False)
 */
        __pyx_t_11 = __pyx_v_i;
        __pyx_t_12 = __pyx_v_idx;
        __pyx_t_13 = __pyx_v_i;
        __pyx_t_14 = __pyx_v_j;
        *((__pyx_t_5numpy_int32_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_out.data + __pyx_t_13 * __pyx_v_out.strides[0]) ) + __pyx_t_14 * __pyx_v_out.strides[1]) )) = (*((__pyx_t_5numpy_int16_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_values.data + __pyx_t_11 * __pyx_v_values.strides[0]) ) + __pyx_t_12 * __pyx_v_values.strides[1]) )));
      }
      __pyx_L8:;
    }
  }

  /* "pandas/src/generated.pyx":3624
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def take_2d_axis1_int16_int32(int16_t[:, :] values,             # <<<<<<<<<<<<<<
 *                                     ndarray[int64_t] indexer,
 *                                     int32_t[:, :] out,
 */

  /* function exit code */
  __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_pybuffernd_indexer.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas.algos.take_2d_axis1_int16_int32", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer);
  __pyx_L2:;
  __PYX_XDEC_MEMVIEW(&__pyx_v_values, 1);
  __PYX_XDEC_MEMVIEW(&__pyx_v_out, 1);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/src/generated.pyx":3650
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def take_2d_axis1_int16_int64(int16_t[:, :] values,             # <<<<<<<<<<<<<<
 *                                     ndarray[int64_t] indexer,
 *                                     int64_t[:, :] out,
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pandas_5algos_315take_2d_axis1_int16_int64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_5algos_315take_2d_axis1_int16_int64 = {__Pyx_NAMESTR("take_2d_axis1_int16_int64"), (PyCFunction)__pyx_pw_6pandas_5algos_315take_2d_axis1_int16_int64, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pw_6pandas_5algos_315take_2d_axis1_int16_int64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  __Pyx_memviewslice __pyx_v_values = { 0, 0, { 0 }, { 0 }, { 0 } };
  PyArrayObject *__pyx_v_indexer = 0;
  __Pyx_memviewslice __pyx_v_out = { 0, 0, { 0 }, { 0 }, { 0 } };
  PyObject *__pyx_v_fill_value = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("take_2d_axis1_int16_int64 (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_values,&__pyx_n_s_indexer,&__pyx_n_s_out,&__pyx_n_s_fill_value,0};
    PyObject* values[4] = {0,0,0,0};
    values[3] = __pyx_k__162;
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_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 (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_indexer)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("take_2d_axis1_int16_int64", 0, 3, 4, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3650; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_out)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("take_2d_axis1_int16_int64", 0, 3, 4, 2); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3650; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  3:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_fill_value);
          if (value) { values[3] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "take_2d_axis1_int16_int64") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3650; __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_values = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_int16_t(values[0]); if (unlikely(!__pyx_v_values.memview)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3650; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_v_indexer = ((PyArrayObject *)values[1]);
    __pyx_v_out = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_int64_t(values[2]); if (unlikely(!__pyx_v_out.memview)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3652; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_v_fill_value = values[3];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("take_2d_axis1_int16_int64", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3650; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas.algos.take_2d_axis1_int16_int64", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_indexer), __pyx_ptype_5numpy_ndarray, 1, "indexer", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3651; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_314take_2d_axis1_int16_int64(__pyx_self, __pyx_v_values, __pyx_v_indexer, __pyx_v_out, __pyx_v_fill_value);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pandas_5algos_314take_2d_axis1_int16_int64(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_values, PyArrayObject *__pyx_v_indexer, __Pyx_memviewslice __pyx_v_out, PyObject *__pyx_v_fill_value) {
  Py_ssize_t __pyx_v_i;
  Py_ssize_t __pyx_v_j;
  Py_ssize_t __pyx_v_k;
  Py_ssize_t __pyx_v_n;
  Py_ssize_t __pyx_v_idx;
  __pyx_t_5numpy_int64_t __pyx_v_fv;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_indexer;
  __Pyx_Buffer __pyx_pybuffer_indexer;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  int __pyx_t_3;
  int __pyx_t_4;
  int __pyx_t_5;
  __pyx_t_5numpy_int64_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;
  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("take_2d_axis1_int16_int64", 0);
  __pyx_pybuffer_indexer.pybuffer.buf = NULL;
  __pyx_pybuffer_indexer.refcount = 0;
  __pyx_pybuffernd_indexer.data = NULL;
  __pyx_pybuffernd_indexer.rcbuffer = &__pyx_pybuffer_indexer;
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer, (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[2]; __pyx_lineno = 3650; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_indexer.diminfo[0].strides = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_indexer.diminfo[0].shape = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.shape[0];

  /* "pandas/src/generated.pyx":3658
 *         int64_t fv
 * 
 *     n = len(values)             # <<<<<<<<<<<<<<
 *     k = len(indexer)
 * 
 */
  __pyx_t_1 = __pyx_memoryview_fromslice(__pyx_v_values, 2, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_5numpy_int16_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_5numpy_int16_t, 0);; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3658; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3658; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_n = __pyx_t_2;

  /* "pandas/src/generated.pyx":3659
 * 
 *     n = len(values)
 *     k = len(indexer)             # <<<<<<<<<<<<<<
 * 
 *     if n == 0 or k == 0:
 */
  __pyx_t_2 = PyObject_Length(((PyObject *)__pyx_v_indexer)); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3659; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_k = __pyx_t_2;

  /* "pandas/src/generated.pyx":3661
 *     k = len(indexer)
 * 
 *     if n == 0 or k == 0:             # <<<<<<<<<<<<<<
 *         return
 * 
 */
  __pyx_t_3 = ((__pyx_v_n == 0) != 0);
  if (!__pyx_t_3) {
    __pyx_t_4 = ((__pyx_v_k == 0) != 0);
    __pyx_t_5 = __pyx_t_4;
  } else {
    __pyx_t_5 = __pyx_t_3;
  }
  if (__pyx_t_5) {

    /* "pandas/src/generated.pyx":3662
 * 
 *     if n == 0 or k == 0:
 *         return             # <<<<<<<<<<<<<<
 * 
 *     fv = fill_value
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_r = Py_None; __Pyx_INCREF(Py_None);
    goto __pyx_L0;
  }

  /* "pandas/src/generated.pyx":3664
 *         return
 * 
 *     fv = fill_value             # <<<<<<<<<<<<<<
 * 
 *     for i from 0 <= i < n:
 */
  __pyx_t_6 = __Pyx_PyInt_As_npy_int64(__pyx_v_fill_value); if (unlikely((__pyx_t_6 == (npy_int64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3664; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_fv = __pyx_t_6;

  /* "pandas/src/generated.pyx":3666
 *     fv = fill_value
 * 
 *     for i from 0 <= i < n:             # <<<<<<<<<<<<<<
 *         for j from 0 <= j < k:
 *             idx = indexer[j]
 */
  __pyx_t_2 = __pyx_v_n;
  for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_2; __pyx_v_i++) {

    /* "pandas/src/generated.pyx":3667
 * 
 *     for i from 0 <= i < n:
 *         for j from 0 <= j < k:             # <<<<<<<<<<<<<<
 *             idx = indexer[j]
 *             if idx == -1:
 */
    __pyx_t_7 = __pyx_v_k;
    for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_7; __pyx_v_j++) {

      /* "pandas/src/generated.pyx":3668
 *     for i from 0 <= i < n:
 *         for j from 0 <= j < k:
 *             idx = indexer[j]             # <<<<<<<<<<<<<<
 *             if idx == -1:
 *                 out[i, j] = fv
 */
      __pyx_t_8 = __pyx_v_j;
      __pyx_v_idx = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_indexer.diminfo[0].strides));

      /* "pandas/src/generated.pyx":3669
 *         for j from 0 <= j < k:
 *             idx = indexer[j]
 *             if idx == -1:             # <<<<<<<<<<<<<<
 *                 out[i, j] = fv
 *             else:
 */
      __pyx_t_5 = ((__pyx_v_idx == -1) != 0);
      if (__pyx_t_5) {

        /* "pandas/src/generated.pyx":3670
 *             idx = indexer[j]
 *             if idx == -1:
 *                 out[i, j] = fv             # <<<<<<<<<<<<<<
 *             else:
 *                 out[i, j] = values[i, idx]
 */
        __pyx_t_9 = __pyx_v_i;
        __pyx_t_10 = __pyx_v_j;
        *((__pyx_t_5numpy_int64_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_out.data + __pyx_t_9 * __pyx_v_out.strides[0]) ) + __pyx_t_10 * __pyx_v_out.strides[1]) )) = __pyx_v_fv;
        goto __pyx_L8;
      }
      /*else*/ {

        /* "pandas/src/generated.pyx":3672
 *                 out[i, j] = fv
 *             else:
 *                 out[i, j] = values[i, idx]             # <<<<<<<<<<<<<<
 * 
 * @cython.wraparound(False)
 */
        __pyx_t_11 = __pyx_v_i;
        __pyx_t_12 = __pyx_v_idx;
        __pyx_t_13 = __pyx_v_i;
        __pyx_t_14 = __pyx_v_j;
        *((__pyx_t_5numpy_int64_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_out.data + __pyx_t_13 * __pyx_v_out.strides[0]) ) + __pyx_t_14 * __pyx_v_out.strides[1]) )) = (*((__pyx_t_5numpy_int16_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_values.data + __pyx_t_11 * __pyx_v_values.strides[0]) ) + __pyx_t_12 * __pyx_v_values.strides[1]) )));
      }
      __pyx_L8:;
    }
  }

  /* "pandas/src/generated.pyx":3650
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def take_2d_axis1_int16_int64(int16_t[:, :] values,             # <<<<<<<<<<<<<<
 *                                     ndarray[int64_t] indexer,
 *                                     int64_t[:, :] out,
 */

  /* function exit code */
  __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_pybuffernd_indexer.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas.algos.take_2d_axis1_int16_int64", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer);
  __pyx_L2:;
  __PYX_XDEC_MEMVIEW(&__pyx_v_values, 1);
  __PYX_XDEC_MEMVIEW(&__pyx_v_out, 1);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/src/generated.pyx":3676
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def take_2d_axis1_int16_float64(int16_t[:, :] values,             # <<<<<<<<<<<<<<
 *                                     ndarray[int64_t] indexer,
 *                                     float64_t[:, :] out,
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pandas_5algos_317take_2d_axis1_int16_float64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_5algos_317take_2d_axis1_int16_float64 = {__Pyx_NAMESTR("take_2d_axis1_int16_float64"), (PyCFunction)__pyx_pw_6pandas_5algos_317take_2d_axis1_int16_float64, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pw_6pandas_5algos_317take_2d_axis1_int16_float64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  __Pyx_memviewslice __pyx_v_values = { 0, 0, { 0 }, { 0 }, { 0 } };
  PyArrayObject *__pyx_v_indexer = 0;
  __Pyx_memviewslice __pyx_v_out = { 0, 0, { 0 }, { 0 }, { 0 } };
  PyObject *__pyx_v_fill_value = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("take_2d_axis1_int16_float64 (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_values,&__pyx_n_s_indexer,&__pyx_n_s_out,&__pyx_n_s_fill_value,0};
    PyObject* values[4] = {0,0,0,0};
    values[3] = __pyx_k__163;
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_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 (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_indexer)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("take_2d_axis1_int16_float64", 0, 3, 4, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3676; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_out)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("take_2d_axis1_int16_float64", 0, 3, 4, 2); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3676; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  3:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_fill_value);
          if (value) { values[3] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "take_2d_axis1_int16_float64") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3676; __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_values = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_int16_t(values[0]); if (unlikely(!__pyx_v_values.memview)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3676; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_v_indexer = ((PyArrayObject *)values[1]);
    __pyx_v_out = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_float64_t(values[2]); if (unlikely(!__pyx_v_out.memview)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3678; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_v_fill_value = values[3];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("take_2d_axis1_int16_float64", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3676; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas.algos.take_2d_axis1_int16_float64", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_indexer), __pyx_ptype_5numpy_ndarray, 1, "indexer", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3677; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_316take_2d_axis1_int16_float64(__pyx_self, __pyx_v_values, __pyx_v_indexer, __pyx_v_out, __pyx_v_fill_value);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pandas_5algos_316take_2d_axis1_int16_float64(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_values, PyArrayObject *__pyx_v_indexer, __Pyx_memviewslice __pyx_v_out, PyObject *__pyx_v_fill_value) {
  Py_ssize_t __pyx_v_i;
  Py_ssize_t __pyx_v_j;
  Py_ssize_t __pyx_v_k;
  Py_ssize_t __pyx_v_n;
  Py_ssize_t __pyx_v_idx;
  __pyx_t_5numpy_float64_t __pyx_v_fv;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_indexer;
  __Pyx_Buffer __pyx_pybuffer_indexer;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  int __pyx_t_3;
  int __pyx_t_4;
  int __pyx_t_5;
  __pyx_t_5numpy_float64_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;
  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("take_2d_axis1_int16_float64", 0);
  __pyx_pybuffer_indexer.pybuffer.buf = NULL;
  __pyx_pybuffer_indexer.refcount = 0;
  __pyx_pybuffernd_indexer.data = NULL;
  __pyx_pybuffernd_indexer.rcbuffer = &__pyx_pybuffer_indexer;
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer, (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[2]; __pyx_lineno = 3676; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_indexer.diminfo[0].strides = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_indexer.diminfo[0].shape = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.shape[0];

  /* "pandas/src/generated.pyx":3684
 *         float64_t fv
 * 
 *     n = len(values)             # <<<<<<<<<<<<<<
 *     k = len(indexer)
 * 
 */
  __pyx_t_1 = __pyx_memoryview_fromslice(__pyx_v_values, 2, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_5numpy_int16_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_5numpy_int16_t, 0);; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3684; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3684; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_n = __pyx_t_2;

  /* "pandas/src/generated.pyx":3685
 * 
 *     n = len(values)
 *     k = len(indexer)             # <<<<<<<<<<<<<<
 * 
 *     if n == 0 or k == 0:
 */
  __pyx_t_2 = PyObject_Length(((PyObject *)__pyx_v_indexer)); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3685; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_k = __pyx_t_2;

  /* "pandas/src/generated.pyx":3687
 *     k = len(indexer)
 * 
 *     if n == 0 or k == 0:             # <<<<<<<<<<<<<<
 *         return
 * 
 */
  __pyx_t_3 = ((__pyx_v_n == 0) != 0);
  if (!__pyx_t_3) {
    __pyx_t_4 = ((__pyx_v_k == 0) != 0);
    __pyx_t_5 = __pyx_t_4;
  } else {
    __pyx_t_5 = __pyx_t_3;
  }
  if (__pyx_t_5) {

    /* "pandas/src/generated.pyx":3688
 * 
 *     if n == 0 or k == 0:
 *         return             # <<<<<<<<<<<<<<
 * 
 *     fv = fill_value
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_r = Py_None; __Pyx_INCREF(Py_None);
    goto __pyx_L0;
  }

  /* "pandas/src/generated.pyx":3690
 *         return
 * 
 *     fv = fill_value             # <<<<<<<<<<<<<<
 * 
 *     for i from 0 <= i < n:
 */
  __pyx_t_6 = __pyx_PyFloat_AsDouble(__pyx_v_fill_value); if (unlikely((__pyx_t_6 == (npy_float64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3690; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_fv = __pyx_t_6;

  /* "pandas/src/generated.pyx":3692
 *     fv = fill_value
 * 
 *     for i from 0 <= i < n:             # <<<<<<<<<<<<<<
 *         for j from 0 <= j < k:
 *             idx = indexer[j]
 */
  __pyx_t_2 = __pyx_v_n;
  for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_2; __pyx_v_i++) {

    /* "pandas/src/generated.pyx":3693
 * 
 *     for i from 0 <= i < n:
 *         for j from 0 <= j < k:             # <<<<<<<<<<<<<<
 *             idx = indexer[j]
 *             if idx == -1:
 */
    __pyx_t_7 = __pyx_v_k;
    for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_7; __pyx_v_j++) {

      /* "pandas/src/generated.pyx":3694
 *     for i from 0 <= i < n:
 *         for j from 0 <= j < k:
 *             idx = indexer[j]             # <<<<<<<<<<<<<<
 *             if idx == -1:
 *                 out[i, j] = fv
 */
      __pyx_t_8 = __pyx_v_j;
      __pyx_v_idx = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_indexer.diminfo[0].strides));

      /* "pandas/src/generated.pyx":3695
 *         for j from 0 <= j < k:
 *             idx = indexer[j]
 *             if idx == -1:             # <<<<<<<<<<<<<<
 *                 out[i, j] = fv
 *             else:
 */
      __pyx_t_5 = ((__pyx_v_idx == -1) != 0);
      if (__pyx_t_5) {

        /* "pandas/src/generated.pyx":3696
 *             idx = indexer[j]
 *             if idx == -1:
 *                 out[i, j] = fv             # <<<<<<<<<<<<<<
 *             else:
 *                 out[i, j] = values[i, idx]
 */
        __pyx_t_9 = __pyx_v_i;
        __pyx_t_10 = __pyx_v_j;
        *((__pyx_t_5numpy_float64_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_out.data + __pyx_t_9 * __pyx_v_out.strides[0]) ) + __pyx_t_10 * __pyx_v_out.strides[1]) )) = __pyx_v_fv;
        goto __pyx_L8;
      }
      /*else*/ {

        /* "pandas/src/generated.pyx":3698
 *                 out[i, j] = fv
 *             else:
 *                 out[i, j] = values[i, idx]             # <<<<<<<<<<<<<<
 * 
 * @cython.wraparound(False)
 */
        __pyx_t_11 = __pyx_v_i;
        __pyx_t_12 = __pyx_v_idx;
        __pyx_t_13 = __pyx_v_i;
        __pyx_t_14 = __pyx_v_j;
        *((__pyx_t_5numpy_float64_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_out.data + __pyx_t_13 * __pyx_v_out.strides[0]) ) + __pyx_t_14 * __pyx_v_out.strides[1]) )) = (*((__pyx_t_5numpy_int16_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_values.data + __pyx_t_11 * __pyx_v_values.strides[0]) ) + __pyx_t_12 * __pyx_v_values.strides[1]) )));
      }
      __pyx_L8:;
    }
  }

  /* "pandas/src/generated.pyx":3676
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def take_2d_axis1_int16_float64(int16_t[:, :] values,             # <<<<<<<<<<<<<<
 *                                     ndarray[int64_t] indexer,
 *                                     float64_t[:, :] out,
 */

  /* function exit code */
  __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_pybuffernd_indexer.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas.algos.take_2d_axis1_int16_float64", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer);
  __pyx_L2:;
  __PYX_XDEC_MEMVIEW(&__pyx_v_values, 1);
  __PYX_XDEC_MEMVIEW(&__pyx_v_out, 1);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/src/generated.pyx":3702
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def take_2d_axis1_int32_int32(int32_t[:, :] values,             # <<<<<<<<<<<<<<
 *                                     ndarray[int64_t] indexer,
 *                                     int32_t[:, :] out,
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pandas_5algos_319take_2d_axis1_int32_int32(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_5algos_319take_2d_axis1_int32_int32 = {__Pyx_NAMESTR("take_2d_axis1_int32_int32"), (PyCFunction)__pyx_pw_6pandas_5algos_319take_2d_axis1_int32_int32, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pw_6pandas_5algos_319take_2d_axis1_int32_int32(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  __Pyx_memviewslice __pyx_v_values = { 0, 0, { 0 }, { 0 }, { 0 } };
  PyArrayObject *__pyx_v_indexer = 0;
  __Pyx_memviewslice __pyx_v_out = { 0, 0, { 0 }, { 0 }, { 0 } };
  PyObject *__pyx_v_fill_value = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("take_2d_axis1_int32_int32 (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_values,&__pyx_n_s_indexer,&__pyx_n_s_out,&__pyx_n_s_fill_value,0};
    PyObject* values[4] = {0,0,0,0};
    values[3] = __pyx_k__164;
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_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 (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_indexer)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("take_2d_axis1_int32_int32", 0, 3, 4, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3702; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_out)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("take_2d_axis1_int32_int32", 0, 3, 4, 2); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3702; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  3:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_fill_value);
          if (value) { values[3] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "take_2d_axis1_int32_int32") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3702; __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_values = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_int32_t(values[0]); if (unlikely(!__pyx_v_values.memview)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3702; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_v_indexer = ((PyArrayObject *)values[1]);
    __pyx_v_out = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_int32_t(values[2]); if (unlikely(!__pyx_v_out.memview)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3704; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_v_fill_value = values[3];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("take_2d_axis1_int32_int32", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3702; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas.algos.take_2d_axis1_int32_int32", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_indexer), __pyx_ptype_5numpy_ndarray, 1, "indexer", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3703; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_318take_2d_axis1_int32_int32(__pyx_self, __pyx_v_values, __pyx_v_indexer, __pyx_v_out, __pyx_v_fill_value);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pandas_5algos_318take_2d_axis1_int32_int32(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_values, PyArrayObject *__pyx_v_indexer, __Pyx_memviewslice __pyx_v_out, PyObject *__pyx_v_fill_value) {
  Py_ssize_t __pyx_v_i;
  Py_ssize_t __pyx_v_j;
  Py_ssize_t __pyx_v_k;
  Py_ssize_t __pyx_v_n;
  Py_ssize_t __pyx_v_idx;
  __pyx_t_5numpy_int32_t __pyx_v_fv;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_indexer;
  __Pyx_Buffer __pyx_pybuffer_indexer;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  int __pyx_t_3;
  int __pyx_t_4;
  int __pyx_t_5;
  __pyx_t_5numpy_int32_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;
  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("take_2d_axis1_int32_int32", 0);
  __pyx_pybuffer_indexer.pybuffer.buf = NULL;
  __pyx_pybuffer_indexer.refcount = 0;
  __pyx_pybuffernd_indexer.data = NULL;
  __pyx_pybuffernd_indexer.rcbuffer = &__pyx_pybuffer_indexer;
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer, (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[2]; __pyx_lineno = 3702; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_indexer.diminfo[0].strides = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_indexer.diminfo[0].shape = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.shape[0];

  /* "pandas/src/generated.pyx":3710
 *         int32_t fv
 * 
 *     n = len(values)             # <<<<<<<<<<<<<<
 *     k = len(indexer)
 * 
 */
  __pyx_t_1 = __pyx_memoryview_fromslice(__pyx_v_values, 2, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_5numpy_int32_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_5numpy_int32_t, 0);; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3710; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3710; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_n = __pyx_t_2;

  /* "pandas/src/generated.pyx":3711
 * 
 *     n = len(values)
 *     k = len(indexer)             # <<<<<<<<<<<<<<
 * 
 *     if n == 0 or k == 0:
 */
  __pyx_t_2 = PyObject_Length(((PyObject *)__pyx_v_indexer)); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3711; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_k = __pyx_t_2;

  /* "pandas/src/generated.pyx":3713
 *     k = len(indexer)
 * 
 *     if n == 0 or k == 0:             # <<<<<<<<<<<<<<
 *         return
 * 
 */
  __pyx_t_3 = ((__pyx_v_n == 0) != 0);
  if (!__pyx_t_3) {
    __pyx_t_4 = ((__pyx_v_k == 0) != 0);
    __pyx_t_5 = __pyx_t_4;
  } else {
    __pyx_t_5 = __pyx_t_3;
  }
  if (__pyx_t_5) {

    /* "pandas/src/generated.pyx":3714
 * 
 *     if n == 0 or k == 0:
 *         return             # <<<<<<<<<<<<<<
 * 
 *     fv = fill_value
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_r = Py_None; __Pyx_INCREF(Py_None);
    goto __pyx_L0;
  }

  /* "pandas/src/generated.pyx":3716
 *         return
 * 
 *     fv = fill_value             # <<<<<<<<<<<<<<
 * 
 *     for i from 0 <= i < n:
 */
  __pyx_t_6 = __Pyx_PyInt_As_npy_int32(__pyx_v_fill_value); if (unlikely((__pyx_t_6 == (npy_int32)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3716; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_fv = __pyx_t_6;

  /* "pandas/src/generated.pyx":3718
 *     fv = fill_value
 * 
 *     for i from 0 <= i < n:             # <<<<<<<<<<<<<<
 *         for j from 0 <= j < k:
 *             idx = indexer[j]
 */
  __pyx_t_2 = __pyx_v_n;
  for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_2; __pyx_v_i++) {

    /* "pandas/src/generated.pyx":3719
 * 
 *     for i from 0 <= i < n:
 *         for j from 0 <= j < k:             # <<<<<<<<<<<<<<
 *             idx = indexer[j]
 *             if idx == -1:
 */
    __pyx_t_7 = __pyx_v_k;
    for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_7; __pyx_v_j++) {

      /* "pandas/src/generated.pyx":3720
 *     for i from 0 <= i < n:
 *         for j from 0 <= j < k:
 *             idx = indexer[j]             # <<<<<<<<<<<<<<
 *             if idx == -1:
 *                 out[i, j] = fv
 */
      __pyx_t_8 = __pyx_v_j;
      __pyx_v_idx = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_indexer.diminfo[0].strides));

      /* "pandas/src/generated.pyx":3721
 *         for j from 0 <= j < k:
 *             idx = indexer[j]
 *             if idx == -1:             # <<<<<<<<<<<<<<
 *                 out[i, j] = fv
 *             else:
 */
      __pyx_t_5 = ((__pyx_v_idx == -1) != 0);
      if (__pyx_t_5) {

        /* "pandas/src/generated.pyx":3722
 *             idx = indexer[j]
 *             if idx == -1:
 *                 out[i, j] = fv             # <<<<<<<<<<<<<<
 *             else:
 *                 out[i, j] = values[i, idx]
 */
        __pyx_t_9 = __pyx_v_i;
        __pyx_t_10 = __pyx_v_j;
        *((__pyx_t_5numpy_int32_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_out.data + __pyx_t_9 * __pyx_v_out.strides[0]) ) + __pyx_t_10 * __pyx_v_out.strides[1]) )) = __pyx_v_fv;
        goto __pyx_L8;
      }
      /*else*/ {

        /* "pandas/src/generated.pyx":3724
 *                 out[i, j] = fv
 *             else:
 *                 out[i, j] = values[i, idx]             # <<<<<<<<<<<<<<
 * 
 * @cython.wraparound(False)
 */
        __pyx_t_11 = __pyx_v_i;
        __pyx_t_12 = __pyx_v_idx;
        __pyx_t_13 = __pyx_v_i;
        __pyx_t_14 = __pyx_v_j;
        *((__pyx_t_5numpy_int32_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_out.data + __pyx_t_13 * __pyx_v_out.strides[0]) ) + __pyx_t_14 * __pyx_v_out.strides[1]) )) = (*((__pyx_t_5numpy_int32_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_values.data + __pyx_t_11 * __pyx_v_values.strides[0]) ) + __pyx_t_12 * __pyx_v_values.strides[1]) )));
      }
      __pyx_L8:;
    }
  }

  /* "pandas/src/generated.pyx":3702
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def take_2d_axis1_int32_int32(int32_t[:, :] values,             # <<<<<<<<<<<<<<
 *                                     ndarray[int64_t] indexer,
 *                                     int32_t[:, :] out,
 */

  /* function exit code */
  __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_pybuffernd_indexer.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas.algos.take_2d_axis1_int32_int32", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer);
  __pyx_L2:;
  __PYX_XDEC_MEMVIEW(&__pyx_v_values, 1);
  __PYX_XDEC_MEMVIEW(&__pyx_v_out, 1);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/src/generated.pyx":3728
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def take_2d_axis1_int32_int64(int32_t[:, :] values,             # <<<<<<<<<<<<<<
 *                                     ndarray[int64_t] indexer,
 *                                     int64_t[:, :] out,
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pandas_5algos_321take_2d_axis1_int32_int64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_5algos_321take_2d_axis1_int32_int64 = {__Pyx_NAMESTR("take_2d_axis1_int32_int64"), (PyCFunction)__pyx_pw_6pandas_5algos_321take_2d_axis1_int32_int64, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pw_6pandas_5algos_321take_2d_axis1_int32_int64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  __Pyx_memviewslice __pyx_v_values = { 0, 0, { 0 }, { 0 }, { 0 } };
  PyArrayObject *__pyx_v_indexer = 0;
  __Pyx_memviewslice __pyx_v_out = { 0, 0, { 0 }, { 0 }, { 0 } };
  PyObject *__pyx_v_fill_value = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("take_2d_axis1_int32_int64 (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_values,&__pyx_n_s_indexer,&__pyx_n_s_out,&__pyx_n_s_fill_value,0};
    PyObject* values[4] = {0,0,0,0};
    values[3] = __pyx_k__165;
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_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 (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_indexer)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("take_2d_axis1_int32_int64", 0, 3, 4, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3728; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_out)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("take_2d_axis1_int32_int64", 0, 3, 4, 2); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3728; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  3:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_fill_value);
          if (value) { values[3] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "take_2d_axis1_int32_int64") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3728; __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_values = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_int32_t(values[0]); if (unlikely(!__pyx_v_values.memview)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3728; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_v_indexer = ((PyArrayObject *)values[1]);
    __pyx_v_out = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_int64_t(values[2]); if (unlikely(!__pyx_v_out.memview)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3730; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_v_fill_value = values[3];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("take_2d_axis1_int32_int64", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3728; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas.algos.take_2d_axis1_int32_int64", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_indexer), __pyx_ptype_5numpy_ndarray, 1, "indexer", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3729; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_320take_2d_axis1_int32_int64(__pyx_self, __pyx_v_values, __pyx_v_indexer, __pyx_v_out, __pyx_v_fill_value);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pandas_5algos_320take_2d_axis1_int32_int64(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_values, PyArrayObject *__pyx_v_indexer, __Pyx_memviewslice __pyx_v_out, PyObject *__pyx_v_fill_value) {
  Py_ssize_t __pyx_v_i;
  Py_ssize_t __pyx_v_j;
  Py_ssize_t __pyx_v_k;
  Py_ssize_t __pyx_v_n;
  Py_ssize_t __pyx_v_idx;
  __pyx_t_5numpy_int64_t __pyx_v_fv;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_indexer;
  __Pyx_Buffer __pyx_pybuffer_indexer;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  int __pyx_t_3;
  int __pyx_t_4;
  int __pyx_t_5;
  __pyx_t_5numpy_int64_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;
  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("take_2d_axis1_int32_int64", 0);
  __pyx_pybuffer_indexer.pybuffer.buf = NULL;
  __pyx_pybuffer_indexer.refcount = 0;
  __pyx_pybuffernd_indexer.data = NULL;
  __pyx_pybuffernd_indexer.rcbuffer = &__pyx_pybuffer_indexer;
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer, (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[2]; __pyx_lineno = 3728; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_indexer.diminfo[0].strides = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_indexer.diminfo[0].shape = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.shape[0];

  /* "pandas/src/generated.pyx":3736
 *         int64_t fv
 * 
 *     n = len(values)             # <<<<<<<<<<<<<<
 *     k = len(indexer)
 * 
 */
  __pyx_t_1 = __pyx_memoryview_fromslice(__pyx_v_values, 2, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_5numpy_int32_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_5numpy_int32_t, 0);; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3736; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3736; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_n = __pyx_t_2;

  /* "pandas/src/generated.pyx":3737
 * 
 *     n = len(values)
 *     k = len(indexer)             # <<<<<<<<<<<<<<
 * 
 *     if n == 0 or k == 0:
 */
  __pyx_t_2 = PyObject_Length(((PyObject *)__pyx_v_indexer)); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3737; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_k = __pyx_t_2;

  /* "pandas/src/generated.pyx":3739
 *     k = len(indexer)
 * 
 *     if n == 0 or k == 0:             # <<<<<<<<<<<<<<
 *         return
 * 
 */
  __pyx_t_3 = ((__pyx_v_n == 0) != 0);
  if (!__pyx_t_3) {
    __pyx_t_4 = ((__pyx_v_k == 0) != 0);
    __pyx_t_5 = __pyx_t_4;
  } else {
    __pyx_t_5 = __pyx_t_3;
  }
  if (__pyx_t_5) {

    /* "pandas/src/generated.pyx":3740
 * 
 *     if n == 0 or k == 0:
 *         return             # <<<<<<<<<<<<<<
 * 
 *     fv = fill_value
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_r = Py_None; __Pyx_INCREF(Py_None);
    goto __pyx_L0;
  }

  /* "pandas/src/generated.pyx":3742
 *         return
 * 
 *     fv = fill_value             # <<<<<<<<<<<<<<
 * 
 *     for i from 0 <= i < n:
 */
  __pyx_t_6 = __Pyx_PyInt_As_npy_int64(__pyx_v_fill_value); if (unlikely((__pyx_t_6 == (npy_int64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3742; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_fv = __pyx_t_6;

  /* "pandas/src/generated.pyx":3744
 *     fv = fill_value
 * 
 *     for i from 0 <= i < n:             # <<<<<<<<<<<<<<
 *         for j from 0 <= j < k:
 *             idx = indexer[j]
 */
  __pyx_t_2 = __pyx_v_n;
  for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_2; __pyx_v_i++) {

    /* "pandas/src/generated.pyx":3745
 * 
 *     for i from 0 <= i < n:
 *         for j from 0 <= j < k:             # <<<<<<<<<<<<<<
 *             idx = indexer[j]
 *             if idx == -1:
 */
    __pyx_t_7 = __pyx_v_k;
    for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_7; __pyx_v_j++) {

      /* "pandas/src/generated.pyx":3746
 *     for i from 0 <= i < n:
 *         for j from 0 <= j < k:
 *             idx = indexer[j]             # <<<<<<<<<<<<<<
 *             if idx == -1:
 *                 out[i, j] = fv
 */
      __pyx_t_8 = __pyx_v_j;
      __pyx_v_idx = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_indexer.diminfo[0].strides));

      /* "pandas/src/generated.pyx":3747
 *         for j from 0 <= j < k:
 *             idx = indexer[j]
 *             if idx == -1:             # <<<<<<<<<<<<<<
 *                 out[i, j] = fv
 *             else:
 */
      __pyx_t_5 = ((__pyx_v_idx == -1) != 0);
      if (__pyx_t_5) {

        /* "pandas/src/generated.pyx":3748
 *             idx = indexer[j]
 *             if idx == -1:
 *                 out[i, j] = fv             # <<<<<<<<<<<<<<
 *             else:
 *                 out[i, j] = values[i, idx]
 */
        __pyx_t_9 = __pyx_v_i;
        __pyx_t_10 = __pyx_v_j;
        *((__pyx_t_5numpy_int64_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_out.data + __pyx_t_9 * __pyx_v_out.strides[0]) ) + __pyx_t_10 * __pyx_v_out.strides[1]) )) = __pyx_v_fv;
        goto __pyx_L8;
      }
      /*else*/ {

        /* "pandas/src/generated.pyx":3750
 *                 out[i, j] = fv
 *             else:
 *                 out[i, j] = values[i, idx]             # <<<<<<<<<<<<<<
 * 
 * @cython.wraparound(False)
 */
        __pyx_t_11 = __pyx_v_i;
        __pyx_t_12 = __pyx_v_idx;
        __pyx_t_13 = __pyx_v_i;
        __pyx_t_14 = __pyx_v_j;
        *((__pyx_t_5numpy_int64_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_out.data + __pyx_t_13 * __pyx_v_out.strides[0]) ) + __pyx_t_14 * __pyx_v_out.strides[1]) )) = (*((__pyx_t_5numpy_int32_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_values.data + __pyx_t_11 * __pyx_v_values.strides[0]) ) + __pyx_t_12 * __pyx_v_values.strides[1]) )));
      }
      __pyx_L8:;
    }
  }

  /* "pandas/src/generated.pyx":3728
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def take_2d_axis1_int32_int64(int32_t[:, :] values,             # <<<<<<<<<<<<<<
 *                                     ndarray[int64_t] indexer,
 *                                     int64_t[:, :] out,
 */

  /* function exit code */
  __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_pybuffernd_indexer.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas.algos.take_2d_axis1_int32_int64", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer);
  __pyx_L2:;
  __PYX_XDEC_MEMVIEW(&__pyx_v_values, 1);
  __PYX_XDEC_MEMVIEW(&__pyx_v_out, 1);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/src/generated.pyx":3754
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def take_2d_axis1_int32_float64(int32_t[:, :] values,             # <<<<<<<<<<<<<<
 *                                     ndarray[int64_t] indexer,
 *                                     float64_t[:, :] out,
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pandas_5algos_323take_2d_axis1_int32_float64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_5algos_323take_2d_axis1_int32_float64 = {__Pyx_NAMESTR("take_2d_axis1_int32_float64"), (PyCFunction)__pyx_pw_6pandas_5algos_323take_2d_axis1_int32_float64, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pw_6pandas_5algos_323take_2d_axis1_int32_float64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  __Pyx_memviewslice __pyx_v_values = { 0, 0, { 0 }, { 0 }, { 0 } };
  PyArrayObject *__pyx_v_indexer = 0;
  __Pyx_memviewslice __pyx_v_out = { 0, 0, { 0 }, { 0 }, { 0 } };
  PyObject *__pyx_v_fill_value = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("take_2d_axis1_int32_float64 (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_values,&__pyx_n_s_indexer,&__pyx_n_s_out,&__pyx_n_s_fill_value,0};
    PyObject* values[4] = {0,0,0,0};
    values[3] = __pyx_k__166;
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_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 (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_indexer)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("take_2d_axis1_int32_float64", 0, 3, 4, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3754; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_out)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("take_2d_axis1_int32_float64", 0, 3, 4, 2); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3754; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  3:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_fill_value);
          if (value) { values[3] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "take_2d_axis1_int32_float64") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3754; __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_values = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_int32_t(values[0]); if (unlikely(!__pyx_v_values.memview)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3754; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_v_indexer = ((PyArrayObject *)values[1]);
    __pyx_v_out = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_float64_t(values[2]); if (unlikely(!__pyx_v_out.memview)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3756; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_v_fill_value = values[3];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("take_2d_axis1_int32_float64", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3754; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas.algos.take_2d_axis1_int32_float64", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_indexer), __pyx_ptype_5numpy_ndarray, 1, "indexer", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3755; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_322take_2d_axis1_int32_float64(__pyx_self, __pyx_v_values, __pyx_v_indexer, __pyx_v_out, __pyx_v_fill_value);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pandas_5algos_322take_2d_axis1_int32_float64(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_values, PyArrayObject *__pyx_v_indexer, __Pyx_memviewslice __pyx_v_out, PyObject *__pyx_v_fill_value) {
  Py_ssize_t __pyx_v_i;
  Py_ssize_t __pyx_v_j;
  Py_ssize_t __pyx_v_k;
  Py_ssize_t __pyx_v_n;
  Py_ssize_t __pyx_v_idx;
  __pyx_t_5numpy_float64_t __pyx_v_fv;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_indexer;
  __Pyx_Buffer __pyx_pybuffer_indexer;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  int __pyx_t_3;
  int __pyx_t_4;
  int __pyx_t_5;
  __pyx_t_5numpy_float64_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;
  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("take_2d_axis1_int32_float64", 0);
  __pyx_pybuffer_indexer.pybuffer.buf = NULL;
  __pyx_pybuffer_indexer.refcount = 0;
  __pyx_pybuffernd_indexer.data = NULL;
  __pyx_pybuffernd_indexer.rcbuffer = &__pyx_pybuffer_indexer;
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer, (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[2]; __pyx_lineno = 3754; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_indexer.diminfo[0].strides = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_indexer.diminfo[0].shape = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.shape[0];

  /* "pandas/src/generated.pyx":3762
 *         float64_t fv
 * 
 *     n = len(values)             # <<<<<<<<<<<<<<
 *     k = len(indexer)
 * 
 */
  __pyx_t_1 = __pyx_memoryview_fromslice(__pyx_v_values, 2, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_5numpy_int32_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_5numpy_int32_t, 0);; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3762; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3762; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_n = __pyx_t_2;

  /* "pandas/src/generated.pyx":3763
 * 
 *     n = len(values)
 *     k = len(indexer)             # <<<<<<<<<<<<<<
 * 
 *     if n == 0 or k == 0:
 */
  __pyx_t_2 = PyObject_Length(((PyObject *)__pyx_v_indexer)); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3763; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_k = __pyx_t_2;

  /* "pandas/src/generated.pyx":3765
 *     k = len(indexer)
 * 
 *     if n == 0 or k == 0:             # <<<<<<<<<<<<<<
 *         return
 * 
 */
  __pyx_t_3 = ((__pyx_v_n == 0) != 0);
  if (!__pyx_t_3) {
    __pyx_t_4 = ((__pyx_v_k == 0) != 0);
    __pyx_t_5 = __pyx_t_4;
  } else {
    __pyx_t_5 = __pyx_t_3;
  }
  if (__pyx_t_5) {

    /* "pandas/src/generated.pyx":3766
 * 
 *     if n == 0 or k == 0:
 *         return             # <<<<<<<<<<<<<<
 * 
 *     fv = fill_value
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_r = Py_None; __Pyx_INCREF(Py_None);
    goto __pyx_L0;
  }

  /* "pandas/src/generated.pyx":3768
 *         return
 * 
 *     fv = fill_value             # <<<<<<<<<<<<<<
 * 
 *     for i from 0 <= i < n:
 */
  __pyx_t_6 = __pyx_PyFloat_AsDouble(__pyx_v_fill_value); if (unlikely((__pyx_t_6 == (npy_float64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3768; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_fv = __pyx_t_6;

  /* "pandas/src/generated.pyx":3770
 *     fv = fill_value
 * 
 *     for i from 0 <= i < n:             # <<<<<<<<<<<<<<
 *         for j from 0 <= j < k:
 *             idx = indexer[j]
 */
  __pyx_t_2 = __pyx_v_n;
  for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_2; __pyx_v_i++) {

    /* "pandas/src/generated.pyx":3771
 * 
 *     for i from 0 <= i < n:
 *         for j from 0 <= j < k:             # <<<<<<<<<<<<<<
 *             idx = indexer[j]
 *             if idx == -1:
 */
    __pyx_t_7 = __pyx_v_k;
    for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_7; __pyx_v_j++) {

      /* "pandas/src/generated.pyx":3772
 *     for i from 0 <= i < n:
 *         for j from 0 <= j < k:
 *             idx = indexer[j]             # <<<<<<<<<<<<<<
 *             if idx == -1:
 *                 out[i, j] = fv
 */
      __pyx_t_8 = __pyx_v_j;
      __pyx_v_idx = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_indexer.diminfo[0].strides));

      /* "pandas/src/generated.pyx":3773
 *         for j from 0 <= j < k:
 *             idx = indexer[j]
 *             if idx == -1:             # <<<<<<<<<<<<<<
 *                 out[i, j] = fv
 *             else:
 */
      __pyx_t_5 = ((__pyx_v_idx == -1) != 0);
      if (__pyx_t_5) {

        /* "pandas/src/generated.pyx":3774
 *             idx = indexer[j]
 *             if idx == -1:
 *                 out[i, j] = fv             # <<<<<<<<<<<<<<
 *             else:
 *                 out[i, j] = values[i, idx]
 */
        __pyx_t_9 = __pyx_v_i;
        __pyx_t_10 = __pyx_v_j;
        *((__pyx_t_5numpy_float64_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_out.data + __pyx_t_9 * __pyx_v_out.strides[0]) ) + __pyx_t_10 * __pyx_v_out.strides[1]) )) = __pyx_v_fv;
        goto __pyx_L8;
      }
      /*else*/ {

        /* "pandas/src/generated.pyx":3776
 *                 out[i, j] = fv
 *             else:
 *                 out[i, j] = values[i, idx]             # <<<<<<<<<<<<<<
 * 
 * @cython.wraparound(False)
 */
        __pyx_t_11 = __pyx_v_i;
        __pyx_t_12 = __pyx_v_idx;
        __pyx_t_13 = __pyx_v_i;
        __pyx_t_14 = __pyx_v_j;
        *((__pyx_t_5numpy_float64_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_out.data + __pyx_t_13 * __pyx_v_out.strides[0]) ) + __pyx_t_14 * __pyx_v_out.strides[1]) )) = (*((__pyx_t_5numpy_int32_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_values.data + __pyx_t_11 * __pyx_v_values.strides[0]) ) + __pyx_t_12 * __pyx_v_values.strides[1]) )));
      }
      __pyx_L8:;
    }
  }

  /* "pandas/src/generated.pyx":3754
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def take_2d_axis1_int32_float64(int32_t[:, :] values,             # <<<<<<<<<<<<<<
 *                                     ndarray[int64_t] indexer,
 *                                     float64_t[:, :] out,
 */

  /* function exit code */
  __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_pybuffernd_indexer.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas.algos.take_2d_axis1_int32_float64", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer);
  __pyx_L2:;
  __PYX_XDEC_MEMVIEW(&__pyx_v_values, 1);
  __PYX_XDEC_MEMVIEW(&__pyx_v_out, 1);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/src/generated.pyx":3780
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def take_2d_axis1_int64_int64(int64_t[:, :] values,             # <<<<<<<<<<<<<<
 *                                     ndarray[int64_t] indexer,
 *                                     int64_t[:, :] out,
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pandas_5algos_325take_2d_axis1_int64_int64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_5algos_325take_2d_axis1_int64_int64 = {__Pyx_NAMESTR("take_2d_axis1_int64_int64"), (PyCFunction)__pyx_pw_6pandas_5algos_325take_2d_axis1_int64_int64, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pw_6pandas_5algos_325take_2d_axis1_int64_int64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  __Pyx_memviewslice __pyx_v_values = { 0, 0, { 0 }, { 0 }, { 0 } };
  PyArrayObject *__pyx_v_indexer = 0;
  __Pyx_memviewslice __pyx_v_out = { 0, 0, { 0 }, { 0 }, { 0 } };
  PyObject *__pyx_v_fill_value = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("take_2d_axis1_int64_int64 (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_values,&__pyx_n_s_indexer,&__pyx_n_s_out,&__pyx_n_s_fill_value,0};
    PyObject* values[4] = {0,0,0,0};
    values[3] = __pyx_k__167;
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_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 (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_indexer)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("take_2d_axis1_int64_int64", 0, 3, 4, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3780; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_out)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("take_2d_axis1_int64_int64", 0, 3, 4, 2); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3780; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  3:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_fill_value);
          if (value) { values[3] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "take_2d_axis1_int64_int64") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3780; __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_values = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_int64_t(values[0]); if (unlikely(!__pyx_v_values.memview)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3780; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_v_indexer = ((PyArrayObject *)values[1]);
    __pyx_v_out = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_int64_t(values[2]); if (unlikely(!__pyx_v_out.memview)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3782; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_v_fill_value = values[3];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("take_2d_axis1_int64_int64", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3780; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas.algos.take_2d_axis1_int64_int64", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_indexer), __pyx_ptype_5numpy_ndarray, 1, "indexer", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3781; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_324take_2d_axis1_int64_int64(__pyx_self, __pyx_v_values, __pyx_v_indexer, __pyx_v_out, __pyx_v_fill_value);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pandas_5algos_324take_2d_axis1_int64_int64(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_values, PyArrayObject *__pyx_v_indexer, __Pyx_memviewslice __pyx_v_out, PyObject *__pyx_v_fill_value) {
  Py_ssize_t __pyx_v_i;
  Py_ssize_t __pyx_v_j;
  Py_ssize_t __pyx_v_k;
  Py_ssize_t __pyx_v_n;
  Py_ssize_t __pyx_v_idx;
  __pyx_t_5numpy_int64_t __pyx_v_fv;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_indexer;
  __Pyx_Buffer __pyx_pybuffer_indexer;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  int __pyx_t_3;
  int __pyx_t_4;
  int __pyx_t_5;
  __pyx_t_5numpy_int64_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;
  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("take_2d_axis1_int64_int64", 0);
  __pyx_pybuffer_indexer.pybuffer.buf = NULL;
  __pyx_pybuffer_indexer.refcount = 0;
  __pyx_pybuffernd_indexer.data = NULL;
  __pyx_pybuffernd_indexer.rcbuffer = &__pyx_pybuffer_indexer;
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer, (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[2]; __pyx_lineno = 3780; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_indexer.diminfo[0].strides = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_indexer.diminfo[0].shape = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.shape[0];

  /* "pandas/src/generated.pyx":3788
 *         int64_t fv
 * 
 *     n = len(values)             # <<<<<<<<<<<<<<
 *     k = len(indexer)
 * 
 */
  __pyx_t_1 = __pyx_memoryview_fromslice(__pyx_v_values, 2, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_5numpy_int64_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_5numpy_int64_t, 0);; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3788; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3788; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_n = __pyx_t_2;

  /* "pandas/src/generated.pyx":3789
 * 
 *     n = len(values)
 *     k = len(indexer)             # <<<<<<<<<<<<<<
 * 
 *     if n == 0 or k == 0:
 */
  __pyx_t_2 = PyObject_Length(((PyObject *)__pyx_v_indexer)); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3789; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_k = __pyx_t_2;

  /* "pandas/src/generated.pyx":3791
 *     k = len(indexer)
 * 
 *     if n == 0 or k == 0:             # <<<<<<<<<<<<<<
 *         return
 * 
 */
  __pyx_t_3 = ((__pyx_v_n == 0) != 0);
  if (!__pyx_t_3) {
    __pyx_t_4 = ((__pyx_v_k == 0) != 0);
    __pyx_t_5 = __pyx_t_4;
  } else {
    __pyx_t_5 = __pyx_t_3;
  }
  if (__pyx_t_5) {

    /* "pandas/src/generated.pyx":3792
 * 
 *     if n == 0 or k == 0:
 *         return             # <<<<<<<<<<<<<<
 * 
 *     fv = fill_value
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_r = Py_None; __Pyx_INCREF(Py_None);
    goto __pyx_L0;
  }

  /* "pandas/src/generated.pyx":3794
 *         return
 * 
 *     fv = fill_value             # <<<<<<<<<<<<<<
 * 
 *     for i from 0 <= i < n:
 */
  __pyx_t_6 = __Pyx_PyInt_As_npy_int64(__pyx_v_fill_value); if (unlikely((__pyx_t_6 == (npy_int64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3794; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_fv = __pyx_t_6;

  /* "pandas/src/generated.pyx":3796
 *     fv = fill_value
 * 
 *     for i from 0 <= i < n:             # <<<<<<<<<<<<<<
 *         for j from 0 <= j < k:
 *             idx = indexer[j]
 */
  __pyx_t_2 = __pyx_v_n;
  for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_2; __pyx_v_i++) {

    /* "pandas/src/generated.pyx":3797
 * 
 *     for i from 0 <= i < n:
 *         for j from 0 <= j < k:             # <<<<<<<<<<<<<<
 *             idx = indexer[j]
 *             if idx == -1:
 */
    __pyx_t_7 = __pyx_v_k;
    for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_7; __pyx_v_j++) {

      /* "pandas/src/generated.pyx":3798
 *     for i from 0 <= i < n:
 *         for j from 0 <= j < k:
 *             idx = indexer[j]             # <<<<<<<<<<<<<<
 *             if idx == -1:
 *                 out[i, j] = fv
 */
      __pyx_t_8 = __pyx_v_j;
      __pyx_v_idx = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_indexer.diminfo[0].strides));

      /* "pandas/src/generated.pyx":3799
 *         for j from 0 <= j < k:
 *             idx = indexer[j]
 *             if idx == -1:             # <<<<<<<<<<<<<<
 *                 out[i, j] = fv
 *             else:
 */
      __pyx_t_5 = ((__pyx_v_idx == -1) != 0);
      if (__pyx_t_5) {

        /* "pandas/src/generated.pyx":3800
 *             idx = indexer[j]
 *             if idx == -1:
 *                 out[i, j] = fv             # <<<<<<<<<<<<<<
 *             else:
 *                 out[i, j] = values[i, idx]
 */
        __pyx_t_9 = __pyx_v_i;
        __pyx_t_10 = __pyx_v_j;
        *((__pyx_t_5numpy_int64_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_out.data + __pyx_t_9 * __pyx_v_out.strides[0]) ) + __pyx_t_10 * __pyx_v_out.strides[1]) )) = __pyx_v_fv;
        goto __pyx_L8;
      }
      /*else*/ {

        /* "pandas/src/generated.pyx":3802
 *                 out[i, j] = fv
 *             else:
 *                 out[i, j] = values[i, idx]             # <<<<<<<<<<<<<<
 * 
 * @cython.wraparound(False)
 */
        __pyx_t_11 = __pyx_v_i;
        __pyx_t_12 = __pyx_v_idx;
        __pyx_t_13 = __pyx_v_i;
        __pyx_t_14 = __pyx_v_j;
        *((__pyx_t_5numpy_int64_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_out.data + __pyx_t_13 * __pyx_v_out.strides[0]) ) + __pyx_t_14 * __pyx_v_out.strides[1]) )) = (*((__pyx_t_5numpy_int64_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_values.data + __pyx_t_11 * __pyx_v_values.strides[0]) ) + __pyx_t_12 * __pyx_v_values.strides[1]) )));
      }
      __pyx_L8:;
    }
  }

  /* "pandas/src/generated.pyx":3780
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def take_2d_axis1_int64_int64(int64_t[:, :] values,             # <<<<<<<<<<<<<<
 *                                     ndarray[int64_t] indexer,
 *                                     int64_t[:, :] out,
 */

  /* function exit code */
  __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_pybuffernd_indexer.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas.algos.take_2d_axis1_int64_int64", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer);
  __pyx_L2:;
  __PYX_XDEC_MEMVIEW(&__pyx_v_values, 1);
  __PYX_XDEC_MEMVIEW(&__pyx_v_out, 1);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/src/generated.pyx":3806
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def take_2d_axis1_int64_float64(int64_t[:, :] values,             # <<<<<<<<<<<<<<
 *                                     ndarray[int64_t] indexer,
 *                                     float64_t[:, :] out,
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pandas_5algos_327take_2d_axis1_int64_float64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_5algos_327take_2d_axis1_int64_float64 = {__Pyx_NAMESTR("take_2d_axis1_int64_float64"), (PyCFunction)__pyx_pw_6pandas_5algos_327take_2d_axis1_int64_float64, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pw_6pandas_5algos_327take_2d_axis1_int64_float64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  __Pyx_memviewslice __pyx_v_values = { 0, 0, { 0 }, { 0 }, { 0 } };
  PyArrayObject *__pyx_v_indexer = 0;
  __Pyx_memviewslice __pyx_v_out = { 0, 0, { 0 }, { 0 }, { 0 } };
  PyObject *__pyx_v_fill_value = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("take_2d_axis1_int64_float64 (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_values,&__pyx_n_s_indexer,&__pyx_n_s_out,&__pyx_n_s_fill_value,0};
    PyObject* values[4] = {0,0,0,0};
    values[3] = __pyx_k__168;
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_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 (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_indexer)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("take_2d_axis1_int64_float64", 0, 3, 4, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3806; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_out)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("take_2d_axis1_int64_float64", 0, 3, 4, 2); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3806; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  3:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_fill_value);
          if (value) { values[3] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "take_2d_axis1_int64_float64") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3806; __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_values = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_int64_t(values[0]); if (unlikely(!__pyx_v_values.memview)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3806; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_v_indexer = ((PyArrayObject *)values[1]);
    __pyx_v_out = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_float64_t(values[2]); if (unlikely(!__pyx_v_out.memview)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3808; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_v_fill_value = values[3];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("take_2d_axis1_int64_float64", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3806; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas.algos.take_2d_axis1_int64_float64", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_indexer), __pyx_ptype_5numpy_ndarray, 1, "indexer", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3807; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_326take_2d_axis1_int64_float64(__pyx_self, __pyx_v_values, __pyx_v_indexer, __pyx_v_out, __pyx_v_fill_value);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pandas_5algos_326take_2d_axis1_int64_float64(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_values, PyArrayObject *__pyx_v_indexer, __Pyx_memviewslice __pyx_v_out, PyObject *__pyx_v_fill_value) {
  Py_ssize_t __pyx_v_i;
  Py_ssize_t __pyx_v_j;
  Py_ssize_t __pyx_v_k;
  Py_ssize_t __pyx_v_n;
  Py_ssize_t __pyx_v_idx;
  __pyx_t_5numpy_float64_t __pyx_v_fv;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_indexer;
  __Pyx_Buffer __pyx_pybuffer_indexer;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  int __pyx_t_3;
  int __pyx_t_4;
  int __pyx_t_5;
  __pyx_t_5numpy_float64_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;
  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("take_2d_axis1_int64_float64", 0);
  __pyx_pybuffer_indexer.pybuffer.buf = NULL;
  __pyx_pybuffer_indexer.refcount = 0;
  __pyx_pybuffernd_indexer.data = NULL;
  __pyx_pybuffernd_indexer.rcbuffer = &__pyx_pybuffer_indexer;
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer, (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[2]; __pyx_lineno = 3806; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_indexer.diminfo[0].strides = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_indexer.diminfo[0].shape = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.shape[0];

  /* "pandas/src/generated.pyx":3814
 *         float64_t fv
 * 
 *     n = len(values)             # <<<<<<<<<<<<<<
 *     k = len(indexer)
 * 
 */
  __pyx_t_1 = __pyx_memoryview_fromslice(__pyx_v_values, 2, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_5numpy_int64_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_5numpy_int64_t, 0);; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3814; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3814; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_n = __pyx_t_2;

  /* "pandas/src/generated.pyx":3815
 * 
 *     n = len(values)
 *     k = len(indexer)             # <<<<<<<<<<<<<<
 * 
 *     if n == 0 or k == 0:
 */
  __pyx_t_2 = PyObject_Length(((PyObject *)__pyx_v_indexer)); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3815; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_k = __pyx_t_2;

  /* "pandas/src/generated.pyx":3817
 *     k = len(indexer)
 * 
 *     if n == 0 or k == 0:             # <<<<<<<<<<<<<<
 *         return
 * 
 */
  __pyx_t_3 = ((__pyx_v_n == 0) != 0);
  if (!__pyx_t_3) {
    __pyx_t_4 = ((__pyx_v_k == 0) != 0);
    __pyx_t_5 = __pyx_t_4;
  } else {
    __pyx_t_5 = __pyx_t_3;
  }
  if (__pyx_t_5) {

    /* "pandas/src/generated.pyx":3818
 * 
 *     if n == 0 or k == 0:
 *         return             # <<<<<<<<<<<<<<
 * 
 *     fv = fill_value
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_r = Py_None; __Pyx_INCREF(Py_None);
    goto __pyx_L0;
  }

  /* "pandas/src/generated.pyx":3820
 *         return
 * 
 *     fv = fill_value             # <<<<<<<<<<<<<<
 * 
 *     for i from 0 <= i < n:
 */
  __pyx_t_6 = __pyx_PyFloat_AsDouble(__pyx_v_fill_value); if (unlikely((__pyx_t_6 == (npy_float64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3820; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_fv = __pyx_t_6;

  /* "pandas/src/generated.pyx":3822
 *     fv = fill_value
 * 
 *     for i from 0 <= i < n:             # <<<<<<<<<<<<<<
 *         for j from 0 <= j < k:
 *             idx = indexer[j]
 */
  __pyx_t_2 = __pyx_v_n;
  for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_2; __pyx_v_i++) {

    /* "pandas/src/generated.pyx":3823
 * 
 *     for i from 0 <= i < n:
 *         for j from 0 <= j < k:             # <<<<<<<<<<<<<<
 *             idx = indexer[j]
 *             if idx == -1:
 */
    __pyx_t_7 = __pyx_v_k;
    for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_7; __pyx_v_j++) {

      /* "pandas/src/generated.pyx":3824
 *     for i from 0 <= i < n:
 *         for j from 0 <= j < k:
 *             idx = indexer[j]             # <<<<<<<<<<<<<<
 *             if idx == -1:
 *                 out[i, j] = fv
 */
      __pyx_t_8 = __pyx_v_j;
      __pyx_v_idx = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_indexer.diminfo[0].strides));

      /* "pandas/src/generated.pyx":3825
 *         for j from 0 <= j < k:
 *             idx = indexer[j]
 *             if idx == -1:             # <<<<<<<<<<<<<<
 *                 out[i, j] = fv
 *             else:
 */
      __pyx_t_5 = ((__pyx_v_idx == -1) != 0);
      if (__pyx_t_5) {

        /* "pandas/src/generated.pyx":3826
 *             idx = indexer[j]
 *             if idx == -1:
 *                 out[i, j] = fv             # <<<<<<<<<<<<<<
 *             else:
 *                 out[i, j] = values[i, idx]
 */
        __pyx_t_9 = __pyx_v_i;
        __pyx_t_10 = __pyx_v_j;
        *((__pyx_t_5numpy_float64_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_out.data + __pyx_t_9 * __pyx_v_out.strides[0]) ) + __pyx_t_10 * __pyx_v_out.strides[1]) )) = __pyx_v_fv;
        goto __pyx_L8;
      }
      /*else*/ {

        /* "pandas/src/generated.pyx":3828
 *                 out[i, j] = fv
 *             else:
 *                 out[i, j] = values[i, idx]             # <<<<<<<<<<<<<<
 * 
 * @cython.wraparound(False)
 */
        __pyx_t_11 = __pyx_v_i;
        __pyx_t_12 = __pyx_v_idx;
        __pyx_t_13 = __pyx_v_i;
        __pyx_t_14 = __pyx_v_j;
        *((__pyx_t_5numpy_float64_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_out.data + __pyx_t_13 * __pyx_v_out.strides[0]) ) + __pyx_t_14 * __pyx_v_out.strides[1]) )) = (*((__pyx_t_5numpy_int64_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_values.data + __pyx_t_11 * __pyx_v_values.strides[0]) ) + __pyx_t_12 * __pyx_v_values.strides[1]) )));
      }
      __pyx_L8:;
    }
  }

  /* "pandas/src/generated.pyx":3806
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def take_2d_axis1_int64_float64(int64_t[:, :] values,             # <<<<<<<<<<<<<<
 *                                     ndarray[int64_t] indexer,
 *                                     float64_t[:, :] out,
 */

  /* function exit code */
  __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_pybuffernd_indexer.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas.algos.take_2d_axis1_int64_float64", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer);
  __pyx_L2:;
  __PYX_XDEC_MEMVIEW(&__pyx_v_values, 1);
  __PYX_XDEC_MEMVIEW(&__pyx_v_out, 1);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/src/generated.pyx":3832
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def take_2d_axis1_float32_float32(float32_t[:, :] values,             # <<<<<<<<<<<<<<
 *                                     ndarray[int64_t] indexer,
 *                                     float32_t[:, :] out,
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pandas_5algos_329take_2d_axis1_float32_float32(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_5algos_329take_2d_axis1_float32_float32 = {__Pyx_NAMESTR("take_2d_axis1_float32_float32"), (PyCFunction)__pyx_pw_6pandas_5algos_329take_2d_axis1_float32_float32, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pw_6pandas_5algos_329take_2d_axis1_float32_float32(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  __Pyx_memviewslice __pyx_v_values = { 0, 0, { 0 }, { 0 }, { 0 } };
  PyArrayObject *__pyx_v_indexer = 0;
  __Pyx_memviewslice __pyx_v_out = { 0, 0, { 0 }, { 0 }, { 0 } };
  PyObject *__pyx_v_fill_value = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("take_2d_axis1_float32_float32 (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_values,&__pyx_n_s_indexer,&__pyx_n_s_out,&__pyx_n_s_fill_value,0};
    PyObject* values[4] = {0,0,0,0};
    values[3] = __pyx_k__169;
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_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 (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_indexer)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("take_2d_axis1_float32_float32", 0, 3, 4, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3832; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_out)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("take_2d_axis1_float32_float32", 0, 3, 4, 2); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3832; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  3:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_fill_value);
          if (value) { values[3] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "take_2d_axis1_float32_float32") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3832; __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_values = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_float32_t(values[0]); if (unlikely(!__pyx_v_values.memview)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3832; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_v_indexer = ((PyArrayObject *)values[1]);
    __pyx_v_out = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_float32_t(values[2]); if (unlikely(!__pyx_v_out.memview)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3834; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_v_fill_value = values[3];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("take_2d_axis1_float32_float32", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3832; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas.algos.take_2d_axis1_float32_float32", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_indexer), __pyx_ptype_5numpy_ndarray, 1, "indexer", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3833; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_328take_2d_axis1_float32_float32(__pyx_self, __pyx_v_values, __pyx_v_indexer, __pyx_v_out, __pyx_v_fill_value);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pandas_5algos_328take_2d_axis1_float32_float32(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_values, PyArrayObject *__pyx_v_indexer, __Pyx_memviewslice __pyx_v_out, PyObject *__pyx_v_fill_value) {
  Py_ssize_t __pyx_v_i;
  Py_ssize_t __pyx_v_j;
  Py_ssize_t __pyx_v_k;
  Py_ssize_t __pyx_v_n;
  Py_ssize_t __pyx_v_idx;
  __pyx_t_5numpy_float32_t __pyx_v_fv;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_indexer;
  __Pyx_Buffer __pyx_pybuffer_indexer;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  int __pyx_t_3;
  int __pyx_t_4;
  int __pyx_t_5;
  __pyx_t_5numpy_float32_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;
  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("take_2d_axis1_float32_float32", 0);
  __pyx_pybuffer_indexer.pybuffer.buf = NULL;
  __pyx_pybuffer_indexer.refcount = 0;
  __pyx_pybuffernd_indexer.data = NULL;
  __pyx_pybuffernd_indexer.rcbuffer = &__pyx_pybuffer_indexer;
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer, (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[2]; __pyx_lineno = 3832; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_indexer.diminfo[0].strides = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_indexer.diminfo[0].shape = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.shape[0];

  /* "pandas/src/generated.pyx":3840
 *         float32_t fv
 * 
 *     n = len(values)             # <<<<<<<<<<<<<<
 *     k = len(indexer)
 * 
 */
  __pyx_t_1 = __pyx_memoryview_fromslice(__pyx_v_values, 2, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_5numpy_float32_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_5numpy_float32_t, 0);; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3840; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3840; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_n = __pyx_t_2;

  /* "pandas/src/generated.pyx":3841
 * 
 *     n = len(values)
 *     k = len(indexer)             # <<<<<<<<<<<<<<
 * 
 *     if n == 0 or k == 0:
 */
  __pyx_t_2 = PyObject_Length(((PyObject *)__pyx_v_indexer)); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3841; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_k = __pyx_t_2;

  /* "pandas/src/generated.pyx":3843
 *     k = len(indexer)
 * 
 *     if n == 0 or k == 0:             # <<<<<<<<<<<<<<
 *         return
 * 
 */
  __pyx_t_3 = ((__pyx_v_n == 0) != 0);
  if (!__pyx_t_3) {
    __pyx_t_4 = ((__pyx_v_k == 0) != 0);
    __pyx_t_5 = __pyx_t_4;
  } else {
    __pyx_t_5 = __pyx_t_3;
  }
  if (__pyx_t_5) {

    /* "pandas/src/generated.pyx":3844
 * 
 *     if n == 0 or k == 0:
 *         return             # <<<<<<<<<<<<<<
 * 
 *     fv = fill_value
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_r = Py_None; __Pyx_INCREF(Py_None);
    goto __pyx_L0;
  }

  /* "pandas/src/generated.pyx":3846
 *         return
 * 
 *     fv = fill_value             # <<<<<<<<<<<<<<
 * 
 *     for i from 0 <= i < n:
 */
  __pyx_t_6 = __pyx_PyFloat_AsFloat(__pyx_v_fill_value); if (unlikely((__pyx_t_6 == (npy_float32)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3846; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_fv = __pyx_t_6;

  /* "pandas/src/generated.pyx":3848
 *     fv = fill_value
 * 
 *     for i from 0 <= i < n:             # <<<<<<<<<<<<<<
 *         for j from 0 <= j < k:
 *             idx = indexer[j]
 */
  __pyx_t_2 = __pyx_v_n;
  for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_2; __pyx_v_i++) {

    /* "pandas/src/generated.pyx":3849
 * 
 *     for i from 0 <= i < n:
 *         for j from 0 <= j < k:             # <<<<<<<<<<<<<<
 *             idx = indexer[j]
 *             if idx == -1:
 */
    __pyx_t_7 = __pyx_v_k;
    for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_7; __pyx_v_j++) {

      /* "pandas/src/generated.pyx":3850
 *     for i from 0 <= i < n:
 *         for j from 0 <= j < k:
 *             idx = indexer[j]             # <<<<<<<<<<<<<<
 *             if idx == -1:
 *                 out[i, j] = fv
 */
      __pyx_t_8 = __pyx_v_j;
      __pyx_v_idx = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_indexer.diminfo[0].strides));

      /* "pandas/src/generated.pyx":3851
 *         for j from 0 <= j < k:
 *             idx = indexer[j]
 *             if idx == -1:             # <<<<<<<<<<<<<<
 *                 out[i, j] = fv
 *             else:
 */
      __pyx_t_5 = ((__pyx_v_idx == -1) != 0);
      if (__pyx_t_5) {

        /* "pandas/src/generated.pyx":3852
 *             idx = indexer[j]
 *             if idx == -1:
 *                 out[i, j] = fv             # <<<<<<<<<<<<<<
 *             else:
 *                 out[i, j] = values[i, idx]
 */
        __pyx_t_9 = __pyx_v_i;
        __pyx_t_10 = __pyx_v_j;
        *((__pyx_t_5numpy_float32_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_out.data + __pyx_t_9 * __pyx_v_out.strides[0]) ) + __pyx_t_10 * __pyx_v_out.strides[1]) )) = __pyx_v_fv;
        goto __pyx_L8;
      }
      /*else*/ {

        /* "pandas/src/generated.pyx":3854
 *                 out[i, j] = fv
 *             else:
 *                 out[i, j] = values[i, idx]             # <<<<<<<<<<<<<<
 * 
 * @cython.wraparound(False)
 */
        __pyx_t_11 = __pyx_v_i;
        __pyx_t_12 = __pyx_v_idx;
        __pyx_t_13 = __pyx_v_i;
        __pyx_t_14 = __pyx_v_j;
        *((__pyx_t_5numpy_float32_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_out.data + __pyx_t_13 * __pyx_v_out.strides[0]) ) + __pyx_t_14 * __pyx_v_out.strides[1]) )) = (*((__pyx_t_5numpy_float32_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_values.data + __pyx_t_11 * __pyx_v_values.strides[0]) ) + __pyx_t_12 * __pyx_v_values.strides[1]) )));
      }
      __pyx_L8:;
    }
  }

  /* "pandas/src/generated.pyx":3832
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def take_2d_axis1_float32_float32(float32_t[:, :] values,             # <<<<<<<<<<<<<<
 *                                     ndarray[int64_t] indexer,
 *                                     float32_t[:, :] out,
 */

  /* function exit code */
  __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_pybuffernd_indexer.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas.algos.take_2d_axis1_float32_float32", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer);
  __pyx_L2:;
  __PYX_XDEC_MEMVIEW(&__pyx_v_values, 1);
  __PYX_XDEC_MEMVIEW(&__pyx_v_out, 1);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/src/generated.pyx":3858
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def take_2d_axis1_float32_float64(float32_t[:, :] values,             # <<<<<<<<<<<<<<
 *                                     ndarray[int64_t] indexer,
 *                                     float64_t[:, :] out,
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pandas_5algos_331take_2d_axis1_float32_float64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_5algos_331take_2d_axis1_float32_float64 = {__Pyx_NAMESTR("take_2d_axis1_float32_float64"), (PyCFunction)__pyx_pw_6pandas_5algos_331take_2d_axis1_float32_float64, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pw_6pandas_5algos_331take_2d_axis1_float32_float64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  __Pyx_memviewslice __pyx_v_values = { 0, 0, { 0 }, { 0 }, { 0 } };
  PyArrayObject *__pyx_v_indexer = 0;
  __Pyx_memviewslice __pyx_v_out = { 0, 0, { 0 }, { 0 }, { 0 } };
  PyObject *__pyx_v_fill_value = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("take_2d_axis1_float32_float64 (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_values,&__pyx_n_s_indexer,&__pyx_n_s_out,&__pyx_n_s_fill_value,0};
    PyObject* values[4] = {0,0,0,0};
    values[3] = __pyx_k__170;
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_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 (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_indexer)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("take_2d_axis1_float32_float64", 0, 3, 4, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3858; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_out)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("take_2d_axis1_float32_float64", 0, 3, 4, 2); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3858; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  3:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_fill_value);
          if (value) { values[3] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "take_2d_axis1_float32_float64") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3858; __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_values = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_float32_t(values[0]); if (unlikely(!__pyx_v_values.memview)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3858; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_v_indexer = ((PyArrayObject *)values[1]);
    __pyx_v_out = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_float64_t(values[2]); if (unlikely(!__pyx_v_out.memview)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3860; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_v_fill_value = values[3];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("take_2d_axis1_float32_float64", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3858; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas.algos.take_2d_axis1_float32_float64", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_indexer), __pyx_ptype_5numpy_ndarray, 1, "indexer", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3859; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_330take_2d_axis1_float32_float64(__pyx_self, __pyx_v_values, __pyx_v_indexer, __pyx_v_out, __pyx_v_fill_value);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pandas_5algos_330take_2d_axis1_float32_float64(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_values, PyArrayObject *__pyx_v_indexer, __Pyx_memviewslice __pyx_v_out, PyObject *__pyx_v_fill_value) {
  Py_ssize_t __pyx_v_i;
  Py_ssize_t __pyx_v_j;
  Py_ssize_t __pyx_v_k;
  Py_ssize_t __pyx_v_n;
  Py_ssize_t __pyx_v_idx;
  __pyx_t_5numpy_float64_t __pyx_v_fv;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_indexer;
  __Pyx_Buffer __pyx_pybuffer_indexer;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  int __pyx_t_3;
  int __pyx_t_4;
  int __pyx_t_5;
  __pyx_t_5numpy_float64_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;
  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("take_2d_axis1_float32_float64", 0);
  __pyx_pybuffer_indexer.pybuffer.buf = NULL;
  __pyx_pybuffer_indexer.refcount = 0;
  __pyx_pybuffernd_indexer.data = NULL;
  __pyx_pybuffernd_indexer.rcbuffer = &__pyx_pybuffer_indexer;
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer, (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[2]; __pyx_lineno = 3858; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_indexer.diminfo[0].strides = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_indexer.diminfo[0].shape = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.shape[0];

  /* "pandas/src/generated.pyx":3866
 *         float64_t fv
 * 
 *     n = len(values)             # <<<<<<<<<<<<<<
 *     k = len(indexer)
 * 
 */
  __pyx_t_1 = __pyx_memoryview_fromslice(__pyx_v_values, 2, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_5numpy_float32_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_5numpy_float32_t, 0);; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3866; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3866; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_n = __pyx_t_2;

  /* "pandas/src/generated.pyx":3867
 * 
 *     n = len(values)
 *     k = len(indexer)             # <<<<<<<<<<<<<<
 * 
 *     if n == 0 or k == 0:
 */
  __pyx_t_2 = PyObject_Length(((PyObject *)__pyx_v_indexer)); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3867; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_k = __pyx_t_2;

  /* "pandas/src/generated.pyx":3869
 *     k = len(indexer)
 * 
 *     if n == 0 or k == 0:             # <<<<<<<<<<<<<<
 *         return
 * 
 */
  __pyx_t_3 = ((__pyx_v_n == 0) != 0);
  if (!__pyx_t_3) {
    __pyx_t_4 = ((__pyx_v_k == 0) != 0);
    __pyx_t_5 = __pyx_t_4;
  } else {
    __pyx_t_5 = __pyx_t_3;
  }
  if (__pyx_t_5) {

    /* "pandas/src/generated.pyx":3870
 * 
 *     if n == 0 or k == 0:
 *         return             # <<<<<<<<<<<<<<
 * 
 *     fv = fill_value
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_r = Py_None; __Pyx_INCREF(Py_None);
    goto __pyx_L0;
  }

  /* "pandas/src/generated.pyx":3872
 *         return
 * 
 *     fv = fill_value             # <<<<<<<<<<<<<<
 * 
 *     for i from 0 <= i < n:
 */
  __pyx_t_6 = __pyx_PyFloat_AsDouble(__pyx_v_fill_value); if (unlikely((__pyx_t_6 == (npy_float64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3872; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_fv = __pyx_t_6;

  /* "pandas/src/generated.pyx":3874
 *     fv = fill_value
 * 
 *     for i from 0 <= i < n:             # <<<<<<<<<<<<<<
 *         for j from 0 <= j < k:
 *             idx = indexer[j]
 */
  __pyx_t_2 = __pyx_v_n;
  for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_2; __pyx_v_i++) {

    /* "pandas/src/generated.pyx":3875
 * 
 *     for i from 0 <= i < n:
 *         for j from 0 <= j < k:             # <<<<<<<<<<<<<<
 *             idx = indexer[j]
 *             if idx == -1:
 */
    __pyx_t_7 = __pyx_v_k;
    for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_7; __pyx_v_j++) {

      /* "pandas/src/generated.pyx":3876
 *     for i from 0 <= i < n:
 *         for j from 0 <= j < k:
 *             idx = indexer[j]             # <<<<<<<<<<<<<<
 *             if idx == -1:
 *                 out[i, j] = fv
 */
      __pyx_t_8 = __pyx_v_j;
      __pyx_v_idx = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_indexer.diminfo[0].strides));

      /* "pandas/src/generated.pyx":3877
 *         for j from 0 <= j < k:
 *             idx = indexer[j]
 *             if idx == -1:             # <<<<<<<<<<<<<<
 *                 out[i, j] = fv
 *             else:
 */
      __pyx_t_5 = ((__pyx_v_idx == -1) != 0);
      if (__pyx_t_5) {

        /* "pandas/src/generated.pyx":3878
 *             idx = indexer[j]
 *             if idx == -1:
 *                 out[i, j] = fv             # <<<<<<<<<<<<<<
 *             else:
 *                 out[i, j] = values[i, idx]
 */
        __pyx_t_9 = __pyx_v_i;
        __pyx_t_10 = __pyx_v_j;
        *((__pyx_t_5numpy_float64_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_out.data + __pyx_t_9 * __pyx_v_out.strides[0]) ) + __pyx_t_10 * __pyx_v_out.strides[1]) )) = __pyx_v_fv;
        goto __pyx_L8;
      }
      /*else*/ {

        /* "pandas/src/generated.pyx":3880
 *                 out[i, j] = fv
 *             else:
 *                 out[i, j] = values[i, idx]             # <<<<<<<<<<<<<<
 * 
 * @cython.wraparound(False)
 */
        __pyx_t_11 = __pyx_v_i;
        __pyx_t_12 = __pyx_v_idx;
        __pyx_t_13 = __pyx_v_i;
        __pyx_t_14 = __pyx_v_j;
        *((__pyx_t_5numpy_float64_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_out.data + __pyx_t_13 * __pyx_v_out.strides[0]) ) + __pyx_t_14 * __pyx_v_out.strides[1]) )) = (*((__pyx_t_5numpy_float32_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_values.data + __pyx_t_11 * __pyx_v_values.strides[0]) ) + __pyx_t_12 * __pyx_v_values.strides[1]) )));
      }
      __pyx_L8:;
    }
  }

  /* "pandas/src/generated.pyx":3858
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def take_2d_axis1_float32_float64(float32_t[:, :] values,             # <<<<<<<<<<<<<<
 *                                     ndarray[int64_t] indexer,
 *                                     float64_t[:, :] out,
 */

  /* function exit code */
  __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_pybuffernd_indexer.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas.algos.take_2d_axis1_float32_float64", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer);
  __pyx_L2:;
  __PYX_XDEC_MEMVIEW(&__pyx_v_values, 1);
  __PYX_XDEC_MEMVIEW(&__pyx_v_out, 1);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/src/generated.pyx":3884
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def take_2d_axis1_float64_float64(float64_t[:, :] values,             # <<<<<<<<<<<<<<
 *                                     ndarray[int64_t] indexer,
 *                                     float64_t[:, :] out,
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pandas_5algos_333take_2d_axis1_float64_float64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_5algos_333take_2d_axis1_float64_float64 = {__Pyx_NAMESTR("take_2d_axis1_float64_float64"), (PyCFunction)__pyx_pw_6pandas_5algos_333take_2d_axis1_float64_float64, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pw_6pandas_5algos_333take_2d_axis1_float64_float64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  __Pyx_memviewslice __pyx_v_values = { 0, 0, { 0 }, { 0 }, { 0 } };
  PyArrayObject *__pyx_v_indexer = 0;
  __Pyx_memviewslice __pyx_v_out = { 0, 0, { 0 }, { 0 }, { 0 } };
  PyObject *__pyx_v_fill_value = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("take_2d_axis1_float64_float64 (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_values,&__pyx_n_s_indexer,&__pyx_n_s_out,&__pyx_n_s_fill_value,0};
    PyObject* values[4] = {0,0,0,0};
    values[3] = __pyx_k__171;
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_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 (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_indexer)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("take_2d_axis1_float64_float64", 0, 3, 4, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3884; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_out)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("take_2d_axis1_float64_float64", 0, 3, 4, 2); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3884; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  3:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_fill_value);
          if (value) { values[3] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "take_2d_axis1_float64_float64") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3884; __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_values = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_float64_t(values[0]); if (unlikely(!__pyx_v_values.memview)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3884; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_v_indexer = ((PyArrayObject *)values[1]);
    __pyx_v_out = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_float64_t(values[2]); if (unlikely(!__pyx_v_out.memview)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3886; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_v_fill_value = values[3];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("take_2d_axis1_float64_float64", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3884; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas.algos.take_2d_axis1_float64_float64", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_indexer), __pyx_ptype_5numpy_ndarray, 1, "indexer", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3885; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_332take_2d_axis1_float64_float64(__pyx_self, __pyx_v_values, __pyx_v_indexer, __pyx_v_out, __pyx_v_fill_value);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pandas_5algos_332take_2d_axis1_float64_float64(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_values, PyArrayObject *__pyx_v_indexer, __Pyx_memviewslice __pyx_v_out, PyObject *__pyx_v_fill_value) {
  Py_ssize_t __pyx_v_i;
  Py_ssize_t __pyx_v_j;
  Py_ssize_t __pyx_v_k;
  Py_ssize_t __pyx_v_n;
  Py_ssize_t __pyx_v_idx;
  __pyx_t_5numpy_float64_t __pyx_v_fv;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_indexer;
  __Pyx_Buffer __pyx_pybuffer_indexer;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  int __pyx_t_3;
  int __pyx_t_4;
  int __pyx_t_5;
  __pyx_t_5numpy_float64_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;
  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("take_2d_axis1_float64_float64", 0);
  __pyx_pybuffer_indexer.pybuffer.buf = NULL;
  __pyx_pybuffer_indexer.refcount = 0;
  __pyx_pybuffernd_indexer.data = NULL;
  __pyx_pybuffernd_indexer.rcbuffer = &__pyx_pybuffer_indexer;
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer, (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[2]; __pyx_lineno = 3884; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_indexer.diminfo[0].strides = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_indexer.diminfo[0].shape = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.shape[0];

  /* "pandas/src/generated.pyx":3892
 *         float64_t fv
 * 
 *     n = len(values)             # <<<<<<<<<<<<<<
 *     k = len(indexer)
 * 
 */
  __pyx_t_1 = __pyx_memoryview_fromslice(__pyx_v_values, 2, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_5numpy_float64_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_5numpy_float64_t, 0);; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3892; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3892; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_n = __pyx_t_2;

  /* "pandas/src/generated.pyx":3893
 * 
 *     n = len(values)
 *     k = len(indexer)             # <<<<<<<<<<<<<<
 * 
 *     if n == 0 or k == 0:
 */
  __pyx_t_2 = PyObject_Length(((PyObject *)__pyx_v_indexer)); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3893; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_k = __pyx_t_2;

  /* "pandas/src/generated.pyx":3895
 *     k = len(indexer)
 * 
 *     if n == 0 or k == 0:             # <<<<<<<<<<<<<<
 *         return
 * 
 */
  __pyx_t_3 = ((__pyx_v_n == 0) != 0);
  if (!__pyx_t_3) {
    __pyx_t_4 = ((__pyx_v_k == 0) != 0);
    __pyx_t_5 = __pyx_t_4;
  } else {
    __pyx_t_5 = __pyx_t_3;
  }
  if (__pyx_t_5) {

    /* "pandas/src/generated.pyx":3896
 * 
 *     if n == 0 or k == 0:
 *         return             # <<<<<<<<<<<<<<
 * 
 *     fv = fill_value
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_r = Py_None; __Pyx_INCREF(Py_None);
    goto __pyx_L0;
  }

  /* "pandas/src/generated.pyx":3898
 *         return
 * 
 *     fv = fill_value             # <<<<<<<<<<<<<<
 * 
 *     for i from 0 <= i < n:
 */
  __pyx_t_6 = __pyx_PyFloat_AsDouble(__pyx_v_fill_value); if (unlikely((__pyx_t_6 == (npy_float64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3898; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_fv = __pyx_t_6;

  /* "pandas/src/generated.pyx":3900
 *     fv = fill_value
 * 
 *     for i from 0 <= i < n:             # <<<<<<<<<<<<<<
 *         for j from 0 <= j < k:
 *             idx = indexer[j]
 */
  __pyx_t_2 = __pyx_v_n;
  for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_2; __pyx_v_i++) {

    /* "pandas/src/generated.pyx":3901
 * 
 *     for i from 0 <= i < n:
 *         for j from 0 <= j < k:             # <<<<<<<<<<<<<<
 *             idx = indexer[j]
 *             if idx == -1:
 */
    __pyx_t_7 = __pyx_v_k;
    for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_7; __pyx_v_j++) {

      /* "pandas/src/generated.pyx":3902
 *     for i from 0 <= i < n:
 *         for j from 0 <= j < k:
 *             idx = indexer[j]             # <<<<<<<<<<<<<<
 *             if idx == -1:
 *                 out[i, j] = fv
 */
      __pyx_t_8 = __pyx_v_j;
      __pyx_v_idx = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_indexer.diminfo[0].strides));

      /* "pandas/src/generated.pyx":3903
 *         for j from 0 <= j < k:
 *             idx = indexer[j]
 *             if idx == -1:             # <<<<<<<<<<<<<<
 *                 out[i, j] = fv
 *             else:
 */
      __pyx_t_5 = ((__pyx_v_idx == -1) != 0);
      if (__pyx_t_5) {

        /* "pandas/src/generated.pyx":3904
 *             idx = indexer[j]
 *             if idx == -1:
 *                 out[i, j] = fv             # <<<<<<<<<<<<<<
 *             else:
 *                 out[i, j] = values[i, idx]
 */
        __pyx_t_9 = __pyx_v_i;
        __pyx_t_10 = __pyx_v_j;
        *((__pyx_t_5numpy_float64_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_out.data + __pyx_t_9 * __pyx_v_out.strides[0]) ) + __pyx_t_10 * __pyx_v_out.strides[1]) )) = __pyx_v_fv;
        goto __pyx_L8;
      }
      /*else*/ {

        /* "pandas/src/generated.pyx":3906
 *                 out[i, j] = fv
 *             else:
 *                 out[i, j] = values[i, idx]             # <<<<<<<<<<<<<<
 * 
 * @cython.wraparound(False)
 */
        __pyx_t_11 = __pyx_v_i;
        __pyx_t_12 = __pyx_v_idx;
        __pyx_t_13 = __pyx_v_i;
        __pyx_t_14 = __pyx_v_j;
        *((__pyx_t_5numpy_float64_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_out.data + __pyx_t_13 * __pyx_v_out.strides[0]) ) + __pyx_t_14 * __pyx_v_out.strides[1]) )) = (*((__pyx_t_5numpy_float64_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_values.data + __pyx_t_11 * __pyx_v_values.strides[0]) ) + __pyx_t_12 * __pyx_v_values.strides[1]) )));
      }
      __pyx_L8:;
    }
  }

  /* "pandas/src/generated.pyx":3884
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def take_2d_axis1_float64_float64(float64_t[:, :] values,             # <<<<<<<<<<<<<<
 *                                     ndarray[int64_t] indexer,
 *                                     float64_t[:, :] out,
 */

  /* function exit code */
  __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_pybuffernd_indexer.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas.algos.take_2d_axis1_float64_float64", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer);
  __pyx_L2:;
  __PYX_XDEC_MEMVIEW(&__pyx_v_values, 1);
  __PYX_XDEC_MEMVIEW(&__pyx_v_out, 1);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/src/generated.pyx":3910
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def take_2d_axis1_object_object(object[:, :] values,             # <<<<<<<<<<<<<<
 *                                     ndarray[int64_t] indexer,
 *                                     object[:, :] out,
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pandas_5algos_335take_2d_axis1_object_object(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_5algos_335take_2d_axis1_object_object = {__Pyx_NAMESTR("take_2d_axis1_object_object"), (PyCFunction)__pyx_pw_6pandas_5algos_335take_2d_axis1_object_object, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pw_6pandas_5algos_335take_2d_axis1_object_object(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  __Pyx_memviewslice __pyx_v_values = { 0, 0, { 0 }, { 0 }, { 0 } };
  PyArrayObject *__pyx_v_indexer = 0;
  __Pyx_memviewslice __pyx_v_out = { 0, 0, { 0 }, { 0 }, { 0 } };
  PyObject *__pyx_v_fill_value = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("take_2d_axis1_object_object (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_values,&__pyx_n_s_indexer,&__pyx_n_s_out,&__pyx_n_s_fill_value,0};
    PyObject* values[4] = {0,0,0,0};
    values[3] = __pyx_k__172;
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_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 (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_indexer)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("take_2d_axis1_object_object", 0, 3, 4, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3910; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_out)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("take_2d_axis1_object_object", 0, 3, 4, 2); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3910; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  3:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_fill_value);
          if (value) { values[3] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "take_2d_axis1_object_object") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3910; __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_values = __Pyx_PyObject_to_MemoryviewSlice_dsds_object(values[0]); if (unlikely(!__pyx_v_values.memview)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3910; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_v_indexer = ((PyArrayObject *)values[1]);
    __pyx_v_out = __Pyx_PyObject_to_MemoryviewSlice_dsds_object(values[2]); if (unlikely(!__pyx_v_out.memview)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3912; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_v_fill_value = values[3];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("take_2d_axis1_object_object", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3910; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas.algos.take_2d_axis1_object_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_indexer), __pyx_ptype_5numpy_ndarray, 1, "indexer", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3911; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_334take_2d_axis1_object_object(__pyx_self, __pyx_v_values, __pyx_v_indexer, __pyx_v_out, __pyx_v_fill_value);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pandas_5algos_334take_2d_axis1_object_object(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_values, PyArrayObject *__pyx_v_indexer, __Pyx_memviewslice __pyx_v_out, PyObject *__pyx_v_fill_value) {
  Py_ssize_t __pyx_v_i;
  Py_ssize_t __pyx_v_j;
  Py_ssize_t __pyx_v_k;
  Py_ssize_t __pyx_v_n;
  Py_ssize_t __pyx_v_idx;
  PyObject *__pyx_v_fv = 0;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_indexer;
  __Pyx_Buffer __pyx_pybuffer_indexer;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  int __pyx_t_3;
  int __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;
  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("take_2d_axis1_object_object", 0);
  __pyx_pybuffer_indexer.pybuffer.buf = NULL;
  __pyx_pybuffer_indexer.refcount = 0;
  __pyx_pybuffernd_indexer.data = NULL;
  __pyx_pybuffernd_indexer.rcbuffer = &__pyx_pybuffer_indexer;
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer, (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[2]; __pyx_lineno = 3910; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_indexer.diminfo[0].strides = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_indexer.diminfo[0].shape = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.shape[0];

  /* "pandas/src/generated.pyx":3918
 *         object fv
 * 
 *     n = len(values)             # <<<<<<<<<<<<<<
 *     k = len(indexer)
 * 
 */
  __pyx_t_1 = __pyx_memoryview_fromslice(__pyx_v_values, 2, (PyObject *(*)(char *)) __pyx_memview_get_object, (int (*)(char *, PyObject *)) __pyx_memview_set_object, 1);; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3918; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3918; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_n = __pyx_t_2;

  /* "pandas/src/generated.pyx":3919
 * 
 *     n = len(values)
 *     k = len(indexer)             # <<<<<<<<<<<<<<
 * 
 *     if n == 0 or k == 0:
 */
  __pyx_t_2 = PyObject_Length(((PyObject *)__pyx_v_indexer)); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3919; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_k = __pyx_t_2;

  /* "pandas/src/generated.pyx":3921
 *     k = len(indexer)
 * 
 *     if n == 0 or k == 0:             # <<<<<<<<<<<<<<
 *         return
 * 
 */
  __pyx_t_3 = ((__pyx_v_n == 0) != 0);
  if (!__pyx_t_3) {
    __pyx_t_4 = ((__pyx_v_k == 0) != 0);
    __pyx_t_5 = __pyx_t_4;
  } else {
    __pyx_t_5 = __pyx_t_3;
  }
  if (__pyx_t_5) {

    /* "pandas/src/generated.pyx":3922
 * 
 *     if n == 0 or k == 0:
 *         return             # <<<<<<<<<<<<<<
 * 
 *     fv = fill_value
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_r = Py_None; __Pyx_INCREF(Py_None);
    goto __pyx_L0;
  }

  /* "pandas/src/generated.pyx":3924
 *         return
 * 
 *     fv = fill_value             # <<<<<<<<<<<<<<
 * 
 *     for i from 0 <= i < n:
 */
  __Pyx_INCREF(__pyx_v_fill_value);
  __pyx_v_fv = __pyx_v_fill_value;

  /* "pandas/src/generated.pyx":3926
 *     fv = fill_value
 * 
 *     for i from 0 <= i < n:             # <<<<<<<<<<<<<<
 *         for j from 0 <= j < k:
 *             idx = indexer[j]
 */
  __pyx_t_2 = __pyx_v_n;
  for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_2; __pyx_v_i++) {

    /* "pandas/src/generated.pyx":3927
 * 
 *     for i from 0 <= i < n:
 *         for j from 0 <= j < k:             # <<<<<<<<<<<<<<
 *             idx = indexer[j]
 *             if idx == -1:
 */
    __pyx_t_6 = __pyx_v_k;
    for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_6; __pyx_v_j++) {

      /* "pandas/src/generated.pyx":3928
 *     for i from 0 <= i < n:
 *         for j from 0 <= j < k:
 *             idx = indexer[j]             # <<<<<<<<<<<<<<
 *             if idx == -1:
 *                 out[i, j] = fv
 */
      __pyx_t_7 = __pyx_v_j;
      __pyx_v_idx = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_7, __pyx_pybuffernd_indexer.diminfo[0].strides));

      /* "pandas/src/generated.pyx":3929
 *         for j from 0 <= j < k:
 *             idx = indexer[j]
 *             if idx == -1:             # <<<<<<<<<<<<<<
 *                 out[i, j] = fv
 *             else:
 */
      __pyx_t_5 = ((__pyx_v_idx == -1) != 0);
      if (__pyx_t_5) {

        /* "pandas/src/generated.pyx":3930
 *             idx = indexer[j]
 *             if idx == -1:
 *                 out[i, j] = fv             # <<<<<<<<<<<<<<
 *             else:
 *                 out[i, j] = values[i, idx]
 */
        __pyx_t_8 = __pyx_v_i;
        __pyx_t_9 = __pyx_v_j;
        __pyx_t_10 = ((PyObject * *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_out.data + __pyx_t_8 * __pyx_v_out.strides[0]) ) + __pyx_t_9 * __pyx_v_out.strides[1]) ));
        __Pyx_GOTREF(*__pyx_t_10);
        __Pyx_INCREF(__pyx_v_fv); __Pyx_DECREF(*__pyx_t_10);
        *__pyx_t_10 = __pyx_v_fv;
        __Pyx_GIVEREF(*__pyx_t_10);
        goto __pyx_L8;
      }
      /*else*/ {

        /* "pandas/src/generated.pyx":3932
 *                 out[i, j] = fv
 *             else:
 *                 out[i, j] = values[i, idx]             # <<<<<<<<<<<<<<
 * 
 * 
 */
        __pyx_t_11 = __pyx_v_i;
        __pyx_t_12 = __pyx_v_idx;
        __pyx_t_1 = (PyObject *) *((PyObject * *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_values.data + __pyx_t_11 * __pyx_v_values.strides[0]) ) + __pyx_t_12 * __pyx_v_values.strides[1]) ));
        __Pyx_INCREF((PyObject*)__pyx_t_1);
        __pyx_t_13 = __pyx_v_i;
        __pyx_t_14 = __pyx_v_j;
        __pyx_t_10 = ((PyObject * *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_out.data + __pyx_t_13 * __pyx_v_out.strides[0]) ) + __pyx_t_14 * __pyx_v_out.strides[1]) ));
        __Pyx_GOTREF(*__pyx_t_10);
        __Pyx_INCREF(__pyx_t_1); __Pyx_DECREF(*__pyx_t_10);
        *__pyx_t_10 = __pyx_t_1;
        __Pyx_GIVEREF(*__pyx_t_10);
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      }
      __pyx_L8:;
    }
  }

  /* "pandas/src/generated.pyx":3910
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def take_2d_axis1_object_object(object[:, :] values,             # <<<<<<<<<<<<<<
 *                                     ndarray[int64_t] indexer,
 *                                     object[:, :] out,
 */

  /* function exit code */
  __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_pybuffernd_indexer.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas.algos.take_2d_axis1_object_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer);
  __pyx_L2:;
  __Pyx_XDECREF(__pyx_v_fv);
  __PYX_XDEC_MEMVIEW(&__pyx_v_values, 1);
  __PYX_XDEC_MEMVIEW(&__pyx_v_out, 1);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/src/generated.pyx":3937
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def take_2d_multi_bool_bool(ndarray[uint8_t, ndim=2] values,             # <<<<<<<<<<<<<<
 *                                     indexer,
 *                                     ndarray[uint8_t, ndim=2] out,
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pandas_5algos_337take_2d_multi_bool_bool(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_5algos_337take_2d_multi_bool_bool = {__Pyx_NAMESTR("take_2d_multi_bool_bool"), (PyCFunction)__pyx_pw_6pandas_5algos_337take_2d_multi_bool_bool, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pw_6pandas_5algos_337take_2d_multi_bool_bool(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyArrayObject *__pyx_v_values = 0;
  PyObject *__pyx_v_indexer = 0;
  PyArrayObject *__pyx_v_out = 0;
  PyObject *__pyx_v_fill_value = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("take_2d_multi_bool_bool (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_values,&__pyx_n_s_indexer,&__pyx_n_s_out,&__pyx_n_s_fill_value,0};
    PyObject* values[4] = {0,0,0,0};
    values[3] = __pyx_k__173;
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_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 (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_indexer)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("take_2d_multi_bool_bool", 0, 3, 4, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3937; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_out)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("take_2d_multi_bool_bool", 0, 3, 4, 2); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3937; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  3:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_fill_value);
          if (value) { values[3] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "take_2d_multi_bool_bool") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3937; __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_values = ((PyArrayObject *)values[0]);
    __pyx_v_indexer = values[1];
    __pyx_v_out = ((PyArrayObject *)values[2]);
    __pyx_v_fill_value = values[3];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("take_2d_multi_bool_bool", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3937; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas.algos.take_2d_multi_bool_bool", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3937; __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[2]; __pyx_lineno = 3939; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_336take_2d_multi_bool_bool(__pyx_self, __pyx_v_values, __pyx_v_indexer, __pyx_v_out, __pyx_v_fill_value);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pandas_5algos_336take_2d_multi_bool_bool(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, PyObject *__pyx_v_indexer, PyArrayObject *__pyx_v_out, PyObject *__pyx_v_fill_value) {
  Py_ssize_t __pyx_v_i;
  Py_ssize_t __pyx_v_j;
  Py_ssize_t __pyx_v_k;
  Py_ssize_t __pyx_v_n;
  Py_ssize_t __pyx_v_idx;
  PyArrayObject *__pyx_v_idx0 = 0;
  PyArrayObject *__pyx_v_idx1 = 0;
  __pyx_t_5numpy_uint8_t __pyx_v_fv;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_idx0;
  __Pyx_Buffer __pyx_pybuffer_idx0;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_idx1;
  __Pyx_Buffer __pyx_pybuffer_idx1;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_out;
  __Pyx_Buffer __pyx_pybuffer_out;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_values;
  __Pyx_Buffer __pyx_pybuffer_values;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyArrayObject *__pyx_t_2 = NULL;
  PyArrayObject *__pyx_t_3 = NULL;
  Py_ssize_t __pyx_t_4;
  __pyx_t_5numpy_uint8_t __pyx_t_5;
  Py_ssize_t __pyx_t_6;
  int __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;
  Py_ssize_t __pyx_t_12;
  Py_ssize_t __pyx_t_13;
  Py_ssize_t __pyx_t_14;
  Py_ssize_t __pyx_t_15;
  __pyx_t_5numpy_int64_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("take_2d_multi_bool_bool", 0);
  __pyx_pybuffer_idx0.pybuffer.buf = NULL;
  __pyx_pybuffer_idx0.refcount = 0;
  __pyx_pybuffernd_idx0.data = NULL;
  __pyx_pybuffernd_idx0.rcbuffer = &__pyx_pybuffer_idx0;
  __pyx_pybuffer_idx1.pybuffer.buf = NULL;
  __pyx_pybuffer_idx1.refcount = 0;
  __pyx_pybuffernd_idx1.data = NULL;
  __pyx_pybuffernd_idx1.rcbuffer = &__pyx_pybuffer_idx1;
  __pyx_pybuffer_values.pybuffer.buf = NULL;
  __pyx_pybuffer_values.refcount = 0;
  __pyx_pybuffernd_values.data = NULL;
  __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values;
  __pyx_pybuffer_out.pybuffer.buf = NULL;
  __pyx_pybuffer_out.refcount = 0;
  __pyx_pybuffernd_out.data = NULL;
  __pyx_pybuffernd_out.rcbuffer = &__pyx_pybuffer_out;
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3937; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_values.diminfo[1].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_values.diminfo[1].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[1];
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_out.rcbuffer->pybuffer, (PyObject*)__pyx_v_out, &__Pyx_TypeInfo_nn___pyx_t_5numpy_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3937; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_out.diminfo[0].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_out.diminfo[0].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_out.diminfo[1].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_out.diminfo[1].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[1];

  /* "pandas/src/generated.pyx":3943
 *     cdef:
 *         Py_ssize_t i, j, k, n, idx
 *         ndarray[int64_t] idx0 = indexer[0]             # <<<<<<<<<<<<<<
 *         ndarray[int64_t] idx1 = indexer[1]
 *         uint8_t fv
 */
  __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_indexer, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3943; __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[2]; __pyx_lineno = 3943; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_2 = ((PyArrayObject *)__pyx_t_1);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_idx0.rcbuffer->pybuffer, (PyObject*)__pyx_t_2, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
      __pyx_v_idx0 = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_idx0.rcbuffer->pybuffer.buf = NULL;
      {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3943; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    } else {__pyx_pybuffernd_idx0.diminfo[0].strides = __pyx_pybuffernd_idx0.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_idx0.diminfo[0].shape = __pyx_pybuffernd_idx0.rcbuffer->pybuffer.shape[0];
    }
  }
  __pyx_t_2 = 0;
  __pyx_v_idx0 = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pandas/src/generated.pyx":3944
 *         Py_ssize_t i, j, k, n, idx
 *         ndarray[int64_t] idx0 = indexer[0]
 *         ndarray[int64_t] idx1 = indexer[1]             # <<<<<<<<<<<<<<
 *         uint8_t fv
 * 
 */
  __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_indexer, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3944; __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[2]; __pyx_lineno = 3944; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_3 = ((PyArrayObject *)__pyx_t_1);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_idx1.rcbuffer->pybuffer, (PyObject*)__pyx_t_3, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
      __pyx_v_idx1 = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_idx1.rcbuffer->pybuffer.buf = NULL;
      {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3944; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    } else {__pyx_pybuffernd_idx1.diminfo[0].strides = __pyx_pybuffernd_idx1.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_idx1.diminfo[0].shape = __pyx_pybuffernd_idx1.rcbuffer->pybuffer.shape[0];
    }
  }
  __pyx_t_3 = 0;
  __pyx_v_idx1 = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pandas/src/generated.pyx":3947
 *         uint8_t fv
 * 
 *     n = len(idx0)             # <<<<<<<<<<<<<<
 *     k = len(idx1)
 * 
 */
  __pyx_t_4 = PyObject_Length(((PyObject *)__pyx_v_idx0)); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3947; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_n = __pyx_t_4;

  /* "pandas/src/generated.pyx":3948
 * 
 *     n = len(idx0)
 *     k = len(idx1)             # <<<<<<<<<<<<<<
 * 
 *     fv = fill_value
 */
  __pyx_t_4 = PyObject_Length(((PyObject *)__pyx_v_idx1)); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3948; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_k = __pyx_t_4;

  /* "pandas/src/generated.pyx":3950
 *     k = len(idx1)
 * 
 *     fv = fill_value             # <<<<<<<<<<<<<<
 *     for i from 0 <= i < n:
 *         idx = idx0[i]
 */
  __pyx_t_5 = __Pyx_PyInt_As_npy_uint8(__pyx_v_fill_value); if (unlikely((__pyx_t_5 == (npy_uint8)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3950; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_fv = __pyx_t_5;

  /* "pandas/src/generated.pyx":3951
 * 
 *     fv = fill_value
 *     for i from 0 <= i < n:             # <<<<<<<<<<<<<<
 *         idx = idx0[i]
 *         if idx == -1:
 */
  __pyx_t_4 = __pyx_v_n;
  for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_4; __pyx_v_i++) {

    /* "pandas/src/generated.pyx":3952
 *     fv = fill_value
 *     for i from 0 <= i < n:
 *         idx = idx0[i]             # <<<<<<<<<<<<<<
 *         if idx == -1:
 *             for j from 0 <= j < k:
 */
    __pyx_t_6 = __pyx_v_i;
    __pyx_v_idx = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_idx0.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_idx0.diminfo[0].strides));

    /* "pandas/src/generated.pyx":3953
 *     for i from 0 <= i < n:
 *         idx = idx0[i]
 *         if idx == -1:             # <<<<<<<<<<<<<<
 *             for j from 0 <= j < k:
 *                 out[i, j] = fv
 */
    __pyx_t_7 = ((__pyx_v_idx == -1) != 0);
    if (__pyx_t_7) {

      /* "pandas/src/generated.pyx":3954
 *         idx = idx0[i]
 *         if idx == -1:
 *             for j from 0 <= j < k:             # <<<<<<<<<<<<<<
 *                 out[i, j] = fv
 *         else:
 */
      __pyx_t_8 = __pyx_v_k;
      for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_8; __pyx_v_j++) {

        /* "pandas/src/generated.pyx":3955
 *         if idx == -1:
 *             for j from 0 <= j < k:
 *                 out[i, j] = fv             # <<<<<<<<<<<<<<
 *         else:
 *             for j from 0 <= j < k:
 */
        __pyx_t_9 = __pyx_v_i;
        __pyx_t_10 = __pyx_v_j;
        *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_uint8_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_9, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_10, __pyx_pybuffernd_out.diminfo[1].strides) = __pyx_v_fv;
      }
      goto __pyx_L5;
    }
    /*else*/ {

      /* "pandas/src/generated.pyx":3957
 *                 out[i, j] = fv
 *         else:
 *             for j from 0 <= j < k:             # <<<<<<<<<<<<<<
 *                 if idx1[j] == -1:
 *                     out[i, j] = fv
 */
      __pyx_t_8 = __pyx_v_k;
      for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_8; __pyx_v_j++) {

        /* "pandas/src/generated.pyx":3958
 *         else:
 *             for j from 0 <= j < k:
 *                 if idx1[j] == -1:             # <<<<<<<<<<<<<<
 *                     out[i, j] = fv
 *                 else:
 */
        __pyx_t_11 = __pyx_v_j;
        __pyx_t_7 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_idx1.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_idx1.diminfo[0].strides)) == -1) != 0);
        if (__pyx_t_7) {

          /* "pandas/src/generated.pyx":3959
 *             for j from 0 <= j < k:
 *                 if idx1[j] == -1:
 *                     out[i, j] = fv             # <<<<<<<<<<<<<<
 *                 else:
 *                     out[i, j] = values[idx, idx1[j]]
 */
          __pyx_t_12 = __pyx_v_i;
          __pyx_t_13 = __pyx_v_j;
          *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_uint8_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_12, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_13, __pyx_pybuffernd_out.diminfo[1].strides) = __pyx_v_fv;
          goto __pyx_L10;
        }
        /*else*/ {

          /* "pandas/src/generated.pyx":3961
 *                     out[i, j] = fv
 *                 else:
 *                     out[i, j] = values[idx, idx1[j]]             # <<<<<<<<<<<<<<
 * 
 * @cython.wraparound(False)
 */
          __pyx_t_14 = __pyx_v_j;
          __pyx_t_15 = __pyx_v_idx;
          __pyx_t_16 = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_idx1.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_idx1.diminfo[0].strides));
          __pyx_t_17 = __pyx_v_i;
          __pyx_t_18 = __pyx_v_j;
          *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_uint8_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_18, __pyx_pybuffernd_out.diminfo[1].strides) = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_uint8_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_values.diminfo[0].strides, __pyx_t_16, __pyx_pybuffernd_values.diminfo[1].strides));
        }
        __pyx_L10:;
      }
    }
    __pyx_L5:;
  }

  /* "pandas/src/generated.pyx":3937
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def take_2d_multi_bool_bool(ndarray[uint8_t, ndim=2] values,             # <<<<<<<<<<<<<<
 *                                     indexer,
 *                                     ndarray[uint8_t, ndim=2] out,
 */

  /* function exit code */
  __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_pybuffernd_idx0.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_idx1.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas.algos.take_2d_multi_bool_bool", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_idx0.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_idx1.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer);
  __pyx_L2:;
  __Pyx_XDECREF((PyObject *)__pyx_v_idx0);
  __Pyx_XDECREF((PyObject *)__pyx_v_idx1);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/src/generated.pyx":3965
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def take_2d_multi_bool_object(ndarray[uint8_t, ndim=2] values,             # <<<<<<<<<<<<<<
 *                                     indexer,
 *                                     ndarray[object, ndim=2] out,
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pandas_5algos_339take_2d_multi_bool_object(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_5algos_339take_2d_multi_bool_object = {__Pyx_NAMESTR("take_2d_multi_bool_object"), (PyCFunction)__pyx_pw_6pandas_5algos_339take_2d_multi_bool_object, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pw_6pandas_5algos_339take_2d_multi_bool_object(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyArrayObject *__pyx_v_values = 0;
  PyObject *__pyx_v_indexer = 0;
  PyArrayObject *__pyx_v_out = 0;
  PyObject *__pyx_v_fill_value = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("take_2d_multi_bool_object (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_values,&__pyx_n_s_indexer,&__pyx_n_s_out,&__pyx_n_s_fill_value,0};
    PyObject* values[4] = {0,0,0,0};
    values[3] = __pyx_k__174;
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_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 (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_indexer)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("take_2d_multi_bool_object", 0, 3, 4, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3965; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_out)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("take_2d_multi_bool_object", 0, 3, 4, 2); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3965; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  3:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_fill_value);
          if (value) { values[3] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "take_2d_multi_bool_object") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3965; __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_values = ((PyArrayObject *)values[0]);
    __pyx_v_indexer = values[1];
    __pyx_v_out = ((PyArrayObject *)values[2]);
    __pyx_v_fill_value = values[3];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("take_2d_multi_bool_object", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3965; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas.algos.take_2d_multi_bool_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3965; __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[2]; __pyx_lineno = 3967; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_338take_2d_multi_bool_object(__pyx_self, __pyx_v_values, __pyx_v_indexer, __pyx_v_out, __pyx_v_fill_value);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pandas_5algos_338take_2d_multi_bool_object(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, PyObject *__pyx_v_indexer, PyArrayObject *__pyx_v_out, PyObject *__pyx_v_fill_value) {
  Py_ssize_t __pyx_v_i;
  Py_ssize_t __pyx_v_j;
  Py_ssize_t __pyx_v_k;
  Py_ssize_t __pyx_v_n;
  Py_ssize_t __pyx_v_idx;
  PyArrayObject *__pyx_v_idx0 = 0;
  PyArrayObject *__pyx_v_idx1 = 0;
  PyObject *__pyx_v_fv = 0;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_idx0;
  __Pyx_Buffer __pyx_pybuffer_idx0;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_idx1;
  __Pyx_Buffer __pyx_pybuffer_idx1;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_out;
  __Pyx_Buffer __pyx_pybuffer_out;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_values;
  __Pyx_Buffer __pyx_pybuffer_values;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyArrayObject *__pyx_t_2 = NULL;
  PyArrayObject *__pyx_t_3 = NULL;
  Py_ssize_t __pyx_t_4;
  Py_ssize_t __pyx_t_5;
  int __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;
  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;
  __pyx_t_5numpy_int64_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("take_2d_multi_bool_object", 0);
  __pyx_pybuffer_idx0.pybuffer.buf = NULL;
  __pyx_pybuffer_idx0.refcount = 0;
  __pyx_pybuffernd_idx0.data = NULL;
  __pyx_pybuffernd_idx0.rcbuffer = &__pyx_pybuffer_idx0;
  __pyx_pybuffer_idx1.pybuffer.buf = NULL;
  __pyx_pybuffer_idx1.refcount = 0;
  __pyx_pybuffernd_idx1.data = NULL;
  __pyx_pybuffernd_idx1.rcbuffer = &__pyx_pybuffer_idx1;
  __pyx_pybuffer_values.pybuffer.buf = NULL;
  __pyx_pybuffer_values.refcount = 0;
  __pyx_pybuffernd_values.data = NULL;
  __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values;
  __pyx_pybuffer_out.pybuffer.buf = NULL;
  __pyx_pybuffer_out.refcount = 0;
  __pyx_pybuffernd_out.data = NULL;
  __pyx_pybuffernd_out.rcbuffer = &__pyx_pybuffer_out;
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3965; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_values.diminfo[1].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_values.diminfo[1].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[1];
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_out.rcbuffer->pybuffer, (PyObject*)__pyx_v_out, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3965; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_out.diminfo[0].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_out.diminfo[0].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_out.diminfo[1].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_out.diminfo[1].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[1];

  /* "pandas/src/generated.pyx":3971
 *     cdef:
 *         Py_ssize_t i, j, k, n, idx
 *         ndarray[int64_t] idx0 = indexer[0]             # <<<<<<<<<<<<<<
 *         ndarray[int64_t] idx1 = indexer[1]
 *         object fv
 */
  __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_indexer, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3971; __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[2]; __pyx_lineno = 3971; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_2 = ((PyArrayObject *)__pyx_t_1);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_idx0.rcbuffer->pybuffer, (PyObject*)__pyx_t_2, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
      __pyx_v_idx0 = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_idx0.rcbuffer->pybuffer.buf = NULL;
      {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3971; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    } else {__pyx_pybuffernd_idx0.diminfo[0].strides = __pyx_pybuffernd_idx0.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_idx0.diminfo[0].shape = __pyx_pybuffernd_idx0.rcbuffer->pybuffer.shape[0];
    }
  }
  __pyx_t_2 = 0;
  __pyx_v_idx0 = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pandas/src/generated.pyx":3972
 *         Py_ssize_t i, j, k, n, idx
 *         ndarray[int64_t] idx0 = indexer[0]
 *         ndarray[int64_t] idx1 = indexer[1]             # <<<<<<<<<<<<<<
 *         object fv
 * 
 */
  __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_indexer, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3972; __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[2]; __pyx_lineno = 3972; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_3 = ((PyArrayObject *)__pyx_t_1);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_idx1.rcbuffer->pybuffer, (PyObject*)__pyx_t_3, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
      __pyx_v_idx1 = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_idx1.rcbuffer->pybuffer.buf = NULL;
      {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3972; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    } else {__pyx_pybuffernd_idx1.diminfo[0].strides = __pyx_pybuffernd_idx1.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_idx1.diminfo[0].shape = __pyx_pybuffernd_idx1.rcbuffer->pybuffer.shape[0];
    }
  }
  __pyx_t_3 = 0;
  __pyx_v_idx1 = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pandas/src/generated.pyx":3975
 *         object fv
 * 
 *     n = len(idx0)             # <<<<<<<<<<<<<<
 *     k = len(idx1)
 * 
 */
  __pyx_t_4 = PyObject_Length(((PyObject *)__pyx_v_idx0)); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3975; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_n = __pyx_t_4;

  /* "pandas/src/generated.pyx":3976
 * 
 *     n = len(idx0)
 *     k = len(idx1)             # <<<<<<<<<<<<<<
 * 
 *     fv = fill_value
 */
  __pyx_t_4 = PyObject_Length(((PyObject *)__pyx_v_idx1)); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3976; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_k = __pyx_t_4;

  /* "pandas/src/generated.pyx":3978
 *     k = len(idx1)
 * 
 *     fv = fill_value             # <<<<<<<<<<<<<<
 *     for i from 0 <= i < n:
 *         idx = idx0[i]
 */
  __Pyx_INCREF(__pyx_v_fill_value);
  __pyx_v_fv = __pyx_v_fill_value;

  /* "pandas/src/generated.pyx":3979
 * 
 *     fv = fill_value
 *     for i from 0 <= i < n:             # <<<<<<<<<<<<<<
 *         idx = idx0[i]
 *         if idx == -1:
 */
  __pyx_t_4 = __pyx_v_n;
  for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_4; __pyx_v_i++) {

    /* "pandas/src/generated.pyx":3980
 *     fv = fill_value
 *     for i from 0 <= i < n:
 *         idx = idx0[i]             # <<<<<<<<<<<<<<
 *         if idx == -1:
 *             for j from 0 <= j < k:
 */
    __pyx_t_5 = __pyx_v_i;
    __pyx_v_idx = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_idx0.rcbuffer->pybuffer.buf, __pyx_t_5, __pyx_pybuffernd_idx0.diminfo[0].strides));

    /* "pandas/src/generated.pyx":3981
 *     for i from 0 <= i < n:
 *         idx = idx0[i]
 *         if idx == -1:             # <<<<<<<<<<<<<<
 *             for j from 0 <= j < k:
 *                 out[i, j] = fv
 */
    __pyx_t_6 = ((__pyx_v_idx == -1) != 0);
    if (__pyx_t_6) {

      /* "pandas/src/generated.pyx":3982
 *         idx = idx0[i]
 *         if idx == -1:
 *             for j from 0 <= j < k:             # <<<<<<<<<<<<<<
 *                 out[i, j] = fv
 *         else:
 */
      __pyx_t_7 = __pyx_v_k;
      for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_7; __pyx_v_j++) {

        /* "pandas/src/generated.pyx":3983
 *         if idx == -1:
 *             for j from 0 <= j < k:
 *                 out[i, j] = fv             # <<<<<<<<<<<<<<
 *         else:
 *             for j from 0 <= j < k:
 */
        __pyx_t_8 = __pyx_v_i;
        __pyx_t_9 = __pyx_v_j;
        __pyx_t_10 = __Pyx_BufPtrStrided2d(PyObject **, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_9, __pyx_pybuffernd_out.diminfo[1].strides);
        __Pyx_GOTREF(*__pyx_t_10);
        __Pyx_INCREF(__pyx_v_fv); __Pyx_DECREF(*__pyx_t_10);
        *__pyx_t_10 = __pyx_v_fv;
        __Pyx_GIVEREF(*__pyx_t_10);
      }
      goto __pyx_L5;
    }
    /*else*/ {

      /* "pandas/src/generated.pyx":3985
 *                 out[i, j] = fv
 *         else:
 *             for j from 0 <= j < k:             # <<<<<<<<<<<<<<
 *                 if idx1[j] == -1:
 *                     out[i, j] = fv
 */
      __pyx_t_7 = __pyx_v_k;
      for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_7; __pyx_v_j++) {

        /* "pandas/src/generated.pyx":3986
 *         else:
 *             for j from 0 <= j < k:
 *                 if idx1[j] == -1:             # <<<<<<<<<<<<<<
 *                     out[i, j] = fv
 *                 else:
 */
        __pyx_t_11 = __pyx_v_j;
        __pyx_t_6 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_idx1.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_idx1.diminfo[0].strides)) == -1) != 0);
        if (__pyx_t_6) {

          /* "pandas/src/generated.pyx":3987
 *             for j from 0 <= j < k:
 *                 if idx1[j] == -1:
 *                     out[i, j] = fv             # <<<<<<<<<<<<<<
 *                 else:
 *                     out[i, j] = True if values[idx, idx1[j]] > 0 else False
 */
          __pyx_t_12 = __pyx_v_i;
          __pyx_t_13 = __pyx_v_j;
          __pyx_t_10 = __Pyx_BufPtrStrided2d(PyObject **, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_12, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_13, __pyx_pybuffernd_out.diminfo[1].strides);
          __Pyx_GOTREF(*__pyx_t_10);
          __Pyx_INCREF(__pyx_v_fv); __Pyx_DECREF(*__pyx_t_10);
          *__pyx_t_10 = __pyx_v_fv;
          __Pyx_GIVEREF(*__pyx_t_10);
          goto __pyx_L10;
        }
        /*else*/ {

          /* "pandas/src/generated.pyx":3989
 *                     out[i, j] = fv
 *                 else:
 *                     out[i, j] = True if values[idx, idx1[j]] > 0 else False             # <<<<<<<<<<<<<<
 * 
 * @cython.wraparound(False)
 */
          __pyx_t_14 = __pyx_v_j;
          __pyx_t_15 = __pyx_v_idx;
          __pyx_t_16 = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_idx1.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_idx1.diminfo[0].strides));
          if ((((*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_uint8_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_values.diminfo[0].strides, __pyx_t_16, __pyx_pybuffernd_values.diminfo[1].strides)) > 0) != 0)) {
            __Pyx_INCREF(Py_True);
            __pyx_t_1 = Py_True;
          } else {
            __Pyx_INCREF(Py_False);
            __pyx_t_1 = Py_False;
          }
          __pyx_t_17 = __pyx_v_i;
          __pyx_t_18 = __pyx_v_j;
          __pyx_t_10 = __Pyx_BufPtrStrided2d(PyObject **, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_18, __pyx_pybuffernd_out.diminfo[1].strides);
          __Pyx_GOTREF(*__pyx_t_10);
          __Pyx_INCREF(__pyx_t_1); __Pyx_DECREF(*__pyx_t_10);
          *__pyx_t_10 = __pyx_t_1;
          __Pyx_GIVEREF(*__pyx_t_10);
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        }
        __pyx_L10:;
      }
    }
    __pyx_L5:;
  }

  /* "pandas/src/generated.pyx":3965
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def take_2d_multi_bool_object(ndarray[uint8_t, ndim=2] values,             # <<<<<<<<<<<<<<
 *                                     indexer,
 *                                     ndarray[object, ndim=2] out,
 */

  /* function exit code */
  __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_pybuffernd_idx0.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_idx1.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas.algos.take_2d_multi_bool_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_idx0.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_idx1.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer);
  __pyx_L2:;
  __Pyx_XDECREF((PyObject *)__pyx_v_idx0);
  __Pyx_XDECREF((PyObject *)__pyx_v_idx1);
  __Pyx_XDECREF(__pyx_v_fv);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/src/generated.pyx":3993
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def take_2d_multi_int8_int8(ndarray[int8_t, ndim=2] values,             # <<<<<<<<<<<<<<
 *                                     indexer,
 *                                     ndarray[int8_t, ndim=2] out,
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pandas_5algos_341take_2d_multi_int8_int8(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_5algos_341take_2d_multi_int8_int8 = {__Pyx_NAMESTR("take_2d_multi_int8_int8"), (PyCFunction)__pyx_pw_6pandas_5algos_341take_2d_multi_int8_int8, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pw_6pandas_5algos_341take_2d_multi_int8_int8(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyArrayObject *__pyx_v_values = 0;
  PyObject *__pyx_v_indexer = 0;
  PyArrayObject *__pyx_v_out = 0;
  PyObject *__pyx_v_fill_value = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("take_2d_multi_int8_int8 (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_values,&__pyx_n_s_indexer,&__pyx_n_s_out,&__pyx_n_s_fill_value,0};
    PyObject* values[4] = {0,0,0,0};
    values[3] = __pyx_k__175;
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_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 (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_indexer)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("take_2d_multi_int8_int8", 0, 3, 4, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3993; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_out)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("take_2d_multi_int8_int8", 0, 3, 4, 2); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3993; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  3:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_fill_value);
          if (value) { values[3] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "take_2d_multi_int8_int8") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3993; __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_values = ((PyArrayObject *)values[0]);
    __pyx_v_indexer = values[1];
    __pyx_v_out = ((PyArrayObject *)values[2]);
    __pyx_v_fill_value = values[3];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("take_2d_multi_int8_int8", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3993; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas.algos.take_2d_multi_int8_int8", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3993; __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[2]; __pyx_lineno = 3995; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_340take_2d_multi_int8_int8(__pyx_self, __pyx_v_values, __pyx_v_indexer, __pyx_v_out, __pyx_v_fill_value);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pandas_5algos_340take_2d_multi_int8_int8(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, PyObject *__pyx_v_indexer, PyArrayObject *__pyx_v_out, PyObject *__pyx_v_fill_value) {
  Py_ssize_t __pyx_v_i;
  Py_ssize_t __pyx_v_j;
  Py_ssize_t __pyx_v_k;
  Py_ssize_t __pyx_v_n;
  Py_ssize_t __pyx_v_idx;
  PyArrayObject *__pyx_v_idx0 = 0;
  PyArrayObject *__pyx_v_idx1 = 0;
  __pyx_t_5numpy_int8_t __pyx_v_fv;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_idx0;
  __Pyx_Buffer __pyx_pybuffer_idx0;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_idx1;
  __Pyx_Buffer __pyx_pybuffer_idx1;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_out;
  __Pyx_Buffer __pyx_pybuffer_out;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_values;
  __Pyx_Buffer __pyx_pybuffer_values;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyArrayObject *__pyx_t_2 = NULL;
  PyArrayObject *__pyx_t_3 = NULL;
  Py_ssize_t __pyx_t_4;
  __pyx_t_5numpy_int8_t __pyx_t_5;
  Py_ssize_t __pyx_t_6;
  int __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;
  Py_ssize_t __pyx_t_12;
  Py_ssize_t __pyx_t_13;
  Py_ssize_t __pyx_t_14;
  Py_ssize_t __pyx_t_15;
  __pyx_t_5numpy_int64_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("take_2d_multi_int8_int8", 0);
  __pyx_pybuffer_idx0.pybuffer.buf = NULL;
  __pyx_pybuffer_idx0.refcount = 0;
  __pyx_pybuffernd_idx0.data = NULL;
  __pyx_pybuffernd_idx0.rcbuffer = &__pyx_pybuffer_idx0;
  __pyx_pybuffer_idx1.pybuffer.buf = NULL;
  __pyx_pybuffer_idx1.refcount = 0;
  __pyx_pybuffernd_idx1.data = NULL;
  __pyx_pybuffernd_idx1.rcbuffer = &__pyx_pybuffer_idx1;
  __pyx_pybuffer_values.pybuffer.buf = NULL;
  __pyx_pybuffer_values.refcount = 0;
  __pyx_pybuffernd_values.data = NULL;
  __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values;
  __pyx_pybuffer_out.pybuffer.buf = NULL;
  __pyx_pybuffer_out.refcount = 0;
  __pyx_pybuffernd_out.data = NULL;
  __pyx_pybuffernd_out.rcbuffer = &__pyx_pybuffer_out;
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int8_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3993; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_values.diminfo[1].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_values.diminfo[1].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[1];
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_out.rcbuffer->pybuffer, (PyObject*)__pyx_v_out, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int8_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3993; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_out.diminfo[0].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_out.diminfo[0].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_out.diminfo[1].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_out.diminfo[1].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[1];

  /* "pandas/src/generated.pyx":3999
 *     cdef:
 *         Py_ssize_t i, j, k, n, idx
 *         ndarray[int64_t] idx0 = indexer[0]             # <<<<<<<<<<<<<<
 *         ndarray[int64_t] idx1 = indexer[1]
 *         int8_t fv
 */
  __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_indexer, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3999; __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[2]; __pyx_lineno = 3999; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_2 = ((PyArrayObject *)__pyx_t_1);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_idx0.rcbuffer->pybuffer, (PyObject*)__pyx_t_2, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
      __pyx_v_idx0 = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_idx0.rcbuffer->pybuffer.buf = NULL;
      {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3999; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    } else {__pyx_pybuffernd_idx0.diminfo[0].strides = __pyx_pybuffernd_idx0.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_idx0.diminfo[0].shape = __pyx_pybuffernd_idx0.rcbuffer->pybuffer.shape[0];
    }
  }
  __pyx_t_2 = 0;
  __pyx_v_idx0 = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pandas/src/generated.pyx":4000
 *         Py_ssize_t i, j, k, n, idx
 *         ndarray[int64_t] idx0 = indexer[0]
 *         ndarray[int64_t] idx1 = indexer[1]             # <<<<<<<<<<<<<<
 *         int8_t fv
 * 
 */
  __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_indexer, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4000; __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[2]; __pyx_lineno = 4000; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_3 = ((PyArrayObject *)__pyx_t_1);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_idx1.rcbuffer->pybuffer, (PyObject*)__pyx_t_3, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
      __pyx_v_idx1 = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_idx1.rcbuffer->pybuffer.buf = NULL;
      {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4000; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    } else {__pyx_pybuffernd_idx1.diminfo[0].strides = __pyx_pybuffernd_idx1.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_idx1.diminfo[0].shape = __pyx_pybuffernd_idx1.rcbuffer->pybuffer.shape[0];
    }
  }
  __pyx_t_3 = 0;
  __pyx_v_idx1 = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pandas/src/generated.pyx":4003
 *         int8_t fv
 * 
 *     n = len(idx0)             # <<<<<<<<<<<<<<
 *     k = len(idx1)
 * 
 */
  __pyx_t_4 = PyObject_Length(((PyObject *)__pyx_v_idx0)); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4003; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_n = __pyx_t_4;

  /* "pandas/src/generated.pyx":4004
 * 
 *     n = len(idx0)
 *     k = len(idx1)             # <<<<<<<<<<<<<<
 * 
 *     fv = fill_value
 */
  __pyx_t_4 = PyObject_Length(((PyObject *)__pyx_v_idx1)); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4004; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_k = __pyx_t_4;

  /* "pandas/src/generated.pyx":4006
 *     k = len(idx1)
 * 
 *     fv = fill_value             # <<<<<<<<<<<<<<
 *     for i from 0 <= i < n:
 *         idx = idx0[i]
 */
  __pyx_t_5 = __Pyx_PyInt_As_npy_int8(__pyx_v_fill_value); if (unlikely((__pyx_t_5 == (npy_int8)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4006; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_fv = __pyx_t_5;

  /* "pandas/src/generated.pyx":4007
 * 
 *     fv = fill_value
 *     for i from 0 <= i < n:             # <<<<<<<<<<<<<<
 *         idx = idx0[i]
 *         if idx == -1:
 */
  __pyx_t_4 = __pyx_v_n;
  for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_4; __pyx_v_i++) {

    /* "pandas/src/generated.pyx":4008
 *     fv = fill_value
 *     for i from 0 <= i < n:
 *         idx = idx0[i]             # <<<<<<<<<<<<<<
 *         if idx == -1:
 *             for j from 0 <= j < k:
 */
    __pyx_t_6 = __pyx_v_i;
    __pyx_v_idx = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_idx0.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_idx0.diminfo[0].strides));

    /* "pandas/src/generated.pyx":4009
 *     for i from 0 <= i < n:
 *         idx = idx0[i]
 *         if idx == -1:             # <<<<<<<<<<<<<<
 *             for j from 0 <= j < k:
 *                 out[i, j] = fv
 */
    __pyx_t_7 = ((__pyx_v_idx == -1) != 0);
    if (__pyx_t_7) {

      /* "pandas/src/generated.pyx":4010
 *         idx = idx0[i]
 *         if idx == -1:
 *             for j from 0 <= j < k:             # <<<<<<<<<<<<<<
 *                 out[i, j] = fv
 *         else:
 */
      __pyx_t_8 = __pyx_v_k;
      for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_8; __pyx_v_j++) {

        /* "pandas/src/generated.pyx":4011
 *         if idx == -1:
 *             for j from 0 <= j < k:
 *                 out[i, j] = fv             # <<<<<<<<<<<<<<
 *         else:
 *             for j from 0 <= j < k:
 */
        __pyx_t_9 = __pyx_v_i;
        __pyx_t_10 = __pyx_v_j;
        *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int8_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_9, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_10, __pyx_pybuffernd_out.diminfo[1].strides) = __pyx_v_fv;
      }
      goto __pyx_L5;
    }
    /*else*/ {

      /* "pandas/src/generated.pyx":4013
 *                 out[i, j] = fv
 *         else:
 *             for j from 0 <= j < k:             # <<<<<<<<<<<<<<
 *                 if idx1[j] == -1:
 *                     out[i, j] = fv
 */
      __pyx_t_8 = __pyx_v_k;
      for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_8; __pyx_v_j++) {

        /* "pandas/src/generated.pyx":4014
 *         else:
 *             for j from 0 <= j < k:
 *                 if idx1[j] == -1:             # <<<<<<<<<<<<<<
 *                     out[i, j] = fv
 *                 else:
 */
        __pyx_t_11 = __pyx_v_j;
        __pyx_t_7 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_idx1.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_idx1.diminfo[0].strides)) == -1) != 0);
        if (__pyx_t_7) {

          /* "pandas/src/generated.pyx":4015
 *             for j from 0 <= j < k:
 *                 if idx1[j] == -1:
 *                     out[i, j] = fv             # <<<<<<<<<<<<<<
 *                 else:
 *                     out[i, j] = values[idx, idx1[j]]
 */
          __pyx_t_12 = __pyx_v_i;
          __pyx_t_13 = __pyx_v_j;
          *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int8_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_12, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_13, __pyx_pybuffernd_out.diminfo[1].strides) = __pyx_v_fv;
          goto __pyx_L10;
        }
        /*else*/ {

          /* "pandas/src/generated.pyx":4017
 *                     out[i, j] = fv
 *                 else:
 *                     out[i, j] = values[idx, idx1[j]]             # <<<<<<<<<<<<<<
 * 
 * @cython.wraparound(False)
 */
          __pyx_t_14 = __pyx_v_j;
          __pyx_t_15 = __pyx_v_idx;
          __pyx_t_16 = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_idx1.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_idx1.diminfo[0].strides));
          __pyx_t_17 = __pyx_v_i;
          __pyx_t_18 = __pyx_v_j;
          *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int8_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_18, __pyx_pybuffernd_out.diminfo[1].strides) = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int8_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_values.diminfo[0].strides, __pyx_t_16, __pyx_pybuffernd_values.diminfo[1].strides));
        }
        __pyx_L10:;
      }
    }
    __pyx_L5:;
  }

  /* "pandas/src/generated.pyx":3993
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def take_2d_multi_int8_int8(ndarray[int8_t, ndim=2] values,             # <<<<<<<<<<<<<<
 *                                     indexer,
 *                                     ndarray[int8_t, ndim=2] out,
 */

  /* function exit code */
  __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_pybuffernd_idx0.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_idx1.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas.algos.take_2d_multi_int8_int8", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_idx0.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_idx1.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer);
  __pyx_L2:;
  __Pyx_XDECREF((PyObject *)__pyx_v_idx0);
  __Pyx_XDECREF((PyObject *)__pyx_v_idx1);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/src/generated.pyx":4021
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def take_2d_multi_int8_int32(ndarray[int8_t, ndim=2] values,             # <<<<<<<<<<<<<<
 *                                     indexer,
 *                                     ndarray[int32_t, ndim=2] out,
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pandas_5algos_343take_2d_multi_int8_int32(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_5algos_343take_2d_multi_int8_int32 = {__Pyx_NAMESTR("take_2d_multi_int8_int32"), (PyCFunction)__pyx_pw_6pandas_5algos_343take_2d_multi_int8_int32, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pw_6pandas_5algos_343take_2d_multi_int8_int32(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyArrayObject *__pyx_v_values = 0;
  PyObject *__pyx_v_indexer = 0;
  PyArrayObject *__pyx_v_out = 0;
  PyObject *__pyx_v_fill_value = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("take_2d_multi_int8_int32 (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_values,&__pyx_n_s_indexer,&__pyx_n_s_out,&__pyx_n_s_fill_value,0};
    PyObject* values[4] = {0,0,0,0};
    values[3] = __pyx_k__176;
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_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 (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_indexer)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("take_2d_multi_int8_int32", 0, 3, 4, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4021; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_out)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("take_2d_multi_int8_int32", 0, 3, 4, 2); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4021; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  3:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_fill_value);
          if (value) { values[3] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "take_2d_multi_int8_int32") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4021; __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_values = ((PyArrayObject *)values[0]);
    __pyx_v_indexer = values[1];
    __pyx_v_out = ((PyArrayObject *)values[2]);
    __pyx_v_fill_value = values[3];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("take_2d_multi_int8_int32", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4021; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas.algos.take_2d_multi_int8_int32", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4021; __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[2]; __pyx_lineno = 4023; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_342take_2d_multi_int8_int32(__pyx_self, __pyx_v_values, __pyx_v_indexer, __pyx_v_out, __pyx_v_fill_value);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pandas_5algos_342take_2d_multi_int8_int32(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, PyObject *__pyx_v_indexer, PyArrayObject *__pyx_v_out, PyObject *__pyx_v_fill_value) {
  Py_ssize_t __pyx_v_i;
  Py_ssize_t __pyx_v_j;
  Py_ssize_t __pyx_v_k;
  Py_ssize_t __pyx_v_n;
  Py_ssize_t __pyx_v_idx;
  PyArrayObject *__pyx_v_idx0 = 0;
  PyArrayObject *__pyx_v_idx1 = 0;
  __pyx_t_5numpy_int32_t __pyx_v_fv;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_idx0;
  __Pyx_Buffer __pyx_pybuffer_idx0;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_idx1;
  __Pyx_Buffer __pyx_pybuffer_idx1;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_out;
  __Pyx_Buffer __pyx_pybuffer_out;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_values;
  __Pyx_Buffer __pyx_pybuffer_values;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyArrayObject *__pyx_t_2 = NULL;
  PyArrayObject *__pyx_t_3 = NULL;
  Py_ssize_t __pyx_t_4;
  __pyx_t_5numpy_int32_t __pyx_t_5;
  Py_ssize_t __pyx_t_6;
  int __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;
  Py_ssize_t __pyx_t_12;
  Py_ssize_t __pyx_t_13;
  Py_ssize_t __pyx_t_14;
  Py_ssize_t __pyx_t_15;
  __pyx_t_5numpy_int64_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("take_2d_multi_int8_int32", 0);
  __pyx_pybuffer_idx0.pybuffer.buf = NULL;
  __pyx_pybuffer_idx0.refcount = 0;
  __pyx_pybuffernd_idx0.data = NULL;
  __pyx_pybuffernd_idx0.rcbuffer = &__pyx_pybuffer_idx0;
  __pyx_pybuffer_idx1.pybuffer.buf = NULL;
  __pyx_pybuffer_idx1.refcount = 0;
  __pyx_pybuffernd_idx1.data = NULL;
  __pyx_pybuffernd_idx1.rcbuffer = &__pyx_pybuffer_idx1;
  __pyx_pybuffer_values.pybuffer.buf = NULL;
  __pyx_pybuffer_values.refcount = 0;
  __pyx_pybuffernd_values.data = NULL;
  __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values;
  __pyx_pybuffer_out.pybuffer.buf = NULL;
  __pyx_pybuffer_out.refcount = 0;
  __pyx_pybuffernd_out.data = NULL;
  __pyx_pybuffernd_out.rcbuffer = &__pyx_pybuffer_out;
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int8_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4021; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_values.diminfo[1].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_values.diminfo[1].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[1];
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_out.rcbuffer->pybuffer, (PyObject*)__pyx_v_out, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4021; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_out.diminfo[0].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_out.diminfo[0].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_out.diminfo[1].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_out.diminfo[1].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[1];

  /* "pandas/src/generated.pyx":4027
 *     cdef:
 *         Py_ssize_t i, j, k, n, idx
 *         ndarray[int64_t] idx0 = indexer[0]             # <<<<<<<<<<<<<<
 *         ndarray[int64_t] idx1 = indexer[1]
 *         int32_t fv
 */
  __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_indexer, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4027; __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[2]; __pyx_lineno = 4027; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_2 = ((PyArrayObject *)__pyx_t_1);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_idx0.rcbuffer->pybuffer, (PyObject*)__pyx_t_2, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
      __pyx_v_idx0 = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_idx0.rcbuffer->pybuffer.buf = NULL;
      {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4027; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    } else {__pyx_pybuffernd_idx0.diminfo[0].strides = __pyx_pybuffernd_idx0.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_idx0.diminfo[0].shape = __pyx_pybuffernd_idx0.rcbuffer->pybuffer.shape[0];
    }
  }
  __pyx_t_2 = 0;
  __pyx_v_idx0 = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pandas/src/generated.pyx":4028
 *         Py_ssize_t i, j, k, n, idx
 *         ndarray[int64_t] idx0 = indexer[0]
 *         ndarray[int64_t] idx1 = indexer[1]             # <<<<<<<<<<<<<<
 *         int32_t fv
 * 
 */
  __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_indexer, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4028; __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[2]; __pyx_lineno = 4028; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_3 = ((PyArrayObject *)__pyx_t_1);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_idx1.rcbuffer->pybuffer, (PyObject*)__pyx_t_3, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
      __pyx_v_idx1 = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_idx1.rcbuffer->pybuffer.buf = NULL;
      {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4028; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    } else {__pyx_pybuffernd_idx1.diminfo[0].strides = __pyx_pybuffernd_idx1.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_idx1.diminfo[0].shape = __pyx_pybuffernd_idx1.rcbuffer->pybuffer.shape[0];
    }
  }
  __pyx_t_3 = 0;
  __pyx_v_idx1 = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pandas/src/generated.pyx":4031
 *         int32_t fv
 * 
 *     n = len(idx0)             # <<<<<<<<<<<<<<
 *     k = len(idx1)
 * 
 */
  __pyx_t_4 = PyObject_Length(((PyObject *)__pyx_v_idx0)); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4031; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_n = __pyx_t_4;

  /* "pandas/src/generated.pyx":4032
 * 
 *     n = len(idx0)
 *     k = len(idx1)             # <<<<<<<<<<<<<<
 * 
 *     fv = fill_value
 */
  __pyx_t_4 = PyObject_Length(((PyObject *)__pyx_v_idx1)); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4032; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_k = __pyx_t_4;

  /* "pandas/src/generated.pyx":4034
 *     k = len(idx1)
 * 
 *     fv = fill_value             # <<<<<<<<<<<<<<
 *     for i from 0 <= i < n:
 *         idx = idx0[i]
 */
  __pyx_t_5 = __Pyx_PyInt_As_npy_int32(__pyx_v_fill_value); if (unlikely((__pyx_t_5 == (npy_int32)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4034; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_fv = __pyx_t_5;

  /* "pandas/src/generated.pyx":4035
 * 
 *     fv = fill_value
 *     for i from 0 <= i < n:             # <<<<<<<<<<<<<<
 *         idx = idx0[i]
 *         if idx == -1:
 */
  __pyx_t_4 = __pyx_v_n;
  for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_4; __pyx_v_i++) {

    /* "pandas/src/generated.pyx":4036
 *     fv = fill_value
 *     for i from 0 <= i < n:
 *         idx = idx0[i]             # <<<<<<<<<<<<<<
 *         if idx == -1:
 *             for j from 0 <= j < k:
 */
    __pyx_t_6 = __pyx_v_i;
    __pyx_v_idx = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_idx0.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_idx0.diminfo[0].strides));

    /* "pandas/src/generated.pyx":4037
 *     for i from 0 <= i < n:
 *         idx = idx0[i]
 *         if idx == -1:             # <<<<<<<<<<<<<<
 *             for j from 0 <= j < k:
 *                 out[i, j] = fv
 */
    __pyx_t_7 = ((__pyx_v_idx == -1) != 0);
    if (__pyx_t_7) {

      /* "pandas/src/generated.pyx":4038
 *         idx = idx0[i]
 *         if idx == -1:
 *             for j from 0 <= j < k:             # <<<<<<<<<<<<<<
 *                 out[i, j] = fv
 *         else:
 */
      __pyx_t_8 = __pyx_v_k;
      for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_8; __pyx_v_j++) {

        /* "pandas/src/generated.pyx":4039
 *         if idx == -1:
 *             for j from 0 <= j < k:
 *                 out[i, j] = fv             # <<<<<<<<<<<<<<
 *         else:
 *             for j from 0 <= j < k:
 */
        __pyx_t_9 = __pyx_v_i;
        __pyx_t_10 = __pyx_v_j;
        *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_9, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_10, __pyx_pybuffernd_out.diminfo[1].strides) = __pyx_v_fv;
      }
      goto __pyx_L5;
    }
    /*else*/ {

      /* "pandas/src/generated.pyx":4041
 *                 out[i, j] = fv
 *         else:
 *             for j from 0 <= j < k:             # <<<<<<<<<<<<<<
 *                 if idx1[j] == -1:
 *                     out[i, j] = fv
 */
      __pyx_t_8 = __pyx_v_k;
      for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_8; __pyx_v_j++) {

        /* "pandas/src/generated.pyx":4042
 *         else:
 *             for j from 0 <= j < k:
 *                 if idx1[j] == -1:             # <<<<<<<<<<<<<<
 *                     out[i, j] = fv
 *                 else:
 */
        __pyx_t_11 = __pyx_v_j;
        __pyx_t_7 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_idx1.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_idx1.diminfo[0].strides)) == -1) != 0);
        if (__pyx_t_7) {

          /* "pandas/src/generated.pyx":4043
 *             for j from 0 <= j < k:
 *                 if idx1[j] == -1:
 *                     out[i, j] = fv             # <<<<<<<<<<<<<<
 *                 else:
 *                     out[i, j] = values[idx, idx1[j]]
 */
          __pyx_t_12 = __pyx_v_i;
          __pyx_t_13 = __pyx_v_j;
          *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_12, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_13, __pyx_pybuffernd_out.diminfo[1].strides) = __pyx_v_fv;
          goto __pyx_L10;
        }
        /*else*/ {

          /* "pandas/src/generated.pyx":4045
 *                     out[i, j] = fv
 *                 else:
 *                     out[i, j] = values[idx, idx1[j]]             # <<<<<<<<<<<<<<
 * 
 * @cython.wraparound(False)
 */
          __pyx_t_14 = __pyx_v_j;
          __pyx_t_15 = __pyx_v_idx;
          __pyx_t_16 = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_idx1.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_idx1.diminfo[0].strides));
          __pyx_t_17 = __pyx_v_i;
          __pyx_t_18 = __pyx_v_j;
          *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_18, __pyx_pybuffernd_out.diminfo[1].strides) = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int8_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_values.diminfo[0].strides, __pyx_t_16, __pyx_pybuffernd_values.diminfo[1].strides));
        }
        __pyx_L10:;
      }
    }
    __pyx_L5:;
  }

  /* "pandas/src/generated.pyx":4021
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def take_2d_multi_int8_int32(ndarray[int8_t, ndim=2] values,             # <<<<<<<<<<<<<<
 *                                     indexer,
 *                                     ndarray[int32_t, ndim=2] out,
 */

  /* function exit code */
  __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_pybuffernd_idx0.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_idx1.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas.algos.take_2d_multi_int8_int32", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_idx0.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_idx1.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer);
  __pyx_L2:;
  __Pyx_XDECREF((PyObject *)__pyx_v_idx0);
  __Pyx_XDECREF((PyObject *)__pyx_v_idx1);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/src/generated.pyx":4049
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def take_2d_multi_int8_int64(ndarray[int8_t, ndim=2] values,             # <<<<<<<<<<<<<<
 *                                     indexer,
 *                                     ndarray[int64_t, ndim=2] out,
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pandas_5algos_345take_2d_multi_int8_int64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_5algos_345take_2d_multi_int8_int64 = {__Pyx_NAMESTR("take_2d_multi_int8_int64"), (PyCFunction)__pyx_pw_6pandas_5algos_345take_2d_multi_int8_int64, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pw_6pandas_5algos_345take_2d_multi_int8_int64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyArrayObject *__pyx_v_values = 0;
  PyObject *__pyx_v_indexer = 0;
  PyArrayObject *__pyx_v_out = 0;
  PyObject *__pyx_v_fill_value = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("take_2d_multi_int8_int64 (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_values,&__pyx_n_s_indexer,&__pyx_n_s_out,&__pyx_n_s_fill_value,0};
    PyObject* values[4] = {0,0,0,0};
    values[3] = __pyx_k__177;
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_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 (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_indexer)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("take_2d_multi_int8_int64", 0, 3, 4, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4049; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_out)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("take_2d_multi_int8_int64", 0, 3, 4, 2); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4049; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  3:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_fill_value);
          if (value) { values[3] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "take_2d_multi_int8_int64") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4049; __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_values = ((PyArrayObject *)values[0]);
    __pyx_v_indexer = values[1];
    __pyx_v_out = ((PyArrayObject *)values[2]);
    __pyx_v_fill_value = values[3];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("take_2d_multi_int8_int64", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4049; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas.algos.take_2d_multi_int8_int64", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4049; __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[2]; __pyx_lineno = 4051; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_344take_2d_multi_int8_int64(__pyx_self, __pyx_v_values, __pyx_v_indexer, __pyx_v_out, __pyx_v_fill_value);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pandas_5algos_344take_2d_multi_int8_int64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, PyObject *__pyx_v_indexer, PyArrayObject *__pyx_v_out, PyObject *__pyx_v_fill_value) {
  Py_ssize_t __pyx_v_i;
  Py_ssize_t __pyx_v_j;
  Py_ssize_t __pyx_v_k;
  Py_ssize_t __pyx_v_n;
  Py_ssize_t __pyx_v_idx;
  PyArrayObject *__pyx_v_idx0 = 0;
  PyArrayObject *__pyx_v_idx1 = 0;
  __pyx_t_5numpy_int64_t __pyx_v_fv;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_idx0;
  __Pyx_Buffer __pyx_pybuffer_idx0;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_idx1;
  __Pyx_Buffer __pyx_pybuffer_idx1;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_out;
  __Pyx_Buffer __pyx_pybuffer_out;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_values;
  __Pyx_Buffer __pyx_pybuffer_values;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyArrayObject *__pyx_t_2 = NULL;
  PyArrayObject *__pyx_t_3 = NULL;
  Py_ssize_t __pyx_t_4;
  __pyx_t_5numpy_int64_t __pyx_t_5;
  Py_ssize_t __pyx_t_6;
  int __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;
  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;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("take_2d_multi_int8_int64", 0);
  __pyx_pybuffer_idx0.pybuffer.buf = NULL;
  __pyx_pybuffer_idx0.refcount = 0;
  __pyx_pybuffernd_idx0.data = NULL;
  __pyx_pybuffernd_idx0.rcbuffer = &__pyx_pybuffer_idx0;
  __pyx_pybuffer_idx1.pybuffer.buf = NULL;
  __pyx_pybuffer_idx1.refcount = 0;
  __pyx_pybuffernd_idx1.data = NULL;
  __pyx_pybuffernd_idx1.rcbuffer = &__pyx_pybuffer_idx1;
  __pyx_pybuffer_values.pybuffer.buf = NULL;
  __pyx_pybuffer_values.refcount = 0;
  __pyx_pybuffernd_values.data = NULL;
  __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values;
  __pyx_pybuffer_out.pybuffer.buf = NULL;
  __pyx_pybuffer_out.refcount = 0;
  __pyx_pybuffernd_out.data = NULL;
  __pyx_pybuffernd_out.rcbuffer = &__pyx_pybuffer_out;
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int8_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4049; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_values.diminfo[1].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_values.diminfo[1].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[1];
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_out.rcbuffer->pybuffer, (PyObject*)__pyx_v_out, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4049; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_out.diminfo[0].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_out.diminfo[0].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_out.diminfo[1].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_out.diminfo[1].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[1];

  /* "pandas/src/generated.pyx":4055
 *     cdef:
 *         Py_ssize_t i, j, k, n, idx
 *         ndarray[int64_t] idx0 = indexer[0]             # <<<<<<<<<<<<<<
 *         ndarray[int64_t] idx1 = indexer[1]
 *         int64_t fv
 */
  __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_indexer, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4055; __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[2]; __pyx_lineno = 4055; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_2 = ((PyArrayObject *)__pyx_t_1);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_idx0.rcbuffer->pybuffer, (PyObject*)__pyx_t_2, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
      __pyx_v_idx0 = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_idx0.rcbuffer->pybuffer.buf = NULL;
      {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4055; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    } else {__pyx_pybuffernd_idx0.diminfo[0].strides = __pyx_pybuffernd_idx0.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_idx0.diminfo[0].shape = __pyx_pybuffernd_idx0.rcbuffer->pybuffer.shape[0];
    }
  }
  __pyx_t_2 = 0;
  __pyx_v_idx0 = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pandas/src/generated.pyx":4056
 *         Py_ssize_t i, j, k, n, idx
 *         ndarray[int64_t] idx0 = indexer[0]
 *         ndarray[int64_t] idx1 = indexer[1]             # <<<<<<<<<<<<<<
 *         int64_t fv
 * 
 */
  __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_indexer, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4056; __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[2]; __pyx_lineno = 4056; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_3 = ((PyArrayObject *)__pyx_t_1);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_idx1.rcbuffer->pybuffer, (PyObject*)__pyx_t_3, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
      __pyx_v_idx1 = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_idx1.rcbuffer->pybuffer.buf = NULL;
      {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4056; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    } else {__pyx_pybuffernd_idx1.diminfo[0].strides = __pyx_pybuffernd_idx1.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_idx1.diminfo[0].shape = __pyx_pybuffernd_idx1.rcbuffer->pybuffer.shape[0];
    }
  }
  __pyx_t_3 = 0;
  __pyx_v_idx1 = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pandas/src/generated.pyx":4059
 *         int64_t fv
 * 
 *     n = len(idx0)             # <<<<<<<<<<<<<<
 *     k = len(idx1)
 * 
 */
  __pyx_t_4 = PyObject_Length(((PyObject *)__pyx_v_idx0)); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4059; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_n = __pyx_t_4;

  /* "pandas/src/generated.pyx":4060
 * 
 *     n = len(idx0)
 *     k = len(idx1)             # <<<<<<<<<<<<<<
 * 
 *     fv = fill_value
 */
  __pyx_t_4 = PyObject_Length(((PyObject *)__pyx_v_idx1)); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4060; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_k = __pyx_t_4;

  /* "pandas/src/generated.pyx":4062
 *     k = len(idx1)
 * 
 *     fv = fill_value             # <<<<<<<<<<<<<<
 *     for i from 0 <= i < n:
 *         idx = idx0[i]
 */
  __pyx_t_5 = __Pyx_PyInt_As_npy_int64(__pyx_v_fill_value); if (unlikely((__pyx_t_5 == (npy_int64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4062; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_fv = __pyx_t_5;

  /* "pandas/src/generated.pyx":4063
 * 
 *     fv = fill_value
 *     for i from 0 <= i < n:             # <<<<<<<<<<<<<<
 *         idx = idx0[i]
 *         if idx == -1:
 */
  __pyx_t_4 = __pyx_v_n;
  for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_4; __pyx_v_i++) {

    /* "pandas/src/generated.pyx":4064
 *     fv = fill_value
 *     for i from 0 <= i < n:
 *         idx = idx0[i]             # <<<<<<<<<<<<<<
 *         if idx == -1:
 *             for j from 0 <= j < k:
 */
    __pyx_t_6 = __pyx_v_i;
    __pyx_v_idx = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_idx0.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_idx0.diminfo[0].strides));

    /* "pandas/src/generated.pyx":4065
 *     for i from 0 <= i < n:
 *         idx = idx0[i]
 *         if idx == -1:             # <<<<<<<<<<<<<<
 *             for j from 0 <= j < k:
 *                 out[i, j] = fv
 */
    __pyx_t_7 = ((__pyx_v_idx == -1) != 0);
    if (__pyx_t_7) {

      /* "pandas/src/generated.pyx":4066
 *         idx = idx0[i]
 *         if idx == -1:
 *             for j from 0 <= j < k:             # <<<<<<<<<<<<<<
 *                 out[i, j] = fv
 *         else:
 */
      __pyx_t_8 = __pyx_v_k;
      for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_8; __pyx_v_j++) {

        /* "pandas/src/generated.pyx":4067
 *         if idx == -1:
 *             for j from 0 <= j < k:
 *                 out[i, j] = fv             # <<<<<<<<<<<<<<
 *         else:
 *             for j from 0 <= j < k:
 */
        __pyx_t_9 = __pyx_v_i;
        __pyx_t_10 = __pyx_v_j;
        *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_9, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_10, __pyx_pybuffernd_out.diminfo[1].strides) = __pyx_v_fv;
      }
      goto __pyx_L5;
    }
    /*else*/ {

      /* "pandas/src/generated.pyx":4069
 *                 out[i, j] = fv
 *         else:
 *             for j from 0 <= j < k:             # <<<<<<<<<<<<<<
 *                 if idx1[j] == -1:
 *                     out[i, j] = fv
 */
      __pyx_t_8 = __pyx_v_k;
      for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_8; __pyx_v_j++) {

        /* "pandas/src/generated.pyx":4070
 *         else:
 *             for j from 0 <= j < k:
 *                 if idx1[j] == -1:             # <<<<<<<<<<<<<<
 *                     out[i, j] = fv
 *                 else:
 */
        __pyx_t_11 = __pyx_v_j;
        __pyx_t_7 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_idx1.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_idx1.diminfo[0].strides)) == -1) != 0);
        if (__pyx_t_7) {

          /* "pandas/src/generated.pyx":4071
 *             for j from 0 <= j < k:
 *                 if idx1[j] == -1:
 *                     out[i, j] = fv             # <<<<<<<<<<<<<<
 *                 else:
 *                     out[i, j] = values[idx, idx1[j]]
 */
          __pyx_t_12 = __pyx_v_i;
          __pyx_t_13 = __pyx_v_j;
          *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_12, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_13, __pyx_pybuffernd_out.diminfo[1].strides) = __pyx_v_fv;
          goto __pyx_L10;
        }
        /*else*/ {

          /* "pandas/src/generated.pyx":4073
 *                     out[i, j] = fv
 *                 else:
 *                     out[i, j] = values[idx, idx1[j]]             # <<<<<<<<<<<<<<
 * 
 * @cython.wraparound(False)
 */
          __pyx_t_14 = __pyx_v_j;
          __pyx_t_15 = __pyx_v_idx;
          __pyx_t_5 = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_idx1.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_idx1.diminfo[0].strides));
          __pyx_t_16 = __pyx_v_i;
          __pyx_t_17 = __pyx_v_j;
          *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_17, __pyx_pybuffernd_out.diminfo[1].strides) = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int8_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_values.diminfo[0].strides, __pyx_t_5, __pyx_pybuffernd_values.diminfo[1].strides));
        }
        __pyx_L10:;
      }
    }
    __pyx_L5:;
  }

  /* "pandas/src/generated.pyx":4049
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def take_2d_multi_int8_int64(ndarray[int8_t, ndim=2] values,             # <<<<<<<<<<<<<<
 *                                     indexer,
 *                                     ndarray[int64_t, ndim=2] out,
 */

  /* function exit code */
  __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_pybuffernd_idx0.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_idx1.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas.algos.take_2d_multi_int8_int64", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_idx0.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_idx1.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer);
  __pyx_L2:;
  __Pyx_XDECREF((PyObject *)__pyx_v_idx0);
  __Pyx_XDECREF((PyObject *)__pyx_v_idx1);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/src/generated.pyx":4077
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def take_2d_multi_int8_float64(ndarray[int8_t, ndim=2] values,             # <<<<<<<<<<<<<<
 *                                     indexer,
 *                                     ndarray[float64_t, ndim=2] out,
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pandas_5algos_347take_2d_multi_int8_float64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_5algos_347take_2d_multi_int8_float64 = {__Pyx_NAMESTR("take_2d_multi_int8_float64"), (PyCFunction)__pyx_pw_6pandas_5algos_347take_2d_multi_int8_float64, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pw_6pandas_5algos_347take_2d_multi_int8_float64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyArrayObject *__pyx_v_values = 0;
  PyObject *__pyx_v_indexer = 0;
  PyArrayObject *__pyx_v_out = 0;
  PyObject *__pyx_v_fill_value = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("take_2d_multi_int8_float64 (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_values,&__pyx_n_s_indexer,&__pyx_n_s_out,&__pyx_n_s_fill_value,0};
    PyObject* values[4] = {0,0,0,0};
    values[3] = __pyx_k__178;
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_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 (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_indexer)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("take_2d_multi_int8_float64", 0, 3, 4, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4077; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_out)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("take_2d_multi_int8_float64", 0, 3, 4, 2); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4077; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  3:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_fill_value);
          if (value) { values[3] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "take_2d_multi_int8_float64") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4077; __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_values = ((PyArrayObject *)values[0]);
    __pyx_v_indexer = values[1];
    __pyx_v_out = ((PyArrayObject *)values[2]);
    __pyx_v_fill_value = values[3];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("take_2d_multi_int8_float64", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4077; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas.algos.take_2d_multi_int8_float64", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4077; __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[2]; __pyx_lineno = 4079; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_346take_2d_multi_int8_float64(__pyx_self, __pyx_v_values, __pyx_v_indexer, __pyx_v_out, __pyx_v_fill_value);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pandas_5algos_346take_2d_multi_int8_float64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, PyObject *__pyx_v_indexer, PyArrayObject *__pyx_v_out, PyObject *__pyx_v_fill_value) {
  Py_ssize_t __pyx_v_i;
  Py_ssize_t __pyx_v_j;
  Py_ssize_t __pyx_v_k;
  Py_ssize_t __pyx_v_n;
  Py_ssize_t __pyx_v_idx;
  PyArrayObject *__pyx_v_idx0 = 0;
  PyArrayObject *__pyx_v_idx1 = 0;
  __pyx_t_5numpy_float64_t __pyx_v_fv;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_idx0;
  __Pyx_Buffer __pyx_pybuffer_idx0;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_idx1;
  __Pyx_Buffer __pyx_pybuffer_idx1;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_out;
  __Pyx_Buffer __pyx_pybuffer_out;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_values;
  __Pyx_Buffer __pyx_pybuffer_values;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyArrayObject *__pyx_t_2 = NULL;
  PyArrayObject *__pyx_t_3 = NULL;
  Py_ssize_t __pyx_t_4;
  __pyx_t_5numpy_float64_t __pyx_t_5;
  Py_ssize_t __pyx_t_6;
  int __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;
  Py_ssize_t __pyx_t_12;
  Py_ssize_t __pyx_t_13;
  Py_ssize_t __pyx_t_14;
  Py_ssize_t __pyx_t_15;
  __pyx_t_5numpy_int64_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("take_2d_multi_int8_float64", 0);
  __pyx_pybuffer_idx0.pybuffer.buf = NULL;
  __pyx_pybuffer_idx0.refcount = 0;
  __pyx_pybuffernd_idx0.data = NULL;
  __pyx_pybuffernd_idx0.rcbuffer = &__pyx_pybuffer_idx0;
  __pyx_pybuffer_idx1.pybuffer.buf = NULL;
  __pyx_pybuffer_idx1.refcount = 0;
  __pyx_pybuffernd_idx1.data = NULL;
  __pyx_pybuffernd_idx1.rcbuffer = &__pyx_pybuffer_idx1;
  __pyx_pybuffer_values.pybuffer.buf = NULL;
  __pyx_pybuffer_values.refcount = 0;
  __pyx_pybuffernd_values.data = NULL;
  __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values;
  __pyx_pybuffer_out.pybuffer.buf = NULL;
  __pyx_pybuffer_out.refcount = 0;
  __pyx_pybuffernd_out.data = NULL;
  __pyx_pybuffernd_out.rcbuffer = &__pyx_pybuffer_out;
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int8_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4077; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_values.diminfo[1].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_values.diminfo[1].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[1];
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_out.rcbuffer->pybuffer, (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[2]; __pyx_lineno = 4077; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_out.diminfo[0].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_out.diminfo[0].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_out.diminfo[1].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_out.diminfo[1].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[1];

  /* "pandas/src/generated.pyx":4083
 *     cdef:
 *         Py_ssize_t i, j, k, n, idx
 *         ndarray[int64_t] idx0 = indexer[0]             # <<<<<<<<<<<<<<
 *         ndarray[int64_t] idx1 = indexer[1]
 *         float64_t fv
 */
  __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_indexer, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4083; __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[2]; __pyx_lineno = 4083; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_2 = ((PyArrayObject *)__pyx_t_1);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_idx0.rcbuffer->pybuffer, (PyObject*)__pyx_t_2, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
      __pyx_v_idx0 = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_idx0.rcbuffer->pybuffer.buf = NULL;
      {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4083; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    } else {__pyx_pybuffernd_idx0.diminfo[0].strides = __pyx_pybuffernd_idx0.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_idx0.diminfo[0].shape = __pyx_pybuffernd_idx0.rcbuffer->pybuffer.shape[0];
    }
  }
  __pyx_t_2 = 0;
  __pyx_v_idx0 = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pandas/src/generated.pyx":4084
 *         Py_ssize_t i, j, k, n, idx
 *         ndarray[int64_t] idx0 = indexer[0]
 *         ndarray[int64_t] idx1 = indexer[1]             # <<<<<<<<<<<<<<
 *         float64_t fv
 * 
 */
  __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_indexer, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4084; __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[2]; __pyx_lineno = 4084; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_3 = ((PyArrayObject *)__pyx_t_1);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_idx1.rcbuffer->pybuffer, (PyObject*)__pyx_t_3, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
      __pyx_v_idx1 = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_idx1.rcbuffer->pybuffer.buf = NULL;
      {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4084; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    } else {__pyx_pybuffernd_idx1.diminfo[0].strides = __pyx_pybuffernd_idx1.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_idx1.diminfo[0].shape = __pyx_pybuffernd_idx1.rcbuffer->pybuffer.shape[0];
    }
  }
  __pyx_t_3 = 0;
  __pyx_v_idx1 = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pandas/src/generated.pyx":4087
 *         float64_t fv
 * 
 *     n = len(idx0)             # <<<<<<<<<<<<<<
 *     k = len(idx1)
 * 
 */
  __pyx_t_4 = PyObject_Length(((PyObject *)__pyx_v_idx0)); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4087; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_n = __pyx_t_4;

  /* "pandas/src/generated.pyx":4088
 * 
 *     n = len(idx0)
 *     k = len(idx1)             # <<<<<<<<<<<<<<
 * 
 *     fv = fill_value
 */
  __pyx_t_4 = PyObject_Length(((PyObject *)__pyx_v_idx1)); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4088; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_k = __pyx_t_4;

  /* "pandas/src/generated.pyx":4090
 *     k = len(idx1)
 * 
 *     fv = fill_value             # <<<<<<<<<<<<<<
 *     for i from 0 <= i < n:
 *         idx = idx0[i]
 */
  __pyx_t_5 = __pyx_PyFloat_AsDouble(__pyx_v_fill_value); if (unlikely((__pyx_t_5 == (npy_float64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4090; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_fv = __pyx_t_5;

  /* "pandas/src/generated.pyx":4091
 * 
 *     fv = fill_value
 *     for i from 0 <= i < n:             # <<<<<<<<<<<<<<
 *         idx = idx0[i]
 *         if idx == -1:
 */
  __pyx_t_4 = __pyx_v_n;
  for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_4; __pyx_v_i++) {

    /* "pandas/src/generated.pyx":4092
 *     fv = fill_value
 *     for i from 0 <= i < n:
 *         idx = idx0[i]             # <<<<<<<<<<<<<<
 *         if idx == -1:
 *             for j from 0 <= j < k:
 */
    __pyx_t_6 = __pyx_v_i;
    __pyx_v_idx = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_idx0.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_idx0.diminfo[0].strides));

    /* "pandas/src/generated.pyx":4093
 *     for i from 0 <= i < n:
 *         idx = idx0[i]
 *         if idx == -1:             # <<<<<<<<<<<<<<
 *             for j from 0 <= j < k:
 *                 out[i, j] = fv
 */
    __pyx_t_7 = ((__pyx_v_idx == -1) != 0);
    if (__pyx_t_7) {

      /* "pandas/src/generated.pyx":4094
 *         idx = idx0[i]
 *         if idx == -1:
 *             for j from 0 <= j < k:             # <<<<<<<<<<<<<<
 *                 out[i, j] = fv
 *         else:
 */
      __pyx_t_8 = __pyx_v_k;
      for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_8; __pyx_v_j++) {

        /* "pandas/src/generated.pyx":4095
 *         if idx == -1:
 *             for j from 0 <= j < k:
 *                 out[i, j] = fv             # <<<<<<<<<<<<<<
 *         else:
 *             for j from 0 <= j < k:
 */
        __pyx_t_9 = __pyx_v_i;
        __pyx_t_10 = __pyx_v_j;
        *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_9, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_10, __pyx_pybuffernd_out.diminfo[1].strides) = __pyx_v_fv;
      }
      goto __pyx_L5;
    }
    /*else*/ {

      /* "pandas/src/generated.pyx":4097
 *                 out[i, j] = fv
 *         else:
 *             for j from 0 <= j < k:             # <<<<<<<<<<<<<<
 *                 if idx1[j] == -1:
 *                     out[i, j] = fv
 */
      __pyx_t_8 = __pyx_v_k;
      for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_8; __pyx_v_j++) {

        /* "pandas/src/generated.pyx":4098
 *         else:
 *             for j from 0 <= j < k:
 *                 if idx1[j] == -1:             # <<<<<<<<<<<<<<
 *                     out[i, j] = fv
 *                 else:
 */
        __pyx_t_11 = __pyx_v_j;
        __pyx_t_7 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_idx1.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_idx1.diminfo[0].strides)) == -1) != 0);
        if (__pyx_t_7) {

          /* "pandas/src/generated.pyx":4099
 *             for j from 0 <= j < k:
 *                 if idx1[j] == -1:
 *                     out[i, j] = fv             # <<<<<<<<<<<<<<
 *                 else:
 *                     out[i, j] = values[idx, idx1[j]]
 */
          __pyx_t_12 = __pyx_v_i;
          __pyx_t_13 = __pyx_v_j;
          *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_12, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_13, __pyx_pybuffernd_out.diminfo[1].strides) = __pyx_v_fv;
          goto __pyx_L10;
        }
        /*else*/ {

          /* "pandas/src/generated.pyx":4101
 *                     out[i, j] = fv
 *                 else:
 *                     out[i, j] = values[idx, idx1[j]]             # <<<<<<<<<<<<<<
 * 
 * @cython.wraparound(False)
 */
          __pyx_t_14 = __pyx_v_j;
          __pyx_t_15 = __pyx_v_idx;
          __pyx_t_16 = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_idx1.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_idx1.diminfo[0].strides));
          __pyx_t_17 = __pyx_v_i;
          __pyx_t_18 = __pyx_v_j;
          *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_18, __pyx_pybuffernd_out.diminfo[1].strides) = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int8_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_values.diminfo[0].strides, __pyx_t_16, __pyx_pybuffernd_values.diminfo[1].strides));
        }
        __pyx_L10:;
      }
    }
    __pyx_L5:;
  }

  /* "pandas/src/generated.pyx":4077
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def take_2d_multi_int8_float64(ndarray[int8_t, ndim=2] values,             # <<<<<<<<<<<<<<
 *                                     indexer,
 *                                     ndarray[float64_t, ndim=2] out,
 */

  /* function exit code */
  __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_pybuffernd_idx0.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_idx1.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas.algos.take_2d_multi_int8_float64", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_idx0.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_idx1.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer);
  __pyx_L2:;
  __Pyx_XDECREF((PyObject *)__pyx_v_idx0);
  __Pyx_XDECREF((PyObject *)__pyx_v_idx1);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/src/generated.pyx":4105
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def take_2d_multi_int16_int16(ndarray[int16_t, ndim=2] values,             # <<<<<<<<<<<<<<
 *                                     indexer,
 *                                     ndarray[int16_t, ndim=2] out,
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pandas_5algos_349take_2d_multi_int16_int16(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_5algos_349take_2d_multi_int16_int16 = {__Pyx_NAMESTR("take_2d_multi_int16_int16"), (PyCFunction)__pyx_pw_6pandas_5algos_349take_2d_multi_int16_int16, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pw_6pandas_5algos_349take_2d_multi_int16_int16(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyArrayObject *__pyx_v_values = 0;
  PyObject *__pyx_v_indexer = 0;
  PyArrayObject *__pyx_v_out = 0;
  PyObject *__pyx_v_fill_value = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("take_2d_multi_int16_int16 (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_values,&__pyx_n_s_indexer,&__pyx_n_s_out,&__pyx_n_s_fill_value,0};
    PyObject* values[4] = {0,0,0,0};
    values[3] = __pyx_k__179;
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_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 (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_indexer)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("take_2d_multi_int16_int16", 0, 3, 4, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4105; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_out)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("take_2d_multi_int16_int16", 0, 3, 4, 2); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4105; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  3:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_fill_value);
          if (value) { values[3] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "take_2d_multi_int16_int16") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4105; __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_values = ((PyArrayObject *)values[0]);
    __pyx_v_indexer = values[1];
    __pyx_v_out = ((PyArrayObject *)values[2]);
    __pyx_v_fill_value = values[3];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("take_2d_multi_int16_int16", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4105; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas.algos.take_2d_multi_int16_int16", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4105; __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[2]; __pyx_lineno = 4107; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_348take_2d_multi_int16_int16(__pyx_self, __pyx_v_values, __pyx_v_indexer, __pyx_v_out, __pyx_v_fill_value);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pandas_5algos_348take_2d_multi_int16_int16(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, PyObject *__pyx_v_indexer, PyArrayObject *__pyx_v_out, PyObject *__pyx_v_fill_value) {
  Py_ssize_t __pyx_v_i;
  Py_ssize_t __pyx_v_j;
  Py_ssize_t __pyx_v_k;
  Py_ssize_t __pyx_v_n;
  Py_ssize_t __pyx_v_idx;
  PyArrayObject *__pyx_v_idx0 = 0;
  PyArrayObject *__pyx_v_idx1 = 0;
  __pyx_t_5numpy_int16_t __pyx_v_fv;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_idx0;
  __Pyx_Buffer __pyx_pybuffer_idx0;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_idx1;
  __Pyx_Buffer __pyx_pybuffer_idx1;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_out;
  __Pyx_Buffer __pyx_pybuffer_out;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_values;
  __Pyx_Buffer __pyx_pybuffer_values;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyArrayObject *__pyx_t_2 = NULL;
  PyArrayObject *__pyx_t_3 = NULL;
  Py_ssize_t __pyx_t_4;
  __pyx_t_5numpy_int16_t __pyx_t_5;
  Py_ssize_t __pyx_t_6;
  int __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;
  Py_ssize_t __pyx_t_12;
  Py_ssize_t __pyx_t_13;
  Py_ssize_t __pyx_t_14;
  Py_ssize_t __pyx_t_15;
  __pyx_t_5numpy_int64_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("take_2d_multi_int16_int16", 0);
  __pyx_pybuffer_idx0.pybuffer.buf = NULL;
  __pyx_pybuffer_idx0.refcount = 0;
  __pyx_pybuffernd_idx0.data = NULL;
  __pyx_pybuffernd_idx0.rcbuffer = &__pyx_pybuffer_idx0;
  __pyx_pybuffer_idx1.pybuffer.buf = NULL;
  __pyx_pybuffer_idx1.refcount = 0;
  __pyx_pybuffernd_idx1.data = NULL;
  __pyx_pybuffernd_idx1.rcbuffer = &__pyx_pybuffer_idx1;
  __pyx_pybuffer_values.pybuffer.buf = NULL;
  __pyx_pybuffer_values.refcount = 0;
  __pyx_pybuffernd_values.data = NULL;
  __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values;
  __pyx_pybuffer_out.pybuffer.buf = NULL;
  __pyx_pybuffer_out.refcount = 0;
  __pyx_pybuffernd_out.data = NULL;
  __pyx_pybuffernd_out.rcbuffer = &__pyx_pybuffer_out;
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int16_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4105; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_values.diminfo[1].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_values.diminfo[1].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[1];
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_out.rcbuffer->pybuffer, (PyObject*)__pyx_v_out, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int16_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4105; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_out.diminfo[0].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_out.diminfo[0].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_out.diminfo[1].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_out.diminfo[1].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[1];

  /* "pandas/src/generated.pyx":4111
 *     cdef:
 *         Py_ssize_t i, j, k, n, idx
 *         ndarray[int64_t] idx0 = indexer[0]             # <<<<<<<<<<<<<<
 *         ndarray[int64_t] idx1 = indexer[1]
 *         int16_t fv
 */
  __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_indexer, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4111; __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[2]; __pyx_lineno = 4111; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_2 = ((PyArrayObject *)__pyx_t_1);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_idx0.rcbuffer->pybuffer, (PyObject*)__pyx_t_2, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
      __pyx_v_idx0 = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_idx0.rcbuffer->pybuffer.buf = NULL;
      {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4111; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    } else {__pyx_pybuffernd_idx0.diminfo[0].strides = __pyx_pybuffernd_idx0.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_idx0.diminfo[0].shape = __pyx_pybuffernd_idx0.rcbuffer->pybuffer.shape[0];
    }
  }
  __pyx_t_2 = 0;
  __pyx_v_idx0 = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pandas/src/generated.pyx":4112
 *         Py_ssize_t i, j, k, n, idx
 *         ndarray[int64_t] idx0 = indexer[0]
 *         ndarray[int64_t] idx1 = indexer[1]             # <<<<<<<<<<<<<<
 *         int16_t fv
 * 
 */
  __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_indexer, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4112; __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[2]; __pyx_lineno = 4112; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_3 = ((PyArrayObject *)__pyx_t_1);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_idx1.rcbuffer->pybuffer, (PyObject*)__pyx_t_3, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
      __pyx_v_idx1 = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_idx1.rcbuffer->pybuffer.buf = NULL;
      {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4112; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    } else {__pyx_pybuffernd_idx1.diminfo[0].strides = __pyx_pybuffernd_idx1.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_idx1.diminfo[0].shape = __pyx_pybuffernd_idx1.rcbuffer->pybuffer.shape[0];
    }
  }
  __pyx_t_3 = 0;
  __pyx_v_idx1 = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pandas/src/generated.pyx":4115
 *         int16_t fv
 * 
 *     n = len(idx0)             # <<<<<<<<<<<<<<
 *     k = len(idx1)
 * 
 */
  __pyx_t_4 = PyObject_Length(((PyObject *)__pyx_v_idx0)); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4115; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_n = __pyx_t_4;

  /* "pandas/src/generated.pyx":4116
 * 
 *     n = len(idx0)
 *     k = len(idx1)             # <<<<<<<<<<<<<<
 * 
 *     fv = fill_value
 */
  __pyx_t_4 = PyObject_Length(((PyObject *)__pyx_v_idx1)); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4116; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_k = __pyx_t_4;

  /* "pandas/src/generated.pyx":4118
 *     k = len(idx1)
 * 
 *     fv = fill_value             # <<<<<<<<<<<<<<
 *     for i from 0 <= i < n:
 *         idx = idx0[i]
 */
  __pyx_t_5 = __Pyx_PyInt_As_npy_int16(__pyx_v_fill_value); if (unlikely((__pyx_t_5 == (npy_int16)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4118; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_fv = __pyx_t_5;

  /* "pandas/src/generated.pyx":4119
 * 
 *     fv = fill_value
 *     for i from 0 <= i < n:             # <<<<<<<<<<<<<<
 *         idx = idx0[i]
 *         if idx == -1:
 */
  __pyx_t_4 = __pyx_v_n;
  for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_4; __pyx_v_i++) {

    /* "pandas/src/generated.pyx":4120
 *     fv = fill_value
 *     for i from 0 <= i < n:
 *         idx = idx0[i]             # <<<<<<<<<<<<<<
 *         if idx == -1:
 *             for j from 0 <= j < k:
 */
    __pyx_t_6 = __pyx_v_i;
    __pyx_v_idx = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_idx0.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_idx0.diminfo[0].strides));

    /* "pandas/src/generated.pyx":4121
 *     for i from 0 <= i < n:
 *         idx = idx0[i]
 *         if idx == -1:             # <<<<<<<<<<<<<<
 *             for j from 0 <= j < k:
 *                 out[i, j] = fv
 */
    __pyx_t_7 = ((__pyx_v_idx == -1) != 0);
    if (__pyx_t_7) {

      /* "pandas/src/generated.pyx":4122
 *         idx = idx0[i]
 *         if idx == -1:
 *             for j from 0 <= j < k:             # <<<<<<<<<<<<<<
 *                 out[i, j] = fv
 *         else:
 */
      __pyx_t_8 = __pyx_v_k;
      for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_8; __pyx_v_j++) {

        /* "pandas/src/generated.pyx":4123
 *         if idx == -1:
 *             for j from 0 <= j < k:
 *                 out[i, j] = fv             # <<<<<<<<<<<<<<
 *         else:
 *             for j from 0 <= j < k:
 */
        __pyx_t_9 = __pyx_v_i;
        __pyx_t_10 = __pyx_v_j;
        *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int16_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_9, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_10, __pyx_pybuffernd_out.diminfo[1].strides) = __pyx_v_fv;
      }
      goto __pyx_L5;
    }
    /*else*/ {

      /* "pandas/src/generated.pyx":4125
 *                 out[i, j] = fv
 *         else:
 *             for j from 0 <= j < k:             # <<<<<<<<<<<<<<
 *                 if idx1[j] == -1:
 *                     out[i, j] = fv
 */
      __pyx_t_8 = __pyx_v_k;
      for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_8; __pyx_v_j++) {

        /* "pandas/src/generated.pyx":4126
 *         else:
 *             for j from 0 <= j < k:
 *                 if idx1[j] == -1:             # <<<<<<<<<<<<<<
 *                     out[i, j] = fv
 *                 else:
 */
        __pyx_t_11 = __pyx_v_j;
        __pyx_t_7 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_idx1.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_idx1.diminfo[0].strides)) == -1) != 0);
        if (__pyx_t_7) {

          /* "pandas/src/generated.pyx":4127
 *             for j from 0 <= j < k:
 *                 if idx1[j] == -1:
 *                     out[i, j] = fv             # <<<<<<<<<<<<<<
 *                 else:
 *                     out[i, j] = values[idx, idx1[j]]
 */
          __pyx_t_12 = __pyx_v_i;
          __pyx_t_13 = __pyx_v_j;
          *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int16_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_12, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_13, __pyx_pybuffernd_out.diminfo[1].strides) = __pyx_v_fv;
          goto __pyx_L10;
        }
        /*else*/ {

          /* "pandas/src/generated.pyx":4129
 *                     out[i, j] = fv
 *                 else:
 *                     out[i, j] = values[idx, idx1[j]]             # <<<<<<<<<<<<<<
 * 
 * @cython.wraparound(False)
 */
          __pyx_t_14 = __pyx_v_j;
          __pyx_t_15 = __pyx_v_idx;
          __pyx_t_16 = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_idx1.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_idx1.diminfo[0].strides));
          __pyx_t_17 = __pyx_v_i;
          __pyx_t_18 = __pyx_v_j;
          *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int16_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_18, __pyx_pybuffernd_out.diminfo[1].strides) = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int16_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_values.diminfo[0].strides, __pyx_t_16, __pyx_pybuffernd_values.diminfo[1].strides));
        }
        __pyx_L10:;
      }
    }
    __pyx_L5:;
  }

  /* "pandas/src/generated.pyx":4105
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def take_2d_multi_int16_int16(ndarray[int16_t, ndim=2] values,             # <<<<<<<<<<<<<<
 *                                     indexer,
 *                                     ndarray[int16_t, ndim=2] out,
 */

  /* function exit code */
  __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_pybuffernd_idx0.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_idx1.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas.algos.take_2d_multi_int16_int16", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_idx0.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_idx1.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer);
  __pyx_L2:;
  __Pyx_XDECREF((PyObject *)__pyx_v_idx0);
  __Pyx_XDECREF((PyObject *)__pyx_v_idx1);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/src/generated.pyx":4133
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def take_2d_multi_int16_int32(ndarray[int16_t, ndim=2] values,             # <<<<<<<<<<<<<<
 *                                     indexer,
 *                                     ndarray[int32_t, ndim=2] out,
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pandas_5algos_351take_2d_multi_int16_int32(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_5algos_351take_2d_multi_int16_int32 = {__Pyx_NAMESTR("take_2d_multi_int16_int32"), (PyCFunction)__pyx_pw_6pandas_5algos_351take_2d_multi_int16_int32, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pw_6pandas_5algos_351take_2d_multi_int16_int32(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyArrayObject *__pyx_v_values = 0;
  PyObject *__pyx_v_indexer = 0;
  PyArrayObject *__pyx_v_out = 0;
  PyObject *__pyx_v_fill_value = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("take_2d_multi_int16_int32 (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_values,&__pyx_n_s_indexer,&__pyx_n_s_out,&__pyx_n_s_fill_value,0};
    PyObject* values[4] = {0,0,0,0};
    values[3] = __pyx_k__180;
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_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 (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_indexer)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("take_2d_multi_int16_int32", 0, 3, 4, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4133; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_out)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("take_2d_multi_int16_int32", 0, 3, 4, 2); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4133; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  3:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_fill_value);
          if (value) { values[3] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "take_2d_multi_int16_int32") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4133; __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_values = ((PyArrayObject *)values[0]);
    __pyx_v_indexer = values[1];
    __pyx_v_out = ((PyArrayObject *)values[2]);
    __pyx_v_fill_value = values[3];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("take_2d_multi_int16_int32", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4133; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas.algos.take_2d_multi_int16_int32", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4133; __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[2]; __pyx_lineno = 4135; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_350take_2d_multi_int16_int32(__pyx_self, __pyx_v_values, __pyx_v_indexer, __pyx_v_out, __pyx_v_fill_value);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pandas_5algos_350take_2d_multi_int16_int32(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, PyObject *__pyx_v_indexer, PyArrayObject *__pyx_v_out, PyObject *__pyx_v_fill_value) {
  Py_ssize_t __pyx_v_i;
  Py_ssize_t __pyx_v_j;
  Py_ssize_t __pyx_v_k;
  Py_ssize_t __pyx_v_n;
  Py_ssize_t __pyx_v_idx;
  PyArrayObject *__pyx_v_idx0 = 0;
  PyArrayObject *__pyx_v_idx1 = 0;
  __pyx_t_5numpy_int32_t __pyx_v_fv;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_idx0;
  __Pyx_Buffer __pyx_pybuffer_idx0;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_idx1;
  __Pyx_Buffer __pyx_pybuffer_idx1;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_out;
  __Pyx_Buffer __pyx_pybuffer_out;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_values;
  __Pyx_Buffer __pyx_pybuffer_values;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyArrayObject *__pyx_t_2 = NULL;
  PyArrayObject *__pyx_t_3 = NULL;
  Py_ssize_t __pyx_t_4;
  __pyx_t_5numpy_int32_t __pyx_t_5;
  Py_ssize_t __pyx_t_6;
  int __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;
  Py_ssize_t __pyx_t_12;
  Py_ssize_t __pyx_t_13;
  Py_ssize_t __pyx_t_14;
  Py_ssize_t __pyx_t_15;
  __pyx_t_5numpy_int64_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("take_2d_multi_int16_int32", 0);
  __pyx_pybuffer_idx0.pybuffer.buf = NULL;
  __pyx_pybuffer_idx0.refcount = 0;
  __pyx_pybuffernd_idx0.data = NULL;
  __pyx_pybuffernd_idx0.rcbuffer = &__pyx_pybuffer_idx0;
  __pyx_pybuffer_idx1.pybuffer.buf = NULL;
  __pyx_pybuffer_idx1.refcount = 0;
  __pyx_pybuffernd_idx1.data = NULL;
  __pyx_pybuffernd_idx1.rcbuffer = &__pyx_pybuffer_idx1;
  __pyx_pybuffer_values.pybuffer.buf = NULL;
  __pyx_pybuffer_values.refcount = 0;
  __pyx_pybuffernd_values.data = NULL;
  __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values;
  __pyx_pybuffer_out.pybuffer.buf = NULL;
  __pyx_pybuffer_out.refcount = 0;
  __pyx_pybuffernd_out.data = NULL;
  __pyx_pybuffernd_out.rcbuffer = &__pyx_pybuffer_out;
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int16_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4133; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_values.diminfo[1].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_values.diminfo[1].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[1];
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_out.rcbuffer->pybuffer, (PyObject*)__pyx_v_out, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4133; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_out.diminfo[0].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_out.diminfo[0].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_out.diminfo[1].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_out.diminfo[1].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[1];

  /* "pandas/src/generated.pyx":4139
 *     cdef:
 *         Py_ssize_t i, j, k, n, idx
 *         ndarray[int64_t] idx0 = indexer[0]             # <<<<<<<<<<<<<<
 *         ndarray[int64_t] idx1 = indexer[1]
 *         int32_t fv
 */
  __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_indexer, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4139; __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[2]; __pyx_lineno = 4139; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_2 = ((PyArrayObject *)__pyx_t_1);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_idx0.rcbuffer->pybuffer, (PyObject*)__pyx_t_2, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
      __pyx_v_idx0 = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_idx0.rcbuffer->pybuffer.buf = NULL;
      {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4139; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    } else {__pyx_pybuffernd_idx0.diminfo[0].strides = __pyx_pybuffernd_idx0.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_idx0.diminfo[0].shape = __pyx_pybuffernd_idx0.rcbuffer->pybuffer.shape[0];
    }
  }
  __pyx_t_2 = 0;
  __pyx_v_idx0 = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pandas/src/generated.pyx":4140
 *         Py_ssize_t i, j, k, n, idx
 *         ndarray[int64_t] idx0 = indexer[0]
 *         ndarray[int64_t] idx1 = indexer[1]             # <<<<<<<<<<<<<<
 *         int32_t fv
 * 
 */
  __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_indexer, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4140; __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[2]; __pyx_lineno = 4140; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_3 = ((PyArrayObject *)__pyx_t_1);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_idx1.rcbuffer->pybuffer, (PyObject*)__pyx_t_3, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
      __pyx_v_idx1 = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_idx1.rcbuffer->pybuffer.buf = NULL;
      {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4140; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    } else {__pyx_pybuffernd_idx1.diminfo[0].strides = __pyx_pybuffernd_idx1.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_idx1.diminfo[0].shape = __pyx_pybuffernd_idx1.rcbuffer->pybuffer.shape[0];
    }
  }
  __pyx_t_3 = 0;
  __pyx_v_idx1 = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pandas/src/generated.pyx":4143
 *         int32_t fv
 * 
 *     n = len(idx0)             # <<<<<<<<<<<<<<
 *     k = len(idx1)
 * 
 */
  __pyx_t_4 = PyObject_Length(((PyObject *)__pyx_v_idx0)); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4143; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_n = __pyx_t_4;

  /* "pandas/src/generated.pyx":4144
 * 
 *     n = len(idx0)
 *     k = len(idx1)             # <<<<<<<<<<<<<<
 * 
 *     fv = fill_value
 */
  __pyx_t_4 = PyObject_Length(((PyObject *)__pyx_v_idx1)); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4144; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_k = __pyx_t_4;

  /* "pandas/src/generated.pyx":4146
 *     k = len(idx1)
 * 
 *     fv = fill_value             # <<<<<<<<<<<<<<
 *     for i from 0 <= i < n:
 *         idx = idx0[i]
 */
  __pyx_t_5 = __Pyx_PyInt_As_npy_int32(__pyx_v_fill_value); if (unlikely((__pyx_t_5 == (npy_int32)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4146; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_fv = __pyx_t_5;

  /* "pandas/src/generated.pyx":4147
 * 
 *     fv = fill_value
 *     for i from 0 <= i < n:             # <<<<<<<<<<<<<<
 *         idx = idx0[i]
 *         if idx == -1:
 */
  __pyx_t_4 = __pyx_v_n;
  for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_4; __pyx_v_i++) {

    /* "pandas/src/generated.pyx":4148
 *     fv = fill_value
 *     for i from 0 <= i < n:
 *         idx = idx0[i]             # <<<<<<<<<<<<<<
 *         if idx == -1:
 *             for j from 0 <= j < k:
 */
    __pyx_t_6 = __pyx_v_i;
    __pyx_v_idx = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_idx0.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_idx0.diminfo[0].strides));

    /* "pandas/src/generated.pyx":4149
 *     for i from 0 <= i < n:
 *         idx = idx0[i]
 *         if idx == -1:             # <<<<<<<<<<<<<<
 *             for j from 0 <= j < k:
 *                 out[i, j] = fv
 */
    __pyx_t_7 = ((__pyx_v_idx == -1) != 0);
    if (__pyx_t_7) {

      /* "pandas/src/generated.pyx":4150
 *         idx = idx0[i]
 *         if idx == -1:
 *             for j from 0 <= j < k:             # <<<<<<<<<<<<<<
 *                 out[i, j] = fv
 *         else:
 */
      __pyx_t_8 = __pyx_v_k;
      for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_8; __pyx_v_j++) {

        /* "pandas/src/generated.pyx":4151
 *         if idx == -1:
 *             for j from 0 <= j < k:
 *                 out[i, j] = fv             # <<<<<<<<<<<<<<
 *         else:
 *             for j from 0 <= j < k:
 */
        __pyx_t_9 = __pyx_v_i;
        __pyx_t_10 = __pyx_v_j;
        *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_9, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_10, __pyx_pybuffernd_out.diminfo[1].strides) = __pyx_v_fv;
      }
      goto __pyx_L5;
    }
    /*else*/ {

      /* "pandas/src/generated.pyx":4153
 *                 out[i, j] = fv
 *         else:
 *             for j from 0 <= j < k:             # <<<<<<<<<<<<<<
 *                 if idx1[j] == -1:
 *                     out[i, j] = fv
 */
      __pyx_t_8 = __pyx_v_k;
      for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_8; __pyx_v_j++) {

        /* "pandas/src/generated.pyx":4154
 *         else:
 *             for j from 0 <= j < k:
 *                 if idx1[j] == -1:             # <<<<<<<<<<<<<<
 *                     out[i, j] = fv
 *                 else:
 */
        __pyx_t_11 = __pyx_v_j;
        __pyx_t_7 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_idx1.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_idx1.diminfo[0].strides)) == -1) != 0);
        if (__pyx_t_7) {

          /* "pandas/src/generated.pyx":4155
 *             for j from 0 <= j < k:
 *                 if idx1[j] == -1:
 *                     out[i, j] = fv             # <<<<<<<<<<<<<<
 *                 else:
 *                     out[i, j] = values[idx, idx1[j]]
 */
          __pyx_t_12 = __pyx_v_i;
          __pyx_t_13 = __pyx_v_j;
          *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_12, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_13, __pyx_pybuffernd_out.diminfo[1].strides) = __pyx_v_fv;
          goto __pyx_L10;
        }
        /*else*/ {

          /* "pandas/src/generated.pyx":4157
 *                     out[i, j] = fv
 *                 else:
 *                     out[i, j] = values[idx, idx1[j]]             # <<<<<<<<<<<<<<
 * 
 * @cython.wraparound(False)
 */
          __pyx_t_14 = __pyx_v_j;
          __pyx_t_15 = __pyx_v_idx;
          __pyx_t_16 = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_idx1.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_idx1.diminfo[0].strides));
          __pyx_t_17 = __pyx_v_i;
          __pyx_t_18 = __pyx_v_j;
          *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_18, __pyx_pybuffernd_out.diminfo[1].strides) = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int16_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_values.diminfo[0].strides, __pyx_t_16, __pyx_pybuffernd_values.diminfo[1].strides));
        }
        __pyx_L10:;
      }
    }
    __pyx_L5:;
  }

  /* "pandas/src/generated.pyx":4133
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def take_2d_multi_int16_int32(ndarray[int16_t, ndim=2] values,             # <<<<<<<<<<<<<<
 *                                     indexer,
 *                                     ndarray[int32_t, ndim=2] out,
 */

  /* function exit code */
  __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_pybuffernd_idx0.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_idx1.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas.algos.take_2d_multi_int16_int32", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_idx0.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_idx1.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer);
  __pyx_L2:;
  __Pyx_XDECREF((PyObject *)__pyx_v_idx0);
  __Pyx_XDECREF((PyObject *)__pyx_v_idx1);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/src/generated.pyx":4161
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def take_2d_multi_int16_int64(ndarray[int16_t, ndim=2] values,             # <<<<<<<<<<<<<<
 *                                     indexer,
 *                                     ndarray[int64_t, ndim=2] out,
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pandas_5algos_353take_2d_multi_int16_int64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_5algos_353take_2d_multi_int16_int64 = {__Pyx_NAMESTR("take_2d_multi_int16_int64"), (PyCFunction)__pyx_pw_6pandas_5algos_353take_2d_multi_int16_int64, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pw_6pandas_5algos_353take_2d_multi_int16_int64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyArrayObject *__pyx_v_values = 0;
  PyObject *__pyx_v_indexer = 0;
  PyArrayObject *__pyx_v_out = 0;
  PyObject *__pyx_v_fill_value = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("take_2d_multi_int16_int64 (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_values,&__pyx_n_s_indexer,&__pyx_n_s_out,&__pyx_n_s_fill_value,0};
    PyObject* values[4] = {0,0,0,0};
    values[3] = __pyx_k__181;
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_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 (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_indexer)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("take_2d_multi_int16_int64", 0, 3, 4, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4161; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_out)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("take_2d_multi_int16_int64", 0, 3, 4, 2); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4161; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  3:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_fill_value);
          if (value) { values[3] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "take_2d_multi_int16_int64") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4161; __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_values = ((PyArrayObject *)values[0]);
    __pyx_v_indexer = values[1];
    __pyx_v_out = ((PyArrayObject *)values[2]);
    __pyx_v_fill_value = values[3];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("take_2d_multi_int16_int64", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4161; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas.algos.take_2d_multi_int16_int64", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4161; __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[2]; __pyx_lineno = 4163; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_352take_2d_multi_int16_int64(__pyx_self, __pyx_v_values, __pyx_v_indexer, __pyx_v_out, __pyx_v_fill_value);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pandas_5algos_352take_2d_multi_int16_int64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, PyObject *__pyx_v_indexer, PyArrayObject *__pyx_v_out, PyObject *__pyx_v_fill_value) {
  Py_ssize_t __pyx_v_i;
  Py_ssize_t __pyx_v_j;
  Py_ssize_t __pyx_v_k;
  Py_ssize_t __pyx_v_n;
  Py_ssize_t __pyx_v_idx;
  PyArrayObject *__pyx_v_idx0 = 0;
  PyArrayObject *__pyx_v_idx1 = 0;
  __pyx_t_5numpy_int64_t __pyx_v_fv;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_idx0;
  __Pyx_Buffer __pyx_pybuffer_idx0;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_idx1;
  __Pyx_Buffer __pyx_pybuffer_idx1;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_out;
  __Pyx_Buffer __pyx_pybuffer_out;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_values;
  __Pyx_Buffer __pyx_pybuffer_values;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyArrayObject *__pyx_t_2 = NULL;
  PyArrayObject *__pyx_t_3 = NULL;
  Py_ssize_t __pyx_t_4;
  __pyx_t_5numpy_int64_t __pyx_t_5;
  Py_ssize_t __pyx_t_6;
  int __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;
  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;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("take_2d_multi_int16_int64", 0);
  __pyx_pybuffer_idx0.pybuffer.buf = NULL;
  __pyx_pybuffer_idx0.refcount = 0;
  __pyx_pybuffernd_idx0.data = NULL;
  __pyx_pybuffernd_idx0.rcbuffer = &__pyx_pybuffer_idx0;
  __pyx_pybuffer_idx1.pybuffer.buf = NULL;
  __pyx_pybuffer_idx1.refcount = 0;
  __pyx_pybuffernd_idx1.data = NULL;
  __pyx_pybuffernd_idx1.rcbuffer = &__pyx_pybuffer_idx1;
  __pyx_pybuffer_values.pybuffer.buf = NULL;
  __pyx_pybuffer_values.refcount = 0;
  __pyx_pybuffernd_values.data = NULL;
  __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values;
  __pyx_pybuffer_out.pybuffer.buf = NULL;
  __pyx_pybuffer_out.refcount = 0;
  __pyx_pybuffernd_out.data = NULL;
  __pyx_pybuffernd_out.rcbuffer = &__pyx_pybuffer_out;
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int16_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4161; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_values.diminfo[1].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_values.diminfo[1].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[1];
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_out.rcbuffer->pybuffer, (PyObject*)__pyx_v_out, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4161; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_out.diminfo[0].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_out.diminfo[0].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_out.diminfo[1].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_out.diminfo[1].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[1];

  /* "pandas/src/generated.pyx":4167
 *     cdef:
 *         Py_ssize_t i, j, k, n, idx
 *         ndarray[int64_t] idx0 = indexer[0]             # <<<<<<<<<<<<<<
 *         ndarray[int64_t] idx1 = indexer[1]
 *         int64_t fv
 */
  __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_indexer, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4167; __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[2]; __pyx_lineno = 4167; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_2 = ((PyArrayObject *)__pyx_t_1);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_idx0.rcbuffer->pybuffer, (PyObject*)__pyx_t_2, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
      __pyx_v_idx0 = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_idx0.rcbuffer->pybuffer.buf = NULL;
      {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4167; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    } else {__pyx_pybuffernd_idx0.diminfo[0].strides = __pyx_pybuffernd_idx0.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_idx0.diminfo[0].shape = __pyx_pybuffernd_idx0.rcbuffer->pybuffer.shape[0];
    }
  }
  __pyx_t_2 = 0;
  __pyx_v_idx0 = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pandas/src/generated.pyx":4168
 *         Py_ssize_t i, j, k, n, idx
 *         ndarray[int64_t] idx0 = indexer[0]
 *         ndarray[int64_t] idx1 = indexer[1]             # <<<<<<<<<<<<<<
 *         int64_t fv
 * 
 */
  __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_indexer, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4168; __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[2]; __pyx_lineno = 4168; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_3 = ((PyArrayObject *)__pyx_t_1);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_idx1.rcbuffer->pybuffer, (PyObject*)__pyx_t_3, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
      __pyx_v_idx1 = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_idx1.rcbuffer->pybuffer.buf = NULL;
      {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4168; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    } else {__pyx_pybuffernd_idx1.diminfo[0].strides = __pyx_pybuffernd_idx1.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_idx1.diminfo[0].shape = __pyx_pybuffernd_idx1.rcbuffer->pybuffer.shape[0];
    }
  }
  __pyx_t_3 = 0;
  __pyx_v_idx1 = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pandas/src/generated.pyx":4171
 *         int64_t fv
 * 
 *     n = len(idx0)             # <<<<<<<<<<<<<<
 *     k = len(idx1)
 * 
 */
  __pyx_t_4 = PyObject_Length(((PyObject *)__pyx_v_idx0)); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4171; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_n = __pyx_t_4;

  /* "pandas/src/generated.pyx":4172
 * 
 *     n = len(idx0)
 *     k = len(idx1)             # <<<<<<<<<<<<<<
 * 
 *     fv = fill_value
 */
  __pyx_t_4 = PyObject_Length(((PyObject *)__pyx_v_idx1)); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4172; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_k = __pyx_t_4;

  /* "pandas/src/generated.pyx":4174
 *     k = len(idx1)
 * 
 *     fv = fill_value             # <<<<<<<<<<<<<<
 *     for i from 0 <= i < n:
 *         idx = idx0[i]
 */
  __pyx_t_5 = __Pyx_PyInt_As_npy_int64(__pyx_v_fill_value); if (unlikely((__pyx_t_5 == (npy_int64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4174; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_fv = __pyx_t_5;

  /* "pandas/src/generated.pyx":4175
 * 
 *     fv = fill_value
 *     for i from 0 <= i < n:             # <<<<<<<<<<<<<<
 *         idx = idx0[i]
 *         if idx == -1:
 */
  __pyx_t_4 = __pyx_v_n;
  for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_4; __pyx_v_i++) {

    /* "pandas/src/generated.pyx":4176
 *     fv = fill_value
 *     for i from 0 <= i < n:
 *         idx = idx0[i]             # <<<<<<<<<<<<<<
 *         if idx == -1:
 *             for j from 0 <= j < k:
 */
    __pyx_t_6 = __pyx_v_i;
    __pyx_v_idx = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_idx0.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_idx0.diminfo[0].strides));

    /* "pandas/src/generated.pyx":4177
 *     for i from 0 <= i < n:
 *         idx = idx0[i]
 *         if idx == -1:             # <<<<<<<<<<<<<<
 *             for j from 0 <= j < k:
 *                 out[i, j] = fv
 */
    __pyx_t_7 = ((__pyx_v_idx == -1) != 0);
    if (__pyx_t_7) {

      /* "pandas/src/generated.pyx":4178
 *         idx = idx0[i]
 *         if idx == -1:
 *             for j from 0 <= j < k:             # <<<<<<<<<<<<<<
 *                 out[i, j] = fv
 *         else:
 */
      __pyx_t_8 = __pyx_v_k;
      for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_8; __pyx_v_j++) {

        /* "pandas/src/generated.pyx":4179
 *         if idx == -1:
 *             for j from 0 <= j < k:
 *                 out[i, j] = fv             # <<<<<<<<<<<<<<
 *         else:
 *             for j from 0 <= j < k:
 */
        __pyx_t_9 = __pyx_v_i;
        __pyx_t_10 = __pyx_v_j;
        *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_9, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_10, __pyx_pybuffernd_out.diminfo[1].strides) = __pyx_v_fv;
      }
      goto __pyx_L5;
    }
    /*else*/ {

      /* "pandas/src/generated.pyx":4181
 *                 out[i, j] = fv
 *         else:
 *             for j from 0 <= j < k:             # <<<<<<<<<<<<<<
 *                 if idx1[j] == -1:
 *                     out[i, j] = fv
 */
      __pyx_t_8 = __pyx_v_k;
      for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_8; __pyx_v_j++) {

        /* "pandas/src/generated.pyx":4182
 *         else:
 *             for j from 0 <= j < k:
 *                 if idx1[j] == -1:             # <<<<<<<<<<<<<<
 *                     out[i, j] = fv
 *                 else:
 */
        __pyx_t_11 = __pyx_v_j;
        __pyx_t_7 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_idx1.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_idx1.diminfo[0].strides)) == -1) != 0);
        if (__pyx_t_7) {

          /* "pandas/src/generated.pyx":4183
 *             for j from 0 <= j < k:
 *                 if idx1[j] == -1:
 *                     out[i, j] = fv             # <<<<<<<<<<<<<<
 *                 else:
 *                     out[i, j] = values[idx, idx1[j]]
 */
          __pyx_t_12 = __pyx_v_i;
          __pyx_t_13 = __pyx_v_j;
          *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_12, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_13, __pyx_pybuffernd_out.diminfo[1].strides) = __pyx_v_fv;
          goto __pyx_L10;
        }
        /*else*/ {

          /* "pandas/src/generated.pyx":4185
 *                     out[i, j] = fv
 *                 else:
 *                     out[i, j] = values[idx, idx1[j]]             # <<<<<<<<<<<<<<
 * 
 * @cython.wraparound(False)
 */
          __pyx_t_14 = __pyx_v_j;
          __pyx_t_15 = __pyx_v_idx;
          __pyx_t_5 = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_idx1.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_idx1.diminfo[0].strides));
          __pyx_t_16 = __pyx_v_i;
          __pyx_t_17 = __pyx_v_j;
          *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_17, __pyx_pybuffernd_out.diminfo[1].strides) = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int16_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_values.diminfo[0].strides, __pyx_t_5, __pyx_pybuffernd_values.diminfo[1].strides));
        }
        __pyx_L10:;
      }
    }
    __pyx_L5:;
  }

  /* "pandas/src/generated.pyx":4161
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def take_2d_multi_int16_int64(ndarray[int16_t, ndim=2] values,             # <<<<<<<<<<<<<<
 *                                     indexer,
 *                                     ndarray[int64_t, ndim=2] out,
 */

  /* function exit code */
  __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_pybuffernd_idx0.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_idx1.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas.algos.take_2d_multi_int16_int64", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_idx0.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_idx1.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer);
  __pyx_L2:;
  __Pyx_XDECREF((PyObject *)__pyx_v_idx0);
  __Pyx_XDECREF((PyObject *)__pyx_v_idx1);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/src/generated.pyx":4189
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def take_2d_multi_int16_float64(ndarray[int16_t, ndim=2] values,             # <<<<<<<<<<<<<<
 *                                     indexer,
 *                                     ndarray[float64_t, ndim=2] out,
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pandas_5algos_355take_2d_multi_int16_float64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_5algos_355take_2d_multi_int16_float64 = {__Pyx_NAMESTR("take_2d_multi_int16_float64"), (PyCFunction)__pyx_pw_6pandas_5algos_355take_2d_multi_int16_float64, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pw_6pandas_5algos_355take_2d_multi_int16_float64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyArrayObject *__pyx_v_values = 0;
  PyObject *__pyx_v_indexer = 0;
  PyArrayObject *__pyx_v_out = 0;
  PyObject *__pyx_v_fill_value = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("take_2d_multi_int16_float64 (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_values,&__pyx_n_s_indexer,&__pyx_n_s_out,&__pyx_n_s_fill_value,0};
    PyObject* values[4] = {0,0,0,0};
    values[3] = __pyx_k__182;
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_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 (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_indexer)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("take_2d_multi_int16_float64", 0, 3, 4, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4189; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_out)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("take_2d_multi_int16_float64", 0, 3, 4, 2); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4189; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  3:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_fill_value);
          if (value) { values[3] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "take_2d_multi_int16_float64") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4189; __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_values = ((PyArrayObject *)values[0]);
    __pyx_v_indexer = values[1];
    __pyx_v_out = ((PyArrayObject *)values[2]);
    __pyx_v_fill_value = values[3];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("take_2d_multi_int16_float64", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4189; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas.algos.take_2d_multi_int16_float64", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4189; __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[2]; __pyx_lineno = 4191; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_354take_2d_multi_int16_float64(__pyx_self, __pyx_v_values, __pyx_v_indexer, __pyx_v_out, __pyx_v_fill_value);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pandas_5algos_354take_2d_multi_int16_float64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, PyObject *__pyx_v_indexer, PyArrayObject *__pyx_v_out, PyObject *__pyx_v_fill_value) {
  Py_ssize_t __pyx_v_i;
  Py_ssize_t __pyx_v_j;
  Py_ssize_t __pyx_v_k;
  Py_ssize_t __pyx_v_n;
  Py_ssize_t __pyx_v_idx;
  PyArrayObject *__pyx_v_idx0 = 0;
  PyArrayObject *__pyx_v_idx1 = 0;
  __pyx_t_5numpy_float64_t __pyx_v_fv;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_idx0;
  __Pyx_Buffer __pyx_pybuffer_idx0;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_idx1;
  __Pyx_Buffer __pyx_pybuffer_idx1;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_out;
  __Pyx_Buffer __pyx_pybuffer_out;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_values;
  __Pyx_Buffer __pyx_pybuffer_values;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyArrayObject *__pyx_t_2 = NULL;
  PyArrayObject *__pyx_t_3 = NULL;
  Py_ssize_t __pyx_t_4;
  __pyx_t_5numpy_float64_t __pyx_t_5;
  Py_ssize_t __pyx_t_6;
  int __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;
  Py_ssize_t __pyx_t_12;
  Py_ssize_t __pyx_t_13;
  Py_ssize_t __pyx_t_14;
  Py_ssize_t __pyx_t_15;
  __pyx_t_5numpy_int64_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("take_2d_multi_int16_float64", 0);
  __pyx_pybuffer_idx0.pybuffer.buf = NULL;
  __pyx_pybuffer_idx0.refcount = 0;
  __pyx_pybuffernd_idx0.data = NULL;
  __pyx_pybuffernd_idx0.rcbuffer = &__pyx_pybuffer_idx0;
  __pyx_pybuffer_idx1.pybuffer.buf = NULL;
  __pyx_pybuffer_idx1.refcount = 0;
  __pyx_pybuffernd_idx1.data = NULL;
  __pyx_pybuffernd_idx1.rcbuffer = &__pyx_pybuffer_idx1;
  __pyx_pybuffer_values.pybuffer.buf = NULL;
  __pyx_pybuffer_values.refcount = 0;
  __pyx_pybuffernd_values.data = NULL;
  __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values;
  __pyx_pybuffer_out.pybuffer.buf = NULL;
  __pyx_pybuffer_out.refcount = 0;
  __pyx_pybuffernd_out.data = NULL;
  __pyx_pybuffernd_out.rcbuffer = &__pyx_pybuffer_out;
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int16_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4189; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_values.diminfo[1].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_values.diminfo[1].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[1];
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_out.rcbuffer->pybuffer, (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[2]; __pyx_lineno = 4189; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_out.diminfo[0].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_out.diminfo[0].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_out.diminfo[1].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_out.diminfo[1].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[1];

  /* "pandas/src/generated.pyx":4195
 *     cdef:
 *         Py_ssize_t i, j, k, n, idx
 *         ndarray[int64_t] idx0 = indexer[0]             # <<<<<<<<<<<<<<
 *         ndarray[int64_t] idx1 = indexer[1]
 *         float64_t fv
 */
  __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_indexer, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4195; __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[2]; __pyx_lineno = 4195; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_2 = ((PyArrayObject *)__pyx_t_1);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_idx0.rcbuffer->pybuffer, (PyObject*)__pyx_t_2, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
      __pyx_v_idx0 = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_idx0.rcbuffer->pybuffer.buf = NULL;
      {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4195; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    } else {__pyx_pybuffernd_idx0.diminfo[0].strides = __pyx_pybuffernd_idx0.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_idx0.diminfo[0].shape = __pyx_pybuffernd_idx0.rcbuffer->pybuffer.shape[0];
    }
  }
  __pyx_t_2 = 0;
  __pyx_v_idx0 = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pandas/src/generated.pyx":4196
 *         Py_ssize_t i, j, k, n, idx
 *         ndarray[int64_t] idx0 = indexer[0]
 *         ndarray[int64_t] idx1 = indexer[1]             # <<<<<<<<<<<<<<
 *         float64_t fv
 * 
 */
  __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_indexer, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4196; __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[2]; __pyx_lineno = 4196; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_3 = ((PyArrayObject *)__pyx_t_1);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_idx1.rcbuffer->pybuffer, (PyObject*)__pyx_t_3, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
      __pyx_v_idx1 = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_idx1.rcbuffer->pybuffer.buf = NULL;
      {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4196; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    } else {__pyx_pybuffernd_idx1.diminfo[0].strides = __pyx_pybuffernd_idx1.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_idx1.diminfo[0].shape = __pyx_pybuffernd_idx1.rcbuffer->pybuffer.shape[0];
    }
  }
  __pyx_t_3 = 0;
  __pyx_v_idx1 = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pandas/src/generated.pyx":4199
 *         float64_t fv
 * 
 *     n = len(idx0)             # <<<<<<<<<<<<<<
 *     k = len(idx1)
 * 
 */
  __pyx_t_4 = PyObject_Length(((PyObject *)__pyx_v_idx0)); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4199; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_n = __pyx_t_4;

  /* "pandas/src/generated.pyx":4200
 * 
 *     n = len(idx0)
 *     k = len(idx1)             # <<<<<<<<<<<<<<
 * 
 *     fv = fill_value
 */
  __pyx_t_4 = PyObject_Length(((PyObject *)__pyx_v_idx1)); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4200; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_k = __pyx_t_4;

  /* "pandas/src/generated.pyx":4202
 *     k = len(idx1)
 * 
 *     fv = fill_value             # <<<<<<<<<<<<<<
 *     for i from 0 <= i < n:
 *         idx = idx0[i]
 */
  __pyx_t_5 = __pyx_PyFloat_AsDouble(__pyx_v_fill_value); if (unlikely((__pyx_t_5 == (npy_float64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4202; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_fv = __pyx_t_5;

  /* "pandas/src/generated.pyx":4203
 * 
 *     fv = fill_value
 *     for i from 0 <= i < n:             # <<<<<<<<<<<<<<
 *         idx = idx0[i]
 *         if idx == -1:
 */
  __pyx_t_4 = __pyx_v_n;
  for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_4; __pyx_v_i++) {

    /* "pandas/src/generated.pyx":4204
 *     fv = fill_value
 *     for i from 0 <= i < n:
 *         idx = idx0[i]             # <<<<<<<<<<<<<<
 *         if idx == -1:
 *             for j from 0 <= j < k:
 */
    __pyx_t_6 = __pyx_v_i;
    __pyx_v_idx = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_idx0.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_idx0.diminfo[0].strides));

    /* "pandas/src/generated.pyx":4205
 *     for i from 0 <= i < n:
 *         idx = idx0[i]
 *         if idx == -1:             # <<<<<<<<<<<<<<
 *             for j from 0 <= j < k:
 *                 out[i, j] = fv
 */
    __pyx_t_7 = ((__pyx_v_idx == -1) != 0);
    if (__pyx_t_7) {

      /* "pandas/src/generated.pyx":4206
 *         idx = idx0[i]
 *         if idx == -1:
 *             for j from 0 <= j < k:             # <<<<<<<<<<<<<<
 *                 out[i, j] = fv
 *         else:
 */
      __pyx_t_8 = __pyx_v_k;
      for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_8; __pyx_v_j++) {

        /* "pandas/src/generated.pyx":4207
 *         if idx == -1:
 *             for j from 0 <= j < k:
 *                 out[i, j] = fv             # <<<<<<<<<<<<<<
 *         else:
 *             for j from 0 <= j < k:
 */
        __pyx_t_9 = __pyx_v_i;
        __pyx_t_10 = __pyx_v_j;
        *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_9, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_10, __pyx_pybuffernd_out.diminfo[1].strides) = __pyx_v_fv;
      }
      goto __pyx_L5;
    }
    /*else*/ {

      /* "pandas/src/generated.pyx":4209
 *                 out[i, j] = fv
 *         else:
 *             for j from 0 <= j < k:             # <<<<<<<<<<<<<<
 *                 if idx1[j] == -1:
 *                     out[i, j] = fv
 */
      __pyx_t_8 = __pyx_v_k;
      for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_8; __pyx_v_j++) {

        /* "pandas/src/generated.pyx":4210
 *         else:
 *             for j from 0 <= j < k:
 *                 if idx1[j] == -1:             # <<<<<<<<<<<<<<
 *                     out[i, j] = fv
 *                 else:
 */
        __pyx_t_11 = __pyx_v_j;
        __pyx_t_7 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_idx1.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_idx1.diminfo[0].strides)) == -1) != 0);
        if (__pyx_t_7) {

          /* "pandas/src/generated.pyx":4211
 *             for j from 0 <= j < k:
 *                 if idx1[j] == -1:
 *                     out[i, j] = fv             # <<<<<<<<<<<<<<
 *                 else:
 *                     out[i, j] = values[idx, idx1[j]]
 */
          __pyx_t_12 = __pyx_v_i;
          __pyx_t_13 = __pyx_v_j;
          *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_12, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_13, __pyx_pybuffernd_out.diminfo[1].strides) = __pyx_v_fv;
          goto __pyx_L10;
        }
        /*else*/ {

          /* "pandas/src/generated.pyx":4213
 *                     out[i, j] = fv
 *                 else:
 *                     out[i, j] = values[idx, idx1[j]]             # <<<<<<<<<<<<<<
 * 
 * @cython.wraparound(False)
 */
          __pyx_t_14 = __pyx_v_j;
          __pyx_t_15 = __pyx_v_idx;
          __pyx_t_16 = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_idx1.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_idx1.diminfo[0].strides));
          __pyx_t_17 = __pyx_v_i;
          __pyx_t_18 = __pyx_v_j;
          *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_18, __pyx_pybuffernd_out.diminfo[1].strides) = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int16_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_values.diminfo[0].strides, __pyx_t_16, __pyx_pybuffernd_values.diminfo[1].strides));
        }
        __pyx_L10:;
      }
    }
    __pyx_L5:;
  }

  /* "pandas/src/generated.pyx":4189
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def take_2d_multi_int16_float64(ndarray[int16_t, ndim=2] values,             # <<<<<<<<<<<<<<
 *                                     indexer,
 *                                     ndarray[float64_t, ndim=2] out,
 */

  /* function exit code */
  __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_pybuffernd_idx0.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_idx1.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas.algos.take_2d_multi_int16_float64", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_idx0.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_idx1.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer);
  __pyx_L2:;
  __Pyx_XDECREF((PyObject *)__pyx_v_idx0);
  __Pyx_XDECREF((PyObject *)__pyx_v_idx1);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/src/generated.pyx":4217
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def take_2d_multi_int32_int32(ndarray[int32_t, ndim=2] values,             # <<<<<<<<<<<<<<
 *                                     indexer,
 *                                     ndarray[int32_t, ndim=2] out,
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pandas_5algos_357take_2d_multi_int32_int32(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_5algos_357take_2d_multi_int32_int32 = {__Pyx_NAMESTR("take_2d_multi_int32_int32"), (PyCFunction)__pyx_pw_6pandas_5algos_357take_2d_multi_int32_int32, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pw_6pandas_5algos_357take_2d_multi_int32_int32(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyArrayObject *__pyx_v_values = 0;
  PyObject *__pyx_v_indexer = 0;
  PyArrayObject *__pyx_v_out = 0;
  PyObject *__pyx_v_fill_value = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("take_2d_multi_int32_int32 (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_values,&__pyx_n_s_indexer,&__pyx_n_s_out,&__pyx_n_s_fill_value,0};
    PyObject* values[4] = {0,0,0,0};
    values[3] = __pyx_k__183;
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_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 (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_indexer)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("take_2d_multi_int32_int32", 0, 3, 4, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4217; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_out)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("take_2d_multi_int32_int32", 0, 3, 4, 2); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4217; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  3:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_fill_value);
          if (value) { values[3] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "take_2d_multi_int32_int32") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4217; __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_values = ((PyArrayObject *)values[0]);
    __pyx_v_indexer = values[1];
    __pyx_v_out = ((PyArrayObject *)values[2]);
    __pyx_v_fill_value = values[3];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("take_2d_multi_int32_int32", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4217; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas.algos.take_2d_multi_int32_int32", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4217; __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[2]; __pyx_lineno = 4219; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_356take_2d_multi_int32_int32(__pyx_self, __pyx_v_values, __pyx_v_indexer, __pyx_v_out, __pyx_v_fill_value);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pandas_5algos_356take_2d_multi_int32_int32(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, PyObject *__pyx_v_indexer, PyArrayObject *__pyx_v_out, PyObject *__pyx_v_fill_value) {
  Py_ssize_t __pyx_v_i;
  Py_ssize_t __pyx_v_j;
  Py_ssize_t __pyx_v_k;
  Py_ssize_t __pyx_v_n;
  Py_ssize_t __pyx_v_idx;
  PyArrayObject *__pyx_v_idx0 = 0;
  PyArrayObject *__pyx_v_idx1 = 0;
  __pyx_t_5numpy_int32_t __pyx_v_fv;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_idx0;
  __Pyx_Buffer __pyx_pybuffer_idx0;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_idx1;
  __Pyx_Buffer __pyx_pybuffer_idx1;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_out;
  __Pyx_Buffer __pyx_pybuffer_out;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_values;
  __Pyx_Buffer __pyx_pybuffer_values;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyArrayObject *__pyx_t_2 = NULL;
  PyArrayObject *__pyx_t_3 = NULL;
  Py_ssize_t __pyx_t_4;
  __pyx_t_5numpy_int32_t __pyx_t_5;
  Py_ssize_t __pyx_t_6;
  int __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;
  Py_ssize_t __pyx_t_12;
  Py_ssize_t __pyx_t_13;
  Py_ssize_t __pyx_t_14;
  Py_ssize_t __pyx_t_15;
  __pyx_t_5numpy_int64_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("take_2d_multi_int32_int32", 0);
  __pyx_pybuffer_idx0.pybuffer.buf = NULL;
  __pyx_pybuffer_idx0.refcount = 0;
  __pyx_pybuffernd_idx0.data = NULL;
  __pyx_pybuffernd_idx0.rcbuffer = &__pyx_pybuffer_idx0;
  __pyx_pybuffer_idx1.pybuffer.buf = NULL;
  __pyx_pybuffer_idx1.refcount = 0;
  __pyx_pybuffernd_idx1.data = NULL;
  __pyx_pybuffernd_idx1.rcbuffer = &__pyx_pybuffer_idx1;
  __pyx_pybuffer_values.pybuffer.buf = NULL;
  __pyx_pybuffer_values.refcount = 0;
  __pyx_pybuffernd_values.data = NULL;
  __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values;
  __pyx_pybuffer_out.pybuffer.buf = NULL;
  __pyx_pybuffer_out.refcount = 0;
  __pyx_pybuffernd_out.data = NULL;
  __pyx_pybuffernd_out.rcbuffer = &__pyx_pybuffer_out;
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4217; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_values.diminfo[1].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_values.diminfo[1].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[1];
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_out.rcbuffer->pybuffer, (PyObject*)__pyx_v_out, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4217; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_out.diminfo[0].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_out.diminfo[0].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_out.diminfo[1].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_out.diminfo[1].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[1];

  /* "pandas/src/generated.pyx":4223
 *     cdef:
 *         Py_ssize_t i, j, k, n, idx
 *         ndarray[int64_t] idx0 = indexer[0]             # <<<<<<<<<<<<<<
 *         ndarray[int64_t] idx1 = indexer[1]
 *         int32_t fv
 */
  __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_indexer, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4223; __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[2]; __pyx_lineno = 4223; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_2 = ((PyArrayObject *)__pyx_t_1);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_idx0.rcbuffer->pybuffer, (PyObject*)__pyx_t_2, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
      __pyx_v_idx0 = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_idx0.rcbuffer->pybuffer.buf = NULL;
      {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4223; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    } else {__pyx_pybuffernd_idx0.diminfo[0].strides = __pyx_pybuffernd_idx0.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_idx0.diminfo[0].shape = __pyx_pybuffernd_idx0.rcbuffer->pybuffer.shape[0];
    }
  }
  __pyx_t_2 = 0;
  __pyx_v_idx0 = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pandas/src/generated.pyx":4224
 *         Py_ssize_t i, j, k, n, idx
 *         ndarray[int64_t] idx0 = indexer[0]
 *         ndarray[int64_t] idx1 = indexer[1]             # <<<<<<<<<<<<<<
 *         int32_t fv
 * 
 */
  __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_indexer, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4224; __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[2]; __pyx_lineno = 4224; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_3 = ((PyArrayObject *)__pyx_t_1);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_idx1.rcbuffer->pybuffer, (PyObject*)__pyx_t_3, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
      __pyx_v_idx1 = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_idx1.rcbuffer->pybuffer.buf = NULL;
      {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4224; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    } else {__pyx_pybuffernd_idx1.diminfo[0].strides = __pyx_pybuffernd_idx1.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_idx1.diminfo[0].shape = __pyx_pybuffernd_idx1.rcbuffer->pybuffer.shape[0];
    }
  }
  __pyx_t_3 = 0;
  __pyx_v_idx1 = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pandas/src/generated.pyx":4227
 *         int32_t fv
 * 
 *     n = len(idx0)             # <<<<<<<<<<<<<<
 *     k = len(idx1)
 * 
 */
  __pyx_t_4 = PyObject_Length(((PyObject *)__pyx_v_idx0)); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4227; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_n = __pyx_t_4;

  /* "pandas/src/generated.pyx":4228
 * 
 *     n = len(idx0)
 *     k = len(idx1)             # <<<<<<<<<<<<<<
 * 
 *     fv = fill_value
 */
  __pyx_t_4 = PyObject_Length(((PyObject *)__pyx_v_idx1)); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4228; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_k = __pyx_t_4;

  /* "pandas/src/generated.pyx":4230
 *     k = len(idx1)
 * 
 *     fv = fill_value             # <<<<<<<<<<<<<<
 *     for i from 0 <= i < n:
 *         idx = idx0[i]
 */
  __pyx_t_5 = __Pyx_PyInt_As_npy_int32(__pyx_v_fill_value); if (unlikely((__pyx_t_5 == (npy_int32)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4230; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_fv = __pyx_t_5;

  /* "pandas/src/generated.pyx":4231
 * 
 *     fv = fill_value
 *     for i from 0 <= i < n:             # <<<<<<<<<<<<<<
 *         idx = idx0[i]
 *         if idx == -1:
 */
  __pyx_t_4 = __pyx_v_n;
  for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_4; __pyx_v_i++) {

    /* "pandas/src/generated.pyx":4232
 *     fv = fill_value
 *     for i from 0 <= i < n:
 *         idx = idx0[i]             # <<<<<<<<<<<<<<
 *         if idx == -1:
 *             for j from 0 <= j < k:
 */
    __pyx_t_6 = __pyx_v_i;
    __pyx_v_idx = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_idx0.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_idx0.diminfo[0].strides));

    /* "pandas/src/generated.pyx":4233
 *     for i from 0 <= i < n:
 *         idx = idx0[i]
 *         if idx == -1:             # <<<<<<<<<<<<<<
 *             for j from 0 <= j < k:
 *                 out[i, j] = fv
 */
    __pyx_t_7 = ((__pyx_v_idx == -1) != 0);
    if (__pyx_t_7) {

      /* "pandas/src/generated.pyx":4234
 *         idx = idx0[i]
 *         if idx == -1:
 *             for j from 0 <= j < k:             # <<<<<<<<<<<<<<
 *                 out[i, j] = fv
 *         else:
 */
      __pyx_t_8 = __pyx_v_k;
      for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_8; __pyx_v_j++) {

        /* "pandas/src/generated.pyx":4235
 *         if idx == -1:
 *             for j from 0 <= j < k:
 *                 out[i, j] = fv             # <<<<<<<<<<<<<<
 *         else:
 *             for j from 0 <= j < k:
 */
        __pyx_t_9 = __pyx_v_i;
        __pyx_t_10 = __pyx_v_j;
        *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_9, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_10, __pyx_pybuffernd_out.diminfo[1].strides) = __pyx_v_fv;
      }
      goto __pyx_L5;
    }
    /*else*/ {

      /* "pandas/src/generated.pyx":4237
 *                 out[i, j] = fv
 *         else:
 *             for j from 0 <= j < k:             # <<<<<<<<<<<<<<
 *                 if idx1[j] == -1:
 *                     out[i, j] = fv
 */
      __pyx_t_8 = __pyx_v_k;
      for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_8; __pyx_v_j++) {

        /* "pandas/src/generated.pyx":4238
 *         else:
 *             for j from 0 <= j < k:
 *                 if idx1[j] == -1:             # <<<<<<<<<<<<<<
 *                     out[i, j] = fv
 *                 else:
 */
        __pyx_t_11 = __pyx_v_j;
        __pyx_t_7 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_idx1.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_idx1.diminfo[0].strides)) == -1) != 0);
        if (__pyx_t_7) {

          /* "pandas/src/generated.pyx":4239
 *             for j from 0 <= j < k:
 *                 if idx1[j] == -1:
 *                     out[i, j] = fv             # <<<<<<<<<<<<<<
 *                 else:
 *                     out[i, j] = values[idx, idx1[j]]
 */
          __pyx_t_12 = __pyx_v_i;
          __pyx_t_13 = __pyx_v_j;
          *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_12, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_13, __pyx_pybuffernd_out.diminfo[1].strides) = __pyx_v_fv;
          goto __pyx_L10;
        }
        /*else*/ {

          /* "pandas/src/generated.pyx":4241
 *                     out[i, j] = fv
 *                 else:
 *                     out[i, j] = values[idx, idx1[j]]             # <<<<<<<<<<<<<<
 * 
 * @cython.wraparound(False)
 */
          __pyx_t_14 = __pyx_v_j;
          __pyx_t_15 = __pyx_v_idx;
          __pyx_t_16 = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_idx1.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_idx1.diminfo[0].strides));
          __pyx_t_17 = __pyx_v_i;
          __pyx_t_18 = __pyx_v_j;
          *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_18, __pyx_pybuffernd_out.diminfo[1].strides) = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_values.diminfo[0].strides, __pyx_t_16, __pyx_pybuffernd_values.diminfo[1].strides));
        }
        __pyx_L10:;
      }
    }
    __pyx_L5:;
  }

  /* "pandas/src/generated.pyx":4217
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def take_2d_multi_int32_int32(ndarray[int32_t, ndim=2] values,             # <<<<<<<<<<<<<<
 *                                     indexer,
 *                                     ndarray[int32_t, ndim=2] out,
 */

  /* function exit code */
  __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_pybuffernd_idx0.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_idx1.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas.algos.take_2d_multi_int32_int32", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_idx0.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_idx1.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer);
  __pyx_L2:;
  __Pyx_XDECREF((PyObject *)__pyx_v_idx0);
  __Pyx_XDECREF((PyObject *)__pyx_v_idx1);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/src/generated.pyx":4245
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def take_2d_multi_int32_int64(ndarray[int32_t, ndim=2] values,             # <<<<<<<<<<<<<<
 *                                     indexer,
 *                                     ndarray[int64_t, ndim=2] out,
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pandas_5algos_359take_2d_multi_int32_int64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_5algos_359take_2d_multi_int32_int64 = {__Pyx_NAMESTR("take_2d_multi_int32_int64"), (PyCFunction)__pyx_pw_6pandas_5algos_359take_2d_multi_int32_int64, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pw_6pandas_5algos_359take_2d_multi_int32_int64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyArrayObject *__pyx_v_values = 0;
  PyObject *__pyx_v_indexer = 0;
  PyArrayObject *__pyx_v_out = 0;
  PyObject *__pyx_v_fill_value = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("take_2d_multi_int32_int64 (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_values,&__pyx_n_s_indexer,&__pyx_n_s_out,&__pyx_n_s_fill_value,0};
    PyObject* values[4] = {0,0,0,0};
    values[3] = __pyx_k__184;
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_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 (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_indexer)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("take_2d_multi_int32_int64", 0, 3, 4, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4245; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_out)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("take_2d_multi_int32_int64", 0, 3, 4, 2); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4245; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  3:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_fill_value);
          if (value) { values[3] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "take_2d_multi_int32_int64") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4245; __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_values = ((PyArrayObject *)values[0]);
    __pyx_v_indexer = values[1];
    __pyx_v_out = ((PyArrayObject *)values[2]);
    __pyx_v_fill_value = values[3];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("take_2d_multi_int32_int64", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4245; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas.algos.take_2d_multi_int32_int64", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4245; __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[2]; __pyx_lineno = 4247; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_358take_2d_multi_int32_int64(__pyx_self, __pyx_v_values, __pyx_v_indexer, __pyx_v_out, __pyx_v_fill_value);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pandas_5algos_358take_2d_multi_int32_int64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, PyObject *__pyx_v_indexer, PyArrayObject *__pyx_v_out, PyObject *__pyx_v_fill_value) {
  Py_ssize_t __pyx_v_i;
  Py_ssize_t __pyx_v_j;
  Py_ssize_t __pyx_v_k;
  Py_ssize_t __pyx_v_n;
  Py_ssize_t __pyx_v_idx;
  PyArrayObject *__pyx_v_idx0 = 0;
  PyArrayObject *__pyx_v_idx1 = 0;
  __pyx_t_5numpy_int64_t __pyx_v_fv;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_idx0;
  __Pyx_Buffer __pyx_pybuffer_idx0;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_idx1;
  __Pyx_Buffer __pyx_pybuffer_idx1;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_out;
  __Pyx_Buffer __pyx_pybuffer_out;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_values;
  __Pyx_Buffer __pyx_pybuffer_values;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyArrayObject *__pyx_t_2 = NULL;
  PyArrayObject *__pyx_t_3 = NULL;
  Py_ssize_t __pyx_t_4;
  __pyx_t_5numpy_int64_t __pyx_t_5;
  Py_ssize_t __pyx_t_6;
  int __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;
  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;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("take_2d_multi_int32_int64", 0);
  __pyx_pybuffer_idx0.pybuffer.buf = NULL;
  __pyx_pybuffer_idx0.refcount = 0;
  __pyx_pybuffernd_idx0.data = NULL;
  __pyx_pybuffernd_idx0.rcbuffer = &__pyx_pybuffer_idx0;
  __pyx_pybuffer_idx1.pybuffer.buf = NULL;
  __pyx_pybuffer_idx1.refcount = 0;
  __pyx_pybuffernd_idx1.data = NULL;
  __pyx_pybuffernd_idx1.rcbuffer = &__pyx_pybuffer_idx1;
  __pyx_pybuffer_values.pybuffer.buf = NULL;
  __pyx_pybuffer_values.refcount = 0;
  __pyx_pybuffernd_values.data = NULL;
  __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values;
  __pyx_pybuffer_out.pybuffer.buf = NULL;
  __pyx_pybuffer_out.refcount = 0;
  __pyx_pybuffernd_out.data = NULL;
  __pyx_pybuffernd_out.rcbuffer = &__pyx_pybuffer_out;
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4245; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_values.diminfo[1].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_values.diminfo[1].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[1];
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_out.rcbuffer->pybuffer, (PyObject*)__pyx_v_out, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4245; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_out.diminfo[0].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_out.diminfo[0].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_out.diminfo[1].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_out.diminfo[1].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[1];

  /* "pandas/src/generated.pyx":4251
 *     cdef:
 *         Py_ssize_t i, j, k, n, idx
 *         ndarray[int64_t] idx0 = indexer[0]             # <<<<<<<<<<<<<<
 *         ndarray[int64_t] idx1 = indexer[1]
 *         int64_t fv
 */
  __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_indexer, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4251; __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[2]; __pyx_lineno = 4251; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_2 = ((PyArrayObject *)__pyx_t_1);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_idx0.rcbuffer->pybuffer, (PyObject*)__pyx_t_2, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
      __pyx_v_idx0 = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_idx0.rcbuffer->pybuffer.buf = NULL;
      {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4251; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    } else {__pyx_pybuffernd_idx0.diminfo[0].strides = __pyx_pybuffernd_idx0.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_idx0.diminfo[0].shape = __pyx_pybuffernd_idx0.rcbuffer->pybuffer.shape[0];
    }
  }
  __pyx_t_2 = 0;
  __pyx_v_idx0 = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pandas/src/generated.pyx":4252
 *         Py_ssize_t i, j, k, n, idx
 *         ndarray[int64_t] idx0 = indexer[0]
 *         ndarray[int64_t] idx1 = indexer[1]             # <<<<<<<<<<<<<<
 *         int64_t fv
 * 
 */
  __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_indexer, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4252; __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[2]; __pyx_lineno = 4252; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_3 = ((PyArrayObject *)__pyx_t_1);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_idx1.rcbuffer->pybuffer, (PyObject*)__pyx_t_3, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
      __pyx_v_idx1 = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_idx1.rcbuffer->pybuffer.buf = NULL;
      {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4252; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    } else {__pyx_pybuffernd_idx1.diminfo[0].strides = __pyx_pybuffernd_idx1.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_idx1.diminfo[0].shape = __pyx_pybuffernd_idx1.rcbuffer->pybuffer.shape[0];
    }
  }
  __pyx_t_3 = 0;
  __pyx_v_idx1 = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pandas/src/generated.pyx":4255
 *         int64_t fv
 * 
 *     n = len(idx0)             # <<<<<<<<<<<<<<
 *     k = len(idx1)
 * 
 */
  __pyx_t_4 = PyObject_Length(((PyObject *)__pyx_v_idx0)); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4255; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_n = __pyx_t_4;

  /* "pandas/src/generated.pyx":4256
 * 
 *     n = len(idx0)
 *     k = len(idx1)             # <<<<<<<<<<<<<<
 * 
 *     fv = fill_value
 */
  __pyx_t_4 = PyObject_Length(((PyObject *)__pyx_v_idx1)); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4256; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_k = __pyx_t_4;

  /* "pandas/src/generated.pyx":4258
 *     k = len(idx1)
 * 
 *     fv = fill_value             # <<<<<<<<<<<<<<
 *     for i from 0 <= i < n:
 *         idx = idx0[i]
 */
  __pyx_t_5 = __Pyx_PyInt_As_npy_int64(__pyx_v_fill_value); if (unlikely((__pyx_t_5 == (npy_int64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4258; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_fv = __pyx_t_5;

  /* "pandas/src/generated.pyx":4259
 * 
 *     fv = fill_value
 *     for i from 0 <= i < n:             # <<<<<<<<<<<<<<
 *         idx = idx0[i]
 *         if idx == -1:
 */
  __pyx_t_4 = __pyx_v_n;
  for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_4; __pyx_v_i++) {

    /* "pandas/src/generated.pyx":4260
 *     fv = fill_value
 *     for i from 0 <= i < n:
 *         idx = idx0[i]             # <<<<<<<<<<<<<<
 *         if idx == -1:
 *             for j from 0 <= j < k:
 */
    __pyx_t_6 = __pyx_v_i;
    __pyx_v_idx = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_idx0.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_idx0.diminfo[0].strides));

    /* "pandas/src/generated.pyx":4261
 *     for i from 0 <= i < n:
 *         idx = idx0[i]
 *         if idx == -1:             # <<<<<<<<<<<<<<
 *             for j from 0 <= j < k:
 *                 out[i, j] = fv
 */
    __pyx_t_7 = ((__pyx_v_idx == -1) != 0);
    if (__pyx_t_7) {

      /* "pandas/src/generated.pyx":4262
 *         idx = idx0[i]
 *         if idx == -1:
 *             for j from 0 <= j < k:             # <<<<<<<<<<<<<<
 *                 out[i, j] = fv
 *         else:
 */
      __pyx_t_8 = __pyx_v_k;
      for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_8; __pyx_v_j++) {

        /* "pandas/src/generated.pyx":4263
 *         if idx == -1:
 *             for j from 0 <= j < k:
 *                 out[i, j] = fv             # <<<<<<<<<<<<<<
 *         else:
 *             for j from 0 <= j < k:
 */
        __pyx_t_9 = __pyx_v_i;
        __pyx_t_10 = __pyx_v_j;
        *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_9, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_10, __pyx_pybuffernd_out.diminfo[1].strides) = __pyx_v_fv;
      }
      goto __pyx_L5;
    }
    /*else*/ {

      /* "pandas/src/generated.pyx":4265
 *                 out[i, j] = fv
 *         else:
 *             for j from 0 <= j < k:             # <<<<<<<<<<<<<<
 *                 if idx1[j] == -1:
 *                     out[i, j] = fv
 */
      __pyx_t_8 = __pyx_v_k;
      for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_8; __pyx_v_j++) {

        /* "pandas/src/generated.pyx":4266
 *         else:
 *             for j from 0 <= j < k:
 *                 if idx1[j] == -1:             # <<<<<<<<<<<<<<
 *                     out[i, j] = fv
 *                 else:
 */
        __pyx_t_11 = __pyx_v_j;
        __pyx_t_7 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_idx1.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_idx1.diminfo[0].strides)) == -1) != 0);
        if (__pyx_t_7) {

          /* "pandas/src/generated.pyx":4267
 *             for j from 0 <= j < k:
 *                 if idx1[j] == -1:
 *                     out[i, j] = fv             # <<<<<<<<<<<<<<
 *                 else:
 *                     out[i, j] = values[idx, idx1[j]]
 */
          __pyx_t_12 = __pyx_v_i;
          __pyx_t_13 = __pyx_v_j;
          *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_12, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_13, __pyx_pybuffernd_out.diminfo[1].strides) = __pyx_v_fv;
          goto __pyx_L10;
        }
        /*else*/ {

          /* "pandas/src/generated.pyx":4269
 *                     out[i, j] = fv
 *                 else:
 *                     out[i, j] = values[idx, idx1[j]]             # <<<<<<<<<<<<<<
 * 
 * @cython.wraparound(False)
 */
          __pyx_t_14 = __pyx_v_j;
          __pyx_t_15 = __pyx_v_idx;
          __pyx_t_5 = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_idx1.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_idx1.diminfo[0].strides));
          __pyx_t_16 = __pyx_v_i;
          __pyx_t_17 = __pyx_v_j;
          *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_17, __pyx_pybuffernd_out.diminfo[1].strides) = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_values.diminfo[0].strides, __pyx_t_5, __pyx_pybuffernd_values.diminfo[1].strides));
        }
        __pyx_L10:;
      }
    }
    __pyx_L5:;
  }

  /* "pandas/src/generated.pyx":4245
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def take_2d_multi_int32_int64(ndarray[int32_t, ndim=2] values,             # <<<<<<<<<<<<<<
 *                                     indexer,
 *                                     ndarray[int64_t, ndim=2] out,
 */

  /* function exit code */
  __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_pybuffernd_idx0.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_idx1.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas.algos.take_2d_multi_int32_int64", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_idx0.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_idx1.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer);
  __pyx_L2:;
  __Pyx_XDECREF((PyObject *)__pyx_v_idx0);
  __Pyx_XDECREF((PyObject *)__pyx_v_idx1);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/src/generated.pyx":4273
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def take_2d_multi_int32_float64(ndarray[int32_t, ndim=2] values,             # <<<<<<<<<<<<<<
 *                                     indexer,
 *                                     ndarray[float64_t, ndim=2] out,
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pandas_5algos_361take_2d_multi_int32_float64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_5algos_361take_2d_multi_int32_float64 = {__Pyx_NAMESTR("take_2d_multi_int32_float64"), (PyCFunction)__pyx_pw_6pandas_5algos_361take_2d_multi_int32_float64, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pw_6pandas_5algos_361take_2d_multi_int32_float64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyArrayObject *__pyx_v_values = 0;
  PyObject *__pyx_v_indexer = 0;
  PyArrayObject *__pyx_v_out = 0;
  PyObject *__pyx_v_fill_value = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("take_2d_multi_int32_float64 (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_values,&__pyx_n_s_indexer,&__pyx_n_s_out,&__pyx_n_s_fill_value,0};
    PyObject* values[4] = {0,0,0,0};
    values[3] = __pyx_k__185;
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_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 (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_indexer)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("take_2d_multi_int32_float64", 0, 3, 4, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4273; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_out)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("take_2d_multi_int32_float64", 0, 3, 4, 2); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4273; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  3:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_fill_value);
          if (value) { values[3] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "take_2d_multi_int32_float64") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4273; __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_values = ((PyArrayObject *)values[0]);
    __pyx_v_indexer = values[1];
    __pyx_v_out = ((PyArrayObject *)values[2]);
    __pyx_v_fill_value = values[3];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("take_2d_multi_int32_float64", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4273; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas.algos.take_2d_multi_int32_float64", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4273; __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[2]; __pyx_lineno = 4275; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_360take_2d_multi_int32_float64(__pyx_self, __pyx_v_values, __pyx_v_indexer, __pyx_v_out, __pyx_v_fill_value);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pandas_5algos_360take_2d_multi_int32_float64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, PyObject *__pyx_v_indexer, PyArrayObject *__pyx_v_out, PyObject *__pyx_v_fill_value) {
  Py_ssize_t __pyx_v_i;
  Py_ssize_t __pyx_v_j;
  Py_ssize_t __pyx_v_k;
  Py_ssize_t __pyx_v_n;
  Py_ssize_t __pyx_v_idx;
  PyArrayObject *__pyx_v_idx0 = 0;
  PyArrayObject *__pyx_v_idx1 = 0;
  __pyx_t_5numpy_float64_t __pyx_v_fv;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_idx0;
  __Pyx_Buffer __pyx_pybuffer_idx0;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_idx1;
  __Pyx_Buffer __pyx_pybuffer_idx1;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_out;
  __Pyx_Buffer __pyx_pybuffer_out;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_values;
  __Pyx_Buffer __pyx_pybuffer_values;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyArrayObject *__pyx_t_2 = NULL;
  PyArrayObject *__pyx_t_3 = NULL;
  Py_ssize_t __pyx_t_4;
  __pyx_t_5numpy_float64_t __pyx_t_5;
  Py_ssize_t __pyx_t_6;
  int __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;
  Py_ssize_t __pyx_t_12;
  Py_ssize_t __pyx_t_13;
  Py_ssize_t __pyx_t_14;
  Py_ssize_t __pyx_t_15;
  __pyx_t_5numpy_int64_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("take_2d_multi_int32_float64", 0);
  __pyx_pybuffer_idx0.pybuffer.buf = NULL;
  __pyx_pybuffer_idx0.refcount = 0;
  __pyx_pybuffernd_idx0.data = NULL;
  __pyx_pybuffernd_idx0.rcbuffer = &__pyx_pybuffer_idx0;
  __pyx_pybuffer_idx1.pybuffer.buf = NULL;
  __pyx_pybuffer_idx1.refcount = 0;
  __pyx_pybuffernd_idx1.data = NULL;
  __pyx_pybuffernd_idx1.rcbuffer = &__pyx_pybuffer_idx1;
  __pyx_pybuffer_values.pybuffer.buf = NULL;
  __pyx_pybuffer_values.refcount = 0;
  __pyx_pybuffernd_values.data = NULL;
  __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values;
  __pyx_pybuffer_out.pybuffer.buf = NULL;
  __pyx_pybuffer_out.refcount = 0;
  __pyx_pybuffernd_out.data = NULL;
  __pyx_pybuffernd_out.rcbuffer = &__pyx_pybuffer_out;
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4273; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_values.diminfo[1].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_values.diminfo[1].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[1];
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_out.rcbuffer->pybuffer, (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[2]; __pyx_lineno = 4273; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_out.diminfo[0].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_out.diminfo[0].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_out.diminfo[1].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_out.diminfo[1].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[1];

  /* "pandas/src/generated.pyx":4279
 *     cdef:
 *         Py_ssize_t i, j, k, n, idx
 *         ndarray[int64_t] idx0 = indexer[0]             # <<<<<<<<<<<<<<
 *         ndarray[int64_t] idx1 = indexer[1]
 *         float64_t fv
 */
  __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_indexer, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4279; __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[2]; __pyx_lineno = 4279; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_2 = ((PyArrayObject *)__pyx_t_1);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_idx0.rcbuffer->pybuffer, (PyObject*)__pyx_t_2, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
      __pyx_v_idx0 = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_idx0.rcbuffer->pybuffer.buf = NULL;
      {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4279; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    } else {__pyx_pybuffernd_idx0.diminfo[0].strides = __pyx_pybuffernd_idx0.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_idx0.diminfo[0].shape = __pyx_pybuffernd_idx0.rcbuffer->pybuffer.shape[0];
    }
  }
  __pyx_t_2 = 0;
  __pyx_v_idx0 = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pandas/src/generated.pyx":4280
 *         Py_ssize_t i, j, k, n, idx
 *         ndarray[int64_t] idx0 = indexer[0]
 *         ndarray[int64_t] idx1 = indexer[1]             # <<<<<<<<<<<<<<
 *         float64_t fv
 * 
 */
  __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_indexer, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4280; __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[2]; __pyx_lineno = 4280; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_3 = ((PyArrayObject *)__pyx_t_1);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_idx1.rcbuffer->pybuffer, (PyObject*)__pyx_t_3, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
      __pyx_v_idx1 = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_idx1.rcbuffer->pybuffer.buf = NULL;
      {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4280; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    } else {__pyx_pybuffernd_idx1.diminfo[0].strides = __pyx_pybuffernd_idx1.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_idx1.diminfo[0].shape = __pyx_pybuffernd_idx1.rcbuffer->pybuffer.shape[0];
    }
  }
  __pyx_t_3 = 0;
  __pyx_v_idx1 = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pandas/src/generated.pyx":4283
 *         float64_t fv
 * 
 *     n = len(idx0)             # <<<<<<<<<<<<<<
 *     k = len(idx1)
 * 
 */
  __pyx_t_4 = PyObject_Length(((PyObject *)__pyx_v_idx0)); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4283; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_n = __pyx_t_4;

  /* "pandas/src/generated.pyx":4284
 * 
 *     n = len(idx0)
 *     k = len(idx1)             # <<<<<<<<<<<<<<
 * 
 *     fv = fill_value
 */
  __pyx_t_4 = PyObject_Length(((PyObject *)__pyx_v_idx1)); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4284; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_k = __pyx_t_4;

  /* "pandas/src/generated.pyx":4286
 *     k = len(idx1)
 * 
 *     fv = fill_value             # <<<<<<<<<<<<<<
 *     for i from 0 <= i < n:
 *         idx = idx0[i]
 */
  __pyx_t_5 = __pyx_PyFloat_AsDouble(__pyx_v_fill_value); if (unlikely((__pyx_t_5 == (npy_float64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4286; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_fv = __pyx_t_5;

  /* "pandas/src/generated.pyx":4287
 * 
 *     fv = fill_value
 *     for i from 0 <= i < n:             # <<<<<<<<<<<<<<
 *         idx = idx0[i]
 *         if idx == -1:
 */
  __pyx_t_4 = __pyx_v_n;
  for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_4; __pyx_v_i++) {

    /* "pandas/src/generated.pyx":4288
 *     fv = fill_value
 *     for i from 0 <= i < n:
 *         idx = idx0[i]             # <<<<<<<<<<<<<<
 *         if idx == -1:
 *             for j from 0 <= j < k:
 */
    __pyx_t_6 = __pyx_v_i;
    __pyx_v_idx = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_idx0.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_idx0.diminfo[0].strides));

    /* "pandas/src/generated.pyx":4289
 *     for i from 0 <= i < n:
 *         idx = idx0[i]
 *         if idx == -1:             # <<<<<<<<<<<<<<
 *             for j from 0 <= j < k:
 *                 out[i, j] = fv
 */
    __pyx_t_7 = ((__pyx_v_idx == -1) != 0);
    if (__pyx_t_7) {

      /* "pandas/src/generated.pyx":4290
 *         idx = idx0[i]
 *         if idx == -1:
 *             for j from 0 <= j < k:             # <<<<<<<<<<<<<<
 *                 out[i, j] = fv
 *         else:
 */
      __pyx_t_8 = __pyx_v_k;
      for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_8; __pyx_v_j++) {

        /* "pandas/src/generated.pyx":4291
 *         if idx == -1:
 *             for j from 0 <= j < k:
 *                 out[i, j] = fv             # <<<<<<<<<<<<<<
 *         else:
 *             for j from 0 <= j < k:
 */
        __pyx_t_9 = __pyx_v_i;
        __pyx_t_10 = __pyx_v_j;
        *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_9, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_10, __pyx_pybuffernd_out.diminfo[1].strides) = __pyx_v_fv;
      }
      goto __pyx_L5;
    }
    /*else*/ {

      /* "pandas/src/generated.pyx":4293
 *                 out[i, j] = fv
 *         else:
 *             for j from 0 <= j < k:             # <<<<<<<<<<<<<<
 *                 if idx1[j] == -1:
 *                     out[i, j] = fv
 */
      __pyx_t_8 = __pyx_v_k;
      for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_8; __pyx_v_j++) {

        /* "pandas/src/generated.pyx":4294
 *         else:
 *             for j from 0 <= j < k:
 *                 if idx1[j] == -1:             # <<<<<<<<<<<<<<
 *                     out[i, j] = fv
 *                 else:
 */
        __pyx_t_11 = __pyx_v_j;
        __pyx_t_7 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_idx1.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_idx1.diminfo[0].strides)) == -1) != 0);
        if (__pyx_t_7) {

          /* "pandas/src/generated.pyx":4295
 *             for j from 0 <= j < k:
 *                 if idx1[j] == -1:
 *                     out[i, j] = fv             # <<<<<<<<<<<<<<
 *                 else:
 *                     out[i, j] = values[idx, idx1[j]]
 */
          __pyx_t_12 = __pyx_v_i;
          __pyx_t_13 = __pyx_v_j;
          *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_12, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_13, __pyx_pybuffernd_out.diminfo[1].strides) = __pyx_v_fv;
          goto __pyx_L10;
        }
        /*else*/ {

          /* "pandas/src/generated.pyx":4297
 *                     out[i, j] = fv
 *                 else:
 *                     out[i, j] = values[idx, idx1[j]]             # <<<<<<<<<<<<<<
 * 
 * @cython.wraparound(False)
 */
          __pyx_t_14 = __pyx_v_j;
          __pyx_t_15 = __pyx_v_idx;
          __pyx_t_16 = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_idx1.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_idx1.diminfo[0].strides));
          __pyx_t_17 = __pyx_v_i;
          __pyx_t_18 = __pyx_v_j;
          *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_18, __pyx_pybuffernd_out.diminfo[1].strides) = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_values.diminfo[0].strides, __pyx_t_16, __pyx_pybuffernd_values.diminfo[1].strides));
        }
        __pyx_L10:;
      }
    }
    __pyx_L5:;
  }

  /* "pandas/src/generated.pyx":4273
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def take_2d_multi_int32_float64(ndarray[int32_t, ndim=2] values,             # <<<<<<<<<<<<<<
 *                                     indexer,
 *                                     ndarray[float64_t, ndim=2] out,
 */

  /* function exit code */
  __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_pybuffernd_idx0.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_idx1.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas.algos.take_2d_multi_int32_float64", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_idx0.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_idx1.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer);
  __pyx_L2:;
  __Pyx_XDECREF((PyObject *)__pyx_v_idx0);
  __Pyx_XDECREF((PyObject *)__pyx_v_idx1);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/src/generated.pyx":4301
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def take_2d_multi_int64_int64(ndarray[int64_t, ndim=2] values,             # <<<<<<<<<<<<<<
 *                                     indexer,
 *                                     ndarray[int64_t, ndim=2] out,
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pandas_5algos_363take_2d_multi_int64_int64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_5algos_363take_2d_multi_int64_int64 = {__Pyx_NAMESTR("take_2d_multi_int64_int64"), (PyCFunction)__pyx_pw_6pandas_5algos_363take_2d_multi_int64_int64, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pw_6pandas_5algos_363take_2d_multi_int64_int64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyArrayObject *__pyx_v_values = 0;
  PyObject *__pyx_v_indexer = 0;
  PyArrayObject *__pyx_v_out = 0;
  PyObject *__pyx_v_fill_value = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("take_2d_multi_int64_int64 (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_values,&__pyx_n_s_indexer,&__pyx_n_s_out,&__pyx_n_s_fill_value,0};
    PyObject* values[4] = {0,0,0,0};
    values[3] = __pyx_k__186;
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_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 (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_indexer)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("take_2d_multi_int64_int64", 0, 3, 4, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4301; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_out)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("take_2d_multi_int64_int64", 0, 3, 4, 2); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4301; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  3:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_fill_value);
          if (value) { values[3] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "take_2d_multi_int64_int64") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4301; __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_values = ((PyArrayObject *)values[0]);
    __pyx_v_indexer = values[1];
    __pyx_v_out = ((PyArrayObject *)values[2]);
    __pyx_v_fill_value = values[3];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("take_2d_multi_int64_int64", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4301; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas.algos.take_2d_multi_int64_int64", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4301; __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[2]; __pyx_lineno = 4303; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_362take_2d_multi_int64_int64(__pyx_self, __pyx_v_values, __pyx_v_indexer, __pyx_v_out, __pyx_v_fill_value);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pandas_5algos_362take_2d_multi_int64_int64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, PyObject *__pyx_v_indexer, PyArrayObject *__pyx_v_out, PyObject *__pyx_v_fill_value) {
  Py_ssize_t __pyx_v_i;
  Py_ssize_t __pyx_v_j;
  Py_ssize_t __pyx_v_k;
  Py_ssize_t __pyx_v_n;
  Py_ssize_t __pyx_v_idx;
  PyArrayObject *__pyx_v_idx0 = 0;
  PyArrayObject *__pyx_v_idx1 = 0;
  __pyx_t_5numpy_int64_t __pyx_v_fv;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_idx0;
  __Pyx_Buffer __pyx_pybuffer_idx0;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_idx1;
  __Pyx_Buffer __pyx_pybuffer_idx1;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_out;
  __Pyx_Buffer __pyx_pybuffer_out;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_values;
  __Pyx_Buffer __pyx_pybuffer_values;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyArrayObject *__pyx_t_2 = NULL;
  PyArrayObject *__pyx_t_3 = NULL;
  Py_ssize_t __pyx_t_4;
  __pyx_t_5numpy_int64_t __pyx_t_5;
  Py_ssize_t __pyx_t_6;
  int __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;
  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;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("take_2d_multi_int64_int64", 0);
  __pyx_pybuffer_idx0.pybuffer.buf = NULL;
  __pyx_pybuffer_idx0.refcount = 0;
  __pyx_pybuffernd_idx0.data = NULL;
  __pyx_pybuffernd_idx0.rcbuffer = &__pyx_pybuffer_idx0;
  __pyx_pybuffer_idx1.pybuffer.buf = NULL;
  __pyx_pybuffer_idx1.refcount = 0;
  __pyx_pybuffernd_idx1.data = NULL;
  __pyx_pybuffernd_idx1.rcbuffer = &__pyx_pybuffer_idx1;
  __pyx_pybuffer_values.pybuffer.buf = NULL;
  __pyx_pybuffer_values.refcount = 0;
  __pyx_pybuffernd_values.data = NULL;
  __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values;
  __pyx_pybuffer_out.pybuffer.buf = NULL;
  __pyx_pybuffer_out.refcount = 0;
  __pyx_pybuffernd_out.data = NULL;
  __pyx_pybuffernd_out.rcbuffer = &__pyx_pybuffer_out;
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (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[2]; __pyx_lineno = 4301; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_values.diminfo[1].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_values.diminfo[1].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[1];
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_out.rcbuffer->pybuffer, (PyObject*)__pyx_v_out, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4301; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_out.diminfo[0].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_out.diminfo[0].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_out.diminfo[1].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_out.diminfo[1].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[1];

  /* "pandas/src/generated.pyx":4307
 *     cdef:
 *         Py_ssize_t i, j, k, n, idx
 *         ndarray[int64_t] idx0 = indexer[0]             # <<<<<<<<<<<<<<
 *         ndarray[int64_t] idx1 = indexer[1]
 *         int64_t fv
 */
  __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_indexer, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4307; __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[2]; __pyx_lineno = 4307; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_2 = ((PyArrayObject *)__pyx_t_1);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_idx0.rcbuffer->pybuffer, (PyObject*)__pyx_t_2, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
      __pyx_v_idx0 = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_idx0.rcbuffer->pybuffer.buf = NULL;
      {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4307; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    } else {__pyx_pybuffernd_idx0.diminfo[0].strides = __pyx_pybuffernd_idx0.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_idx0.diminfo[0].shape = __pyx_pybuffernd_idx0.rcbuffer->pybuffer.shape[0];
    }
  }
  __pyx_t_2 = 0;
  __pyx_v_idx0 = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pandas/src/generated.pyx":4308
 *         Py_ssize_t i, j, k, n, idx
 *         ndarray[int64_t] idx0 = indexer[0]
 *         ndarray[int64_t] idx1 = indexer[1]             # <<<<<<<<<<<<<<
 *         int64_t fv
 * 
 */
  __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_indexer, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4308; __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[2]; __pyx_lineno = 4308; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_3 = ((PyArrayObject *)__pyx_t_1);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_idx1.rcbuffer->pybuffer, (PyObject*)__pyx_t_3, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
      __pyx_v_idx1 = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_idx1.rcbuffer->pybuffer.buf = NULL;
      {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4308; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    } else {__pyx_pybuffernd_idx1.diminfo[0].strides = __pyx_pybuffernd_idx1.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_idx1.diminfo[0].shape = __pyx_pybuffernd_idx1.rcbuffer->pybuffer.shape[0];
    }
  }
  __pyx_t_3 = 0;
  __pyx_v_idx1 = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pandas/src/generated.pyx":4311
 *         int64_t fv
 * 
 *     n = len(idx0)             # <<<<<<<<<<<<<<
 *     k = len(idx1)
 * 
 */
  __pyx_t_4 = PyObject_Length(((PyObject *)__pyx_v_idx0)); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4311; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_n = __pyx_t_4;

  /* "pandas/src/generated.pyx":4312
 * 
 *     n = len(idx0)
 *     k = len(idx1)             # <<<<<<<<<<<<<<
 * 
 *     fv = fill_value
 */
  __pyx_t_4 = PyObject_Length(((PyObject *)__pyx_v_idx1)); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4312; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_k = __pyx_t_4;

  /* "pandas/src/generated.pyx":4314
 *     k = len(idx1)
 * 
 *     fv = fill_value             # <<<<<<<<<<<<<<
 *     for i from 0 <= i < n:
 *         idx = idx0[i]
 */
  __pyx_t_5 = __Pyx_PyInt_As_npy_int64(__pyx_v_fill_value); if (unlikely((__pyx_t_5 == (npy_int64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4314; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_fv = __pyx_t_5;

  /* "pandas/src/generated.pyx":4315
 * 
 *     fv = fill_value
 *     for i from 0 <= i < n:             # <<<<<<<<<<<<<<
 *         idx = idx0[i]
 *         if idx == -1:
 */
  __pyx_t_4 = __pyx_v_n;
  for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_4; __pyx_v_i++) {

    /* "pandas/src/generated.pyx":4316
 *     fv = fill_value
 *     for i from 0 <= i < n:
 *         idx = idx0[i]             # <<<<<<<<<<<<<<
 *         if idx == -1:
 *             for j from 0 <= j < k:
 */
    __pyx_t_6 = __pyx_v_i;
    __pyx_v_idx = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_idx0.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_idx0.diminfo[0].strides));

    /* "pandas/src/generated.pyx":4317
 *     for i from 0 <= i < n:
 *         idx = idx0[i]
 *         if idx == -1:             # <<<<<<<<<<<<<<
 *             for j from 0 <= j < k:
 *                 out[i, j] = fv
 */
    __pyx_t_7 = ((__pyx_v_idx == -1) != 0);
    if (__pyx_t_7) {

      /* "pandas/src/generated.pyx":4318
 *         idx = idx0[i]
 *         if idx == -1:
 *             for j from 0 <= j < k:             # <<<<<<<<<<<<<<
 *                 out[i, j] = fv
 *         else:
 */
      __pyx_t_8 = __pyx_v_k;
      for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_8; __pyx_v_j++) {

        /* "pandas/src/generated.pyx":4319
 *         if idx == -1:
 *             for j from 0 <= j < k:
 *                 out[i, j] = fv             # <<<<<<<<<<<<<<
 *         else:
 *             for j from 0 <= j < k:
 */
        __pyx_t_9 = __pyx_v_i;
        __pyx_t_10 = __pyx_v_j;
        *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_9, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_10, __pyx_pybuffernd_out.diminfo[1].strides) = __pyx_v_fv;
      }
      goto __pyx_L5;
    }
    /*else*/ {

      /* "pandas/src/generated.pyx":4321
 *                 out[i, j] = fv
 *         else:
 *             for j from 0 <= j < k:             # <<<<<<<<<<<<<<
 *                 if idx1[j] == -1:
 *                     out[i, j] = fv
 */
      __pyx_t_8 = __pyx_v_k;
      for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_8; __pyx_v_j++) {

        /* "pandas/src/generated.pyx":4322
 *         else:
 *             for j from 0 <= j < k:
 *                 if idx1[j] == -1:             # <<<<<<<<<<<<<<
 *                     out[i, j] = fv
 *                 else:
 */
        __pyx_t_11 = __pyx_v_j;
        __pyx_t_7 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_idx1.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_idx1.diminfo[0].strides)) == -1) != 0);
        if (__pyx_t_7) {

          /* "pandas/src/generated.pyx":4323
 *             for j from 0 <= j < k:
 *                 if idx1[j] == -1:
 *                     out[i, j] = fv             # <<<<<<<<<<<<<<
 *                 else:
 *                     out[i, j] = values[idx, idx1[j]]
 */
          __pyx_t_12 = __pyx_v_i;
          __pyx_t_13 = __pyx_v_j;
          *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_12, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_13, __pyx_pybuffernd_out.diminfo[1].strides) = __pyx_v_fv;
          goto __pyx_L10;
        }
        /*else*/ {

          /* "pandas/src/generated.pyx":4325
 *                     out[i, j] = fv
 *                 else:
 *                     out[i, j] = values[idx, idx1[j]]             # <<<<<<<<<<<<<<
 * 
 * @cython.wraparound(False)
 */
          __pyx_t_14 = __pyx_v_j;
          __pyx_t_15 = __pyx_v_idx;
          __pyx_t_5 = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_idx1.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_idx1.diminfo[0].strides));
          __pyx_t_16 = __pyx_v_i;
          __pyx_t_17 = __pyx_v_j;
          *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_17, __pyx_pybuffernd_out.diminfo[1].strides) = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_values.diminfo[0].strides, __pyx_t_5, __pyx_pybuffernd_values.diminfo[1].strides));
        }
        __pyx_L10:;
      }
    }
    __pyx_L5:;
  }

  /* "pandas/src/generated.pyx":4301
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def take_2d_multi_int64_int64(ndarray[int64_t, ndim=2] values,             # <<<<<<<<<<<<<<
 *                                     indexer,
 *                                     ndarray[int64_t, ndim=2] out,
 */

  /* function exit code */
  __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_pybuffernd_idx0.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_idx1.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas.algos.take_2d_multi_int64_int64", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_idx0.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_idx1.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer);
  __pyx_L2:;
  __Pyx_XDECREF((PyObject *)__pyx_v_idx0);
  __Pyx_XDECREF((PyObject *)__pyx_v_idx1);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/src/generated.pyx":4329
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def take_2d_multi_int64_float64(ndarray[int64_t, ndim=2] values,             # <<<<<<<<<<<<<<
 *                                     indexer,
 *                                     ndarray[float64_t, ndim=2] out,
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pandas_5algos_365take_2d_multi_int64_float64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_5algos_365take_2d_multi_int64_float64 = {__Pyx_NAMESTR("take_2d_multi_int64_float64"), (PyCFunction)__pyx_pw_6pandas_5algos_365take_2d_multi_int64_float64, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pw_6pandas_5algos_365take_2d_multi_int64_float64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyArrayObject *__pyx_v_values = 0;
  PyObject *__pyx_v_indexer = 0;
  PyArrayObject *__pyx_v_out = 0;
  PyObject *__pyx_v_fill_value = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("take_2d_multi_int64_float64 (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_values,&__pyx_n_s_indexer,&__pyx_n_s_out,&__pyx_n_s_fill_value,0};
    PyObject* values[4] = {0,0,0,0};
    values[3] = __pyx_k__187;
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_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 (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_indexer)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("take_2d_multi_int64_float64", 0, 3, 4, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4329; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_out)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("take_2d_multi_int64_float64", 0, 3, 4, 2); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4329; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  3:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_fill_value);
          if (value) { values[3] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "take_2d_multi_int64_float64") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4329; __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_values = ((PyArrayObject *)values[0]);
    __pyx_v_indexer = values[1];
    __pyx_v_out = ((PyArrayObject *)values[2]);
    __pyx_v_fill_value = values[3];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("take_2d_multi_int64_float64", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4329; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas.algos.take_2d_multi_int64_float64", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4329; __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[2]; __pyx_lineno = 4331; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_364take_2d_multi_int64_float64(__pyx_self, __pyx_v_values, __pyx_v_indexer, __pyx_v_out, __pyx_v_fill_value);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pandas_5algos_364take_2d_multi_int64_float64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, PyObject *__pyx_v_indexer, PyArrayObject *__pyx_v_out, PyObject *__pyx_v_fill_value) {
  Py_ssize_t __pyx_v_i;
  Py_ssize_t __pyx_v_j;
  Py_ssize_t __pyx_v_k;
  Py_ssize_t __pyx_v_n;
  Py_ssize_t __pyx_v_idx;
  PyArrayObject *__pyx_v_idx0 = 0;
  PyArrayObject *__pyx_v_idx1 = 0;
  __pyx_t_5numpy_float64_t __pyx_v_fv;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_idx0;
  __Pyx_Buffer __pyx_pybuffer_idx0;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_idx1;
  __Pyx_Buffer __pyx_pybuffer_idx1;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_out;
  __Pyx_Buffer __pyx_pybuffer_out;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_values;
  __Pyx_Buffer __pyx_pybuffer_values;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyArrayObject *__pyx_t_2 = NULL;
  PyArrayObject *__pyx_t_3 = NULL;
  Py_ssize_t __pyx_t_4;
  __pyx_t_5numpy_float64_t __pyx_t_5;
  Py_ssize_t __pyx_t_6;
  int __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;
  Py_ssize_t __pyx_t_12;
  Py_ssize_t __pyx_t_13;
  Py_ssize_t __pyx_t_14;
  Py_ssize_t __pyx_t_15;
  __pyx_t_5numpy_int64_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("take_2d_multi_int64_float64", 0);
  __pyx_pybuffer_idx0.pybuffer.buf = NULL;
  __pyx_pybuffer_idx0.refcount = 0;
  __pyx_pybuffernd_idx0.data = NULL;
  __pyx_pybuffernd_idx0.rcbuffer = &__pyx_pybuffer_idx0;
  __pyx_pybuffer_idx1.pybuffer.buf = NULL;
  __pyx_pybuffer_idx1.refcount = 0;
  __pyx_pybuffernd_idx1.data = NULL;
  __pyx_pybuffernd_idx1.rcbuffer = &__pyx_pybuffer_idx1;
  __pyx_pybuffer_values.pybuffer.buf = NULL;
  __pyx_pybuffer_values.refcount = 0;
  __pyx_pybuffernd_values.data = NULL;
  __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values;
  __pyx_pybuffer_out.pybuffer.buf = NULL;
  __pyx_pybuffer_out.refcount = 0;
  __pyx_pybuffernd_out.data = NULL;
  __pyx_pybuffernd_out.rcbuffer = &__pyx_pybuffer_out;
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (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[2]; __pyx_lineno = 4329; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_values.diminfo[1].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_values.diminfo[1].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[1];
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_out.rcbuffer->pybuffer, (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[2]; __pyx_lineno = 4329; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_out.diminfo[0].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_out.diminfo[0].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_out.diminfo[1].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_out.diminfo[1].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[1];

  /* "pandas/src/generated.pyx":4335
 *     cdef:
 *         Py_ssize_t i, j, k, n, idx
 *         ndarray[int64_t] idx0 = indexer[0]             # <<<<<<<<<<<<<<
 *         ndarray[int64_t] idx1 = indexer[1]
 *         float64_t fv
 */
  __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_indexer, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4335; __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[2]; __pyx_lineno = 4335; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_2 = ((PyArrayObject *)__pyx_t_1);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_idx0.rcbuffer->pybuffer, (PyObject*)__pyx_t_2, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
      __pyx_v_idx0 = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_idx0.rcbuffer->pybuffer.buf = NULL;
      {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4335; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    } else {__pyx_pybuffernd_idx0.diminfo[0].strides = __pyx_pybuffernd_idx0.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_idx0.diminfo[0].shape = __pyx_pybuffernd_idx0.rcbuffer->pybuffer.shape[0];
    }
  }
  __pyx_t_2 = 0;
  __pyx_v_idx0 = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pandas/src/generated.pyx":4336
 *         Py_ssize_t i, j, k, n, idx
 *         ndarray[int64_t] idx0 = indexer[0]
 *         ndarray[int64_t] idx1 = indexer[1]             # <<<<<<<<<<<<<<
 *         float64_t fv
 * 
 */
  __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_indexer, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4336; __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[2]; __pyx_lineno = 4336; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_3 = ((PyArrayObject *)__pyx_t_1);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_idx1.rcbuffer->pybuffer, (PyObject*)__pyx_t_3, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
      __pyx_v_idx1 = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_idx1.rcbuffer->pybuffer.buf = NULL;
      {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4336; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    } else {__pyx_pybuffernd_idx1.diminfo[0].strides = __pyx_pybuffernd_idx1.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_idx1.diminfo[0].shape = __pyx_pybuffernd_idx1.rcbuffer->pybuffer.shape[0];
    }
  }
  __pyx_t_3 = 0;
  __pyx_v_idx1 = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pandas/src/generated.pyx":4339
 *         float64_t fv
 * 
 *     n = len(idx0)             # <<<<<<<<<<<<<<
 *     k = len(idx1)
 * 
 */
  __pyx_t_4 = PyObject_Length(((PyObject *)__pyx_v_idx0)); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4339; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_n = __pyx_t_4;

  /* "pandas/src/generated.pyx":4340
 * 
 *     n = len(idx0)
 *     k = len(idx1)             # <<<<<<<<<<<<<<
 * 
 *     fv = fill_value
 */
  __pyx_t_4 = PyObject_Length(((PyObject *)__pyx_v_idx1)); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4340; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_k = __pyx_t_4;

  /* "pandas/src/generated.pyx":4342
 *     k = len(idx1)
 * 
 *     fv = fill_value             # <<<<<<<<<<<<<<
 *     for i from 0 <= i < n:
 *         idx = idx0[i]
 */
  __pyx_t_5 = __pyx_PyFloat_AsDouble(__pyx_v_fill_value); if (unlikely((__pyx_t_5 == (npy_float64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4342; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_fv = __pyx_t_5;

  /* "pandas/src/generated.pyx":4343
 * 
 *     fv = fill_value
 *     for i from 0 <= i < n:             # <<<<<<<<<<<<<<
 *         idx = idx0[i]
 *         if idx == -1:
 */
  __pyx_t_4 = __pyx_v_n;
  for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_4; __pyx_v_i++) {

    /* "pandas/src/generated.pyx":4344
 *     fv = fill_value
 *     for i from 0 <= i < n:
 *         idx = idx0[i]             # <<<<<<<<<<<<<<
 *         if idx == -1:
 *             for j from 0 <= j < k:
 */
    __pyx_t_6 = __pyx_v_i;
    __pyx_v_idx = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_idx0.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_idx0.diminfo[0].strides));

    /* "pandas/src/generated.pyx":4345
 *     for i from 0 <= i < n:
 *         idx = idx0[i]
 *         if idx == -1:             # <<<<<<<<<<<<<<
 *             for j from 0 <= j < k:
 *                 out[i, j] = fv
 */
    __pyx_t_7 = ((__pyx_v_idx == -1) != 0);
    if (__pyx_t_7) {

      /* "pandas/src/generated.pyx":4346
 *         idx = idx0[i]
 *         if idx == -1:
 *             for j from 0 <= j < k:             # <<<<<<<<<<<<<<
 *                 out[i, j] = fv
 *         else:
 */
      __pyx_t_8 = __pyx_v_k;
      for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_8; __pyx_v_j++) {

        /* "pandas/src/generated.pyx":4347
 *         if idx == -1:
 *             for j from 0 <= j < k:
 *                 out[i, j] = fv             # <<<<<<<<<<<<<<
 *         else:
 *             for j from 0 <= j < k:
 */
        __pyx_t_9 = __pyx_v_i;
        __pyx_t_10 = __pyx_v_j;
        *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_9, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_10, __pyx_pybuffernd_out.diminfo[1].strides) = __pyx_v_fv;
      }
      goto __pyx_L5;
    }
    /*else*/ {

      /* "pandas/src/generated.pyx":4349
 *                 out[i, j] = fv
 *         else:
 *             for j from 0 <= j < k:             # <<<<<<<<<<<<<<
 *                 if idx1[j] == -1:
 *                     out[i, j] = fv
 */
      __pyx_t_8 = __pyx_v_k;
      for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_8; __pyx_v_j++) {

        /* "pandas/src/generated.pyx":4350
 *         else:
 *             for j from 0 <= j < k:
 *                 if idx1[j] == -1:             # <<<<<<<<<<<<<<
 *                     out[i, j] = fv
 *                 else:
 */
        __pyx_t_11 = __pyx_v_j;
        __pyx_t_7 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_idx1.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_idx1.diminfo[0].strides)) == -1) != 0);
        if (__pyx_t_7) {

          /* "pandas/src/generated.pyx":4351
 *             for j from 0 <= j < k:
 *                 if idx1[j] == -1:
 *                     out[i, j] = fv             # <<<<<<<<<<<<<<
 *                 else:
 *                     out[i, j] = values[idx, idx1[j]]
 */
          __pyx_t_12 = __pyx_v_i;
          __pyx_t_13 = __pyx_v_j;
          *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_12, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_13, __pyx_pybuffernd_out.diminfo[1].strides) = __pyx_v_fv;
          goto __pyx_L10;
        }
        /*else*/ {

          /* "pandas/src/generated.pyx":4353
 *                     out[i, j] = fv
 *                 else:
 *                     out[i, j] = values[idx, idx1[j]]             # <<<<<<<<<<<<<<
 * 
 * @cython.wraparound(False)
 */
          __pyx_t_14 = __pyx_v_j;
          __pyx_t_15 = __pyx_v_idx;
          __pyx_t_16 = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_idx1.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_idx1.diminfo[0].strides));
          __pyx_t_17 = __pyx_v_i;
          __pyx_t_18 = __pyx_v_j;
          *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_18, __pyx_pybuffernd_out.diminfo[1].strides) = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_values.diminfo[0].strides, __pyx_t_16, __pyx_pybuffernd_values.diminfo[1].strides));
        }
        __pyx_L10:;
      }
    }
    __pyx_L5:;
  }

  /* "pandas/src/generated.pyx":4329
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def take_2d_multi_int64_float64(ndarray[int64_t, ndim=2] values,             # <<<<<<<<<<<<<<
 *                                     indexer,
 *                                     ndarray[float64_t, ndim=2] out,
 */

  /* function exit code */
  __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_pybuffernd_idx0.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_idx1.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas.algos.take_2d_multi_int64_float64", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_idx0.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_idx1.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer);
  __pyx_L2:;
  __Pyx_XDECREF((PyObject *)__pyx_v_idx0);
  __Pyx_XDECREF((PyObject *)__pyx_v_idx1);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/src/generated.pyx":4357
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def take_2d_multi_float32_float32(ndarray[float32_t, ndim=2] values,             # <<<<<<<<<<<<<<
 *                                     indexer,
 *                                     ndarray[float32_t, ndim=2] out,
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pandas_5algos_367take_2d_multi_float32_float32(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_5algos_367take_2d_multi_float32_float32 = {__Pyx_NAMESTR("take_2d_multi_float32_float32"), (PyCFunction)__pyx_pw_6pandas_5algos_367take_2d_multi_float32_float32, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pw_6pandas_5algos_367take_2d_multi_float32_float32(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyArrayObject *__pyx_v_values = 0;
  PyObject *__pyx_v_indexer = 0;
  PyArrayObject *__pyx_v_out = 0;
  PyObject *__pyx_v_fill_value = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("take_2d_multi_float32_float32 (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_values,&__pyx_n_s_indexer,&__pyx_n_s_out,&__pyx_n_s_fill_value,0};
    PyObject* values[4] = {0,0,0,0};
    values[3] = __pyx_k__188;
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_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 (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_indexer)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("take_2d_multi_float32_float32", 0, 3, 4, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4357; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_out)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("take_2d_multi_float32_float32", 0, 3, 4, 2); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4357; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  3:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_fill_value);
          if (value) { values[3] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "take_2d_multi_float32_float32") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4357; __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_values = ((PyArrayObject *)values[0]);
    __pyx_v_indexer = values[1];
    __pyx_v_out = ((PyArrayObject *)values[2]);
    __pyx_v_fill_value = values[3];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("take_2d_multi_float32_float32", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4357; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas.algos.take_2d_multi_float32_float32", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4357; __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[2]; __pyx_lineno = 4359; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_366take_2d_multi_float32_float32(__pyx_self, __pyx_v_values, __pyx_v_indexer, __pyx_v_out, __pyx_v_fill_value);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pandas_5algos_366take_2d_multi_float32_float32(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, PyObject *__pyx_v_indexer, PyArrayObject *__pyx_v_out, PyObject *__pyx_v_fill_value) {
  Py_ssize_t __pyx_v_i;
  Py_ssize_t __pyx_v_j;
  Py_ssize_t __pyx_v_k;
  Py_ssize_t __pyx_v_n;
  Py_ssize_t __pyx_v_idx;
  PyArrayObject *__pyx_v_idx0 = 0;
  PyArrayObject *__pyx_v_idx1 = 0;
  __pyx_t_5numpy_float32_t __pyx_v_fv;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_idx0;
  __Pyx_Buffer __pyx_pybuffer_idx0;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_idx1;
  __Pyx_Buffer __pyx_pybuffer_idx1;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_out;
  __Pyx_Buffer __pyx_pybuffer_out;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_values;
  __Pyx_Buffer __pyx_pybuffer_values;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyArrayObject *__pyx_t_2 = NULL;
  PyArrayObject *__pyx_t_3 = NULL;
  Py_ssize_t __pyx_t_4;
  __pyx_t_5numpy_float32_t __pyx_t_5;
  Py_ssize_t __pyx_t_6;
  int __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;
  Py_ssize_t __pyx_t_12;
  Py_ssize_t __pyx_t_13;
  Py_ssize_t __pyx_t_14;
  Py_ssize_t __pyx_t_15;
  __pyx_t_5numpy_int64_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("take_2d_multi_float32_float32", 0);
  __pyx_pybuffer_idx0.pybuffer.buf = NULL;
  __pyx_pybuffer_idx0.refcount = 0;
  __pyx_pybuffernd_idx0.data = NULL;
  __pyx_pybuffernd_idx0.rcbuffer = &__pyx_pybuffer_idx0;
  __pyx_pybuffer_idx1.pybuffer.buf = NULL;
  __pyx_pybuffer_idx1.refcount = 0;
  __pyx_pybuffernd_idx1.data = NULL;
  __pyx_pybuffernd_idx1.rcbuffer = &__pyx_pybuffer_idx1;
  __pyx_pybuffer_values.pybuffer.buf = NULL;
  __pyx_pybuffer_values.refcount = 0;
  __pyx_pybuffernd_values.data = NULL;
  __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values;
  __pyx_pybuffer_out.pybuffer.buf = NULL;
  __pyx_pybuffer_out.refcount = 0;
  __pyx_pybuffernd_out.data = NULL;
  __pyx_pybuffernd_out.rcbuffer = &__pyx_pybuffer_out;
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4357; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_values.diminfo[1].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_values.diminfo[1].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[1];
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_out.rcbuffer->pybuffer, (PyObject*)__pyx_v_out, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4357; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_out.diminfo[0].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_out.diminfo[0].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_out.diminfo[1].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_out.diminfo[1].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[1];

  /* "pandas/src/generated.pyx":4363
 *     cdef:
 *         Py_ssize_t i, j, k, n, idx
 *         ndarray[int64_t] idx0 = indexer[0]             # <<<<<<<<<<<<<<
 *         ndarray[int64_t] idx1 = indexer[1]
 *         float32_t fv
 */
  __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_indexer, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4363; __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[2]; __pyx_lineno = 4363; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_2 = ((PyArrayObject *)__pyx_t_1);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_idx0.rcbuffer->pybuffer, (PyObject*)__pyx_t_2, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
      __pyx_v_idx0 = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_idx0.rcbuffer->pybuffer.buf = NULL;
      {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4363; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    } else {__pyx_pybuffernd_idx0.diminfo[0].strides = __pyx_pybuffernd_idx0.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_idx0.diminfo[0].shape = __pyx_pybuffernd_idx0.rcbuffer->pybuffer.shape[0];
    }
  }
  __pyx_t_2 = 0;
  __pyx_v_idx0 = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pandas/src/generated.pyx":4364
 *         Py_ssize_t i, j, k, n, idx
 *         ndarray[int64_t] idx0 = indexer[0]
 *         ndarray[int64_t] idx1 = indexer[1]             # <<<<<<<<<<<<<<
 *         float32_t fv
 * 
 */
  __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_indexer, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4364; __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[2]; __pyx_lineno = 4364; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_3 = ((PyArrayObject *)__pyx_t_1);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_idx1.rcbuffer->pybuffer, (PyObject*)__pyx_t_3, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
      __pyx_v_idx1 = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_idx1.rcbuffer->pybuffer.buf = NULL;
      {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4364; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    } else {__pyx_pybuffernd_idx1.diminfo[0].strides = __pyx_pybuffernd_idx1.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_idx1.diminfo[0].shape = __pyx_pybuffernd_idx1.rcbuffer->pybuffer.shape[0];
    }
  }
  __pyx_t_3 = 0;
  __pyx_v_idx1 = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pandas/src/generated.pyx":4367
 *         float32_t fv
 * 
 *     n = len(idx0)             # <<<<<<<<<<<<<<
 *     k = len(idx1)
 * 
 */
  __pyx_t_4 = PyObject_Length(((PyObject *)__pyx_v_idx0)); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4367; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_n = __pyx_t_4;

  /* "pandas/src/generated.pyx":4368
 * 
 *     n = len(idx0)
 *     k = len(idx1)             # <<<<<<<<<<<<<<
 * 
 *     fv = fill_value
 */
  __pyx_t_4 = PyObject_Length(((PyObject *)__pyx_v_idx1)); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4368; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_k = __pyx_t_4;

  /* "pandas/src/generated.pyx":4370
 *     k = len(idx1)
 * 
 *     fv = fill_value             # <<<<<<<<<<<<<<
 *     for i from 0 <= i < n:
 *         idx = idx0[i]
 */
  __pyx_t_5 = __pyx_PyFloat_AsFloat(__pyx_v_fill_value); if (unlikely((__pyx_t_5 == (npy_float32)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4370; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_fv = __pyx_t_5;

  /* "pandas/src/generated.pyx":4371
 * 
 *     fv = fill_value
 *     for i from 0 <= i < n:             # <<<<<<<<<<<<<<
 *         idx = idx0[i]
 *         if idx == -1:
 */
  __pyx_t_4 = __pyx_v_n;
  for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_4; __pyx_v_i++) {

    /* "pandas/src/generated.pyx":4372
 *     fv = fill_value
 *     for i from 0 <= i < n:
 *         idx = idx0[i]             # <<<<<<<<<<<<<<
 *         if idx == -1:
 *             for j from 0 <= j < k:
 */
    __pyx_t_6 = __pyx_v_i;
    __pyx_v_idx = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_idx0.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_idx0.diminfo[0].strides));

    /* "pandas/src/generated.pyx":4373
 *     for i from 0 <= i < n:
 *         idx = idx0[i]
 *         if idx == -1:             # <<<<<<<<<<<<<<
 *             for j from 0 <= j < k:
 *                 out[i, j] = fv
 */
    __pyx_t_7 = ((__pyx_v_idx == -1) != 0);
    if (__pyx_t_7) {

      /* "pandas/src/generated.pyx":4374
 *         idx = idx0[i]
 *         if idx == -1:
 *             for j from 0 <= j < k:             # <<<<<<<<<<<<<<
 *                 out[i, j] = fv
 *         else:
 */
      __pyx_t_8 = __pyx_v_k;
      for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_8; __pyx_v_j++) {

        /* "pandas/src/generated.pyx":4375
 *         if idx == -1:
 *             for j from 0 <= j < k:
 *                 out[i, j] = fv             # <<<<<<<<<<<<<<
 *         else:
 *             for j from 0 <= j < k:
 */
        __pyx_t_9 = __pyx_v_i;
        __pyx_t_10 = __pyx_v_j;
        *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_9, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_10, __pyx_pybuffernd_out.diminfo[1].strides) = __pyx_v_fv;
      }
      goto __pyx_L5;
    }
    /*else*/ {

      /* "pandas/src/generated.pyx":4377
 *                 out[i, j] = fv
 *         else:
 *             for j from 0 <= j < k:             # <<<<<<<<<<<<<<
 *                 if idx1[j] == -1:
 *                     out[i, j] = fv
 */
      __pyx_t_8 = __pyx_v_k;
      for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_8; __pyx_v_j++) {

        /* "pandas/src/generated.pyx":4378
 *         else:
 *             for j from 0 <= j < k:
 *                 if idx1[j] == -1:             # <<<<<<<<<<<<<<
 *                     out[i, j] = fv
 *                 else:
 */
        __pyx_t_11 = __pyx_v_j;
        __pyx_t_7 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_idx1.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_idx1.diminfo[0].strides)) == -1) != 0);
        if (__pyx_t_7) {

          /* "pandas/src/generated.pyx":4379
 *             for j from 0 <= j < k:
 *                 if idx1[j] == -1:
 *                     out[i, j] = fv             # <<<<<<<<<<<<<<
 *                 else:
 *                     out[i, j] = values[idx, idx1[j]]
 */
          __pyx_t_12 = __pyx_v_i;
          __pyx_t_13 = __pyx_v_j;
          *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_12, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_13, __pyx_pybuffernd_out.diminfo[1].strides) = __pyx_v_fv;
          goto __pyx_L10;
        }
        /*else*/ {

          /* "pandas/src/generated.pyx":4381
 *                     out[i, j] = fv
 *                 else:
 *                     out[i, j] = values[idx, idx1[j]]             # <<<<<<<<<<<<<<
 * 
 * @cython.wraparound(False)
 */
          __pyx_t_14 = __pyx_v_j;
          __pyx_t_15 = __pyx_v_idx;
          __pyx_t_16 = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_idx1.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_idx1.diminfo[0].strides));
          __pyx_t_17 = __pyx_v_i;
          __pyx_t_18 = __pyx_v_j;
          *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_18, __pyx_pybuffernd_out.diminfo[1].strides) = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_values.diminfo[0].strides, __pyx_t_16, __pyx_pybuffernd_values.diminfo[1].strides));
        }
        __pyx_L10:;
      }
    }
    __pyx_L5:;
  }

  /* "pandas/src/generated.pyx":4357
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def take_2d_multi_float32_float32(ndarray[float32_t, ndim=2] values,             # <<<<<<<<<<<<<<
 *                                     indexer,
 *                                     ndarray[float32_t, ndim=2] out,
 */

  /* function exit code */
  __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_pybuffernd_idx0.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_idx1.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas.algos.take_2d_multi_float32_float32", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_idx0.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_idx1.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer);
  __pyx_L2:;
  __Pyx_XDECREF((PyObject *)__pyx_v_idx0);
  __Pyx_XDECREF((PyObject *)__pyx_v_idx1);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/src/generated.pyx":4385
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def take_2d_multi_float32_float64(ndarray[float32_t, ndim=2] values,             # <<<<<<<<<<<<<<
 *                                     indexer,
 *                                     ndarray[float64_t, ndim=2] out,
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pandas_5algos_369take_2d_multi_float32_float64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_5algos_369take_2d_multi_float32_float64 = {__Pyx_NAMESTR("take_2d_multi_float32_float64"), (PyCFunction)__pyx_pw_6pandas_5algos_369take_2d_multi_float32_float64, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pw_6pandas_5algos_369take_2d_multi_float32_float64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyArrayObject *__pyx_v_values = 0;
  PyObject *__pyx_v_indexer = 0;
  PyArrayObject *__pyx_v_out = 0;
  PyObject *__pyx_v_fill_value = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("take_2d_multi_float32_float64 (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_values,&__pyx_n_s_indexer,&__pyx_n_s_out,&__pyx_n_s_fill_value,0};
    PyObject* values[4] = {0,0,0,0};
    values[3] = __pyx_k__189;
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_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 (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_indexer)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("take_2d_multi_float32_float64", 0, 3, 4, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4385; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_out)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("take_2d_multi_float32_float64", 0, 3, 4, 2); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4385; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  3:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_fill_value);
          if (value) { values[3] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "take_2d_multi_float32_float64") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4385; __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_values = ((PyArrayObject *)values[0]);
    __pyx_v_indexer = values[1];
    __pyx_v_out = ((PyArrayObject *)values[2]);
    __pyx_v_fill_value = values[3];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("take_2d_multi_float32_float64", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4385; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas.algos.take_2d_multi_float32_float64", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4385; __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[2]; __pyx_lineno = 4387; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_368take_2d_multi_float32_float64(__pyx_self, __pyx_v_values, __pyx_v_indexer, __pyx_v_out, __pyx_v_fill_value);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pandas_5algos_368take_2d_multi_float32_float64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, PyObject *__pyx_v_indexer, PyArrayObject *__pyx_v_out, PyObject *__pyx_v_fill_value) {
  Py_ssize_t __pyx_v_i;
  Py_ssize_t __pyx_v_j;
  Py_ssize_t __pyx_v_k;
  Py_ssize_t __pyx_v_n;
  Py_ssize_t __pyx_v_idx;
  PyArrayObject *__pyx_v_idx0 = 0;
  PyArrayObject *__pyx_v_idx1 = 0;
  __pyx_t_5numpy_float64_t __pyx_v_fv;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_idx0;
  __Pyx_Buffer __pyx_pybuffer_idx0;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_idx1;
  __Pyx_Buffer __pyx_pybuffer_idx1;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_out;
  __Pyx_Buffer __pyx_pybuffer_out;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_values;
  __Pyx_Buffer __pyx_pybuffer_values;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyArrayObject *__pyx_t_2 = NULL;
  PyArrayObject *__pyx_t_3 = NULL;
  Py_ssize_t __pyx_t_4;
  __pyx_t_5numpy_float64_t __pyx_t_5;
  Py_ssize_t __pyx_t_6;
  int __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;
  Py_ssize_t __pyx_t_12;
  Py_ssize_t __pyx_t_13;
  Py_ssize_t __pyx_t_14;
  Py_ssize_t __pyx_t_15;
  __pyx_t_5numpy_int64_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("take_2d_multi_float32_float64", 0);
  __pyx_pybuffer_idx0.pybuffer.buf = NULL;
  __pyx_pybuffer_idx0.refcount = 0;
  __pyx_pybuffernd_idx0.data = NULL;
  __pyx_pybuffernd_idx0.rcbuffer = &__pyx_pybuffer_idx0;
  __pyx_pybuffer_idx1.pybuffer.buf = NULL;
  __pyx_pybuffer_idx1.refcount = 0;
  __pyx_pybuffernd_idx1.data = NULL;
  __pyx_pybuffernd_idx1.rcbuffer = &__pyx_pybuffer_idx1;
  __pyx_pybuffer_values.pybuffer.buf = NULL;
  __pyx_pybuffer_values.refcount = 0;
  __pyx_pybuffernd_values.data = NULL;
  __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values;
  __pyx_pybuffer_out.pybuffer.buf = NULL;
  __pyx_pybuffer_out.refcount = 0;
  __pyx_pybuffernd_out.data = NULL;
  __pyx_pybuffernd_out.rcbuffer = &__pyx_pybuffer_out;
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4385; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_values.diminfo[1].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_values.diminfo[1].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[1];
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_out.rcbuffer->pybuffer, (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[2]; __pyx_lineno = 4385; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_out.diminfo[0].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_out.diminfo[0].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_out.diminfo[1].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_out.diminfo[1].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[1];

  /* "pandas/src/generated.pyx":4391
 *     cdef:
 *         Py_ssize_t i, j, k, n, idx
 *         ndarray[int64_t] idx0 = indexer[0]             # <<<<<<<<<<<<<<
 *         ndarray[int64_t] idx1 = indexer[1]
 *         float64_t fv
 */
  __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_indexer, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4391; __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[2]; __pyx_lineno = 4391; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_2 = ((PyArrayObject *)__pyx_t_1);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_idx0.rcbuffer->pybuffer, (PyObject*)__pyx_t_2, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
      __pyx_v_idx0 = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_idx0.rcbuffer->pybuffer.buf = NULL;
      {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4391; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    } else {__pyx_pybuffernd_idx0.diminfo[0].strides = __pyx_pybuffernd_idx0.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_idx0.diminfo[0].shape = __pyx_pybuffernd_idx0.rcbuffer->pybuffer.shape[0];
    }
  }
  __pyx_t_2 = 0;
  __pyx_v_idx0 = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pandas/src/generated.pyx":4392
 *         Py_ssize_t i, j, k, n, idx
 *         ndarray[int64_t] idx0 = indexer[0]
 *         ndarray[int64_t] idx1 = indexer[1]             # <<<<<<<<<<<<<<
 *         float64_t fv
 * 
 */
  __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_indexer, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4392; __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[2]; __pyx_lineno = 4392; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_3 = ((PyArrayObject *)__pyx_t_1);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_idx1.rcbuffer->pybuffer, (PyObject*)__pyx_t_3, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
      __pyx_v_idx1 = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_idx1.rcbuffer->pybuffer.buf = NULL;
      {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4392; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    } else {__pyx_pybuffernd_idx1.diminfo[0].strides = __pyx_pybuffernd_idx1.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_idx1.diminfo[0].shape = __pyx_pybuffernd_idx1.rcbuffer->pybuffer.shape[0];
    }
  }
  __pyx_t_3 = 0;
  __pyx_v_idx1 = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pandas/src/generated.pyx":4395
 *         float64_t fv
 * 
 *     n = len(idx0)             # <<<<<<<<<<<<<<
 *     k = len(idx1)
 * 
 */
  __pyx_t_4 = PyObject_Length(((PyObject *)__pyx_v_idx0)); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4395; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_n = __pyx_t_4;

  /* "pandas/src/generated.pyx":4396
 * 
 *     n = len(idx0)
 *     k = len(idx1)             # <<<<<<<<<<<<<<
 * 
 *     fv = fill_value
 */
  __pyx_t_4 = PyObject_Length(((PyObject *)__pyx_v_idx1)); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4396; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_k = __pyx_t_4;

  /* "pandas/src/generated.pyx":4398
 *     k = len(idx1)
 * 
 *     fv = fill_value             # <<<<<<<<<<<<<<
 *     for i from 0 <= i < n:
 *         idx = idx0[i]
 */
  __pyx_t_5 = __pyx_PyFloat_AsDouble(__pyx_v_fill_value); if (unlikely((__pyx_t_5 == (npy_float64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4398; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_fv = __pyx_t_5;

  /* "pandas/src/generated.pyx":4399
 * 
 *     fv = fill_value
 *     for i from 0 <= i < n:             # <<<<<<<<<<<<<<
 *         idx = idx0[i]
 *         if idx == -1:
 */
  __pyx_t_4 = __pyx_v_n;
  for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_4; __pyx_v_i++) {

    /* "pandas/src/generated.pyx":4400
 *     fv = fill_value
 *     for i from 0 <= i < n:
 *         idx = idx0[i]             # <<<<<<<<<<<<<<
 *         if idx == -1:
 *             for j from 0 <= j < k:
 */
    __pyx_t_6 = __pyx_v_i;
    __pyx_v_idx = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_idx0.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_idx0.diminfo[0].strides));

    /* "pandas/src/generated.pyx":4401
 *     for i from 0 <= i < n:
 *         idx = idx0[i]
 *         if idx == -1:             # <<<<<<<<<<<<<<
 *             for j from 0 <= j < k:
 *                 out[i, j] = fv
 */
    __pyx_t_7 = ((__pyx_v_idx == -1) != 0);
    if (__pyx_t_7) {

      /* "pandas/src/generated.pyx":4402
 *         idx = idx0[i]
 *         if idx == -1:
 *             for j from 0 <= j < k:             # <<<<<<<<<<<<<<
 *                 out[i, j] = fv
 *         else:
 */
      __pyx_t_8 = __pyx_v_k;
      for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_8; __pyx_v_j++) {

        /* "pandas/src/generated.pyx":4403
 *         if idx == -1:
 *             for j from 0 <= j < k:
 *                 out[i, j] = fv             # <<<<<<<<<<<<<<
 *         else:
 *             for j from 0 <= j < k:
 */
        __pyx_t_9 = __pyx_v_i;
        __pyx_t_10 = __pyx_v_j;
        *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_9, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_10, __pyx_pybuffernd_out.diminfo[1].strides) = __pyx_v_fv;
      }
      goto __pyx_L5;
    }
    /*else*/ {

      /* "pandas/src/generated.pyx":4405
 *                 out[i, j] = fv
 *         else:
 *             for j from 0 <= j < k:             # <<<<<<<<<<<<<<
 *                 if idx1[j] == -1:
 *                     out[i, j] = fv
 */
      __pyx_t_8 = __pyx_v_k;
      for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_8; __pyx_v_j++) {

        /* "pandas/src/generated.pyx":4406
 *         else:
 *             for j from 0 <= j < k:
 *                 if idx1[j] == -1:             # <<<<<<<<<<<<<<
 *                     out[i, j] = fv
 *                 else:
 */
        __pyx_t_11 = __pyx_v_j;
        __pyx_t_7 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_idx1.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_idx1.diminfo[0].strides)) == -1) != 0);
        if (__pyx_t_7) {

          /* "pandas/src/generated.pyx":4407
 *             for j from 0 <= j < k:
 *                 if idx1[j] == -1:
 *                     out[i, j] = fv             # <<<<<<<<<<<<<<
 *                 else:
 *                     out[i, j] = values[idx, idx1[j]]
 */
          __pyx_t_12 = __pyx_v_i;
          __pyx_t_13 = __pyx_v_j;
          *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_12, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_13, __pyx_pybuffernd_out.diminfo[1].strides) = __pyx_v_fv;
          goto __pyx_L10;
        }
        /*else*/ {

          /* "pandas/src/generated.pyx":4409
 *                     out[i, j] = fv
 *                 else:
 *                     out[i, j] = values[idx, idx1[j]]             # <<<<<<<<<<<<<<
 * 
 * @cython.wraparound(False)
 */
          __pyx_t_14 = __pyx_v_j;
          __pyx_t_15 = __pyx_v_idx;
          __pyx_t_16 = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_idx1.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_idx1.diminfo[0].strides));
          __pyx_t_17 = __pyx_v_i;
          __pyx_t_18 = __pyx_v_j;
          *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_18, __pyx_pybuffernd_out.diminfo[1].strides) = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_values.diminfo[0].strides, __pyx_t_16, __pyx_pybuffernd_values.diminfo[1].strides));
        }
        __pyx_L10:;
      }
    }
    __pyx_L5:;
  }

  /* "pandas/src/generated.pyx":4385
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def take_2d_multi_float32_float64(ndarray[float32_t, ndim=2] values,             # <<<<<<<<<<<<<<
 *                                     indexer,
 *                                     ndarray[float64_t, ndim=2] out,
 */

  /* function exit code */
  __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_pybuffernd_idx0.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_idx1.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas.algos.take_2d_multi_float32_float64", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_idx0.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_idx1.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer);
  __pyx_L2:;
  __Pyx_XDECREF((PyObject *)__pyx_v_idx0);
  __Pyx_XDECREF((PyObject *)__pyx_v_idx1);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/src/generated.pyx":4413
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def take_2d_multi_float64_float64(ndarray[float64_t, ndim=2] values,             # <<<<<<<<<<<<<<
 *                                     indexer,
 *                                     ndarray[float64_t, ndim=2] out,
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pandas_5algos_371take_2d_multi_float64_float64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_5algos_371take_2d_multi_float64_float64 = {__Pyx_NAMESTR("take_2d_multi_float64_float64"), (PyCFunction)__pyx_pw_6pandas_5algos_371take_2d_multi_float64_float64, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pw_6pandas_5algos_371take_2d_multi_float64_float64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyArrayObject *__pyx_v_values = 0;
  PyObject *__pyx_v_indexer = 0;
  PyArrayObject *__pyx_v_out = 0;
  PyObject *__pyx_v_fill_value = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("take_2d_multi_float64_float64 (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_values,&__pyx_n_s_indexer,&__pyx_n_s_out,&__pyx_n_s_fill_value,0};
    PyObject* values[4] = {0,0,0,0};
    values[3] = __pyx_k__190;
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_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 (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_indexer)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("take_2d_multi_float64_float64", 0, 3, 4, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4413; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_out)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("take_2d_multi_float64_float64", 0, 3, 4, 2); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4413; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  3:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_fill_value);
          if (value) { values[3] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "take_2d_multi_float64_float64") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4413; __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_values = ((PyArrayObject *)values[0]);
    __pyx_v_indexer = values[1];
    __pyx_v_out = ((PyArrayObject *)values[2]);
    __pyx_v_fill_value = values[3];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("take_2d_multi_float64_float64", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4413; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas.algos.take_2d_multi_float64_float64", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4413; __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[2]; __pyx_lineno = 4415; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_370take_2d_multi_float64_float64(__pyx_self, __pyx_v_values, __pyx_v_indexer, __pyx_v_out, __pyx_v_fill_value);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pandas_5algos_370take_2d_multi_float64_float64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, PyObject *__pyx_v_indexer, PyArrayObject *__pyx_v_out, PyObject *__pyx_v_fill_value) {
  Py_ssize_t __pyx_v_i;
  Py_ssize_t __pyx_v_j;
  Py_ssize_t __pyx_v_k;
  Py_ssize_t __pyx_v_n;
  Py_ssize_t __pyx_v_idx;
  PyArrayObject *__pyx_v_idx0 = 0;
  PyArrayObject *__pyx_v_idx1 = 0;
  __pyx_t_5numpy_float64_t __pyx_v_fv;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_idx0;
  __Pyx_Buffer __pyx_pybuffer_idx0;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_idx1;
  __Pyx_Buffer __pyx_pybuffer_idx1;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_out;
  __Pyx_Buffer __pyx_pybuffer_out;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_values;
  __Pyx_Buffer __pyx_pybuffer_values;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyArrayObject *__pyx_t_2 = NULL;
  PyArrayObject *__pyx_t_3 = NULL;
  Py_ssize_t __pyx_t_4;
  __pyx_t_5numpy_float64_t __pyx_t_5;
  Py_ssize_t __pyx_t_6;
  int __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;
  Py_ssize_t __pyx_t_12;
  Py_ssize_t __pyx_t_13;
  Py_ssize_t __pyx_t_14;
  Py_ssize_t __pyx_t_15;
  __pyx_t_5numpy_int64_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("take_2d_multi_float64_float64", 0);
  __pyx_pybuffer_idx0.pybuffer.buf = NULL;
  __pyx_pybuffer_idx0.refcount = 0;
  __pyx_pybuffernd_idx0.data = NULL;
  __pyx_pybuffernd_idx0.rcbuffer = &__pyx_pybuffer_idx0;
  __pyx_pybuffer_idx1.pybuffer.buf = NULL;
  __pyx_pybuffer_idx1.refcount = 0;
  __pyx_pybuffernd_idx1.data = NULL;
  __pyx_pybuffernd_idx1.rcbuffer = &__pyx_pybuffer_idx1;
  __pyx_pybuffer_values.pybuffer.buf = NULL;
  __pyx_pybuffer_values.refcount = 0;
  __pyx_pybuffernd_values.data = NULL;
  __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values;
  __pyx_pybuffer_out.pybuffer.buf = NULL;
  __pyx_pybuffer_out.refcount = 0;
  __pyx_pybuffernd_out.data = NULL;
  __pyx_pybuffernd_out.rcbuffer = &__pyx_pybuffer_out;
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (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[2]; __pyx_lineno = 4413; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_values.diminfo[1].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_values.diminfo[1].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[1];
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_out.rcbuffer->pybuffer, (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[2]; __pyx_lineno = 4413; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_out.diminfo[0].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_out.diminfo[0].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_out.diminfo[1].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_out.diminfo[1].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[1];

  /* "pandas/src/generated.pyx":4419
 *     cdef:
 *         Py_ssize_t i, j, k, n, idx
 *         ndarray[int64_t] idx0 = indexer[0]             # <<<<<<<<<<<<<<
 *         ndarray[int64_t] idx1 = indexer[1]
 *         float64_t fv
 */
  __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_indexer, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4419; __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[2]; __pyx_lineno = 4419; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_2 = ((PyArrayObject *)__pyx_t_1);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_idx0.rcbuffer->pybuffer, (PyObject*)__pyx_t_2, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
      __pyx_v_idx0 = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_idx0.rcbuffer->pybuffer.buf = NULL;
      {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4419; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    } else {__pyx_pybuffernd_idx0.diminfo[0].strides = __pyx_pybuffernd_idx0.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_idx0.diminfo[0].shape = __pyx_pybuffernd_idx0.rcbuffer->pybuffer.shape[0];
    }
  }
  __pyx_t_2 = 0;
  __pyx_v_idx0 = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pandas/src/generated.pyx":4420
 *         Py_ssize_t i, j, k, n, idx
 *         ndarray[int64_t] idx0 = indexer[0]
 *         ndarray[int64_t] idx1 = indexer[1]             # <<<<<<<<<<<<<<
 *         float64_t fv
 * 
 */
  __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_indexer, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4420; __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[2]; __pyx_lineno = 4420; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_3 = ((PyArrayObject *)__pyx_t_1);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_idx1.rcbuffer->pybuffer, (PyObject*)__pyx_t_3, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
      __pyx_v_idx1 = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_idx1.rcbuffer->pybuffer.buf = NULL;
      {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4420; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    } else {__pyx_pybuffernd_idx1.diminfo[0].strides = __pyx_pybuffernd_idx1.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_idx1.diminfo[0].shape = __pyx_pybuffernd_idx1.rcbuffer->pybuffer.shape[0];
    }
  }
  __pyx_t_3 = 0;
  __pyx_v_idx1 = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pandas/src/generated.pyx":4423
 *         float64_t fv
 * 
 *     n = len(idx0)             # <<<<<<<<<<<<<<
 *     k = len(idx1)
 * 
 */
  __pyx_t_4 = PyObject_Length(((PyObject *)__pyx_v_idx0)); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4423; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_n = __pyx_t_4;

  /* "pandas/src/generated.pyx":4424
 * 
 *     n = len(idx0)
 *     k = len(idx1)             # <<<<<<<<<<<<<<
 * 
 *     fv = fill_value
 */
  __pyx_t_4 = PyObject_Length(((PyObject *)__pyx_v_idx1)); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4424; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_k = __pyx_t_4;

  /* "pandas/src/generated.pyx":4426
 *     k = len(idx1)
 * 
 *     fv = fill_value             # <<<<<<<<<<<<<<
 *     for i from 0 <= i < n:
 *         idx = idx0[i]
 */
  __pyx_t_5 = __pyx_PyFloat_AsDouble(__pyx_v_fill_value); if (unlikely((__pyx_t_5 == (npy_float64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4426; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_fv = __pyx_t_5;

  /* "pandas/src/generated.pyx":4427
 * 
 *     fv = fill_value
 *     for i from 0 <= i < n:             # <<<<<<<<<<<<<<
 *         idx = idx0[i]
 *         if idx == -1:
 */
  __pyx_t_4 = __pyx_v_n;
  for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_4; __pyx_v_i++) {

    /* "pandas/src/generated.pyx":4428
 *     fv = fill_value
 *     for i from 0 <= i < n:
 *         idx = idx0[i]             # <<<<<<<<<<<<<<
 *         if idx == -1:
 *             for j from 0 <= j < k:
 */
    __pyx_t_6 = __pyx_v_i;
    __pyx_v_idx = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_idx0.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_idx0.diminfo[0].strides));

    /* "pandas/src/generated.pyx":4429
 *     for i from 0 <= i < n:
 *         idx = idx0[i]
 *         if idx == -1:             # <<<<<<<<<<<<<<
 *             for j from 0 <= j < k:
 *                 out[i, j] = fv
 */
    __pyx_t_7 = ((__pyx_v_idx == -1) != 0);
    if (__pyx_t_7) {

      /* "pandas/src/generated.pyx":4430
 *         idx = idx0[i]
 *         if idx == -1:
 *             for j from 0 <= j < k:             # <<<<<<<<<<<<<<
 *                 out[i, j] = fv
 *         else:
 */
      __pyx_t_8 = __pyx_v_k;
      for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_8; __pyx_v_j++) {

        /* "pandas/src/generated.pyx":4431
 *         if idx == -1:
 *             for j from 0 <= j < k:
 *                 out[i, j] = fv             # <<<<<<<<<<<<<<
 *         else:
 *             for j from 0 <= j < k:
 */
        __pyx_t_9 = __pyx_v_i;
        __pyx_t_10 = __pyx_v_j;
        *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_9, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_10, __pyx_pybuffernd_out.diminfo[1].strides) = __pyx_v_fv;
      }
      goto __pyx_L5;
    }
    /*else*/ {

      /* "pandas/src/generated.pyx":4433
 *                 out[i, j] = fv
 *         else:
 *             for j from 0 <= j < k:             # <<<<<<<<<<<<<<
 *                 if idx1[j] == -1:
 *                     out[i, j] = fv
 */
      __pyx_t_8 = __pyx_v_k;
      for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_8; __pyx_v_j++) {

        /* "pandas/src/generated.pyx":4434
 *         else:
 *             for j from 0 <= j < k:
 *                 if idx1[j] == -1:             # <<<<<<<<<<<<<<
 *                     out[i, j] = fv
 *                 else:
 */
        __pyx_t_11 = __pyx_v_j;
        __pyx_t_7 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_idx1.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_idx1.diminfo[0].strides)) == -1) != 0);
        if (__pyx_t_7) {

          /* "pandas/src/generated.pyx":4435
 *             for j from 0 <= j < k:
 *                 if idx1[j] == -1:
 *                     out[i, j] = fv             # <<<<<<<<<<<<<<
 *                 else:
 *                     out[i, j] = values[idx, idx1[j]]
 */
          __pyx_t_12 = __pyx_v_i;
          __pyx_t_13 = __pyx_v_j;
          *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_12, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_13, __pyx_pybuffernd_out.diminfo[1].strides) = __pyx_v_fv;
          goto __pyx_L10;
        }
        /*else*/ {

          /* "pandas/src/generated.pyx":4437
 *                     out[i, j] = fv
 *                 else:
 *                     out[i, j] = values[idx, idx1[j]]             # <<<<<<<<<<<<<<
 * 
 * @cython.wraparound(False)
 */
          __pyx_t_14 = __pyx_v_j;
          __pyx_t_15 = __pyx_v_idx;
          __pyx_t_16 = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_idx1.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_idx1.diminfo[0].strides));
          __pyx_t_17 = __pyx_v_i;
          __pyx_t_18 = __pyx_v_j;
          *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_18, __pyx_pybuffernd_out.diminfo[1].strides) = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_values.diminfo[0].strides, __pyx_t_16, __pyx_pybuffernd_values.diminfo[1].strides));
        }
        __pyx_L10:;
      }
    }
    __pyx_L5:;
  }

  /* "pandas/src/generated.pyx":4413
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def take_2d_multi_float64_float64(ndarray[float64_t, ndim=2] values,             # <<<<<<<<<<<<<<
 *                                     indexer,
 *                                     ndarray[float64_t, ndim=2] out,
 */

  /* function exit code */
  __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_pybuffernd_idx0.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_idx1.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas.algos.take_2d_multi_float64_float64", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_idx0.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_idx1.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer);
  __pyx_L2:;
  __Pyx_XDECREF((PyObject *)__pyx_v_idx0);
  __Pyx_XDECREF((PyObject *)__pyx_v_idx1);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/src/generated.pyx":4441
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def take_2d_multi_object_object(ndarray[object, ndim=2] values,             # <<<<<<<<<<<<<<
 *                                     indexer,
 *                                     ndarray[object, ndim=2] out,
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pandas_5algos_373take_2d_multi_object_object(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_5algos_373take_2d_multi_object_object = {__Pyx_NAMESTR("take_2d_multi_object_object"), (PyCFunction)__pyx_pw_6pandas_5algos_373take_2d_multi_object_object, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pw_6pandas_5algos_373take_2d_multi_object_object(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyArrayObject *__pyx_v_values = 0;
  PyObject *__pyx_v_indexer = 0;
  PyArrayObject *__pyx_v_out = 0;
  PyObject *__pyx_v_fill_value = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("take_2d_multi_object_object (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_values,&__pyx_n_s_indexer,&__pyx_n_s_out,&__pyx_n_s_fill_value,0};
    PyObject* values[4] = {0,0,0,0};
    values[3] = __pyx_k__191;
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_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 (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_indexer)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("take_2d_multi_object_object", 0, 3, 4, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4441; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_out)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("take_2d_multi_object_object", 0, 3, 4, 2); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4441; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  3:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_fill_value);
          if (value) { values[3] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "take_2d_multi_object_object") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4441; __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_values = ((PyArrayObject *)values[0]);
    __pyx_v_indexer = values[1];
    __pyx_v_out = ((PyArrayObject *)values[2]);
    __pyx_v_fill_value = values[3];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("take_2d_multi_object_object", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4441; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas.algos.take_2d_multi_object_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4441; __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[2]; __pyx_lineno = 4443; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_372take_2d_multi_object_object(__pyx_self, __pyx_v_values, __pyx_v_indexer, __pyx_v_out, __pyx_v_fill_value);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pandas_5algos_372take_2d_multi_object_object(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, PyObject *__pyx_v_indexer, PyArrayObject *__pyx_v_out, PyObject *__pyx_v_fill_value) {
  Py_ssize_t __pyx_v_i;
  Py_ssize_t __pyx_v_j;
  Py_ssize_t __pyx_v_k;
  Py_ssize_t __pyx_v_n;
  Py_ssize_t __pyx_v_idx;
  PyArrayObject *__pyx_v_idx0 = 0;
  PyArrayObject *__pyx_v_idx1 = 0;
  PyObject *__pyx_v_fv = 0;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_idx0;
  __Pyx_Buffer __pyx_pybuffer_idx0;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_idx1;
  __Pyx_Buffer __pyx_pybuffer_idx1;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_out;
  __Pyx_Buffer __pyx_pybuffer_out;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_values;
  __Pyx_Buffer __pyx_pybuffer_values;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyArrayObject *__pyx_t_2 = NULL;
  PyArrayObject *__pyx_t_3 = NULL;
  Py_ssize_t __pyx_t_4;
  Py_ssize_t __pyx_t_5;
  int __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;
  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;
  __pyx_t_5numpy_int64_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("take_2d_multi_object_object", 0);
  __pyx_pybuffer_idx0.pybuffer.buf = NULL;
  __pyx_pybuffer_idx0.refcount = 0;
  __pyx_pybuffernd_idx0.data = NULL;
  __pyx_pybuffernd_idx0.rcbuffer = &__pyx_pybuffer_idx0;
  __pyx_pybuffer_idx1.pybuffer.buf = NULL;
  __pyx_pybuffer_idx1.refcount = 0;
  __pyx_pybuffernd_idx1.data = NULL;
  __pyx_pybuffernd_idx1.rcbuffer = &__pyx_pybuffer_idx1;
  __pyx_pybuffer_values.pybuffer.buf = NULL;
  __pyx_pybuffer_values.refcount = 0;
  __pyx_pybuffernd_values.data = NULL;
  __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values;
  __pyx_pybuffer_out.pybuffer.buf = NULL;
  __pyx_pybuffer_out.refcount = 0;
  __pyx_pybuffernd_out.data = NULL;
  __pyx_pybuffernd_out.rcbuffer = &__pyx_pybuffer_out;
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4441; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_values.diminfo[1].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_values.diminfo[1].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[1];
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_out.rcbuffer->pybuffer, (PyObject*)__pyx_v_out, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4441; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_out.diminfo[0].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_out.diminfo[0].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_out.diminfo[1].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_out.diminfo[1].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[1];

  /* "pandas/src/generated.pyx":4447
 *     cdef:
 *         Py_ssize_t i, j, k, n, idx
 *         ndarray[int64_t] idx0 = indexer[0]             # <<<<<<<<<<<<<<
 *         ndarray[int64_t] idx1 = indexer[1]
 *         object fv
 */
  __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_indexer, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4447; __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[2]; __pyx_lineno = 4447; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_2 = ((PyArrayObject *)__pyx_t_1);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_idx0.rcbuffer->pybuffer, (PyObject*)__pyx_t_2, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
      __pyx_v_idx0 = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_idx0.rcbuffer->pybuffer.buf = NULL;
      {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4447; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    } else {__pyx_pybuffernd_idx0.diminfo[0].strides = __pyx_pybuffernd_idx0.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_idx0.diminfo[0].shape = __pyx_pybuffernd_idx0.rcbuffer->pybuffer.shape[0];
    }
  }
  __pyx_t_2 = 0;
  __pyx_v_idx0 = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pandas/src/generated.pyx":4448
 *         Py_ssize_t i, j, k, n, idx
 *         ndarray[int64_t] idx0 = indexer[0]
 *         ndarray[int64_t] idx1 = indexer[1]             # <<<<<<<<<<<<<<
 *         object fv
 * 
 */
  __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_indexer, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4448; __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[2]; __pyx_lineno = 4448; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_3 = ((PyArrayObject *)__pyx_t_1);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_idx1.rcbuffer->pybuffer, (PyObject*)__pyx_t_3, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
      __pyx_v_idx1 = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_idx1.rcbuffer->pybuffer.buf = NULL;
      {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4448; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    } else {__pyx_pybuffernd_idx1.diminfo[0].strides = __pyx_pybuffernd_idx1.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_idx1.diminfo[0].shape = __pyx_pybuffernd_idx1.rcbuffer->pybuffer.shape[0];
    }
  }
  __pyx_t_3 = 0;
  __pyx_v_idx1 = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pandas/src/generated.pyx":4451
 *         object fv
 * 
 *     n = len(idx0)             # <<<<<<<<<<<<<<
 *     k = len(idx1)
 * 
 */
  __pyx_t_4 = PyObject_Length(((PyObject *)__pyx_v_idx0)); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4451; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_n = __pyx_t_4;

  /* "pandas/src/generated.pyx":4452
 * 
 *     n = len(idx0)
 *     k = len(idx1)             # <<<<<<<<<<<<<<
 * 
 *     fv = fill_value
 */
  __pyx_t_4 = PyObject_Length(((PyObject *)__pyx_v_idx1)); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4452; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_k = __pyx_t_4;

  /* "pandas/src/generated.pyx":4454
 *     k = len(idx1)
 * 
 *     fv = fill_value             # <<<<<<<<<<<<<<
 *     for i from 0 <= i < n:
 *         idx = idx0[i]
 */
  __Pyx_INCREF(__pyx_v_fill_value);
  __pyx_v_fv = __pyx_v_fill_value;

  /* "pandas/src/generated.pyx":4455
 * 
 *     fv = fill_value
 *     for i from 0 <= i < n:             # <<<<<<<<<<<<<<
 *         idx = idx0[i]
 *         if idx == -1:
 */
  __pyx_t_4 = __pyx_v_n;
  for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_4; __pyx_v_i++) {

    /* "pandas/src/generated.pyx":4456
 *     fv = fill_value
 *     for i from 0 <= i < n:
 *         idx = idx0[i]             # <<<<<<<<<<<<<<
 *         if idx == -1:
 *             for j from 0 <= j < k:
 */
    __pyx_t_5 = __pyx_v_i;
    __pyx_v_idx = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_idx0.rcbuffer->pybuffer.buf, __pyx_t_5, __pyx_pybuffernd_idx0.diminfo[0].strides));

    /* "pandas/src/generated.pyx":4457
 *     for i from 0 <= i < n:
 *         idx = idx0[i]
 *         if idx == -1:             # <<<<<<<<<<<<<<
 *             for j from 0 <= j < k:
 *                 out[i, j] = fv
 */
    __pyx_t_6 = ((__pyx_v_idx == -1) != 0);
    if (__pyx_t_6) {

      /* "pandas/src/generated.pyx":4458
 *         idx = idx0[i]
 *         if idx == -1:
 *             for j from 0 <= j < k:             # <<<<<<<<<<<<<<
 *                 out[i, j] = fv
 *         else:
 */
      __pyx_t_7 = __pyx_v_k;
      for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_7; __pyx_v_j++) {

        /* "pandas/src/generated.pyx":4459
 *         if idx == -1:
 *             for j from 0 <= j < k:
 *                 out[i, j] = fv             # <<<<<<<<<<<<<<
 *         else:
 *             for j from 0 <= j < k:
 */
        __pyx_t_8 = __pyx_v_i;
        __pyx_t_9 = __pyx_v_j;
        __pyx_t_10 = __Pyx_BufPtrStrided2d(PyObject **, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_9, __pyx_pybuffernd_out.diminfo[1].strides);
        __Pyx_GOTREF(*__pyx_t_10);
        __Pyx_INCREF(__pyx_v_fv); __Pyx_DECREF(*__pyx_t_10);
        *__pyx_t_10 = __pyx_v_fv;
        __Pyx_GIVEREF(*__pyx_t_10);
      }
      goto __pyx_L5;
    }
    /*else*/ {

      /* "pandas/src/generated.pyx":4461
 *                 out[i, j] = fv
 *         else:
 *             for j from 0 <= j < k:             # <<<<<<<<<<<<<<
 *                 if idx1[j] == -1:
 *                     out[i, j] = fv
 */
      __pyx_t_7 = __pyx_v_k;
      for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_7; __pyx_v_j++) {

        /* "pandas/src/generated.pyx":4462
 *         else:
 *             for j from 0 <= j < k:
 *                 if idx1[j] == -1:             # <<<<<<<<<<<<<<
 *                     out[i, j] = fv
 *                 else:
 */
        __pyx_t_11 = __pyx_v_j;
        __pyx_t_6 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_idx1.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_idx1.diminfo[0].strides)) == -1) != 0);
        if (__pyx_t_6) {

          /* "pandas/src/generated.pyx":4463
 *             for j from 0 <= j < k:
 *                 if idx1[j] == -1:
 *                     out[i, j] = fv             # <<<<<<<<<<<<<<
 *                 else:
 *                     out[i, j] = values[idx, idx1[j]]
 */
          __pyx_t_12 = __pyx_v_i;
          __pyx_t_13 = __pyx_v_j;
          __pyx_t_10 = __Pyx_BufPtrStrided2d(PyObject **, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_12, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_13, __pyx_pybuffernd_out.diminfo[1].strides);
          __Pyx_GOTREF(*__pyx_t_10);
          __Pyx_INCREF(__pyx_v_fv); __Pyx_DECREF(*__pyx_t_10);
          *__pyx_t_10 = __pyx_v_fv;
          __Pyx_GIVEREF(*__pyx_t_10);
          goto __pyx_L10;
        }
        /*else*/ {

          /* "pandas/src/generated.pyx":4465
 *                     out[i, j] = fv
 *                 else:
 *                     out[i, j] = values[idx, idx1[j]]             # <<<<<<<<<<<<<<
 * 
 * 
 */
          __pyx_t_14 = __pyx_v_j;
          __pyx_t_15 = __pyx_v_idx;
          __pyx_t_16 = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_idx1.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_idx1.diminfo[0].strides));
          __pyx_t_1 = (PyObject *) *__Pyx_BufPtrStrided2d(PyObject **, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_values.diminfo[0].strides, __pyx_t_16, __pyx_pybuffernd_values.diminfo[1].strides);
          __Pyx_INCREF((PyObject*)__pyx_t_1);
          __pyx_t_17 = __pyx_v_i;
          __pyx_t_18 = __pyx_v_j;
          __pyx_t_10 = __Pyx_BufPtrStrided2d(PyObject **, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_18, __pyx_pybuffernd_out.diminfo[1].strides);
          __Pyx_GOTREF(*__pyx_t_10);
          __Pyx_INCREF(__pyx_t_1); __Pyx_DECREF(*__pyx_t_10);
          *__pyx_t_10 = __pyx_t_1;
          __Pyx_GIVEREF(*__pyx_t_10);
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        }
        __pyx_L10:;
      }
    }
    __pyx_L5:;
  }

  /* "pandas/src/generated.pyx":4441
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def take_2d_multi_object_object(ndarray[object, ndim=2] values,             # <<<<<<<<<<<<<<
 *                                     indexer,
 *                                     ndarray[object, ndim=2] out,
 */

  /* function exit code */
  __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_pybuffernd_idx0.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_idx1.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas.algos.take_2d_multi_object_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_idx0.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_idx1.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer);
  __pyx_L2:;
  __Pyx_XDECREF((PyObject *)__pyx_v_idx0);
  __Pyx_XDECREF((PyObject *)__pyx_v_idx1);
  __Pyx_XDECREF(__pyx_v_fv);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/src/generated.pyx":4470
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def diff_2d_float64(ndarray[float64_t, ndim=2] arr,             # <<<<<<<<<<<<<<
 *                      ndarray[float64_t, ndim=2] out,
 *                     Py_ssize_t periods, int axis):
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pandas_5algos_375diff_2d_float64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_5algos_375diff_2d_float64 = {__Pyx_NAMESTR("diff_2d_float64"), (PyCFunction)__pyx_pw_6pandas_5algos_375diff_2d_float64, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pw_6pandas_5algos_375diff_2d_float64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyArrayObject *__pyx_v_arr = 0;
  PyArrayObject *__pyx_v_out = 0;
  Py_ssize_t __pyx_v_periods;
  int __pyx_v_axis;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("diff_2d_float64 (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_arr,&__pyx_n_s_out,&__pyx_n_s_periods,&__pyx_n_s_axis,0};
    PyObject* values[4] = {0,0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_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 (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_arr)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_out)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("diff_2d_float64", 1, 4, 4, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4470; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_periods)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("diff_2d_float64", 1, 4, 4, 2); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4470; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  3:
        if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_axis)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("diff_2d_float64", 1, 4, 4, 3); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4470; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "diff_2d_float64") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4470; __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_arr = ((PyArrayObject *)values[0]);
    __pyx_v_out = ((PyArrayObject *)values[1]);
    __pyx_v_periods = __Pyx_PyIndex_AsSsize_t(values[2]); if (unlikely((__pyx_v_periods == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4472; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_v_axis = __Pyx_PyInt_As_int(values[3]); if (unlikely((__pyx_v_axis == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4472; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("diff_2d_float64", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4470; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas.algos.diff_2d_float64", __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[2]; __pyx_lineno = 4470; __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[2]; __pyx_lineno = 4471; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_374diff_2d_float64(__pyx_self, __pyx_v_arr, __pyx_v_out, __pyx_v_periods, __pyx_v_axis);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pandas_5algos_374diff_2d_float64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_arr, PyArrayObject *__pyx_v_out, Py_ssize_t __pyx_v_periods, int __pyx_v_axis) {
  Py_ssize_t __pyx_v_i;
  Py_ssize_t __pyx_v_j;
  Py_ssize_t __pyx_v_sx;
  Py_ssize_t __pyx_v_sy;
  Py_ssize_t __pyx_v_start;
  Py_ssize_t __pyx_v_stop;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_arr;
  __Pyx_Buffer __pyx_pybuffer_arr;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_out;
  __Pyx_Buffer __pyx_pybuffer_out;
  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;
  int __pyx_t_8;
  Py_ssize_t __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;
  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;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("diff_2d_float64", 0);
  __pyx_pybuffer_arr.pybuffer.buf = NULL;
  __pyx_pybuffer_arr.refcount = 0;
  __pyx_pybuffernd_arr.data = NULL;
  __pyx_pybuffernd_arr.rcbuffer = &__pyx_pybuffer_arr;
  __pyx_pybuffer_out.pybuffer.buf = NULL;
  __pyx_pybuffer_out.refcount = 0;
  __pyx_pybuffernd_out.data = NULL;
  __pyx_pybuffernd_out.rcbuffer = &__pyx_pybuffer_out;
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_arr.rcbuffer->pybuffer, (PyObject*)__pyx_v_arr, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4470; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_arr.diminfo[0].strides = __pyx_pybuffernd_arr.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_arr.diminfo[0].shape = __pyx_pybuffernd_arr.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_arr.diminfo[1].strides = __pyx_pybuffernd_arr.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_arr.diminfo[1].shape = __pyx_pybuffernd_arr.rcbuffer->pybuffer.shape[1];
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_out.rcbuffer->pybuffer, (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[2]; __pyx_lineno = 4470; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_out.diminfo[0].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_out.diminfo[0].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_out.diminfo[1].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_out.diminfo[1].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[1];

  /* "pandas/src/generated.pyx":4476
 *         Py_ssize_t i, j, sx, sy
 * 
 *     sx, sy = (<object> arr).shape             # <<<<<<<<<<<<<<
 *     if arr.flags.f_contiguous:
 *         if axis == 0:
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_arr), __pyx_n_s_shape); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4476; __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 CYTHON_COMPILING_IN_CPYTHON
    Py_ssize_t size = Py_SIZE(sequence);
    #else
    Py_ssize_t size = PySequence_Size(sequence);
    #endif
    if (unlikely(size != 2)) {
      if (size > 2) __Pyx_RaiseTooManyValuesError(2);
      else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
      {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4476; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    #if CYTHON_COMPILING_IN_CPYTHON
    if (likely(PyTuple_CheckExact(sequence))) {
      __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); 
      __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1); 
    } else {
      __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);
    #else
    __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4476; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4476; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    #endif
    __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[2]; __pyx_lineno = 4476; __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_L3_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_L3_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_3);
    if (__Pyx_IternextUnpackEndCheck(__pyx_t_5(__pyx_t_4), 2) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4476; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_5 = NULL;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    goto __pyx_L4_unpacking_done;
    __pyx_L3_unpacking_failed:;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_5 = NULL;
    if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
    {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4476; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_L4_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[2]; __pyx_lineno = 4476; __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[2]; __pyx_lineno = 4476; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_v_sx = __pyx_t_6;
  __pyx_v_sy = __pyx_t_7;

  /* "pandas/src/generated.pyx":4477
 * 
 *     sx, sy = (<object> arr).shape
 *     if arr.flags.f_contiguous:             # <<<<<<<<<<<<<<
 *         if axis == 0:
 *             if periods >= 0:
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_arr), __pyx_n_s_flags); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4477; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_f_contiguous); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4477; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4477; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (__pyx_t_8) {

    /* "pandas/src/generated.pyx":4478
 *     sx, sy = (<object> arr).shape
 *     if arr.flags.f_contiguous:
 *         if axis == 0:             # <<<<<<<<<<<<<<
 *             if periods >= 0:
 *                 start, stop = periods, sx
 */
    __pyx_t_8 = ((__pyx_v_axis == 0) != 0);
    if (__pyx_t_8) {

      /* "pandas/src/generated.pyx":4479
 *     if arr.flags.f_contiguous:
 *         if axis == 0:
 *             if periods >= 0:             # <<<<<<<<<<<<<<
 *                 start, stop = periods, sx
 *             else:
 */
      __pyx_t_8 = ((__pyx_v_periods >= 0) != 0);
      if (__pyx_t_8) {

        /* "pandas/src/generated.pyx":4480
 *         if axis == 0:
 *             if periods >= 0:
 *                 start, stop = periods, sx             # <<<<<<<<<<<<<<
 *             else:
 *                 start, stop = 0, sx + periods
 */
        __pyx_t_7 = __pyx_v_periods;
        __pyx_t_6 = __pyx_v_sx;
        __pyx_v_start = __pyx_t_7;
        __pyx_v_stop = __pyx_t_6;
        goto __pyx_L7;
      }
      /*else*/ {

        /* "pandas/src/generated.pyx":4482
 *                 start, stop = periods, sx
 *             else:
 *                 start, stop = 0, sx + periods             # <<<<<<<<<<<<<<
 *             for j in range(sy):
 *                 for i in range(start, stop):
 */
        __pyx_t_6 = 0;
        __pyx_t_7 = (__pyx_v_sx + __pyx_v_periods);
        __pyx_v_start = __pyx_t_6;
        __pyx_v_stop = __pyx_t_7;
      }
      __pyx_L7:;

      /* "pandas/src/generated.pyx":4483
 *             else:
 *                 start, stop = 0, sx + periods
 *             for j in range(sy):             # <<<<<<<<<<<<<<
 *                 for i in range(start, stop):
 *                     out[i, j] = arr[i, j] - arr[i - periods, j]
 */
      __pyx_t_7 = __pyx_v_sy;
      for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_7; __pyx_t_6+=1) {
        __pyx_v_j = __pyx_t_6;

        /* "pandas/src/generated.pyx":4484
 *                 start, stop = 0, sx + periods
 *             for j in range(sy):
 *                 for i in range(start, stop):             # <<<<<<<<<<<<<<
 *                     out[i, j] = arr[i, j] - arr[i - periods, j]
 *         else:
 */
        __pyx_t_9 = __pyx_v_stop;
        for (__pyx_t_10 = __pyx_v_start; __pyx_t_10 < __pyx_t_9; __pyx_t_10+=1) {
          __pyx_v_i = __pyx_t_10;

          /* "pandas/src/generated.pyx":4485
 *             for j in range(sy):
 *                 for i in range(start, stop):
 *                     out[i, j] = arr[i, j] - arr[i - periods, j]             # <<<<<<<<<<<<<<
 *         else:
 *             if periods >= 0:
 */
          __pyx_t_11 = __pyx_v_i;
          __pyx_t_12 = __pyx_v_j;
          __pyx_t_13 = (__pyx_v_i - __pyx_v_periods);
          __pyx_t_14 = __pyx_v_j;
          __pyx_t_15 = __pyx_v_i;
          __pyx_t_16 = __pyx_v_j;
          *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_16, __pyx_pybuffernd_out.diminfo[1].strides) = ((*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_arr.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_arr.diminfo[0].strides, __pyx_t_12, __pyx_pybuffernd_arr.diminfo[1].strides)) - (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_arr.rcbuffer->pybuffer.buf, __pyx_t_13, __pyx_pybuffernd_arr.diminfo[0].strides, __pyx_t_14, __pyx_pybuffernd_arr.diminfo[1].strides)));
        }
      }
      goto __pyx_L6;
    }
    /*else*/ {

      /* "pandas/src/generated.pyx":4487
 *                     out[i, j] = arr[i, j] - arr[i - periods, j]
 *         else:
 *             if periods >= 0:             # <<<<<<<<<<<<<<
 *                 start, stop = periods, sy
 *             else:
 */
      __pyx_t_8 = ((__pyx_v_periods >= 0) != 0);
      if (__pyx_t_8) {

        /* "pandas/src/generated.pyx":4488
 *         else:
 *             if periods >= 0:
 *                 start, stop = periods, sy             # <<<<<<<<<<<<<<
 *             else:
 *                 start, stop = 0, sy + periods
 */
        __pyx_t_7 = __pyx_v_periods;
        __pyx_t_6 = __pyx_v_sy;
        __pyx_v_start = __pyx_t_7;
        __pyx_v_stop = __pyx_t_6;
        goto __pyx_L12;
      }
      /*else*/ {

        /* "pandas/src/generated.pyx":4490
 *                 start, stop = periods, sy
 *             else:
 *                 start, stop = 0, sy + periods             # <<<<<<<<<<<<<<
 *             for j in range(start, stop):
 *                 for i in range(sx):
 */
        __pyx_t_6 = 0;
        __pyx_t_7 = (__pyx_v_sy + __pyx_v_periods);
        __pyx_v_start = __pyx_t_6;
        __pyx_v_stop = __pyx_t_7;
      }
      __pyx_L12:;

      /* "pandas/src/generated.pyx":4491
 *             else:
 *                 start, stop = 0, sy + periods
 *             for j in range(start, stop):             # <<<<<<<<<<<<<<
 *                 for i in range(sx):
 *                     out[i, j] = arr[i, j] - arr[i, j - periods]
 */
      __pyx_t_7 = __pyx_v_stop;
      for (__pyx_t_6 = __pyx_v_start; __pyx_t_6 < __pyx_t_7; __pyx_t_6+=1) {
        __pyx_v_j = __pyx_t_6;

        /* "pandas/src/generated.pyx":4492
 *                 start, stop = 0, sy + periods
 *             for j in range(start, stop):
 *                 for i in range(sx):             # <<<<<<<<<<<<<<
 *                     out[i, j] = arr[i, j] - arr[i, j - periods]
 *     else:
 */
        __pyx_t_9 = __pyx_v_sx;
        for (__pyx_t_10 = 0; __pyx_t_10 < __pyx_t_9; __pyx_t_10+=1) {
          __pyx_v_i = __pyx_t_10;

          /* "pandas/src/generated.pyx":4493
 *             for j in range(start, stop):
 *                 for i in range(sx):
 *                     out[i, j] = arr[i, j] - arr[i, j - periods]             # <<<<<<<<<<<<<<
 *     else:
 *         if axis == 0:
 */
          __pyx_t_17 = __pyx_v_i;
          __pyx_t_18 = __pyx_v_j;
          __pyx_t_19 = __pyx_v_i;
          __pyx_t_20 = (__pyx_v_j - __pyx_v_periods);
          __pyx_t_21 = __pyx_v_i;
          __pyx_t_22 = __pyx_v_j;
          *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_22, __pyx_pybuffernd_out.diminfo[1].strides) = ((*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_arr.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_arr.diminfo[0].strides, __pyx_t_18, __pyx_pybuffernd_arr.diminfo[1].strides)) - (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_arr.rcbuffer->pybuffer.buf, __pyx_t_19, __pyx_pybuffernd_arr.diminfo[0].strides, __pyx_t_20, __pyx_pybuffernd_arr.diminfo[1].strides)));
        }
      }
    }
    __pyx_L6:;
    goto __pyx_L5;
  }
  /*else*/ {

    /* "pandas/src/generated.pyx":4495
 *                     out[i, j] = arr[i, j] - arr[i, j - periods]
 *     else:
 *         if axis == 0:             # <<<<<<<<<<<<<<
 *             if periods >= 0:
 *                 start, stop = periods, sx
 */
    __pyx_t_8 = ((__pyx_v_axis == 0) != 0);
    if (__pyx_t_8) {

      /* "pandas/src/generated.pyx":4496
 *     else:
 *         if axis == 0:
 *             if periods >= 0:             # <<<<<<<<<<<<<<
 *                 start, stop = periods, sx
 *             else:
 */
      __pyx_t_8 = ((__pyx_v_periods >= 0) != 0);
      if (__pyx_t_8) {

        /* "pandas/src/generated.pyx":4497
 *         if axis == 0:
 *             if periods >= 0:
 *                 start, stop = periods, sx             # <<<<<<<<<<<<<<
 *             else:
 *                 start, stop = 0, sx + periods
 */
        __pyx_t_7 = __pyx_v_periods;
        __pyx_t_6 = __pyx_v_sx;
        __pyx_v_start = __pyx_t_7;
        __pyx_v_stop = __pyx_t_6;
        goto __pyx_L18;
      }
      /*else*/ {

        /* "pandas/src/generated.pyx":4499
 *                 start, stop = periods, sx
 *             else:
 *                 start, stop = 0, sx + periods             # <<<<<<<<<<<<<<
 *             for i in range(start, stop):
 *                 for j in range(sy):
 */
        __pyx_t_6 = 0;
        __pyx_t_7 = (__pyx_v_sx + __pyx_v_periods);
        __pyx_v_start = __pyx_t_6;
        __pyx_v_stop = __pyx_t_7;
      }
      __pyx_L18:;

      /* "pandas/src/generated.pyx":4500
 *             else:
 *                 start, stop = 0, sx + periods
 *             for i in range(start, stop):             # <<<<<<<<<<<<<<
 *                 for j in range(sy):
 *                     out[i, j] = arr[i, j] - arr[i - periods, j]
 */
      __pyx_t_7 = __pyx_v_stop;
      for (__pyx_t_6 = __pyx_v_start; __pyx_t_6 < __pyx_t_7; __pyx_t_6+=1) {
        __pyx_v_i = __pyx_t_6;

        /* "pandas/src/generated.pyx":4501
 *                 start, stop = 0, sx + periods
 *             for i in range(start, stop):
 *                 for j in range(sy):             # <<<<<<<<<<<<<<
 *                     out[i, j] = arr[i, j] - arr[i - periods, j]
 *         else:
 */
        __pyx_t_9 = __pyx_v_sy;
        for (__pyx_t_10 = 0; __pyx_t_10 < __pyx_t_9; __pyx_t_10+=1) {
          __pyx_v_j = __pyx_t_10;

          /* "pandas/src/generated.pyx":4502
 *             for i in range(start, stop):
 *                 for j in range(sy):
 *                     out[i, j] = arr[i, j] - arr[i - periods, j]             # <<<<<<<<<<<<<<
 *         else:
 *             if periods >= 0:
 */
          __pyx_t_23 = __pyx_v_i;
          __pyx_t_24 = __pyx_v_j;
          __pyx_t_25 = (__pyx_v_i - __pyx_v_periods);
          __pyx_t_26 = __pyx_v_j;
          __pyx_t_27 = __pyx_v_i;
          __pyx_t_28 = __pyx_v_j;
          *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_27, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_28, __pyx_pybuffernd_out.diminfo[1].strides) = ((*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_arr.rcbuffer->pybuffer.buf, __pyx_t_23, __pyx_pybuffernd_arr.diminfo[0].strides, __pyx_t_24, __pyx_pybuffernd_arr.diminfo[1].strides)) - (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_arr.rcbuffer->pybuffer.buf, __pyx_t_25, __pyx_pybuffernd_arr.diminfo[0].strides, __pyx_t_26, __pyx_pybuffernd_arr.diminfo[1].strides)));
        }
      }
      goto __pyx_L17;
    }
    /*else*/ {

      /* "pandas/src/generated.pyx":4504
 *                     out[i, j] = arr[i, j] - arr[i - periods, j]
 *         else:
 *             if periods >= 0:             # <<<<<<<<<<<<<<
 *                 start, stop = periods, sy
 *             else:
 */
      __pyx_t_8 = ((__pyx_v_periods >= 0) != 0);
      if (__pyx_t_8) {

        /* "pandas/src/generated.pyx":4505
 *         else:
 *             if periods >= 0:
 *                 start, stop = periods, sy             # <<<<<<<<<<<<<<
 *             else:
 *                 start, stop = 0, sy + periods
 */
        __pyx_t_7 = __pyx_v_periods;
        __pyx_t_6 = __pyx_v_sy;
        __pyx_v_start = __pyx_t_7;
        __pyx_v_stop = __pyx_t_6;
        goto __pyx_L23;
      }
      /*else*/ {

        /* "pandas/src/generated.pyx":4507
 *                 start, stop = periods, sy
 *             else:
 *                 start, stop = 0, sy + periods             # <<<<<<<<<<<<<<
 *             for i in range(sx):
 *                 for j in range(start, stop):
 */
        __pyx_t_6 = 0;
        __pyx_t_7 = (__pyx_v_sy + __pyx_v_periods);
        __pyx_v_start = __pyx_t_6;
        __pyx_v_stop = __pyx_t_7;
      }
      __pyx_L23:;

      /* "pandas/src/generated.pyx":4508
 *             else:
 *                 start, stop = 0, sy + periods
 *             for i in range(sx):             # <<<<<<<<<<<<<<
 *                 for j in range(start, stop):
 *                     out[i, j] = arr[i, j] - arr[i, j - periods]
 */
      __pyx_t_7 = __pyx_v_sx;
      for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_7; __pyx_t_6+=1) {
        __pyx_v_i = __pyx_t_6;

        /* "pandas/src/generated.pyx":4509
 *                 start, stop = 0, sy + periods
 *             for i in range(sx):
 *                 for j in range(start, stop):             # <<<<<<<<<<<<<<
 *                     out[i, j] = arr[i, j] - arr[i, j - periods]
 * @cython.boundscheck(False)
 */
        __pyx_t_9 = __pyx_v_stop;
        for (__pyx_t_10 = __pyx_v_start; __pyx_t_10 < __pyx_t_9; __pyx_t_10+=1) {
          __pyx_v_j = __pyx_t_10;

          /* "pandas/src/generated.pyx":4510
 *             for i in range(sx):
 *                 for j in range(start, stop):
 *                     out[i, j] = arr[i, j] - arr[i, j - periods]             # <<<<<<<<<<<<<<
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 */
          __pyx_t_29 = __pyx_v_i;
          __pyx_t_30 = __pyx_v_j;
          __pyx_t_31 = __pyx_v_i;
          __pyx_t_32 = (__pyx_v_j - __pyx_v_periods);
          __pyx_t_33 = __pyx_v_i;
          __pyx_t_34 = __pyx_v_j;
          *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_33, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_34, __pyx_pybuffernd_out.diminfo[1].strides) = ((*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_arr.rcbuffer->pybuffer.buf, __pyx_t_29, __pyx_pybuffernd_arr.diminfo[0].strides, __pyx_t_30, __pyx_pybuffernd_arr.diminfo[1].strides)) - (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_arr.rcbuffer->pybuffer.buf, __pyx_t_31, __pyx_pybuffernd_arr.diminfo[0].strides, __pyx_t_32, __pyx_pybuffernd_arr.diminfo[1].strides)));
        }
      }
    }
    __pyx_L17:;
  }
  __pyx_L5:;

  /* "pandas/src/generated.pyx":4470
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def diff_2d_float64(ndarray[float64_t, ndim=2] arr,             # <<<<<<<<<<<<<<
 *                      ndarray[float64_t, ndim=2] out,
 *                     Py_ssize_t periods, int axis):
 */

  /* function exit code */
  __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_pybuffernd_arr.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas.algos.diff_2d_float64", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_arr.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer);
  __pyx_L2:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/src/generated.pyx":4513
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def diff_2d_float32(ndarray[float32_t, ndim=2] arr,             # <<<<<<<<<<<<<<
 *                      ndarray[float32_t, ndim=2] out,
 *                     Py_ssize_t periods, int axis):
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pandas_5algos_377diff_2d_float32(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_5algos_377diff_2d_float32 = {__Pyx_NAMESTR("diff_2d_float32"), (PyCFunction)__pyx_pw_6pandas_5algos_377diff_2d_float32, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pw_6pandas_5algos_377diff_2d_float32(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyArrayObject *__pyx_v_arr = 0;
  PyArrayObject *__pyx_v_out = 0;
  Py_ssize_t __pyx_v_periods;
  int __pyx_v_axis;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("diff_2d_float32 (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_arr,&__pyx_n_s_out,&__pyx_n_s_periods,&__pyx_n_s_axis,0};
    PyObject* values[4] = {0,0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_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 (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_arr)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_out)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("diff_2d_float32", 1, 4, 4, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4513; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_periods)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("diff_2d_float32", 1, 4, 4, 2); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4513; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  3:
        if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_axis)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("diff_2d_float32", 1, 4, 4, 3); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4513; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "diff_2d_float32") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4513; __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_arr = ((PyArrayObject *)values[0]);
    __pyx_v_out = ((PyArrayObject *)values[1]);
    __pyx_v_periods = __Pyx_PyIndex_AsSsize_t(values[2]); if (unlikely((__pyx_v_periods == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4515; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_v_axis = __Pyx_PyInt_As_int(values[3]); if (unlikely((__pyx_v_axis == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4515; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("diff_2d_float32", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4513; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas.algos.diff_2d_float32", __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[2]; __pyx_lineno = 4513; __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[2]; __pyx_lineno = 4514; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_376diff_2d_float32(__pyx_self, __pyx_v_arr, __pyx_v_out, __pyx_v_periods, __pyx_v_axis);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pandas_5algos_376diff_2d_float32(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_arr, PyArrayObject *__pyx_v_out, Py_ssize_t __pyx_v_periods, int __pyx_v_axis) {
  Py_ssize_t __pyx_v_i;
  Py_ssize_t __pyx_v_j;
  Py_ssize_t __pyx_v_sx;
  Py_ssize_t __pyx_v_sy;
  Py_ssize_t __pyx_v_start;
  Py_ssize_t __pyx_v_stop;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_arr;
  __Pyx_Buffer __pyx_pybuffer_arr;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_out;
  __Pyx_Buffer __pyx_pybuffer_out;
  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;
  int __pyx_t_8;
  Py_ssize_t __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;
  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;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("diff_2d_float32", 0);
  __pyx_pybuffer_arr.pybuffer.buf = NULL;
  __pyx_pybuffer_arr.refcount = 0;
  __pyx_pybuffernd_arr.data = NULL;
  __pyx_pybuffernd_arr.rcbuffer = &__pyx_pybuffer_arr;
  __pyx_pybuffer_out.pybuffer.buf = NULL;
  __pyx_pybuffer_out.refcount = 0;
  __pyx_pybuffernd_out.data = NULL;
  __pyx_pybuffernd_out.rcbuffer = &__pyx_pybuffer_out;
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_arr.rcbuffer->pybuffer, (PyObject*)__pyx_v_arr, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4513; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_arr.diminfo[0].strides = __pyx_pybuffernd_arr.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_arr.diminfo[0].shape = __pyx_pybuffernd_arr.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_arr.diminfo[1].strides = __pyx_pybuffernd_arr.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_arr.diminfo[1].shape = __pyx_pybuffernd_arr.rcbuffer->pybuffer.shape[1];
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_out.rcbuffer->pybuffer, (PyObject*)__pyx_v_out, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4513; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_out.diminfo[0].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_out.diminfo[0].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_out.diminfo[1].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_out.diminfo[1].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[1];

  /* "pandas/src/generated.pyx":4519
 *         Py_ssize_t i, j, sx, sy
 * 
 *     sx, sy = (<object> arr).shape             # <<<<<<<<<<<<<<
 *     if arr.flags.f_contiguous:
 *         if axis == 0:
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_arr), __pyx_n_s_shape); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4519; __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 CYTHON_COMPILING_IN_CPYTHON
    Py_ssize_t size = Py_SIZE(sequence);
    #else
    Py_ssize_t size = PySequence_Size(sequence);
    #endif
    if (unlikely(size != 2)) {
      if (size > 2) __Pyx_RaiseTooManyValuesError(2);
      else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
      {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4519; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    #if CYTHON_COMPILING_IN_CPYTHON
    if (likely(PyTuple_CheckExact(sequence))) {
      __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); 
      __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1); 
    } else {
      __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);
    #else
    __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4519; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4519; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    #endif
    __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[2]; __pyx_lineno = 4519; __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_L3_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_L3_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_3);
    if (__Pyx_IternextUnpackEndCheck(__pyx_t_5(__pyx_t_4), 2) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4519; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_5 = NULL;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    goto __pyx_L4_unpacking_done;
    __pyx_L3_unpacking_failed:;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_5 = NULL;
    if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
    {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4519; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_L4_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[2]; __pyx_lineno = 4519; __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[2]; __pyx_lineno = 4519; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_v_sx = __pyx_t_6;
  __pyx_v_sy = __pyx_t_7;

  /* "pandas/src/generated.pyx":4520
 * 
 *     sx, sy = (<object> arr).shape
 *     if arr.flags.f_contiguous:             # <<<<<<<<<<<<<<
 *         if axis == 0:
 *             if periods >= 0:
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_arr), __pyx_n_s_flags); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4520; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_f_contiguous); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4520; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4520; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (__pyx_t_8) {

    /* "pandas/src/generated.pyx":4521
 *     sx, sy = (<object> arr).shape
 *     if arr.flags.f_contiguous:
 *         if axis == 0:             # <<<<<<<<<<<<<<
 *             if periods >= 0:
 *                 start, stop = periods, sx
 */
    __pyx_t_8 = ((__pyx_v_axis == 0) != 0);
    if (__pyx_t_8) {

      /* "pandas/src/generated.pyx":4522
 *     if arr.flags.f_contiguous:
 *         if axis == 0:
 *             if periods >= 0:             # <<<<<<<<<<<<<<
 *                 start, stop = periods, sx
 *             else:
 */
      __pyx_t_8 = ((__pyx_v_periods >= 0) != 0);
      if (__pyx_t_8) {

        /* "pandas/src/generated.pyx":4523
 *         if axis == 0:
 *             if periods >= 0:
 *                 start, stop = periods, sx             # <<<<<<<<<<<<<<
 *             else:
 *                 start, stop = 0, sx + periods
 */
        __pyx_t_7 = __pyx_v_periods;
        __pyx_t_6 = __pyx_v_sx;
        __pyx_v_start = __pyx_t_7;
        __pyx_v_stop = __pyx_t_6;
        goto __pyx_L7;
      }
      /*else*/ {

        /* "pandas/src/generated.pyx":4525
 *                 start, stop = periods, sx
 *             else:
 *                 start, stop = 0, sx + periods             # <<<<<<<<<<<<<<
 *             for j in range(sy):
 *                 for i in range(start, stop):
 */
        __pyx_t_6 = 0;
        __pyx_t_7 = (__pyx_v_sx + __pyx_v_periods);
        __pyx_v_start = __pyx_t_6;
        __pyx_v_stop = __pyx_t_7;
      }
      __pyx_L7:;

      /* "pandas/src/generated.pyx":4526
 *             else:
 *                 start, stop = 0, sx + periods
 *             for j in range(sy):             # <<<<<<<<<<<<<<
 *                 for i in range(start, stop):
 *                     out[i, j] = arr[i, j] - arr[i - periods, j]
 */
      __pyx_t_7 = __pyx_v_sy;
      for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_7; __pyx_t_6+=1) {
        __pyx_v_j = __pyx_t_6;

        /* "pandas/src/generated.pyx":4527
 *                 start, stop = 0, sx + periods
 *             for j in range(sy):
 *                 for i in range(start, stop):             # <<<<<<<<<<<<<<
 *                     out[i, j] = arr[i, j] - arr[i - periods, j]
 *         else:
 */
        __pyx_t_9 = __pyx_v_stop;
        for (__pyx_t_10 = __pyx_v_start; __pyx_t_10 < __pyx_t_9; __pyx_t_10+=1) {
          __pyx_v_i = __pyx_t_10;

          /* "pandas/src/generated.pyx":4528
 *             for j in range(sy):
 *                 for i in range(start, stop):
 *                     out[i, j] = arr[i, j] - arr[i - periods, j]             # <<<<<<<<<<<<<<
 *         else:
 *             if periods >= 0:
 */
          __pyx_t_11 = __pyx_v_i;
          __pyx_t_12 = __pyx_v_j;
          __pyx_t_13 = (__pyx_v_i - __pyx_v_periods);
          __pyx_t_14 = __pyx_v_j;
          __pyx_t_15 = __pyx_v_i;
          __pyx_t_16 = __pyx_v_j;
          *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_16, __pyx_pybuffernd_out.diminfo[1].strides) = ((*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_arr.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_arr.diminfo[0].strides, __pyx_t_12, __pyx_pybuffernd_arr.diminfo[1].strides)) - (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_arr.rcbuffer->pybuffer.buf, __pyx_t_13, __pyx_pybuffernd_arr.diminfo[0].strides, __pyx_t_14, __pyx_pybuffernd_arr.diminfo[1].strides)));
        }
      }
      goto __pyx_L6;
    }
    /*else*/ {

      /* "pandas/src/generated.pyx":4530
 *                     out[i, j] = arr[i, j] - arr[i - periods, j]
 *         else:
 *             if periods >= 0:             # <<<<<<<<<<<<<<
 *                 start, stop = periods, sy
 *             else:
 */
      __pyx_t_8 = ((__pyx_v_periods >= 0) != 0);
      if (__pyx_t_8) {

        /* "pandas/src/generated.pyx":4531
 *         else:
 *             if periods >= 0:
 *                 start, stop = periods, sy             # <<<<<<<<<<<<<<
 *             else:
 *                 start, stop = 0, sy + periods
 */
        __pyx_t_7 = __pyx_v_periods;
        __pyx_t_6 = __pyx_v_sy;
        __pyx_v_start = __pyx_t_7;
        __pyx_v_stop = __pyx_t_6;
        goto __pyx_L12;
      }
      /*else*/ {

        /* "pandas/src/generated.pyx":4533
 *                 start, stop = periods, sy
 *             else:
 *                 start, stop = 0, sy + periods             # <<<<<<<<<<<<<<
 *             for j in range(start, stop):
 *                 for i in range(sx):
 */
        __pyx_t_6 = 0;
        __pyx_t_7 = (__pyx_v_sy + __pyx_v_periods);
        __pyx_v_start = __pyx_t_6;
        __pyx_v_stop = __pyx_t_7;
      }
      __pyx_L12:;

      /* "pandas/src/generated.pyx":4534
 *             else:
 *                 start, stop = 0, sy + periods
 *             for j in range(start, stop):             # <<<<<<<<<<<<<<
 *                 for i in range(sx):
 *                     out[i, j] = arr[i, j] - arr[i, j - periods]
 */
      __pyx_t_7 = __pyx_v_stop;
      for (__pyx_t_6 = __pyx_v_start; __pyx_t_6 < __pyx_t_7; __pyx_t_6+=1) {
        __pyx_v_j = __pyx_t_6;

        /* "pandas/src/generated.pyx":4535
 *                 start, stop = 0, sy + periods
 *             for j in range(start, stop):
 *                 for i in range(sx):             # <<<<<<<<<<<<<<
 *                     out[i, j] = arr[i, j] - arr[i, j - periods]
 *     else:
 */
        __pyx_t_9 = __pyx_v_sx;
        for (__pyx_t_10 = 0; __pyx_t_10 < __pyx_t_9; __pyx_t_10+=1) {
          __pyx_v_i = __pyx_t_10;

          /* "pandas/src/generated.pyx":4536
 *             for j in range(start, stop):
 *                 for i in range(sx):
 *                     out[i, j] = arr[i, j] - arr[i, j - periods]             # <<<<<<<<<<<<<<
 *     else:
 *         if axis == 0:
 */
          __pyx_t_17 = __pyx_v_i;
          __pyx_t_18 = __pyx_v_j;
          __pyx_t_19 = __pyx_v_i;
          __pyx_t_20 = (__pyx_v_j - __pyx_v_periods);
          __pyx_t_21 = __pyx_v_i;
          __pyx_t_22 = __pyx_v_j;
          *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_22, __pyx_pybuffernd_out.diminfo[1].strides) = ((*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_arr.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_arr.diminfo[0].strides, __pyx_t_18, __pyx_pybuffernd_arr.diminfo[1].strides)) - (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_arr.rcbuffer->pybuffer.buf, __pyx_t_19, __pyx_pybuffernd_arr.diminfo[0].strides, __pyx_t_20, __pyx_pybuffernd_arr.diminfo[1].strides)));
        }
      }
    }
    __pyx_L6:;
    goto __pyx_L5;
  }
  /*else*/ {

    /* "pandas/src/generated.pyx":4538
 *                     out[i, j] = arr[i, j] - arr[i, j - periods]
 *     else:
 *         if axis == 0:             # <<<<<<<<<<<<<<
 *             if periods >= 0:
 *                 start, stop = periods, sx
 */
    __pyx_t_8 = ((__pyx_v_axis == 0) != 0);
    if (__pyx_t_8) {

      /* "pandas/src/generated.pyx":4539
 *     else:
 *         if axis == 0:
 *             if periods >= 0:             # <<<<<<<<<<<<<<
 *                 start, stop = periods, sx
 *             else:
 */
      __pyx_t_8 = ((__pyx_v_periods >= 0) != 0);
      if (__pyx_t_8) {

        /* "pandas/src/generated.pyx":4540
 *         if axis == 0:
 *             if periods >= 0:
 *                 start, stop = periods, sx             # <<<<<<<<<<<<<<
 *             else:
 *                 start, stop = 0, sx + periods
 */
        __pyx_t_7 = __pyx_v_periods;
        __pyx_t_6 = __pyx_v_sx;
        __pyx_v_start = __pyx_t_7;
        __pyx_v_stop = __pyx_t_6;
        goto __pyx_L18;
      }
      /*else*/ {

        /* "pandas/src/generated.pyx":4542
 *                 start, stop = periods, sx
 *             else:
 *                 start, stop = 0, sx + periods             # <<<<<<<<<<<<<<
 *             for i in range(start, stop):
 *                 for j in range(sy):
 */
        __pyx_t_6 = 0;
        __pyx_t_7 = (__pyx_v_sx + __pyx_v_periods);
        __pyx_v_start = __pyx_t_6;
        __pyx_v_stop = __pyx_t_7;
      }
      __pyx_L18:;

      /* "pandas/src/generated.pyx":4543
 *             else:
 *                 start, stop = 0, sx + periods
 *             for i in range(start, stop):             # <<<<<<<<<<<<<<
 *                 for j in range(sy):
 *                     out[i, j] = arr[i, j] - arr[i - periods, j]
 */
      __pyx_t_7 = __pyx_v_stop;
      for (__pyx_t_6 = __pyx_v_start; __pyx_t_6 < __pyx_t_7; __pyx_t_6+=1) {
        __pyx_v_i = __pyx_t_6;

        /* "pandas/src/generated.pyx":4544
 *                 start, stop = 0, sx + periods
 *             for i in range(start, stop):
 *                 for j in range(sy):             # <<<<<<<<<<<<<<
 *                     out[i, j] = arr[i, j] - arr[i - periods, j]
 *         else:
 */
        __pyx_t_9 = __pyx_v_sy;
        for (__pyx_t_10 = 0; __pyx_t_10 < __pyx_t_9; __pyx_t_10+=1) {
          __pyx_v_j = __pyx_t_10;

          /* "pandas/src/generated.pyx":4545
 *             for i in range(start, stop):
 *                 for j in range(sy):
 *                     out[i, j] = arr[i, j] - arr[i - periods, j]             # <<<<<<<<<<<<<<
 *         else:
 *             if periods >= 0:
 */
          __pyx_t_23 = __pyx_v_i;
          __pyx_t_24 = __pyx_v_j;
          __pyx_t_25 = (__pyx_v_i - __pyx_v_periods);
          __pyx_t_26 = __pyx_v_j;
          __pyx_t_27 = __pyx_v_i;
          __pyx_t_28 = __pyx_v_j;
          *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_27, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_28, __pyx_pybuffernd_out.diminfo[1].strides) = ((*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_arr.rcbuffer->pybuffer.buf, __pyx_t_23, __pyx_pybuffernd_arr.diminfo[0].strides, __pyx_t_24, __pyx_pybuffernd_arr.diminfo[1].strides)) - (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_arr.rcbuffer->pybuffer.buf, __pyx_t_25, __pyx_pybuffernd_arr.diminfo[0].strides, __pyx_t_26, __pyx_pybuffernd_arr.diminfo[1].strides)));
        }
      }
      goto __pyx_L17;
    }
    /*else*/ {

      /* "pandas/src/generated.pyx":4547
 *                     out[i, j] = arr[i, j] - arr[i - periods, j]
 *         else:
 *             if periods >= 0:             # <<<<<<<<<<<<<<
 *                 start, stop = periods, sy
 *             else:
 */
      __pyx_t_8 = ((__pyx_v_periods >= 0) != 0);
      if (__pyx_t_8) {

        /* "pandas/src/generated.pyx":4548
 *         else:
 *             if periods >= 0:
 *                 start, stop = periods, sy             # <<<<<<<<<<<<<<
 *             else:
 *                 start, stop = 0, sy + periods
 */
        __pyx_t_7 = __pyx_v_periods;
        __pyx_t_6 = __pyx_v_sy;
        __pyx_v_start = __pyx_t_7;
        __pyx_v_stop = __pyx_t_6;
        goto __pyx_L23;
      }
      /*else*/ {

        /* "pandas/src/generated.pyx":4550
 *                 start, stop = periods, sy
 *             else:
 *                 start, stop = 0, sy + periods             # <<<<<<<<<<<<<<
 *             for i in range(sx):
 *                 for j in range(start, stop):
 */
        __pyx_t_6 = 0;
        __pyx_t_7 = (__pyx_v_sy + __pyx_v_periods);
        __pyx_v_start = __pyx_t_6;
        __pyx_v_stop = __pyx_t_7;
      }
      __pyx_L23:;

      /* "pandas/src/generated.pyx":4551
 *             else:
 *                 start, stop = 0, sy + periods
 *             for i in range(sx):             # <<<<<<<<<<<<<<
 *                 for j in range(start, stop):
 *                     out[i, j] = arr[i, j] - arr[i, j - periods]
 */
      __pyx_t_7 = __pyx_v_sx;
      for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_7; __pyx_t_6+=1) {
        __pyx_v_i = __pyx_t_6;

        /* "pandas/src/generated.pyx":4552
 *                 start, stop = 0, sy + periods
 *             for i in range(sx):
 *                 for j in range(start, stop):             # <<<<<<<<<<<<<<
 *                     out[i, j] = arr[i, j] - arr[i, j - periods]
 * @cython.boundscheck(False)
 */
        __pyx_t_9 = __pyx_v_stop;
        for (__pyx_t_10 = __pyx_v_start; __pyx_t_10 < __pyx_t_9; __pyx_t_10+=1) {
          __pyx_v_j = __pyx_t_10;

          /* "pandas/src/generated.pyx":4553
 *             for i in range(sx):
 *                 for j in range(start, stop):
 *                     out[i, j] = arr[i, j] - arr[i, j - periods]             # <<<<<<<<<<<<<<
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 */
          __pyx_t_29 = __pyx_v_i;
          __pyx_t_30 = __pyx_v_j;
          __pyx_t_31 = __pyx_v_i;
          __pyx_t_32 = (__pyx_v_j - __pyx_v_periods);
          __pyx_t_33 = __pyx_v_i;
          __pyx_t_34 = __pyx_v_j;
          *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_33, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_34, __pyx_pybuffernd_out.diminfo[1].strides) = ((*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_arr.rcbuffer->pybuffer.buf, __pyx_t_29, __pyx_pybuffernd_arr.diminfo[0].strides, __pyx_t_30, __pyx_pybuffernd_arr.diminfo[1].strides)) - (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_arr.rcbuffer->pybuffer.buf, __pyx_t_31, __pyx_pybuffernd_arr.diminfo[0].strides, __pyx_t_32, __pyx_pybuffernd_arr.diminfo[1].strides)));
        }
      }
    }
    __pyx_L17:;
  }
  __pyx_L5:;

  /* "pandas/src/generated.pyx":4513
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def diff_2d_float32(ndarray[float32_t, ndim=2] arr,             # <<<<<<<<<<<<<<
 *                      ndarray[float32_t, ndim=2] out,
 *                     Py_ssize_t periods, int axis):
 */

  /* function exit code */
  __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_pybuffernd_arr.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas.algos.diff_2d_float32", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_arr.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer);
  __pyx_L2:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/src/generated.pyx":4556
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def diff_2d_int8(ndarray[int8_t, ndim=2] arr,             # <<<<<<<<<<<<<<
 *                      ndarray[float32_t, ndim=2] out,
 *                     Py_ssize_t periods, int axis):
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pandas_5algos_379diff_2d_int8(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_5algos_379diff_2d_int8 = {__Pyx_NAMESTR("diff_2d_int8"), (PyCFunction)__pyx_pw_6pandas_5algos_379diff_2d_int8, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pw_6pandas_5algos_379diff_2d_int8(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyArrayObject *__pyx_v_arr = 0;
  PyArrayObject *__pyx_v_out = 0;
  Py_ssize_t __pyx_v_periods;
  int __pyx_v_axis;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("diff_2d_int8 (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_arr,&__pyx_n_s_out,&__pyx_n_s_periods,&__pyx_n_s_axis,0};
    PyObject* values[4] = {0,0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_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 (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_arr)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_out)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("diff_2d_int8", 1, 4, 4, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4556; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_periods)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("diff_2d_int8", 1, 4, 4, 2); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4556; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  3:
        if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_axis)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("diff_2d_int8", 1, 4, 4, 3); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4556; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "diff_2d_int8") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4556; __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_arr = ((PyArrayObject *)values[0]);
    __pyx_v_out = ((PyArrayObject *)values[1]);
    __pyx_v_periods = __Pyx_PyIndex_AsSsize_t(values[2]); if (unlikely((__pyx_v_periods == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4558; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_v_axis = __Pyx_PyInt_As_int(values[3]); if (unlikely((__pyx_v_axis == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4558; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("diff_2d_int8", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4556; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas.algos.diff_2d_int8", __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[2]; __pyx_lineno = 4556; __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[2]; __pyx_lineno = 4557; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_378diff_2d_int8(__pyx_self, __pyx_v_arr, __pyx_v_out, __pyx_v_periods, __pyx_v_axis);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pandas_5algos_378diff_2d_int8(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_arr, PyArrayObject *__pyx_v_out, Py_ssize_t __pyx_v_periods, int __pyx_v_axis) {
  Py_ssize_t __pyx_v_i;
  Py_ssize_t __pyx_v_j;
  Py_ssize_t __pyx_v_sx;
  Py_ssize_t __pyx_v_sy;
  Py_ssize_t __pyx_v_start;
  Py_ssize_t __pyx_v_stop;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_arr;
  __Pyx_Buffer __pyx_pybuffer_arr;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_out;
  __Pyx_Buffer __pyx_pybuffer_out;
  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;
  int __pyx_t_8;
  Py_ssize_t __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;
  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;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("diff_2d_int8", 0);
  __pyx_pybuffer_arr.pybuffer.buf = NULL;
  __pyx_pybuffer_arr.refcount = 0;
  __pyx_pybuffernd_arr.data = NULL;
  __pyx_pybuffernd_arr.rcbuffer = &__pyx_pybuffer_arr;
  __pyx_pybuffer_out.pybuffer.buf = NULL;
  __pyx_pybuffer_out.refcount = 0;
  __pyx_pybuffernd_out.data = NULL;
  __pyx_pybuffernd_out.rcbuffer = &__pyx_pybuffer_out;
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_arr.rcbuffer->pybuffer, (PyObject*)__pyx_v_arr, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int8_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4556; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_arr.diminfo[0].strides = __pyx_pybuffernd_arr.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_arr.diminfo[0].shape = __pyx_pybuffernd_arr.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_arr.diminfo[1].strides = __pyx_pybuffernd_arr.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_arr.diminfo[1].shape = __pyx_pybuffernd_arr.rcbuffer->pybuffer.shape[1];
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_out.rcbuffer->pybuffer, (PyObject*)__pyx_v_out, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4556; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_out.diminfo[0].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_out.diminfo[0].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_out.diminfo[1].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_out.diminfo[1].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[1];

  /* "pandas/src/generated.pyx":4562
 *         Py_ssize_t i, j, sx, sy
 * 
 *     sx, sy = (<object> arr).shape             # <<<<<<<<<<<<<<
 *     if arr.flags.f_contiguous:
 *         if axis == 0:
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_arr), __pyx_n_s_shape); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4562; __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 CYTHON_COMPILING_IN_CPYTHON
    Py_ssize_t size = Py_SIZE(sequence);
    #else
    Py_ssize_t size = PySequence_Size(sequence);
    #endif
    if (unlikely(size != 2)) {
      if (size > 2) __Pyx_RaiseTooManyValuesError(2);
      else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
      {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4562; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    #if CYTHON_COMPILING_IN_CPYTHON
    if (likely(PyTuple_CheckExact(sequence))) {
      __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); 
      __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1); 
    } else {
      __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);
    #else
    __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4562; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4562; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    #endif
    __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[2]; __pyx_lineno = 4562; __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_L3_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_L3_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_3);
    if (__Pyx_IternextUnpackEndCheck(__pyx_t_5(__pyx_t_4), 2) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4562; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_5 = NULL;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    goto __pyx_L4_unpacking_done;
    __pyx_L3_unpacking_failed:;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_5 = NULL;
    if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
    {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4562; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_L4_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[2]; __pyx_lineno = 4562; __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[2]; __pyx_lineno = 4562; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_v_sx = __pyx_t_6;
  __pyx_v_sy = __pyx_t_7;

  /* "pandas/src/generated.pyx":4563
 * 
 *     sx, sy = (<object> arr).shape
 *     if arr.flags.f_contiguous:             # <<<<<<<<<<<<<<
 *         if axis == 0:
 *             if periods >= 0:
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_arr), __pyx_n_s_flags); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4563; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_f_contiguous); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4563; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4563; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (__pyx_t_8) {

    /* "pandas/src/generated.pyx":4564
 *     sx, sy = (<object> arr).shape
 *     if arr.flags.f_contiguous:
 *         if axis == 0:             # <<<<<<<<<<<<<<
 *             if periods >= 0:
 *                 start, stop = periods, sx
 */
    __pyx_t_8 = ((__pyx_v_axis == 0) != 0);
    if (__pyx_t_8) {

      /* "pandas/src/generated.pyx":4565
 *     if arr.flags.f_contiguous:
 *         if axis == 0:
 *             if periods >= 0:             # <<<<<<<<<<<<<<
 *                 start, stop = periods, sx
 *             else:
 */
      __pyx_t_8 = ((__pyx_v_periods >= 0) != 0);
      if (__pyx_t_8) {

        /* "pandas/src/generated.pyx":4566
 *         if axis == 0:
 *             if periods >= 0:
 *                 start, stop = periods, sx             # <<<<<<<<<<<<<<
 *             else:
 *                 start, stop = 0, sx + periods
 */
        __pyx_t_7 = __pyx_v_periods;
        __pyx_t_6 = __pyx_v_sx;
        __pyx_v_start = __pyx_t_7;
        __pyx_v_stop = __pyx_t_6;
        goto __pyx_L7;
      }
      /*else*/ {

        /* "pandas/src/generated.pyx":4568
 *                 start, stop = periods, sx
 *             else:
 *                 start, stop = 0, sx + periods             # <<<<<<<<<<<<<<
 *             for j in range(sy):
 *                 for i in range(start, stop):
 */
        __pyx_t_6 = 0;
        __pyx_t_7 = (__pyx_v_sx + __pyx_v_periods);
        __pyx_v_start = __pyx_t_6;
        __pyx_v_stop = __pyx_t_7;
      }
      __pyx_L7:;

      /* "pandas/src/generated.pyx":4569
 *             else:
 *                 start, stop = 0, sx + periods
 *             for j in range(sy):             # <<<<<<<<<<<<<<
 *                 for i in range(start, stop):
 *                     out[i, j] = arr[i, j] - arr[i - periods, j]
 */
      __pyx_t_7 = __pyx_v_sy;
      for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_7; __pyx_t_6+=1) {
        __pyx_v_j = __pyx_t_6;

        /* "pandas/src/generated.pyx":4570
 *                 start, stop = 0, sx + periods
 *             for j in range(sy):
 *                 for i in range(start, stop):             # <<<<<<<<<<<<<<
 *                     out[i, j] = arr[i, j] - arr[i - periods, j]
 *         else:
 */
        __pyx_t_9 = __pyx_v_stop;
        for (__pyx_t_10 = __pyx_v_start; __pyx_t_10 < __pyx_t_9; __pyx_t_10+=1) {
          __pyx_v_i = __pyx_t_10;

          /* "pandas/src/generated.pyx":4571
 *             for j in range(sy):
 *                 for i in range(start, stop):
 *                     out[i, j] = arr[i, j] - arr[i - periods, j]             # <<<<<<<<<<<<<<
 *         else:
 *             if periods >= 0:
 */
          __pyx_t_11 = __pyx_v_i;
          __pyx_t_12 = __pyx_v_j;
          __pyx_t_13 = (__pyx_v_i - __pyx_v_periods);
          __pyx_t_14 = __pyx_v_j;
          __pyx_t_15 = __pyx_v_i;
          __pyx_t_16 = __pyx_v_j;
          *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_16, __pyx_pybuffernd_out.diminfo[1].strides) = ((*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int8_t *, __pyx_pybuffernd_arr.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_arr.diminfo[0].strides, __pyx_t_12, __pyx_pybuffernd_arr.diminfo[1].strides)) - (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int8_t *, __pyx_pybuffernd_arr.rcbuffer->pybuffer.buf, __pyx_t_13, __pyx_pybuffernd_arr.diminfo[0].strides, __pyx_t_14, __pyx_pybuffernd_arr.diminfo[1].strides)));
        }
      }
      goto __pyx_L6;
    }
    /*else*/ {

      /* "pandas/src/generated.pyx":4573
 *                     out[i, j] = arr[i, j] - arr[i - periods, j]
 *         else:
 *             if periods >= 0:             # <<<<<<<<<<<<<<
 *                 start, stop = periods, sy
 *             else:
 */
      __pyx_t_8 = ((__pyx_v_periods >= 0) != 0);
      if (__pyx_t_8) {

        /* "pandas/src/generated.pyx":4574
 *         else:
 *             if periods >= 0:
 *                 start, stop = periods, sy             # <<<<<<<<<<<<<<
 *             else:
 *                 start, stop = 0, sy + periods
 */
        __pyx_t_7 = __pyx_v_periods;
        __pyx_t_6 = __pyx_v_sy;
        __pyx_v_start = __pyx_t_7;
        __pyx_v_stop = __pyx_t_6;
        goto __pyx_L12;
      }
      /*else*/ {

        /* "pandas/src/generated.pyx":4576
 *                 start, stop = periods, sy
 *             else:
 *                 start, stop = 0, sy + periods             # <<<<<<<<<<<<<<
 *             for j in range(start, stop):
 *                 for i in range(sx):
 */
        __pyx_t_6 = 0;
        __pyx_t_7 = (__pyx_v_sy + __pyx_v_periods);
        __pyx_v_start = __pyx_t_6;
        __pyx_v_stop = __pyx_t_7;
      }
      __pyx_L12:;

      /* "pandas/src/generated.pyx":4577
 *             else:
 *                 start, stop = 0, sy + periods
 *             for j in range(start, stop):             # <<<<<<<<<<<<<<
 *                 for i in range(sx):
 *                     out[i, j] = arr[i, j] - arr[i, j - periods]
 */
      __pyx_t_7 = __pyx_v_stop;
      for (__pyx_t_6 = __pyx_v_start; __pyx_t_6 < __pyx_t_7; __pyx_t_6+=1) {
        __pyx_v_j = __pyx_t_6;

        /* "pandas/src/generated.pyx":4578
 *                 start, stop = 0, sy + periods
 *             for j in range(start, stop):
 *                 for i in range(sx):             # <<<<<<<<<<<<<<
 *                     out[i, j] = arr[i, j] - arr[i, j - periods]
 *     else:
 */
        __pyx_t_9 = __pyx_v_sx;
        for (__pyx_t_10 = 0; __pyx_t_10 < __pyx_t_9; __pyx_t_10+=1) {
          __pyx_v_i = __pyx_t_10;

          /* "pandas/src/generated.pyx":4579
 *             for j in range(start, stop):
 *                 for i in range(sx):
 *                     out[i, j] = arr[i, j] - arr[i, j - periods]             # <<<<<<<<<<<<<<
 *     else:
 *         if axis == 0:
 */
          __pyx_t_17 = __pyx_v_i;
          __pyx_t_18 = __pyx_v_j;
          __pyx_t_19 = __pyx_v_i;
          __pyx_t_20 = (__pyx_v_j - __pyx_v_periods);
          __pyx_t_21 = __pyx_v_i;
          __pyx_t_22 = __pyx_v_j;
          *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_22, __pyx_pybuffernd_out.diminfo[1].strides) = ((*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int8_t *, __pyx_pybuffernd_arr.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_arr.diminfo[0].strides, __pyx_t_18, __pyx_pybuffernd_arr.diminfo[1].strides)) - (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int8_t *, __pyx_pybuffernd_arr.rcbuffer->pybuffer.buf, __pyx_t_19, __pyx_pybuffernd_arr.diminfo[0].strides, __pyx_t_20, __pyx_pybuffernd_arr.diminfo[1].strides)));
        }
      }
    }
    __pyx_L6:;
    goto __pyx_L5;
  }
  /*else*/ {

    /* "pandas/src/generated.pyx":4581
 *                     out[i, j] = arr[i, j] - arr[i, j - periods]
 *     else:
 *         if axis == 0:             # <<<<<<<<<<<<<<
 *             if periods >= 0:
 *                 start, stop = periods, sx
 */
    __pyx_t_8 = ((__pyx_v_axis == 0) != 0);
    if (__pyx_t_8) {

      /* "pandas/src/generated.pyx":4582
 *     else:
 *         if axis == 0:
 *             if periods >= 0:             # <<<<<<<<<<<<<<
 *                 start, stop = periods, sx
 *             else:
 */
      __pyx_t_8 = ((__pyx_v_periods >= 0) != 0);
      if (__pyx_t_8) {

        /* "pandas/src/generated.pyx":4583
 *         if axis == 0:
 *             if periods >= 0:
 *                 start, stop = periods, sx             # <<<<<<<<<<<<<<
 *             else:
 *                 start, stop = 0, sx + periods
 */
        __pyx_t_7 = __pyx_v_periods;
        __pyx_t_6 = __pyx_v_sx;
        __pyx_v_start = __pyx_t_7;
        __pyx_v_stop = __pyx_t_6;
        goto __pyx_L18;
      }
      /*else*/ {

        /* "pandas/src/generated.pyx":4585
 *                 start, stop = periods, sx
 *             else:
 *                 start, stop = 0, sx + periods             # <<<<<<<<<<<<<<
 *             for i in range(start, stop):
 *                 for j in range(sy):
 */
        __pyx_t_6 = 0;
        __pyx_t_7 = (__pyx_v_sx + __pyx_v_periods);
        __pyx_v_start = __pyx_t_6;
        __pyx_v_stop = __pyx_t_7;
      }
      __pyx_L18:;

      /* "pandas/src/generated.pyx":4586
 *             else:
 *                 start, stop = 0, sx + periods
 *             for i in range(start, stop):             # <<<<<<<<<<<<<<
 *                 for j in range(sy):
 *                     out[i, j] = arr[i, j] - arr[i - periods, j]
 */
      __pyx_t_7 = __pyx_v_stop;
      for (__pyx_t_6 = __pyx_v_start; __pyx_t_6 < __pyx_t_7; __pyx_t_6+=1) {
        __pyx_v_i = __pyx_t_6;

        /* "pandas/src/generated.pyx":4587
 *                 start, stop = 0, sx + periods
 *             for i in range(start, stop):
 *                 for j in range(sy):             # <<<<<<<<<<<<<<
 *                     out[i, j] = arr[i, j] - arr[i - periods, j]
 *         else:
 */
        __pyx_t_9 = __pyx_v_sy;
        for (__pyx_t_10 = 0; __pyx_t_10 < __pyx_t_9; __pyx_t_10+=1) {
          __pyx_v_j = __pyx_t_10;

          /* "pandas/src/generated.pyx":4588
 *             for i in range(start, stop):
 *                 for j in range(sy):
 *                     out[i, j] = arr[i, j] - arr[i - periods, j]             # <<<<<<<<<<<<<<
 *         else:
 *             if periods >= 0:
 */
          __pyx_t_23 = __pyx_v_i;
          __pyx_t_24 = __pyx_v_j;
          __pyx_t_25 = (__pyx_v_i - __pyx_v_periods);
          __pyx_t_26 = __pyx_v_j;
          __pyx_t_27 = __pyx_v_i;
          __pyx_t_28 = __pyx_v_j;
          *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_27, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_28, __pyx_pybuffernd_out.diminfo[1].strides) = ((*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int8_t *, __pyx_pybuffernd_arr.rcbuffer->pybuffer.buf, __pyx_t_23, __pyx_pybuffernd_arr.diminfo[0].strides, __pyx_t_24, __pyx_pybuffernd_arr.diminfo[1].strides)) - (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int8_t *, __pyx_pybuffernd_arr.rcbuffer->pybuffer.buf, __pyx_t_25, __pyx_pybuffernd_arr.diminfo[0].strides, __pyx_t_26, __pyx_pybuffernd_arr.diminfo[1].strides)));
        }
      }
      goto __pyx_L17;
    }
    /*else*/ {

      /* "pandas/src/generated.pyx":4590
 *                     out[i, j] = arr[i, j] - arr[i - periods, j]
 *         else:
 *             if periods >= 0:             # <<<<<<<<<<<<<<
 *                 start, stop = periods, sy
 *             else:
 */
      __pyx_t_8 = ((__pyx_v_periods >= 0) != 0);
      if (__pyx_t_8) {

        /* "pandas/src/generated.pyx":4591
 *         else:
 *             if periods >= 0:
 *                 start, stop = periods, sy             # <<<<<<<<<<<<<<
 *             else:
 *                 start, stop = 0, sy + periods
 */
        __pyx_t_7 = __pyx_v_periods;
        __pyx_t_6 = __pyx_v_sy;
        __pyx_v_start = __pyx_t_7;
        __pyx_v_stop = __pyx_t_6;
        goto __pyx_L23;
      }
      /*else*/ {

        /* "pandas/src/generated.pyx":4593
 *                 start, stop = periods, sy
 *             else:
 *                 start, stop = 0, sy + periods             # <<<<<<<<<<<<<<
 *             for i in range(sx):
 *                 for j in range(start, stop):
 */
        __pyx_t_6 = 0;
        __pyx_t_7 = (__pyx_v_sy + __pyx_v_periods);
        __pyx_v_start = __pyx_t_6;
        __pyx_v_stop = __pyx_t_7;
      }
      __pyx_L23:;

      /* "pandas/src/generated.pyx":4594
 *             else:
 *                 start, stop = 0, sy + periods
 *             for i in range(sx):             # <<<<<<<<<<<<<<
 *                 for j in range(start, stop):
 *                     out[i, j] = arr[i, j] - arr[i, j - periods]
 */
      __pyx_t_7 = __pyx_v_sx;
      for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_7; __pyx_t_6+=1) {
        __pyx_v_i = __pyx_t_6;

        /* "pandas/src/generated.pyx":4595
 *                 start, stop = 0, sy + periods
 *             for i in range(sx):
 *                 for j in range(start, stop):             # <<<<<<<<<<<<<<
 *                     out[i, j] = arr[i, j] - arr[i, j - periods]
 * @cython.boundscheck(False)
 */
        __pyx_t_9 = __pyx_v_stop;
        for (__pyx_t_10 = __pyx_v_start; __pyx_t_10 < __pyx_t_9; __pyx_t_10+=1) {
          __pyx_v_j = __pyx_t_10;

          /* "pandas/src/generated.pyx":4596
 *             for i in range(sx):
 *                 for j in range(start, stop):
 *                     out[i, j] = arr[i, j] - arr[i, j - periods]             # <<<<<<<<<<<<<<
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 */
          __pyx_t_29 = __pyx_v_i;
          __pyx_t_30 = __pyx_v_j;
          __pyx_t_31 = __pyx_v_i;
          __pyx_t_32 = (__pyx_v_j - __pyx_v_periods);
          __pyx_t_33 = __pyx_v_i;
          __pyx_t_34 = __pyx_v_j;
          *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_33, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_34, __pyx_pybuffernd_out.diminfo[1].strides) = ((*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int8_t *, __pyx_pybuffernd_arr.rcbuffer->pybuffer.buf, __pyx_t_29, __pyx_pybuffernd_arr.diminfo[0].strides, __pyx_t_30, __pyx_pybuffernd_arr.diminfo[1].strides)) - (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int8_t *, __pyx_pybuffernd_arr.rcbuffer->pybuffer.buf, __pyx_t_31, __pyx_pybuffernd_arr.diminfo[0].strides, __pyx_t_32, __pyx_pybuffernd_arr.diminfo[1].strides)));
        }
      }
    }
    __pyx_L17:;
  }
  __pyx_L5:;

  /* "pandas/src/generated.pyx":4556
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def diff_2d_int8(ndarray[int8_t, ndim=2] arr,             # <<<<<<<<<<<<<<
 *                      ndarray[float32_t, ndim=2] out,
 *                     Py_ssize_t periods, int axis):
 */

  /* function exit code */
  __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_pybuffernd_arr.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas.algos.diff_2d_int8", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_arr.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer);
  __pyx_L2:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/src/generated.pyx":4599
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def diff_2d_int16(ndarray[int16_t, ndim=2] arr,             # <<<<<<<<<<<<<<
 *                      ndarray[float32_t, ndim=2] out,
 *                     Py_ssize_t periods, int axis):
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pandas_5algos_381diff_2d_int16(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_5algos_381diff_2d_int16 = {__Pyx_NAMESTR("diff_2d_int16"), (PyCFunction)__pyx_pw_6pandas_5algos_381diff_2d_int16, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pw_6pandas_5algos_381diff_2d_int16(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyArrayObject *__pyx_v_arr = 0;
  PyArrayObject *__pyx_v_out = 0;
  Py_ssize_t __pyx_v_periods;
  int __pyx_v_axis;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("diff_2d_int16 (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_arr,&__pyx_n_s_out,&__pyx_n_s_periods,&__pyx_n_s_axis,0};
    PyObject* values[4] = {0,0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_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 (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_arr)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_out)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("diff_2d_int16", 1, 4, 4, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4599; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_periods)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("diff_2d_int16", 1, 4, 4, 2); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4599; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  3:
        if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_axis)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("diff_2d_int16", 1, 4, 4, 3); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4599; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "diff_2d_int16") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4599; __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_arr = ((PyArrayObject *)values[0]);
    __pyx_v_out = ((PyArrayObject *)values[1]);
    __pyx_v_periods = __Pyx_PyIndex_AsSsize_t(values[2]); if (unlikely((__pyx_v_periods == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4601; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_v_axis = __Pyx_PyInt_As_int(values[3]); if (unlikely((__pyx_v_axis == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4601; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("diff_2d_int16", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4599; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas.algos.diff_2d_int16", __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[2]; __pyx_lineno = 4599; __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[2]; __pyx_lineno = 4600; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_380diff_2d_int16(__pyx_self, __pyx_v_arr, __pyx_v_out, __pyx_v_periods, __pyx_v_axis);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pandas_5algos_380diff_2d_int16(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_arr, PyArrayObject *__pyx_v_out, Py_ssize_t __pyx_v_periods, int __pyx_v_axis) {
  Py_ssize_t __pyx_v_i;
  Py_ssize_t __pyx_v_j;
  Py_ssize_t __pyx_v_sx;
  Py_ssize_t __pyx_v_sy;
  Py_ssize_t __pyx_v_start;
  Py_ssize_t __pyx_v_stop;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_arr;
  __Pyx_Buffer __pyx_pybuffer_arr;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_out;
  __Pyx_Buffer __pyx_pybuffer_out;
  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;
  int __pyx_t_8;
  Py_ssize_t __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;
  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;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("diff_2d_int16", 0);
  __pyx_pybuffer_arr.pybuffer.buf = NULL;
  __pyx_pybuffer_arr.refcount = 0;
  __pyx_pybuffernd_arr.data = NULL;
  __pyx_pybuffernd_arr.rcbuffer = &__pyx_pybuffer_arr;
  __pyx_pybuffer_out.pybuffer.buf = NULL;
  __pyx_pybuffer_out.refcount = 0;
  __pyx_pybuffernd_out.data = NULL;
  __pyx_pybuffernd_out.rcbuffer = &__pyx_pybuffer_out;
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_arr.rcbuffer->pybuffer, (PyObject*)__pyx_v_arr, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int16_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4599; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_arr.diminfo[0].strides = __pyx_pybuffernd_arr.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_arr.diminfo[0].shape = __pyx_pybuffernd_arr.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_arr.diminfo[1].strides = __pyx_pybuffernd_arr.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_arr.diminfo[1].shape = __pyx_pybuffernd_arr.rcbuffer->pybuffer.shape[1];
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_out.rcbuffer->pybuffer, (PyObject*)__pyx_v_out, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4599; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_out.diminfo[0].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_out.diminfo[0].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_out.diminfo[1].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_out.diminfo[1].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[1];

  /* "pandas/src/generated.pyx":4605
 *         Py_ssize_t i, j, sx, sy
 * 
 *     sx, sy = (<object> arr).shape             # <<<<<<<<<<<<<<
 *     if arr.flags.f_contiguous:
 *         if axis == 0:
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_arr), __pyx_n_s_shape); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4605; __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 CYTHON_COMPILING_IN_CPYTHON
    Py_ssize_t size = Py_SIZE(sequence);
    #else
    Py_ssize_t size = PySequence_Size(sequence);
    #endif
    if (unlikely(size != 2)) {
      if (size > 2) __Pyx_RaiseTooManyValuesError(2);
      else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
      {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4605; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    #if CYTHON_COMPILING_IN_CPYTHON
    if (likely(PyTuple_CheckExact(sequence))) {
      __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); 
      __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1); 
    } else {
      __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);
    #else
    __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4605; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4605; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    #endif
    __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[2]; __pyx_lineno = 4605; __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_L3_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_L3_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_3);
    if (__Pyx_IternextUnpackEndCheck(__pyx_t_5(__pyx_t_4), 2) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4605; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_5 = NULL;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    goto __pyx_L4_unpacking_done;
    __pyx_L3_unpacking_failed:;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_5 = NULL;
    if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
    {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4605; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_L4_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[2]; __pyx_lineno = 4605; __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[2]; __pyx_lineno = 4605; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_v_sx = __pyx_t_6;
  __pyx_v_sy = __pyx_t_7;

  /* "pandas/src/generated.pyx":4606
 * 
 *     sx, sy = (<object> arr).shape
 *     if arr.flags.f_contiguous:             # <<<<<<<<<<<<<<
 *         if axis == 0:
 *             if periods >= 0:
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_arr), __pyx_n_s_flags); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4606; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_f_contiguous); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4606; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4606; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (__pyx_t_8) {

    /* "pandas/src/generated.pyx":4607
 *     sx, sy = (<object> arr).shape
 *     if arr.flags.f_contiguous:
 *         if axis == 0:             # <<<<<<<<<<<<<<
 *             if periods >= 0:
 *                 start, stop = periods, sx
 */
    __pyx_t_8 = ((__pyx_v_axis == 0) != 0);
    if (__pyx_t_8) {

      /* "pandas/src/generated.pyx":4608
 *     if arr.flags.f_contiguous:
 *         if axis == 0:
 *             if periods >= 0:             # <<<<<<<<<<<<<<
 *                 start, stop = periods, sx
 *             else:
 */
      __pyx_t_8 = ((__pyx_v_periods >= 0) != 0);
      if (__pyx_t_8) {

        /* "pandas/src/generated.pyx":4609
 *         if axis == 0:
 *             if periods >= 0:
 *                 start, stop = periods, sx             # <<<<<<<<<<<<<<
 *             else:
 *                 start, stop = 0, sx + periods
 */
        __pyx_t_7 = __pyx_v_periods;
        __pyx_t_6 = __pyx_v_sx;
        __pyx_v_start = __pyx_t_7;
        __pyx_v_stop = __pyx_t_6;
        goto __pyx_L7;
      }
      /*else*/ {

        /* "pandas/src/generated.pyx":4611
 *                 start, stop = periods, sx
 *             else:
 *                 start, stop = 0, sx + periods             # <<<<<<<<<<<<<<
 *             for j in range(sy):
 *                 for i in range(start, stop):
 */
        __pyx_t_6 = 0;
        __pyx_t_7 = (__pyx_v_sx + __pyx_v_periods);
        __pyx_v_start = __pyx_t_6;
        __pyx_v_stop = __pyx_t_7;
      }
      __pyx_L7:;

      /* "pandas/src/generated.pyx":4612
 *             else:
 *                 start, stop = 0, sx + periods
 *             for j in range(sy):             # <<<<<<<<<<<<<<
 *                 for i in range(start, stop):
 *                     out[i, j] = arr[i, j] - arr[i - periods, j]
 */
      __pyx_t_7 = __pyx_v_sy;
      for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_7; __pyx_t_6+=1) {
        __pyx_v_j = __pyx_t_6;

        /* "pandas/src/generated.pyx":4613
 *                 start, stop = 0, sx + periods
 *             for j in range(sy):
 *                 for i in range(start, stop):             # <<<<<<<<<<<<<<
 *                     out[i, j] = arr[i, j] - arr[i - periods, j]
 *         else:
 */
        __pyx_t_9 = __pyx_v_stop;
        for (__pyx_t_10 = __pyx_v_start; __pyx_t_10 < __pyx_t_9; __pyx_t_10+=1) {
          __pyx_v_i = __pyx_t_10;

          /* "pandas/src/generated.pyx":4614
 *             for j in range(sy):
 *                 for i in range(start, stop):
 *                     out[i, j] = arr[i, j] - arr[i - periods, j]             # <<<<<<<<<<<<<<
 *         else:
 *             if periods >= 0:
 */
          __pyx_t_11 = __pyx_v_i;
          __pyx_t_12 = __pyx_v_j;
          __pyx_t_13 = (__pyx_v_i - __pyx_v_periods);
          __pyx_t_14 = __pyx_v_j;
          __pyx_t_15 = __pyx_v_i;
          __pyx_t_16 = __pyx_v_j;
          *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_16, __pyx_pybuffernd_out.diminfo[1].strides) = ((*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int16_t *, __pyx_pybuffernd_arr.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_arr.diminfo[0].strides, __pyx_t_12, __pyx_pybuffernd_arr.diminfo[1].strides)) - (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int16_t *, __pyx_pybuffernd_arr.rcbuffer->pybuffer.buf, __pyx_t_13, __pyx_pybuffernd_arr.diminfo[0].strides, __pyx_t_14, __pyx_pybuffernd_arr.diminfo[1].strides)));
        }
      }
      goto __pyx_L6;
    }
    /*else*/ {

      /* "pandas/src/generated.pyx":4616
 *                     out[i, j] = arr[i, j] - arr[i - periods, j]
 *         else:
 *             if periods >= 0:             # <<<<<<<<<<<<<<
 *                 start, stop = periods, sy
 *             else:
 */
      __pyx_t_8 = ((__pyx_v_periods >= 0) != 0);
      if (__pyx_t_8) {

        /* "pandas/src/generated.pyx":4617
 *         else:
 *             if periods >= 0:
 *                 start, stop = periods, sy             # <<<<<<<<<<<<<<
 *             else:
 *                 start, stop = 0, sy + periods
 */
        __pyx_t_7 = __pyx_v_periods;
        __pyx_t_6 = __pyx_v_sy;
        __pyx_v_start = __pyx_t_7;
        __pyx_v_stop = __pyx_t_6;
        goto __pyx_L12;
      }
      /*else*/ {

        /* "pandas/src/generated.pyx":4619
 *                 start, stop = periods, sy
 *             else:
 *                 start, stop = 0, sy + periods             # <<<<<<<<<<<<<<
 *             for j in range(start, stop):
 *                 for i in range(sx):
 */
        __pyx_t_6 = 0;
        __pyx_t_7 = (__pyx_v_sy + __pyx_v_periods);
        __pyx_v_start = __pyx_t_6;
        __pyx_v_stop = __pyx_t_7;
      }
      __pyx_L12:;

      /* "pandas/src/generated.pyx":4620
 *             else:
 *                 start, stop = 0, sy + periods
 *             for j in range(start, stop):             # <<<<<<<<<<<<<<
 *                 for i in range(sx):
 *                     out[i, j] = arr[i, j] - arr[i, j - periods]
 */
      __pyx_t_7 = __pyx_v_stop;
      for (__pyx_t_6 = __pyx_v_start; __pyx_t_6 < __pyx_t_7; __pyx_t_6+=1) {
        __pyx_v_j = __pyx_t_6;

        /* "pandas/src/generated.pyx":4621
 *                 start, stop = 0, sy + periods
 *             for j in range(start, stop):
 *                 for i in range(sx):             # <<<<<<<<<<<<<<
 *                     out[i, j] = arr[i, j] - arr[i, j - periods]
 *     else:
 */
        __pyx_t_9 = __pyx_v_sx;
        for (__pyx_t_10 = 0; __pyx_t_10 < __pyx_t_9; __pyx_t_10+=1) {
          __pyx_v_i = __pyx_t_10;

          /* "pandas/src/generated.pyx":4622
 *             for j in range(start, stop):
 *                 for i in range(sx):
 *                     out[i, j] = arr[i, j] - arr[i, j - periods]             # <<<<<<<<<<<<<<
 *     else:
 *         if axis == 0:
 */
          __pyx_t_17 = __pyx_v_i;
          __pyx_t_18 = __pyx_v_j;
          __pyx_t_19 = __pyx_v_i;
          __pyx_t_20 = (__pyx_v_j - __pyx_v_periods);
          __pyx_t_21 = __pyx_v_i;
          __pyx_t_22 = __pyx_v_j;
          *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_22, __pyx_pybuffernd_out.diminfo[1].strides) = ((*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int16_t *, __pyx_pybuffernd_arr.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_arr.diminfo[0].strides, __pyx_t_18, __pyx_pybuffernd_arr.diminfo[1].strides)) - (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int16_t *, __pyx_pybuffernd_arr.rcbuffer->pybuffer.buf, __pyx_t_19, __pyx_pybuffernd_arr.diminfo[0].strides, __pyx_t_20, __pyx_pybuffernd_arr.diminfo[1].strides)));
        }
      }
    }
    __pyx_L6:;
    goto __pyx_L5;
  }
  /*else*/ {

    /* "pandas/src/generated.pyx":4624
 *                     out[i, j] = arr[i, j] - arr[i, j - periods]
 *     else:
 *         if axis == 0:             # <<<<<<<<<<<<<<
 *             if periods >= 0:
 *                 start, stop = periods, sx
 */
    __pyx_t_8 = ((__pyx_v_axis == 0) != 0);
    if (__pyx_t_8) {

      /* "pandas/src/generated.pyx":4625
 *     else:
 *         if axis == 0:
 *             if periods >= 0:             # <<<<<<<<<<<<<<
 *                 start, stop = periods, sx
 *             else:
 */
      __pyx_t_8 = ((__pyx_v_periods >= 0) != 0);
      if (__pyx_t_8) {

        /* "pandas/src/generated.pyx":4626
 *         if axis == 0:
 *             if periods >= 0:
 *                 start, stop = periods, sx             # <<<<<<<<<<<<<<
 *             else:
 *                 start, stop = 0, sx + periods
 */
        __pyx_t_7 = __pyx_v_periods;
        __pyx_t_6 = __pyx_v_sx;
        __pyx_v_start = __pyx_t_7;
        __pyx_v_stop = __pyx_t_6;
        goto __pyx_L18;
      }
      /*else*/ {

        /* "pandas/src/generated.pyx":4628
 *                 start, stop = periods, sx
 *             else:
 *                 start, stop = 0, sx + periods             # <<<<<<<<<<<<<<
 *             for i in range(start, stop):
 *                 for j in range(sy):
 */
        __pyx_t_6 = 0;
        __pyx_t_7 = (__pyx_v_sx + __pyx_v_periods);
        __pyx_v_start = __pyx_t_6;
        __pyx_v_stop = __pyx_t_7;
      }
      __pyx_L18:;

      /* "pandas/src/generated.pyx":4629
 *             else:
 *                 start, stop = 0, sx + periods
 *             for i in range(start, stop):             # <<<<<<<<<<<<<<
 *                 for j in range(sy):
 *                     out[i, j] = arr[i, j] - arr[i - periods, j]
 */
      __pyx_t_7 = __pyx_v_stop;
      for (__pyx_t_6 = __pyx_v_start; __pyx_t_6 < __pyx_t_7; __pyx_t_6+=1) {
        __pyx_v_i = __pyx_t_6;

        /* "pandas/src/generated.pyx":4630
 *                 start, stop = 0, sx + periods
 *             for i in range(start, stop):
 *                 for j in range(sy):             # <<<<<<<<<<<<<<
 *                     out[i, j] = arr[i, j] - arr[i - periods, j]
 *         else:
 */
        __pyx_t_9 = __pyx_v_sy;
        for (__pyx_t_10 = 0; __pyx_t_10 < __pyx_t_9; __pyx_t_10+=1) {
          __pyx_v_j = __pyx_t_10;

          /* "pandas/src/generated.pyx":4631
 *             for i in range(start, stop):
 *                 for j in range(sy):
 *                     out[i, j] = arr[i, j] - arr[i - periods, j]             # <<<<<<<<<<<<<<
 *         else:
 *             if periods >= 0:
 */
          __pyx_t_23 = __pyx_v_i;
          __pyx_t_24 = __pyx_v_j;
          __pyx_t_25 = (__pyx_v_i - __pyx_v_periods);
          __pyx_t_26 = __pyx_v_j;
          __pyx_t_27 = __pyx_v_i;
          __pyx_t_28 = __pyx_v_j;
          *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_27, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_28, __pyx_pybuffernd_out.diminfo[1].strides) = ((*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int16_t *, __pyx_pybuffernd_arr.rcbuffer->pybuffer.buf, __pyx_t_23, __pyx_pybuffernd_arr.diminfo[0].strides, __pyx_t_24, __pyx_pybuffernd_arr.diminfo[1].strides)) - (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int16_t *, __pyx_pybuffernd_arr.rcbuffer->pybuffer.buf, __pyx_t_25, __pyx_pybuffernd_arr.diminfo[0].strides, __pyx_t_26, __pyx_pybuffernd_arr.diminfo[1].strides)));
        }
      }
      goto __pyx_L17;
    }
    /*else*/ {

      /* "pandas/src/generated.pyx":4633
 *                     out[i, j] = arr[i, j] - arr[i - periods, j]
 *         else:
 *             if periods >= 0:             # <<<<<<<<<<<<<<
 *                 start, stop = periods, sy
 *             else:
 */
      __pyx_t_8 = ((__pyx_v_periods >= 0) != 0);
      if (__pyx_t_8) {

        /* "pandas/src/generated.pyx":4634
 *         else:
 *             if periods >= 0:
 *                 start, stop = periods, sy             # <<<<<<<<<<<<<<
 *             else:
 *                 start, stop = 0, sy + periods
 */
        __pyx_t_7 = __pyx_v_periods;
        __pyx_t_6 = __pyx_v_sy;
        __pyx_v_start = __pyx_t_7;
        __pyx_v_stop = __pyx_t_6;
        goto __pyx_L23;
      }
      /*else*/ {

        /* "pandas/src/generated.pyx":4636
 *                 start, stop = periods, sy
 *             else:
 *                 start, stop = 0, sy + periods             # <<<<<<<<<<<<<<
 *             for i in range(sx):
 *                 for j in range(start, stop):
 */
        __pyx_t_6 = 0;
        __pyx_t_7 = (__pyx_v_sy + __pyx_v_periods);
        __pyx_v_start = __pyx_t_6;
        __pyx_v_stop = __pyx_t_7;
      }
      __pyx_L23:;

      /* "pandas/src/generated.pyx":4637
 *             else:
 *                 start, stop = 0, sy + periods
 *             for i in range(sx):             # <<<<<<<<<<<<<<
 *                 for j in range(start, stop):
 *                     out[i, j] = arr[i, j] - arr[i, j - periods]
 */
      __pyx_t_7 = __pyx_v_sx;
      for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_7; __pyx_t_6+=1) {
        __pyx_v_i = __pyx_t_6;

        /* "pandas/src/generated.pyx":4638
 *                 start, stop = 0, sy + periods
 *             for i in range(sx):
 *                 for j in range(start, stop):             # <<<<<<<<<<<<<<
 *                     out[i, j] = arr[i, j] - arr[i, j - periods]
 * @cython.boundscheck(False)
 */
        __pyx_t_9 = __pyx_v_stop;
        for (__pyx_t_10 = __pyx_v_start; __pyx_t_10 < __pyx_t_9; __pyx_t_10+=1) {
          __pyx_v_j = __pyx_t_10;

          /* "pandas/src/generated.pyx":4639
 *             for i in range(sx):
 *                 for j in range(start, stop):
 *                     out[i, j] = arr[i, j] - arr[i, j - periods]             # <<<<<<<<<<<<<<
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 */
          __pyx_t_29 = __pyx_v_i;
          __pyx_t_30 = __pyx_v_j;
          __pyx_t_31 = __pyx_v_i;
          __pyx_t_32 = (__pyx_v_j - __pyx_v_periods);
          __pyx_t_33 = __pyx_v_i;
          __pyx_t_34 = __pyx_v_j;
          *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_33, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_34, __pyx_pybuffernd_out.diminfo[1].strides) = ((*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int16_t *, __pyx_pybuffernd_arr.rcbuffer->pybuffer.buf, __pyx_t_29, __pyx_pybuffernd_arr.diminfo[0].strides, __pyx_t_30, __pyx_pybuffernd_arr.diminfo[1].strides)) - (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int16_t *, __pyx_pybuffernd_arr.rcbuffer->pybuffer.buf, __pyx_t_31, __pyx_pybuffernd_arr.diminfo[0].strides, __pyx_t_32, __pyx_pybuffernd_arr.diminfo[1].strides)));
        }
      }
    }
    __pyx_L17:;
  }
  __pyx_L5:;

  /* "pandas/src/generated.pyx":4599
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def diff_2d_int16(ndarray[int16_t, ndim=2] arr,             # <<<<<<<<<<<<<<
 *                      ndarray[float32_t, ndim=2] out,
 *                     Py_ssize_t periods, int axis):
 */

  /* function exit code */
  __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_pybuffernd_arr.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas.algos.diff_2d_int16", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_arr.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer);
  __pyx_L2:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/src/generated.pyx":4642
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def diff_2d_int32(ndarray[int32_t, ndim=2] arr,             # <<<<<<<<<<<<<<
 *                      ndarray[float64_t, ndim=2] out,
 *                     Py_ssize_t periods, int axis):
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pandas_5algos_383diff_2d_int32(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_5algos_383diff_2d_int32 = {__Pyx_NAMESTR("diff_2d_int32"), (PyCFunction)__pyx_pw_6pandas_5algos_383diff_2d_int32, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pw_6pandas_5algos_383diff_2d_int32(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyArrayObject *__pyx_v_arr = 0;
  PyArrayObject *__pyx_v_out = 0;
  Py_ssize_t __pyx_v_periods;
  int __pyx_v_axis;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("diff_2d_int32 (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_arr,&__pyx_n_s_out,&__pyx_n_s_periods,&__pyx_n_s_axis,0};
    PyObject* values[4] = {0,0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_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 (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_arr)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_out)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("diff_2d_int32", 1, 4, 4, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4642; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_periods)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("diff_2d_int32", 1, 4, 4, 2); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4642; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  3:
        if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_axis)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("diff_2d_int32", 1, 4, 4, 3); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4642; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "diff_2d_int32") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4642; __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_arr = ((PyArrayObject *)values[0]);
    __pyx_v_out = ((PyArrayObject *)values[1]);
    __pyx_v_periods = __Pyx_PyIndex_AsSsize_t(values[2]); if (unlikely((__pyx_v_periods == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4644; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_v_axis = __Pyx_PyInt_As_int(values[3]); if (unlikely((__pyx_v_axis == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4644; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("diff_2d_int32", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4642; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas.algos.diff_2d_int32", __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[2]; __pyx_lineno = 4642; __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[2]; __pyx_lineno = 4643; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_382diff_2d_int32(__pyx_self, __pyx_v_arr, __pyx_v_out, __pyx_v_periods, __pyx_v_axis);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pandas_5algos_382diff_2d_int32(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_arr, PyArrayObject *__pyx_v_out, Py_ssize_t __pyx_v_periods, int __pyx_v_axis) {
  Py_ssize_t __pyx_v_i;
  Py_ssize_t __pyx_v_j;
  Py_ssize_t __pyx_v_sx;
  Py_ssize_t __pyx_v_sy;
  Py_ssize_t __pyx_v_start;
  Py_ssize_t __pyx_v_stop;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_arr;
  __Pyx_Buffer __pyx_pybuffer_arr;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_out;
  __Pyx_Buffer __pyx_pybuffer_out;
  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;
  int __pyx_t_8;
  Py_ssize_t __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;
  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;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("diff_2d_int32", 0);
  __pyx_pybuffer_arr.pybuffer.buf = NULL;
  __pyx_pybuffer_arr.refcount = 0;
  __pyx_pybuffernd_arr.data = NULL;
  __pyx_pybuffernd_arr.rcbuffer = &__pyx_pybuffer_arr;
  __pyx_pybuffer_out.pybuffer.buf = NULL;
  __pyx_pybuffer_out.refcount = 0;
  __pyx_pybuffernd_out.data = NULL;
  __pyx_pybuffernd_out.rcbuffer = &__pyx_pybuffer_out;
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_arr.rcbuffer->pybuffer, (PyObject*)__pyx_v_arr, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4642; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_arr.diminfo[0].strides = __pyx_pybuffernd_arr.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_arr.diminfo[0].shape = __pyx_pybuffernd_arr.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_arr.diminfo[1].strides = __pyx_pybuffernd_arr.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_arr.diminfo[1].shape = __pyx_pybuffernd_arr.rcbuffer->pybuffer.shape[1];
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_out.rcbuffer->pybuffer, (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[2]; __pyx_lineno = 4642; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_out.diminfo[0].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_out.diminfo[0].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_out.diminfo[1].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_out.diminfo[1].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[1];

  /* "pandas/src/generated.pyx":4648
 *         Py_ssize_t i, j, sx, sy
 * 
 *     sx, sy = (<object> arr).shape             # <<<<<<<<<<<<<<
 *     if arr.flags.f_contiguous:
 *         if axis == 0:
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_arr), __pyx_n_s_shape); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4648; __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 CYTHON_COMPILING_IN_CPYTHON
    Py_ssize_t size = Py_SIZE(sequence);
    #else
    Py_ssize_t size = PySequence_Size(sequence);
    #endif
    if (unlikely(size != 2)) {
      if (size > 2) __Pyx_RaiseTooManyValuesError(2);
      else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
      {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4648; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    #if CYTHON_COMPILING_IN_CPYTHON
    if (likely(PyTuple_CheckExact(sequence))) {
      __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); 
      __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1); 
    } else {
      __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);
    #else
    __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4648; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4648; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    #endif
    __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[2]; __pyx_lineno = 4648; __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_L3_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_L3_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_3);
    if (__Pyx_IternextUnpackEndCheck(__pyx_t_5(__pyx_t_4), 2) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4648; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_5 = NULL;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    goto __pyx_L4_unpacking_done;
    __pyx_L3_unpacking_failed:;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_5 = NULL;
    if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
    {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4648; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_L4_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[2]; __pyx_lineno = 4648; __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[2]; __pyx_lineno = 4648; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_v_sx = __pyx_t_6;
  __pyx_v_sy = __pyx_t_7;

  /* "pandas/src/generated.pyx":4649
 * 
 *     sx, sy = (<object> arr).shape
 *     if arr.flags.f_contiguous:             # <<<<<<<<<<<<<<
 *         if axis == 0:
 *             if periods >= 0:
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_arr), __pyx_n_s_flags); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4649; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_f_contiguous); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4649; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4649; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (__pyx_t_8) {

    /* "pandas/src/generated.pyx":4650
 *     sx, sy = (<object> arr).shape
 *     if arr.flags.f_contiguous:
 *         if axis == 0:             # <<<<<<<<<<<<<<
 *             if periods >= 0:
 *                 start, stop = periods, sx
 */
    __pyx_t_8 = ((__pyx_v_axis == 0) != 0);
    if (__pyx_t_8) {

      /* "pandas/src/generated.pyx":4651
 *     if arr.flags.f_contiguous:
 *         if axis == 0:
 *             if periods >= 0:             # <<<<<<<<<<<<<<
 *                 start, stop = periods, sx
 *             else:
 */
      __pyx_t_8 = ((__pyx_v_periods >= 0) != 0);
      if (__pyx_t_8) {

        /* "pandas/src/generated.pyx":4652
 *         if axis == 0:
 *             if periods >= 0:
 *                 start, stop = periods, sx             # <<<<<<<<<<<<<<
 *             else:
 *                 start, stop = 0, sx + periods
 */
        __pyx_t_7 = __pyx_v_periods;
        __pyx_t_6 = __pyx_v_sx;
        __pyx_v_start = __pyx_t_7;
        __pyx_v_stop = __pyx_t_6;
        goto __pyx_L7;
      }
      /*else*/ {

        /* "pandas/src/generated.pyx":4654
 *                 start, stop = periods, sx
 *             else:
 *                 start, stop = 0, sx + periods             # <<<<<<<<<<<<<<
 *             for j in range(sy):
 *                 for i in range(start, stop):
 */
        __pyx_t_6 = 0;
        __pyx_t_7 = (__pyx_v_sx + __pyx_v_periods);
        __pyx_v_start = __pyx_t_6;
        __pyx_v_stop = __pyx_t_7;
      }
      __pyx_L7:;

      /* "pandas/src/generated.pyx":4655
 *             else:
 *                 start, stop = 0, sx + periods
 *             for j in range(sy):             # <<<<<<<<<<<<<<
 *                 for i in range(start, stop):
 *                     out[i, j] = arr[i, j] - arr[i - periods, j]
 */
      __pyx_t_7 = __pyx_v_sy;
      for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_7; __pyx_t_6+=1) {
        __pyx_v_j = __pyx_t_6;

        /* "pandas/src/generated.pyx":4656
 *                 start, stop = 0, sx + periods
 *             for j in range(sy):
 *                 for i in range(start, stop):             # <<<<<<<<<<<<<<
 *                     out[i, j] = arr[i, j] - arr[i - periods, j]
 *         else:
 */
        __pyx_t_9 = __pyx_v_stop;
        for (__pyx_t_10 = __pyx_v_start; __pyx_t_10 < __pyx_t_9; __pyx_t_10+=1) {
          __pyx_v_i = __pyx_t_10;

          /* "pandas/src/generated.pyx":4657
 *             for j in range(sy):
 *                 for i in range(start, stop):
 *                     out[i, j] = arr[i, j] - arr[i - periods, j]             # <<<<<<<<<<<<<<
 *         else:
 *             if periods >= 0:
 */
          __pyx_t_11 = __pyx_v_i;
          __pyx_t_12 = __pyx_v_j;
          __pyx_t_13 = (__pyx_v_i - __pyx_v_periods);
          __pyx_t_14 = __pyx_v_j;
          __pyx_t_15 = __pyx_v_i;
          __pyx_t_16 = __pyx_v_j;
          *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_16, __pyx_pybuffernd_out.diminfo[1].strides) = ((*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_arr.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_arr.diminfo[0].strides, __pyx_t_12, __pyx_pybuffernd_arr.diminfo[1].strides)) - (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_arr.rcbuffer->pybuffer.buf, __pyx_t_13, __pyx_pybuffernd_arr.diminfo[0].strides, __pyx_t_14, __pyx_pybuffernd_arr.diminfo[1].strides)));
        }
      }
      goto __pyx_L6;
    }
    /*else*/ {

      /* "pandas/src/generated.pyx":4659
 *                     out[i, j] = arr[i, j] - arr[i - periods, j]
 *         else:
 *             if periods >= 0:             # <<<<<<<<<<<<<<
 *                 start, stop = periods, sy
 *             else:
 */
      __pyx_t_8 = ((__pyx_v_periods >= 0) != 0);
      if (__pyx_t_8) {

        /* "pandas/src/generated.pyx":4660
 *         else:
 *             if periods >= 0:
 *                 start, stop = periods, sy             # <<<<<<<<<<<<<<
 *             else:
 *                 start, stop = 0, sy + periods
 */
        __pyx_t_7 = __pyx_v_periods;
        __pyx_t_6 = __pyx_v_sy;
        __pyx_v_start = __pyx_t_7;
        __pyx_v_stop = __pyx_t_6;
        goto __pyx_L12;
      }
      /*else*/ {

        /* "pandas/src/generated.pyx":4662
 *                 start, stop = periods, sy
 *             else:
 *                 start, stop = 0, sy + periods             # <<<<<<<<<<<<<<
 *             for j in range(start, stop):
 *                 for i in range(sx):
 */
        __pyx_t_6 = 0;
        __pyx_t_7 = (__pyx_v_sy + __pyx_v_periods);
        __pyx_v_start = __pyx_t_6;
        __pyx_v_stop = __pyx_t_7;
      }
      __pyx_L12:;

      /* "pandas/src/generated.pyx":4663
 *             else:
 *                 start, stop = 0, sy + periods
 *             for j in range(start, stop):             # <<<<<<<<<<<<<<
 *                 for i in range(sx):
 *                     out[i, j] = arr[i, j] - arr[i, j - periods]
 */
      __pyx_t_7 = __pyx_v_stop;
      for (__pyx_t_6 = __pyx_v_start; __pyx_t_6 < __pyx_t_7; __pyx_t_6+=1) {
        __pyx_v_j = __pyx_t_6;

        /* "pandas/src/generated.pyx":4664
 *                 start, stop = 0, sy + periods
 *             for j in range(start, stop):
 *                 for i in range(sx):             # <<<<<<<<<<<<<<
 *                     out[i, j] = arr[i, j] - arr[i, j - periods]
 *     else:
 */
        __pyx_t_9 = __pyx_v_sx;
        for (__pyx_t_10 = 0; __pyx_t_10 < __pyx_t_9; __pyx_t_10+=1) {
          __pyx_v_i = __pyx_t_10;

          /* "pandas/src/generated.pyx":4665
 *             for j in range(start, stop):
 *                 for i in range(sx):
 *                     out[i, j] = arr[i, j] - arr[i, j - periods]             # <<<<<<<<<<<<<<
 *     else:
 *         if axis == 0:
 */
          __pyx_t_17 = __pyx_v_i;
          __pyx_t_18 = __pyx_v_j;
          __pyx_t_19 = __pyx_v_i;
          __pyx_t_20 = (__pyx_v_j - __pyx_v_periods);
          __pyx_t_21 = __pyx_v_i;
          __pyx_t_22 = __pyx_v_j;
          *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_22, __pyx_pybuffernd_out.diminfo[1].strides) = ((*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_arr.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_arr.diminfo[0].strides, __pyx_t_18, __pyx_pybuffernd_arr.diminfo[1].strides)) - (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_arr.rcbuffer->pybuffer.buf, __pyx_t_19, __pyx_pybuffernd_arr.diminfo[0].strides, __pyx_t_20, __pyx_pybuffernd_arr.diminfo[1].strides)));
        }
      }
    }
    __pyx_L6:;
    goto __pyx_L5;
  }
  /*else*/ {

    /* "pandas/src/generated.pyx":4667
 *                     out[i, j] = arr[i, j] - arr[i, j - periods]
 *     else:
 *         if axis == 0:             # <<<<<<<<<<<<<<
 *             if periods >= 0:
 *                 start, stop = periods, sx
 */
    __pyx_t_8 = ((__pyx_v_axis == 0) != 0);
    if (__pyx_t_8) {

      /* "pandas/src/generated.pyx":4668
 *     else:
 *         if axis == 0:
 *             if periods >= 0:             # <<<<<<<<<<<<<<
 *                 start, stop = periods, sx
 *             else:
 */
      __pyx_t_8 = ((__pyx_v_periods >= 0) != 0);
      if (__pyx_t_8) {

        /* "pandas/src/generated.pyx":4669
 *         if axis == 0:
 *             if periods >= 0:
 *                 start, stop = periods, sx             # <<<<<<<<<<<<<<
 *             else:
 *                 start, stop = 0, sx + periods
 */
        __pyx_t_7 = __pyx_v_periods;
        __pyx_t_6 = __pyx_v_sx;
        __pyx_v_start = __pyx_t_7;
        __pyx_v_stop = __pyx_t_6;
        goto __pyx_L18;
      }
      /*else*/ {

        /* "pandas/src/generated.pyx":4671
 *                 start, stop = periods, sx
 *             else:
 *                 start, stop = 0, sx + periods             # <<<<<<<<<<<<<<
 *             for i in range(start, stop):
 *                 for j in range(sy):
 */
        __pyx_t_6 = 0;
        __pyx_t_7 = (__pyx_v_sx + __pyx_v_periods);
        __pyx_v_start = __pyx_t_6;
        __pyx_v_stop = __pyx_t_7;
      }
      __pyx_L18:;

      /* "pandas/src/generated.pyx":4672
 *             else:
 *                 start, stop = 0, sx + periods
 *             for i in range(start, stop):             # <<<<<<<<<<<<<<
 *                 for j in range(sy):
 *                     out[i, j] = arr[i, j] - arr[i - periods, j]
 */
      __pyx_t_7 = __pyx_v_stop;
      for (__pyx_t_6 = __pyx_v_start; __pyx_t_6 < __pyx_t_7; __pyx_t_6+=1) {
        __pyx_v_i = __pyx_t_6;

        /* "pandas/src/generated.pyx":4673
 *                 start, stop = 0, sx + periods
 *             for i in range(start, stop):
 *                 for j in range(sy):             # <<<<<<<<<<<<<<
 *                     out[i, j] = arr[i, j] - arr[i - periods, j]
 *         else:
 */
        __pyx_t_9 = __pyx_v_sy;
        for (__pyx_t_10 = 0; __pyx_t_10 < __pyx_t_9; __pyx_t_10+=1) {
          __pyx_v_j = __pyx_t_10;

          /* "pandas/src/generated.pyx":4674
 *             for i in range(start, stop):
 *                 for j in range(sy):
 *                     out[i, j] = arr[i, j] - arr[i - periods, j]             # <<<<<<<<<<<<<<
 *         else:
 *             if periods >= 0:
 */
          __pyx_t_23 = __pyx_v_i;
          __pyx_t_24 = __pyx_v_j;
          __pyx_t_25 = (__pyx_v_i - __pyx_v_periods);
          __pyx_t_26 = __pyx_v_j;
          __pyx_t_27 = __pyx_v_i;
          __pyx_t_28 = __pyx_v_j;
          *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_27, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_28, __pyx_pybuffernd_out.diminfo[1].strides) = ((*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_arr.rcbuffer->pybuffer.buf, __pyx_t_23, __pyx_pybuffernd_arr.diminfo[0].strides, __pyx_t_24, __pyx_pybuffernd_arr.diminfo[1].strides)) - (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_arr.rcbuffer->pybuffer.buf, __pyx_t_25, __pyx_pybuffernd_arr.diminfo[0].strides, __pyx_t_26, __pyx_pybuffernd_arr.diminfo[1].strides)));
        }
      }
      goto __pyx_L17;
    }
    /*else*/ {

      /* "pandas/src/generated.pyx":4676
 *                     out[i, j] = arr[i, j] - arr[i - periods, j]
 *         else:
 *             if periods >= 0:             # <<<<<<<<<<<<<<
 *                 start, stop = periods, sy
 *             else:
 */
      __pyx_t_8 = ((__pyx_v_periods >= 0) != 0);
      if (__pyx_t_8) {

        /* "pandas/src/generated.pyx":4677
 *         else:
 *             if periods >= 0:
 *                 start, stop = periods, sy             # <<<<<<<<<<<<<<
 *             else:
 *                 start, stop = 0, sy + periods
 */
        __pyx_t_7 = __pyx_v_periods;
        __pyx_t_6 = __pyx_v_sy;
        __pyx_v_start = __pyx_t_7;
        __pyx_v_stop = __pyx_t_6;
        goto __pyx_L23;
      }
      /*else*/ {

        /* "pandas/src/generated.pyx":4679
 *                 start, stop = periods, sy
 *             else:
 *                 start, stop = 0, sy + periods             # <<<<<<<<<<<<<<
 *             for i in range(sx):
 *                 for j in range(start, stop):
 */
        __pyx_t_6 = 0;
        __pyx_t_7 = (__pyx_v_sy + __pyx_v_periods);
        __pyx_v_start = __pyx_t_6;
        __pyx_v_stop = __pyx_t_7;
      }
      __pyx_L23:;

      /* "pandas/src/generated.pyx":4680
 *             else:
 *                 start, stop = 0, sy + periods
 *             for i in range(sx):             # <<<<<<<<<<<<<<
 *                 for j in range(start, stop):
 *                     out[i, j] = arr[i, j] - arr[i, j - periods]
 */
      __pyx_t_7 = __pyx_v_sx;
      for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_7; __pyx_t_6+=1) {
        __pyx_v_i = __pyx_t_6;

        /* "pandas/src/generated.pyx":4681
 *                 start, stop = 0, sy + periods
 *             for i in range(sx):
 *                 for j in range(start, stop):             # <<<<<<<<<<<<<<
 *                     out[i, j] = arr[i, j] - arr[i, j - periods]
 * @cython.boundscheck(False)
 */
        __pyx_t_9 = __pyx_v_stop;
        for (__pyx_t_10 = __pyx_v_start; __pyx_t_10 < __pyx_t_9; __pyx_t_10+=1) {
          __pyx_v_j = __pyx_t_10;

          /* "pandas/src/generated.pyx":4682
 *             for i in range(sx):
 *                 for j in range(start, stop):
 *                     out[i, j] = arr[i, j] - arr[i, j - periods]             # <<<<<<<<<<<<<<
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 */
          __pyx_t_29 = __pyx_v_i;
          __pyx_t_30 = __pyx_v_j;
          __pyx_t_31 = __pyx_v_i;
          __pyx_t_32 = (__pyx_v_j - __pyx_v_periods);
          __pyx_t_33 = __pyx_v_i;
          __pyx_t_34 = __pyx_v_j;
          *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_33, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_34, __pyx_pybuffernd_out.diminfo[1].strides) = ((*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_arr.rcbuffer->pybuffer.buf, __pyx_t_29, __pyx_pybuffernd_arr.diminfo[0].strides, __pyx_t_30, __pyx_pybuffernd_arr.diminfo[1].strides)) - (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_arr.rcbuffer->pybuffer.buf, __pyx_t_31, __pyx_pybuffernd_arr.diminfo[0].strides, __pyx_t_32, __pyx_pybuffernd_arr.diminfo[1].strides)));
        }
      }
    }
    __pyx_L17:;
  }
  __pyx_L5:;

  /* "pandas/src/generated.pyx":4642
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def diff_2d_int32(ndarray[int32_t, ndim=2] arr,             # <<<<<<<<<<<<<<
 *                      ndarray[float64_t, ndim=2] out,
 *                     Py_ssize_t periods, int axis):
 */

  /* function exit code */
  __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_pybuffernd_arr.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas.algos.diff_2d_int32", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_arr.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer);
  __pyx_L2:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/src/generated.pyx":4685
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def diff_2d_int64(ndarray[int64_t, ndim=2] arr,             # <<<<<<<<<<<<<<
 *                      ndarray[float64_t, ndim=2] out,
 *                     Py_ssize_t periods, int axis):
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pandas_5algos_385diff_2d_int64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_5algos_385diff_2d_int64 = {__Pyx_NAMESTR("diff_2d_int64"), (PyCFunction)__pyx_pw_6pandas_5algos_385diff_2d_int64, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pw_6pandas_5algos_385diff_2d_int64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyArrayObject *__pyx_v_arr = 0;
  PyArrayObject *__pyx_v_out = 0;
  Py_ssize_t __pyx_v_periods;
  int __pyx_v_axis;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("diff_2d_int64 (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_arr,&__pyx_n_s_out,&__pyx_n_s_periods,&__pyx_n_s_axis,0};
    PyObject* values[4] = {0,0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_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 (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_arr)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_out)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("diff_2d_int64", 1, 4, 4, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4685; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_periods)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("diff_2d_int64", 1, 4, 4, 2); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4685; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  3:
        if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_axis)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("diff_2d_int64", 1, 4, 4, 3); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4685; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "diff_2d_int64") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4685; __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_arr = ((PyArrayObject *)values[0]);
    __pyx_v_out = ((PyArrayObject *)values[1]);
    __pyx_v_periods = __Pyx_PyIndex_AsSsize_t(values[2]); if (unlikely((__pyx_v_periods == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4687; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_v_axis = __Pyx_PyInt_As_int(values[3]); if (unlikely((__pyx_v_axis == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4687; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("diff_2d_int64", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4685; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas.algos.diff_2d_int64", __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[2]; __pyx_lineno = 4685; __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[2]; __pyx_lineno = 4686; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_384diff_2d_int64(__pyx_self, __pyx_v_arr, __pyx_v_out, __pyx_v_periods, __pyx_v_axis);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pandas_5algos_384diff_2d_int64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_arr, PyArrayObject *__pyx_v_out, Py_ssize_t __pyx_v_periods, int __pyx_v_axis) {
  Py_ssize_t __pyx_v_i;
  Py_ssize_t __pyx_v_j;
  Py_ssize_t __pyx_v_sx;
  Py_ssize_t __pyx_v_sy;
  Py_ssize_t __pyx_v_start;
  Py_ssize_t __pyx_v_stop;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_arr;
  __Pyx_Buffer __pyx_pybuffer_arr;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_out;
  __Pyx_Buffer __pyx_pybuffer_out;
  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;
  int __pyx_t_8;
  Py_ssize_t __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;
  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;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("diff_2d_int64", 0);
  __pyx_pybuffer_arr.pybuffer.buf = NULL;
  __pyx_pybuffer_arr.refcount = 0;
  __pyx_pybuffernd_arr.data = NULL;
  __pyx_pybuffernd_arr.rcbuffer = &__pyx_pybuffer_arr;
  __pyx_pybuffer_out.pybuffer.buf = NULL;
  __pyx_pybuffer_out.refcount = 0;
  __pyx_pybuffernd_out.data = NULL;
  __pyx_pybuffernd_out.rcbuffer = &__pyx_pybuffer_out;
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_arr.rcbuffer->pybuffer, (PyObject*)__pyx_v_arr, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4685; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_arr.diminfo[0].strides = __pyx_pybuffernd_arr.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_arr.diminfo[0].shape = __pyx_pybuffernd_arr.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_arr.diminfo[1].strides = __pyx_pybuffernd_arr.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_arr.diminfo[1].shape = __pyx_pybuffernd_arr.rcbuffer->pybuffer.shape[1];
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_out.rcbuffer->pybuffer, (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[2]; __pyx_lineno = 4685; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_out.diminfo[0].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_out.diminfo[0].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_out.diminfo[1].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_out.diminfo[1].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[1];

  /* "pandas/src/generated.pyx":4691
 *         Py_ssize_t i, j, sx, sy
 * 
 *     sx, sy = (<object> arr).shape             # <<<<<<<<<<<<<<
 *     if arr.flags.f_contiguous:
 *         if axis == 0:
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_arr), __pyx_n_s_shape); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4691; __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 CYTHON_COMPILING_IN_CPYTHON
    Py_ssize_t size = Py_SIZE(sequence);
    #else
    Py_ssize_t size = PySequence_Size(sequence);
    #endif
    if (unlikely(size != 2)) {
      if (size > 2) __Pyx_RaiseTooManyValuesError(2);
      else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
      {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4691; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    #if CYTHON_COMPILING_IN_CPYTHON
    if (likely(PyTuple_CheckExact(sequence))) {
      __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); 
      __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1); 
    } else {
      __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);
    #else
    __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4691; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4691; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    #endif
    __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[2]; __pyx_lineno = 4691; __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_L3_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_L3_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_3);
    if (__Pyx_IternextUnpackEndCheck(__pyx_t_5(__pyx_t_4), 2) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4691; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_5 = NULL;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    goto __pyx_L4_unpacking_done;
    __pyx_L3_unpacking_failed:;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_5 = NULL;
    if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
    {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4691; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_L4_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[2]; __pyx_lineno = 4691; __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[2]; __pyx_lineno = 4691; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_v_sx = __pyx_t_6;
  __pyx_v_sy = __pyx_t_7;

  /* "pandas/src/generated.pyx":4692
 * 
 *     sx, sy = (<object> arr).shape
 *     if arr.flags.f_contiguous:             # <<<<<<<<<<<<<<
 *         if axis == 0:
 *             if periods >= 0:
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_arr), __pyx_n_s_flags); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4692; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_f_contiguous); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4692; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4692; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (__pyx_t_8) {

    /* "pandas/src/generated.pyx":4693
 *     sx, sy = (<object> arr).shape
 *     if arr.flags.f_contiguous:
 *         if axis == 0:             # <<<<<<<<<<<<<<
 *             if periods >= 0:
 *                 start, stop = periods, sx
 */
    __pyx_t_8 = ((__pyx_v_axis == 0) != 0);
    if (__pyx_t_8) {

      /* "pandas/src/generated.pyx":4694
 *     if arr.flags.f_contiguous:
 *         if axis == 0:
 *             if periods >= 0:             # <<<<<<<<<<<<<<
 *                 start, stop = periods, sx
 *             else:
 */
      __pyx_t_8 = ((__pyx_v_periods >= 0) != 0);
      if (__pyx_t_8) {

        /* "pandas/src/generated.pyx":4695
 *         if axis == 0:
 *             if periods >= 0:
 *                 start, stop = periods, sx             # <<<<<<<<<<<<<<
 *             else:
 *                 start, stop = 0, sx + periods
 */
        __pyx_t_7 = __pyx_v_periods;
        __pyx_t_6 = __pyx_v_sx;
        __pyx_v_start = __pyx_t_7;
        __pyx_v_stop = __pyx_t_6;
        goto __pyx_L7;
      }
      /*else*/ {

        /* "pandas/src/generated.pyx":4697
 *                 start, stop = periods, sx
 *             else:
 *                 start, stop = 0, sx + periods             # <<<<<<<<<<<<<<
 *             for j in range(sy):
 *                 for i in range(start, stop):
 */
        __pyx_t_6 = 0;
        __pyx_t_7 = (__pyx_v_sx + __pyx_v_periods);
        __pyx_v_start = __pyx_t_6;
        __pyx_v_stop = __pyx_t_7;
      }
      __pyx_L7:;

      /* "pandas/src/generated.pyx":4698
 *             else:
 *                 start, stop = 0, sx + periods
 *             for j in range(sy):             # <<<<<<<<<<<<<<
 *                 for i in range(start, stop):
 *                     out[i, j] = arr[i, j] - arr[i - periods, j]
 */
      __pyx_t_7 = __pyx_v_sy;
      for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_7; __pyx_t_6+=1) {
        __pyx_v_j = __pyx_t_6;

        /* "pandas/src/generated.pyx":4699
 *                 start, stop = 0, sx + periods
 *             for j in range(sy):
 *                 for i in range(start, stop):             # <<<<<<<<<<<<<<
 *                     out[i, j] = arr[i, j] - arr[i - periods, j]
 *         else:
 */
        __pyx_t_9 = __pyx_v_stop;
        for (__pyx_t_10 = __pyx_v_start; __pyx_t_10 < __pyx_t_9; __pyx_t_10+=1) {
          __pyx_v_i = __pyx_t_10;

          /* "pandas/src/generated.pyx":4700
 *             for j in range(sy):
 *                 for i in range(start, stop):
 *                     out[i, j] = arr[i, j] - arr[i - periods, j]             # <<<<<<<<<<<<<<
 *         else:
 *             if periods >= 0:
 */
          __pyx_t_11 = __pyx_v_i;
          __pyx_t_12 = __pyx_v_j;
          __pyx_t_13 = (__pyx_v_i - __pyx_v_periods);
          __pyx_t_14 = __pyx_v_j;
          __pyx_t_15 = __pyx_v_i;
          __pyx_t_16 = __pyx_v_j;
          *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_16, __pyx_pybuffernd_out.diminfo[1].strides) = ((*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_arr.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_arr.diminfo[0].strides, __pyx_t_12, __pyx_pybuffernd_arr.diminfo[1].strides)) - (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_arr.rcbuffer->pybuffer.buf, __pyx_t_13, __pyx_pybuffernd_arr.diminfo[0].strides, __pyx_t_14, __pyx_pybuffernd_arr.diminfo[1].strides)));
        }
      }
      goto __pyx_L6;
    }
    /*else*/ {

      /* "pandas/src/generated.pyx":4702
 *                     out[i, j] = arr[i, j] - arr[i - periods, j]
 *         else:
 *             if periods >= 0:             # <<<<<<<<<<<<<<
 *                 start, stop = periods, sy
 *             else:
 */
      __pyx_t_8 = ((__pyx_v_periods >= 0) != 0);
      if (__pyx_t_8) {

        /* "pandas/src/generated.pyx":4703
 *         else:
 *             if periods >= 0:
 *                 start, stop = periods, sy             # <<<<<<<<<<<<<<
 *             else:
 *                 start, stop = 0, sy + periods
 */
        __pyx_t_7 = __pyx_v_periods;
        __pyx_t_6 = __pyx_v_sy;
        __pyx_v_start = __pyx_t_7;
        __pyx_v_stop = __pyx_t_6;
        goto __pyx_L12;
      }
      /*else*/ {

        /* "pandas/src/generated.pyx":4705
 *                 start, stop = periods, sy
 *             else:
 *                 start, stop = 0, sy + periods             # <<<<<<<<<<<<<<
 *             for j in range(start, stop):
 *                 for i in range(sx):
 */
        __pyx_t_6 = 0;
        __pyx_t_7 = (__pyx_v_sy + __pyx_v_periods);
        __pyx_v_start = __pyx_t_6;
        __pyx_v_stop = __pyx_t_7;
      }
      __pyx_L12:;

      /* "pandas/src/generated.pyx":4706
 *             else:
 *                 start, stop = 0, sy + periods
 *             for j in range(start, stop):             # <<<<<<<<<<<<<<
 *                 for i in range(sx):
 *                     out[i, j] = arr[i, j] - arr[i, j - periods]
 */
      __pyx_t_7 = __pyx_v_stop;
      for (__pyx_t_6 = __pyx_v_start; __pyx_t_6 < __pyx_t_7; __pyx_t_6+=1) {
        __pyx_v_j = __pyx_t_6;

        /* "pandas/src/generated.pyx":4707
 *                 start, stop = 0, sy + periods
 *             for j in range(start, stop):
 *                 for i in range(sx):             # <<<<<<<<<<<<<<
 *                     out[i, j] = arr[i, j] - arr[i, j - periods]
 *     else:
 */
        __pyx_t_9 = __pyx_v_sx;
        for (__pyx_t_10 = 0; __pyx_t_10 < __pyx_t_9; __pyx_t_10+=1) {
          __pyx_v_i = __pyx_t_10;

          /* "pandas/src/generated.pyx":4708
 *             for j in range(start, stop):
 *                 for i in range(sx):
 *                     out[i, j] = arr[i, j] - arr[i, j - periods]             # <<<<<<<<<<<<<<
 *     else:
 *         if axis == 0:
 */
          __pyx_t_17 = __pyx_v_i;
          __pyx_t_18 = __pyx_v_j;
          __pyx_t_19 = __pyx_v_i;
          __pyx_t_20 = (__pyx_v_j - __pyx_v_periods);
          __pyx_t_21 = __pyx_v_i;
          __pyx_t_22 = __pyx_v_j;
          *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_22, __pyx_pybuffernd_out.diminfo[1].strides) = ((*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_arr.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_arr.diminfo[0].strides, __pyx_t_18, __pyx_pybuffernd_arr.diminfo[1].strides)) - (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_arr.rcbuffer->pybuffer.buf, __pyx_t_19, __pyx_pybuffernd_arr.diminfo[0].strides, __pyx_t_20, __pyx_pybuffernd_arr.diminfo[1].strides)));
        }
      }
    }
    __pyx_L6:;
    goto __pyx_L5;
  }
  /*else*/ {

    /* "pandas/src/generated.pyx":4710
 *                     out[i, j] = arr[i, j] - arr[i, j - periods]
 *     else:
 *         if axis == 0:             # <<<<<<<<<<<<<<
 *             if periods >= 0:
 *                 start, stop = periods, sx
 */
    __pyx_t_8 = ((__pyx_v_axis == 0) != 0);
    if (__pyx_t_8) {

      /* "pandas/src/generated.pyx":4711
 *     else:
 *         if axis == 0:
 *             if periods >= 0:             # <<<<<<<<<<<<<<
 *                 start, stop = periods, sx
 *             else:
 */
      __pyx_t_8 = ((__pyx_v_periods >= 0) != 0);
      if (__pyx_t_8) {

        /* "pandas/src/generated.pyx":4712
 *         if axis == 0:
 *             if periods >= 0:
 *                 start, stop = periods, sx             # <<<<<<<<<<<<<<
 *             else:
 *                 start, stop = 0, sx + periods
 */
        __pyx_t_7 = __pyx_v_periods;
        __pyx_t_6 = __pyx_v_sx;
        __pyx_v_start = __pyx_t_7;
        __pyx_v_stop = __pyx_t_6;
        goto __pyx_L18;
      }
      /*else*/ {

        /* "pandas/src/generated.pyx":4714
 *                 start, stop = periods, sx
 *             else:
 *                 start, stop = 0, sx + periods             # <<<<<<<<<<<<<<
 *             for i in range(start, stop):
 *                 for j in range(sy):
 */
        __pyx_t_6 = 0;
        __pyx_t_7 = (__pyx_v_sx + __pyx_v_periods);
        __pyx_v_start = __pyx_t_6;
        __pyx_v_stop = __pyx_t_7;
      }
      __pyx_L18:;

      /* "pandas/src/generated.pyx":4715
 *             else:
 *                 start, stop = 0, sx + periods
 *             for i in range(start, stop):             # <<<<<<<<<<<<<<
 *                 for j in range(sy):
 *                     out[i, j] = arr[i, j] - arr[i - periods, j]
 */
      __pyx_t_7 = __pyx_v_stop;
      for (__pyx_t_6 = __pyx_v_start; __pyx_t_6 < __pyx_t_7; __pyx_t_6+=1) {
        __pyx_v_i = __pyx_t_6;

        /* "pandas/src/generated.pyx":4716
 *                 start, stop = 0, sx + periods
 *             for i in range(start, stop):
 *                 for j in range(sy):             # <<<<<<<<<<<<<<
 *                     out[i, j] = arr[i, j] - arr[i - periods, j]
 *         else:
 */
        __pyx_t_9 = __pyx_v_sy;
        for (__pyx_t_10 = 0; __pyx_t_10 < __pyx_t_9; __pyx_t_10+=1) {
          __pyx_v_j = __pyx_t_10;

          /* "pandas/src/generated.pyx":4717
 *             for i in range(start, stop):
 *                 for j in range(sy):
 *                     out[i, j] = arr[i, j] - arr[i - periods, j]             # <<<<<<<<<<<<<<
 *         else:
 *             if periods >= 0:
 */
          __pyx_t_23 = __pyx_v_i;
          __pyx_t_24 = __pyx_v_j;
          __pyx_t_25 = (__pyx_v_i - __pyx_v_periods);
          __pyx_t_26 = __pyx_v_j;
          __pyx_t_27 = __pyx_v_i;
          __pyx_t_28 = __pyx_v_j;
          *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_27, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_28, __pyx_pybuffernd_out.diminfo[1].strides) = ((*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_arr.rcbuffer->pybuffer.buf, __pyx_t_23, __pyx_pybuffernd_arr.diminfo[0].strides, __pyx_t_24, __pyx_pybuffernd_arr.diminfo[1].strides)) - (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_arr.rcbuffer->pybuffer.buf, __pyx_t_25, __pyx_pybuffernd_arr.diminfo[0].strides, __pyx_t_26, __pyx_pybuffernd_arr.diminfo[1].strides)));
        }
      }
      goto __pyx_L17;
    }
    /*else*/ {

      /* "pandas/src/generated.pyx":4719
 *                     out[i, j] = arr[i, j] - arr[i - periods, j]
 *         else:
 *             if periods >= 0:             # <<<<<<<<<<<<<<
 *                 start, stop = periods, sy
 *             else:
 */
      __pyx_t_8 = ((__pyx_v_periods >= 0) != 0);
      if (__pyx_t_8) {

        /* "pandas/src/generated.pyx":4720
 *         else:
 *             if periods >= 0:
 *                 start, stop = periods, sy             # <<<<<<<<<<<<<<
 *             else:
 *                 start, stop = 0, sy + periods
 */
        __pyx_t_7 = __pyx_v_periods;
        __pyx_t_6 = __pyx_v_sy;
        __pyx_v_start = __pyx_t_7;
        __pyx_v_stop = __pyx_t_6;
        goto __pyx_L23;
      }
      /*else*/ {

        /* "pandas/src/generated.pyx":4722
 *                 start, stop = periods, sy
 *             else:
 *                 start, stop = 0, sy + periods             # <<<<<<<<<<<<<<
 *             for i in range(sx):
 *                 for j in range(start, stop):
 */
        __pyx_t_6 = 0;
        __pyx_t_7 = (__pyx_v_sy + __pyx_v_periods);
        __pyx_v_start = __pyx_t_6;
        __pyx_v_stop = __pyx_t_7;
      }
      __pyx_L23:;

      /* "pandas/src/generated.pyx":4723
 *             else:
 *                 start, stop = 0, sy + periods
 *             for i in range(sx):             # <<<<<<<<<<<<<<
 *                 for j in range(start, stop):
 *                     out[i, j] = arr[i, j] - arr[i, j - periods]
 */
      __pyx_t_7 = __pyx_v_sx;
      for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_7; __pyx_t_6+=1) {
        __pyx_v_i = __pyx_t_6;

        /* "pandas/src/generated.pyx":4724
 *                 start, stop = 0, sy + periods
 *             for i in range(sx):
 *                 for j in range(start, stop):             # <<<<<<<<<<<<<<
 *                     out[i, j] = arr[i, j] - arr[i, j - periods]
 * 
 */
        __pyx_t_9 = __pyx_v_stop;
        for (__pyx_t_10 = __pyx_v_start; __pyx_t_10 < __pyx_t_9; __pyx_t_10+=1) {
          __pyx_v_j = __pyx_t_10;

          /* "pandas/src/generated.pyx":4725
 *             for i in range(sx):
 *                 for j in range(start, stop):
 *                     out[i, j] = arr[i, j] - arr[i, j - periods]             # <<<<<<<<<<<<<<
 * 
 * @cython.wraparound(False)
 */
          __pyx_t_29 = __pyx_v_i;
          __pyx_t_30 = __pyx_v_j;
          __pyx_t_31 = __pyx_v_i;
          __pyx_t_32 = (__pyx_v_j - __pyx_v_periods);
          __pyx_t_33 = __pyx_v_i;
          __pyx_t_34 = __pyx_v_j;
          *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_33, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_34, __pyx_pybuffernd_out.diminfo[1].strides) = ((*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_arr.rcbuffer->pybuffer.buf, __pyx_t_29, __pyx_pybuffernd_arr.diminfo[0].strides, __pyx_t_30, __pyx_pybuffernd_arr.diminfo[1].strides)) - (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_arr.rcbuffer->pybuffer.buf, __pyx_t_31, __pyx_pybuffernd_arr.diminfo[0].strides, __pyx_t_32, __pyx_pybuffernd_arr.diminfo[1].strides)));
        }
      }
    }
    __pyx_L17:;
  }
  __pyx_L5:;

  /* "pandas/src/generated.pyx":4685
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def diff_2d_int64(ndarray[int64_t, ndim=2] arr,             # <<<<<<<<<<<<<<
 *                      ndarray[float64_t, ndim=2] out,
 *                     Py_ssize_t periods, int axis):
 */

  /* function exit code */
  __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_pybuffernd_arr.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas.algos.diff_2d_int64", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_arr.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer);
  __pyx_L2:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/src/generated.pyx":4729
 * @cython.wraparound(False)
 * @cython.wraparound(False)
 * def group_last_float64(ndarray[float64_t, ndim=2] out,             # <<<<<<<<<<<<<<
 *                ndarray[int64_t] counts,
 *                ndarray[float64_t, ndim=2] values,
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pandas_5algos_387group_last_float64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6pandas_5algos_386group_last_float64[] = "\n    Only aggregates on axis=0\n    ";
static PyMethodDef __pyx_mdef_6pandas_5algos_387group_last_float64 = {__Pyx_NAMESTR("group_last_float64"), (PyCFunction)__pyx_pw_6pandas_5algos_387group_last_float64, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6pandas_5algos_386group_last_float64)};
static PyObject *__pyx_pw_6pandas_5algos_387group_last_float64(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;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("group_last_float64 (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_out,&__pyx_n_s_counts,&__pyx_n_s_values,&__pyx_n_s_labels,0};
    PyObject* values[4] = {0,0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_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 (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_out)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_counts)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("group_last_float64", 1, 4, 4, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4729; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("group_last_float64", 1, 4, 4, 2); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4729; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  3:
        if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_labels)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("group_last_float64", 1, 4, 4, 3); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4729; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "group_last_float64") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4729; __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_float64", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4729; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas.algos.group_last_float64", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_out), __pyx_ptype_5numpy_ndarray, 1, "out", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4729; __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[2]; __pyx_lineno = 4730; __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[2]; __pyx_lineno = 4731; __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[2]; __pyx_lineno = 4732; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_386group_last_float64(__pyx_self, __pyx_v_out, __pyx_v_counts, __pyx_v_values, __pyx_v_labels);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pandas_5algos_386group_last_float64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_out, PyArrayObject *__pyx_v_counts, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_labels) {
  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;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_counts;
  __Pyx_Buffer __pyx_pybuffer_counts;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_labels;
  __Pyx_Buffer __pyx_pybuffer_labels;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_nobs;
  __Pyx_Buffer __pyx_pybuffer_nobs;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_out;
  __Pyx_Buffer __pyx_pybuffer_out;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_resx;
  __Pyx_Buffer __pyx_pybuffer_resx;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_values;
  __Pyx_Buffer __pyx_pybuffer_values;
  PyObject *__pyx_r = NULL;
  __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;
  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;
  PyArrayObject *__pyx_t_14 = NULL;
  PyObject *(*__pyx_t_15)(PyObject *);
  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;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("group_last_float64", 0);
  __pyx_pybuffer_resx.pybuffer.buf = NULL;
  __pyx_pybuffer_resx.refcount = 0;
  __pyx_pybuffernd_resx.data = NULL;
  __pyx_pybuffernd_resx.rcbuffer = &__pyx_pybuffer_resx;
  __pyx_pybuffer_nobs.pybuffer.buf = NULL;
  __pyx_pybuffer_nobs.refcount = 0;
  __pyx_pybuffernd_nobs.data = NULL;
  __pyx_pybuffernd_nobs.rcbuffer = &__pyx_pybuffer_nobs;
  __pyx_pybuffer_out.pybuffer.buf = NULL;
  __pyx_pybuffer_out.refcount = 0;
  __pyx_pybuffernd_out.data = NULL;
  __pyx_pybuffernd_out.rcbuffer = &__pyx_pybuffer_out;
  __pyx_pybuffer_counts.pybuffer.buf = NULL;
  __pyx_pybuffer_counts.refcount = 0;
  __pyx_pybuffernd_counts.data = NULL;
  __pyx_pybuffernd_counts.rcbuffer = &__pyx_pybuffer_counts;
  __pyx_pybuffer_values.pybuffer.buf = NULL;
  __pyx_pybuffer_values.refcount = 0;
  __pyx_pybuffernd_values.data = NULL;
  __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values;
  __pyx_pybuffer_labels.pybuffer.buf = NULL;
  __pyx_pybuffer_labels.refcount = 0;
  __pyx_pybuffernd_labels.data = NULL;
  __pyx_pybuffernd_labels.rcbuffer = &__pyx_pybuffer_labels;
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_out.rcbuffer->pybuffer, (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[2]; __pyx_lineno = 4729; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_out.diminfo[0].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_out.diminfo[0].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_out.diminfo[1].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_out.diminfo[1].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[1];
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_counts.rcbuffer->pybuffer, (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[2]; __pyx_lineno = 4729; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_counts.diminfo[0].strides = __pyx_pybuffernd_counts.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_counts.diminfo[0].shape = __pyx_pybuffernd_counts.rcbuffer->pybuffer.shape[0];
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (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[2]; __pyx_lineno = 4729; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_values.diminfo[1].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_values.diminfo[1].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[1];
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_labels.rcbuffer->pybuffer, (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[2]; __pyx_lineno = 4729; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_labels.diminfo[0].strides = __pyx_pybuffernd_labels.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_labels.diminfo[0].shape = __pyx_pybuffernd_labels.rcbuffer->pybuffer.shape[0];

  /* "pandas/src/generated.pyx":4742
 *         ndarray[int64_t, ndim=2] nobs
 * 
 *     if not len(values) == len(labels):             # <<<<<<<<<<<<<<
 *        raise AssertionError("len(index) != len(labels)")
 * 
 */
  __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_values)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4742; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_2 = PyObject_Length(((PyObject *)__pyx_v_labels)); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4742; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_3 = ((!((__pyx_t_1 == __pyx_t_2) != 0)) != 0);
  if (__pyx_t_3) {

    /* "pandas/src/generated.pyx":4743
 * 
 *     if not len(values) == len(labels):
 *        raise AssertionError("len(index) != len(labels)")             # <<<<<<<<<<<<<<
 * 
 *     nobs = np.zeros((<object> out).shape, dtype=np.int64)
 */
    __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_AssertionError, __pyx_tuple__192, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4743; __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[2]; __pyx_lineno = 4743; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }

  /* "pandas/src/generated.pyx":4745
 *        raise AssertionError("len(index) != len(labels)")
 * 
 *     nobs = np.zeros((<object> out).shape, dtype=np.int64)             # <<<<<<<<<<<<<<
 *     resx = np.empty_like(out)
 * 
 */
  __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4745; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_zeros); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4745; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_out), __pyx_n_s_shape); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4745; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4745; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__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 = PyDict_New(); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4745; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4745; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_int64); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4745; __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_4, __pyx_n_s_dtype, __pyx_t_8) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4745; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_6, __pyx_t_4); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4745; __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_6); __pyx_t_6 = 0;
  __Pyx_DECREF(__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[2]; __pyx_lineno = 4745; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_9 = ((PyArrayObject *)__pyx_t_8);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer);
    __pyx_t_10 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer, (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_pybuffernd_nobs.rcbuffer->pybuffer, (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_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_pybuffernd_nobs.diminfo[0].strides = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_nobs.diminfo[0].shape = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_nobs.diminfo[1].strides = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_nobs.diminfo[1].shape = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.shape[1];
    if (unlikely(__pyx_t_10 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4745; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_9 = 0;
  __pyx_v_nobs = ((PyArrayObject *)__pyx_t_8);
  __pyx_t_8 = 0;

  /* "pandas/src/generated.pyx":4746
 * 
 *     nobs = np.zeros((<object> out).shape, dtype=np.int64)
 *     resx = np.empty_like(out)             # <<<<<<<<<<<<<<
 * 
 *     N, K = (<object> values).shape
 */
  __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4746; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_8);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_empty_like); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4746; __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[2]; __pyx_lineno = 4746; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_INCREF(((PyObject *)__pyx_v_out));
  PyTuple_SET_ITEM(__pyx_t_8, 0, ((PyObject *)__pyx_v_out));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_out));
  __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_8, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4746; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 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 = 4746; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_14 = ((PyArrayObject *)__pyx_t_6);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_resx.rcbuffer->pybuffer);
    __pyx_t_10 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_resx.rcbuffer->pybuffer, (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_10 < 0)) {
      PyErr_Fetch(&__pyx_t_13, &__pyx_t_12, &__pyx_t_11);
      if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_resx.rcbuffer->pybuffer, (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_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_pybuffernd_resx.diminfo[0].strides = __pyx_pybuffernd_resx.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_resx.diminfo[0].shape = __pyx_pybuffernd_resx.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_resx.diminfo[1].strides = __pyx_pybuffernd_resx.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_resx.diminfo[1].shape = __pyx_pybuffernd_resx.rcbuffer->pybuffer.shape[1];
    if (unlikely(__pyx_t_10 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4746; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_14 = 0;
  __pyx_v_resx = ((PyArrayObject *)__pyx_t_6);
  __pyx_t_6 = 0;

  /* "pandas/src/generated.pyx":4748
 *     resx = np.empty_like(out)
 * 
 *     N, K = (<object> values).shape             # <<<<<<<<<<<<<<
 * 
 *     for i in range(N):
 */
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_values), __pyx_n_s_shape); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4748; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  if ((likely(PyTuple_CheckExact(__pyx_t_6))) || (PyList_CheckExact(__pyx_t_6))) {
    PyObject* sequence = __pyx_t_6;
    #if CYTHON_COMPILING_IN_CPYTHON
    Py_ssize_t size = Py_SIZE(sequence);
    #else
    Py_ssize_t size = PySequence_Size(sequence);
    #endif
    if (unlikely(size != 2)) {
      if (size > 2) __Pyx_RaiseTooManyValuesError(2);
      else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
      {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4748; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    #if CYTHON_COMPILING_IN_CPYTHON
    if (likely(PyTuple_CheckExact(sequence))) {
      __pyx_t_8 = PyTuple_GET_ITEM(sequence, 0); 
      __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1); 
    } else {
      __pyx_t_8 = PyList_GET_ITEM(sequence, 0); 
      __pyx_t_4 = PyList_GET_ITEM(sequence, 1); 
    }
    __Pyx_INCREF(__pyx_t_8);
    __Pyx_INCREF(__pyx_t_4);
    #else
    __pyx_t_8 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4748; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4748; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    #endif
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  } else {
    Py_ssize_t index = -1;
    __pyx_t_5 = PyObject_GetIter(__pyx_t_6); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4748; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_15 = Py_TYPE(__pyx_t_5)->tp_iternext;
    index = 0; __pyx_t_8 = __pyx_t_15(__pyx_t_5); if (unlikely(!__pyx_t_8)) goto __pyx_L4_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_8);
    index = 1; __pyx_t_4 = __pyx_t_15(__pyx_t_5); if (unlikely(!__pyx_t_4)) goto __pyx_L4_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_4);
    if (__Pyx_IternextUnpackEndCheck(__pyx_t_15(__pyx_t_5), 2) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4748; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_15 = NULL;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    goto __pyx_L5_unpacking_done;
    __pyx_L4_unpacking_failed:;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_15 = NULL;
    if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
    {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4748; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_L5_unpacking_done:;
  }
  __pyx_t_2 = __Pyx_PyIndex_AsSsize_t(__pyx_t_8); if (unlikely((__pyx_t_2 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4748; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  __pyx_t_1 = __Pyx_PyIndex_AsSsize_t(__pyx_t_4); if (unlikely((__pyx_t_1 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4748; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_v_N = __pyx_t_2;
  __pyx_v_K = __pyx_t_1;

  /* "pandas/src/generated.pyx":4750
 *     N, K = (<object> values).shape
 * 
 *     for i in range(N):             # <<<<<<<<<<<<<<
 *         lab = labels[i]
 *         if lab < 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;

    /* "pandas/src/generated.pyx":4751
 * 
 *     for i in range(N):
 *         lab = labels[i]             # <<<<<<<<<<<<<<
 *         if lab < 0:
 *             continue
 */
    __pyx_t_16 = __pyx_v_i;
    __pyx_t_10 = -1;
    if (__pyx_t_16 < 0) {
      __pyx_t_10 = 0;
    } else if (unlikely(__pyx_t_16 >= __pyx_pybuffernd_labels.diminfo[0].shape)) __pyx_t_10 = 0;
    if (unlikely(__pyx_t_10 != -1)) {
      __Pyx_RaiseBufferIndexError(__pyx_t_10);
      {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4751; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_v_lab = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_labels.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_labels.diminfo[0].strides));

    /* "pandas/src/generated.pyx":4752
 *     for i in range(N):
 *         lab = labels[i]
 *         if lab < 0:             # <<<<<<<<<<<<<<
 *             continue
 * 
 */
    __pyx_t_3 = ((__pyx_v_lab < 0) != 0);
    if (__pyx_t_3) {

      /* "pandas/src/generated.pyx":4753
 *         lab = labels[i]
 *         if lab < 0:
 *             continue             # <<<<<<<<<<<<<<
 * 
 *         counts[lab] += 1
 */
      goto __pyx_L6_continue;
    }

    /* "pandas/src/generated.pyx":4755
 *             continue
 * 
 *         counts[lab] += 1             # <<<<<<<<<<<<<<
 *         for j in range(K):
 *             val = values[i, j]
 */
    __pyx_t_17 = __pyx_v_lab;
    __pyx_t_10 = -1;
    if (__pyx_t_17 < 0) {
      __pyx_t_10 = 0;
    } else if (unlikely(__pyx_t_17 >= __pyx_pybuffernd_counts.diminfo[0].shape)) __pyx_t_10 = 0;
    if (unlikely(__pyx_t_10 != -1)) {
      __Pyx_RaiseBufferIndexError(__pyx_t_10);
      {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4755; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_counts.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_counts.diminfo[0].strides) += 1;

    /* "pandas/src/generated.pyx":4756
 * 
 *         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;

      /* "pandas/src/generated.pyx":4757
 *         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_t_10 = -1;
      if (__pyx_t_20 < 0) {
        __pyx_t_10 = 0;
      } else if (unlikely(__pyx_t_20 >= __pyx_pybuffernd_values.diminfo[0].shape)) __pyx_t_10 = 0;
      if (__pyx_t_21 < 0) {
        __pyx_t_10 = 1;
      } else if (unlikely(__pyx_t_21 >= __pyx_pybuffernd_values.diminfo[1].shape)) __pyx_t_10 = 1;
      if (unlikely(__pyx_t_10 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_10);
        {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4757; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_v_val = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_values.diminfo[0].strides, __pyx_t_21, __pyx_pybuffernd_values.diminfo[1].strides));

      /* "pandas/src/generated.pyx":4760
 * 
 *             # not nan
 *             if val == val:             # <<<<<<<<<<<<<<
 *                 nobs[lab, j] += 1
 *                 resx[lab, j] = val
 */
      __pyx_t_3 = ((__pyx_v_val == __pyx_v_val) != 0);
      if (__pyx_t_3) {

        /* "pandas/src/generated.pyx":4761
 *             # 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_t_10 = -1;
        if (__pyx_t_22 < 0) {
          __pyx_t_10 = 0;
        } else if (unlikely(__pyx_t_22 >= __pyx_pybuffernd_nobs.diminfo[0].shape)) __pyx_t_10 = 0;
        if (__pyx_t_23 < 0) {
          __pyx_t_10 = 1;
        } else if (unlikely(__pyx_t_23 >= __pyx_pybuffernd_nobs.diminfo[1].shape)) __pyx_t_10 = 1;
        if (unlikely(__pyx_t_10 != -1)) {
          __Pyx_RaiseBufferIndexError(__pyx_t_10);
          {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4761; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_nobs.rcbuffer->pybuffer.buf, __pyx_t_22, __pyx_pybuffernd_nobs.diminfo[0].strides, __pyx_t_23, __pyx_pybuffernd_nobs.diminfo[1].strides) += 1;

        /* "pandas/src/generated.pyx":4762
 *             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_t_10 = -1;
        if (__pyx_t_24 < 0) {
          __pyx_t_10 = 0;
        } else if (unlikely(__pyx_t_24 >= __pyx_pybuffernd_resx.diminfo[0].shape)) __pyx_t_10 = 0;
        if (__pyx_t_25 < 0) {
          __pyx_t_10 = 1;
        } else if (unlikely(__pyx_t_25 >= __pyx_pybuffernd_resx.diminfo[1].shape)) __pyx_t_10 = 1;
        if (unlikely(__pyx_t_10 != -1)) {
          __Pyx_RaiseBufferIndexError(__pyx_t_10);
          {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4762; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_resx.rcbuffer->pybuffer.buf, __pyx_t_24, __pyx_pybuffernd_resx.diminfo[0].strides, __pyx_t_25, __pyx_pybuffernd_resx.diminfo[1].strides) = __pyx_v_val;
        goto __pyx_L11;
      }
      __pyx_L11:;
    }
    __pyx_L6_continue:;
  }

  /* "pandas/src/generated.pyx":4764
 *                 resx[lab, j] = val
 * 
 *     for i in range(len(counts)):             # <<<<<<<<<<<<<<
 *         for j in range(K):
 *             if nobs[i, j] == 0:
 */
  __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_counts)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4764; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) {
    __pyx_v_i = __pyx_t_2;

    /* "pandas/src/generated.pyx":4765
 * 
 *     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;

      /* "pandas/src/generated.pyx":4766
 *     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_10 = -1;
      if (__pyx_t_26 < 0) {
        __pyx_t_10 = 0;
      } else if (unlikely(__pyx_t_26 >= __pyx_pybuffernd_nobs.diminfo[0].shape)) __pyx_t_10 = 0;
      if (__pyx_t_27 < 0) {
        __pyx_t_10 = 1;
      } else if (unlikely(__pyx_t_27 >= __pyx_pybuffernd_nobs.diminfo[1].shape)) __pyx_t_10 = 1;
      if (unlikely(__pyx_t_10 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_10);
        {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4766; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_t_3 = (((*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_nobs.rcbuffer->pybuffer.buf, __pyx_t_26, __pyx_pybuffernd_nobs.diminfo[0].strides, __pyx_t_27, __pyx_pybuffernd_nobs.diminfo[1].strides)) == 0) != 0);
      if (__pyx_t_3) {

        /* "pandas/src/generated.pyx":4767
 *         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_t_10 = -1;
        if (__pyx_t_28 < 0) {
          __pyx_t_10 = 0;
        } else if (unlikely(__pyx_t_28 >= __pyx_pybuffernd_out.diminfo[0].shape)) __pyx_t_10 = 0;
        if (__pyx_t_29 < 0) {
          __pyx_t_10 = 1;
        } else if (unlikely(__pyx_t_29 >= __pyx_pybuffernd_out.diminfo[1].shape)) __pyx_t_10 = 1;
        if (unlikely(__pyx_t_10 != -1)) {
          __Pyx_RaiseBufferIndexError(__pyx_t_10);
          {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4767; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_28, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_29, __pyx_pybuffernd_out.diminfo[1].strides) = __pyx_v_6pandas_5algos_nan;
        goto __pyx_L16;
      }
      /*else*/ {

        /* "pandas/src/generated.pyx":4769
 *                 out[i, j] = nan
 *             else:
 *                 out[i, j] = resx[i, j]             # <<<<<<<<<<<<<<
 * @cython.wraparound(False)
 * @cython.wraparound(False)
 */
        __pyx_t_30 = __pyx_v_i;
        __pyx_t_31 = __pyx_v_j;
        __pyx_t_10 = -1;
        if (__pyx_t_30 < 0) {
          __pyx_t_10 = 0;
        } else if (unlikely(__pyx_t_30 >= __pyx_pybuffernd_resx.diminfo[0].shape)) __pyx_t_10 = 0;
        if (__pyx_t_31 < 0) {
          __pyx_t_10 = 1;
        } else if (unlikely(__pyx_t_31 >= __pyx_pybuffernd_resx.diminfo[1].shape)) __pyx_t_10 = 1;
        if (unlikely(__pyx_t_10 != -1)) {
          __Pyx_RaiseBufferIndexError(__pyx_t_10);
          {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4769; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        __pyx_t_32 = __pyx_v_i;
        __pyx_t_33 = __pyx_v_j;
        __pyx_t_10 = -1;
        if (__pyx_t_32 < 0) {
          __pyx_t_10 = 0;
        } else if (unlikely(__pyx_t_32 >= __pyx_pybuffernd_out.diminfo[0].shape)) __pyx_t_10 = 0;
        if (__pyx_t_33 < 0) {
          __pyx_t_10 = 1;
        } else if (unlikely(__pyx_t_33 >= __pyx_pybuffernd_out.diminfo[1].shape)) __pyx_t_10 = 1;
        if (unlikely(__pyx_t_10 != -1)) {
          __Pyx_RaiseBufferIndexError(__pyx_t_10);
          {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4769; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_32, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_33, __pyx_pybuffernd_out.diminfo[1].strides) = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_resx.rcbuffer->pybuffer.buf, __pyx_t_30, __pyx_pybuffernd_resx.diminfo[0].strides, __pyx_t_31, __pyx_pybuffernd_resx.diminfo[1].strides));
      }
      __pyx_L16:;
    }
  }

  /* "pandas/src/generated.pyx":4729
 * @cython.wraparound(False)
 * @cython.wraparound(False)
 * def group_last_float64(ndarray[float64_t, ndim=2] out,             # <<<<<<<<<<<<<<
 *                ndarray[int64_t] counts,
 *                ndarray[float64_t, ndim=2] values,
 */

  /* function exit code */
  __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);
  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
    __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_counts.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_labels.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_resx.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas.algos.group_last_float64", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_counts.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_labels.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_resx.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer);
  __pyx_L2:;
  __Pyx_XDECREF((PyObject *)__pyx_v_resx);
  __Pyx_XDECREF((PyObject *)__pyx_v_nobs);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/src/generated.pyx":4772
 * @cython.wraparound(False)
 * @cython.wraparound(False)
 * def group_last_float32(ndarray[float32_t, ndim=2] out,             # <<<<<<<<<<<<<<
 *                ndarray[int64_t] counts,
 *                ndarray[float32_t, ndim=2] values,
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pandas_5algos_389group_last_float32(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6pandas_5algos_388group_last_float32[] = "\n    Only aggregates on axis=0\n    ";
static PyMethodDef __pyx_mdef_6pandas_5algos_389group_last_float32 = {__Pyx_NAMESTR("group_last_float32"), (PyCFunction)__pyx_pw_6pandas_5algos_389group_last_float32, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6pandas_5algos_388group_last_float32)};
static PyObject *__pyx_pw_6pandas_5algos_389group_last_float32(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;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("group_last_float32 (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_out,&__pyx_n_s_counts,&__pyx_n_s_values,&__pyx_n_s_labels,0};
    PyObject* values[4] = {0,0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_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 (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_out)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_counts)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("group_last_float32", 1, 4, 4, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4772; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("group_last_float32", 1, 4, 4, 2); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4772; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  3:
        if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_labels)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("group_last_float32", 1, 4, 4, 3); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4772; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "group_last_float32") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4772; __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_float32", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4772; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas.algos.group_last_float32", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_out), __pyx_ptype_5numpy_ndarray, 1, "out", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4772; __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[2]; __pyx_lineno = 4773; __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[2]; __pyx_lineno = 4774; __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[2]; __pyx_lineno = 4775; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_388group_last_float32(__pyx_self, __pyx_v_out, __pyx_v_counts, __pyx_v_values, __pyx_v_labels);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pandas_5algos_388group_last_float32(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_out, PyArrayObject *__pyx_v_counts, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_labels) {
  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_float32_t __pyx_v_val;
  PyArrayObject *__pyx_v_resx = 0;
  PyArrayObject *__pyx_v_nobs = 0;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_counts;
  __Pyx_Buffer __pyx_pybuffer_counts;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_labels;
  __Pyx_Buffer __pyx_pybuffer_labels;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_nobs;
  __Pyx_Buffer __pyx_pybuffer_nobs;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_out;
  __Pyx_Buffer __pyx_pybuffer_out;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_resx;
  __Pyx_Buffer __pyx_pybuffer_resx;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_values;
  __Pyx_Buffer __pyx_pybuffer_values;
  PyObject *__pyx_r = NULL;
  __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;
  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;
  PyArrayObject *__pyx_t_14 = NULL;
  PyObject *(*__pyx_t_15)(PyObject *);
  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;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("group_last_float32", 0);
  __pyx_pybuffer_resx.pybuffer.buf = NULL;
  __pyx_pybuffer_resx.refcount = 0;
  __pyx_pybuffernd_resx.data = NULL;
  __pyx_pybuffernd_resx.rcbuffer = &__pyx_pybuffer_resx;
  __pyx_pybuffer_nobs.pybuffer.buf = NULL;
  __pyx_pybuffer_nobs.refcount = 0;
  __pyx_pybuffernd_nobs.data = NULL;
  __pyx_pybuffernd_nobs.rcbuffer = &__pyx_pybuffer_nobs;
  __pyx_pybuffer_out.pybuffer.buf = NULL;
  __pyx_pybuffer_out.refcount = 0;
  __pyx_pybuffernd_out.data = NULL;
  __pyx_pybuffernd_out.rcbuffer = &__pyx_pybuffer_out;
  __pyx_pybuffer_counts.pybuffer.buf = NULL;
  __pyx_pybuffer_counts.refcount = 0;
  __pyx_pybuffernd_counts.data = NULL;
  __pyx_pybuffernd_counts.rcbuffer = &__pyx_pybuffer_counts;
  __pyx_pybuffer_values.pybuffer.buf = NULL;
  __pyx_pybuffer_values.refcount = 0;
  __pyx_pybuffernd_values.data = NULL;
  __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values;
  __pyx_pybuffer_labels.pybuffer.buf = NULL;
  __pyx_pybuffer_labels.refcount = 0;
  __pyx_pybuffernd_labels.data = NULL;
  __pyx_pybuffernd_labels.rcbuffer = &__pyx_pybuffer_labels;
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_out.rcbuffer->pybuffer, (PyObject*)__pyx_v_out, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4772; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_out.diminfo[0].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_out.diminfo[0].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_out.diminfo[1].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_out.diminfo[1].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[1];
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_counts.rcbuffer->pybuffer, (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[2]; __pyx_lineno = 4772; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_counts.diminfo[0].strides = __pyx_pybuffernd_counts.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_counts.diminfo[0].shape = __pyx_pybuffernd_counts.rcbuffer->pybuffer.shape[0];
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4772; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_values.diminfo[1].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_values.diminfo[1].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[1];
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_labels.rcbuffer->pybuffer, (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[2]; __pyx_lineno = 4772; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_labels.diminfo[0].strides = __pyx_pybuffernd_labels.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_labels.diminfo[0].shape = __pyx_pybuffernd_labels.rcbuffer->pybuffer.shape[0];

  /* "pandas/src/generated.pyx":4785
 *         ndarray[int64_t, ndim=2] nobs
 * 
 *     if not len(values) == len(labels):             # <<<<<<<<<<<<<<
 *        raise AssertionError("len(index) != len(labels)")
 * 
 */
  __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_values)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4785; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_2 = PyObject_Length(((PyObject *)__pyx_v_labels)); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4785; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_3 = ((!((__pyx_t_1 == __pyx_t_2) != 0)) != 0);
  if (__pyx_t_3) {

    /* "pandas/src/generated.pyx":4786
 * 
 *     if not len(values) == len(labels):
 *        raise AssertionError("len(index) != len(labels)")             # <<<<<<<<<<<<<<
 * 
 *     nobs = np.zeros((<object> out).shape, dtype=np.int64)
 */
    __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_AssertionError, __pyx_tuple__193, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4786; __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[2]; __pyx_lineno = 4786; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }

  /* "pandas/src/generated.pyx":4788
 *        raise AssertionError("len(index) != len(labels)")
 * 
 *     nobs = np.zeros((<object> out).shape, dtype=np.int64)             # <<<<<<<<<<<<<<
 *     resx = np.empty_like(out)
 * 
 */
  __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4788; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_zeros); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4788; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_out), __pyx_n_s_shape); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4788; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4788; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__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 = PyDict_New(); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4788; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4788; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_int64); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4788; __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_4, __pyx_n_s_dtype, __pyx_t_8) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4788; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_6, __pyx_t_4); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4788; __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_6); __pyx_t_6 = 0;
  __Pyx_DECREF(__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[2]; __pyx_lineno = 4788; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_9 = ((PyArrayObject *)__pyx_t_8);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer);
    __pyx_t_10 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer, (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_pybuffernd_nobs.rcbuffer->pybuffer, (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_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_pybuffernd_nobs.diminfo[0].strides = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_nobs.diminfo[0].shape = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_nobs.diminfo[1].strides = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_nobs.diminfo[1].shape = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.shape[1];
    if (unlikely(__pyx_t_10 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4788; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_9 = 0;
  __pyx_v_nobs = ((PyArrayObject *)__pyx_t_8);
  __pyx_t_8 = 0;

  /* "pandas/src/generated.pyx":4789
 * 
 *     nobs = np.zeros((<object> out).shape, dtype=np.int64)
 *     resx = np.empty_like(out)             # <<<<<<<<<<<<<<
 * 
 *     N, K = (<object> values).shape
 */
  __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4789; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_8);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_empty_like); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4789; __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[2]; __pyx_lineno = 4789; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_INCREF(((PyObject *)__pyx_v_out));
  PyTuple_SET_ITEM(__pyx_t_8, 0, ((PyObject *)__pyx_v_out));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_out));
  __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_8, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4789; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 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 = 4789; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_14 = ((PyArrayObject *)__pyx_t_6);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_resx.rcbuffer->pybuffer);
    __pyx_t_10 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_resx.rcbuffer->pybuffer, (PyObject*)__pyx_t_14, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 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_pybuffernd_resx.rcbuffer->pybuffer, (PyObject*)__pyx_v_resx, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 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_pybuffernd_resx.diminfo[0].strides = __pyx_pybuffernd_resx.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_resx.diminfo[0].shape = __pyx_pybuffernd_resx.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_resx.diminfo[1].strides = __pyx_pybuffernd_resx.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_resx.diminfo[1].shape = __pyx_pybuffernd_resx.rcbuffer->pybuffer.shape[1];
    if (unlikely(__pyx_t_10 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4789; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_14 = 0;
  __pyx_v_resx = ((PyArrayObject *)__pyx_t_6);
  __pyx_t_6 = 0;

  /* "pandas/src/generated.pyx":4791
 *     resx = np.empty_like(out)
 * 
 *     N, K = (<object> values).shape             # <<<<<<<<<<<<<<
 * 
 *     for i in range(N):
 */
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_values), __pyx_n_s_shape); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4791; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  if ((likely(PyTuple_CheckExact(__pyx_t_6))) || (PyList_CheckExact(__pyx_t_6))) {
    PyObject* sequence = __pyx_t_6;
    #if CYTHON_COMPILING_IN_CPYTHON
    Py_ssize_t size = Py_SIZE(sequence);
    #else
    Py_ssize_t size = PySequence_Size(sequence);
    #endif
    if (unlikely(size != 2)) {
      if (size > 2) __Pyx_RaiseTooManyValuesError(2);
      else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
      {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4791; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    #if CYTHON_COMPILING_IN_CPYTHON
    if (likely(PyTuple_CheckExact(sequence))) {
      __pyx_t_8 = PyTuple_GET_ITEM(sequence, 0); 
      __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1); 
    } else {
      __pyx_t_8 = PyList_GET_ITEM(sequence, 0); 
      __pyx_t_4 = PyList_GET_ITEM(sequence, 1); 
    }
    __Pyx_INCREF(__pyx_t_8);
    __Pyx_INCREF(__pyx_t_4);
    #else
    __pyx_t_8 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4791; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4791; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    #endif
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  } else {
    Py_ssize_t index = -1;
    __pyx_t_5 = PyObject_GetIter(__pyx_t_6); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4791; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_15 = Py_TYPE(__pyx_t_5)->tp_iternext;
    index = 0; __pyx_t_8 = __pyx_t_15(__pyx_t_5); if (unlikely(!__pyx_t_8)) goto __pyx_L4_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_8);
    index = 1; __pyx_t_4 = __pyx_t_15(__pyx_t_5); if (unlikely(!__pyx_t_4)) goto __pyx_L4_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_4);
    if (__Pyx_IternextUnpackEndCheck(__pyx_t_15(__pyx_t_5), 2) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4791; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_15 = NULL;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    goto __pyx_L5_unpacking_done;
    __pyx_L4_unpacking_failed:;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_15 = NULL;
    if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
    {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4791; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_L5_unpacking_done:;
  }
  __pyx_t_2 = __Pyx_PyIndex_AsSsize_t(__pyx_t_8); if (unlikely((__pyx_t_2 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4791; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  __pyx_t_1 = __Pyx_PyIndex_AsSsize_t(__pyx_t_4); if (unlikely((__pyx_t_1 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4791; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_v_N = __pyx_t_2;
  __pyx_v_K = __pyx_t_1;

  /* "pandas/src/generated.pyx":4793
 *     N, K = (<object> values).shape
 * 
 *     for i in range(N):             # <<<<<<<<<<<<<<
 *         lab = labels[i]
 *         if lab < 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;

    /* "pandas/src/generated.pyx":4794
 * 
 *     for i in range(N):
 *         lab = labels[i]             # <<<<<<<<<<<<<<
 *         if lab < 0:
 *             continue
 */
    __pyx_t_16 = __pyx_v_i;
    __pyx_t_10 = -1;
    if (__pyx_t_16 < 0) {
      __pyx_t_10 = 0;
    } else if (unlikely(__pyx_t_16 >= __pyx_pybuffernd_labels.diminfo[0].shape)) __pyx_t_10 = 0;
    if (unlikely(__pyx_t_10 != -1)) {
      __Pyx_RaiseBufferIndexError(__pyx_t_10);
      {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4794; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_v_lab = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_labels.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_labels.diminfo[0].strides));

    /* "pandas/src/generated.pyx":4795
 *     for i in range(N):
 *         lab = labels[i]
 *         if lab < 0:             # <<<<<<<<<<<<<<
 *             continue
 * 
 */
    __pyx_t_3 = ((__pyx_v_lab < 0) != 0);
    if (__pyx_t_3) {

      /* "pandas/src/generated.pyx":4796
 *         lab = labels[i]
 *         if lab < 0:
 *             continue             # <<<<<<<<<<<<<<
 * 
 *         counts[lab] += 1
 */
      goto __pyx_L6_continue;
    }

    /* "pandas/src/generated.pyx":4798
 *             continue
 * 
 *         counts[lab] += 1             # <<<<<<<<<<<<<<
 *         for j in range(K):
 *             val = values[i, j]
 */
    __pyx_t_17 = __pyx_v_lab;
    __pyx_t_10 = -1;
    if (__pyx_t_17 < 0) {
      __pyx_t_10 = 0;
    } else if (unlikely(__pyx_t_17 >= __pyx_pybuffernd_counts.diminfo[0].shape)) __pyx_t_10 = 0;
    if (unlikely(__pyx_t_10 != -1)) {
      __Pyx_RaiseBufferIndexError(__pyx_t_10);
      {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4798; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_counts.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_counts.diminfo[0].strides) += 1;

    /* "pandas/src/generated.pyx":4799
 * 
 *         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;

      /* "pandas/src/generated.pyx":4800
 *         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_t_10 = -1;
      if (__pyx_t_20 < 0) {
        __pyx_t_10 = 0;
      } else if (unlikely(__pyx_t_20 >= __pyx_pybuffernd_values.diminfo[0].shape)) __pyx_t_10 = 0;
      if (__pyx_t_21 < 0) {
        __pyx_t_10 = 1;
      } else if (unlikely(__pyx_t_21 >= __pyx_pybuffernd_values.diminfo[1].shape)) __pyx_t_10 = 1;
      if (unlikely(__pyx_t_10 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_10);
        {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4800; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_v_val = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_values.diminfo[0].strides, __pyx_t_21, __pyx_pybuffernd_values.diminfo[1].strides));

      /* "pandas/src/generated.pyx":4803
 * 
 *             # not nan
 *             if val == val:             # <<<<<<<<<<<<<<
 *                 nobs[lab, j] += 1
 *                 resx[lab, j] = val
 */
      __pyx_t_3 = ((__pyx_v_val == __pyx_v_val) != 0);
      if (__pyx_t_3) {

        /* "pandas/src/generated.pyx":4804
 *             # 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_t_10 = -1;
        if (__pyx_t_22 < 0) {
          __pyx_t_10 = 0;
        } else if (unlikely(__pyx_t_22 >= __pyx_pybuffernd_nobs.diminfo[0].shape)) __pyx_t_10 = 0;
        if (__pyx_t_23 < 0) {
          __pyx_t_10 = 1;
        } else if (unlikely(__pyx_t_23 >= __pyx_pybuffernd_nobs.diminfo[1].shape)) __pyx_t_10 = 1;
        if (unlikely(__pyx_t_10 != -1)) {
          __Pyx_RaiseBufferIndexError(__pyx_t_10);
          {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4804; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_nobs.rcbuffer->pybuffer.buf, __pyx_t_22, __pyx_pybuffernd_nobs.diminfo[0].strides, __pyx_t_23, __pyx_pybuffernd_nobs.diminfo[1].strides) += 1;

        /* "pandas/src/generated.pyx":4805
 *             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_t_10 = -1;
        if (__pyx_t_24 < 0) {
          __pyx_t_10 = 0;
        } else if (unlikely(__pyx_t_24 >= __pyx_pybuffernd_resx.diminfo[0].shape)) __pyx_t_10 = 0;
        if (__pyx_t_25 < 0) {
          __pyx_t_10 = 1;
        } else if (unlikely(__pyx_t_25 >= __pyx_pybuffernd_resx.diminfo[1].shape)) __pyx_t_10 = 1;
        if (unlikely(__pyx_t_10 != -1)) {
          __Pyx_RaiseBufferIndexError(__pyx_t_10);
          {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4805; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_resx.rcbuffer->pybuffer.buf, __pyx_t_24, __pyx_pybuffernd_resx.diminfo[0].strides, __pyx_t_25, __pyx_pybuffernd_resx.diminfo[1].strides) = __pyx_v_val;
        goto __pyx_L11;
      }
      __pyx_L11:;
    }
    __pyx_L6_continue:;
  }

  /* "pandas/src/generated.pyx":4807
 *                 resx[lab, j] = val
 * 
 *     for i in range(len(counts)):             # <<<<<<<<<<<<<<
 *         for j in range(K):
 *             if nobs[i, j] == 0:
 */
  __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_counts)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4807; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) {
    __pyx_v_i = __pyx_t_2;

    /* "pandas/src/generated.pyx":4808
 * 
 *     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;

      /* "pandas/src/generated.pyx":4809
 *     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_10 = -1;
      if (__pyx_t_26 < 0) {
        __pyx_t_10 = 0;
      } else if (unlikely(__pyx_t_26 >= __pyx_pybuffernd_nobs.diminfo[0].shape)) __pyx_t_10 = 0;
      if (__pyx_t_27 < 0) {
        __pyx_t_10 = 1;
      } else if (unlikely(__pyx_t_27 >= __pyx_pybuffernd_nobs.diminfo[1].shape)) __pyx_t_10 = 1;
      if (unlikely(__pyx_t_10 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_10);
        {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4809; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_t_3 = (((*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_nobs.rcbuffer->pybuffer.buf, __pyx_t_26, __pyx_pybuffernd_nobs.diminfo[0].strides, __pyx_t_27, __pyx_pybuffernd_nobs.diminfo[1].strides)) == 0) != 0);
      if (__pyx_t_3) {

        /* "pandas/src/generated.pyx":4810
 *         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_t_10 = -1;
        if (__pyx_t_28 < 0) {
          __pyx_t_10 = 0;
        } else if (unlikely(__pyx_t_28 >= __pyx_pybuffernd_out.diminfo[0].shape)) __pyx_t_10 = 0;
        if (__pyx_t_29 < 0) {
          __pyx_t_10 = 1;
        } else if (unlikely(__pyx_t_29 >= __pyx_pybuffernd_out.diminfo[1].shape)) __pyx_t_10 = 1;
        if (unlikely(__pyx_t_10 != -1)) {
          __Pyx_RaiseBufferIndexError(__pyx_t_10);
          {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4810; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_28, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_29, __pyx_pybuffernd_out.diminfo[1].strides) = __pyx_v_6pandas_5algos_nan;
        goto __pyx_L16;
      }
      /*else*/ {

        /* "pandas/src/generated.pyx":4812
 *                 out[i, j] = nan
 *             else:
 *                 out[i, j] = resx[i, j]             # <<<<<<<<<<<<<<
 * 
 * @cython.wraparound(False)
 */
        __pyx_t_30 = __pyx_v_i;
        __pyx_t_31 = __pyx_v_j;
        __pyx_t_10 = -1;
        if (__pyx_t_30 < 0) {
          __pyx_t_10 = 0;
        } else if (unlikely(__pyx_t_30 >= __pyx_pybuffernd_resx.diminfo[0].shape)) __pyx_t_10 = 0;
        if (__pyx_t_31 < 0) {
          __pyx_t_10 = 1;
        } else if (unlikely(__pyx_t_31 >= __pyx_pybuffernd_resx.diminfo[1].shape)) __pyx_t_10 = 1;
        if (unlikely(__pyx_t_10 != -1)) {
          __Pyx_RaiseBufferIndexError(__pyx_t_10);
          {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4812; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        __pyx_t_32 = __pyx_v_i;
        __pyx_t_33 = __pyx_v_j;
        __pyx_t_10 = -1;
        if (__pyx_t_32 < 0) {
          __pyx_t_10 = 0;
        } else if (unlikely(__pyx_t_32 >= __pyx_pybuffernd_out.diminfo[0].shape)) __pyx_t_10 = 0;
        if (__pyx_t_33 < 0) {
          __pyx_t_10 = 1;
        } else if (unlikely(__pyx_t_33 >= __pyx_pybuffernd_out.diminfo[1].shape)) __pyx_t_10 = 1;
        if (unlikely(__pyx_t_10 != -1)) {
          __Pyx_RaiseBufferIndexError(__pyx_t_10);
          {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4812; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_32, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_33, __pyx_pybuffernd_out.diminfo[1].strides) = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_resx.rcbuffer->pybuffer.buf, __pyx_t_30, __pyx_pybuffernd_resx.diminfo[0].strides, __pyx_t_31, __pyx_pybuffernd_resx.diminfo[1].strides));
      }
      __pyx_L16:;
    }
  }

  /* "pandas/src/generated.pyx":4772
 * @cython.wraparound(False)
 * @cython.wraparound(False)
 * def group_last_float32(ndarray[float32_t, ndim=2] out,             # <<<<<<<<<<<<<<
 *                ndarray[int64_t] counts,
 *                ndarray[float32_t, ndim=2] values,
 */

  /* function exit code */
  __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);
  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
    __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_counts.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_labels.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_resx.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas.algos.group_last_float32", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_counts.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_labels.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_resx.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer);
  __pyx_L2:;
  __Pyx_XDECREF((PyObject *)__pyx_v_resx);
  __Pyx_XDECREF((PyObject *)__pyx_v_nobs);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/src/generated.pyx":4816
 * @cython.wraparound(False)
 * @cython.wraparound(False)
 * def group_last_bin_float64(ndarray[float64_t, ndim=2] out,             # <<<<<<<<<<<<<<
 *                    ndarray[int64_t] counts,
 *                    ndarray[float64_t, ndim=2] values,
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pandas_5algos_391group_last_bin_float64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6pandas_5algos_390group_last_bin_float64[] = "\n    Only aggregates on axis=0\n    ";
static PyMethodDef __pyx_mdef_6pandas_5algos_391group_last_bin_float64 = {__Pyx_NAMESTR("group_last_bin_float64"), (PyCFunction)__pyx_pw_6pandas_5algos_391group_last_bin_float64, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6pandas_5algos_390group_last_bin_float64)};
static PyObject *__pyx_pw_6pandas_5algos_391group_last_bin_float64(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;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("group_last_bin_float64 (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_out,&__pyx_n_s_counts,&__pyx_n_s_values,&__pyx_n_s_bins,0};
    PyObject* values[4] = {0,0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_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 (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_out)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_counts)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("group_last_bin_float64", 1, 4, 4, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4816; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("group_last_bin_float64", 1, 4, 4, 2); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4816; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  3:
        if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_bins)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("group_last_bin_float64", 1, 4, 4, 3); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4816; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "group_last_bin_float64") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4816; __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_float64", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4816; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas.algos.group_last_bin_float64", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_out), __pyx_ptype_5numpy_ndarray, 1, "out", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4816; __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[2]; __pyx_lineno = 4817; __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[2]; __pyx_lineno = 4818; __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[2]; __pyx_lineno = 4819; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_390group_last_bin_float64(__pyx_self, __pyx_v_out, __pyx_v_counts, __pyx_v_values, __pyx_v_bins);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pandas_5algos_390group_last_bin_float64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_out, PyArrayObject *__pyx_v_counts, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_bins) {
  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;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_bins;
  __Pyx_Buffer __pyx_pybuffer_bins;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_counts;
  __Pyx_Buffer __pyx_pybuffer_counts;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_nobs;
  __Pyx_Buffer __pyx_pybuffer_nobs;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_out;
  __Pyx_Buffer __pyx_pybuffer_out;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_resx;
  __Pyx_Buffer __pyx_pybuffer_resx;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_values;
  __Pyx_Buffer __pyx_pybuffer_values;
  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;
  __Pyx_RefNannySetupContext("group_last_bin_float64", 0);
  __pyx_pybuffer_resx.pybuffer.buf = NULL;
  __pyx_pybuffer_resx.refcount = 0;
  __pyx_pybuffernd_resx.data = NULL;
  __pyx_pybuffernd_resx.rcbuffer = &__pyx_pybuffer_resx;
  __pyx_pybuffer_nobs.pybuffer.buf = NULL;
  __pyx_pybuffer_nobs.refcount = 0;
  __pyx_pybuffernd_nobs.data = NULL;
  __pyx_pybuffernd_nobs.rcbuffer = &__pyx_pybuffer_nobs;
  __pyx_pybuffer_out.pybuffer.buf = NULL;
  __pyx_pybuffer_out.refcount = 0;
  __pyx_pybuffernd_out.data = NULL;
  __pyx_pybuffernd_out.rcbuffer = &__pyx_pybuffer_out;
  __pyx_pybuffer_counts.pybuffer.buf = NULL;
  __pyx_pybuffer_counts.refcount = 0;
  __pyx_pybuffernd_counts.data = NULL;
  __pyx_pybuffernd_counts.rcbuffer = &__pyx_pybuffer_counts;
  __pyx_pybuffer_values.pybuffer.buf = NULL;
  __pyx_pybuffer_values.refcount = 0;
  __pyx_pybuffernd_values.data = NULL;
  __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values;
  __pyx_pybuffer_bins.pybuffer.buf = NULL;
  __pyx_pybuffer_bins.refcount = 0;
  __pyx_pybuffernd_bins.data = NULL;
  __pyx_pybuffernd_bins.rcbuffer = &__pyx_pybuffer_bins;
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_out.rcbuffer->pybuffer, (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[2]; __pyx_lineno = 4816; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_out.diminfo[0].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_out.diminfo[0].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_out.diminfo[1].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_out.diminfo[1].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[1];
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_counts.rcbuffer->pybuffer, (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[2]; __pyx_lineno = 4816; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_counts.diminfo[0].strides = __pyx_pybuffernd_counts.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_counts.diminfo[0].shape = __pyx_pybuffernd_counts.rcbuffer->pybuffer.shape[0];
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (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[2]; __pyx_lineno = 4816; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_values.diminfo[1].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_values.diminfo[1].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[1];
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_bins.rcbuffer->pybuffer, (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[2]; __pyx_lineno = 4816; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_bins.diminfo[0].strides = __pyx_pybuffernd_bins.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_bins.diminfo[0].shape = __pyx_pybuffernd_bins.rcbuffer->pybuffer.shape[0];

  /* "pandas/src/generated.pyx":4828
 *         ndarray[float64_t, ndim=2] resx, nobs
 * 
 *     nobs = np.zeros_like(out)             # <<<<<<<<<<<<<<
 *     resx = np.empty_like(out)
 * 
 */
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4828; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros_like); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4828; __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[2]; __pyx_lineno = 4828; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__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 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4828; __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 (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4828; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_4 = ((PyArrayObject *)__pyx_t_3);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer);
    __pyx_t_5 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer, (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_pybuffernd_nobs.rcbuffer->pybuffer, (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_pybuffernd_nobs.diminfo[0].strides = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_nobs.diminfo[0].shape = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_nobs.diminfo[1].strides = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_nobs.diminfo[1].shape = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.shape[1];
    if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4828; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_4 = 0;
  __pyx_v_nobs = ((PyArrayObject *)__pyx_t_3);
  __pyx_t_3 = 0;

  /* "pandas/src/generated.pyx":4829
 * 
 *     nobs = np.zeros_like(out)
 *     resx = np.empty_like(out)             # <<<<<<<<<<<<<<
 * 
 *     if bins[len(bins) - 1] == len(values):
 */
  __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4829; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_empty_like); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4829; __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[2]; __pyx_lineno = 4829; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__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 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4829; __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;
  if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4829; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_4 = ((PyArrayObject *)__pyx_t_2);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_resx.rcbuffer->pybuffer);
    __pyx_t_5 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_resx.rcbuffer->pybuffer, (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_pybuffernd_resx.rcbuffer->pybuffer, (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_pybuffernd_resx.diminfo[0].strides = __pyx_pybuffernd_resx.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_resx.diminfo[0].shape = __pyx_pybuffernd_resx.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_resx.diminfo[1].strides = __pyx_pybuffernd_resx.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_resx.diminfo[1].shape = __pyx_pybuffernd_resx.rcbuffer->pybuffer.shape[1];
    if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4829; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_4 = 0;
  __pyx_v_resx = ((PyArrayObject *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "pandas/src/generated.pyx":4831
 *     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[2]; __pyx_lineno = 4831; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_10 = (__pyx_t_9 - 1);
  __pyx_t_5 = -1;
  if (__pyx_t_10 < 0) {
    __pyx_t_5 = 0;
  } else if (unlikely(__pyx_t_10 >= __pyx_pybuffernd_bins.diminfo[0].shape)) __pyx_t_5 = 0;
  if (unlikely(__pyx_t_5 != -1)) {
    __Pyx_RaiseBufferIndexError(__pyx_t_5);
    {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4831; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_11 = PyObject_Length(((PyObject *)__pyx_v_values)); if (unlikely(__pyx_t_11 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4831; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_12 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_bins.rcbuffer->pybuffer.buf, __pyx_t_10, __pyx_pybuffernd_bins.diminfo[0].strides)) == __pyx_t_11) != 0);
  if (__pyx_t_12) {

    /* "pandas/src/generated.pyx":4832
 * 
 *     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[2]; __pyx_lineno = 4832; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_v_ngroups = __pyx_t_11;
    goto __pyx_L3;
  }
  /*else*/ {

    /* "pandas/src/generated.pyx":4834
 *         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[2]; __pyx_lineno = 4834; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_v_ngroups = (__pyx_t_11 + 1);
  }
  __pyx_L3:;

  /* "pandas/src/generated.pyx":4836
 *         ngroups = len(bins) + 1
 * 
 *     N, K = (<object> values).shape             # <<<<<<<<<<<<<<
 * 
 *     b = 0
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_values), __pyx_n_s_shape); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4836; __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 CYTHON_COMPILING_IN_CPYTHON
    Py_ssize_t size = Py_SIZE(sequence);
    #else
    Py_ssize_t size = PySequence_Size(sequence);
    #endif
    if (unlikely(size != 2)) {
      if (size > 2) __Pyx_RaiseTooManyValuesError(2);
      else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
      {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4836; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    #if CYTHON_COMPILING_IN_CPYTHON
    if (likely(PyTuple_CheckExact(sequence))) {
      __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0); 
      __pyx_t_1 = PyTuple_GET_ITEM(sequence, 1); 
    } else {
      __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);
    #else
    __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4836; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_1 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4836; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    #endif
    __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[2]; __pyx_lineno = 4836; __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_L4_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_L4_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_1);
    if (__Pyx_IternextUnpackEndCheck(__pyx_t_14(__pyx_t_13), 2) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4836; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_14 = NULL;
    __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
    goto __pyx_L5_unpacking_done;
    __pyx_L4_unpacking_failed:;
    __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
    __pyx_t_14 = NULL;
    if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
    {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4836; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_L5_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[2]; __pyx_lineno = 4836; __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[2]; __pyx_lineno = 4836; __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;

  /* "pandas/src/generated.pyx":4838
 *     N, K = (<object> values).shape
 * 
 *     b = 0             # <<<<<<<<<<<<<<
 *     for i in range(N):
 *         while b < ngroups - 1 and i >= bins[b]:
 */
  __pyx_v_b = 0;

  /* "pandas/src/generated.pyx":4839
 * 
 *     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;

    /* "pandas/src/generated.pyx":4840
 *     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)) != 0);
      if (__pyx_t_12) {
        __pyx_t_15 = __pyx_v_b;
        __pyx_t_5 = -1;
        if (__pyx_t_15 < 0) {
          __pyx_t_5 = 0;
        } else if (unlikely(__pyx_t_15 >= __pyx_pybuffernd_bins.diminfo[0].shape)) __pyx_t_5 = 0;
        if (unlikely(__pyx_t_5 != -1)) {
          __Pyx_RaiseBufferIndexError(__pyx_t_5);
          {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4840; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        __pyx_t_16 = ((__pyx_v_i >= (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_bins.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_bins.diminfo[0].strides))) != 0);
        __pyx_t_17 = __pyx_t_16;
      } else {
        __pyx_t_17 = __pyx_t_12;
      }
      if (!__pyx_t_17) break;

      /* "pandas/src/generated.pyx":4841
 *     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);
    }

    /* "pandas/src/generated.pyx":4843
 *             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_5 = 0;
    } else if (unlikely(__pyx_t_18 >= __pyx_pybuffernd_counts.diminfo[0].shape)) __pyx_t_5 = 0;
    if (unlikely(__pyx_t_5 != -1)) {
      __Pyx_RaiseBufferIndexError(__pyx_t_5);
      {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4843; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_counts.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_counts.diminfo[0].strides) += 1;

    /* "pandas/src/generated.pyx":4844
 * 
 *         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;

      /* "pandas/src/generated.pyx":4845
 *         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_5 = 0;
      } else if (unlikely(__pyx_t_21 >= __pyx_pybuffernd_values.diminfo[0].shape)) __pyx_t_5 = 0;
      if (__pyx_t_22 < 0) {
        __pyx_t_5 = 1;
      } else if (unlikely(__pyx_t_22 >= __pyx_pybuffernd_values.diminfo[1].shape)) __pyx_t_5 = 1;
      if (unlikely(__pyx_t_5 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_5);
        {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4845; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_v_val = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_values.diminfo[0].strides, __pyx_t_22, __pyx_pybuffernd_values.diminfo[1].strides));

      /* "pandas/src/generated.pyx":4848
 * 
 *             # not nan
 *             if val == val:             # <<<<<<<<<<<<<<
 *                 nobs[b, j] += 1
 *                 resx[b, j] = val
 */
      __pyx_t_17 = ((__pyx_v_val == __pyx_v_val) != 0);
      if (__pyx_t_17) {

        /* "pandas/src/generated.pyx":4849
 *             # 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_t_5 = -1;
        if (__pyx_t_23 < 0) {
          __pyx_t_5 = 0;
        } else if (unlikely(__pyx_t_23 >= __pyx_pybuffernd_nobs.diminfo[0].shape)) __pyx_t_5 = 0;
        if (__pyx_t_24 < 0) {
          __pyx_t_5 = 1;
        } else if (unlikely(__pyx_t_24 >= __pyx_pybuffernd_nobs.diminfo[1].shape)) __pyx_t_5 = 1;
        if (unlikely(__pyx_t_5 != -1)) {
          __Pyx_RaiseBufferIndexError(__pyx_t_5);
          {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4849; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_nobs.rcbuffer->pybuffer.buf, __pyx_t_23, __pyx_pybuffernd_nobs.diminfo[0].strides, __pyx_t_24, __pyx_pybuffernd_nobs.diminfo[1].strides) += 1.0;

        /* "pandas/src/generated.pyx":4850
 *             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_t_5 = -1;
        if (__pyx_t_25 < 0) {
          __pyx_t_5 = 0;
        } else if (unlikely(__pyx_t_25 >= __pyx_pybuffernd_resx.diminfo[0].shape)) __pyx_t_5 = 0;
        if (__pyx_t_26 < 0) {
          __pyx_t_5 = 1;
        } else if (unlikely(__pyx_t_26 >= __pyx_pybuffernd_resx.diminfo[1].shape)) __pyx_t_5 = 1;
        if (unlikely(__pyx_t_5 != -1)) {
          __Pyx_RaiseBufferIndexError(__pyx_t_5);
          {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4850; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_resx.rcbuffer->pybuffer.buf, __pyx_t_25, __pyx_pybuffernd_resx.diminfo[0].strides, __pyx_t_26, __pyx_pybuffernd_resx.diminfo[1].strides) = __pyx_v_val;
        goto __pyx_L12;
      }
      __pyx_L12:;
    }
  }

  /* "pandas/src/generated.pyx":4852
 *                 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;

    /* "pandas/src/generated.pyx":4853
 * 
 *     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;

      /* "pandas/src/generated.pyx":4854
 *     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_5 = -1;
      if (__pyx_t_27 < 0) {
        __pyx_t_5 = 0;
      } else if (unlikely(__pyx_t_27 >= __pyx_pybuffernd_nobs.diminfo[0].shape)) __pyx_t_5 = 0;
      if (__pyx_t_28 < 0) {
        __pyx_t_5 = 1;
      } else if (unlikely(__pyx_t_28 >= __pyx_pybuffernd_nobs.diminfo[1].shape)) __pyx_t_5 = 1;
      if (unlikely(__pyx_t_5 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_5);
        {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4854; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_t_17 = (((*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_nobs.rcbuffer->pybuffer.buf, __pyx_t_27, __pyx_pybuffernd_nobs.diminfo[0].strides, __pyx_t_28, __pyx_pybuffernd_nobs.diminfo[1].strides)) == 0.0) != 0);
      if (__pyx_t_17) {

        /* "pandas/src/generated.pyx":4855
 *         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_t_5 = -1;
        if (__pyx_t_29 < 0) {
          __pyx_t_5 = 0;
        } else if (unlikely(__pyx_t_29 >= __pyx_pybuffernd_out.diminfo[0].shape)) __pyx_t_5 = 0;
        if (__pyx_t_30 < 0) {
          __pyx_t_5 = 1;
        } else if (unlikely(__pyx_t_30 >= __pyx_pybuffernd_out.diminfo[1].shape)) __pyx_t_5 = 1;
        if (unlikely(__pyx_t_5 != -1)) {
          __Pyx_RaiseBufferIndexError(__pyx_t_5);
          {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4855; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_29, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_30, __pyx_pybuffernd_out.diminfo[1].strides) = __pyx_v_6pandas_5algos_nan;
        goto __pyx_L17;
      }
      /*else*/ {

        /* "pandas/src/generated.pyx":4857
 *                 out[i, j] = nan
 *             else:
 *                 out[i, j] = resx[i, j]             # <<<<<<<<<<<<<<
 * @cython.wraparound(False)
 * @cython.wraparound(False)
 */
        __pyx_t_31 = __pyx_v_i;
        __pyx_t_32 = __pyx_v_j;
        __pyx_t_5 = -1;
        if (__pyx_t_31 < 0) {
          __pyx_t_5 = 0;
        } else if (unlikely(__pyx_t_31 >= __pyx_pybuffernd_resx.diminfo[0].shape)) __pyx_t_5 = 0;
        if (__pyx_t_32 < 0) {
          __pyx_t_5 = 1;
        } else if (unlikely(__pyx_t_32 >= __pyx_pybuffernd_resx.diminfo[1].shape)) __pyx_t_5 = 1;
        if (unlikely(__pyx_t_5 != -1)) {
          __Pyx_RaiseBufferIndexError(__pyx_t_5);
          {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4857; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        __pyx_t_33 = __pyx_v_i;
        __pyx_t_34 = __pyx_v_j;
        __pyx_t_5 = -1;
        if (__pyx_t_33 < 0) {
          __pyx_t_5 = 0;
        } else if (unlikely(__pyx_t_33 >= __pyx_pybuffernd_out.diminfo[0].shape)) __pyx_t_5 = 0;
        if (__pyx_t_34 < 0) {
          __pyx_t_5 = 1;
        } else if (unlikely(__pyx_t_34 >= __pyx_pybuffernd_out.diminfo[1].shape)) __pyx_t_5 = 1;
        if (unlikely(__pyx_t_5 != -1)) {
          __Pyx_RaiseBufferIndexError(__pyx_t_5);
          {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4857; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_33, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_34, __pyx_pybuffernd_out.diminfo[1].strides) = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_resx.rcbuffer->pybuffer.buf, __pyx_t_31, __pyx_pybuffernd_resx.diminfo[0].strides, __pyx_t_32, __pyx_pybuffernd_resx.diminfo[1].strides));
      }
      __pyx_L17:;
    }
  }

  /* "pandas/src/generated.pyx":4816
 * @cython.wraparound(False)
 * @cython.wraparound(False)
 * def group_last_bin_float64(ndarray[float64_t, ndim=2] out,             # <<<<<<<<<<<<<<
 *                    ndarray[int64_t] counts,
 *                    ndarray[float64_t, ndim=2] values,
 */

  /* function exit code */
  __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_pybuffernd_bins.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_counts.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_resx.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas.algos.group_last_bin_float64", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_bins.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_counts.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_resx.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer);
  __pyx_L2:;
  __Pyx_XDECREF((PyObject *)__pyx_v_resx);
  __Pyx_XDECREF((PyObject *)__pyx_v_nobs);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/src/generated.pyx":4860
 * @cython.wraparound(False)
 * @cython.wraparound(False)
 * def group_last_bin_float32(ndarray[float32_t, ndim=2] out,             # <<<<<<<<<<<<<<
 *                    ndarray[int64_t] counts,
 *                    ndarray[float32_t, ndim=2] values,
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pandas_5algos_393group_last_bin_float32(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6pandas_5algos_392group_last_bin_float32[] = "\n    Only aggregates on axis=0\n    ";
static PyMethodDef __pyx_mdef_6pandas_5algos_393group_last_bin_float32 = {__Pyx_NAMESTR("group_last_bin_float32"), (PyCFunction)__pyx_pw_6pandas_5algos_393group_last_bin_float32, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6pandas_5algos_392group_last_bin_float32)};
static PyObject *__pyx_pw_6pandas_5algos_393group_last_bin_float32(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;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("group_last_bin_float32 (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_out,&__pyx_n_s_counts,&__pyx_n_s_values,&__pyx_n_s_bins,0};
    PyObject* values[4] = {0,0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_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 (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_out)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_counts)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("group_last_bin_float32", 1, 4, 4, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4860; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("group_last_bin_float32", 1, 4, 4, 2); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4860; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  3:
        if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_bins)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("group_last_bin_float32", 1, 4, 4, 3); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4860; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "group_last_bin_float32") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4860; __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_float32", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4860; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas.algos.group_last_bin_float32", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_out), __pyx_ptype_5numpy_ndarray, 1, "out", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4860; __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[2]; __pyx_lineno = 4861; __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[2]; __pyx_lineno = 4862; __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[2]; __pyx_lineno = 4863; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_392group_last_bin_float32(__pyx_self, __pyx_v_out, __pyx_v_counts, __pyx_v_values, __pyx_v_bins);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pandas_5algos_392group_last_bin_float32(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_out, PyArrayObject *__pyx_v_counts, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_bins) {
  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_float32_t __pyx_v_val;
  PyArrayObject *__pyx_v_resx = 0;
  PyArrayObject *__pyx_v_nobs = 0;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_bins;
  __Pyx_Buffer __pyx_pybuffer_bins;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_counts;
  __Pyx_Buffer __pyx_pybuffer_counts;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_nobs;
  __Pyx_Buffer __pyx_pybuffer_nobs;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_out;
  __Pyx_Buffer __pyx_pybuffer_out;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_resx;
  __Pyx_Buffer __pyx_pybuffer_resx;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_values;
  __Pyx_Buffer __pyx_pybuffer_values;
  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;
  __Pyx_RefNannySetupContext("group_last_bin_float32", 0);
  __pyx_pybuffer_resx.pybuffer.buf = NULL;
  __pyx_pybuffer_resx.refcount = 0;
  __pyx_pybuffernd_resx.data = NULL;
  __pyx_pybuffernd_resx.rcbuffer = &__pyx_pybuffer_resx;
  __pyx_pybuffer_nobs.pybuffer.buf = NULL;
  __pyx_pybuffer_nobs.refcount = 0;
  __pyx_pybuffernd_nobs.data = NULL;
  __pyx_pybuffernd_nobs.rcbuffer = &__pyx_pybuffer_nobs;
  __pyx_pybuffer_out.pybuffer.buf = NULL;
  __pyx_pybuffer_out.refcount = 0;
  __pyx_pybuffernd_out.data = NULL;
  __pyx_pybuffernd_out.rcbuffer = &__pyx_pybuffer_out;
  __pyx_pybuffer_counts.pybuffer.buf = NULL;
  __pyx_pybuffer_counts.refcount = 0;
  __pyx_pybuffernd_counts.data = NULL;
  __pyx_pybuffernd_counts.rcbuffer = &__pyx_pybuffer_counts;
  __pyx_pybuffer_values.pybuffer.buf = NULL;
  __pyx_pybuffer_values.refcount = 0;
  __pyx_pybuffernd_values.data = NULL;
  __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values;
  __pyx_pybuffer_bins.pybuffer.buf = NULL;
  __pyx_pybuffer_bins.refcount = 0;
  __pyx_pybuffernd_bins.data = NULL;
  __pyx_pybuffernd_bins.rcbuffer = &__pyx_pybuffer_bins;
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_out.rcbuffer->pybuffer, (PyObject*)__pyx_v_out, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4860; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_out.diminfo[0].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_out.diminfo[0].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_out.diminfo[1].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_out.diminfo[1].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[1];
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_counts.rcbuffer->pybuffer, (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[2]; __pyx_lineno = 4860; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_counts.diminfo[0].strides = __pyx_pybuffernd_counts.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_counts.diminfo[0].shape = __pyx_pybuffernd_counts.rcbuffer->pybuffer.shape[0];
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4860; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_values.diminfo[1].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_values.diminfo[1].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[1];
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_bins.rcbuffer->pybuffer, (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[2]; __pyx_lineno = 4860; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_bins.diminfo[0].strides = __pyx_pybuffernd_bins.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_bins.diminfo[0].shape = __pyx_pybuffernd_bins.rcbuffer->pybuffer.shape[0];

  /* "pandas/src/generated.pyx":4872
 *         ndarray[float32_t, ndim=2] resx, nobs
 * 
 *     nobs = np.zeros_like(out)             # <<<<<<<<<<<<<<
 *     resx = np.empty_like(out)
 * 
 */
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4872; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros_like); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4872; __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[2]; __pyx_lineno = 4872; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__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 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4872; __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 (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4872; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_4 = ((PyArrayObject *)__pyx_t_3);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer);
    __pyx_t_5 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer, (PyObject*)__pyx_t_4, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_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_pybuffernd_nobs.rcbuffer->pybuffer, (PyObject*)__pyx_v_nobs, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_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_pybuffernd_nobs.diminfo[0].strides = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_nobs.diminfo[0].shape = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_nobs.diminfo[1].strides = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_nobs.diminfo[1].shape = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.shape[1];
    if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4872; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_4 = 0;
  __pyx_v_nobs = ((PyArrayObject *)__pyx_t_3);
  __pyx_t_3 = 0;

  /* "pandas/src/generated.pyx":4873
 * 
 *     nobs = np.zeros_like(out)
 *     resx = np.empty_like(out)             # <<<<<<<<<<<<<<
 * 
 *     if bins[len(bins) - 1] == len(values):
 */
  __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4873; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_empty_like); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4873; __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[2]; __pyx_lineno = 4873; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__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 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4873; __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;
  if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4873; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_4 = ((PyArrayObject *)__pyx_t_2);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_resx.rcbuffer->pybuffer);
    __pyx_t_5 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_resx.rcbuffer->pybuffer, (PyObject*)__pyx_t_4, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_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_pybuffernd_resx.rcbuffer->pybuffer, (PyObject*)__pyx_v_resx, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_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_pybuffernd_resx.diminfo[0].strides = __pyx_pybuffernd_resx.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_resx.diminfo[0].shape = __pyx_pybuffernd_resx.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_resx.diminfo[1].strides = __pyx_pybuffernd_resx.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_resx.diminfo[1].shape = __pyx_pybuffernd_resx.rcbuffer->pybuffer.shape[1];
    if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4873; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_4 = 0;
  __pyx_v_resx = ((PyArrayObject *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "pandas/src/generated.pyx":4875
 *     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[2]; __pyx_lineno = 4875; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_10 = (__pyx_t_9 - 1);
  __pyx_t_5 = -1;
  if (__pyx_t_10 < 0) {
    __pyx_t_5 = 0;
  } else if (unlikely(__pyx_t_10 >= __pyx_pybuffernd_bins.diminfo[0].shape)) __pyx_t_5 = 0;
  if (unlikely(__pyx_t_5 != -1)) {
    __Pyx_RaiseBufferIndexError(__pyx_t_5);
    {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4875; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_11 = PyObject_Length(((PyObject *)__pyx_v_values)); if (unlikely(__pyx_t_11 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4875; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_12 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_bins.rcbuffer->pybuffer.buf, __pyx_t_10, __pyx_pybuffernd_bins.diminfo[0].strides)) == __pyx_t_11) != 0);
  if (__pyx_t_12) {

    /* "pandas/src/generated.pyx":4876
 * 
 *     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[2]; __pyx_lineno = 4876; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_v_ngroups = __pyx_t_11;
    goto __pyx_L3;
  }
  /*else*/ {

    /* "pandas/src/generated.pyx":4878
 *         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[2]; __pyx_lineno = 4878; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_v_ngroups = (__pyx_t_11 + 1);
  }
  __pyx_L3:;

  /* "pandas/src/generated.pyx":4880
 *         ngroups = len(bins) + 1
 * 
 *     N, K = (<object> values).shape             # <<<<<<<<<<<<<<
 * 
 *     b = 0
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_values), __pyx_n_s_shape); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4880; __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 CYTHON_COMPILING_IN_CPYTHON
    Py_ssize_t size = Py_SIZE(sequence);
    #else
    Py_ssize_t size = PySequence_Size(sequence);
    #endif
    if (unlikely(size != 2)) {
      if (size > 2) __Pyx_RaiseTooManyValuesError(2);
      else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
      {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4880; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    #if CYTHON_COMPILING_IN_CPYTHON
    if (likely(PyTuple_CheckExact(sequence))) {
      __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0); 
      __pyx_t_1 = PyTuple_GET_ITEM(sequence, 1); 
    } else {
      __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);
    #else
    __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4880; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_1 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4880; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    #endif
    __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[2]; __pyx_lineno = 4880; __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_L4_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_L4_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_1);
    if (__Pyx_IternextUnpackEndCheck(__pyx_t_14(__pyx_t_13), 2) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4880; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_14 = NULL;
    __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
    goto __pyx_L5_unpacking_done;
    __pyx_L4_unpacking_failed:;
    __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
    __pyx_t_14 = NULL;
    if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
    {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4880; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_L5_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[2]; __pyx_lineno = 4880; __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[2]; __pyx_lineno = 4880; __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;

  /* "pandas/src/generated.pyx":4882
 *     N, K = (<object> values).shape
 * 
 *     b = 0             # <<<<<<<<<<<<<<
 *     for i in range(N):
 *         while b < ngroups - 1 and i >= bins[b]:
 */
  __pyx_v_b = 0;

  /* "pandas/src/generated.pyx":4883
 * 
 *     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;

    /* "pandas/src/generated.pyx":4884
 *     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)) != 0);
      if (__pyx_t_12) {
        __pyx_t_15 = __pyx_v_b;
        __pyx_t_5 = -1;
        if (__pyx_t_15 < 0) {
          __pyx_t_5 = 0;
        } else if (unlikely(__pyx_t_15 >= __pyx_pybuffernd_bins.diminfo[0].shape)) __pyx_t_5 = 0;
        if (unlikely(__pyx_t_5 != -1)) {
          __Pyx_RaiseBufferIndexError(__pyx_t_5);
          {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4884; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        __pyx_t_16 = ((__pyx_v_i >= (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_bins.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_bins.diminfo[0].strides))) != 0);
        __pyx_t_17 = __pyx_t_16;
      } else {
        __pyx_t_17 = __pyx_t_12;
      }
      if (!__pyx_t_17) break;

      /* "pandas/src/generated.pyx":4885
 *     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);
    }

    /* "pandas/src/generated.pyx":4887
 *             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_5 = 0;
    } else if (unlikely(__pyx_t_18 >= __pyx_pybuffernd_counts.diminfo[0].shape)) __pyx_t_5 = 0;
    if (unlikely(__pyx_t_5 != -1)) {
      __Pyx_RaiseBufferIndexError(__pyx_t_5);
      {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4887; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_counts.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_counts.diminfo[0].strides) += 1;

    /* "pandas/src/generated.pyx":4888
 * 
 *         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;

      /* "pandas/src/generated.pyx":4889
 *         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_5 = 0;
      } else if (unlikely(__pyx_t_21 >= __pyx_pybuffernd_values.diminfo[0].shape)) __pyx_t_5 = 0;
      if (__pyx_t_22 < 0) {
        __pyx_t_5 = 1;
      } else if (unlikely(__pyx_t_22 >= __pyx_pybuffernd_values.diminfo[1].shape)) __pyx_t_5 = 1;
      if (unlikely(__pyx_t_5 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_5);
        {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4889; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_v_val = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_values.diminfo[0].strides, __pyx_t_22, __pyx_pybuffernd_values.diminfo[1].strides));

      /* "pandas/src/generated.pyx":4892
 * 
 *             # not nan
 *             if val == val:             # <<<<<<<<<<<<<<
 *                 nobs[b, j] += 1
 *                 resx[b, j] = val
 */
      __pyx_t_17 = ((__pyx_v_val == __pyx_v_val) != 0);
      if (__pyx_t_17) {

        /* "pandas/src/generated.pyx":4893
 *             # 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_t_5 = -1;
        if (__pyx_t_23 < 0) {
          __pyx_t_5 = 0;
        } else if (unlikely(__pyx_t_23 >= __pyx_pybuffernd_nobs.diminfo[0].shape)) __pyx_t_5 = 0;
        if (__pyx_t_24 < 0) {
          __pyx_t_5 = 1;
        } else if (unlikely(__pyx_t_24 >= __pyx_pybuffernd_nobs.diminfo[1].shape)) __pyx_t_5 = 1;
        if (unlikely(__pyx_t_5 != -1)) {
          __Pyx_RaiseBufferIndexError(__pyx_t_5);
          {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4893; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_nobs.rcbuffer->pybuffer.buf, __pyx_t_23, __pyx_pybuffernd_nobs.diminfo[0].strides, __pyx_t_24, __pyx_pybuffernd_nobs.diminfo[1].strides) += 1.0;

        /* "pandas/src/generated.pyx":4894
 *             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_t_5 = -1;
        if (__pyx_t_25 < 0) {
          __pyx_t_5 = 0;
        } else if (unlikely(__pyx_t_25 >= __pyx_pybuffernd_resx.diminfo[0].shape)) __pyx_t_5 = 0;
        if (__pyx_t_26 < 0) {
          __pyx_t_5 = 1;
        } else if (unlikely(__pyx_t_26 >= __pyx_pybuffernd_resx.diminfo[1].shape)) __pyx_t_5 = 1;
        if (unlikely(__pyx_t_5 != -1)) {
          __Pyx_RaiseBufferIndexError(__pyx_t_5);
          {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4894; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_resx.rcbuffer->pybuffer.buf, __pyx_t_25, __pyx_pybuffernd_resx.diminfo[0].strides, __pyx_t_26, __pyx_pybuffernd_resx.diminfo[1].strides) = __pyx_v_val;
        goto __pyx_L12;
      }
      __pyx_L12:;
    }
  }

  /* "pandas/src/generated.pyx":4896
 *                 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;

    /* "pandas/src/generated.pyx":4897
 * 
 *     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;

      /* "pandas/src/generated.pyx":4898
 *     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_5 = -1;
      if (__pyx_t_27 < 0) {
        __pyx_t_5 = 0;
      } else if (unlikely(__pyx_t_27 >= __pyx_pybuffernd_nobs.diminfo[0].shape)) __pyx_t_5 = 0;
      if (__pyx_t_28 < 0) {
        __pyx_t_5 = 1;
      } else if (unlikely(__pyx_t_28 >= __pyx_pybuffernd_nobs.diminfo[1].shape)) __pyx_t_5 = 1;
      if (unlikely(__pyx_t_5 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_5);
        {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4898; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_t_17 = (((*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_nobs.rcbuffer->pybuffer.buf, __pyx_t_27, __pyx_pybuffernd_nobs.diminfo[0].strides, __pyx_t_28, __pyx_pybuffernd_nobs.diminfo[1].strides)) == 0.0) != 0);
      if (__pyx_t_17) {

        /* "pandas/src/generated.pyx":4899
 *         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_t_5 = -1;
        if (__pyx_t_29 < 0) {
          __pyx_t_5 = 0;
        } else if (unlikely(__pyx_t_29 >= __pyx_pybuffernd_out.diminfo[0].shape)) __pyx_t_5 = 0;
        if (__pyx_t_30 < 0) {
          __pyx_t_5 = 1;
        } else if (unlikely(__pyx_t_30 >= __pyx_pybuffernd_out.diminfo[1].shape)) __pyx_t_5 = 1;
        if (unlikely(__pyx_t_5 != -1)) {
          __Pyx_RaiseBufferIndexError(__pyx_t_5);
          {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4899; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_29, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_30, __pyx_pybuffernd_out.diminfo[1].strides) = __pyx_v_6pandas_5algos_nan;
        goto __pyx_L17;
      }
      /*else*/ {

        /* "pandas/src/generated.pyx":4901
 *                 out[i, j] = nan
 *             else:
 *                 out[i, j] = resx[i, j]             # <<<<<<<<<<<<<<
 * 
 * @cython.boundscheck(False)
 */
        __pyx_t_31 = __pyx_v_i;
        __pyx_t_32 = __pyx_v_j;
        __pyx_t_5 = -1;
        if (__pyx_t_31 < 0) {
          __pyx_t_5 = 0;
        } else if (unlikely(__pyx_t_31 >= __pyx_pybuffernd_resx.diminfo[0].shape)) __pyx_t_5 = 0;
        if (__pyx_t_32 < 0) {
          __pyx_t_5 = 1;
        } else if (unlikely(__pyx_t_32 >= __pyx_pybuffernd_resx.diminfo[1].shape)) __pyx_t_5 = 1;
        if (unlikely(__pyx_t_5 != -1)) {
          __Pyx_RaiseBufferIndexError(__pyx_t_5);
          {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4901; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        __pyx_t_33 = __pyx_v_i;
        __pyx_t_34 = __pyx_v_j;
        __pyx_t_5 = -1;
        if (__pyx_t_33 < 0) {
          __pyx_t_5 = 0;
        } else if (unlikely(__pyx_t_33 >= __pyx_pybuffernd_out.diminfo[0].shape)) __pyx_t_5 = 0;
        if (__pyx_t_34 < 0) {
          __pyx_t_5 = 1;
        } else if (unlikely(__pyx_t_34 >= __pyx_pybuffernd_out.diminfo[1].shape)) __pyx_t_5 = 1;
        if (unlikely(__pyx_t_5 != -1)) {
          __Pyx_RaiseBufferIndexError(__pyx_t_5);
          {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4901; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_33, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_34, __pyx_pybuffernd_out.diminfo[1].strides) = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_resx.rcbuffer->pybuffer.buf, __pyx_t_31, __pyx_pybuffernd_resx.diminfo[0].strides, __pyx_t_32, __pyx_pybuffernd_resx.diminfo[1].strides));
      }
      __pyx_L17:;
    }
  }

  /* "pandas/src/generated.pyx":4860
 * @cython.wraparound(False)
 * @cython.wraparound(False)
 * def group_last_bin_float32(ndarray[float32_t, ndim=2] out,             # <<<<<<<<<<<<<<
 *                    ndarray[int64_t] counts,
 *                    ndarray[float32_t, ndim=2] values,
 */

  /* function exit code */
  __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_pybuffernd_bins.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_counts.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_resx.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas.algos.group_last_bin_float32", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_bins.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_counts.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_resx.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer);
  __pyx_L2:;
  __Pyx_XDECREF((PyObject *)__pyx_v_resx);
  __Pyx_XDECREF((PyObject *)__pyx_v_nobs);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/src/generated.pyx":4905
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def group_nth_float64(ndarray[float64_t, ndim=2] out,             # <<<<<<<<<<<<<<
 *               ndarray[int64_t] counts,
 *               ndarray[float64_t, ndim=2] values,
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pandas_5algos_395group_nth_float64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6pandas_5algos_394group_nth_float64[] = "\n    Only aggregates on axis=0\n    ";
static PyMethodDef __pyx_mdef_6pandas_5algos_395group_nth_float64 = {__Pyx_NAMESTR("group_nth_float64"), (PyCFunction)__pyx_pw_6pandas_5algos_395group_nth_float64, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6pandas_5algos_394group_nth_float64)};
static PyObject *__pyx_pw_6pandas_5algos_395group_nth_float64(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;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("group_nth_float64 (wrapper)", 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};
    PyObject* values[5] = {0,0,0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_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 (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_out)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_counts)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("group_nth_float64", 1, 5, 5, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4905; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("group_nth_float64", 1, 5, 5, 2); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4905; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  3:
        if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_labels)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("group_nth_float64", 1, 5, 5, 3); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4905; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  4:
        if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_rank)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("group_nth_float64", 1, 5, 5, 4); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4905; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "group_nth_float64") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4905; __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_As_npy_int64(values[4]); if (unlikely((__pyx_v_rank == (npy_int64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4908; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("group_nth_float64", 1, 5, 5, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4905; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas.algos.group_nth_float64", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_out), __pyx_ptype_5numpy_ndarray, 1, "out", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4905; __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[2]; __pyx_lineno = 4906; __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[2]; __pyx_lineno = 4907; __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[2]; __pyx_lineno = 4908; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_394group_nth_float64(__pyx_self, __pyx_v_out, __pyx_v_counts, __pyx_v_values, __pyx_v_labels, __pyx_v_rank);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pandas_5algos_394group_nth_float64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_out, PyArrayObject *__pyx_v_counts, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_labels, __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;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_counts;
  __Pyx_Buffer __pyx_pybuffer_counts;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_labels;
  __Pyx_Buffer __pyx_pybuffer_labels;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_nobs;
  __Pyx_Buffer __pyx_pybuffer_nobs;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_out;
  __Pyx_Buffer __pyx_pybuffer_out;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_resx;
  __Pyx_Buffer __pyx_pybuffer_resx;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_values;
  __Pyx_Buffer __pyx_pybuffer_values;
  PyObject *__pyx_r = NULL;
  __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;
  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;
  PyArrayObject *__pyx_t_14 = NULL;
  PyObject *(*__pyx_t_15)(PyObject *);
  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;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("group_nth_float64", 0);
  __pyx_pybuffer_resx.pybuffer.buf = NULL;
  __pyx_pybuffer_resx.refcount = 0;
  __pyx_pybuffernd_resx.data = NULL;
  __pyx_pybuffernd_resx.rcbuffer = &__pyx_pybuffer_resx;
  __pyx_pybuffer_nobs.pybuffer.buf = NULL;
  __pyx_pybuffer_nobs.refcount = 0;
  __pyx_pybuffernd_nobs.data = NULL;
  __pyx_pybuffernd_nobs.rcbuffer = &__pyx_pybuffer_nobs;
  __pyx_pybuffer_out.pybuffer.buf = NULL;
  __pyx_pybuffer_out.refcount = 0;
  __pyx_pybuffernd_out.data = NULL;
  __pyx_pybuffernd_out.rcbuffer = &__pyx_pybuffer_out;
  __pyx_pybuffer_counts.pybuffer.buf = NULL;
  __pyx_pybuffer_counts.refcount = 0;
  __pyx_pybuffernd_counts.data = NULL;
  __pyx_pybuffernd_counts.rcbuffer = &__pyx_pybuffer_counts;
  __pyx_pybuffer_values.pybuffer.buf = NULL;
  __pyx_pybuffer_values.refcount = 0;
  __pyx_pybuffernd_values.data = NULL;
  __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values;
  __pyx_pybuffer_labels.pybuffer.buf = NULL;
  __pyx_pybuffer_labels.refcount = 0;
  __pyx_pybuffernd_labels.data = NULL;
  __pyx_pybuffernd_labels.rcbuffer = &__pyx_pybuffer_labels;
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_out.rcbuffer->pybuffer, (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[2]; __pyx_lineno = 4905; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_out.diminfo[0].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_out.diminfo[0].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_out.diminfo[1].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_out.diminfo[1].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[1];
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_counts.rcbuffer->pybuffer, (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[2]; __pyx_lineno = 4905; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_counts.diminfo[0].strides = __pyx_pybuffernd_counts.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_counts.diminfo[0].shape = __pyx_pybuffernd_counts.rcbuffer->pybuffer.shape[0];
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (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[2]; __pyx_lineno = 4905; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_values.diminfo[1].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_values.diminfo[1].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[1];
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_labels.rcbuffer->pybuffer, (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[2]; __pyx_lineno = 4905; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_labels.diminfo[0].strides = __pyx_pybuffernd_labels.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_labels.diminfo[0].shape = __pyx_pybuffernd_labels.rcbuffer->pybuffer.shape[0];

  /* "pandas/src/generated.pyx":4918
 *         ndarray[int64_t, ndim=2] nobs
 * 
 *     if not len(values) == len(labels):             # <<<<<<<<<<<<<<
 *        raise AssertionError("len(index) != len(labels)")
 * 
 */
  __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_values)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4918; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_2 = PyObject_Length(((PyObject *)__pyx_v_labels)); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4918; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_3 = ((!((__pyx_t_1 == __pyx_t_2) != 0)) != 0);
  if (__pyx_t_3) {

    /* "pandas/src/generated.pyx":4919
 * 
 *     if not len(values) == len(labels):
 *        raise AssertionError("len(index) != len(labels)")             # <<<<<<<<<<<<<<
 * 
 *     nobs = np.zeros((<object> out).shape, dtype=np.int64)
 */
    __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_AssertionError, __pyx_tuple__194, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4919; __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[2]; __pyx_lineno = 4919; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }

  /* "pandas/src/generated.pyx":4921
 *        raise AssertionError("len(index) != len(labels)")
 * 
 *     nobs = np.zeros((<object> out).shape, dtype=np.int64)             # <<<<<<<<<<<<<<
 *     resx = np.empty_like(out)
 * 
 */
  __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4921; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_zeros); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4921; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_out), __pyx_n_s_shape); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4921; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4921; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__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 = PyDict_New(); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4921; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4921; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_int64); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4921; __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_4, __pyx_n_s_dtype, __pyx_t_8) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4921; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_6, __pyx_t_4); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4921; __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_6); __pyx_t_6 = 0;
  __Pyx_DECREF(__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[2]; __pyx_lineno = 4921; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_9 = ((PyArrayObject *)__pyx_t_8);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer);
    __pyx_t_10 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer, (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_pybuffernd_nobs.rcbuffer->pybuffer, (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_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_pybuffernd_nobs.diminfo[0].strides = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_nobs.diminfo[0].shape = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_nobs.diminfo[1].strides = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_nobs.diminfo[1].shape = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.shape[1];
    if (unlikely(__pyx_t_10 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4921; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_9 = 0;
  __pyx_v_nobs = ((PyArrayObject *)__pyx_t_8);
  __pyx_t_8 = 0;

  /* "pandas/src/generated.pyx":4922
 * 
 *     nobs = np.zeros((<object> out).shape, dtype=np.int64)
 *     resx = np.empty_like(out)             # <<<<<<<<<<<<<<
 * 
 *     N, K = (<object> values).shape
 */
  __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4922; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_8);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_empty_like); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4922; __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[2]; __pyx_lineno = 4922; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_INCREF(((PyObject *)__pyx_v_out));
  PyTuple_SET_ITEM(__pyx_t_8, 0, ((PyObject *)__pyx_v_out));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_out));
  __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_8, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4922; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 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 = 4922; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_14 = ((PyArrayObject *)__pyx_t_6);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_resx.rcbuffer->pybuffer);
    __pyx_t_10 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_resx.rcbuffer->pybuffer, (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_10 < 0)) {
      PyErr_Fetch(&__pyx_t_13, &__pyx_t_12, &__pyx_t_11);
      if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_resx.rcbuffer->pybuffer, (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_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_pybuffernd_resx.diminfo[0].strides = __pyx_pybuffernd_resx.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_resx.diminfo[0].shape = __pyx_pybuffernd_resx.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_resx.diminfo[1].strides = __pyx_pybuffernd_resx.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_resx.diminfo[1].shape = __pyx_pybuffernd_resx.rcbuffer->pybuffer.shape[1];
    if (unlikely(__pyx_t_10 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4922; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_14 = 0;
  __pyx_v_resx = ((PyArrayObject *)__pyx_t_6);
  __pyx_t_6 = 0;

  /* "pandas/src/generated.pyx":4924
 *     resx = np.empty_like(out)
 * 
 *     N, K = (<object> values).shape             # <<<<<<<<<<<<<<
 * 
 *     for i in range(N):
 */
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_values), __pyx_n_s_shape); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4924; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  if ((likely(PyTuple_CheckExact(__pyx_t_6))) || (PyList_CheckExact(__pyx_t_6))) {
    PyObject* sequence = __pyx_t_6;
    #if CYTHON_COMPILING_IN_CPYTHON
    Py_ssize_t size = Py_SIZE(sequence);
    #else
    Py_ssize_t size = PySequence_Size(sequence);
    #endif
    if (unlikely(size != 2)) {
      if (size > 2) __Pyx_RaiseTooManyValuesError(2);
      else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
      {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4924; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    #if CYTHON_COMPILING_IN_CPYTHON
    if (likely(PyTuple_CheckExact(sequence))) {
      __pyx_t_8 = PyTuple_GET_ITEM(sequence, 0); 
      __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1); 
    } else {
      __pyx_t_8 = PyList_GET_ITEM(sequence, 0); 
      __pyx_t_4 = PyList_GET_ITEM(sequence, 1); 
    }
    __Pyx_INCREF(__pyx_t_8);
    __Pyx_INCREF(__pyx_t_4);
    #else
    __pyx_t_8 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4924; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4924; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    #endif
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  } else {
    Py_ssize_t index = -1;
    __pyx_t_5 = PyObject_GetIter(__pyx_t_6); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4924; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_15 = Py_TYPE(__pyx_t_5)->tp_iternext;
    index = 0; __pyx_t_8 = __pyx_t_15(__pyx_t_5); if (unlikely(!__pyx_t_8)) goto __pyx_L4_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_8);
    index = 1; __pyx_t_4 = __pyx_t_15(__pyx_t_5); if (unlikely(!__pyx_t_4)) goto __pyx_L4_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_4);
    if (__Pyx_IternextUnpackEndCheck(__pyx_t_15(__pyx_t_5), 2) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4924; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_15 = NULL;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    goto __pyx_L5_unpacking_done;
    __pyx_L4_unpacking_failed:;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_15 = NULL;
    if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
    {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4924; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_L5_unpacking_done:;
  }
  __pyx_t_2 = __Pyx_PyIndex_AsSsize_t(__pyx_t_8); if (unlikely((__pyx_t_2 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4924; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  __pyx_t_1 = __Pyx_PyIndex_AsSsize_t(__pyx_t_4); if (unlikely((__pyx_t_1 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4924; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_v_N = __pyx_t_2;
  __pyx_v_K = __pyx_t_1;

  /* "pandas/src/generated.pyx":4926
 *     N, K = (<object> values).shape
 * 
 *     for i in range(N):             # <<<<<<<<<<<<<<
 *         lab = labels[i]
 *         if lab < 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;

    /* "pandas/src/generated.pyx":4927
 * 
 *     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_pybuffernd_labels.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_labels.diminfo[0].strides));

    /* "pandas/src/generated.pyx":4928
 *     for i in range(N):
 *         lab = labels[i]
 *         if lab < 0:             # <<<<<<<<<<<<<<
 *             continue
 * 
 */
    __pyx_t_3 = ((__pyx_v_lab < 0) != 0);
    if (__pyx_t_3) {

      /* "pandas/src/generated.pyx":4929
 *         lab = labels[i]
 *         if lab < 0:
 *             continue             # <<<<<<<<<<<<<<
 * 
 *         counts[lab] += 1
 */
      goto __pyx_L6_continue;
    }

    /* "pandas/src/generated.pyx":4931
 *             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_pybuffernd_counts.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_counts.diminfo[0].strides) += 1;

    /* "pandas/src/generated.pyx":4932
 * 
 *         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;

      /* "pandas/src/generated.pyx":4933
 *         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_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_values.diminfo[0].strides, __pyx_t_21, __pyx_pybuffernd_values.diminfo[1].strides));

      /* "pandas/src/generated.pyx":4936
 * 
 *             # not nan
 *             if val == val:             # <<<<<<<<<<<<<<
 *                 nobs[lab, j] += 1
 *                 if nobs[lab, j] == rank:
 */
      __pyx_t_3 = ((__pyx_v_val == __pyx_v_val) != 0);
      if (__pyx_t_3) {

        /* "pandas/src/generated.pyx":4937
 *             # 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_pybuffernd_nobs.rcbuffer->pybuffer.buf, __pyx_t_22, __pyx_pybuffernd_nobs.diminfo[0].strides, __pyx_t_23, __pyx_pybuffernd_nobs.diminfo[1].strides) += 1;

        /* "pandas/src/generated.pyx":4938
 *             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_3 = (((*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_nobs.rcbuffer->pybuffer.buf, __pyx_t_24, __pyx_pybuffernd_nobs.diminfo[0].strides, __pyx_t_25, __pyx_pybuffernd_nobs.diminfo[1].strides)) == __pyx_v_rank) != 0);
        if (__pyx_t_3) {

          /* "pandas/src/generated.pyx":4939
 *                 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_pybuffernd_resx.rcbuffer->pybuffer.buf, __pyx_t_26, __pyx_pybuffernd_resx.diminfo[0].strides, __pyx_t_27, __pyx_pybuffernd_resx.diminfo[1].strides) = __pyx_v_val;
          goto __pyx_L12;
        }
        __pyx_L12:;
        goto __pyx_L11;
      }
      __pyx_L11:;
    }
    __pyx_L6_continue:;
  }

  /* "pandas/src/generated.pyx":4941
 *                     resx[lab, j] = val
 * 
 *     for i in range(len(counts)):             # <<<<<<<<<<<<<<
 *         for j in range(K):
 *             if nobs[i, j] == 0:
 */
  __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_counts)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4941; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) {
    __pyx_v_i = __pyx_t_2;

    /* "pandas/src/generated.pyx":4942
 * 
 *     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;

      /* "pandas/src/generated.pyx":4943
 *     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_3 = (((*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_nobs.rcbuffer->pybuffer.buf, __pyx_t_28, __pyx_pybuffernd_nobs.diminfo[0].strides, __pyx_t_29, __pyx_pybuffernd_nobs.diminfo[1].strides)) == 0) != 0);
      if (__pyx_t_3) {

        /* "pandas/src/generated.pyx":4944
 *         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_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_30, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_31, __pyx_pybuffernd_out.diminfo[1].strides) = __pyx_v_6pandas_5algos_nan;
        goto __pyx_L17;
      }
      /*else*/ {

        /* "pandas/src/generated.pyx":4946
 *                 out[i, j] = nan
 *             else:
 *                 out[i, j] = resx[i, j]             # <<<<<<<<<<<<<<
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 */
        __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_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_34, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_35, __pyx_pybuffernd_out.diminfo[1].strides) = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_resx.rcbuffer->pybuffer.buf, __pyx_t_32, __pyx_pybuffernd_resx.diminfo[0].strides, __pyx_t_33, __pyx_pybuffernd_resx.diminfo[1].strides));
      }
      __pyx_L17:;
    }
  }

  /* "pandas/src/generated.pyx":4905
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def group_nth_float64(ndarray[float64_t, ndim=2] out,             # <<<<<<<<<<<<<<
 *               ndarray[int64_t] counts,
 *               ndarray[float64_t, ndim=2] values,
 */

  /* function exit code */
  __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);
  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
    __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_counts.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_labels.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_resx.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas.algos.group_nth_float64", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_counts.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_labels.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_resx.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer);
  __pyx_L2:;
  __Pyx_XDECREF((PyObject *)__pyx_v_resx);
  __Pyx_XDECREF((PyObject *)__pyx_v_nobs);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/src/generated.pyx":4949
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def group_nth_float32(ndarray[float32_t, ndim=2] out,             # <<<<<<<<<<<<<<
 *               ndarray[int64_t] counts,
 *               ndarray[float32_t, ndim=2] values,
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pandas_5algos_397group_nth_float32(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6pandas_5algos_396group_nth_float32[] = "\n    Only aggregates on axis=0\n    ";
static PyMethodDef __pyx_mdef_6pandas_5algos_397group_nth_float32 = {__Pyx_NAMESTR("group_nth_float32"), (PyCFunction)__pyx_pw_6pandas_5algos_397group_nth_float32, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6pandas_5algos_396group_nth_float32)};
static PyObject *__pyx_pw_6pandas_5algos_397group_nth_float32(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;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("group_nth_float32 (wrapper)", 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};
    PyObject* values[5] = {0,0,0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_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 (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_out)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_counts)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("group_nth_float32", 1, 5, 5, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4949; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("group_nth_float32", 1, 5, 5, 2); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4949; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  3:
        if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_labels)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("group_nth_float32", 1, 5, 5, 3); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4949; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  4:
        if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_rank)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("group_nth_float32", 1, 5, 5, 4); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4949; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "group_nth_float32") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4949; __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_As_npy_int64(values[4]); if (unlikely((__pyx_v_rank == (npy_int64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4952; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("group_nth_float32", 1, 5, 5, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4949; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas.algos.group_nth_float32", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_out), __pyx_ptype_5numpy_ndarray, 1, "out", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4949; __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[2]; __pyx_lineno = 4950; __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[2]; __pyx_lineno = 4951; __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[2]; __pyx_lineno = 4952; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_396group_nth_float32(__pyx_self, __pyx_v_out, __pyx_v_counts, __pyx_v_values, __pyx_v_labels, __pyx_v_rank);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pandas_5algos_396group_nth_float32(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_out, PyArrayObject *__pyx_v_counts, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_labels, __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_float32_t __pyx_v_val;
  PyArrayObject *__pyx_v_resx = 0;
  PyArrayObject *__pyx_v_nobs = 0;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_counts;
  __Pyx_Buffer __pyx_pybuffer_counts;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_labels;
  __Pyx_Buffer __pyx_pybuffer_labels;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_nobs;
  __Pyx_Buffer __pyx_pybuffer_nobs;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_out;
  __Pyx_Buffer __pyx_pybuffer_out;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_resx;
  __Pyx_Buffer __pyx_pybuffer_resx;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_values;
  __Pyx_Buffer __pyx_pybuffer_values;
  PyObject *__pyx_r = NULL;
  __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;
  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;
  PyArrayObject *__pyx_t_14 = NULL;
  PyObject *(*__pyx_t_15)(PyObject *);
  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;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("group_nth_float32", 0);
  __pyx_pybuffer_resx.pybuffer.buf = NULL;
  __pyx_pybuffer_resx.refcount = 0;
  __pyx_pybuffernd_resx.data = NULL;
  __pyx_pybuffernd_resx.rcbuffer = &__pyx_pybuffer_resx;
  __pyx_pybuffer_nobs.pybuffer.buf = NULL;
  __pyx_pybuffer_nobs.refcount = 0;
  __pyx_pybuffernd_nobs.data = NULL;
  __pyx_pybuffernd_nobs.rcbuffer = &__pyx_pybuffer_nobs;
  __pyx_pybuffer_out.pybuffer.buf = NULL;
  __pyx_pybuffer_out.refcount = 0;
  __pyx_pybuffernd_out.data = NULL;
  __pyx_pybuffernd_out.rcbuffer = &__pyx_pybuffer_out;
  __pyx_pybuffer_counts.pybuffer.buf = NULL;
  __pyx_pybuffer_counts.refcount = 0;
  __pyx_pybuffernd_counts.data = NULL;
  __pyx_pybuffernd_counts.rcbuffer = &__pyx_pybuffer_counts;
  __pyx_pybuffer_values.pybuffer.buf = NULL;
  __pyx_pybuffer_values.refcount = 0;
  __pyx_pybuffernd_values.data = NULL;
  __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values;
  __pyx_pybuffer_labels.pybuffer.buf = NULL;
  __pyx_pybuffer_labels.refcount = 0;
  __pyx_pybuffernd_labels.data = NULL;
  __pyx_pybuffernd_labels.rcbuffer = &__pyx_pybuffer_labels;
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_out.rcbuffer->pybuffer, (PyObject*)__pyx_v_out, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4949; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_out.diminfo[0].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_out.diminfo[0].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_out.diminfo[1].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_out.diminfo[1].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[1];
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_counts.rcbuffer->pybuffer, (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[2]; __pyx_lineno = 4949; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_counts.diminfo[0].strides = __pyx_pybuffernd_counts.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_counts.diminfo[0].shape = __pyx_pybuffernd_counts.rcbuffer->pybuffer.shape[0];
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4949; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_values.diminfo[1].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_values.diminfo[1].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[1];
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_labels.rcbuffer->pybuffer, (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[2]; __pyx_lineno = 4949; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_labels.diminfo[0].strides = __pyx_pybuffernd_labels.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_labels.diminfo[0].shape = __pyx_pybuffernd_labels.rcbuffer->pybuffer.shape[0];

  /* "pandas/src/generated.pyx":4962
 *         ndarray[int64_t, ndim=2] nobs
 * 
 *     if not len(values) == len(labels):             # <<<<<<<<<<<<<<
 *        raise AssertionError("len(index) != len(labels)")
 * 
 */
  __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_values)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4962; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_2 = PyObject_Length(((PyObject *)__pyx_v_labels)); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4962; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_3 = ((!((__pyx_t_1 == __pyx_t_2) != 0)) != 0);
  if (__pyx_t_3) {

    /* "pandas/src/generated.pyx":4963
 * 
 *     if not len(values) == len(labels):
 *        raise AssertionError("len(index) != len(labels)")             # <<<<<<<<<<<<<<
 * 
 *     nobs = np.zeros((<object> out).shape, dtype=np.int64)
 */
    __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_AssertionError, __pyx_tuple__195, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4963; __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[2]; __pyx_lineno = 4963; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }

  /* "pandas/src/generated.pyx":4965
 *        raise AssertionError("len(index) != len(labels)")
 * 
 *     nobs = np.zeros((<object> out).shape, dtype=np.int64)             # <<<<<<<<<<<<<<
 *     resx = np.empty_like(out)
 * 
 */
  __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4965; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_zeros); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4965; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_out), __pyx_n_s_shape); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4965; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4965; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__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 = PyDict_New(); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4965; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4965; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_int64); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4965; __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_4, __pyx_n_s_dtype, __pyx_t_8) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4965; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_6, __pyx_t_4); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4965; __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_6); __pyx_t_6 = 0;
  __Pyx_DECREF(__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[2]; __pyx_lineno = 4965; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_9 = ((PyArrayObject *)__pyx_t_8);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer);
    __pyx_t_10 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer, (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_pybuffernd_nobs.rcbuffer->pybuffer, (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_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_pybuffernd_nobs.diminfo[0].strides = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_nobs.diminfo[0].shape = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_nobs.diminfo[1].strides = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_nobs.diminfo[1].shape = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.shape[1];
    if (unlikely(__pyx_t_10 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4965; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_9 = 0;
  __pyx_v_nobs = ((PyArrayObject *)__pyx_t_8);
  __pyx_t_8 = 0;

  /* "pandas/src/generated.pyx":4966
 * 
 *     nobs = np.zeros((<object> out).shape, dtype=np.int64)
 *     resx = np.empty_like(out)             # <<<<<<<<<<<<<<
 * 
 *     N, K = (<object> values).shape
 */
  __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4966; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_8);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_empty_like); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4966; __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[2]; __pyx_lineno = 4966; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_INCREF(((PyObject *)__pyx_v_out));
  PyTuple_SET_ITEM(__pyx_t_8, 0, ((PyObject *)__pyx_v_out));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_out));
  __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_8, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4966; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 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 = 4966; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_14 = ((PyArrayObject *)__pyx_t_6);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_resx.rcbuffer->pybuffer);
    __pyx_t_10 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_resx.rcbuffer->pybuffer, (PyObject*)__pyx_t_14, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 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_pybuffernd_resx.rcbuffer->pybuffer, (PyObject*)__pyx_v_resx, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 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_pybuffernd_resx.diminfo[0].strides = __pyx_pybuffernd_resx.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_resx.diminfo[0].shape = __pyx_pybuffernd_resx.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_resx.diminfo[1].strides = __pyx_pybuffernd_resx.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_resx.diminfo[1].shape = __pyx_pybuffernd_resx.rcbuffer->pybuffer.shape[1];
    if (unlikely(__pyx_t_10 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4966; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_14 = 0;
  __pyx_v_resx = ((PyArrayObject *)__pyx_t_6);
  __pyx_t_6 = 0;

  /* "pandas/src/generated.pyx":4968
 *     resx = np.empty_like(out)
 * 
 *     N, K = (<object> values).shape             # <<<<<<<<<<<<<<
 * 
 *     for i in range(N):
 */
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_values), __pyx_n_s_shape); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4968; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  if ((likely(PyTuple_CheckExact(__pyx_t_6))) || (PyList_CheckExact(__pyx_t_6))) {
    PyObject* sequence = __pyx_t_6;
    #if CYTHON_COMPILING_IN_CPYTHON
    Py_ssize_t size = Py_SIZE(sequence);
    #else
    Py_ssize_t size = PySequence_Size(sequence);
    #endif
    if (unlikely(size != 2)) {
      if (size > 2) __Pyx_RaiseTooManyValuesError(2);
      else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
      {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4968; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    #if CYTHON_COMPILING_IN_CPYTHON
    if (likely(PyTuple_CheckExact(sequence))) {
      __pyx_t_8 = PyTuple_GET_ITEM(sequence, 0); 
      __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1); 
    } else {
      __pyx_t_8 = PyList_GET_ITEM(sequence, 0); 
      __pyx_t_4 = PyList_GET_ITEM(sequence, 1); 
    }
    __Pyx_INCREF(__pyx_t_8);
    __Pyx_INCREF(__pyx_t_4);
    #else
    __pyx_t_8 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4968; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4968; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    #endif
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  } else {
    Py_ssize_t index = -1;
    __pyx_t_5 = PyObject_GetIter(__pyx_t_6); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4968; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_15 = Py_TYPE(__pyx_t_5)->tp_iternext;
    index = 0; __pyx_t_8 = __pyx_t_15(__pyx_t_5); if (unlikely(!__pyx_t_8)) goto __pyx_L4_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_8);
    index = 1; __pyx_t_4 = __pyx_t_15(__pyx_t_5); if (unlikely(!__pyx_t_4)) goto __pyx_L4_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_4);
    if (__Pyx_IternextUnpackEndCheck(__pyx_t_15(__pyx_t_5), 2) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4968; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_15 = NULL;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    goto __pyx_L5_unpacking_done;
    __pyx_L4_unpacking_failed:;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_15 = NULL;
    if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
    {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4968; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_L5_unpacking_done:;
  }
  __pyx_t_2 = __Pyx_PyIndex_AsSsize_t(__pyx_t_8); if (unlikely((__pyx_t_2 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4968; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  __pyx_t_1 = __Pyx_PyIndex_AsSsize_t(__pyx_t_4); if (unlikely((__pyx_t_1 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4968; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_v_N = __pyx_t_2;
  __pyx_v_K = __pyx_t_1;

  /* "pandas/src/generated.pyx":4970
 *     N, K = (<object> values).shape
 * 
 *     for i in range(N):             # <<<<<<<<<<<<<<
 *         lab = labels[i]
 *         if lab < 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;

    /* "pandas/src/generated.pyx":4971
 * 
 *     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_pybuffernd_labels.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_labels.diminfo[0].strides));

    /* "pandas/src/generated.pyx":4972
 *     for i in range(N):
 *         lab = labels[i]
 *         if lab < 0:             # <<<<<<<<<<<<<<
 *             continue
 * 
 */
    __pyx_t_3 = ((__pyx_v_lab < 0) != 0);
    if (__pyx_t_3) {

      /* "pandas/src/generated.pyx":4973
 *         lab = labels[i]
 *         if lab < 0:
 *             continue             # <<<<<<<<<<<<<<
 * 
 *         counts[lab] += 1
 */
      goto __pyx_L6_continue;
    }

    /* "pandas/src/generated.pyx":4975
 *             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_pybuffernd_counts.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_counts.diminfo[0].strides) += 1;

    /* "pandas/src/generated.pyx":4976
 * 
 *         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;

      /* "pandas/src/generated.pyx":4977
 *         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_float32_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_values.diminfo[0].strides, __pyx_t_21, __pyx_pybuffernd_values.diminfo[1].strides));

      /* "pandas/src/generated.pyx":4980
 * 
 *             # not nan
 *             if val == val:             # <<<<<<<<<<<<<<
 *                 nobs[lab, j] += 1
 *                 if nobs[lab, j] == rank:
 */
      __pyx_t_3 = ((__pyx_v_val == __pyx_v_val) != 0);
      if (__pyx_t_3) {

        /* "pandas/src/generated.pyx":4981
 *             # 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_pybuffernd_nobs.rcbuffer->pybuffer.buf, __pyx_t_22, __pyx_pybuffernd_nobs.diminfo[0].strides, __pyx_t_23, __pyx_pybuffernd_nobs.diminfo[1].strides) += 1;

        /* "pandas/src/generated.pyx":4982
 *             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_3 = (((*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_nobs.rcbuffer->pybuffer.buf, __pyx_t_24, __pyx_pybuffernd_nobs.diminfo[0].strides, __pyx_t_25, __pyx_pybuffernd_nobs.diminfo[1].strides)) == __pyx_v_rank) != 0);
        if (__pyx_t_3) {

          /* "pandas/src/generated.pyx":4983
 *                 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_float32_t *, __pyx_pybuffernd_resx.rcbuffer->pybuffer.buf, __pyx_t_26, __pyx_pybuffernd_resx.diminfo[0].strides, __pyx_t_27, __pyx_pybuffernd_resx.diminfo[1].strides) = __pyx_v_val;
          goto __pyx_L12;
        }
        __pyx_L12:;
        goto __pyx_L11;
      }
      __pyx_L11:;
    }
    __pyx_L6_continue:;
  }

  /* "pandas/src/generated.pyx":4985
 *                     resx[lab, j] = val
 * 
 *     for i in range(len(counts)):             # <<<<<<<<<<<<<<
 *         for j in range(K):
 *             if nobs[i, j] == 0:
 */
  __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_counts)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4985; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) {
    __pyx_v_i = __pyx_t_2;

    /* "pandas/src/generated.pyx":4986
 * 
 *     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;

      /* "pandas/src/generated.pyx":4987
 *     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_3 = (((*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_nobs.rcbuffer->pybuffer.buf, __pyx_t_28, __pyx_pybuffernd_nobs.diminfo[0].strides, __pyx_t_29, __pyx_pybuffernd_nobs.diminfo[1].strides)) == 0) != 0);
      if (__pyx_t_3) {

        /* "pandas/src/generated.pyx":4988
 *         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_float32_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_30, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_31, __pyx_pybuffernd_out.diminfo[1].strides) = __pyx_v_6pandas_5algos_nan;
        goto __pyx_L17;
      }
      /*else*/ {

        /* "pandas/src/generated.pyx":4990
 *                 out[i, j] = nan
 *             else:
 *                 out[i, j] = resx[i, j]             # <<<<<<<<<<<<<<
 * 
 * @cython.boundscheck(False)
 */
        __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_float32_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_34, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_35, __pyx_pybuffernd_out.diminfo[1].strides) = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_resx.rcbuffer->pybuffer.buf, __pyx_t_32, __pyx_pybuffernd_resx.diminfo[0].strides, __pyx_t_33, __pyx_pybuffernd_resx.diminfo[1].strides));
      }
      __pyx_L17:;
    }
  }

  /* "pandas/src/generated.pyx":4949
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def group_nth_float32(ndarray[float32_t, ndim=2] out,             # <<<<<<<<<<<<<<
 *               ndarray[int64_t] counts,
 *               ndarray[float32_t, ndim=2] values,
 */

  /* function exit code */
  __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);
  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
    __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_counts.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_labels.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_resx.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas.algos.group_nth_float32", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_counts.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_labels.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_resx.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer);
  __pyx_L2:;
  __Pyx_XDECREF((PyObject *)__pyx_v_resx);
  __Pyx_XDECREF((PyObject *)__pyx_v_nobs);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/src/generated.pyx":4994
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def group_nth_bin_float64(ndarray[float64_t, ndim=2] out,             # <<<<<<<<<<<<<<
 *                   ndarray[int64_t] counts,
 *                   ndarray[float64_t, ndim=2] values,
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pandas_5algos_399group_nth_bin_float64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6pandas_5algos_398group_nth_bin_float64[] = "\n    Only aggregates on axis=0\n    ";
static PyMethodDef __pyx_mdef_6pandas_5algos_399group_nth_bin_float64 = {__Pyx_NAMESTR("group_nth_bin_float64"), (PyCFunction)__pyx_pw_6pandas_5algos_399group_nth_bin_float64, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6pandas_5algos_398group_nth_bin_float64)};
static PyObject *__pyx_pw_6pandas_5algos_399group_nth_bin_float64(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;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("group_nth_bin_float64 (wrapper)", 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};
    PyObject* values[5] = {0,0,0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_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 (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_out)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_counts)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("group_nth_bin_float64", 1, 5, 5, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4994; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("group_nth_bin_float64", 1, 5, 5, 2); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4994; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  3:
        if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_bins)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("group_nth_bin_float64", 1, 5, 5, 3); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4994; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  4:
        if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_rank)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("group_nth_bin_float64", 1, 5, 5, 4); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4994; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "group_nth_bin_float64") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4994; __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_As_npy_int64(values[4]); if (unlikely((__pyx_v_rank == (npy_int64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4997; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("group_nth_bin_float64", 1, 5, 5, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4994; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas.algos.group_nth_bin_float64", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_out), __pyx_ptype_5numpy_ndarray, 1, "out", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4994; __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[2]; __pyx_lineno = 4995; __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[2]; __pyx_lineno = 4996; __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[2]; __pyx_lineno = 4997; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_398group_nth_bin_float64(__pyx_self, __pyx_v_out, __pyx_v_counts, __pyx_v_values, __pyx_v_bins, __pyx_v_rank);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pandas_5algos_398group_nth_bin_float64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_out, PyArrayObject *__pyx_v_counts, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_bins, __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;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_bins;
  __Pyx_Buffer __pyx_pybuffer_bins;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_counts;
  __Pyx_Buffer __pyx_pybuffer_counts;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_nobs;
  __Pyx_Buffer __pyx_pybuffer_nobs;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_out;
  __Pyx_Buffer __pyx_pybuffer_out;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_resx;
  __Pyx_Buffer __pyx_pybuffer_resx;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_values;
  __Pyx_Buffer __pyx_pybuffer_values;
  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;
  __Pyx_RefNannySetupContext("group_nth_bin_float64", 0);
  __pyx_pybuffer_resx.pybuffer.buf = NULL;
  __pyx_pybuffer_resx.refcount = 0;
  __pyx_pybuffernd_resx.data = NULL;
  __pyx_pybuffernd_resx.rcbuffer = &__pyx_pybuffer_resx;
  __pyx_pybuffer_nobs.pybuffer.buf = NULL;
  __pyx_pybuffer_nobs.refcount = 0;
  __pyx_pybuffernd_nobs.data = NULL;
  __pyx_pybuffernd_nobs.rcbuffer = &__pyx_pybuffer_nobs;
  __pyx_pybuffer_out.pybuffer.buf = NULL;
  __pyx_pybuffer_out.refcount = 0;
  __pyx_pybuffernd_out.data = NULL;
  __pyx_pybuffernd_out.rcbuffer = &__pyx_pybuffer_out;
  __pyx_pybuffer_counts.pybuffer.buf = NULL;
  __pyx_pybuffer_counts.refcount = 0;
  __pyx_pybuffernd_counts.data = NULL;
  __pyx_pybuffernd_counts.rcbuffer = &__pyx_pybuffer_counts;
  __pyx_pybuffer_values.pybuffer.buf = NULL;
  __pyx_pybuffer_values.refcount = 0;
  __pyx_pybuffernd_values.data = NULL;
  __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values;
  __pyx_pybuffer_bins.pybuffer.buf = NULL;
  __pyx_pybuffer_bins.refcount = 0;
  __pyx_pybuffernd_bins.data = NULL;
  __pyx_pybuffernd_bins.rcbuffer = &__pyx_pybuffer_bins;
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_out.rcbuffer->pybuffer, (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[2]; __pyx_lineno = 4994; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_out.diminfo[0].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_out.diminfo[0].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_out.diminfo[1].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_out.diminfo[1].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[1];
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_counts.rcbuffer->pybuffer, (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[2]; __pyx_lineno = 4994; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_counts.diminfo[0].strides = __pyx_pybuffernd_counts.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_counts.diminfo[0].shape = __pyx_pybuffernd_counts.rcbuffer->pybuffer.shape[0];
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (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[2]; __pyx_lineno = 4994; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_values.diminfo[1].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_values.diminfo[1].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[1];
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_bins.rcbuffer->pybuffer, (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[2]; __pyx_lineno = 4994; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_bins.diminfo[0].strides = __pyx_pybuffernd_bins.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_bins.diminfo[0].shape = __pyx_pybuffernd_bins.rcbuffer->pybuffer.shape[0];

  /* "pandas/src/generated.pyx":5006
 *         ndarray[float64_t, ndim=2] resx, nobs
 * 
 *     nobs = np.zeros_like(out)             # <<<<<<<<<<<<<<
 *     resx = np.empty_like(out)
 * 
 */
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5006; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros_like); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5006; __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[2]; __pyx_lineno = 5006; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__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 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5006; __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 (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5006; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_4 = ((PyArrayObject *)__pyx_t_3);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer);
    __pyx_t_5 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer, (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_pybuffernd_nobs.rcbuffer->pybuffer, (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_pybuffernd_nobs.diminfo[0].strides = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_nobs.diminfo[0].shape = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_nobs.diminfo[1].strides = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_nobs.diminfo[1].shape = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.shape[1];
    if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5006; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_4 = 0;
  __pyx_v_nobs = ((PyArrayObject *)__pyx_t_3);
  __pyx_t_3 = 0;

  /* "pandas/src/generated.pyx":5007
 * 
 *     nobs = np.zeros_like(out)
 *     resx = np.empty_like(out)             # <<<<<<<<<<<<<<
 * 
 *     if bins[len(bins) - 1] == len(values):
 */
  __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5007; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_empty_like); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5007; __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[2]; __pyx_lineno = 5007; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__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 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5007; __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;
  if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5007; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_4 = ((PyArrayObject *)__pyx_t_2);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_resx.rcbuffer->pybuffer);
    __pyx_t_5 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_resx.rcbuffer->pybuffer, (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_pybuffernd_resx.rcbuffer->pybuffer, (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_pybuffernd_resx.diminfo[0].strides = __pyx_pybuffernd_resx.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_resx.diminfo[0].shape = __pyx_pybuffernd_resx.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_resx.diminfo[1].strides = __pyx_pybuffernd_resx.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_resx.diminfo[1].shape = __pyx_pybuffernd_resx.rcbuffer->pybuffer.shape[1];
    if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5007; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_4 = 0;
  __pyx_v_resx = ((PyArrayObject *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "pandas/src/generated.pyx":5009
 *     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[2]; __pyx_lineno = 5009; __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[2]; __pyx_lineno = 5009; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_12 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_bins.rcbuffer->pybuffer.buf, __pyx_t_10, __pyx_pybuffernd_bins.diminfo[0].strides)) == __pyx_t_11) != 0);
  if (__pyx_t_12) {

    /* "pandas/src/generated.pyx":5010
 * 
 *     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[2]; __pyx_lineno = 5010; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_v_ngroups = __pyx_t_11;
    goto __pyx_L3;
  }
  /*else*/ {

    /* "pandas/src/generated.pyx":5012
 *         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[2]; __pyx_lineno = 5012; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_v_ngroups = (__pyx_t_11 + 1);
  }
  __pyx_L3:;

  /* "pandas/src/generated.pyx":5014
 *         ngroups = len(bins) + 1
 * 
 *     N, K = (<object> values).shape             # <<<<<<<<<<<<<<
 * 
 *     b = 0
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_values), __pyx_n_s_shape); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5014; __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 CYTHON_COMPILING_IN_CPYTHON
    Py_ssize_t size = Py_SIZE(sequence);
    #else
    Py_ssize_t size = PySequence_Size(sequence);
    #endif
    if (unlikely(size != 2)) {
      if (size > 2) __Pyx_RaiseTooManyValuesError(2);
      else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
      {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5014; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    #if CYTHON_COMPILING_IN_CPYTHON
    if (likely(PyTuple_CheckExact(sequence))) {
      __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0); 
      __pyx_t_1 = PyTuple_GET_ITEM(sequence, 1); 
    } else {
      __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);
    #else
    __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5014; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_1 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5014; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    #endif
    __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[2]; __pyx_lineno = 5014; __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_L4_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_L4_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_1);
    if (__Pyx_IternextUnpackEndCheck(__pyx_t_14(__pyx_t_13), 2) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5014; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_14 = NULL;
    __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
    goto __pyx_L5_unpacking_done;
    __pyx_L4_unpacking_failed:;
    __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
    __pyx_t_14 = NULL;
    if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
    {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5014; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_L5_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[2]; __pyx_lineno = 5014; __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[2]; __pyx_lineno = 5014; __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;

  /* "pandas/src/generated.pyx":5016
 *     N, K = (<object> values).shape
 * 
 *     b = 0             # <<<<<<<<<<<<<<
 *     for i in range(N):
 *         while b < ngroups - 1 and i >= bins[b]:
 */
  __pyx_v_b = 0;

  /* "pandas/src/generated.pyx":5017
 * 
 *     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;

    /* "pandas/src/generated.pyx":5018
 *     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)) != 0);
      if (__pyx_t_12) {
        __pyx_t_15 = __pyx_v_b;
        __pyx_t_16 = ((__pyx_v_i >= (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_bins.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_bins.diminfo[0].strides))) != 0);
        __pyx_t_17 = __pyx_t_16;
      } else {
        __pyx_t_17 = __pyx_t_12;
      }
      if (!__pyx_t_17) break;

      /* "pandas/src/generated.pyx":5019
 *     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);
    }

    /* "pandas/src/generated.pyx":5021
 *             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_pybuffernd_counts.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_counts.diminfo[0].strides) += 1;

    /* "pandas/src/generated.pyx":5022
 * 
 *         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;

      /* "pandas/src/generated.pyx":5023
 *         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_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_values.diminfo[0].strides, __pyx_t_22, __pyx_pybuffernd_values.diminfo[1].strides));

      /* "pandas/src/generated.pyx":5026
 * 
 *             # not nan
 *             if val == val:             # <<<<<<<<<<<<<<
 *                 nobs[b, j] += 1
 *                 if nobs[b, j] == rank:
 */
      __pyx_t_17 = ((__pyx_v_val == __pyx_v_val) != 0);
      if (__pyx_t_17) {

        /* "pandas/src/generated.pyx":5027
 *             # 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_pybuffernd_nobs.rcbuffer->pybuffer.buf, __pyx_t_23, __pyx_pybuffernd_nobs.diminfo[0].strides, __pyx_t_24, __pyx_pybuffernd_nobs.diminfo[1].strides) += 1.0;

        /* "pandas/src/generated.pyx":5028
 *             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_pybuffernd_nobs.rcbuffer->pybuffer.buf, __pyx_t_25, __pyx_pybuffernd_nobs.diminfo[0].strides, __pyx_t_26, __pyx_pybuffernd_nobs.diminfo[1].strides)) == __pyx_v_rank) != 0);
        if (__pyx_t_17) {

          /* "pandas/src/generated.pyx":5029
 *                 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_pybuffernd_resx.rcbuffer->pybuffer.buf, __pyx_t_27, __pyx_pybuffernd_resx.diminfo[0].strides, __pyx_t_28, __pyx_pybuffernd_resx.diminfo[1].strides) = __pyx_v_val;
          goto __pyx_L13;
        }
        __pyx_L13:;
        goto __pyx_L12;
      }
      __pyx_L12:;
    }
  }

  /* "pandas/src/generated.pyx":5031
 *                     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;

    /* "pandas/src/generated.pyx":5032
 * 
 *     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;

      /* "pandas/src/generated.pyx":5033
 *     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_pybuffernd_nobs.rcbuffer->pybuffer.buf, __pyx_t_29, __pyx_pybuffernd_nobs.diminfo[0].strides, __pyx_t_30, __pyx_pybuffernd_nobs.diminfo[1].strides)) == 0.0) != 0);
      if (__pyx_t_17) {

        /* "pandas/src/generated.pyx":5034
 *         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_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_31, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_32, __pyx_pybuffernd_out.diminfo[1].strides) = __pyx_v_6pandas_5algos_nan;
        goto __pyx_L18;
      }
      /*else*/ {

        /* "pandas/src/generated.pyx":5036
 *                 out[i, j] = nan
 *             else:
 *                 out[i, j] = resx[i, j]             # <<<<<<<<<<<<<<
 * @cython.boundscheck(False)
 * @cython.wraparound(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_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_35, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_36, __pyx_pybuffernd_out.diminfo[1].strides) = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_resx.rcbuffer->pybuffer.buf, __pyx_t_33, __pyx_pybuffernd_resx.diminfo[0].strides, __pyx_t_34, __pyx_pybuffernd_resx.diminfo[1].strides));
      }
      __pyx_L18:;
    }
  }

  /* "pandas/src/generated.pyx":4994
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def group_nth_bin_float64(ndarray[float64_t, ndim=2] out,             # <<<<<<<<<<<<<<
 *                   ndarray[int64_t] counts,
 *                   ndarray[float64_t, ndim=2] values,
 */

  /* function exit code */
  __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_pybuffernd_bins.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_counts.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_resx.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas.algos.group_nth_bin_float64", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_bins.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_counts.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_resx.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer);
  __pyx_L2:;
  __Pyx_XDECREF((PyObject *)__pyx_v_resx);
  __Pyx_XDECREF((PyObject *)__pyx_v_nobs);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/src/generated.pyx":5039
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def group_nth_bin_float32(ndarray[float32_t, ndim=2] out,             # <<<<<<<<<<<<<<
 *                   ndarray[int64_t] counts,
 *                   ndarray[float32_t, ndim=2] values,
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pandas_5algos_401group_nth_bin_float32(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6pandas_5algos_400group_nth_bin_float32[] = "\n    Only aggregates on axis=0\n    ";
static PyMethodDef __pyx_mdef_6pandas_5algos_401group_nth_bin_float32 = {__Pyx_NAMESTR("group_nth_bin_float32"), (PyCFunction)__pyx_pw_6pandas_5algos_401group_nth_bin_float32, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6pandas_5algos_400group_nth_bin_float32)};
static PyObject *__pyx_pw_6pandas_5algos_401group_nth_bin_float32(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;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("group_nth_bin_float32 (wrapper)", 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};
    PyObject* values[5] = {0,0,0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_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 (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_out)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_counts)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("group_nth_bin_float32", 1, 5, 5, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5039; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("group_nth_bin_float32", 1, 5, 5, 2); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5039; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  3:
        if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_bins)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("group_nth_bin_float32", 1, 5, 5, 3); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5039; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  4:
        if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_rank)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("group_nth_bin_float32", 1, 5, 5, 4); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5039; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "group_nth_bin_float32") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5039; __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_As_npy_int64(values[4]); if (unlikely((__pyx_v_rank == (npy_int64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5042; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("group_nth_bin_float32", 1, 5, 5, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5039; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas.algos.group_nth_bin_float32", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_out), __pyx_ptype_5numpy_ndarray, 1, "out", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5039; __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[2]; __pyx_lineno = 5040; __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[2]; __pyx_lineno = 5041; __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[2]; __pyx_lineno = 5042; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_400group_nth_bin_float32(__pyx_self, __pyx_v_out, __pyx_v_counts, __pyx_v_values, __pyx_v_bins, __pyx_v_rank);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pandas_5algos_400group_nth_bin_float32(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_out, PyArrayObject *__pyx_v_counts, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_bins, __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_float32_t __pyx_v_val;
  PyArrayObject *__pyx_v_resx = 0;
  PyArrayObject *__pyx_v_nobs = 0;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_bins;
  __Pyx_Buffer __pyx_pybuffer_bins;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_counts;
  __Pyx_Buffer __pyx_pybuffer_counts;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_nobs;
  __Pyx_Buffer __pyx_pybuffer_nobs;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_out;
  __Pyx_Buffer __pyx_pybuffer_out;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_resx;
  __Pyx_Buffer __pyx_pybuffer_resx;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_values;
  __Pyx_Buffer __pyx_pybuffer_values;
  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;
  __Pyx_RefNannySetupContext("group_nth_bin_float32", 0);
  __pyx_pybuffer_resx.pybuffer.buf = NULL;
  __pyx_pybuffer_resx.refcount = 0;
  __pyx_pybuffernd_resx.data = NULL;
  __pyx_pybuffernd_resx.rcbuffer = &__pyx_pybuffer_resx;
  __pyx_pybuffer_nobs.pybuffer.buf = NULL;
  __pyx_pybuffer_nobs.refcount = 0;
  __pyx_pybuffernd_nobs.data = NULL;
  __pyx_pybuffernd_nobs.rcbuffer = &__pyx_pybuffer_nobs;
  __pyx_pybuffer_out.pybuffer.buf = NULL;
  __pyx_pybuffer_out.refcount = 0;
  __pyx_pybuffernd_out.data = NULL;
  __pyx_pybuffernd_out.rcbuffer = &__pyx_pybuffer_out;
  __pyx_pybuffer_counts.pybuffer.buf = NULL;
  __pyx_pybuffer_counts.refcount = 0;
  __pyx_pybuffernd_counts.data = NULL;
  __pyx_pybuffernd_counts.rcbuffer = &__pyx_pybuffer_counts;
  __pyx_pybuffer_values.pybuffer.buf = NULL;
  __pyx_pybuffer_values.refcount = 0;
  __pyx_pybuffernd_values.data = NULL;
  __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values;
  __pyx_pybuffer_bins.pybuffer.buf = NULL;
  __pyx_pybuffer_bins.refcount = 0;
  __pyx_pybuffernd_bins.data = NULL;
  __pyx_pybuffernd_bins.rcbuffer = &__pyx_pybuffer_bins;
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_out.rcbuffer->pybuffer, (PyObject*)__pyx_v_out, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5039; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_out.diminfo[0].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_out.diminfo[0].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_out.diminfo[1].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_out.diminfo[1].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[1];
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_counts.rcbuffer->pybuffer, (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[2]; __pyx_lineno = 5039; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_counts.diminfo[0].strides = __pyx_pybuffernd_counts.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_counts.diminfo[0].shape = __pyx_pybuffernd_counts.rcbuffer->pybuffer.shape[0];
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5039; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_values.diminfo[1].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_values.diminfo[1].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[1];
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_bins.rcbuffer->pybuffer, (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[2]; __pyx_lineno = 5039; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_bins.diminfo[0].strides = __pyx_pybuffernd_bins.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_bins.diminfo[0].shape = __pyx_pybuffernd_bins.rcbuffer->pybuffer.shape[0];

  /* "pandas/src/generated.pyx":5051
 *         ndarray[float32_t, ndim=2] resx, nobs
 * 
 *     nobs = np.zeros_like(out)             # <<<<<<<<<<<<<<
 *     resx = np.empty_like(out)
 * 
 */
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5051; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros_like); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5051; __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[2]; __pyx_lineno = 5051; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__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 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5051; __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 (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5051; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_4 = ((PyArrayObject *)__pyx_t_3);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer);
    __pyx_t_5 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer, (PyObject*)__pyx_t_4, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_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_pybuffernd_nobs.rcbuffer->pybuffer, (PyObject*)__pyx_v_nobs, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_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_pybuffernd_nobs.diminfo[0].strides = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_nobs.diminfo[0].shape = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_nobs.diminfo[1].strides = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_nobs.diminfo[1].shape = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.shape[1];
    if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5051; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_4 = 0;
  __pyx_v_nobs = ((PyArrayObject *)__pyx_t_3);
  __pyx_t_3 = 0;

  /* "pandas/src/generated.pyx":5052
 * 
 *     nobs = np.zeros_like(out)
 *     resx = np.empty_like(out)             # <<<<<<<<<<<<<<
 * 
 *     if bins[len(bins) - 1] == len(values):
 */
  __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5052; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_empty_like); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5052; __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[2]; __pyx_lineno = 5052; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__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 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5052; __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;
  if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5052; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_4 = ((PyArrayObject *)__pyx_t_2);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_resx.rcbuffer->pybuffer);
    __pyx_t_5 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_resx.rcbuffer->pybuffer, (PyObject*)__pyx_t_4, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_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_pybuffernd_resx.rcbuffer->pybuffer, (PyObject*)__pyx_v_resx, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_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_pybuffernd_resx.diminfo[0].strides = __pyx_pybuffernd_resx.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_resx.diminfo[0].shape = __pyx_pybuffernd_resx.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_resx.diminfo[1].strides = __pyx_pybuffernd_resx.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_resx.diminfo[1].shape = __pyx_pybuffernd_resx.rcbuffer->pybuffer.shape[1];
    if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5052; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_4 = 0;
  __pyx_v_resx = ((PyArrayObject *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "pandas/src/generated.pyx":5054
 *     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[2]; __pyx_lineno = 5054; __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[2]; __pyx_lineno = 5054; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_12 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_bins.rcbuffer->pybuffer.buf, __pyx_t_10, __pyx_pybuffernd_bins.diminfo[0].strides)) == __pyx_t_11) != 0);
  if (__pyx_t_12) {

    /* "pandas/src/generated.pyx":5055
 * 
 *     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[2]; __pyx_lineno = 5055; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_v_ngroups = __pyx_t_11;
    goto __pyx_L3;
  }
  /*else*/ {

    /* "pandas/src/generated.pyx":5057
 *         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[2]; __pyx_lineno = 5057; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_v_ngroups = (__pyx_t_11 + 1);
  }
  __pyx_L3:;

  /* "pandas/src/generated.pyx":5059
 *         ngroups = len(bins) + 1
 * 
 *     N, K = (<object> values).shape             # <<<<<<<<<<<<<<
 * 
 *     b = 0
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_values), __pyx_n_s_shape); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5059; __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 CYTHON_COMPILING_IN_CPYTHON
    Py_ssize_t size = Py_SIZE(sequence);
    #else
    Py_ssize_t size = PySequence_Size(sequence);
    #endif
    if (unlikely(size != 2)) {
      if (size > 2) __Pyx_RaiseTooManyValuesError(2);
      else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
      {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5059; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    #if CYTHON_COMPILING_IN_CPYTHON
    if (likely(PyTuple_CheckExact(sequence))) {
      __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0); 
      __pyx_t_1 = PyTuple_GET_ITEM(sequence, 1); 
    } else {
      __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);
    #else
    __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5059; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_1 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5059; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    #endif
    __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[2]; __pyx_lineno = 5059; __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_L4_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_L4_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_1);
    if (__Pyx_IternextUnpackEndCheck(__pyx_t_14(__pyx_t_13), 2) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5059; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_14 = NULL;
    __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
    goto __pyx_L5_unpacking_done;
    __pyx_L4_unpacking_failed:;
    __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
    __pyx_t_14 = NULL;
    if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
    {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5059; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_L5_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[2]; __pyx_lineno = 5059; __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[2]; __pyx_lineno = 5059; __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;

  /* "pandas/src/generated.pyx":5061
 *     N, K = (<object> values).shape
 * 
 *     b = 0             # <<<<<<<<<<<<<<
 *     for i in range(N):
 *         while b < ngroups - 1 and i >= bins[b]:
 */
  __pyx_v_b = 0;

  /* "pandas/src/generated.pyx":5062
 * 
 *     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;

    /* "pandas/src/generated.pyx":5063
 *     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)) != 0);
      if (__pyx_t_12) {
        __pyx_t_15 = __pyx_v_b;
        __pyx_t_16 = ((__pyx_v_i >= (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_bins.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_bins.diminfo[0].strides))) != 0);
        __pyx_t_17 = __pyx_t_16;
      } else {
        __pyx_t_17 = __pyx_t_12;
      }
      if (!__pyx_t_17) break;

      /* "pandas/src/generated.pyx":5064
 *     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);
    }

    /* "pandas/src/generated.pyx":5066
 *             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_pybuffernd_counts.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_counts.diminfo[0].strides) += 1;

    /* "pandas/src/generated.pyx":5067
 * 
 *         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;

      /* "pandas/src/generated.pyx":5068
 *         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_float32_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_values.diminfo[0].strides, __pyx_t_22, __pyx_pybuffernd_values.diminfo[1].strides));

      /* "pandas/src/generated.pyx":5071
 * 
 *             # not nan
 *             if val == val:             # <<<<<<<<<<<<<<
 *                 nobs[b, j] += 1
 *                 if nobs[b, j] == rank:
 */
      __pyx_t_17 = ((__pyx_v_val == __pyx_v_val) != 0);
      if (__pyx_t_17) {

        /* "pandas/src/generated.pyx":5072
 *             # 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_float32_t *, __pyx_pybuffernd_nobs.rcbuffer->pybuffer.buf, __pyx_t_23, __pyx_pybuffernd_nobs.diminfo[0].strides, __pyx_t_24, __pyx_pybuffernd_nobs.diminfo[1].strides) += 1.0;

        /* "pandas/src/generated.pyx":5073
 *             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_float32_t *, __pyx_pybuffernd_nobs.rcbuffer->pybuffer.buf, __pyx_t_25, __pyx_pybuffernd_nobs.diminfo[0].strides, __pyx_t_26, __pyx_pybuffernd_nobs.diminfo[1].strides)) == __pyx_v_rank) != 0);
        if (__pyx_t_17) {

          /* "pandas/src/generated.pyx":5074
 *                 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_float32_t *, __pyx_pybuffernd_resx.rcbuffer->pybuffer.buf, __pyx_t_27, __pyx_pybuffernd_resx.diminfo[0].strides, __pyx_t_28, __pyx_pybuffernd_resx.diminfo[1].strides) = __pyx_v_val;
          goto __pyx_L13;
        }
        __pyx_L13:;
        goto __pyx_L12;
      }
      __pyx_L12:;
    }
  }

  /* "pandas/src/generated.pyx":5076
 *                     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;

    /* "pandas/src/generated.pyx":5077
 * 
 *     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;

      /* "pandas/src/generated.pyx":5078
 *     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_float32_t *, __pyx_pybuffernd_nobs.rcbuffer->pybuffer.buf, __pyx_t_29, __pyx_pybuffernd_nobs.diminfo[0].strides, __pyx_t_30, __pyx_pybuffernd_nobs.diminfo[1].strides)) == 0.0) != 0);
      if (__pyx_t_17) {

        /* "pandas/src/generated.pyx":5079
 *         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_float32_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_31, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_32, __pyx_pybuffernd_out.diminfo[1].strides) = __pyx_v_6pandas_5algos_nan;
        goto __pyx_L18;
      }
      /*else*/ {

        /* "pandas/src/generated.pyx":5081
 *                 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_float32_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_35, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_36, __pyx_pybuffernd_out.diminfo[1].strides) = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_resx.rcbuffer->pybuffer.buf, __pyx_t_33, __pyx_pybuffernd_resx.diminfo[0].strides, __pyx_t_34, __pyx_pybuffernd_resx.diminfo[1].strides));
      }
      __pyx_L18:;
    }
  }

  /* "pandas/src/generated.pyx":5039
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def group_nth_bin_float32(ndarray[float32_t, ndim=2] out,             # <<<<<<<<<<<<<<
 *                   ndarray[int64_t] counts,
 *                   ndarray[float32_t, ndim=2] values,
 */

  /* function exit code */
  __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_pybuffernd_bins.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_counts.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_resx.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas.algos.group_nth_bin_float32", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_bins.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_counts.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_resx.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer);
  __pyx_L2:;
  __Pyx_XDECREF((PyObject *)__pyx_v_resx);
  __Pyx_XDECREF((PyObject *)__pyx_v_nobs);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/src/generated.pyx":5085
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def group_add_float64(ndarray[float64_t, ndim=2] out,             # <<<<<<<<<<<<<<
 *               ndarray[int64_t] counts,
 *               ndarray[float64_t, ndim=2] values,
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pandas_5algos_403group_add_float64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6pandas_5algos_402group_add_float64[] = "\n    Only aggregates on axis=0\n    ";
static PyMethodDef __pyx_mdef_6pandas_5algos_403group_add_float64 = {__Pyx_NAMESTR("group_add_float64"), (PyCFunction)__pyx_pw_6pandas_5algos_403group_add_float64, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6pandas_5algos_402group_add_float64)};
static PyObject *__pyx_pw_6pandas_5algos_403group_add_float64(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;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("group_add_float64 (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_out,&__pyx_n_s_counts,&__pyx_n_s_values,&__pyx_n_s_labels,0};
    PyObject* values[4] = {0,0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_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 (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_out)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_counts)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("group_add_float64", 1, 4, 4, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5085; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("group_add_float64", 1, 4, 4, 2); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5085; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  3:
        if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_labels)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("group_add_float64", 1, 4, 4, 3); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5085; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "group_add_float64") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5085; __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_float64", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5085; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas.algos.group_add_float64", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_out), __pyx_ptype_5numpy_ndarray, 1, "out", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5085; __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[2]; __pyx_lineno = 5086; __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[2]; __pyx_lineno = 5087; __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[2]; __pyx_lineno = 5088; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_402group_add_float64(__pyx_self, __pyx_v_out, __pyx_v_counts, __pyx_v_values, __pyx_v_labels);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pandas_5algos_402group_add_float64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_out, PyArrayObject *__pyx_v_counts, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_labels) {
  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;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_counts;
  __Pyx_Buffer __pyx_pybuffer_counts;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_labels;
  __Pyx_Buffer __pyx_pybuffer_labels;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_nobs;
  __Pyx_Buffer __pyx_pybuffer_nobs;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_out;
  __Pyx_Buffer __pyx_pybuffer_out;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_sumx;
  __Pyx_Buffer __pyx_pybuffer_sumx;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_values;
  __Pyx_Buffer __pyx_pybuffer_values;
  PyObject *__pyx_r = NULL;
  __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;
  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;
  PyObject *__pyx_t_12 = NULL;
  PyObject *(*__pyx_t_13)(PyObject *);
  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;
  __Pyx_RefNannySetupContext("group_add_float64", 0);
  __pyx_pybuffer_sumx.pybuffer.buf = NULL;
  __pyx_pybuffer_sumx.refcount = 0;
  __pyx_pybuffernd_sumx.data = NULL;
  __pyx_pybuffernd_sumx.rcbuffer = &__pyx_pybuffer_sumx;
  __pyx_pybuffer_nobs.pybuffer.buf = NULL;
  __pyx_pybuffer_nobs.refcount = 0;
  __pyx_pybuffernd_nobs.data = NULL;
  __pyx_pybuffernd_nobs.rcbuffer = &__pyx_pybuffer_nobs;
  __pyx_pybuffer_out.pybuffer.buf = NULL;
  __pyx_pybuffer_out.refcount = 0;
  __pyx_pybuffernd_out.data = NULL;
  __pyx_pybuffernd_out.rcbuffer = &__pyx_pybuffer_out;
  __pyx_pybuffer_counts.pybuffer.buf = NULL;
  __pyx_pybuffer_counts.refcount = 0;
  __pyx_pybuffernd_counts.data = NULL;
  __pyx_pybuffernd_counts.rcbuffer = &__pyx_pybuffer_counts;
  __pyx_pybuffer_values.pybuffer.buf = NULL;
  __pyx_pybuffer_values.refcount = 0;
  __pyx_pybuffernd_values.data = NULL;
  __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values;
  __pyx_pybuffer_labels.pybuffer.buf = NULL;
  __pyx_pybuffer_labels.refcount = 0;
  __pyx_pybuffernd_labels.data = NULL;
  __pyx_pybuffernd_labels.rcbuffer = &__pyx_pybuffer_labels;
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_out.rcbuffer->pybuffer, (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[2]; __pyx_lineno = 5085; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_out.diminfo[0].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_out.diminfo[0].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_out.diminfo[1].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_out.diminfo[1].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[1];
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_counts.rcbuffer->pybuffer, (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[2]; __pyx_lineno = 5085; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_counts.diminfo[0].strides = __pyx_pybuffernd_counts.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_counts.diminfo[0].shape = __pyx_pybuffernd_counts.rcbuffer->pybuffer.shape[0];
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (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[2]; __pyx_lineno = 5085; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_values.diminfo[1].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_values.diminfo[1].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[1];
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_labels.rcbuffer->pybuffer, (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[2]; __pyx_lineno = 5085; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_labels.diminfo[0].strides = __pyx_pybuffernd_labels.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_labels.diminfo[0].shape = __pyx_pybuffernd_labels.rcbuffer->pybuffer.shape[0];

  /* "pandas/src/generated.pyx":5097
 *         ndarray[float64_t, ndim=2] sumx, nobs
 * 
 *     if not len(values) == len(labels):             # <<<<<<<<<<<<<<
 *        raise AssertionError("len(index) != len(labels)")
 * 
 */
  __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_values)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5097; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_2 = PyObject_Length(((PyObject *)__pyx_v_labels)); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5097; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_3 = ((!((__pyx_t_1 == __pyx_t_2) != 0)) != 0);
  if (__pyx_t_3) {

    /* "pandas/src/generated.pyx":5098
 * 
 *     if not len(values) == len(labels):
 *        raise AssertionError("len(index) != len(labels)")             # <<<<<<<<<<<<<<
 * 
 *     nobs = np.zeros_like(out)
 */
    __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_AssertionError, __pyx_tuple__196, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5098; __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[2]; __pyx_lineno = 5098; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }

  /* "pandas/src/generated.pyx":5100
 *        raise AssertionError("len(index) != len(labels)")
 * 
 *     nobs = np.zeros_like(out)             # <<<<<<<<<<<<<<
 *     sumx = np.zeros_like(out)
 * 
 */
  __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5100; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_zeros_like); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5100; __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[2]; __pyx_lineno = 5100; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_INCREF(((PyObject *)__pyx_v_out));
  PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_v_out));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_out));
  __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_4, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5100; __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_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[2]; __pyx_lineno = 5100; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_7 = ((PyArrayObject *)__pyx_t_6);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer);
    __pyx_t_8 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer, (PyObject*)__pyx_t_7, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 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_pybuffernd_nobs.rcbuffer->pybuffer, (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_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_pybuffernd_nobs.diminfo[0].strides = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_nobs.diminfo[0].shape = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_nobs.diminfo[1].strides = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_nobs.diminfo[1].shape = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.shape[1];
    if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5100; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_7 = 0;
  __pyx_v_nobs = ((PyArrayObject *)__pyx_t_6);
  __pyx_t_6 = 0;

  /* "pandas/src/generated.pyx":5101
 * 
 *     nobs = np.zeros_like(out)
 *     sumx = np.zeros_like(out)             # <<<<<<<<<<<<<<
 * 
 *     N, K = (<object> values).shape
 */
  __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5101; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_zeros_like); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5101; __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[2]; __pyx_lineno = 5101; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_INCREF(((PyObject *)__pyx_v_out));
  PyTuple_SET_ITEM(__pyx_t_6, 0, ((PyObject *)__pyx_v_out));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_out));
  __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5101; __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;
  if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5101; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_7 = ((PyArrayObject *)__pyx_t_5);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_sumx.rcbuffer->pybuffer);
    __pyx_t_8 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_sumx.rcbuffer->pybuffer, (PyObject*)__pyx_t_7, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 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_pybuffernd_sumx.rcbuffer->pybuffer, (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_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_pybuffernd_sumx.diminfo[0].strides = __pyx_pybuffernd_sumx.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_sumx.diminfo[0].shape = __pyx_pybuffernd_sumx.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_sumx.diminfo[1].strides = __pyx_pybuffernd_sumx.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_sumx.diminfo[1].shape = __pyx_pybuffernd_sumx.rcbuffer->pybuffer.shape[1];
    if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5101; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_7 = 0;
  __pyx_v_sumx = ((PyArrayObject *)__pyx_t_5);
  __pyx_t_5 = 0;

  /* "pandas/src/generated.pyx":5103
 *     sumx = np.zeros_like(out)
 * 
 *     N, K = (<object> values).shape             # <<<<<<<<<<<<<<
 * 
 *     if K > 1:
 */
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_values), __pyx_n_s_shape); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5103; __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 CYTHON_COMPILING_IN_CPYTHON
    Py_ssize_t size = Py_SIZE(sequence);
    #else
    Py_ssize_t size = PySequence_Size(sequence);
    #endif
    if (unlikely(size != 2)) {
      if (size > 2) __Pyx_RaiseTooManyValuesError(2);
      else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
      {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5103; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    #if CYTHON_COMPILING_IN_CPYTHON
    if (likely(PyTuple_CheckExact(sequence))) {
      __pyx_t_6 = PyTuple_GET_ITEM(sequence, 0); 
      __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1); 
    } else {
      __pyx_t_6 = PyList_GET_ITEM(sequence, 0); 
      __pyx_t_4 = PyList_GET_ITEM(sequence, 1); 
    }
    __Pyx_INCREF(__pyx_t_6);
    __Pyx_INCREF(__pyx_t_4);
    #else
    __pyx_t_6 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5103; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5103; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    #endif
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  } else {
    Py_ssize_t index = -1;
    __pyx_t_12 = PyObject_GetIter(__pyx_t_5); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5103; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_12);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_13 = Py_TYPE(__pyx_t_12)->tp_iternext;
    index = 0; __pyx_t_6 = __pyx_t_13(__pyx_t_12); if (unlikely(!__pyx_t_6)) goto __pyx_L4_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_6);
    index = 1; __pyx_t_4 = __pyx_t_13(__pyx_t_12); if (unlikely(!__pyx_t_4)) goto __pyx_L4_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_4);
    if (__Pyx_IternextUnpackEndCheck(__pyx_t_13(__pyx_t_12), 2) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5103; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_13 = NULL;
    __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
    goto __pyx_L5_unpacking_done;
    __pyx_L4_unpacking_failed:;
    __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
    __pyx_t_13 = NULL;
    if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
    {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5103; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_L5_unpacking_done:;
  }
  __pyx_t_2 = __Pyx_PyIndex_AsSsize_t(__pyx_t_6); if (unlikely((__pyx_t_2 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5103; __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_4); if (unlikely((__pyx_t_1 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5103; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_v_N = __pyx_t_2;
  __pyx_v_K = __pyx_t_1;

  /* "pandas/src/generated.pyx":5105
 *     N, K = (<object> values).shape
 * 
 *     if K > 1:             # <<<<<<<<<<<<<<
 *         for i in range(N):
 *             lab = labels[i]
 */
  __pyx_t_3 = ((__pyx_v_K > 1) != 0);
  if (__pyx_t_3) {

    /* "pandas/src/generated.pyx":5106
 * 
 *     if K > 1:
 *         for i in range(N):             # <<<<<<<<<<<<<<
 *             lab = labels[i]
 *             if lab < 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;

      /* "pandas/src/generated.pyx":5107
 *     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_pybuffernd_labels.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_labels.diminfo[0].strides));

      /* "pandas/src/generated.pyx":5108
 *         for i in range(N):
 *             lab = labels[i]
 *             if lab < 0:             # <<<<<<<<<<<<<<
 *                 continue
 * 
 */
      __pyx_t_3 = ((__pyx_v_lab < 0) != 0);
      if (__pyx_t_3) {

        /* "pandas/src/generated.pyx":5109
 *             lab = labels[i]
 *             if lab < 0:
 *                 continue             # <<<<<<<<<<<<<<
 * 
 *             counts[lab] += 1
 */
        goto __pyx_L7_continue;
      }

      /* "pandas/src/generated.pyx":5111
 *                 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_pybuffernd_counts.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_counts.diminfo[0].strides) += 1;

      /* "pandas/src/generated.pyx":5112
 * 
 *             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;

        /* "pandas/src/generated.pyx":5113
 *             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_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_values.diminfo[0].strides, __pyx_t_19, __pyx_pybuffernd_values.diminfo[1].strides));

        /* "pandas/src/generated.pyx":5116
 * 
 *                 # not nan
 *                 if val == val:             # <<<<<<<<<<<<<<
 *                     nobs[lab, j] += 1
 *                     sumx[lab, j] += val
 */
        __pyx_t_3 = ((__pyx_v_val == __pyx_v_val) != 0);
        if (__pyx_t_3) {

          /* "pandas/src/generated.pyx":5117
 *                 # 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_pybuffernd_nobs.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_nobs.diminfo[0].strides, __pyx_t_21, __pyx_pybuffernd_nobs.diminfo[1].strides) += 1.0;

          /* "pandas/src/generated.pyx":5118
 *                 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_pybuffernd_sumx.rcbuffer->pybuffer.buf, __pyx_t_22, __pyx_pybuffernd_sumx.diminfo[0].strides, __pyx_t_23, __pyx_pybuffernd_sumx.diminfo[1].strides) += __pyx_v_val;
          goto __pyx_L12;
        }
        __pyx_L12:;
      }
      __pyx_L7_continue:;
    }
    goto __pyx_L6;
  }
  /*else*/ {

    /* "pandas/src/generated.pyx":5120
 *                     sumx[lab, j] += val
 *     else:
 *         for i in range(N):             # <<<<<<<<<<<<<<
 *             lab = labels[i]
 *             if lab < 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;

      /* "pandas/src/generated.pyx":5121
 *     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_pybuffernd_labels.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_labels.diminfo[0].strides));

      /* "pandas/src/generated.pyx":5122
 *         for i in range(N):
 *             lab = labels[i]
 *             if lab < 0:             # <<<<<<<<<<<<<<
 *                 continue
 * 
 */
      __pyx_t_3 = ((__pyx_v_lab < 0) != 0);
      if (__pyx_t_3) {

        /* "pandas/src/generated.pyx":5123
 *             lab = labels[i]
 *             if lab < 0:
 *                 continue             # <<<<<<<<<<<<<<
 * 
 *             counts[lab] += 1
 */
        goto __pyx_L13_continue;
      }

      /* "pandas/src/generated.pyx":5125
 *                 continue
 * 
 *             counts[lab] += 1             # <<<<<<<<<<<<<<
 *             val = values[i, 0]
 * 
 */
      __pyx_t_17 = __pyx_v_lab;
      *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_counts.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_counts.diminfo[0].strides) += 1;

      /* "pandas/src/generated.pyx":5126
 * 
 *             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_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_24, __pyx_pybuffernd_values.diminfo[0].strides, __pyx_t_25, __pyx_pybuffernd_values.diminfo[1].strides));

      /* "pandas/src/generated.pyx":5129
 * 
 *             # not nan
 *             if val == val:             # <<<<<<<<<<<<<<
 *                 nobs[lab, 0] += 1
 *                 sumx[lab, 0] += val
 */
      __pyx_t_3 = ((__pyx_v_val == __pyx_v_val) != 0);
      if (__pyx_t_3) {

        /* "pandas/src/generated.pyx":5130
 *             # 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_pybuffernd_nobs.rcbuffer->pybuffer.buf, __pyx_t_26, __pyx_pybuffernd_nobs.diminfo[0].strides, __pyx_t_27, __pyx_pybuffernd_nobs.diminfo[1].strides) += 1.0;

        /* "pandas/src/generated.pyx":5131
 *             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_pybuffernd_sumx.rcbuffer->pybuffer.buf, __pyx_t_28, __pyx_pybuffernd_sumx.diminfo[0].strides, __pyx_t_29, __pyx_pybuffernd_sumx.diminfo[1].strides) += __pyx_v_val;
        goto __pyx_L16;
      }
      __pyx_L16:;
      __pyx_L13_continue:;
    }
  }
  __pyx_L6:;

  /* "pandas/src/generated.pyx":5133
 *                 sumx[lab, 0] += val
 * 
 *     for i in range(len(counts)):             # <<<<<<<<<<<<<<
 *         for j in range(K):
 *             if nobs[i, j] == 0:
 */
  __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_counts)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5133; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) {
    __pyx_v_i = __pyx_t_2;

    /* "pandas/src/generated.pyx":5134
 * 
 *     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;

      /* "pandas/src/generated.pyx":5135
 *     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_3 = (((*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_nobs.rcbuffer->pybuffer.buf, __pyx_t_32, __pyx_pybuffernd_nobs.diminfo[0].strides, __pyx_t_33, __pyx_pybuffernd_nobs.diminfo[1].strides)) == 0.0) != 0);
      if (__pyx_t_3) {

        /* "pandas/src/generated.pyx":5136
 *         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_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_34, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_35, __pyx_pybuffernd_out.diminfo[1].strides) = __pyx_v_6pandas_5algos_nan;
        goto __pyx_L21;
      }
      /*else*/ {

        /* "pandas/src/generated.pyx":5138
 *                 out[i, j] = nan
 *             else:
 *                 out[i, j] = sumx[i, j]             # <<<<<<<<<<<<<<
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 */
        __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_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_38, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_39, __pyx_pybuffernd_out.diminfo[1].strides) = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_sumx.rcbuffer->pybuffer.buf, __pyx_t_36, __pyx_pybuffernd_sumx.diminfo[0].strides, __pyx_t_37, __pyx_pybuffernd_sumx.diminfo[1].strides));
      }
      __pyx_L21:;
    }
  }

  /* "pandas/src/generated.pyx":5085
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def group_add_float64(ndarray[float64_t, ndim=2] out,             # <<<<<<<<<<<<<<
 *               ndarray[int64_t] counts,
 *               ndarray[float64_t, ndim=2] values,
 */

  /* function exit code */
  __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_12);
  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
    __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_counts.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_labels.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_sumx.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas.algos.group_add_float64", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_counts.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_labels.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_sumx.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer);
  __pyx_L2:;
  __Pyx_XDECREF((PyObject *)__pyx_v_sumx);
  __Pyx_XDECREF((PyObject *)__pyx_v_nobs);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/src/generated.pyx":5141
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def group_add_float32(ndarray[float32_t, ndim=2] out,             # <<<<<<<<<<<<<<
 *               ndarray[int64_t] counts,
 *               ndarray[float32_t, ndim=2] values,
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pandas_5algos_405group_add_float32(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6pandas_5algos_404group_add_float32[] = "\n    Only aggregates on axis=0\n    ";
static PyMethodDef __pyx_mdef_6pandas_5algos_405group_add_float32 = {__Pyx_NAMESTR("group_add_float32"), (PyCFunction)__pyx_pw_6pandas_5algos_405group_add_float32, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6pandas_5algos_404group_add_float32)};
static PyObject *__pyx_pw_6pandas_5algos_405group_add_float32(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;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("group_add_float32 (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_out,&__pyx_n_s_counts,&__pyx_n_s_values,&__pyx_n_s_labels,0};
    PyObject* values[4] = {0,0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_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 (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_out)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_counts)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("group_add_float32", 1, 4, 4, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5141; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("group_add_float32", 1, 4, 4, 2); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5141; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  3:
        if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_labels)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("group_add_float32", 1, 4, 4, 3); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5141; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "group_add_float32") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5141; __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_float32", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5141; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas.algos.group_add_float32", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_out), __pyx_ptype_5numpy_ndarray, 1, "out", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5141; __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[2]; __pyx_lineno = 5142; __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[2]; __pyx_lineno = 5143; __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[2]; __pyx_lineno = 5144; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_404group_add_float32(__pyx_self, __pyx_v_out, __pyx_v_counts, __pyx_v_values, __pyx_v_labels);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pandas_5algos_404group_add_float32(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_out, PyArrayObject *__pyx_v_counts, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_labels) {
  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_float32_t __pyx_v_val;
  PyArrayObject *__pyx_v_sumx = 0;
  PyArrayObject *__pyx_v_nobs = 0;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_counts;
  __Pyx_Buffer __pyx_pybuffer_counts;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_labels;
  __Pyx_Buffer __pyx_pybuffer_labels;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_nobs;
  __Pyx_Buffer __pyx_pybuffer_nobs;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_out;
  __Pyx_Buffer __pyx_pybuffer_out;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_sumx;
  __Pyx_Buffer __pyx_pybuffer_sumx;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_values;
  __Pyx_Buffer __pyx_pybuffer_values;
  PyObject *__pyx_r = NULL;
  __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;
  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;
  PyObject *__pyx_t_12 = NULL;
  PyObject *(*__pyx_t_13)(PyObject *);
  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;
  __Pyx_RefNannySetupContext("group_add_float32", 0);
  __pyx_pybuffer_sumx.pybuffer.buf = NULL;
  __pyx_pybuffer_sumx.refcount = 0;
  __pyx_pybuffernd_sumx.data = NULL;
  __pyx_pybuffernd_sumx.rcbuffer = &__pyx_pybuffer_sumx;
  __pyx_pybuffer_nobs.pybuffer.buf = NULL;
  __pyx_pybuffer_nobs.refcount = 0;
  __pyx_pybuffernd_nobs.data = NULL;
  __pyx_pybuffernd_nobs.rcbuffer = &__pyx_pybuffer_nobs;
  __pyx_pybuffer_out.pybuffer.buf = NULL;
  __pyx_pybuffer_out.refcount = 0;
  __pyx_pybuffernd_out.data = NULL;
  __pyx_pybuffernd_out.rcbuffer = &__pyx_pybuffer_out;
  __pyx_pybuffer_counts.pybuffer.buf = NULL;
  __pyx_pybuffer_counts.refcount = 0;
  __pyx_pybuffernd_counts.data = NULL;
  __pyx_pybuffernd_counts.rcbuffer = &__pyx_pybuffer_counts;
  __pyx_pybuffer_values.pybuffer.buf = NULL;
  __pyx_pybuffer_values.refcount = 0;
  __pyx_pybuffernd_values.data = NULL;
  __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values;
  __pyx_pybuffer_labels.pybuffer.buf = NULL;
  __pyx_pybuffer_labels.refcount = 0;
  __pyx_pybuffernd_labels.data = NULL;
  __pyx_pybuffernd_labels.rcbuffer = &__pyx_pybuffer_labels;
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_out.rcbuffer->pybuffer, (PyObject*)__pyx_v_out, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5141; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_out.diminfo[0].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_out.diminfo[0].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_out.diminfo[1].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_out.diminfo[1].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[1];
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_counts.rcbuffer->pybuffer, (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[2]; __pyx_lineno = 5141; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_counts.diminfo[0].strides = __pyx_pybuffernd_counts.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_counts.diminfo[0].shape = __pyx_pybuffernd_counts.rcbuffer->pybuffer.shape[0];
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5141; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_values.diminfo[1].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_values.diminfo[1].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[1];
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_labels.rcbuffer->pybuffer, (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[2]; __pyx_lineno = 5141; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_labels.diminfo[0].strides = __pyx_pybuffernd_labels.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_labels.diminfo[0].shape = __pyx_pybuffernd_labels.rcbuffer->pybuffer.shape[0];

  /* "pandas/src/generated.pyx":5153
 *         ndarray[float32_t, ndim=2] sumx, nobs
 * 
 *     if not len(values) == len(labels):             # <<<<<<<<<<<<<<
 *        raise AssertionError("len(index) != len(labels)")
 * 
 */
  __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_values)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5153; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_2 = PyObject_Length(((PyObject *)__pyx_v_labels)); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5153; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_3 = ((!((__pyx_t_1 == __pyx_t_2) != 0)) != 0);
  if (__pyx_t_3) {

    /* "pandas/src/generated.pyx":5154
 * 
 *     if not len(values) == len(labels):
 *        raise AssertionError("len(index) != len(labels)")             # <<<<<<<<<<<<<<
 * 
 *     nobs = np.zeros_like(out)
 */
    __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_AssertionError, __pyx_tuple__197, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5154; __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[2]; __pyx_lineno = 5154; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }

  /* "pandas/src/generated.pyx":5156
 *        raise AssertionError("len(index) != len(labels)")
 * 
 *     nobs = np.zeros_like(out)             # <<<<<<<<<<<<<<
 *     sumx = np.zeros_like(out)
 * 
 */
  __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5156; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_zeros_like); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5156; __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[2]; __pyx_lineno = 5156; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_INCREF(((PyObject *)__pyx_v_out));
  PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_v_out));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_out));
  __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_4, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5156; __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_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[2]; __pyx_lineno = 5156; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_7 = ((PyArrayObject *)__pyx_t_6);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer);
    __pyx_t_8 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer, (PyObject*)__pyx_t_7, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 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_pybuffernd_nobs.rcbuffer->pybuffer, (PyObject*)__pyx_v_nobs, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, 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_pybuffernd_nobs.diminfo[0].strides = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_nobs.diminfo[0].shape = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_nobs.diminfo[1].strides = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_nobs.diminfo[1].shape = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.shape[1];
    if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5156; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_7 = 0;
  __pyx_v_nobs = ((PyArrayObject *)__pyx_t_6);
  __pyx_t_6 = 0;

  /* "pandas/src/generated.pyx":5157
 * 
 *     nobs = np.zeros_like(out)
 *     sumx = np.zeros_like(out)             # <<<<<<<<<<<<<<
 * 
 *     N, K = (<object> values).shape
 */
  __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5157; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_zeros_like); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5157; __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[2]; __pyx_lineno = 5157; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_INCREF(((PyObject *)__pyx_v_out));
  PyTuple_SET_ITEM(__pyx_t_6, 0, ((PyObject *)__pyx_v_out));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_out));
  __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5157; __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;
  if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5157; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_7 = ((PyArrayObject *)__pyx_t_5);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_sumx.rcbuffer->pybuffer);
    __pyx_t_8 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_sumx.rcbuffer->pybuffer, (PyObject*)__pyx_t_7, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 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_pybuffernd_sumx.rcbuffer->pybuffer, (PyObject*)__pyx_v_sumx, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 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_pybuffernd_sumx.diminfo[0].strides = __pyx_pybuffernd_sumx.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_sumx.diminfo[0].shape = __pyx_pybuffernd_sumx.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_sumx.diminfo[1].strides = __pyx_pybuffernd_sumx.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_sumx.diminfo[1].shape = __pyx_pybuffernd_sumx.rcbuffer->pybuffer.shape[1];
    if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5157; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_7 = 0;
  __pyx_v_sumx = ((PyArrayObject *)__pyx_t_5);
  __pyx_t_5 = 0;

  /* "pandas/src/generated.pyx":5159
 *     sumx = np.zeros_like(out)
 * 
 *     N, K = (<object> values).shape             # <<<<<<<<<<<<<<
 * 
 *     if K > 1:
 */
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_values), __pyx_n_s_shape); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5159; __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 CYTHON_COMPILING_IN_CPYTHON
    Py_ssize_t size = Py_SIZE(sequence);
    #else
    Py_ssize_t size = PySequence_Size(sequence);
    #endif
    if (unlikely(size != 2)) {
      if (size > 2) __Pyx_RaiseTooManyValuesError(2);
      else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
      {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5159; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    #if CYTHON_COMPILING_IN_CPYTHON
    if (likely(PyTuple_CheckExact(sequence))) {
      __pyx_t_6 = PyTuple_GET_ITEM(sequence, 0); 
      __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1); 
    } else {
      __pyx_t_6 = PyList_GET_ITEM(sequence, 0); 
      __pyx_t_4 = PyList_GET_ITEM(sequence, 1); 
    }
    __Pyx_INCREF(__pyx_t_6);
    __Pyx_INCREF(__pyx_t_4);
    #else
    __pyx_t_6 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5159; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5159; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    #endif
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  } else {
    Py_ssize_t index = -1;
    __pyx_t_12 = PyObject_GetIter(__pyx_t_5); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5159; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_12);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_13 = Py_TYPE(__pyx_t_12)->tp_iternext;
    index = 0; __pyx_t_6 = __pyx_t_13(__pyx_t_12); if (unlikely(!__pyx_t_6)) goto __pyx_L4_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_6);
    index = 1; __pyx_t_4 = __pyx_t_13(__pyx_t_12); if (unlikely(!__pyx_t_4)) goto __pyx_L4_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_4);
    if (__Pyx_IternextUnpackEndCheck(__pyx_t_13(__pyx_t_12), 2) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5159; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_13 = NULL;
    __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
    goto __pyx_L5_unpacking_done;
    __pyx_L4_unpacking_failed:;
    __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
    __pyx_t_13 = NULL;
    if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
    {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5159; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_L5_unpacking_done:;
  }
  __pyx_t_2 = __Pyx_PyIndex_AsSsize_t(__pyx_t_6); if (unlikely((__pyx_t_2 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5159; __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_4); if (unlikely((__pyx_t_1 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5159; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_v_N = __pyx_t_2;
  __pyx_v_K = __pyx_t_1;

  /* "pandas/src/generated.pyx":5161
 *     N, K = (<object> values).shape
 * 
 *     if K > 1:             # <<<<<<<<<<<<<<
 *         for i in range(N):
 *             lab = labels[i]
 */
  __pyx_t_3 = ((__pyx_v_K > 1) != 0);
  if (__pyx_t_3) {

    /* "pandas/src/generated.pyx":5162
 * 
 *     if K > 1:
 *         for i in range(N):             # <<<<<<<<<<<<<<
 *             lab = labels[i]
 *             if lab < 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;

      /* "pandas/src/generated.pyx":5163
 *     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_pybuffernd_labels.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_labels.diminfo[0].strides));

      /* "pandas/src/generated.pyx":5164
 *         for i in range(N):
 *             lab = labels[i]
 *             if lab < 0:             # <<<<<<<<<<<<<<
 *                 continue
 * 
 */
      __pyx_t_3 = ((__pyx_v_lab < 0) != 0);
      if (__pyx_t_3) {

        /* "pandas/src/generated.pyx":5165
 *             lab = labels[i]
 *             if lab < 0:
 *                 continue             # <<<<<<<<<<<<<<
 * 
 *             counts[lab] += 1
 */
        goto __pyx_L7_continue;
      }

      /* "pandas/src/generated.pyx":5167
 *                 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_pybuffernd_counts.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_counts.diminfo[0].strides) += 1;

      /* "pandas/src/generated.pyx":5168
 * 
 *             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;

        /* "pandas/src/generated.pyx":5169
 *             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_float32_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_values.diminfo[0].strides, __pyx_t_19, __pyx_pybuffernd_values.diminfo[1].strides));

        /* "pandas/src/generated.pyx":5172
 * 
 *                 # not nan
 *                 if val == val:             # <<<<<<<<<<<<<<
 *                     nobs[lab, j] += 1
 *                     sumx[lab, j] += val
 */
        __pyx_t_3 = ((__pyx_v_val == __pyx_v_val) != 0);
        if (__pyx_t_3) {

          /* "pandas/src/generated.pyx":5173
 *                 # 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_float32_t *, __pyx_pybuffernd_nobs.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_nobs.diminfo[0].strides, __pyx_t_21, __pyx_pybuffernd_nobs.diminfo[1].strides) += 1.0;

          /* "pandas/src/generated.pyx":5174
 *                 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_float32_t *, __pyx_pybuffernd_sumx.rcbuffer->pybuffer.buf, __pyx_t_22, __pyx_pybuffernd_sumx.diminfo[0].strides, __pyx_t_23, __pyx_pybuffernd_sumx.diminfo[1].strides) += __pyx_v_val;
          goto __pyx_L12;
        }
        __pyx_L12:;
      }
      __pyx_L7_continue:;
    }
    goto __pyx_L6;
  }
  /*else*/ {

    /* "pandas/src/generated.pyx":5176
 *                     sumx[lab, j] += val
 *     else:
 *         for i in range(N):             # <<<<<<<<<<<<<<
 *             lab = labels[i]
 *             if lab < 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;

      /* "pandas/src/generated.pyx":5177
 *     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_pybuffernd_labels.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_labels.diminfo[0].strides));

      /* "pandas/src/generated.pyx":5178
 *         for i in range(N):
 *             lab = labels[i]
 *             if lab < 0:             # <<<<<<<<<<<<<<
 *                 continue
 * 
 */
      __pyx_t_3 = ((__pyx_v_lab < 0) != 0);
      if (__pyx_t_3) {

        /* "pandas/src/generated.pyx":5179
 *             lab = labels[i]
 *             if lab < 0:
 *                 continue             # <<<<<<<<<<<<<<
 * 
 *             counts[lab] += 1
 */
        goto __pyx_L13_continue;
      }

      /* "pandas/src/generated.pyx":5181
 *                 continue
 * 
 *             counts[lab] += 1             # <<<<<<<<<<<<<<
 *             val = values[i, 0]
 * 
 */
      __pyx_t_17 = __pyx_v_lab;
      *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_counts.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_counts.diminfo[0].strides) += 1;

      /* "pandas/src/generated.pyx":5182
 * 
 *             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_float32_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_24, __pyx_pybuffernd_values.diminfo[0].strides, __pyx_t_25, __pyx_pybuffernd_values.diminfo[1].strides));

      /* "pandas/src/generated.pyx":5185
 * 
 *             # not nan
 *             if val == val:             # <<<<<<<<<<<<<<
 *                 nobs[lab, 0] += 1
 *                 sumx[lab, 0] += val
 */
      __pyx_t_3 = ((__pyx_v_val == __pyx_v_val) != 0);
      if (__pyx_t_3) {

        /* "pandas/src/generated.pyx":5186
 *             # 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_float32_t *, __pyx_pybuffernd_nobs.rcbuffer->pybuffer.buf, __pyx_t_26, __pyx_pybuffernd_nobs.diminfo[0].strides, __pyx_t_27, __pyx_pybuffernd_nobs.diminfo[1].strides) += 1.0;

        /* "pandas/src/generated.pyx":5187
 *             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_float32_t *, __pyx_pybuffernd_sumx.rcbuffer->pybuffer.buf, __pyx_t_28, __pyx_pybuffernd_sumx.diminfo[0].strides, __pyx_t_29, __pyx_pybuffernd_sumx.diminfo[1].strides) += __pyx_v_val;
        goto __pyx_L16;
      }
      __pyx_L16:;
      __pyx_L13_continue:;
    }
  }
  __pyx_L6:;

  /* "pandas/src/generated.pyx":5189
 *                 sumx[lab, 0] += val
 * 
 *     for i in range(len(counts)):             # <<<<<<<<<<<<<<
 *         for j in range(K):
 *             if nobs[i, j] == 0:
 */
  __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_counts)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5189; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) {
    __pyx_v_i = __pyx_t_2;

    /* "pandas/src/generated.pyx":5190
 * 
 *     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;

      /* "pandas/src/generated.pyx":5191
 *     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_3 = (((*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_nobs.rcbuffer->pybuffer.buf, __pyx_t_32, __pyx_pybuffernd_nobs.diminfo[0].strides, __pyx_t_33, __pyx_pybuffernd_nobs.diminfo[1].strides)) == 0.0) != 0);
      if (__pyx_t_3) {

        /* "pandas/src/generated.pyx":5192
 *         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_float32_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_34, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_35, __pyx_pybuffernd_out.diminfo[1].strides) = __pyx_v_6pandas_5algos_nan;
        goto __pyx_L21;
      }
      /*else*/ {

        /* "pandas/src/generated.pyx":5194
 *                 out[i, j] = nan
 *             else:
 *                 out[i, j] = sumx[i, j]             # <<<<<<<<<<<<<<
 * 
 * @cython.boundscheck(False)
 */
        __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_float32_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_38, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_39, __pyx_pybuffernd_out.diminfo[1].strides) = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_sumx.rcbuffer->pybuffer.buf, __pyx_t_36, __pyx_pybuffernd_sumx.diminfo[0].strides, __pyx_t_37, __pyx_pybuffernd_sumx.diminfo[1].strides));
      }
      __pyx_L21:;
    }
  }

  /* "pandas/src/generated.pyx":5141
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def group_add_float32(ndarray[float32_t, ndim=2] out,             # <<<<<<<<<<<<<<
 *               ndarray[int64_t] counts,
 *               ndarray[float32_t, ndim=2] values,
 */

  /* function exit code */
  __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_12);
  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
    __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_counts.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_labels.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_sumx.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas.algos.group_add_float32", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_counts.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_labels.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_sumx.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer);
  __pyx_L2:;
  __Pyx_XDECREF((PyObject *)__pyx_v_sumx);
  __Pyx_XDECREF((PyObject *)__pyx_v_nobs);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/src/generated.pyx":5198
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def group_add_bin_float64(ndarray[float64_t, ndim=2] out,             # <<<<<<<<<<<<<<
 *                   ndarray[int64_t] counts,
 *                   ndarray[float64_t, ndim=2] values,
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pandas_5algos_407group_add_bin_float64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6pandas_5algos_406group_add_bin_float64[] = "\n    Only aggregates on axis=0\n    ";
static PyMethodDef __pyx_mdef_6pandas_5algos_407group_add_bin_float64 = {__Pyx_NAMESTR("group_add_bin_float64"), (PyCFunction)__pyx_pw_6pandas_5algos_407group_add_bin_float64, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6pandas_5algos_406group_add_bin_float64)};
static PyObject *__pyx_pw_6pandas_5algos_407group_add_bin_float64(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;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("group_add_bin_float64 (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_out,&__pyx_n_s_counts,&__pyx_n_s_values,&__pyx_n_s_bins,0};
    PyObject* values[4] = {0,0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_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 (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_out)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_counts)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("group_add_bin_float64", 1, 4, 4, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5198; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("group_add_bin_float64", 1, 4, 4, 2); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5198; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  3:
        if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_bins)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("group_add_bin_float64", 1, 4, 4, 3); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5198; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "group_add_bin_float64") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5198; __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_float64", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5198; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas.algos.group_add_bin_float64", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_out), __pyx_ptype_5numpy_ndarray, 1, "out", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5198; __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[2]; __pyx_lineno = 5199; __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[2]; __pyx_lineno = 5200; __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[2]; __pyx_lineno = 5201; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_406group_add_bin_float64(__pyx_self, __pyx_v_out, __pyx_v_counts, __pyx_v_values, __pyx_v_bins);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pandas_5algos_406group_add_bin_float64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_out, PyArrayObject *__pyx_v_counts, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_bins) {
  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;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_bins;
  __Pyx_Buffer __pyx_pybuffer_bins;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_counts;
  __Pyx_Buffer __pyx_pybuffer_counts;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_nobs;
  __Pyx_Buffer __pyx_pybuffer_nobs;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_out;
  __Pyx_Buffer __pyx_pybuffer_out;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_sumx;
  __Pyx_Buffer __pyx_pybuffer_sumx;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_values;
  __Pyx_Buffer __pyx_pybuffer_values;
  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;
  __Pyx_RefNannySetupContext("group_add_bin_float64", 0);
  __pyx_pybuffer_sumx.pybuffer.buf = NULL;
  __pyx_pybuffer_sumx.refcount = 0;
  __pyx_pybuffernd_sumx.data = NULL;
  __pyx_pybuffernd_sumx.rcbuffer = &__pyx_pybuffer_sumx;
  __pyx_pybuffer_nobs.pybuffer.buf = NULL;
  __pyx_pybuffer_nobs.refcount = 0;
  __pyx_pybuffernd_nobs.data = NULL;
  __pyx_pybuffernd_nobs.rcbuffer = &__pyx_pybuffer_nobs;
  __pyx_pybuffer_out.pybuffer.buf = NULL;
  __pyx_pybuffer_out.refcount = 0;
  __pyx_pybuffernd_out.data = NULL;
  __pyx_pybuffernd_out.rcbuffer = &__pyx_pybuffer_out;
  __pyx_pybuffer_counts.pybuffer.buf = NULL;
  __pyx_pybuffer_counts.refcount = 0;
  __pyx_pybuffernd_counts.data = NULL;
  __pyx_pybuffernd_counts.rcbuffer = &__pyx_pybuffer_counts;
  __pyx_pybuffer_values.pybuffer.buf = NULL;
  __pyx_pybuffer_values.refcount = 0;
  __pyx_pybuffernd_values.data = NULL;
  __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values;
  __pyx_pybuffer_bins.pybuffer.buf = NULL;
  __pyx_pybuffer_bins.refcount = 0;
  __pyx_pybuffernd_bins.data = NULL;
  __pyx_pybuffernd_bins.rcbuffer = &__pyx_pybuffer_bins;
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_out.rcbuffer->pybuffer, (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[2]; __pyx_lineno = 5198; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_out.diminfo[0].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_out.diminfo[0].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_out.diminfo[1].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_out.diminfo[1].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[1];
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_counts.rcbuffer->pybuffer, (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[2]; __pyx_lineno = 5198; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_counts.diminfo[0].strides = __pyx_pybuffernd_counts.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_counts.diminfo[0].shape = __pyx_pybuffernd_counts.rcbuffer->pybuffer.shape[0];
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (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[2]; __pyx_lineno = 5198; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_values.diminfo[1].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_values.diminfo[1].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[1];
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_bins.rcbuffer->pybuffer, (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[2]; __pyx_lineno = 5198; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_bins.diminfo[0].strides = __pyx_pybuffernd_bins.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_bins.diminfo[0].shape = __pyx_pybuffernd_bins.rcbuffer->pybuffer.shape[0];

  /* "pandas/src/generated.pyx":5210
 *         ndarray[float64_t, ndim=2] sumx, nobs
 * 
 *     nobs = np.zeros_like(out)             # <<<<<<<<<<<<<<
 *     sumx = np.zeros_like(out)
 * 
 */
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5210; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros_like); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5210; __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[2]; __pyx_lineno = 5210; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__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 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5210; __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 (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5210; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_4 = ((PyArrayObject *)__pyx_t_3);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer);
    __pyx_t_5 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer, (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_pybuffernd_nobs.rcbuffer->pybuffer, (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_pybuffernd_nobs.diminfo[0].strides = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_nobs.diminfo[0].shape = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_nobs.diminfo[1].strides = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_nobs.diminfo[1].shape = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.shape[1];
    if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5210; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_4 = 0;
  __pyx_v_nobs = ((PyArrayObject *)__pyx_t_3);
  __pyx_t_3 = 0;

  /* "pandas/src/generated.pyx":5211
 * 
 *     nobs = np.zeros_like(out)
 *     sumx = np.zeros_like(out)             # <<<<<<<<<<<<<<
 * 
 *     if bins[len(bins) - 1] == len(values):
 */
  __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5211; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_zeros_like); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5211; __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[2]; __pyx_lineno = 5211; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__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 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5211; __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;
  if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5211; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_4 = ((PyArrayObject *)__pyx_t_2);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_sumx.rcbuffer->pybuffer);
    __pyx_t_5 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_sumx.rcbuffer->pybuffer, (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_pybuffernd_sumx.rcbuffer->pybuffer, (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_pybuffernd_sumx.diminfo[0].strides = __pyx_pybuffernd_sumx.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_sumx.diminfo[0].shape = __pyx_pybuffernd_sumx.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_sumx.diminfo[1].strides = __pyx_pybuffernd_sumx.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_sumx.diminfo[1].shape = __pyx_pybuffernd_sumx.rcbuffer->pybuffer.shape[1];
    if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5211; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_4 = 0;
  __pyx_v_sumx = ((PyArrayObject *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "pandas/src/generated.pyx":5213
 *     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[2]; __pyx_lineno = 5213; __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[2]; __pyx_lineno = 5213; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_12 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_bins.rcbuffer->pybuffer.buf, __pyx_t_10, __pyx_pybuffernd_bins.diminfo[0].strides)) == __pyx_t_11) != 0);
  if (__pyx_t_12) {

    /* "pandas/src/generated.pyx":5214
 * 
 *     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[2]; __pyx_lineno = 5214; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_v_ngroups = __pyx_t_11;
    goto __pyx_L3;
  }
  /*else*/ {

    /* "pandas/src/generated.pyx":5216
 *         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[2]; __pyx_lineno = 5216; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_v_ngroups = (__pyx_t_11 + 1);
  }
  __pyx_L3:;

  /* "pandas/src/generated.pyx":5217
 *     else:
 *         ngroups = len(bins) + 1
 *     N, K = (<object> values).shape             # <<<<<<<<<<<<<<
 * 
 *     b = 0
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_values), __pyx_n_s_shape); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5217; __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 CYTHON_COMPILING_IN_CPYTHON
    Py_ssize_t size = Py_SIZE(sequence);
    #else
    Py_ssize_t size = PySequence_Size(sequence);
    #endif
    if (unlikely(size != 2)) {
      if (size > 2) __Pyx_RaiseTooManyValuesError(2);
      else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
      {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5217; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    #if CYTHON_COMPILING_IN_CPYTHON
    if (likely(PyTuple_CheckExact(sequence))) {
      __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0); 
      __pyx_t_1 = PyTuple_GET_ITEM(sequence, 1); 
    } else {
      __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);
    #else
    __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5217; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_1 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5217; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    #endif
    __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[2]; __pyx_lineno = 5217; __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_L4_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_L4_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_1);
    if (__Pyx_IternextUnpackEndCheck(__pyx_t_14(__pyx_t_13), 2) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5217; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_14 = NULL;
    __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
    goto __pyx_L5_unpacking_done;
    __pyx_L4_unpacking_failed:;
    __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
    __pyx_t_14 = NULL;
    if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
    {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5217; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_L5_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[2]; __pyx_lineno = 5217; __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[2]; __pyx_lineno = 5217; __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;

  /* "pandas/src/generated.pyx":5219
 *     N, K = (<object> values).shape
 * 
 *     b = 0             # <<<<<<<<<<<<<<
 *     if K > 1:
 *         for i in range(N):
 */
  __pyx_v_b = 0;

  /* "pandas/src/generated.pyx":5220
 * 
 *     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) != 0);
  if (__pyx_t_12) {

    /* "pandas/src/generated.pyx":5221
 *     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;

      /* "pandas/src/generated.pyx":5222
 *     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)) != 0);
        if (__pyx_t_12) {
          __pyx_t_15 = __pyx_v_b;
          __pyx_t_16 = ((__pyx_v_i >= (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_bins.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_bins.diminfo[0].strides))) != 0);
          __pyx_t_17 = __pyx_t_16;
        } else {
          __pyx_t_17 = __pyx_t_12;
        }
        if (!__pyx_t_17) break;

        /* "pandas/src/generated.pyx":5223
 *         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);
      }

      /* "pandas/src/generated.pyx":5225
 *                 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_pybuffernd_counts.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_counts.diminfo[0].strides) += 1;

      /* "pandas/src/generated.pyx":5226
 * 
 *             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;

        /* "pandas/src/generated.pyx":5227
 *             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_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_values.diminfo[0].strides, __pyx_t_22, __pyx_pybuffernd_values.diminfo[1].strides));

        /* "pandas/src/generated.pyx":5230
 * 
 *                 # not nan
 *                 if val == val:             # <<<<<<<<<<<<<<
 *                     nobs[b, j] += 1
 *                     sumx[b, j] += val
 */
        __pyx_t_17 = ((__pyx_v_val == __pyx_v_val) != 0);
        if (__pyx_t_17) {

          /* "pandas/src/generated.pyx":5231
 *                 # 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_pybuffernd_nobs.rcbuffer->pybuffer.buf, __pyx_t_23, __pyx_pybuffernd_nobs.diminfo[0].strides, __pyx_t_24, __pyx_pybuffernd_nobs.diminfo[1].strides) += 1.0;

          /* "pandas/src/generated.pyx":5232
 *                 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_pybuffernd_sumx.rcbuffer->pybuffer.buf, __pyx_t_25, __pyx_pybuffernd_sumx.diminfo[0].strides, __pyx_t_26, __pyx_pybuffernd_sumx.diminfo[1].strides) += __pyx_v_val;
          goto __pyx_L13;
        }
        __pyx_L13:;
      }
    }
    goto __pyx_L6;
  }
  /*else*/ {

    /* "pandas/src/generated.pyx":5234
 *                     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;

      /* "pandas/src/generated.pyx":5235
 *     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)) != 0);
        if (__pyx_t_17) {
          __pyx_t_19 = __pyx_v_b;
          __pyx_t_12 = ((__pyx_v_i >= (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_bins.rcbuffer->pybuffer.buf, __pyx_t_19, __pyx_pybuffernd_bins.diminfo[0].strides))) != 0);
          __pyx_t_16 = __pyx_t_12;
        } else {
          __pyx_t_16 = __pyx_t_17;
        }
        if (!__pyx_t_16) break;

        /* "pandas/src/generated.pyx":5236
 *         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);
      }

      /* "pandas/src/generated.pyx":5238
 *                 b += 1
 * 
 *             counts[b] += 1             # <<<<<<<<<<<<<<
 *             val = values[i, 0]
 * 
 */
      __pyx_t_20 = __pyx_v_b;
      *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_counts.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_counts.diminfo[0].strides) += 1;

      /* "pandas/src/generated.pyx":5239
 * 
 *             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_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_27, __pyx_pybuffernd_values.diminfo[0].strides, __pyx_t_28, __pyx_pybuffernd_values.diminfo[1].strides));

      /* "pandas/src/generated.pyx":5242
 * 
 *             # not nan
 *             if val == val:             # <<<<<<<<<<<<<<
 *                 nobs[b, 0] += 1
 *                 sumx[b, 0] += val
 */
      __pyx_t_16 = ((__pyx_v_val == __pyx_v_val) != 0);
      if (__pyx_t_16) {

        /* "pandas/src/generated.pyx":5243
 *             # 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_pybuffernd_nobs.rcbuffer->pybuffer.buf, __pyx_t_29, __pyx_pybuffernd_nobs.diminfo[0].strides, __pyx_t_30, __pyx_pybuffernd_nobs.diminfo[1].strides) += 1.0;

        /* "pandas/src/generated.pyx":5244
 *             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_pybuffernd_sumx.rcbuffer->pybuffer.buf, __pyx_t_31, __pyx_pybuffernd_sumx.diminfo[0].strides, __pyx_t_32, __pyx_pybuffernd_sumx.diminfo[1].strides) += __pyx_v_val;
        goto __pyx_L18;
      }
      __pyx_L18:;
    }
  }
  __pyx_L6:;

  /* "pandas/src/generated.pyx":5246
 *                 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;

    /* "pandas/src/generated.pyx":5247
 * 
 *     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;

      /* "pandas/src/generated.pyx":5248
 *     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_pybuffernd_nobs.rcbuffer->pybuffer.buf, __pyx_t_35, __pyx_pybuffernd_nobs.diminfo[0].strides, __pyx_t_36, __pyx_pybuffernd_nobs.diminfo[1].strides)) == 0.0) != 0);
      if (__pyx_t_16) {

        /* "pandas/src/generated.pyx":5249
 *         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_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_37, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_38, __pyx_pybuffernd_out.diminfo[1].strides) = __pyx_v_6pandas_5algos_nan;
        goto __pyx_L23;
      }
      /*else*/ {

        /* "pandas/src/generated.pyx":5251
 *                 out[i, j] = nan
 *             else:
 *                 out[i, j] = sumx[i, j]             # <<<<<<<<<<<<<<
 * @cython.boundscheck(False)
 * @cython.wraparound(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_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_41, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_42, __pyx_pybuffernd_out.diminfo[1].strides) = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_sumx.rcbuffer->pybuffer.buf, __pyx_t_39, __pyx_pybuffernd_sumx.diminfo[0].strides, __pyx_t_40, __pyx_pybuffernd_sumx.diminfo[1].strides));
      }
      __pyx_L23:;
    }
  }

  /* "pandas/src/generated.pyx":5198
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def group_add_bin_float64(ndarray[float64_t, ndim=2] out,             # <<<<<<<<<<<<<<
 *                   ndarray[int64_t] counts,
 *                   ndarray[float64_t, ndim=2] values,
 */

  /* function exit code */
  __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_pybuffernd_bins.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_counts.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_sumx.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas.algos.group_add_bin_float64", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_bins.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_counts.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_sumx.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer);
  __pyx_L2:;
  __Pyx_XDECREF((PyObject *)__pyx_v_sumx);
  __Pyx_XDECREF((PyObject *)__pyx_v_nobs);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/src/generated.pyx":5254
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def group_add_bin_float32(ndarray[float32_t, ndim=2] out,             # <<<<<<<<<<<<<<
 *                   ndarray[int64_t] counts,
 *                   ndarray[float32_t, ndim=2] values,
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pandas_5algos_409group_add_bin_float32(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6pandas_5algos_408group_add_bin_float32[] = "\n    Only aggregates on axis=0\n    ";
static PyMethodDef __pyx_mdef_6pandas_5algos_409group_add_bin_float32 = {__Pyx_NAMESTR("group_add_bin_float32"), (PyCFunction)__pyx_pw_6pandas_5algos_409group_add_bin_float32, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6pandas_5algos_408group_add_bin_float32)};
static PyObject *__pyx_pw_6pandas_5algos_409group_add_bin_float32(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;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("group_add_bin_float32 (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_out,&__pyx_n_s_counts,&__pyx_n_s_values,&__pyx_n_s_bins,0};
    PyObject* values[4] = {0,0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_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 (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_out)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_counts)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("group_add_bin_float32", 1, 4, 4, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5254; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("group_add_bin_float32", 1, 4, 4, 2); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5254; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  3:
        if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_bins)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("group_add_bin_float32", 1, 4, 4, 3); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5254; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "group_add_bin_float32") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5254; __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_float32", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5254; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas.algos.group_add_bin_float32", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_out), __pyx_ptype_5numpy_ndarray, 1, "out", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5254; __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[2]; __pyx_lineno = 5255; __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[2]; __pyx_lineno = 5256; __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[2]; __pyx_lineno = 5257; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_408group_add_bin_float32(__pyx_self, __pyx_v_out, __pyx_v_counts, __pyx_v_values, __pyx_v_bins);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pandas_5algos_408group_add_bin_float32(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_out, PyArrayObject *__pyx_v_counts, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_bins) {
  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_float32_t __pyx_v_val;
  PyArrayObject *__pyx_v_sumx = 0;
  PyArrayObject *__pyx_v_nobs = 0;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_bins;
  __Pyx_Buffer __pyx_pybuffer_bins;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_counts;
  __Pyx_Buffer __pyx_pybuffer_counts;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_nobs;
  __Pyx_Buffer __pyx_pybuffer_nobs;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_out;
  __Pyx_Buffer __pyx_pybuffer_out;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_sumx;
  __Pyx_Buffer __pyx_pybuffer_sumx;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_values;
  __Pyx_Buffer __pyx_pybuffer_values;
  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;
  __Pyx_RefNannySetupContext("group_add_bin_float32", 0);
  __pyx_pybuffer_sumx.pybuffer.buf = NULL;
  __pyx_pybuffer_sumx.refcount = 0;
  __pyx_pybuffernd_sumx.data = NULL;
  __pyx_pybuffernd_sumx.rcbuffer = &__pyx_pybuffer_sumx;
  __pyx_pybuffer_nobs.pybuffer.buf = NULL;
  __pyx_pybuffer_nobs.refcount = 0;
  __pyx_pybuffernd_nobs.data = NULL;
  __pyx_pybuffernd_nobs.rcbuffer = &__pyx_pybuffer_nobs;
  __pyx_pybuffer_out.pybuffer.buf = NULL;
  __pyx_pybuffer_out.refcount = 0;
  __pyx_pybuffernd_out.data = NULL;
  __pyx_pybuffernd_out.rcbuffer = &__pyx_pybuffer_out;
  __pyx_pybuffer_counts.pybuffer.buf = NULL;
  __pyx_pybuffer_counts.refcount = 0;
  __pyx_pybuffernd_counts.data = NULL;
  __pyx_pybuffernd_counts.rcbuffer = &__pyx_pybuffer_counts;
  __pyx_pybuffer_values.pybuffer.buf = NULL;
  __pyx_pybuffer_values.refcount = 0;
  __pyx_pybuffernd_values.data = NULL;
  __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values;
  __pyx_pybuffer_bins.pybuffer.buf = NULL;
  __pyx_pybuffer_bins.refcount = 0;
  __pyx_pybuffernd_bins.data = NULL;
  __pyx_pybuffernd_bins.rcbuffer = &__pyx_pybuffer_bins;
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_out.rcbuffer->pybuffer, (PyObject*)__pyx_v_out, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5254; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_out.diminfo[0].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_out.diminfo[0].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_out.diminfo[1].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_out.diminfo[1].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[1];
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_counts.rcbuffer->pybuffer, (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[2]; __pyx_lineno = 5254; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_counts.diminfo[0].strides = __pyx_pybuffernd_counts.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_counts.diminfo[0].shape = __pyx_pybuffernd_counts.rcbuffer->pybuffer.shape[0];
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5254; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_values.diminfo[1].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_values.diminfo[1].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[1];
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_bins.rcbuffer->pybuffer, (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[2]; __pyx_lineno = 5254; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_bins.diminfo[0].strides = __pyx_pybuffernd_bins.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_bins.diminfo[0].shape = __pyx_pybuffernd_bins.rcbuffer->pybuffer.shape[0];

  /* "pandas/src/generated.pyx":5266
 *         ndarray[float32_t, ndim=2] sumx, nobs
 * 
 *     nobs = np.zeros_like(out)             # <<<<<<<<<<<<<<
 *     sumx = np.zeros_like(out)
 * 
 */
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5266; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros_like); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5266; __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[2]; __pyx_lineno = 5266; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__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 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5266; __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 (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5266; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_4 = ((PyArrayObject *)__pyx_t_3);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer);
    __pyx_t_5 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer, (PyObject*)__pyx_t_4, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_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_pybuffernd_nobs.rcbuffer->pybuffer, (PyObject*)__pyx_v_nobs, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_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_pybuffernd_nobs.diminfo[0].strides = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_nobs.diminfo[0].shape = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_nobs.diminfo[1].strides = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_nobs.diminfo[1].shape = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.shape[1];
    if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5266; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_4 = 0;
  __pyx_v_nobs = ((PyArrayObject *)__pyx_t_3);
  __pyx_t_3 = 0;

  /* "pandas/src/generated.pyx":5267
 * 
 *     nobs = np.zeros_like(out)
 *     sumx = np.zeros_like(out)             # <<<<<<<<<<<<<<
 * 
 *     if bins[len(bins) - 1] == len(values):
 */
  __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5267; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_zeros_like); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5267; __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[2]; __pyx_lineno = 5267; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__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 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5267; __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;
  if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5267; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_4 = ((PyArrayObject *)__pyx_t_2);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_sumx.rcbuffer->pybuffer);
    __pyx_t_5 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_sumx.rcbuffer->pybuffer, (PyObject*)__pyx_t_4, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_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_pybuffernd_sumx.rcbuffer->pybuffer, (PyObject*)__pyx_v_sumx, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_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_pybuffernd_sumx.diminfo[0].strides = __pyx_pybuffernd_sumx.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_sumx.diminfo[0].shape = __pyx_pybuffernd_sumx.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_sumx.diminfo[1].strides = __pyx_pybuffernd_sumx.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_sumx.diminfo[1].shape = __pyx_pybuffernd_sumx.rcbuffer->pybuffer.shape[1];
    if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5267; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_4 = 0;
  __pyx_v_sumx = ((PyArrayObject *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "pandas/src/generated.pyx":5269
 *     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[2]; __pyx_lineno = 5269; __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[2]; __pyx_lineno = 5269; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_12 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_bins.rcbuffer->pybuffer.buf, __pyx_t_10, __pyx_pybuffernd_bins.diminfo[0].strides)) == __pyx_t_11) != 0);
  if (__pyx_t_12) {

    /* "pandas/src/generated.pyx":5270
 * 
 *     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[2]; __pyx_lineno = 5270; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_v_ngroups = __pyx_t_11;
    goto __pyx_L3;
  }
  /*else*/ {

    /* "pandas/src/generated.pyx":5272
 *         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[2]; __pyx_lineno = 5272; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_v_ngroups = (__pyx_t_11 + 1);
  }
  __pyx_L3:;

  /* "pandas/src/generated.pyx":5273
 *     else:
 *         ngroups = len(bins) + 1
 *     N, K = (<object> values).shape             # <<<<<<<<<<<<<<
 * 
 *     b = 0
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_values), __pyx_n_s_shape); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5273; __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 CYTHON_COMPILING_IN_CPYTHON
    Py_ssize_t size = Py_SIZE(sequence);
    #else
    Py_ssize_t size = PySequence_Size(sequence);
    #endif
    if (unlikely(size != 2)) {
      if (size > 2) __Pyx_RaiseTooManyValuesError(2);
      else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
      {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5273; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    #if CYTHON_COMPILING_IN_CPYTHON
    if (likely(PyTuple_CheckExact(sequence))) {
      __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0); 
      __pyx_t_1 = PyTuple_GET_ITEM(sequence, 1); 
    } else {
      __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);
    #else
    __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5273; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_1 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5273; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    #endif
    __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[2]; __pyx_lineno = 5273; __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_L4_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_L4_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_1);
    if (__Pyx_IternextUnpackEndCheck(__pyx_t_14(__pyx_t_13), 2) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5273; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_14 = NULL;
    __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
    goto __pyx_L5_unpacking_done;
    __pyx_L4_unpacking_failed:;
    __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
    __pyx_t_14 = NULL;
    if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
    {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5273; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_L5_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[2]; __pyx_lineno = 5273; __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[2]; __pyx_lineno = 5273; __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;

  /* "pandas/src/generated.pyx":5275
 *     N, K = (<object> values).shape
 * 
 *     b = 0             # <<<<<<<<<<<<<<
 *     if K > 1:
 *         for i in range(N):
 */
  __pyx_v_b = 0;

  /* "pandas/src/generated.pyx":5276
 * 
 *     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) != 0);
  if (__pyx_t_12) {

    /* "pandas/src/generated.pyx":5277
 *     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;

      /* "pandas/src/generated.pyx":5278
 *     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)) != 0);
        if (__pyx_t_12) {
          __pyx_t_15 = __pyx_v_b;
          __pyx_t_16 = ((__pyx_v_i >= (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_bins.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_bins.diminfo[0].strides))) != 0);
          __pyx_t_17 = __pyx_t_16;
        } else {
          __pyx_t_17 = __pyx_t_12;
        }
        if (!__pyx_t_17) break;

        /* "pandas/src/generated.pyx":5279
 *         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);
      }

      /* "pandas/src/generated.pyx":5281
 *                 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_pybuffernd_counts.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_counts.diminfo[0].strides) += 1;

      /* "pandas/src/generated.pyx":5282
 * 
 *             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;

        /* "pandas/src/generated.pyx":5283
 *             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_float32_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_values.diminfo[0].strides, __pyx_t_22, __pyx_pybuffernd_values.diminfo[1].strides));

        /* "pandas/src/generated.pyx":5286
 * 
 *                 # not nan
 *                 if val == val:             # <<<<<<<<<<<<<<
 *                     nobs[b, j] += 1
 *                     sumx[b, j] += val
 */
        __pyx_t_17 = ((__pyx_v_val == __pyx_v_val) != 0);
        if (__pyx_t_17) {

          /* "pandas/src/generated.pyx":5287
 *                 # 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_float32_t *, __pyx_pybuffernd_nobs.rcbuffer->pybuffer.buf, __pyx_t_23, __pyx_pybuffernd_nobs.diminfo[0].strides, __pyx_t_24, __pyx_pybuffernd_nobs.diminfo[1].strides) += 1.0;

          /* "pandas/src/generated.pyx":5288
 *                 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_float32_t *, __pyx_pybuffernd_sumx.rcbuffer->pybuffer.buf, __pyx_t_25, __pyx_pybuffernd_sumx.diminfo[0].strides, __pyx_t_26, __pyx_pybuffernd_sumx.diminfo[1].strides) += __pyx_v_val;
          goto __pyx_L13;
        }
        __pyx_L13:;
      }
    }
    goto __pyx_L6;
  }
  /*else*/ {

    /* "pandas/src/generated.pyx":5290
 *                     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;

      /* "pandas/src/generated.pyx":5291
 *     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)) != 0);
        if (__pyx_t_17) {
          __pyx_t_19 = __pyx_v_b;
          __pyx_t_12 = ((__pyx_v_i >= (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_bins.rcbuffer->pybuffer.buf, __pyx_t_19, __pyx_pybuffernd_bins.diminfo[0].strides))) != 0);
          __pyx_t_16 = __pyx_t_12;
        } else {
          __pyx_t_16 = __pyx_t_17;
        }
        if (!__pyx_t_16) break;

        /* "pandas/src/generated.pyx":5292
 *         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);
      }

      /* "pandas/src/generated.pyx":5294
 *                 b += 1
 * 
 *             counts[b] += 1             # <<<<<<<<<<<<<<
 *             val = values[i, 0]
 * 
 */
      __pyx_t_20 = __pyx_v_b;
      *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_counts.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_counts.diminfo[0].strides) += 1;

      /* "pandas/src/generated.pyx":5295
 * 
 *             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_float32_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_27, __pyx_pybuffernd_values.diminfo[0].strides, __pyx_t_28, __pyx_pybuffernd_values.diminfo[1].strides));

      /* "pandas/src/generated.pyx":5298
 * 
 *             # not nan
 *             if val == val:             # <<<<<<<<<<<<<<
 *                 nobs[b, 0] += 1
 *                 sumx[b, 0] += val
 */
      __pyx_t_16 = ((__pyx_v_val == __pyx_v_val) != 0);
      if (__pyx_t_16) {

        /* "pandas/src/generated.pyx":5299
 *             # 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_float32_t *, __pyx_pybuffernd_nobs.rcbuffer->pybuffer.buf, __pyx_t_29, __pyx_pybuffernd_nobs.diminfo[0].strides, __pyx_t_30, __pyx_pybuffernd_nobs.diminfo[1].strides) += 1.0;

        /* "pandas/src/generated.pyx":5300
 *             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_float32_t *, __pyx_pybuffernd_sumx.rcbuffer->pybuffer.buf, __pyx_t_31, __pyx_pybuffernd_sumx.diminfo[0].strides, __pyx_t_32, __pyx_pybuffernd_sumx.diminfo[1].strides) += __pyx_v_val;
        goto __pyx_L18;
      }
      __pyx_L18:;
    }
  }
  __pyx_L6:;

  /* "pandas/src/generated.pyx":5302
 *                 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;

    /* "pandas/src/generated.pyx":5303
 * 
 *     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;

      /* "pandas/src/generated.pyx":5304
 *     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_float32_t *, __pyx_pybuffernd_nobs.rcbuffer->pybuffer.buf, __pyx_t_35, __pyx_pybuffernd_nobs.diminfo[0].strides, __pyx_t_36, __pyx_pybuffernd_nobs.diminfo[1].strides)) == 0.0) != 0);
      if (__pyx_t_16) {

        /* "pandas/src/generated.pyx":5305
 *         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_float32_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_37, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_38, __pyx_pybuffernd_out.diminfo[1].strides) = __pyx_v_6pandas_5algos_nan;
        goto __pyx_L23;
      }
      /*else*/ {

        /* "pandas/src/generated.pyx":5307
 *                 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_float32_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_41, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_42, __pyx_pybuffernd_out.diminfo[1].strides) = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_sumx.rcbuffer->pybuffer.buf, __pyx_t_39, __pyx_pybuffernd_sumx.diminfo[0].strides, __pyx_t_40, __pyx_pybuffernd_sumx.diminfo[1].strides));
      }
      __pyx_L23:;
    }
  }

  /* "pandas/src/generated.pyx":5254
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def group_add_bin_float32(ndarray[float32_t, ndim=2] out,             # <<<<<<<<<<<<<<
 *                   ndarray[int64_t] counts,
 *                   ndarray[float32_t, ndim=2] values,
 */

  /* function exit code */
  __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_pybuffernd_bins.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_counts.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_sumx.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas.algos.group_add_bin_float32", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_bins.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_counts.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_sumx.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer);
  __pyx_L2:;
  __Pyx_XDECREF((PyObject *)__pyx_v_sumx);
  __Pyx_XDECREF((PyObject *)__pyx_v_nobs);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/src/generated.pyx":5311
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def group_prod_float64(ndarray[float64_t, ndim=2] out,             # <<<<<<<<<<<<<<
 *                ndarray[int64_t] counts,
 *                ndarray[float64_t, ndim=2] values,
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pandas_5algos_411group_prod_float64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6pandas_5algos_410group_prod_float64[] = "\n    Only aggregates on axis=0\n    ";
static PyMethodDef __pyx_mdef_6pandas_5algos_411group_prod_float64 = {__Pyx_NAMESTR("group_prod_float64"), (PyCFunction)__pyx_pw_6pandas_5algos_411group_prod_float64, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6pandas_5algos_410group_prod_float64)};
static PyObject *__pyx_pw_6pandas_5algos_411group_prod_float64(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;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("group_prod_float64 (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_out,&__pyx_n_s_counts,&__pyx_n_s_values,&__pyx_n_s_labels,0};
    PyObject* values[4] = {0,0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_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 (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_out)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_counts)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("group_prod_float64", 1, 4, 4, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5311; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("group_prod_float64", 1, 4, 4, 2); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5311; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  3:
        if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_labels)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("group_prod_float64", 1, 4, 4, 3); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5311; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "group_prod_float64") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5311; __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_float64", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5311; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas.algos.group_prod_float64", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_out), __pyx_ptype_5numpy_ndarray, 1, "out", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5311; __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[2]; __pyx_lineno = 5312; __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[2]; __pyx_lineno = 5313; __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[2]; __pyx_lineno = 5314; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_410group_prod_float64(__pyx_self, __pyx_v_out, __pyx_v_counts, __pyx_v_values, __pyx_v_labels);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pandas_5algos_410group_prod_float64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_out, PyArrayObject *__pyx_v_counts, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_labels) {
  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;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_counts;
  __Pyx_Buffer __pyx_pybuffer_counts;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_labels;
  __Pyx_Buffer __pyx_pybuffer_labels;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_nobs;
  __Pyx_Buffer __pyx_pybuffer_nobs;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_out;
  __Pyx_Buffer __pyx_pybuffer_out;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_prodx;
  __Pyx_Buffer __pyx_pybuffer_prodx;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_values;
  __Pyx_Buffer __pyx_pybuffer_values;
  PyObject *__pyx_r = NULL;
  __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;
  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;
  PyObject *__pyx_t_12 = NULL;
  PyObject *(*__pyx_t_13)(PyObject *);
  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;
  __Pyx_RefNannySetupContext("group_prod_float64", 0);
  __pyx_pybuffer_prodx.pybuffer.buf = NULL;
  __pyx_pybuffer_prodx.refcount = 0;
  __pyx_pybuffernd_prodx.data = NULL;
  __pyx_pybuffernd_prodx.rcbuffer = &__pyx_pybuffer_prodx;
  __pyx_pybuffer_nobs.pybuffer.buf = NULL;
  __pyx_pybuffer_nobs.refcount = 0;
  __pyx_pybuffernd_nobs.data = NULL;
  __pyx_pybuffernd_nobs.rcbuffer = &__pyx_pybuffer_nobs;
  __pyx_pybuffer_out.pybuffer.buf = NULL;
  __pyx_pybuffer_out.refcount = 0;
  __pyx_pybuffernd_out.data = NULL;
  __pyx_pybuffernd_out.rcbuffer = &__pyx_pybuffer_out;
  __pyx_pybuffer_counts.pybuffer.buf = NULL;
  __pyx_pybuffer_counts.refcount = 0;
  __pyx_pybuffernd_counts.data = NULL;
  __pyx_pybuffernd_counts.rcbuffer = &__pyx_pybuffer_counts;
  __pyx_pybuffer_values.pybuffer.buf = NULL;
  __pyx_pybuffer_values.refcount = 0;
  __pyx_pybuffernd_values.data = NULL;
  __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values;
  __pyx_pybuffer_labels.pybuffer.buf = NULL;
  __pyx_pybuffer_labels.refcount = 0;
  __pyx_pybuffernd_labels.data = NULL;
  __pyx_pybuffernd_labels.rcbuffer = &__pyx_pybuffer_labels;
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_out.rcbuffer->pybuffer, (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[2]; __pyx_lineno = 5311; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_out.diminfo[0].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_out.diminfo[0].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_out.diminfo[1].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_out.diminfo[1].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[1];
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_counts.rcbuffer->pybuffer, (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[2]; __pyx_lineno = 5311; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_counts.diminfo[0].strides = __pyx_pybuffernd_counts.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_counts.diminfo[0].shape = __pyx_pybuffernd_counts.rcbuffer->pybuffer.shape[0];
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (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[2]; __pyx_lineno = 5311; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_values.diminfo[1].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_values.diminfo[1].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[1];
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_labels.rcbuffer->pybuffer, (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[2]; __pyx_lineno = 5311; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_labels.diminfo[0].strides = __pyx_pybuffernd_labels.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_labels.diminfo[0].shape = __pyx_pybuffernd_labels.rcbuffer->pybuffer.shape[0];

  /* "pandas/src/generated.pyx":5323
 *         ndarray[float64_t, ndim=2] prodx, nobs
 * 
 *     if not len(values) == len(labels):             # <<<<<<<<<<<<<<
 *        raise AssertionError("len(index) != len(labels)")
 * 
 */
  __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_values)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5323; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_2 = PyObject_Length(((PyObject *)__pyx_v_labels)); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5323; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_3 = ((!((__pyx_t_1 == __pyx_t_2) != 0)) != 0);
  if (__pyx_t_3) {

    /* "pandas/src/generated.pyx":5324
 * 
 *     if not len(values) == len(labels):
 *        raise AssertionError("len(index) != len(labels)")             # <<<<<<<<<<<<<<
 * 
 *     nobs = np.zeros_like(out)
 */
    __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_AssertionError, __pyx_tuple__198, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5324; __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[2]; __pyx_lineno = 5324; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }

  /* "pandas/src/generated.pyx":5326
 *        raise AssertionError("len(index) != len(labels)")
 * 
 *     nobs = np.zeros_like(out)             # <<<<<<<<<<<<<<
 *     prodx = np.ones_like(out)
 * 
 */
  __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5326; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_zeros_like); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5326; __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[2]; __pyx_lineno = 5326; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_INCREF(((PyObject *)__pyx_v_out));
  PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_v_out));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_out));
  __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_4, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5326; __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_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[2]; __pyx_lineno = 5326; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_7 = ((PyArrayObject *)__pyx_t_6);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer);
    __pyx_t_8 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer, (PyObject*)__pyx_t_7, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 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_pybuffernd_nobs.rcbuffer->pybuffer, (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_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_pybuffernd_nobs.diminfo[0].strides = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_nobs.diminfo[0].shape = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_nobs.diminfo[1].strides = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_nobs.diminfo[1].shape = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.shape[1];
    if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5326; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_7 = 0;
  __pyx_v_nobs = ((PyArrayObject *)__pyx_t_6);
  __pyx_t_6 = 0;

  /* "pandas/src/generated.pyx":5327
 * 
 *     nobs = np.zeros_like(out)
 *     prodx = np.ones_like(out)             # <<<<<<<<<<<<<<
 * 
 *     N, K = (<object> values).shape
 */
  __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5327; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_ones_like); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5327; __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[2]; __pyx_lineno = 5327; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_INCREF(((PyObject *)__pyx_v_out));
  PyTuple_SET_ITEM(__pyx_t_6, 0, ((PyObject *)__pyx_v_out));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_out));
  __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5327; __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;
  if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5327; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_7 = ((PyArrayObject *)__pyx_t_5);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_prodx.rcbuffer->pybuffer);
    __pyx_t_8 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_prodx.rcbuffer->pybuffer, (PyObject*)__pyx_t_7, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 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_pybuffernd_prodx.rcbuffer->pybuffer, (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_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_pybuffernd_prodx.diminfo[0].strides = __pyx_pybuffernd_prodx.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_prodx.diminfo[0].shape = __pyx_pybuffernd_prodx.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_prodx.diminfo[1].strides = __pyx_pybuffernd_prodx.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_prodx.diminfo[1].shape = __pyx_pybuffernd_prodx.rcbuffer->pybuffer.shape[1];
    if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5327; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_7 = 0;
  __pyx_v_prodx = ((PyArrayObject *)__pyx_t_5);
  __pyx_t_5 = 0;

  /* "pandas/src/generated.pyx":5329
 *     prodx = np.ones_like(out)
 * 
 *     N, K = (<object> values).shape             # <<<<<<<<<<<<<<
 * 
 *     if K > 1:
 */
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_values), __pyx_n_s_shape); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5329; __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 CYTHON_COMPILING_IN_CPYTHON
    Py_ssize_t size = Py_SIZE(sequence);
    #else
    Py_ssize_t size = PySequence_Size(sequence);
    #endif
    if (unlikely(size != 2)) {
      if (size > 2) __Pyx_RaiseTooManyValuesError(2);
      else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
      {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5329; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    #if CYTHON_COMPILING_IN_CPYTHON
    if (likely(PyTuple_CheckExact(sequence))) {
      __pyx_t_6 = PyTuple_GET_ITEM(sequence, 0); 
      __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1); 
    } else {
      __pyx_t_6 = PyList_GET_ITEM(sequence, 0); 
      __pyx_t_4 = PyList_GET_ITEM(sequence, 1); 
    }
    __Pyx_INCREF(__pyx_t_6);
    __Pyx_INCREF(__pyx_t_4);
    #else
    __pyx_t_6 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5329; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5329; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    #endif
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  } else {
    Py_ssize_t index = -1;
    __pyx_t_12 = PyObject_GetIter(__pyx_t_5); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5329; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_12);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_13 = Py_TYPE(__pyx_t_12)->tp_iternext;
    index = 0; __pyx_t_6 = __pyx_t_13(__pyx_t_12); if (unlikely(!__pyx_t_6)) goto __pyx_L4_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_6);
    index = 1; __pyx_t_4 = __pyx_t_13(__pyx_t_12); if (unlikely(!__pyx_t_4)) goto __pyx_L4_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_4);
    if (__Pyx_IternextUnpackEndCheck(__pyx_t_13(__pyx_t_12), 2) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5329; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_13 = NULL;
    __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
    goto __pyx_L5_unpacking_done;
    __pyx_L4_unpacking_failed:;
    __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
    __pyx_t_13 = NULL;
    if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
    {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5329; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_L5_unpacking_done:;
  }
  __pyx_t_2 = __Pyx_PyIndex_AsSsize_t(__pyx_t_6); if (unlikely((__pyx_t_2 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5329; __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_4); if (unlikely((__pyx_t_1 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5329; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_v_N = __pyx_t_2;
  __pyx_v_K = __pyx_t_1;

  /* "pandas/src/generated.pyx":5331
 *     N, K = (<object> values).shape
 * 
 *     if K > 1:             # <<<<<<<<<<<<<<
 *         for i in range(N):
 *             lab = labels[i]
 */
  __pyx_t_3 = ((__pyx_v_K > 1) != 0);
  if (__pyx_t_3) {

    /* "pandas/src/generated.pyx":5332
 * 
 *     if K > 1:
 *         for i in range(N):             # <<<<<<<<<<<<<<
 *             lab = labels[i]
 *             if lab < 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;

      /* "pandas/src/generated.pyx":5333
 *     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_pybuffernd_labels.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_labels.diminfo[0].strides));

      /* "pandas/src/generated.pyx":5334
 *         for i in range(N):
 *             lab = labels[i]
 *             if lab < 0:             # <<<<<<<<<<<<<<
 *                 continue
 * 
 */
      __pyx_t_3 = ((__pyx_v_lab < 0) != 0);
      if (__pyx_t_3) {

        /* "pandas/src/generated.pyx":5335
 *             lab = labels[i]
 *             if lab < 0:
 *                 continue             # <<<<<<<<<<<<<<
 * 
 *             counts[lab] += 1
 */
        goto __pyx_L7_continue;
      }

      /* "pandas/src/generated.pyx":5337
 *                 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_pybuffernd_counts.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_counts.diminfo[0].strides) += 1;

      /* "pandas/src/generated.pyx":5338
 * 
 *             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;

        /* "pandas/src/generated.pyx":5339
 *             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_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_values.diminfo[0].strides, __pyx_t_19, __pyx_pybuffernd_values.diminfo[1].strides));

        /* "pandas/src/generated.pyx":5342
 * 
 *                 # not nan
 *                 if val == val:             # <<<<<<<<<<<<<<
 *                     nobs[lab, j] += 1
 *                     prodx[lab, j] *= val
 */
        __pyx_t_3 = ((__pyx_v_val == __pyx_v_val) != 0);
        if (__pyx_t_3) {

          /* "pandas/src/generated.pyx":5343
 *                 # 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_pybuffernd_nobs.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_nobs.diminfo[0].strides, __pyx_t_21, __pyx_pybuffernd_nobs.diminfo[1].strides) += 1.0;

          /* "pandas/src/generated.pyx":5344
 *                 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_pybuffernd_prodx.rcbuffer->pybuffer.buf, __pyx_t_22, __pyx_pybuffernd_prodx.diminfo[0].strides, __pyx_t_23, __pyx_pybuffernd_prodx.diminfo[1].strides) *= __pyx_v_val;
          goto __pyx_L12;
        }
        __pyx_L12:;
      }
      __pyx_L7_continue:;
    }
    goto __pyx_L6;
  }
  /*else*/ {

    /* "pandas/src/generated.pyx":5346
 *                     prodx[lab, j] *= val
 *     else:
 *         for i in range(N):             # <<<<<<<<<<<<<<
 *             lab = labels[i]
 *             if lab < 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;

      /* "pandas/src/generated.pyx":5347
 *     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_pybuffernd_labels.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_labels.diminfo[0].strides));

      /* "pandas/src/generated.pyx":5348
 *         for i in range(N):
 *             lab = labels[i]
 *             if lab < 0:             # <<<<<<<<<<<<<<
 *                 continue
 * 
 */
      __pyx_t_3 = ((__pyx_v_lab < 0) != 0);
      if (__pyx_t_3) {

        /* "pandas/src/generated.pyx":5349
 *             lab = labels[i]
 *             if lab < 0:
 *                 continue             # <<<<<<<<<<<<<<
 * 
 *             counts[lab] += 1
 */
        goto __pyx_L13_continue;
      }

      /* "pandas/src/generated.pyx":5351
 *                 continue
 * 
 *             counts[lab] += 1             # <<<<<<<<<<<<<<
 *             val = values[i, 0]
 * 
 */
      __pyx_t_17 = __pyx_v_lab;
      *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_counts.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_counts.diminfo[0].strides) += 1;

      /* "pandas/src/generated.pyx":5352
 * 
 *             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_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_24, __pyx_pybuffernd_values.diminfo[0].strides, __pyx_t_25, __pyx_pybuffernd_values.diminfo[1].strides));

      /* "pandas/src/generated.pyx":5355
 * 
 *             # not nan
 *             if val == val:             # <<<<<<<<<<<<<<
 *                 nobs[lab, 0] += 1
 *                 prodx[lab, 0] *= val
 */
      __pyx_t_3 = ((__pyx_v_val == __pyx_v_val) != 0);
      if (__pyx_t_3) {

        /* "pandas/src/generated.pyx":5356
 *             # 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_pybuffernd_nobs.rcbuffer->pybuffer.buf, __pyx_t_26, __pyx_pybuffernd_nobs.diminfo[0].strides, __pyx_t_27, __pyx_pybuffernd_nobs.diminfo[1].strides) += 1.0;

        /* "pandas/src/generated.pyx":5357
 *             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_pybuffernd_prodx.rcbuffer->pybuffer.buf, __pyx_t_28, __pyx_pybuffernd_prodx.diminfo[0].strides, __pyx_t_29, __pyx_pybuffernd_prodx.diminfo[1].strides) *= __pyx_v_val;
        goto __pyx_L16;
      }
      __pyx_L16:;
      __pyx_L13_continue:;
    }
  }
  __pyx_L6:;

  /* "pandas/src/generated.pyx":5359
 *                 prodx[lab, 0] *= val
 * 
 *     for i in range(len(counts)):             # <<<<<<<<<<<<<<
 *         for j in range(K):
 *             if nobs[i, j] == 0:
 */
  __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_counts)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5359; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) {
    __pyx_v_i = __pyx_t_2;

    /* "pandas/src/generated.pyx":5360
 * 
 *     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;

      /* "pandas/src/generated.pyx":5361
 *     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_3 = (((*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_nobs.rcbuffer->pybuffer.buf, __pyx_t_32, __pyx_pybuffernd_nobs.diminfo[0].strides, __pyx_t_33, __pyx_pybuffernd_nobs.diminfo[1].strides)) == 0.0) != 0);
      if (__pyx_t_3) {

        /* "pandas/src/generated.pyx":5362
 *         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_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_34, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_35, __pyx_pybuffernd_out.diminfo[1].strides) = __pyx_v_6pandas_5algos_nan;
        goto __pyx_L21;
      }
      /*else*/ {

        /* "pandas/src/generated.pyx":5364
 *                 out[i, j] = nan
 *             else:
 *                 out[i, j] = prodx[i, j]             # <<<<<<<<<<<<<<
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 */
        __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_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_38, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_39, __pyx_pybuffernd_out.diminfo[1].strides) = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_prodx.rcbuffer->pybuffer.buf, __pyx_t_36, __pyx_pybuffernd_prodx.diminfo[0].strides, __pyx_t_37, __pyx_pybuffernd_prodx.diminfo[1].strides));
      }
      __pyx_L21:;
    }
  }

  /* "pandas/src/generated.pyx":5311
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def group_prod_float64(ndarray[float64_t, ndim=2] out,             # <<<<<<<<<<<<<<
 *                ndarray[int64_t] counts,
 *                ndarray[float64_t, ndim=2] values,
 */

  /* function exit code */
  __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_12);
  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
    __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_counts.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_labels.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_prodx.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas.algos.group_prod_float64", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_counts.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_labels.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_prodx.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer);
  __pyx_L2:;
  __Pyx_XDECREF((PyObject *)__pyx_v_prodx);
  __Pyx_XDECREF((PyObject *)__pyx_v_nobs);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/src/generated.pyx":5367
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def group_prod_float32(ndarray[float32_t, ndim=2] out,             # <<<<<<<<<<<<<<
 *                ndarray[int64_t] counts,
 *                ndarray[float32_t, ndim=2] values,
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pandas_5algos_413group_prod_float32(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6pandas_5algos_412group_prod_float32[] = "\n    Only aggregates on axis=0\n    ";
static PyMethodDef __pyx_mdef_6pandas_5algos_413group_prod_float32 = {__Pyx_NAMESTR("group_prod_float32"), (PyCFunction)__pyx_pw_6pandas_5algos_413group_prod_float32, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6pandas_5algos_412group_prod_float32)};
static PyObject *__pyx_pw_6pandas_5algos_413group_prod_float32(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;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("group_prod_float32 (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_out,&__pyx_n_s_counts,&__pyx_n_s_values,&__pyx_n_s_labels,0};
    PyObject* values[4] = {0,0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_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 (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_out)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_counts)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("group_prod_float32", 1, 4, 4, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5367; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("group_prod_float32", 1, 4, 4, 2); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5367; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  3:
        if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_labels)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("group_prod_float32", 1, 4, 4, 3); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5367; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "group_prod_float32") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5367; __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_float32", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5367; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas.algos.group_prod_float32", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_out), __pyx_ptype_5numpy_ndarray, 1, "out", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5367; __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[2]; __pyx_lineno = 5368; __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[2]; __pyx_lineno = 5369; __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[2]; __pyx_lineno = 5370; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_412group_prod_float32(__pyx_self, __pyx_v_out, __pyx_v_counts, __pyx_v_values, __pyx_v_labels);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pandas_5algos_412group_prod_float32(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_out, PyArrayObject *__pyx_v_counts, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_labels) {
  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_float32_t __pyx_v_val;
  PyArrayObject *__pyx_v_prodx = 0;
  PyArrayObject *__pyx_v_nobs = 0;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_counts;
  __Pyx_Buffer __pyx_pybuffer_counts;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_labels;
  __Pyx_Buffer __pyx_pybuffer_labels;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_nobs;
  __Pyx_Buffer __pyx_pybuffer_nobs;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_out;
  __Pyx_Buffer __pyx_pybuffer_out;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_prodx;
  __Pyx_Buffer __pyx_pybuffer_prodx;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_values;
  __Pyx_Buffer __pyx_pybuffer_values;
  PyObject *__pyx_r = NULL;
  __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;
  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;
  PyObject *__pyx_t_12 = NULL;
  PyObject *(*__pyx_t_13)(PyObject *);
  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;
  __Pyx_RefNannySetupContext("group_prod_float32", 0);
  __pyx_pybuffer_prodx.pybuffer.buf = NULL;
  __pyx_pybuffer_prodx.refcount = 0;
  __pyx_pybuffernd_prodx.data = NULL;
  __pyx_pybuffernd_prodx.rcbuffer = &__pyx_pybuffer_prodx;
  __pyx_pybuffer_nobs.pybuffer.buf = NULL;
  __pyx_pybuffer_nobs.refcount = 0;
  __pyx_pybuffernd_nobs.data = NULL;
  __pyx_pybuffernd_nobs.rcbuffer = &__pyx_pybuffer_nobs;
  __pyx_pybuffer_out.pybuffer.buf = NULL;
  __pyx_pybuffer_out.refcount = 0;
  __pyx_pybuffernd_out.data = NULL;
  __pyx_pybuffernd_out.rcbuffer = &__pyx_pybuffer_out;
  __pyx_pybuffer_counts.pybuffer.buf = NULL;
  __pyx_pybuffer_counts.refcount = 0;
  __pyx_pybuffernd_counts.data = NULL;
  __pyx_pybuffernd_counts.rcbuffer = &__pyx_pybuffer_counts;
  __pyx_pybuffer_values.pybuffer.buf = NULL;
  __pyx_pybuffer_values.refcount = 0;
  __pyx_pybuffernd_values.data = NULL;
  __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values;
  __pyx_pybuffer_labels.pybuffer.buf = NULL;
  __pyx_pybuffer_labels.refcount = 0;
  __pyx_pybuffernd_labels.data = NULL;
  __pyx_pybuffernd_labels.rcbuffer = &__pyx_pybuffer_labels;
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_out.rcbuffer->pybuffer, (PyObject*)__pyx_v_out, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5367; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_out.diminfo[0].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_out.diminfo[0].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_out.diminfo[1].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_out.diminfo[1].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[1];
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_counts.rcbuffer->pybuffer, (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[2]; __pyx_lineno = 5367; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_counts.diminfo[0].strides = __pyx_pybuffernd_counts.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_counts.diminfo[0].shape = __pyx_pybuffernd_counts.rcbuffer->pybuffer.shape[0];
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5367; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_values.diminfo[1].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_values.diminfo[1].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[1];
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_labels.rcbuffer->pybuffer, (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[2]; __pyx_lineno = 5367; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_labels.diminfo[0].strides = __pyx_pybuffernd_labels.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_labels.diminfo[0].shape = __pyx_pybuffernd_labels.rcbuffer->pybuffer.shape[0];

  /* "pandas/src/generated.pyx":5379
 *         ndarray[float32_t, ndim=2] prodx, nobs
 * 
 *     if not len(values) == len(labels):             # <<<<<<<<<<<<<<
 *        raise AssertionError("len(index) != len(labels)")
 * 
 */
  __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_values)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5379; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_2 = PyObject_Length(((PyObject *)__pyx_v_labels)); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5379; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_3 = ((!((__pyx_t_1 == __pyx_t_2) != 0)) != 0);
  if (__pyx_t_3) {

    /* "pandas/src/generated.pyx":5380
 * 
 *     if not len(values) == len(labels):
 *        raise AssertionError("len(index) != len(labels)")             # <<<<<<<<<<<<<<
 * 
 *     nobs = np.zeros_like(out)
 */
    __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_AssertionError, __pyx_tuple__199, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5380; __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[2]; __pyx_lineno = 5380; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }

  /* "pandas/src/generated.pyx":5382
 *        raise AssertionError("len(index) != len(labels)")
 * 
 *     nobs = np.zeros_like(out)             # <<<<<<<<<<<<<<
 *     prodx = np.ones_like(out)
 * 
 */
  __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5382; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_zeros_like); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5382; __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[2]; __pyx_lineno = 5382; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_INCREF(((PyObject *)__pyx_v_out));
  PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_v_out));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_out));
  __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_4, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5382; __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_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[2]; __pyx_lineno = 5382; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_7 = ((PyArrayObject *)__pyx_t_6);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer);
    __pyx_t_8 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer, (PyObject*)__pyx_t_7, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 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_pybuffernd_nobs.rcbuffer->pybuffer, (PyObject*)__pyx_v_nobs, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, 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_pybuffernd_nobs.diminfo[0].strides = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_nobs.diminfo[0].shape = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_nobs.diminfo[1].strides = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_nobs.diminfo[1].shape = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.shape[1];
    if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5382; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_7 = 0;
  __pyx_v_nobs = ((PyArrayObject *)__pyx_t_6);
  __pyx_t_6 = 0;

  /* "pandas/src/generated.pyx":5383
 * 
 *     nobs = np.zeros_like(out)
 *     prodx = np.ones_like(out)             # <<<<<<<<<<<<<<
 * 
 *     N, K = (<object> values).shape
 */
  __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5383; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_ones_like); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5383; __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[2]; __pyx_lineno = 5383; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_INCREF(((PyObject *)__pyx_v_out));
  PyTuple_SET_ITEM(__pyx_t_6, 0, ((PyObject *)__pyx_v_out));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_out));
  __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5383; __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;
  if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5383; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_7 = ((PyArrayObject *)__pyx_t_5);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_prodx.rcbuffer->pybuffer);
    __pyx_t_8 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_prodx.rcbuffer->pybuffer, (PyObject*)__pyx_t_7, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 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_pybuffernd_prodx.rcbuffer->pybuffer, (PyObject*)__pyx_v_prodx, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 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_pybuffernd_prodx.diminfo[0].strides = __pyx_pybuffernd_prodx.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_prodx.diminfo[0].shape = __pyx_pybuffernd_prodx.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_prodx.diminfo[1].strides = __pyx_pybuffernd_prodx.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_prodx.diminfo[1].shape = __pyx_pybuffernd_prodx.rcbuffer->pybuffer.shape[1];
    if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5383; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_7 = 0;
  __pyx_v_prodx = ((PyArrayObject *)__pyx_t_5);
  __pyx_t_5 = 0;

  /* "pandas/src/generated.pyx":5385
 *     prodx = np.ones_like(out)
 * 
 *     N, K = (<object> values).shape             # <<<<<<<<<<<<<<
 * 
 *     if K > 1:
 */
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_values), __pyx_n_s_shape); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5385; __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 CYTHON_COMPILING_IN_CPYTHON
    Py_ssize_t size = Py_SIZE(sequence);
    #else
    Py_ssize_t size = PySequence_Size(sequence);
    #endif
    if (unlikely(size != 2)) {
      if (size > 2) __Pyx_RaiseTooManyValuesError(2);
      else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
      {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5385; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    #if CYTHON_COMPILING_IN_CPYTHON
    if (likely(PyTuple_CheckExact(sequence))) {
      __pyx_t_6 = PyTuple_GET_ITEM(sequence, 0); 
      __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1); 
    } else {
      __pyx_t_6 = PyList_GET_ITEM(sequence, 0); 
      __pyx_t_4 = PyList_GET_ITEM(sequence, 1); 
    }
    __Pyx_INCREF(__pyx_t_6);
    __Pyx_INCREF(__pyx_t_4);
    #else
    __pyx_t_6 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5385; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5385; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    #endif
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  } else {
    Py_ssize_t index = -1;
    __pyx_t_12 = PyObject_GetIter(__pyx_t_5); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5385; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_12);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_13 = Py_TYPE(__pyx_t_12)->tp_iternext;
    index = 0; __pyx_t_6 = __pyx_t_13(__pyx_t_12); if (unlikely(!__pyx_t_6)) goto __pyx_L4_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_6);
    index = 1; __pyx_t_4 = __pyx_t_13(__pyx_t_12); if (unlikely(!__pyx_t_4)) goto __pyx_L4_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_4);
    if (__Pyx_IternextUnpackEndCheck(__pyx_t_13(__pyx_t_12), 2) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5385; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_13 = NULL;
    __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
    goto __pyx_L5_unpacking_done;
    __pyx_L4_unpacking_failed:;
    __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
    __pyx_t_13 = NULL;
    if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
    {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5385; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_L5_unpacking_done:;
  }
  __pyx_t_2 = __Pyx_PyIndex_AsSsize_t(__pyx_t_6); if (unlikely((__pyx_t_2 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5385; __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_4); if (unlikely((__pyx_t_1 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5385; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_v_N = __pyx_t_2;
  __pyx_v_K = __pyx_t_1;

  /* "pandas/src/generated.pyx":5387
 *     N, K = (<object> values).shape
 * 
 *     if K > 1:             # <<<<<<<<<<<<<<
 *         for i in range(N):
 *             lab = labels[i]
 */
  __pyx_t_3 = ((__pyx_v_K > 1) != 0);
  if (__pyx_t_3) {

    /* "pandas/src/generated.pyx":5388
 * 
 *     if K > 1:
 *         for i in range(N):             # <<<<<<<<<<<<<<
 *             lab = labels[i]
 *             if lab < 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;

      /* "pandas/src/generated.pyx":5389
 *     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_pybuffernd_labels.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_labels.diminfo[0].strides));

      /* "pandas/src/generated.pyx":5390
 *         for i in range(N):
 *             lab = labels[i]
 *             if lab < 0:             # <<<<<<<<<<<<<<
 *                 continue
 * 
 */
      __pyx_t_3 = ((__pyx_v_lab < 0) != 0);
      if (__pyx_t_3) {

        /* "pandas/src/generated.pyx":5391
 *             lab = labels[i]
 *             if lab < 0:
 *                 continue             # <<<<<<<<<<<<<<
 * 
 *             counts[lab] += 1
 */
        goto __pyx_L7_continue;
      }

      /* "pandas/src/generated.pyx":5393
 *                 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_pybuffernd_counts.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_counts.diminfo[0].strides) += 1;

      /* "pandas/src/generated.pyx":5394
 * 
 *             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;

        /* "pandas/src/generated.pyx":5395
 *             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_float32_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_values.diminfo[0].strides, __pyx_t_19, __pyx_pybuffernd_values.diminfo[1].strides));

        /* "pandas/src/generated.pyx":5398
 * 
 *                 # not nan
 *                 if val == val:             # <<<<<<<<<<<<<<
 *                     nobs[lab, j] += 1
 *                     prodx[lab, j] *= val
 */
        __pyx_t_3 = ((__pyx_v_val == __pyx_v_val) != 0);
        if (__pyx_t_3) {

          /* "pandas/src/generated.pyx":5399
 *                 # 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_float32_t *, __pyx_pybuffernd_nobs.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_nobs.diminfo[0].strides, __pyx_t_21, __pyx_pybuffernd_nobs.diminfo[1].strides) += 1.0;

          /* "pandas/src/generated.pyx":5400
 *                 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_float32_t *, __pyx_pybuffernd_prodx.rcbuffer->pybuffer.buf, __pyx_t_22, __pyx_pybuffernd_prodx.diminfo[0].strides, __pyx_t_23, __pyx_pybuffernd_prodx.diminfo[1].strides) *= __pyx_v_val;
          goto __pyx_L12;
        }
        __pyx_L12:;
      }
      __pyx_L7_continue:;
    }
    goto __pyx_L6;
  }
  /*else*/ {

    /* "pandas/src/generated.pyx":5402
 *                     prodx[lab, j] *= val
 *     else:
 *         for i in range(N):             # <<<<<<<<<<<<<<
 *             lab = labels[i]
 *             if lab < 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;

      /* "pandas/src/generated.pyx":5403
 *     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_pybuffernd_labels.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_labels.diminfo[0].strides));

      /* "pandas/src/generated.pyx":5404
 *         for i in range(N):
 *             lab = labels[i]
 *             if lab < 0:             # <<<<<<<<<<<<<<
 *                 continue
 * 
 */
      __pyx_t_3 = ((__pyx_v_lab < 0) != 0);
      if (__pyx_t_3) {

        /* "pandas/src/generated.pyx":5405
 *             lab = labels[i]
 *             if lab < 0:
 *                 continue             # <<<<<<<<<<<<<<
 * 
 *             counts[lab] += 1
 */
        goto __pyx_L13_continue;
      }

      /* "pandas/src/generated.pyx":5407
 *                 continue
 * 
 *             counts[lab] += 1             # <<<<<<<<<<<<<<
 *             val = values[i, 0]
 * 
 */
      __pyx_t_17 = __pyx_v_lab;
      *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_counts.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_counts.diminfo[0].strides) += 1;

      /* "pandas/src/generated.pyx":5408
 * 
 *             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_float32_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_24, __pyx_pybuffernd_values.diminfo[0].strides, __pyx_t_25, __pyx_pybuffernd_values.diminfo[1].strides));

      /* "pandas/src/generated.pyx":5411
 * 
 *             # not nan
 *             if val == val:             # <<<<<<<<<<<<<<
 *                 nobs[lab, 0] += 1
 *                 prodx[lab, 0] *= val
 */
      __pyx_t_3 = ((__pyx_v_val == __pyx_v_val) != 0);
      if (__pyx_t_3) {

        /* "pandas/src/generated.pyx":5412
 *             # 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_float32_t *, __pyx_pybuffernd_nobs.rcbuffer->pybuffer.buf, __pyx_t_26, __pyx_pybuffernd_nobs.diminfo[0].strides, __pyx_t_27, __pyx_pybuffernd_nobs.diminfo[1].strides) += 1.0;

        /* "pandas/src/generated.pyx":5413
 *             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_float32_t *, __pyx_pybuffernd_prodx.rcbuffer->pybuffer.buf, __pyx_t_28, __pyx_pybuffernd_prodx.diminfo[0].strides, __pyx_t_29, __pyx_pybuffernd_prodx.diminfo[1].strides) *= __pyx_v_val;
        goto __pyx_L16;
      }
      __pyx_L16:;
      __pyx_L13_continue:;
    }
  }
  __pyx_L6:;

  /* "pandas/src/generated.pyx":5415
 *                 prodx[lab, 0] *= val
 * 
 *     for i in range(len(counts)):             # <<<<<<<<<<<<<<
 *         for j in range(K):
 *             if nobs[i, j] == 0:
 */
  __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_counts)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5415; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) {
    __pyx_v_i = __pyx_t_2;

    /* "pandas/src/generated.pyx":5416
 * 
 *     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;

      /* "pandas/src/generated.pyx":5417
 *     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_3 = (((*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_nobs.rcbuffer->pybuffer.buf, __pyx_t_32, __pyx_pybuffernd_nobs.diminfo[0].strides, __pyx_t_33, __pyx_pybuffernd_nobs.diminfo[1].strides)) == 0.0) != 0);
      if (__pyx_t_3) {

        /* "pandas/src/generated.pyx":5418
 *         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_float32_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_34, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_35, __pyx_pybuffernd_out.diminfo[1].strides) = __pyx_v_6pandas_5algos_nan;
        goto __pyx_L21;
      }
      /*else*/ {

        /* "pandas/src/generated.pyx":5420
 *                 out[i, j] = nan
 *             else:
 *                 out[i, j] = prodx[i, j]             # <<<<<<<<<<<<<<
 * 
 * @cython.boundscheck(False)
 */
        __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_float32_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_38, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_39, __pyx_pybuffernd_out.diminfo[1].strides) = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_prodx.rcbuffer->pybuffer.buf, __pyx_t_36, __pyx_pybuffernd_prodx.diminfo[0].strides, __pyx_t_37, __pyx_pybuffernd_prodx.diminfo[1].strides));
      }
      __pyx_L21:;
    }
  }

  /* "pandas/src/generated.pyx":5367
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def group_prod_float32(ndarray[float32_t, ndim=2] out,             # <<<<<<<<<<<<<<
 *                ndarray[int64_t] counts,
 *                ndarray[float32_t, ndim=2] values,
 */

  /* function exit code */
  __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_12);
  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
    __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_counts.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_labels.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_prodx.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas.algos.group_prod_float32", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_counts.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_labels.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_prodx.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer);
  __pyx_L2:;
  __Pyx_XDECREF((PyObject *)__pyx_v_prodx);
  __Pyx_XDECREF((PyObject *)__pyx_v_nobs);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/src/generated.pyx":5424
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def group_prod_bin_float64(ndarray[float64_t, ndim=2] out,             # <<<<<<<<<<<<<<
 *                   ndarray[int64_t] counts,
 *                   ndarray[float64_t, ndim=2] values,
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pandas_5algos_415group_prod_bin_float64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6pandas_5algos_414group_prod_bin_float64[] = "\n    Only aggregates on axis=0\n    ";
static PyMethodDef __pyx_mdef_6pandas_5algos_415group_prod_bin_float64 = {__Pyx_NAMESTR("group_prod_bin_float64"), (PyCFunction)__pyx_pw_6pandas_5algos_415group_prod_bin_float64, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6pandas_5algos_414group_prod_bin_float64)};
static PyObject *__pyx_pw_6pandas_5algos_415group_prod_bin_float64(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;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("group_prod_bin_float64 (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_out,&__pyx_n_s_counts,&__pyx_n_s_values,&__pyx_n_s_bins,0};
    PyObject* values[4] = {0,0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_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 (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_out)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_counts)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("group_prod_bin_float64", 1, 4, 4, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5424; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("group_prod_bin_float64", 1, 4, 4, 2); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5424; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  3:
        if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_bins)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("group_prod_bin_float64", 1, 4, 4, 3); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5424; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "group_prod_bin_float64") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5424; __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_float64", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5424; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas.algos.group_prod_bin_float64", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_out), __pyx_ptype_5numpy_ndarray, 1, "out", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5424; __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[2]; __pyx_lineno = 5425; __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[2]; __pyx_lineno = 5426; __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[2]; __pyx_lineno = 5427; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_414group_prod_bin_float64(__pyx_self, __pyx_v_out, __pyx_v_counts, __pyx_v_values, __pyx_v_bins);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pandas_5algos_414group_prod_bin_float64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_out, PyArrayObject *__pyx_v_counts, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_bins) {
  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;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_bins;
  __Pyx_Buffer __pyx_pybuffer_bins;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_counts;
  __Pyx_Buffer __pyx_pybuffer_counts;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_nobs;
  __Pyx_Buffer __pyx_pybuffer_nobs;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_out;
  __Pyx_Buffer __pyx_pybuffer_out;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_prodx;
  __Pyx_Buffer __pyx_pybuffer_prodx;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_values;
  __Pyx_Buffer __pyx_pybuffer_values;
  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;
  __Pyx_RefNannySetupContext("group_prod_bin_float64", 0);
  __pyx_pybuffer_prodx.pybuffer.buf = NULL;
  __pyx_pybuffer_prodx.refcount = 0;
  __pyx_pybuffernd_prodx.data = NULL;
  __pyx_pybuffernd_prodx.rcbuffer = &__pyx_pybuffer_prodx;
  __pyx_pybuffer_nobs.pybuffer.buf = NULL;
  __pyx_pybuffer_nobs.refcount = 0;
  __pyx_pybuffernd_nobs.data = NULL;
  __pyx_pybuffernd_nobs.rcbuffer = &__pyx_pybuffer_nobs;
  __pyx_pybuffer_out.pybuffer.buf = NULL;
  __pyx_pybuffer_out.refcount = 0;
  __pyx_pybuffernd_out.data = NULL;
  __pyx_pybuffernd_out.rcbuffer = &__pyx_pybuffer_out;
  __pyx_pybuffer_counts.pybuffer.buf = NULL;
  __pyx_pybuffer_counts.refcount = 0;
  __pyx_pybuffernd_counts.data = NULL;
  __pyx_pybuffernd_counts.rcbuffer = &__pyx_pybuffer_counts;
  __pyx_pybuffer_values.pybuffer.buf = NULL;
  __pyx_pybuffer_values.refcount = 0;
  __pyx_pybuffernd_values.data = NULL;
  __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values;
  __pyx_pybuffer_bins.pybuffer.buf = NULL;
  __pyx_pybuffer_bins.refcount = 0;
  __pyx_pybuffernd_bins.data = NULL;
  __pyx_pybuffernd_bins.rcbuffer = &__pyx_pybuffer_bins;
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_out.rcbuffer->pybuffer, (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[2]; __pyx_lineno = 5424; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_out.diminfo[0].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_out.diminfo[0].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_out.diminfo[1].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_out.diminfo[1].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[1];
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_counts.rcbuffer->pybuffer, (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[2]; __pyx_lineno = 5424; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_counts.diminfo[0].strides = __pyx_pybuffernd_counts.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_counts.diminfo[0].shape = __pyx_pybuffernd_counts.rcbuffer->pybuffer.shape[0];
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (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[2]; __pyx_lineno = 5424; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_values.diminfo[1].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_values.diminfo[1].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[1];
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_bins.rcbuffer->pybuffer, (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[2]; __pyx_lineno = 5424; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_bins.diminfo[0].strides = __pyx_pybuffernd_bins.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_bins.diminfo[0].shape = __pyx_pybuffernd_bins.rcbuffer->pybuffer.shape[0];

  /* "pandas/src/generated.pyx":5436
 *         ndarray[float64_t, ndim=2] prodx, nobs
 * 
 *     nobs = np.zeros_like(out)             # <<<<<<<<<<<<<<
 *     prodx = np.ones_like(out)
 * 
 */
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5436; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros_like); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5436; __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[2]; __pyx_lineno = 5436; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__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 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5436; __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 (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5436; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_4 = ((PyArrayObject *)__pyx_t_3);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer);
    __pyx_t_5 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer, (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_pybuffernd_nobs.rcbuffer->pybuffer, (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_pybuffernd_nobs.diminfo[0].strides = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_nobs.diminfo[0].shape = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_nobs.diminfo[1].strides = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_nobs.diminfo[1].shape = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.shape[1];
    if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5436; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_4 = 0;
  __pyx_v_nobs = ((PyArrayObject *)__pyx_t_3);
  __pyx_t_3 = 0;

  /* "pandas/src/generated.pyx":5437
 * 
 *     nobs = np.zeros_like(out)
 *     prodx = np.ones_like(out)             # <<<<<<<<<<<<<<
 * 
 *     if bins[len(bins) - 1] == len(values):
 */
  __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5437; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_ones_like); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5437; __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[2]; __pyx_lineno = 5437; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__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 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5437; __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;
  if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5437; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_4 = ((PyArrayObject *)__pyx_t_2);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_prodx.rcbuffer->pybuffer);
    __pyx_t_5 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_prodx.rcbuffer->pybuffer, (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_pybuffernd_prodx.rcbuffer->pybuffer, (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_pybuffernd_prodx.diminfo[0].strides = __pyx_pybuffernd_prodx.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_prodx.diminfo[0].shape = __pyx_pybuffernd_prodx.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_prodx.diminfo[1].strides = __pyx_pybuffernd_prodx.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_prodx.diminfo[1].shape = __pyx_pybuffernd_prodx.rcbuffer->pybuffer.shape[1];
    if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5437; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_4 = 0;
  __pyx_v_prodx = ((PyArrayObject *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "pandas/src/generated.pyx":5439
 *     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[2]; __pyx_lineno = 5439; __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[2]; __pyx_lineno = 5439; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_12 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_bins.rcbuffer->pybuffer.buf, __pyx_t_10, __pyx_pybuffernd_bins.diminfo[0].strides)) == __pyx_t_11) != 0);
  if (__pyx_t_12) {

    /* "pandas/src/generated.pyx":5440
 * 
 *     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[2]; __pyx_lineno = 5440; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_v_ngroups = __pyx_t_11;
    goto __pyx_L3;
  }
  /*else*/ {

    /* "pandas/src/generated.pyx":5442
 *         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[2]; __pyx_lineno = 5442; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_v_ngroups = (__pyx_t_11 + 1);
  }
  __pyx_L3:;

  /* "pandas/src/generated.pyx":5443
 *     else:
 *         ngroups = len(bins) + 1
 *     N, K = (<object> values).shape             # <<<<<<<<<<<<<<
 * 
 *     b = 0
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_values), __pyx_n_s_shape); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5443; __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 CYTHON_COMPILING_IN_CPYTHON
    Py_ssize_t size = Py_SIZE(sequence);
    #else
    Py_ssize_t size = PySequence_Size(sequence);
    #endif
    if (unlikely(size != 2)) {
      if (size > 2) __Pyx_RaiseTooManyValuesError(2);
      else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
      {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5443; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    #if CYTHON_COMPILING_IN_CPYTHON
    if (likely(PyTuple_CheckExact(sequence))) {
      __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0); 
      __pyx_t_1 = PyTuple_GET_ITEM(sequence, 1); 
    } else {
      __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);
    #else
    __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5443; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_1 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5443; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    #endif
    __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[2]; __pyx_lineno = 5443; __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_L4_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_L4_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_1);
    if (__Pyx_IternextUnpackEndCheck(__pyx_t_14(__pyx_t_13), 2) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5443; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_14 = NULL;
    __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
    goto __pyx_L5_unpacking_done;
    __pyx_L4_unpacking_failed:;
    __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
    __pyx_t_14 = NULL;
    if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
    {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5443; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_L5_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[2]; __pyx_lineno = 5443; __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[2]; __pyx_lineno = 5443; __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;

  /* "pandas/src/generated.pyx":5445
 *     N, K = (<object> values).shape
 * 
 *     b = 0             # <<<<<<<<<<<<<<
 *     if K > 1:
 *         for i in range(N):
 */
  __pyx_v_b = 0;

  /* "pandas/src/generated.pyx":5446
 * 
 *     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) != 0);
  if (__pyx_t_12) {

    /* "pandas/src/generated.pyx":5447
 *     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;

      /* "pandas/src/generated.pyx":5448
 *     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)) != 0);
        if (__pyx_t_12) {
          __pyx_t_15 = __pyx_v_b;
          __pyx_t_16 = ((__pyx_v_i >= (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_bins.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_bins.diminfo[0].strides))) != 0);
          __pyx_t_17 = __pyx_t_16;
        } else {
          __pyx_t_17 = __pyx_t_12;
        }
        if (!__pyx_t_17) break;

        /* "pandas/src/generated.pyx":5449
 *         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);
      }

      /* "pandas/src/generated.pyx":5451
 *                 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_pybuffernd_counts.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_counts.diminfo[0].strides) += 1;

      /* "pandas/src/generated.pyx":5452
 * 
 *             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;

        /* "pandas/src/generated.pyx":5453
 *             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_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_values.diminfo[0].strides, __pyx_t_22, __pyx_pybuffernd_values.diminfo[1].strides));

        /* "pandas/src/generated.pyx":5456
 * 
 *                 # not nan
 *                 if val == val:             # <<<<<<<<<<<<<<
 *                     nobs[b, j] += 1
 *                     prodx[b, j] *= val
 */
        __pyx_t_17 = ((__pyx_v_val == __pyx_v_val) != 0);
        if (__pyx_t_17) {

          /* "pandas/src/generated.pyx":5457
 *                 # 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_pybuffernd_nobs.rcbuffer->pybuffer.buf, __pyx_t_23, __pyx_pybuffernd_nobs.diminfo[0].strides, __pyx_t_24, __pyx_pybuffernd_nobs.diminfo[1].strides) += 1.0;

          /* "pandas/src/generated.pyx":5458
 *                 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_pybuffernd_prodx.rcbuffer->pybuffer.buf, __pyx_t_25, __pyx_pybuffernd_prodx.diminfo[0].strides, __pyx_t_26, __pyx_pybuffernd_prodx.diminfo[1].strides) *= __pyx_v_val;
          goto __pyx_L13;
        }
        __pyx_L13:;
      }
    }
    goto __pyx_L6;
  }
  /*else*/ {

    /* "pandas/src/generated.pyx":5460
 *                     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;

      /* "pandas/src/generated.pyx":5461
 *     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)) != 0);
        if (__pyx_t_17) {
          __pyx_t_19 = __pyx_v_b;
          __pyx_t_12 = ((__pyx_v_i >= (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_bins.rcbuffer->pybuffer.buf, __pyx_t_19, __pyx_pybuffernd_bins.diminfo[0].strides))) != 0);
          __pyx_t_16 = __pyx_t_12;
        } else {
          __pyx_t_16 = __pyx_t_17;
        }
        if (!__pyx_t_16) break;

        /* "pandas/src/generated.pyx":5462
 *         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);
      }

      /* "pandas/src/generated.pyx":5464
 *                 b += 1
 * 
 *             counts[b] += 1             # <<<<<<<<<<<<<<
 *             val = values[i, 0]
 * 
 */
      __pyx_t_20 = __pyx_v_b;
      *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_counts.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_counts.diminfo[0].strides) += 1;

      /* "pandas/src/generated.pyx":5465
 * 
 *             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_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_27, __pyx_pybuffernd_values.diminfo[0].strides, __pyx_t_28, __pyx_pybuffernd_values.diminfo[1].strides));

      /* "pandas/src/generated.pyx":5468
 * 
 *             # not nan
 *             if val == val:             # <<<<<<<<<<<<<<
 *                 nobs[b, 0] += 1
 *                 prodx[b, 0] *= val
 */
      __pyx_t_16 = ((__pyx_v_val == __pyx_v_val) != 0);
      if (__pyx_t_16) {

        /* "pandas/src/generated.pyx":5469
 *             # 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_pybuffernd_nobs.rcbuffer->pybuffer.buf, __pyx_t_29, __pyx_pybuffernd_nobs.diminfo[0].strides, __pyx_t_30, __pyx_pybuffernd_nobs.diminfo[1].strides) += 1.0;

        /* "pandas/src/generated.pyx":5470
 *             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_pybuffernd_prodx.rcbuffer->pybuffer.buf, __pyx_t_31, __pyx_pybuffernd_prodx.diminfo[0].strides, __pyx_t_32, __pyx_pybuffernd_prodx.diminfo[1].strides) *= __pyx_v_val;
        goto __pyx_L18;
      }
      __pyx_L18:;
    }
  }
  __pyx_L6:;

  /* "pandas/src/generated.pyx":5472
 *                 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;

    /* "pandas/src/generated.pyx":5473
 * 
 *     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;

      /* "pandas/src/generated.pyx":5474
 *     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_pybuffernd_nobs.rcbuffer->pybuffer.buf, __pyx_t_35, __pyx_pybuffernd_nobs.diminfo[0].strides, __pyx_t_36, __pyx_pybuffernd_nobs.diminfo[1].strides)) == 0.0) != 0);
      if (__pyx_t_16) {

        /* "pandas/src/generated.pyx":5475
 *         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_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_37, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_38, __pyx_pybuffernd_out.diminfo[1].strides) = __pyx_v_6pandas_5algos_nan;
        goto __pyx_L23;
      }
      /*else*/ {

        /* "pandas/src/generated.pyx":5477
 *                 out[i, j] = nan
 *             else:
 *                 out[i, j] = prodx[i, j]             # <<<<<<<<<<<<<<
 * @cython.boundscheck(False)
 * @cython.wraparound(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_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_41, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_42, __pyx_pybuffernd_out.diminfo[1].strides) = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_prodx.rcbuffer->pybuffer.buf, __pyx_t_39, __pyx_pybuffernd_prodx.diminfo[0].strides, __pyx_t_40, __pyx_pybuffernd_prodx.diminfo[1].strides));
      }
      __pyx_L23:;
    }
  }

  /* "pandas/src/generated.pyx":5424
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def group_prod_bin_float64(ndarray[float64_t, ndim=2] out,             # <<<<<<<<<<<<<<
 *                   ndarray[int64_t] counts,
 *                   ndarray[float64_t, ndim=2] values,
 */

  /* function exit code */
  __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_pybuffernd_bins.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_counts.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_prodx.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas.algos.group_prod_bin_float64", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_bins.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_counts.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_prodx.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer);
  __pyx_L2:;
  __Pyx_XDECREF((PyObject *)__pyx_v_prodx);
  __Pyx_XDECREF((PyObject *)__pyx_v_nobs);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/src/generated.pyx":5480
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def group_prod_bin_float32(ndarray[float32_t, ndim=2] out,             # <<<<<<<<<<<<<<
 *                   ndarray[int64_t] counts,
 *                   ndarray[float32_t, ndim=2] values,
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pandas_5algos_417group_prod_bin_float32(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6pandas_5algos_416group_prod_bin_float32[] = "\n    Only aggregates on axis=0\n    ";
static PyMethodDef __pyx_mdef_6pandas_5algos_417group_prod_bin_float32 = {__Pyx_NAMESTR("group_prod_bin_float32"), (PyCFunction)__pyx_pw_6pandas_5algos_417group_prod_bin_float32, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6pandas_5algos_416group_prod_bin_float32)};
static PyObject *__pyx_pw_6pandas_5algos_417group_prod_bin_float32(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;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("group_prod_bin_float32 (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_out,&__pyx_n_s_counts,&__pyx_n_s_values,&__pyx_n_s_bins,0};
    PyObject* values[4] = {0,0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_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 (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_out)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_counts)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("group_prod_bin_float32", 1, 4, 4, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5480; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("group_prod_bin_float32", 1, 4, 4, 2); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5480; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  3:
        if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_bins)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("group_prod_bin_float32", 1, 4, 4, 3); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5480; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "group_prod_bin_float32") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5480; __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_float32", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5480; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas.algos.group_prod_bin_float32", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_out), __pyx_ptype_5numpy_ndarray, 1, "out", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5480; __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[2]; __pyx_lineno = 5481; __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[2]; __pyx_lineno = 5482; __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[2]; __pyx_lineno = 5483; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_416group_prod_bin_float32(__pyx_self, __pyx_v_out, __pyx_v_counts, __pyx_v_values, __pyx_v_bins);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pandas_5algos_416group_prod_bin_float32(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_out, PyArrayObject *__pyx_v_counts, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_bins) {
  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_float32_t __pyx_v_val;
  PyArrayObject *__pyx_v_prodx = 0;
  PyArrayObject *__pyx_v_nobs = 0;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_bins;
  __Pyx_Buffer __pyx_pybuffer_bins;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_counts;
  __Pyx_Buffer __pyx_pybuffer_counts;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_nobs;
  __Pyx_Buffer __pyx_pybuffer_nobs;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_out;
  __Pyx_Buffer __pyx_pybuffer_out;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_prodx;
  __Pyx_Buffer __pyx_pybuffer_prodx;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_values;
  __Pyx_Buffer __pyx_pybuffer_values;
  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;
  __Pyx_RefNannySetupContext("group_prod_bin_float32", 0);
  __pyx_pybuffer_prodx.pybuffer.buf = NULL;
  __pyx_pybuffer_prodx.refcount = 0;
  __pyx_pybuffernd_prodx.data = NULL;
  __pyx_pybuffernd_prodx.rcbuffer = &__pyx_pybuffer_prodx;
  __pyx_pybuffer_nobs.pybuffer.buf = NULL;
  __pyx_pybuffer_nobs.refcount = 0;
  __pyx_pybuffernd_nobs.data = NULL;
  __pyx_pybuffernd_nobs.rcbuffer = &__pyx_pybuffer_nobs;
  __pyx_pybuffer_out.pybuffer.buf = NULL;
  __pyx_pybuffer_out.refcount = 0;
  __pyx_pybuffernd_out.data = NULL;
  __pyx_pybuffernd_out.rcbuffer = &__pyx_pybuffer_out;
  __pyx_pybuffer_counts.pybuffer.buf = NULL;
  __pyx_pybuffer_counts.refcount = 0;
  __pyx_pybuffernd_counts.data = NULL;
  __pyx_pybuffernd_counts.rcbuffer = &__pyx_pybuffer_counts;
  __pyx_pybuffer_values.pybuffer.buf = NULL;
  __pyx_pybuffer_values.refcount = 0;
  __pyx_pybuffernd_values.data = NULL;
  __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values;
  __pyx_pybuffer_bins.pybuffer.buf = NULL;
  __pyx_pybuffer_bins.refcount = 0;
  __pyx_pybuffernd_bins.data = NULL;
  __pyx_pybuffernd_bins.rcbuffer = &__pyx_pybuffer_bins;
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_out.rcbuffer->pybuffer, (PyObject*)__pyx_v_out, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5480; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_out.diminfo[0].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_out.diminfo[0].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_out.diminfo[1].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_out.diminfo[1].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[1];
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_counts.rcbuffer->pybuffer, (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[2]; __pyx_lineno = 5480; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_counts.diminfo[0].strides = __pyx_pybuffernd_counts.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_counts.diminfo[0].shape = __pyx_pybuffernd_counts.rcbuffer->pybuffer.shape[0];
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5480; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_values.diminfo[1].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_values.diminfo[1].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[1];
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_bins.rcbuffer->pybuffer, (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[2]; __pyx_lineno = 5480; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_bins.diminfo[0].strides = __pyx_pybuffernd_bins.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_bins.diminfo[0].shape = __pyx_pybuffernd_bins.rcbuffer->pybuffer.shape[0];

  /* "pandas/src/generated.pyx":5492
 *         ndarray[float32_t, ndim=2] prodx, nobs
 * 
 *     nobs = np.zeros_like(out)             # <<<<<<<<<<<<<<
 *     prodx = np.ones_like(out)
 * 
 */
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5492; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros_like); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5492; __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[2]; __pyx_lineno = 5492; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__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 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5492; __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 (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5492; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_4 = ((PyArrayObject *)__pyx_t_3);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer);
    __pyx_t_5 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer, (PyObject*)__pyx_t_4, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_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_pybuffernd_nobs.rcbuffer->pybuffer, (PyObject*)__pyx_v_nobs, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_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_pybuffernd_nobs.diminfo[0].strides = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_nobs.diminfo[0].shape = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_nobs.diminfo[1].strides = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_nobs.diminfo[1].shape = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.shape[1];
    if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5492; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_4 = 0;
  __pyx_v_nobs = ((PyArrayObject *)__pyx_t_3);
  __pyx_t_3 = 0;

  /* "pandas/src/generated.pyx":5493
 * 
 *     nobs = np.zeros_like(out)
 *     prodx = np.ones_like(out)             # <<<<<<<<<<<<<<
 * 
 *     if bins[len(bins) - 1] == len(values):
 */
  __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5493; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_ones_like); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5493; __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[2]; __pyx_lineno = 5493; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__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 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5493; __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;
  if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5493; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_4 = ((PyArrayObject *)__pyx_t_2);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_prodx.rcbuffer->pybuffer);
    __pyx_t_5 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_prodx.rcbuffer->pybuffer, (PyObject*)__pyx_t_4, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_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_pybuffernd_prodx.rcbuffer->pybuffer, (PyObject*)__pyx_v_prodx, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_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_pybuffernd_prodx.diminfo[0].strides = __pyx_pybuffernd_prodx.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_prodx.diminfo[0].shape = __pyx_pybuffernd_prodx.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_prodx.diminfo[1].strides = __pyx_pybuffernd_prodx.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_prodx.diminfo[1].shape = __pyx_pybuffernd_prodx.rcbuffer->pybuffer.shape[1];
    if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5493; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_4 = 0;
  __pyx_v_prodx = ((PyArrayObject *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "pandas/src/generated.pyx":5495
 *     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[2]; __pyx_lineno = 5495; __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[2]; __pyx_lineno = 5495; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_12 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_bins.rcbuffer->pybuffer.buf, __pyx_t_10, __pyx_pybuffernd_bins.diminfo[0].strides)) == __pyx_t_11) != 0);
  if (__pyx_t_12) {

    /* "pandas/src/generated.pyx":5496
 * 
 *     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[2]; __pyx_lineno = 5496; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_v_ngroups = __pyx_t_11;
    goto __pyx_L3;
  }
  /*else*/ {

    /* "pandas/src/generated.pyx":5498
 *         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[2]; __pyx_lineno = 5498; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_v_ngroups = (__pyx_t_11 + 1);
  }
  __pyx_L3:;

  /* "pandas/src/generated.pyx":5499
 *     else:
 *         ngroups = len(bins) + 1
 *     N, K = (<object> values).shape             # <<<<<<<<<<<<<<
 * 
 *     b = 0
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_values), __pyx_n_s_shape); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5499; __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 CYTHON_COMPILING_IN_CPYTHON
    Py_ssize_t size = Py_SIZE(sequence);
    #else
    Py_ssize_t size = PySequence_Size(sequence);
    #endif
    if (unlikely(size != 2)) {
      if (size > 2) __Pyx_RaiseTooManyValuesError(2);
      else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
      {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5499; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    #if CYTHON_COMPILING_IN_CPYTHON
    if (likely(PyTuple_CheckExact(sequence))) {
      __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0); 
      __pyx_t_1 = PyTuple_GET_ITEM(sequence, 1); 
    } else {
      __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);
    #else
    __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5499; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_1 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5499; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    #endif
    __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[2]; __pyx_lineno = 5499; __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_L4_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_L4_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_1);
    if (__Pyx_IternextUnpackEndCheck(__pyx_t_14(__pyx_t_13), 2) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5499; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_14 = NULL;
    __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
    goto __pyx_L5_unpacking_done;
    __pyx_L4_unpacking_failed:;
    __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
    __pyx_t_14 = NULL;
    if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
    {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5499; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_L5_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[2]; __pyx_lineno = 5499; __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[2]; __pyx_lineno = 5499; __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;

  /* "pandas/src/generated.pyx":5501
 *     N, K = (<object> values).shape
 * 
 *     b = 0             # <<<<<<<<<<<<<<
 *     if K > 1:
 *         for i in range(N):
 */
  __pyx_v_b = 0;

  /* "pandas/src/generated.pyx":5502
 * 
 *     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) != 0);
  if (__pyx_t_12) {

    /* "pandas/src/generated.pyx":5503
 *     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;

      /* "pandas/src/generated.pyx":5504
 *     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)) != 0);
        if (__pyx_t_12) {
          __pyx_t_15 = __pyx_v_b;
          __pyx_t_16 = ((__pyx_v_i >= (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_bins.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_bins.diminfo[0].strides))) != 0);
          __pyx_t_17 = __pyx_t_16;
        } else {
          __pyx_t_17 = __pyx_t_12;
        }
        if (!__pyx_t_17) break;

        /* "pandas/src/generated.pyx":5505
 *         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);
      }

      /* "pandas/src/generated.pyx":5507
 *                 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_pybuffernd_counts.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_counts.diminfo[0].strides) += 1;

      /* "pandas/src/generated.pyx":5508
 * 
 *             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;

        /* "pandas/src/generated.pyx":5509
 *             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_float32_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_values.diminfo[0].strides, __pyx_t_22, __pyx_pybuffernd_values.diminfo[1].strides));

        /* "pandas/src/generated.pyx":5512
 * 
 *                 # not nan
 *                 if val == val:             # <<<<<<<<<<<<<<
 *                     nobs[b, j] += 1
 *                     prodx[b, j] *= val
 */
        __pyx_t_17 = ((__pyx_v_val == __pyx_v_val) != 0);
        if (__pyx_t_17) {

          /* "pandas/src/generated.pyx":5513
 *                 # 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_float32_t *, __pyx_pybuffernd_nobs.rcbuffer->pybuffer.buf, __pyx_t_23, __pyx_pybuffernd_nobs.diminfo[0].strides, __pyx_t_24, __pyx_pybuffernd_nobs.diminfo[1].strides) += 1.0;

          /* "pandas/src/generated.pyx":5514
 *                 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_float32_t *, __pyx_pybuffernd_prodx.rcbuffer->pybuffer.buf, __pyx_t_25, __pyx_pybuffernd_prodx.diminfo[0].strides, __pyx_t_26, __pyx_pybuffernd_prodx.diminfo[1].strides) *= __pyx_v_val;
          goto __pyx_L13;
        }
        __pyx_L13:;
      }
    }
    goto __pyx_L6;
  }
  /*else*/ {

    /* "pandas/src/generated.pyx":5516
 *                     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;

      /* "pandas/src/generated.pyx":5517
 *     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)) != 0);
        if (__pyx_t_17) {
          __pyx_t_19 = __pyx_v_b;
          __pyx_t_12 = ((__pyx_v_i >= (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_bins.rcbuffer->pybuffer.buf, __pyx_t_19, __pyx_pybuffernd_bins.diminfo[0].strides))) != 0);
          __pyx_t_16 = __pyx_t_12;
        } else {
          __pyx_t_16 = __pyx_t_17;
        }
        if (!__pyx_t_16) break;

        /* "pandas/src/generated.pyx":5518
 *         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);
      }

      /* "pandas/src/generated.pyx":5520
 *                 b += 1
 * 
 *             counts[b] += 1             # <<<<<<<<<<<<<<
 *             val = values[i, 0]
 * 
 */
      __pyx_t_20 = __pyx_v_b;
      *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_counts.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_counts.diminfo[0].strides) += 1;

      /* "pandas/src/generated.pyx":5521
 * 
 *             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_float32_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_27, __pyx_pybuffernd_values.diminfo[0].strides, __pyx_t_28, __pyx_pybuffernd_values.diminfo[1].strides));

      /* "pandas/src/generated.pyx":5524
 * 
 *             # not nan
 *             if val == val:             # <<<<<<<<<<<<<<
 *                 nobs[b, 0] += 1
 *                 prodx[b, 0] *= val
 */
      __pyx_t_16 = ((__pyx_v_val == __pyx_v_val) != 0);
      if (__pyx_t_16) {

        /* "pandas/src/generated.pyx":5525
 *             # 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_float32_t *, __pyx_pybuffernd_nobs.rcbuffer->pybuffer.buf, __pyx_t_29, __pyx_pybuffernd_nobs.diminfo[0].strides, __pyx_t_30, __pyx_pybuffernd_nobs.diminfo[1].strides) += 1.0;

        /* "pandas/src/generated.pyx":5526
 *             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_float32_t *, __pyx_pybuffernd_prodx.rcbuffer->pybuffer.buf, __pyx_t_31, __pyx_pybuffernd_prodx.diminfo[0].strides, __pyx_t_32, __pyx_pybuffernd_prodx.diminfo[1].strides) *= __pyx_v_val;
        goto __pyx_L18;
      }
      __pyx_L18:;
    }
  }
  __pyx_L6:;

  /* "pandas/src/generated.pyx":5528
 *                 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;

    /* "pandas/src/generated.pyx":5529
 * 
 *     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;

      /* "pandas/src/generated.pyx":5530
 *     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_float32_t *, __pyx_pybuffernd_nobs.rcbuffer->pybuffer.buf, __pyx_t_35, __pyx_pybuffernd_nobs.diminfo[0].strides, __pyx_t_36, __pyx_pybuffernd_nobs.diminfo[1].strides)) == 0.0) != 0);
      if (__pyx_t_16) {

        /* "pandas/src/generated.pyx":5531
 *         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_float32_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_37, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_38, __pyx_pybuffernd_out.diminfo[1].strides) = __pyx_v_6pandas_5algos_nan;
        goto __pyx_L23;
      }
      /*else*/ {

        /* "pandas/src/generated.pyx":5533
 *                 out[i, j] = nan
 *             else:
 *                 out[i, j] = prodx[i, j]             # <<<<<<<<<<<<<<
 * 
 * @cython.wraparound(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_float32_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_41, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_42, __pyx_pybuffernd_out.diminfo[1].strides) = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_prodx.rcbuffer->pybuffer.buf, __pyx_t_39, __pyx_pybuffernd_prodx.diminfo[0].strides, __pyx_t_40, __pyx_pybuffernd_prodx.diminfo[1].strides));
      }
      __pyx_L23:;
    }
  }

  /* "pandas/src/generated.pyx":5480
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def group_prod_bin_float32(ndarray[float32_t, ndim=2] out,             # <<<<<<<<<<<<<<
 *                   ndarray[int64_t] counts,
 *                   ndarray[float32_t, ndim=2] values,
 */

  /* function exit code */
  __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_pybuffernd_bins.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_counts.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_prodx.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas.algos.group_prod_bin_float32", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_bins.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_counts.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_prodx.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer);
  __pyx_L2:;
  __Pyx_XDECREF((PyObject *)__pyx_v_prodx);
  __Pyx_XDECREF((PyObject *)__pyx_v_nobs);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/src/generated.pyx":5537
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def group_var_float64(ndarray[float64_t, ndim=2] out,             # <<<<<<<<<<<<<<
 *               ndarray[int64_t] counts,
 *               ndarray[float64_t, ndim=2] values,
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pandas_5algos_419group_var_float64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_5algos_419group_var_float64 = {__Pyx_NAMESTR("group_var_float64"), (PyCFunction)__pyx_pw_6pandas_5algos_419group_var_float64, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pw_6pandas_5algos_419group_var_float64(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;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("group_var_float64 (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_out,&__pyx_n_s_counts,&__pyx_n_s_values,&__pyx_n_s_labels,0};
    PyObject* values[4] = {0,0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_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 (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_out)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_counts)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("group_var_float64", 1, 4, 4, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5537; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("group_var_float64", 1, 4, 4, 2); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5537; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  3:
        if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_labels)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("group_var_float64", 1, 4, 4, 3); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5537; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "group_var_float64") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5537; __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_float64", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5537; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas.algos.group_var_float64", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_out), __pyx_ptype_5numpy_ndarray, 1, "out", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5537; __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[2]; __pyx_lineno = 5538; __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[2]; __pyx_lineno = 5539; __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[2]; __pyx_lineno = 5540; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_418group_var_float64(__pyx_self, __pyx_v_out, __pyx_v_counts, __pyx_v_values, __pyx_v_labels);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pandas_5algos_418group_var_float64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_out, PyArrayObject *__pyx_v_counts, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_labels) {
  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;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_counts;
  __Pyx_Buffer __pyx_pybuffer_counts;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_labels;
  __Pyx_Buffer __pyx_pybuffer_labels;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_nobs;
  __Pyx_Buffer __pyx_pybuffer_nobs;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_out;
  __Pyx_Buffer __pyx_pybuffer_out;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_sumx;
  __Pyx_Buffer __pyx_pybuffer_sumx;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_sumxx;
  __Pyx_Buffer __pyx_pybuffer_sumxx;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_values;
  __Pyx_Buffer __pyx_pybuffer_values;
  PyObject *__pyx_r = NULL;
  __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;
  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;
  PyObject *__pyx_t_12 = NULL;
  PyObject *(*__pyx_t_13)(PyObject *);
  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;
  __Pyx_RefNannySetupContext("group_var_float64", 0);
  __pyx_pybuffer_nobs.pybuffer.buf = NULL;
  __pyx_pybuffer_nobs.refcount = 0;
  __pyx_pybuffernd_nobs.data = NULL;
  __pyx_pybuffernd_nobs.rcbuffer = &__pyx_pybuffer_nobs;
  __pyx_pybuffer_sumx.pybuffer.buf = NULL;
  __pyx_pybuffer_sumx.refcount = 0;
  __pyx_pybuffernd_sumx.data = NULL;
  __pyx_pybuffernd_sumx.rcbuffer = &__pyx_pybuffer_sumx;
  __pyx_pybuffer_sumxx.pybuffer.buf = NULL;
  __pyx_pybuffer_sumxx.refcount = 0;
  __pyx_pybuffernd_sumxx.data = NULL;
  __pyx_pybuffernd_sumxx.rcbuffer = &__pyx_pybuffer_sumxx;
  __pyx_pybuffer_out.pybuffer.buf = NULL;
  __pyx_pybuffer_out.refcount = 0;
  __pyx_pybuffernd_out.data = NULL;
  __pyx_pybuffernd_out.rcbuffer = &__pyx_pybuffer_out;
  __pyx_pybuffer_counts.pybuffer.buf = NULL;
  __pyx_pybuffer_counts.refcount = 0;
  __pyx_pybuffernd_counts.data = NULL;
  __pyx_pybuffernd_counts.rcbuffer = &__pyx_pybuffer_counts;
  __pyx_pybuffer_values.pybuffer.buf = NULL;
  __pyx_pybuffer_values.refcount = 0;
  __pyx_pybuffernd_values.data = NULL;
  __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values;
  __pyx_pybuffer_labels.pybuffer.buf = NULL;
  __pyx_pybuffer_labels.refcount = 0;
  __pyx_pybuffernd_labels.data = NULL;
  __pyx_pybuffernd_labels.rcbuffer = &__pyx_pybuffer_labels;
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_out.rcbuffer->pybuffer, (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[2]; __pyx_lineno = 5537; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_out.diminfo[0].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_out.diminfo[0].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_out.diminfo[1].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_out.diminfo[1].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[1];
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_counts.rcbuffer->pybuffer, (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[2]; __pyx_lineno = 5537; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_counts.diminfo[0].strides = __pyx_pybuffernd_counts.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_counts.diminfo[0].shape = __pyx_pybuffernd_counts.rcbuffer->pybuffer.shape[0];
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (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[2]; __pyx_lineno = 5537; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_values.diminfo[1].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_values.diminfo[1].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[1];
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_labels.rcbuffer->pybuffer, (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[2]; __pyx_lineno = 5537; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_labels.diminfo[0].strides = __pyx_pybuffernd_labels.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_labels.diminfo[0].shape = __pyx_pybuffernd_labels.rcbuffer->pybuffer.shape[0];

  /* "pandas/src/generated.pyx":5546
 *         ndarray[float64_t, ndim=2] nobs, sumx, sumxx
 * 
 *     if not len(values) == len(labels):             # <<<<<<<<<<<<<<
 *        raise AssertionError("len(index) != len(labels)")
 * 
 */
  __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_values)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5546; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_2 = PyObject_Length(((PyObject *)__pyx_v_labels)); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5546; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_3 = ((!((__pyx_t_1 == __pyx_t_2) != 0)) != 0);
  if (__pyx_t_3) {

    /* "pandas/src/generated.pyx":5547
 * 
 *     if not len(values) == len(labels):
 *        raise AssertionError("len(index) != len(labels)")             # <<<<<<<<<<<<<<
 * 
 *     nobs = np.zeros_like(out)
 */
    __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_AssertionError, __pyx_tuple__200, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5547; __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[2]; __pyx_lineno = 5547; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }

  /* "pandas/src/generated.pyx":5549
 *        raise AssertionError("len(index) != len(labels)")
 * 
 *     nobs = np.zeros_like(out)             # <<<<<<<<<<<<<<
 *     sumx = np.zeros_like(out)
 *     sumxx = np.zeros_like(out)
 */
  __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5549; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_zeros_like); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5549; __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[2]; __pyx_lineno = 5549; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_INCREF(((PyObject *)__pyx_v_out));
  PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_v_out));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_out));
  __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_4, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5549; __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_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[2]; __pyx_lineno = 5549; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_7 = ((PyArrayObject *)__pyx_t_6);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer);
    __pyx_t_8 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer, (PyObject*)__pyx_t_7, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 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_pybuffernd_nobs.rcbuffer->pybuffer, (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_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_pybuffernd_nobs.diminfo[0].strides = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_nobs.diminfo[0].shape = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_nobs.diminfo[1].strides = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_nobs.diminfo[1].shape = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.shape[1];
    if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5549; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_7 = 0;
  __pyx_v_nobs = ((PyArrayObject *)__pyx_t_6);
  __pyx_t_6 = 0;

  /* "pandas/src/generated.pyx":5550
 * 
 *     nobs = np.zeros_like(out)
 *     sumx = np.zeros_like(out)             # <<<<<<<<<<<<<<
 *     sumxx = np.zeros_like(out)
 * 
 */
  __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5550; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_zeros_like); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5550; __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[2]; __pyx_lineno = 5550; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_INCREF(((PyObject *)__pyx_v_out));
  PyTuple_SET_ITEM(__pyx_t_6, 0, ((PyObject *)__pyx_v_out));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_out));
  __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5550; __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;
  if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5550; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_7 = ((PyArrayObject *)__pyx_t_5);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_sumx.rcbuffer->pybuffer);
    __pyx_t_8 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_sumx.rcbuffer->pybuffer, (PyObject*)__pyx_t_7, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 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_pybuffernd_sumx.rcbuffer->pybuffer, (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_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_pybuffernd_sumx.diminfo[0].strides = __pyx_pybuffernd_sumx.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_sumx.diminfo[0].shape = __pyx_pybuffernd_sumx.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_sumx.diminfo[1].strides = __pyx_pybuffernd_sumx.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_sumx.diminfo[1].shape = __pyx_pybuffernd_sumx.rcbuffer->pybuffer.shape[1];
    if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5550; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_7 = 0;
  __pyx_v_sumx = ((PyArrayObject *)__pyx_t_5);
  __pyx_t_5 = 0;

  /* "pandas/src/generated.pyx":5551
 *     nobs = np.zeros_like(out)
 *     sumx = np.zeros_like(out)
 *     sumxx = np.zeros_like(out)             # <<<<<<<<<<<<<<
 * 
 *     N, K = (<object> values).shape
 */
  __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5551; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_zeros_like); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5551; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __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 = 5551; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__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_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5551; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __Pyx_DECREF(__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[2]; __pyx_lineno = 5551; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_7 = ((PyArrayObject *)__pyx_t_4);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_sumxx.rcbuffer->pybuffer);
    __pyx_t_8 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_sumxx.rcbuffer->pybuffer, (PyObject*)__pyx_t_7, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 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_pybuffernd_sumxx.rcbuffer->pybuffer, (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_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_pybuffernd_sumxx.diminfo[0].strides = __pyx_pybuffernd_sumxx.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_sumxx.diminfo[0].shape = __pyx_pybuffernd_sumxx.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_sumxx.diminfo[1].strides = __pyx_pybuffernd_sumxx.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_sumxx.diminfo[1].shape = __pyx_pybuffernd_sumxx.rcbuffer->pybuffer.shape[1];
    if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5551; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_7 = 0;
  __pyx_v_sumxx = ((PyArrayObject *)__pyx_t_4);
  __pyx_t_4 = 0;

  /* "pandas/src/generated.pyx":5553
 *     sumxx = np.zeros_like(out)
 * 
 *     N, K = (<object> values).shape             # <<<<<<<<<<<<<<
 * 
 *     if K > 1:
 */
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_values), __pyx_n_s_shape); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5553; __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 CYTHON_COMPILING_IN_CPYTHON
    Py_ssize_t size = Py_SIZE(sequence);
    #else
    Py_ssize_t size = PySequence_Size(sequence);
    #endif
    if (unlikely(size != 2)) {
      if (size > 2) __Pyx_RaiseTooManyValuesError(2);
      else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
      {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5553; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    #if CYTHON_COMPILING_IN_CPYTHON
    if (likely(PyTuple_CheckExact(sequence))) {
      __pyx_t_5 = PyTuple_GET_ITEM(sequence, 0); 
      __pyx_t_6 = PyTuple_GET_ITEM(sequence, 1); 
    } else {
      __pyx_t_5 = PyList_GET_ITEM(sequence, 0); 
      __pyx_t_6 = PyList_GET_ITEM(sequence, 1); 
    }
    __Pyx_INCREF(__pyx_t_5);
    __Pyx_INCREF(__pyx_t_6);
    #else
    __pyx_t_5 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5553; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5553; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    #endif
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  } else {
    Py_ssize_t index = -1;
    __pyx_t_12 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5553; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_12);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_13 = Py_TYPE(__pyx_t_12)->tp_iternext;
    index = 0; __pyx_t_5 = __pyx_t_13(__pyx_t_12); if (unlikely(!__pyx_t_5)) goto __pyx_L4_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_5);
    index = 1; __pyx_t_6 = __pyx_t_13(__pyx_t_12); if (unlikely(!__pyx_t_6)) goto __pyx_L4_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_6);
    if (__Pyx_IternextUnpackEndCheck(__pyx_t_13(__pyx_t_12), 2) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5553; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_13 = NULL;
    __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
    goto __pyx_L5_unpacking_done;
    __pyx_L4_unpacking_failed:;
    __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
    __pyx_t_13 = NULL;
    if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
    {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5553; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_L5_unpacking_done:;
  }
  __pyx_t_2 = __Pyx_PyIndex_AsSsize_t(__pyx_t_5); if (unlikely((__pyx_t_2 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5553; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 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[2]; __pyx_lineno = 5553; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_v_N = __pyx_t_2;
  __pyx_v_K = __pyx_t_1;

  /* "pandas/src/generated.pyx":5555
 *     N, K = (<object> values).shape
 * 
 *     if K > 1:             # <<<<<<<<<<<<<<
 *         for i in range(N):
 * 
 */
  __pyx_t_3 = ((__pyx_v_K > 1) != 0);
  if (__pyx_t_3) {

    /* "pandas/src/generated.pyx":5556
 * 
 *     if K > 1:
 *         for i in range(N):             # <<<<<<<<<<<<<<
 * 
 *             lab = labels[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;

      /* "pandas/src/generated.pyx":5558
 *         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_pybuffernd_labels.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_labels.diminfo[0].strides));

      /* "pandas/src/generated.pyx":5559
 * 
 *             lab = labels[i]
 *             if lab < 0:             # <<<<<<<<<<<<<<
 *                 continue
 * 
 */
      __pyx_t_3 = ((__pyx_v_lab < 0) != 0);
      if (__pyx_t_3) {

        /* "pandas/src/generated.pyx":5560
 *             lab = labels[i]
 *             if lab < 0:
 *                 continue             # <<<<<<<<<<<<<<
 * 
 *             counts[lab] += 1
 */
        goto __pyx_L7_continue;
      }

      /* "pandas/src/generated.pyx":5562
 *                 continue
 * 
 *             counts[lab] += 1             # <<<<<<<<<<<<<<
 * 
 *             for j in range(K):
 */
      __pyx_t_15 = __pyx_v_lab;
      *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_counts.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_counts.diminfo[0].strides) += 1;

      /* "pandas/src/generated.pyx":5564
 *             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;

        /* "pandas/src/generated.pyx":5565
 * 
 *             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_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_values.diminfo[0].strides, __pyx_t_19, __pyx_pybuffernd_values.diminfo[1].strides));

        /* "pandas/src/generated.pyx":5568
 * 
 *                 # not nan
 *                 if val == val:             # <<<<<<<<<<<<<<
 *                     nobs[lab, j] += 1
 *                     sumx[lab, j] += val
 */
        __pyx_t_3 = ((__pyx_v_val == __pyx_v_val) != 0);
        if (__pyx_t_3) {

          /* "pandas/src/generated.pyx":5569
 *                 # 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_pybuffernd_nobs.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_nobs.diminfo[0].strides, __pyx_t_21, __pyx_pybuffernd_nobs.diminfo[1].strides) += 1.0;

          /* "pandas/src/generated.pyx":5570
 *                 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_pybuffernd_sumx.rcbuffer->pybuffer.buf, __pyx_t_22, __pyx_pybuffernd_sumx.diminfo[0].strides, __pyx_t_23, __pyx_pybuffernd_sumx.diminfo[1].strides) += __pyx_v_val;

          /* "pandas/src/generated.pyx":5571
 *                     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_pybuffernd_sumxx.rcbuffer->pybuffer.buf, __pyx_t_24, __pyx_pybuffernd_sumxx.diminfo[0].strides, __pyx_t_25, __pyx_pybuffernd_sumxx.diminfo[1].strides) += (__pyx_v_val * __pyx_v_val);
          goto __pyx_L12;
        }
        __pyx_L12:;
      }
      __pyx_L7_continue:;
    }
    goto __pyx_L6;
  }
  /*else*/ {

    /* "pandas/src/generated.pyx":5573
 *                     sumxx[lab, j] += val * val
 *     else:
 *         for i in range(N):             # <<<<<<<<<<<<<<
 * 
 *             lab = labels[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;

      /* "pandas/src/generated.pyx":5575
 *         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_pybuffernd_labels.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_labels.diminfo[0].strides));

      /* "pandas/src/generated.pyx":5576
 * 
 *             lab = labels[i]
 *             if lab < 0:             # <<<<<<<<<<<<<<
 *                 continue
 * 
 */
      __pyx_t_3 = ((__pyx_v_lab < 0) != 0);
      if (__pyx_t_3) {

        /* "pandas/src/generated.pyx":5577
 *             lab = labels[i]
 *             if lab < 0:
 *                 continue             # <<<<<<<<<<<<<<
 * 
 *             counts[lab] += 1
 */
        goto __pyx_L13_continue;
      }

      /* "pandas/src/generated.pyx":5579
 *                 continue
 * 
 *             counts[lab] += 1             # <<<<<<<<<<<<<<
 *             val = values[i, 0]
 *             # not nan
 */
      __pyx_t_17 = __pyx_v_lab;
      *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_counts.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_counts.diminfo[0].strides) += 1;

      /* "pandas/src/generated.pyx":5580
 * 
 *             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_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_26, __pyx_pybuffernd_values.diminfo[0].strides, __pyx_t_27, __pyx_pybuffernd_values.diminfo[1].strides));

      /* "pandas/src/generated.pyx":5582
 *             val = values[i, 0]
 *             # not nan
 *             if val == val:             # <<<<<<<<<<<<<<
 *                 nobs[lab, 0] += 1
 *                 sumx[lab, 0] += val
 */
      __pyx_t_3 = ((__pyx_v_val == __pyx_v_val) != 0);
      if (__pyx_t_3) {

        /* "pandas/src/generated.pyx":5583
 *             # 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_pybuffernd_nobs.rcbuffer->pybuffer.buf, __pyx_t_28, __pyx_pybuffernd_nobs.diminfo[0].strides, __pyx_t_29, __pyx_pybuffernd_nobs.diminfo[1].strides) += 1.0;

        /* "pandas/src/generated.pyx":5584
 *             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_pybuffernd_sumx.rcbuffer->pybuffer.buf, __pyx_t_30, __pyx_pybuffernd_sumx.diminfo[0].strides, __pyx_t_31, __pyx_pybuffernd_sumx.diminfo[1].strides) += __pyx_v_val;

        /* "pandas/src/generated.pyx":5585
 *                 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_pybuffernd_sumxx.rcbuffer->pybuffer.buf, __pyx_t_32, __pyx_pybuffernd_sumxx.diminfo[0].strides, __pyx_t_33, __pyx_pybuffernd_sumxx.diminfo[1].strides) += (__pyx_v_val * __pyx_v_val);
        goto __pyx_L16;
      }
      __pyx_L16:;
      __pyx_L13_continue:;
    }
  }
  __pyx_L6:;

  /* "pandas/src/generated.pyx":5588
 * 
 * 
 *     for i in range(len(counts)):             # <<<<<<<<<<<<<<
 *         for j in range(K):
 *             ct = nobs[i, j]
 */
  __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_counts)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5588; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) {
    __pyx_v_i = __pyx_t_2;

    /* "pandas/src/generated.pyx":5589
 * 
 *     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;

      /* "pandas/src/generated.pyx":5590
 *     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_pybuffernd_nobs.rcbuffer->pybuffer.buf, __pyx_t_36, __pyx_pybuffernd_nobs.diminfo[0].strides, __pyx_t_37, __pyx_pybuffernd_nobs.diminfo[1].strides));

      /* "pandas/src/generated.pyx":5591
 *         for j in range(K):
 *             ct = nobs[i, j]
 *             if ct < 2:             # <<<<<<<<<<<<<<
 *                 out[i, j] = nan
 *             else:
 */
      __pyx_t_3 = ((__pyx_v_ct < 2.0) != 0);
      if (__pyx_t_3) {

        /* "pandas/src/generated.pyx":5592
 *             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_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_38, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_39, __pyx_pybuffernd_out.diminfo[1].strides) = __pyx_v_6pandas_5algos_nan;
        goto __pyx_L21;
      }
      /*else*/ {

        /* "pandas/src/generated.pyx":5594
 *                 out[i, j] = nan
 *             else:
 *                 out[i, j] = ((ct * sumxx[i, j] - sumx[i, j] * sumx[i, j]) /             # <<<<<<<<<<<<<<
 *                              (ct * ct - ct))
 * @cython.wraparound(False)
 */
        __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_pybuffernd_sumxx.rcbuffer->pybuffer.buf, __pyx_t_40, __pyx_pybuffernd_sumxx.diminfo[0].strides, __pyx_t_41, __pyx_pybuffernd_sumxx.diminfo[1].strides))) - ((*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_sumx.rcbuffer->pybuffer.buf, __pyx_t_42, __pyx_pybuffernd_sumx.diminfo[0].strides, __pyx_t_43, __pyx_pybuffernd_sumx.diminfo[1].strides)) * (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_sumx.rcbuffer->pybuffer.buf, __pyx_t_44, __pyx_pybuffernd_sumx.diminfo[0].strides, __pyx_t_45, __pyx_pybuffernd_sumx.diminfo[1].strides))));

        /* "pandas/src/generated.pyx":5595
 *             else:
 *                 out[i, j] = ((ct * sumxx[i, j] - sumx[i, j] * sumx[i, j]) /
 *                              (ct * ct - ct))             # <<<<<<<<<<<<<<
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 */
        __pyx_t_47 = ((__pyx_v_ct * __pyx_v_ct) - __pyx_v_ct);

        /* "pandas/src/generated.pyx":5594
 *                 out[i, j] = nan
 *             else:
 *                 out[i, j] = ((ct * sumxx[i, j] - sumx[i, j] * sumx[i, j]) /             # <<<<<<<<<<<<<<
 *                              (ct * ct - ct))
 * @cython.wraparound(False)
 */
        if (unlikely(__pyx_t_47 == 0)) {
          #ifdef WITH_THREAD
          PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
          #endif
          PyErr_SetString(PyExc_ZeroDivisionError, "float division");
          #ifdef WITH_THREAD
          PyGILState_Release(__pyx_gilstate_save);
          #endif
          {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5594; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        __pyx_t_48 = __pyx_v_i;
        __pyx_t_49 = __pyx_v_j;
        *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_48, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_49, __pyx_pybuffernd_out.diminfo[1].strides) = (__pyx_t_46 / __pyx_t_47);
      }
      __pyx_L21:;
    }
  }

  /* "pandas/src/generated.pyx":5537
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def group_var_float64(ndarray[float64_t, ndim=2] out,             # <<<<<<<<<<<<<<
 *               ndarray[int64_t] counts,
 *               ndarray[float64_t, ndim=2] values,
 */

  /* function exit code */
  __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_12);
  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
    __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_counts.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_labels.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_sumx.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_sumxx.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas.algos.group_var_float64", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_counts.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_labels.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_sumx.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_sumxx.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer);
  __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;
}

/* "pandas/src/generated.pyx":5598
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def group_var_float32(ndarray[float32_t, ndim=2] out,             # <<<<<<<<<<<<<<
 *               ndarray[int64_t] counts,
 *               ndarray[float32_t, ndim=2] values,
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pandas_5algos_421group_var_float32(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_5algos_421group_var_float32 = {__Pyx_NAMESTR("group_var_float32"), (PyCFunction)__pyx_pw_6pandas_5algos_421group_var_float32, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pw_6pandas_5algos_421group_var_float32(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;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("group_var_float32 (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_out,&__pyx_n_s_counts,&__pyx_n_s_values,&__pyx_n_s_labels,0};
    PyObject* values[4] = {0,0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_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 (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_out)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_counts)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("group_var_float32", 1, 4, 4, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5598; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("group_var_float32", 1, 4, 4, 2); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5598; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  3:
        if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_labels)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("group_var_float32", 1, 4, 4, 3); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5598; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "group_var_float32") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5598; __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_float32", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5598; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas.algos.group_var_float32", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_out), __pyx_ptype_5numpy_ndarray, 1, "out", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5598; __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[2]; __pyx_lineno = 5599; __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[2]; __pyx_lineno = 5600; __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[2]; __pyx_lineno = 5601; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_420group_var_float32(__pyx_self, __pyx_v_out, __pyx_v_counts, __pyx_v_values, __pyx_v_labels);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pandas_5algos_420group_var_float32(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_out, PyArrayObject *__pyx_v_counts, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_labels) {
  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_float32_t __pyx_v_val;
  __pyx_t_5numpy_float32_t __pyx_v_ct;
  PyArrayObject *__pyx_v_nobs = 0;
  PyArrayObject *__pyx_v_sumx = 0;
  PyArrayObject *__pyx_v_sumxx = 0;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_counts;
  __Pyx_Buffer __pyx_pybuffer_counts;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_labels;
  __Pyx_Buffer __pyx_pybuffer_labels;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_nobs;
  __Pyx_Buffer __pyx_pybuffer_nobs;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_out;
  __Pyx_Buffer __pyx_pybuffer_out;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_sumx;
  __Pyx_Buffer __pyx_pybuffer_sumx;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_sumxx;
  __Pyx_Buffer __pyx_pybuffer_sumxx;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_values;
  __Pyx_Buffer __pyx_pybuffer_values;
  PyObject *__pyx_r = NULL;
  __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;
  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;
  PyObject *__pyx_t_12 = NULL;
  PyObject *(*__pyx_t_13)(PyObject *);
  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_float32_t __pyx_t_46;
  __pyx_t_5numpy_float32_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;
  __Pyx_RefNannySetupContext("group_var_float32", 0);
  __pyx_pybuffer_nobs.pybuffer.buf = NULL;
  __pyx_pybuffer_nobs.refcount = 0;
  __pyx_pybuffernd_nobs.data = NULL;
  __pyx_pybuffernd_nobs.rcbuffer = &__pyx_pybuffer_nobs;
  __pyx_pybuffer_sumx.pybuffer.buf = NULL;
  __pyx_pybuffer_sumx.refcount = 0;
  __pyx_pybuffernd_sumx.data = NULL;
  __pyx_pybuffernd_sumx.rcbuffer = &__pyx_pybuffer_sumx;
  __pyx_pybuffer_sumxx.pybuffer.buf = NULL;
  __pyx_pybuffer_sumxx.refcount = 0;
  __pyx_pybuffernd_sumxx.data = NULL;
  __pyx_pybuffernd_sumxx.rcbuffer = &__pyx_pybuffer_sumxx;
  __pyx_pybuffer_out.pybuffer.buf = NULL;
  __pyx_pybuffer_out.refcount = 0;
  __pyx_pybuffernd_out.data = NULL;
  __pyx_pybuffernd_out.rcbuffer = &__pyx_pybuffer_out;
  __pyx_pybuffer_counts.pybuffer.buf = NULL;
  __pyx_pybuffer_counts.refcount = 0;
  __pyx_pybuffernd_counts.data = NULL;
  __pyx_pybuffernd_counts.rcbuffer = &__pyx_pybuffer_counts;
  __pyx_pybuffer_values.pybuffer.buf = NULL;
  __pyx_pybuffer_values.refcount = 0;
  __pyx_pybuffernd_values.data = NULL;
  __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values;
  __pyx_pybuffer_labels.pybuffer.buf = NULL;
  __pyx_pybuffer_labels.refcount = 0;
  __pyx_pybuffernd_labels.data = NULL;
  __pyx_pybuffernd_labels.rcbuffer = &__pyx_pybuffer_labels;
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_out.rcbuffer->pybuffer, (PyObject*)__pyx_v_out, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5598; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_out.diminfo[0].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_out.diminfo[0].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_out.diminfo[1].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_out.diminfo[1].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[1];
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_counts.rcbuffer->pybuffer, (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[2]; __pyx_lineno = 5598; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_counts.diminfo[0].strides = __pyx_pybuffernd_counts.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_counts.diminfo[0].shape = __pyx_pybuffernd_counts.rcbuffer->pybuffer.shape[0];
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5598; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_values.diminfo[1].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_values.diminfo[1].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[1];
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_labels.rcbuffer->pybuffer, (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[2]; __pyx_lineno = 5598; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_labels.diminfo[0].strides = __pyx_pybuffernd_labels.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_labels.diminfo[0].shape = __pyx_pybuffernd_labels.rcbuffer->pybuffer.shape[0];

  /* "pandas/src/generated.pyx":5607
 *         ndarray[float32_t, ndim=2] nobs, sumx, sumxx
 * 
 *     if not len(values) == len(labels):             # <<<<<<<<<<<<<<
 *        raise AssertionError("len(index) != len(labels)")
 * 
 */
  __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_values)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5607; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_2 = PyObject_Length(((PyObject *)__pyx_v_labels)); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5607; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_3 = ((!((__pyx_t_1 == __pyx_t_2) != 0)) != 0);
  if (__pyx_t_3) {

    /* "pandas/src/generated.pyx":5608
 * 
 *     if not len(values) == len(labels):
 *        raise AssertionError("len(index) != len(labels)")             # <<<<<<<<<<<<<<
 * 
 *     nobs = np.zeros_like(out)
 */
    __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_AssertionError, __pyx_tuple__201, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5608; __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[2]; __pyx_lineno = 5608; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }

  /* "pandas/src/generated.pyx":5610
 *        raise AssertionError("len(index) != len(labels)")
 * 
 *     nobs = np.zeros_like(out)             # <<<<<<<<<<<<<<
 *     sumx = np.zeros_like(out)
 *     sumxx = np.zeros_like(out)
 */
  __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5610; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_zeros_like); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5610; __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[2]; __pyx_lineno = 5610; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_INCREF(((PyObject *)__pyx_v_out));
  PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_v_out));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_out));
  __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_4, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5610; __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_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[2]; __pyx_lineno = 5610; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_7 = ((PyArrayObject *)__pyx_t_6);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer);
    __pyx_t_8 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer, (PyObject*)__pyx_t_7, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 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_pybuffernd_nobs.rcbuffer->pybuffer, (PyObject*)__pyx_v_nobs, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, 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_pybuffernd_nobs.diminfo[0].strides = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_nobs.diminfo[0].shape = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_nobs.diminfo[1].strides = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_nobs.diminfo[1].shape = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.shape[1];
    if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5610; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_7 = 0;
  __pyx_v_nobs = ((PyArrayObject *)__pyx_t_6);
  __pyx_t_6 = 0;

  /* "pandas/src/generated.pyx":5611
 * 
 *     nobs = np.zeros_like(out)
 *     sumx = np.zeros_like(out)             # <<<<<<<<<<<<<<
 *     sumxx = np.zeros_like(out)
 * 
 */
  __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5611; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_zeros_like); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5611; __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[2]; __pyx_lineno = 5611; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_INCREF(((PyObject *)__pyx_v_out));
  PyTuple_SET_ITEM(__pyx_t_6, 0, ((PyObject *)__pyx_v_out));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_out));
  __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5611; __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;
  if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5611; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_7 = ((PyArrayObject *)__pyx_t_5);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_sumx.rcbuffer->pybuffer);
    __pyx_t_8 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_sumx.rcbuffer->pybuffer, (PyObject*)__pyx_t_7, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 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_pybuffernd_sumx.rcbuffer->pybuffer, (PyObject*)__pyx_v_sumx, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 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_pybuffernd_sumx.diminfo[0].strides = __pyx_pybuffernd_sumx.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_sumx.diminfo[0].shape = __pyx_pybuffernd_sumx.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_sumx.diminfo[1].strides = __pyx_pybuffernd_sumx.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_sumx.diminfo[1].shape = __pyx_pybuffernd_sumx.rcbuffer->pybuffer.shape[1];
    if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5611; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_7 = 0;
  __pyx_v_sumx = ((PyArrayObject *)__pyx_t_5);
  __pyx_t_5 = 0;

  /* "pandas/src/generated.pyx":5612
 *     nobs = np.zeros_like(out)
 *     sumx = np.zeros_like(out)
 *     sumxx = np.zeros_like(out)             # <<<<<<<<<<<<<<
 * 
 *     N, K = (<object> values).shape
 */
  __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5612; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_zeros_like); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5612; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __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 = 5612; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__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_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5612; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __Pyx_DECREF(__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[2]; __pyx_lineno = 5612; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_7 = ((PyArrayObject *)__pyx_t_4);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_sumxx.rcbuffer->pybuffer);
    __pyx_t_8 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_sumxx.rcbuffer->pybuffer, (PyObject*)__pyx_t_7, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 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_pybuffernd_sumxx.rcbuffer->pybuffer, (PyObject*)__pyx_v_sumxx, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, 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_pybuffernd_sumxx.diminfo[0].strides = __pyx_pybuffernd_sumxx.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_sumxx.diminfo[0].shape = __pyx_pybuffernd_sumxx.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_sumxx.diminfo[1].strides = __pyx_pybuffernd_sumxx.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_sumxx.diminfo[1].shape = __pyx_pybuffernd_sumxx.rcbuffer->pybuffer.shape[1];
    if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5612; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_7 = 0;
  __pyx_v_sumxx = ((PyArrayObject *)__pyx_t_4);
  __pyx_t_4 = 0;

  /* "pandas/src/generated.pyx":5614
 *     sumxx = np.zeros_like(out)
 * 
 *     N, K = (<object> values).shape             # <<<<<<<<<<<<<<
 * 
 *     if K > 1:
 */
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_values), __pyx_n_s_shape); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5614; __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 CYTHON_COMPILING_IN_CPYTHON
    Py_ssize_t size = Py_SIZE(sequence);
    #else
    Py_ssize_t size = PySequence_Size(sequence);
    #endif
    if (unlikely(size != 2)) {
      if (size > 2) __Pyx_RaiseTooManyValuesError(2);
      else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
      {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5614; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    #if CYTHON_COMPILING_IN_CPYTHON
    if (likely(PyTuple_CheckExact(sequence))) {
      __pyx_t_5 = PyTuple_GET_ITEM(sequence, 0); 
      __pyx_t_6 = PyTuple_GET_ITEM(sequence, 1); 
    } else {
      __pyx_t_5 = PyList_GET_ITEM(sequence, 0); 
      __pyx_t_6 = PyList_GET_ITEM(sequence, 1); 
    }
    __Pyx_INCREF(__pyx_t_5);
    __Pyx_INCREF(__pyx_t_6);
    #else
    __pyx_t_5 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5614; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5614; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    #endif
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  } else {
    Py_ssize_t index = -1;
    __pyx_t_12 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5614; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_12);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_13 = Py_TYPE(__pyx_t_12)->tp_iternext;
    index = 0; __pyx_t_5 = __pyx_t_13(__pyx_t_12); if (unlikely(!__pyx_t_5)) goto __pyx_L4_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_5);
    index = 1; __pyx_t_6 = __pyx_t_13(__pyx_t_12); if (unlikely(!__pyx_t_6)) goto __pyx_L4_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_6);
    if (__Pyx_IternextUnpackEndCheck(__pyx_t_13(__pyx_t_12), 2) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5614; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_13 = NULL;
    __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
    goto __pyx_L5_unpacking_done;
    __pyx_L4_unpacking_failed:;
    __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
    __pyx_t_13 = NULL;
    if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
    {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5614; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_L5_unpacking_done:;
  }
  __pyx_t_2 = __Pyx_PyIndex_AsSsize_t(__pyx_t_5); if (unlikely((__pyx_t_2 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5614; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 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[2]; __pyx_lineno = 5614; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_v_N = __pyx_t_2;
  __pyx_v_K = __pyx_t_1;

  /* "pandas/src/generated.pyx":5616
 *     N, K = (<object> values).shape
 * 
 *     if K > 1:             # <<<<<<<<<<<<<<
 *         for i in range(N):
 * 
 */
  __pyx_t_3 = ((__pyx_v_K > 1) != 0);
  if (__pyx_t_3) {

    /* "pandas/src/generated.pyx":5617
 * 
 *     if K > 1:
 *         for i in range(N):             # <<<<<<<<<<<<<<
 * 
 *             lab = labels[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;

      /* "pandas/src/generated.pyx":5619
 *         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_pybuffernd_labels.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_labels.diminfo[0].strides));

      /* "pandas/src/generated.pyx":5620
 * 
 *             lab = labels[i]
 *             if lab < 0:             # <<<<<<<<<<<<<<
 *                 continue
 * 
 */
      __pyx_t_3 = ((__pyx_v_lab < 0) != 0);
      if (__pyx_t_3) {

        /* "pandas/src/generated.pyx":5621
 *             lab = labels[i]
 *             if lab < 0:
 *                 continue             # <<<<<<<<<<<<<<
 * 
 *             counts[lab] += 1
 */
        goto __pyx_L7_continue;
      }

      /* "pandas/src/generated.pyx":5623
 *                 continue
 * 
 *             counts[lab] += 1             # <<<<<<<<<<<<<<
 * 
 *             for j in range(K):
 */
      __pyx_t_15 = __pyx_v_lab;
      *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_counts.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_counts.diminfo[0].strides) += 1;

      /* "pandas/src/generated.pyx":5625
 *             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;

        /* "pandas/src/generated.pyx":5626
 * 
 *             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_float32_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_values.diminfo[0].strides, __pyx_t_19, __pyx_pybuffernd_values.diminfo[1].strides));

        /* "pandas/src/generated.pyx":5629
 * 
 *                 # not nan
 *                 if val == val:             # <<<<<<<<<<<<<<
 *                     nobs[lab, j] += 1
 *                     sumx[lab, j] += val
 */
        __pyx_t_3 = ((__pyx_v_val == __pyx_v_val) != 0);
        if (__pyx_t_3) {

          /* "pandas/src/generated.pyx":5630
 *                 # 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_float32_t *, __pyx_pybuffernd_nobs.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_nobs.diminfo[0].strides, __pyx_t_21, __pyx_pybuffernd_nobs.diminfo[1].strides) += 1.0;

          /* "pandas/src/generated.pyx":5631
 *                 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_float32_t *, __pyx_pybuffernd_sumx.rcbuffer->pybuffer.buf, __pyx_t_22, __pyx_pybuffernd_sumx.diminfo[0].strides, __pyx_t_23, __pyx_pybuffernd_sumx.diminfo[1].strides) += __pyx_v_val;

          /* "pandas/src/generated.pyx":5632
 *                     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_float32_t *, __pyx_pybuffernd_sumxx.rcbuffer->pybuffer.buf, __pyx_t_24, __pyx_pybuffernd_sumxx.diminfo[0].strides, __pyx_t_25, __pyx_pybuffernd_sumxx.diminfo[1].strides) += (__pyx_v_val * __pyx_v_val);
          goto __pyx_L12;
        }
        __pyx_L12:;
      }
      __pyx_L7_continue:;
    }
    goto __pyx_L6;
  }
  /*else*/ {

    /* "pandas/src/generated.pyx":5634
 *                     sumxx[lab, j] += val * val
 *     else:
 *         for i in range(N):             # <<<<<<<<<<<<<<
 * 
 *             lab = labels[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;

      /* "pandas/src/generated.pyx":5636
 *         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_pybuffernd_labels.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_labels.diminfo[0].strides));

      /* "pandas/src/generated.pyx":5637
 * 
 *             lab = labels[i]
 *             if lab < 0:             # <<<<<<<<<<<<<<
 *                 continue
 * 
 */
      __pyx_t_3 = ((__pyx_v_lab < 0) != 0);
      if (__pyx_t_3) {

        /* "pandas/src/generated.pyx":5638
 *             lab = labels[i]
 *             if lab < 0:
 *                 continue             # <<<<<<<<<<<<<<
 * 
 *             counts[lab] += 1
 */
        goto __pyx_L13_continue;
      }

      /* "pandas/src/generated.pyx":5640
 *                 continue
 * 
 *             counts[lab] += 1             # <<<<<<<<<<<<<<
 *             val = values[i, 0]
 *             # not nan
 */
      __pyx_t_17 = __pyx_v_lab;
      *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_counts.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_counts.diminfo[0].strides) += 1;

      /* "pandas/src/generated.pyx":5641
 * 
 *             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_float32_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_26, __pyx_pybuffernd_values.diminfo[0].strides, __pyx_t_27, __pyx_pybuffernd_values.diminfo[1].strides));

      /* "pandas/src/generated.pyx":5643
 *             val = values[i, 0]
 *             # not nan
 *             if val == val:             # <<<<<<<<<<<<<<
 *                 nobs[lab, 0] += 1
 *                 sumx[lab, 0] += val
 */
      __pyx_t_3 = ((__pyx_v_val == __pyx_v_val) != 0);
      if (__pyx_t_3) {

        /* "pandas/src/generated.pyx":5644
 *             # 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_float32_t *, __pyx_pybuffernd_nobs.rcbuffer->pybuffer.buf, __pyx_t_28, __pyx_pybuffernd_nobs.diminfo[0].strides, __pyx_t_29, __pyx_pybuffernd_nobs.diminfo[1].strides) += 1.0;

        /* "pandas/src/generated.pyx":5645
 *             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_float32_t *, __pyx_pybuffernd_sumx.rcbuffer->pybuffer.buf, __pyx_t_30, __pyx_pybuffernd_sumx.diminfo[0].strides, __pyx_t_31, __pyx_pybuffernd_sumx.diminfo[1].strides) += __pyx_v_val;

        /* "pandas/src/generated.pyx":5646
 *                 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_float32_t *, __pyx_pybuffernd_sumxx.rcbuffer->pybuffer.buf, __pyx_t_32, __pyx_pybuffernd_sumxx.diminfo[0].strides, __pyx_t_33, __pyx_pybuffernd_sumxx.diminfo[1].strides) += (__pyx_v_val * __pyx_v_val);
        goto __pyx_L16;
      }
      __pyx_L16:;
      __pyx_L13_continue:;
    }
  }
  __pyx_L6:;

  /* "pandas/src/generated.pyx":5649
 * 
 * 
 *     for i in range(len(counts)):             # <<<<<<<<<<<<<<
 *         for j in range(K):
 *             ct = nobs[i, j]
 */
  __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_counts)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5649; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) {
    __pyx_v_i = __pyx_t_2;

    /* "pandas/src/generated.pyx":5650
 * 
 *     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;

      /* "pandas/src/generated.pyx":5651
 *     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_float32_t *, __pyx_pybuffernd_nobs.rcbuffer->pybuffer.buf, __pyx_t_36, __pyx_pybuffernd_nobs.diminfo[0].strides, __pyx_t_37, __pyx_pybuffernd_nobs.diminfo[1].strides));

      /* "pandas/src/generated.pyx":5652
 *         for j in range(K):
 *             ct = nobs[i, j]
 *             if ct < 2:             # <<<<<<<<<<<<<<
 *                 out[i, j] = nan
 *             else:
 */
      __pyx_t_3 = ((__pyx_v_ct < 2.0) != 0);
      if (__pyx_t_3) {

        /* "pandas/src/generated.pyx":5653
 *             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_float32_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_38, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_39, __pyx_pybuffernd_out.diminfo[1].strides) = __pyx_v_6pandas_5algos_nan;
        goto __pyx_L21;
      }
      /*else*/ {

        /* "pandas/src/generated.pyx":5655
 *                 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_float32_t *, __pyx_pybuffernd_sumxx.rcbuffer->pybuffer.buf, __pyx_t_40, __pyx_pybuffernd_sumxx.diminfo[0].strides, __pyx_t_41, __pyx_pybuffernd_sumxx.diminfo[1].strides))) - ((*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_sumx.rcbuffer->pybuffer.buf, __pyx_t_42, __pyx_pybuffernd_sumx.diminfo[0].strides, __pyx_t_43, __pyx_pybuffernd_sumx.diminfo[1].strides)) * (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_sumx.rcbuffer->pybuffer.buf, __pyx_t_44, __pyx_pybuffernd_sumx.diminfo[0].strides, __pyx_t_45, __pyx_pybuffernd_sumx.diminfo[1].strides))));

        /* "pandas/src/generated.pyx":5656
 *             else:
 *                 out[i, j] = ((ct * sumxx[i, j] - sumx[i, j] * sumx[i, j]) /
 *                              (ct * ct - ct))             # <<<<<<<<<<<<<<
 * 
 * @cython.wraparound(False)
 */
        __pyx_t_47 = ((__pyx_v_ct * __pyx_v_ct) - __pyx_v_ct);

        /* "pandas/src/generated.pyx":5655
 *                 out[i, j] = nan
 *             else:
 *                 out[i, j] = ((ct * sumxx[i, j] - sumx[i, j] * sumx[i, j]) /             # <<<<<<<<<<<<<<
 *                              (ct * ct - ct))
 * 
 */
        if (unlikely(__pyx_t_47 == 0)) {
          #ifdef WITH_THREAD
          PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
          #endif
          PyErr_SetString(PyExc_ZeroDivisionError, "float division");
          #ifdef WITH_THREAD
          PyGILState_Release(__pyx_gilstate_save);
          #endif
          {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5655; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        __pyx_t_48 = __pyx_v_i;
        __pyx_t_49 = __pyx_v_j;
        *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_48, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_49, __pyx_pybuffernd_out.diminfo[1].strides) = (__pyx_t_46 / __pyx_t_47);
      }
      __pyx_L21:;
    }
  }

  /* "pandas/src/generated.pyx":5598
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def group_var_float32(ndarray[float32_t, ndim=2] out,             # <<<<<<<<<<<<<<
 *               ndarray[int64_t] counts,
 *               ndarray[float32_t, ndim=2] values,
 */

  /* function exit code */
  __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_12);
  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
    __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_counts.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_labels.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_sumx.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_sumxx.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas.algos.group_var_float32", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_counts.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_labels.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_sumx.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_sumxx.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer);
  __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;
}

/* "pandas/src/generated.pyx":5660
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def group_var_bin_float64(ndarray[float64_t, ndim=2] out,             # <<<<<<<<<<<<<<
 *                   ndarray[int64_t] counts,
 *                   ndarray[float64_t, ndim=2] values,
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pandas_5algos_423group_var_bin_float64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_5algos_423group_var_bin_float64 = {__Pyx_NAMESTR("group_var_bin_float64"), (PyCFunction)__pyx_pw_6pandas_5algos_423group_var_bin_float64, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pw_6pandas_5algos_423group_var_bin_float64(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;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("group_var_bin_float64 (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_out,&__pyx_n_s_counts,&__pyx_n_s_values,&__pyx_n_s_bins,0};
    PyObject* values[4] = {0,0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_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 (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_out)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_counts)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("group_var_bin_float64", 1, 4, 4, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5660; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("group_var_bin_float64", 1, 4, 4, 2); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5660; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  3:
        if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_bins)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("group_var_bin_float64", 1, 4, 4, 3); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5660; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "group_var_bin_float64") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5660; __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_float64", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5660; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas.algos.group_var_bin_float64", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_out), __pyx_ptype_5numpy_ndarray, 1, "out", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5660; __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[2]; __pyx_lineno = 5661; __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[2]; __pyx_lineno = 5662; __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[2]; __pyx_lineno = 5663; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_422group_var_bin_float64(__pyx_self, __pyx_v_out, __pyx_v_counts, __pyx_v_values, __pyx_v_bins);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pandas_5algos_422group_var_bin_float64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_out, PyArrayObject *__pyx_v_counts, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_bins) {
  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;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_bins;
  __Pyx_Buffer __pyx_pybuffer_bins;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_counts;
  __Pyx_Buffer __pyx_pybuffer_counts;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_nobs;
  __Pyx_Buffer __pyx_pybuffer_nobs;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_out;
  __Pyx_Buffer __pyx_pybuffer_out;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_sumx;
  __Pyx_Buffer __pyx_pybuffer_sumx;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_sumxx;
  __Pyx_Buffer __pyx_pybuffer_sumxx;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_values;
  __Pyx_Buffer __pyx_pybuffer_values;
  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;
  __Pyx_RefNannySetupContext("group_var_bin_float64", 0);
  __pyx_pybuffer_nobs.pybuffer.buf = NULL;
  __pyx_pybuffer_nobs.refcount = 0;
  __pyx_pybuffernd_nobs.data = NULL;
  __pyx_pybuffernd_nobs.rcbuffer = &__pyx_pybuffer_nobs;
  __pyx_pybuffer_sumx.pybuffer.buf = NULL;
  __pyx_pybuffer_sumx.refcount = 0;
  __pyx_pybuffernd_sumx.data = NULL;
  __pyx_pybuffernd_sumx.rcbuffer = &__pyx_pybuffer_sumx;
  __pyx_pybuffer_sumxx.pybuffer.buf = NULL;
  __pyx_pybuffer_sumxx.refcount = 0;
  __pyx_pybuffernd_sumxx.data = NULL;
  __pyx_pybuffernd_sumxx.rcbuffer = &__pyx_pybuffer_sumxx;
  __pyx_pybuffer_out.pybuffer.buf = NULL;
  __pyx_pybuffer_out.refcount = 0;
  __pyx_pybuffernd_out.data = NULL;
  __pyx_pybuffernd_out.rcbuffer = &__pyx_pybuffer_out;
  __pyx_pybuffer_counts.pybuffer.buf = NULL;
  __pyx_pybuffer_counts.refcount = 0;
  __pyx_pybuffernd_counts.data = NULL;
  __pyx_pybuffernd_counts.rcbuffer = &__pyx_pybuffer_counts;
  __pyx_pybuffer_values.pybuffer.buf = NULL;
  __pyx_pybuffer_values.refcount = 0;
  __pyx_pybuffernd_values.data = NULL;
  __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values;
  __pyx_pybuffer_bins.pybuffer.buf = NULL;
  __pyx_pybuffer_bins.refcount = 0;
  __pyx_pybuffernd_bins.data = NULL;
  __pyx_pybuffernd_bins.rcbuffer = &__pyx_pybuffer_bins;
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_out.rcbuffer->pybuffer, (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[2]; __pyx_lineno = 5660; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_out.diminfo[0].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_out.diminfo[0].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_out.diminfo[1].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_out.diminfo[1].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[1];
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_counts.rcbuffer->pybuffer, (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[2]; __pyx_lineno = 5660; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_counts.diminfo[0].strides = __pyx_pybuffernd_counts.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_counts.diminfo[0].shape = __pyx_pybuffernd_counts.rcbuffer->pybuffer.shape[0];
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (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[2]; __pyx_lineno = 5660; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_values.diminfo[1].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_values.diminfo[1].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[1];
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_bins.rcbuffer->pybuffer, (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[2]; __pyx_lineno = 5660; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_bins.diminfo[0].strides = __pyx_pybuffernd_bins.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_bins.diminfo[0].shape = __pyx_pybuffernd_bins.rcbuffer->pybuffer.shape[0];

  /* "pandas/src/generated.pyx":5670
 *         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_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5670; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros_like); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5670; __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[2]; __pyx_lineno = 5670; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__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 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5670; __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 (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5670; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_4 = ((PyArrayObject *)__pyx_t_3);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer);
    __pyx_t_5 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer, (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_pybuffernd_nobs.rcbuffer->pybuffer, (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_pybuffernd_nobs.diminfo[0].strides = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_nobs.diminfo[0].shape = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_nobs.diminfo[1].strides = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_nobs.diminfo[1].shape = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.shape[1];
    if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5670; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_4 = 0;
  __pyx_v_nobs = ((PyArrayObject *)__pyx_t_3);
  __pyx_t_3 = 0;

  /* "pandas/src/generated.pyx":5671
 * 
 *     nobs = np.zeros_like(out)
 *     sumx = np.zeros_like(out)             # <<<<<<<<<<<<<<
 *     sumxx = np.zeros_like(out)
 * 
 */
  __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5671; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_zeros_like); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5671; __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[2]; __pyx_lineno = 5671; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__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 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5671; __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;
  if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5671; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_4 = ((PyArrayObject *)__pyx_t_2);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_sumx.rcbuffer->pybuffer);
    __pyx_t_5 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_sumx.rcbuffer->pybuffer, (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_pybuffernd_sumx.rcbuffer->pybuffer, (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_pybuffernd_sumx.diminfo[0].strides = __pyx_pybuffernd_sumx.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_sumx.diminfo[0].shape = __pyx_pybuffernd_sumx.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_sumx.diminfo[1].strides = __pyx_pybuffernd_sumx.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_sumx.diminfo[1].shape = __pyx_pybuffernd_sumx.rcbuffer->pybuffer.shape[1];
    if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5671; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_4 = 0;
  __pyx_v_sumx = ((PyArrayObject *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "pandas/src/generated.pyx":5672
 *     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_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5672; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_zeros_like); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5672; __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[2]; __pyx_lineno = 5672; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__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 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5672; __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;
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5672; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_4 = ((PyArrayObject *)__pyx_t_1);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_sumxx.rcbuffer->pybuffer);
    __pyx_t_5 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_sumxx.rcbuffer->pybuffer, (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_pybuffernd_sumxx.rcbuffer->pybuffer, (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_pybuffernd_sumxx.diminfo[0].strides = __pyx_pybuffernd_sumxx.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_sumxx.diminfo[0].shape = __pyx_pybuffernd_sumxx.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_sumxx.diminfo[1].strides = __pyx_pybuffernd_sumxx.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_sumxx.diminfo[1].shape = __pyx_pybuffernd_sumxx.rcbuffer->pybuffer.shape[1];
    if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5672; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_4 = 0;
  __pyx_v_sumxx = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pandas/src/generated.pyx":5674
 *     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[2]; __pyx_lineno = 5674; __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[2]; __pyx_lineno = 5674; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_12 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_bins.rcbuffer->pybuffer.buf, __pyx_t_10, __pyx_pybuffernd_bins.diminfo[0].strides)) == __pyx_t_11) != 0);
  if (__pyx_t_12) {

    /* "pandas/src/generated.pyx":5675
 * 
 *     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[2]; __pyx_lineno = 5675; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_v_ngroups = __pyx_t_11;
    goto __pyx_L3;
  }
  /*else*/ {

    /* "pandas/src/generated.pyx":5677
 *         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[2]; __pyx_lineno = 5677; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_v_ngroups = (__pyx_t_11 + 1);
  }
  __pyx_L3:;

  /* "pandas/src/generated.pyx":5679
 *         ngroups = len(bins) + 1
 * 
 *     N, K = (<object> values).shape             # <<<<<<<<<<<<<<
 * 
 *     b = 0
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_values), __pyx_n_s_shape); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5679; __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 CYTHON_COMPILING_IN_CPYTHON
    Py_ssize_t size = Py_SIZE(sequence);
    #else
    Py_ssize_t size = PySequence_Size(sequence);
    #endif
    if (unlikely(size != 2)) {
      if (size > 2) __Pyx_RaiseTooManyValuesError(2);
      else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
      {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5679; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    #if CYTHON_COMPILING_IN_CPYTHON
    if (likely(PyTuple_CheckExact(sequence))) {
      __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); 
      __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1); 
    } else {
      __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);
    #else
    __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5679; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5679; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    #endif
    __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[2]; __pyx_lineno = 5679; __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_L4_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_L4_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_3);
    if (__Pyx_IternextUnpackEndCheck(__pyx_t_14(__pyx_t_13), 2) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5679; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_14 = NULL;
    __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
    goto __pyx_L5_unpacking_done;
    __pyx_L4_unpacking_failed:;
    __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
    __pyx_t_14 = NULL;
    if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
    {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5679; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_L5_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[2]; __pyx_lineno = 5679; __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[2]; __pyx_lineno = 5679; __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;

  /* "pandas/src/generated.pyx":5681
 *     N, K = (<object> values).shape
 * 
 *     b = 0             # <<<<<<<<<<<<<<
 *     if K > 1:
 *         for i in range(N):
 */
  __pyx_v_b = 0;

  /* "pandas/src/generated.pyx":5682
 * 
 *     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) != 0);
  if (__pyx_t_12) {

    /* "pandas/src/generated.pyx":5683
 *     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;

      /* "pandas/src/generated.pyx":5684
 *     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)) != 0);
        if (__pyx_t_12) {
          __pyx_t_15 = __pyx_v_b;
          __pyx_t_16 = ((__pyx_v_i >= (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_bins.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_bins.diminfo[0].strides))) != 0);
          __pyx_t_17 = __pyx_t_16;
        } else {
          __pyx_t_17 = __pyx_t_12;
        }
        if (!__pyx_t_17) break;

        /* "pandas/src/generated.pyx":5685
 *         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);
      }

      /* "pandas/src/generated.pyx":5687
 *                 b += 1
 * 
 *             counts[b] += 1             # <<<<<<<<<<<<<<
 * 
 *             for j in range(K):
 */
      __pyx_t_18 = __pyx_v_b;
      *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_counts.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_counts.diminfo[0].strides) += 1;

      /* "pandas/src/generated.pyx":5689
 *             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;

        /* "pandas/src/generated.pyx":5690
 * 
 *             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_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_values.diminfo[0].strides, __pyx_t_22, __pyx_pybuffernd_values.diminfo[1].strides));

        /* "pandas/src/generated.pyx":5693
 * 
 *                 # not nan
 *                 if val == val:             # <<<<<<<<<<<<<<
 *                     nobs[b, j] += 1
 *                     sumx[b, j] += val
 */
        __pyx_t_17 = ((__pyx_v_val == __pyx_v_val) != 0);
        if (__pyx_t_17) {

          /* "pandas/src/generated.pyx":5694
 *                 # 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_pybuffernd_nobs.rcbuffer->pybuffer.buf, __pyx_t_23, __pyx_pybuffernd_nobs.diminfo[0].strides, __pyx_t_24, __pyx_pybuffernd_nobs.diminfo[1].strides) += 1.0;

          /* "pandas/src/generated.pyx":5695
 *                 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_pybuffernd_sumx.rcbuffer->pybuffer.buf, __pyx_t_25, __pyx_pybuffernd_sumx.diminfo[0].strides, __pyx_t_26, __pyx_pybuffernd_sumx.diminfo[1].strides) += __pyx_v_val;

          /* "pandas/src/generated.pyx":5696
 *                     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_pybuffernd_sumxx.rcbuffer->pybuffer.buf, __pyx_t_27, __pyx_pybuffernd_sumxx.diminfo[0].strides, __pyx_t_28, __pyx_pybuffernd_sumxx.diminfo[1].strides) += (__pyx_v_val * __pyx_v_val);
          goto __pyx_L13;
        }
        __pyx_L13:;
      }
    }
    goto __pyx_L6;
  }
  /*else*/ {

    /* "pandas/src/generated.pyx":5698
 *                     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;

      /* "pandas/src/generated.pyx":5699
 *     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)) != 0);
        if (__pyx_t_17) {
          __pyx_t_19 = __pyx_v_b;
          __pyx_t_12 = ((__pyx_v_i >= (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_bins.rcbuffer->pybuffer.buf, __pyx_t_19, __pyx_pybuffernd_bins.diminfo[0].strides))) != 0);
          __pyx_t_16 = __pyx_t_12;
        } else {
          __pyx_t_16 = __pyx_t_17;
        }
        if (!__pyx_t_16) break;

        /* "pandas/src/generated.pyx":5700
 *         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);
      }

      /* "pandas/src/generated.pyx":5702
 *                 b += 1
 * 
 *             counts[b] += 1             # <<<<<<<<<<<<<<
 *             val = values[i, 0]
 * 
 */
      __pyx_t_20 = __pyx_v_b;
      *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_counts.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_counts.diminfo[0].strides) += 1;

      /* "pandas/src/generated.pyx":5703
 * 
 *             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_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_29, __pyx_pybuffernd_values.diminfo[0].strides, __pyx_t_30, __pyx_pybuffernd_values.diminfo[1].strides));

      /* "pandas/src/generated.pyx":5706
 * 
 *             # not nan
 *             if val == val:             # <<<<<<<<<<<<<<
 *                 nobs[b, 0] += 1
 *                 sumx[b, 0] += val
 */
      __pyx_t_16 = ((__pyx_v_val == __pyx_v_val) != 0);
      if (__pyx_t_16) {

        /* "pandas/src/generated.pyx":5707
 *             # 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_pybuffernd_nobs.rcbuffer->pybuffer.buf, __pyx_t_31, __pyx_pybuffernd_nobs.diminfo[0].strides, __pyx_t_32, __pyx_pybuffernd_nobs.diminfo[1].strides) += 1.0;

        /* "pandas/src/generated.pyx":5708
 *             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_pybuffernd_sumx.rcbuffer->pybuffer.buf, __pyx_t_33, __pyx_pybuffernd_sumx.diminfo[0].strides, __pyx_t_34, __pyx_pybuffernd_sumx.diminfo[1].strides) += __pyx_v_val;

        /* "pandas/src/generated.pyx":5709
 *                 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_pybuffernd_sumxx.rcbuffer->pybuffer.buf, __pyx_t_35, __pyx_pybuffernd_sumxx.diminfo[0].strides, __pyx_t_36, __pyx_pybuffernd_sumxx.diminfo[1].strides) += (__pyx_v_val * __pyx_v_val);
        goto __pyx_L18;
      }
      __pyx_L18:;
    }
  }
  __pyx_L6:;

  /* "pandas/src/generated.pyx":5711
 *                 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;

    /* "pandas/src/generated.pyx":5712
 * 
 *     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;

      /* "pandas/src/generated.pyx":5713
 *     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_pybuffernd_nobs.rcbuffer->pybuffer.buf, __pyx_t_39, __pyx_pybuffernd_nobs.diminfo[0].strides, __pyx_t_40, __pyx_pybuffernd_nobs.diminfo[1].strides));

      /* "pandas/src/generated.pyx":5714
 *         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) != 0);
      if (__pyx_t_16) {

        /* "pandas/src/generated.pyx":5715
 *             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_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_41, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_42, __pyx_pybuffernd_out.diminfo[1].strides) = __pyx_v_6pandas_5algos_nan;
        goto __pyx_L23;
      }
      /*else*/ {

        /* "pandas/src/generated.pyx":5717
 *                 out[i, j] = nan
 *             else:
 *                 out[i, j] = ((ct * sumxx[i, j] - sumx[i, j] * sumx[i, j]) /             # <<<<<<<<<<<<<<
 *                              (ct * ct - ct))
 * @cython.wraparound(False)
 */
        __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_pybuffernd_sumxx.rcbuffer->pybuffer.buf, __pyx_t_43, __pyx_pybuffernd_sumxx.diminfo[0].strides, __pyx_t_44, __pyx_pybuffernd_sumxx.diminfo[1].strides))) - ((*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_sumx.rcbuffer->pybuffer.buf, __pyx_t_45, __pyx_pybuffernd_sumx.diminfo[0].strides, __pyx_t_46, __pyx_pybuffernd_sumx.diminfo[1].strides)) * (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_sumx.rcbuffer->pybuffer.buf, __pyx_t_47, __pyx_pybuffernd_sumx.diminfo[0].strides, __pyx_t_48, __pyx_pybuffernd_sumx.diminfo[1].strides))));

        /* "pandas/src/generated.pyx":5718
 *             else:
 *                 out[i, j] = ((ct * sumxx[i, j] - sumx[i, j] * sumx[i, j]) /
 *                              (ct * ct - ct))             # <<<<<<<<<<<<<<
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 */
        __pyx_t_50 = ((__pyx_v_ct * __pyx_v_ct) - __pyx_v_ct);

        /* "pandas/src/generated.pyx":5717
 *                 out[i, j] = nan
 *             else:
 *                 out[i, j] = ((ct * sumxx[i, j] - sumx[i, j] * sumx[i, j]) /             # <<<<<<<<<<<<<<
 *                              (ct * ct - ct))
 * @cython.wraparound(False)
 */
        if (unlikely(__pyx_t_50 == 0)) {
          #ifdef WITH_THREAD
          PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
          #endif
          PyErr_SetString(PyExc_ZeroDivisionError, "float division");
          #ifdef WITH_THREAD
          PyGILState_Release(__pyx_gilstate_save);
          #endif
          {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5717; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        __pyx_t_51 = __pyx_v_i;
        __pyx_t_52 = __pyx_v_j;
        *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_51, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_52, __pyx_pybuffernd_out.diminfo[1].strides) = (__pyx_t_49 / __pyx_t_50);
      }
      __pyx_L23:;
    }
  }

  /* "pandas/src/generated.pyx":5660
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def group_var_bin_float64(ndarray[float64_t, ndim=2] out,             # <<<<<<<<<<<<<<
 *                   ndarray[int64_t] counts,
 *                   ndarray[float64_t, ndim=2] values,
 */

  /* function exit code */
  __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_pybuffernd_bins.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_counts.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_sumx.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_sumxx.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas.algos.group_var_bin_float64", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_bins.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_counts.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_sumx.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_sumxx.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer);
  __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;
}

/* "pandas/src/generated.pyx":5721
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def group_var_bin_float32(ndarray[float32_t, ndim=2] out,             # <<<<<<<<<<<<<<
 *                   ndarray[int64_t] counts,
 *                   ndarray[float32_t, ndim=2] values,
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pandas_5algos_425group_var_bin_float32(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_5algos_425group_var_bin_float32 = {__Pyx_NAMESTR("group_var_bin_float32"), (PyCFunction)__pyx_pw_6pandas_5algos_425group_var_bin_float32, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pw_6pandas_5algos_425group_var_bin_float32(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;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("group_var_bin_float32 (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_out,&__pyx_n_s_counts,&__pyx_n_s_values,&__pyx_n_s_bins,0};
    PyObject* values[4] = {0,0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_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 (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_out)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_counts)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("group_var_bin_float32", 1, 4, 4, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5721; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("group_var_bin_float32", 1, 4, 4, 2); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5721; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  3:
        if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_bins)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("group_var_bin_float32", 1, 4, 4, 3); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5721; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "group_var_bin_float32") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5721; __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_float32", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5721; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas.algos.group_var_bin_float32", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_out), __pyx_ptype_5numpy_ndarray, 1, "out", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5721; __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[2]; __pyx_lineno = 5722; __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[2]; __pyx_lineno = 5723; __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[2]; __pyx_lineno = 5724; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_424group_var_bin_float32(__pyx_self, __pyx_v_out, __pyx_v_counts, __pyx_v_values, __pyx_v_bins);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pandas_5algos_424group_var_bin_float32(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_out, PyArrayObject *__pyx_v_counts, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_bins) {
  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_float32_t __pyx_v_val;
  __pyx_t_5numpy_float32_t __pyx_v_ct;
  PyArrayObject *__pyx_v_nobs = 0;
  PyArrayObject *__pyx_v_sumx = 0;
  PyArrayObject *__pyx_v_sumxx = 0;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_bins;
  __Pyx_Buffer __pyx_pybuffer_bins;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_counts;
  __Pyx_Buffer __pyx_pybuffer_counts;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_nobs;
  __Pyx_Buffer __pyx_pybuffer_nobs;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_out;
  __Pyx_Buffer __pyx_pybuffer_out;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_sumx;
  __Pyx_Buffer __pyx_pybuffer_sumx;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_sumxx;
  __Pyx_Buffer __pyx_pybuffer_sumxx;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_values;
  __Pyx_Buffer __pyx_pybuffer_values;
  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_float32_t __pyx_t_49;
  __pyx_t_5numpy_float32_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;
  __Pyx_RefNannySetupContext("group_var_bin_float32", 0);
  __pyx_pybuffer_nobs.pybuffer.buf = NULL;
  __pyx_pybuffer_nobs.refcount = 0;
  __pyx_pybuffernd_nobs.data = NULL;
  __pyx_pybuffernd_nobs.rcbuffer = &__pyx_pybuffer_nobs;
  __pyx_pybuffer_sumx.pybuffer.buf = NULL;
  __pyx_pybuffer_sumx.refcount = 0;
  __pyx_pybuffernd_sumx.data = NULL;
  __pyx_pybuffernd_sumx.rcbuffer = &__pyx_pybuffer_sumx;
  __pyx_pybuffer_sumxx.pybuffer.buf = NULL;
  __pyx_pybuffer_sumxx.refcount = 0;
  __pyx_pybuffernd_sumxx.data = NULL;
  __pyx_pybuffernd_sumxx.rcbuffer = &__pyx_pybuffer_sumxx;
  __pyx_pybuffer_out.pybuffer.buf = NULL;
  __pyx_pybuffer_out.refcount = 0;
  __pyx_pybuffernd_out.data = NULL;
  __pyx_pybuffernd_out.rcbuffer = &__pyx_pybuffer_out;
  __pyx_pybuffer_counts.pybuffer.buf = NULL;
  __pyx_pybuffer_counts.refcount = 0;
  __pyx_pybuffernd_counts.data = NULL;
  __pyx_pybuffernd_counts.rcbuffer = &__pyx_pybuffer_counts;
  __pyx_pybuffer_values.pybuffer.buf = NULL;
  __pyx_pybuffer_values.refcount = 0;
  __pyx_pybuffernd_values.data = NULL;
  __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values;
  __pyx_pybuffer_bins.pybuffer.buf = NULL;
  __pyx_pybuffer_bins.refcount = 0;
  __pyx_pybuffernd_bins.data = NULL;
  __pyx_pybuffernd_bins.rcbuffer = &__pyx_pybuffer_bins;
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_out.rcbuffer->pybuffer, (PyObject*)__pyx_v_out, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5721; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_out.diminfo[0].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_out.diminfo[0].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_out.diminfo[1].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_out.diminfo[1].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[1];
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_counts.rcbuffer->pybuffer, (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[2]; __pyx_lineno = 5721; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_counts.diminfo[0].strides = __pyx_pybuffernd_counts.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_counts.diminfo[0].shape = __pyx_pybuffernd_counts.rcbuffer->pybuffer.shape[0];
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5721; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_values.diminfo[1].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_values.diminfo[1].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[1];
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_bins.rcbuffer->pybuffer, (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[2]; __pyx_lineno = 5721; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_bins.diminfo[0].strides = __pyx_pybuffernd_bins.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_bins.diminfo[0].shape = __pyx_pybuffernd_bins.rcbuffer->pybuffer.shape[0];

  /* "pandas/src/generated.pyx":5731
 *         ndarray[float32_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_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5731; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros_like); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5731; __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[2]; __pyx_lineno = 5731; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__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 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5731; __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 (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5731; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_4 = ((PyArrayObject *)__pyx_t_3);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer);
    __pyx_t_5 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer, (PyObject*)__pyx_t_4, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_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_pybuffernd_nobs.rcbuffer->pybuffer, (PyObject*)__pyx_v_nobs, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_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_pybuffernd_nobs.diminfo[0].strides = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_nobs.diminfo[0].shape = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_nobs.diminfo[1].strides = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_nobs.diminfo[1].shape = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.shape[1];
    if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5731; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_4 = 0;
  __pyx_v_nobs = ((PyArrayObject *)__pyx_t_3);
  __pyx_t_3 = 0;

  /* "pandas/src/generated.pyx":5732
 * 
 *     nobs = np.zeros_like(out)
 *     sumx = np.zeros_like(out)             # <<<<<<<<<<<<<<
 *     sumxx = np.zeros_like(out)
 * 
 */
  __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5732; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_zeros_like); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5732; __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[2]; __pyx_lineno = 5732; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__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 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5732; __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;
  if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5732; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_4 = ((PyArrayObject *)__pyx_t_2);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_sumx.rcbuffer->pybuffer);
    __pyx_t_5 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_sumx.rcbuffer->pybuffer, (PyObject*)__pyx_t_4, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_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_pybuffernd_sumx.rcbuffer->pybuffer, (PyObject*)__pyx_v_sumx, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_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_pybuffernd_sumx.diminfo[0].strides = __pyx_pybuffernd_sumx.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_sumx.diminfo[0].shape = __pyx_pybuffernd_sumx.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_sumx.diminfo[1].strides = __pyx_pybuffernd_sumx.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_sumx.diminfo[1].shape = __pyx_pybuffernd_sumx.rcbuffer->pybuffer.shape[1];
    if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5732; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_4 = 0;
  __pyx_v_sumx = ((PyArrayObject *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "pandas/src/generated.pyx":5733
 *     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_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5733; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_zeros_like); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5733; __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[2]; __pyx_lineno = 5733; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__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 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5733; __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;
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5733; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_4 = ((PyArrayObject *)__pyx_t_1);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_sumxx.rcbuffer->pybuffer);
    __pyx_t_5 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_sumxx.rcbuffer->pybuffer, (PyObject*)__pyx_t_4, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_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_pybuffernd_sumxx.rcbuffer->pybuffer, (PyObject*)__pyx_v_sumxx, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_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_pybuffernd_sumxx.diminfo[0].strides = __pyx_pybuffernd_sumxx.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_sumxx.diminfo[0].shape = __pyx_pybuffernd_sumxx.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_sumxx.diminfo[1].strides = __pyx_pybuffernd_sumxx.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_sumxx.diminfo[1].shape = __pyx_pybuffernd_sumxx.rcbuffer->pybuffer.shape[1];
    if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5733; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_4 = 0;
  __pyx_v_sumxx = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pandas/src/generated.pyx":5735
 *     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[2]; __pyx_lineno = 5735; __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[2]; __pyx_lineno = 5735; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_12 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_bins.rcbuffer->pybuffer.buf, __pyx_t_10, __pyx_pybuffernd_bins.diminfo[0].strides)) == __pyx_t_11) != 0);
  if (__pyx_t_12) {

    /* "pandas/src/generated.pyx":5736
 * 
 *     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[2]; __pyx_lineno = 5736; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_v_ngroups = __pyx_t_11;
    goto __pyx_L3;
  }
  /*else*/ {

    /* "pandas/src/generated.pyx":5738
 *         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[2]; __pyx_lineno = 5738; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_v_ngroups = (__pyx_t_11 + 1);
  }
  __pyx_L3:;

  /* "pandas/src/generated.pyx":5740
 *         ngroups = len(bins) + 1
 * 
 *     N, K = (<object> values).shape             # <<<<<<<<<<<<<<
 * 
 *     b = 0
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_values), __pyx_n_s_shape); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5740; __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 CYTHON_COMPILING_IN_CPYTHON
    Py_ssize_t size = Py_SIZE(sequence);
    #else
    Py_ssize_t size = PySequence_Size(sequence);
    #endif
    if (unlikely(size != 2)) {
      if (size > 2) __Pyx_RaiseTooManyValuesError(2);
      else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
      {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5740; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    #if CYTHON_COMPILING_IN_CPYTHON
    if (likely(PyTuple_CheckExact(sequence))) {
      __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); 
      __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1); 
    } else {
      __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);
    #else
    __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5740; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5740; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    #endif
    __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[2]; __pyx_lineno = 5740; __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_L4_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_L4_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_3);
    if (__Pyx_IternextUnpackEndCheck(__pyx_t_14(__pyx_t_13), 2) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5740; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_14 = NULL;
    __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
    goto __pyx_L5_unpacking_done;
    __pyx_L4_unpacking_failed:;
    __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
    __pyx_t_14 = NULL;
    if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
    {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5740; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_L5_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[2]; __pyx_lineno = 5740; __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[2]; __pyx_lineno = 5740; __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;

  /* "pandas/src/generated.pyx":5742
 *     N, K = (<object> values).shape
 * 
 *     b = 0             # <<<<<<<<<<<<<<
 *     if K > 1:
 *         for i in range(N):
 */
  __pyx_v_b = 0;

  /* "pandas/src/generated.pyx":5743
 * 
 *     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) != 0);
  if (__pyx_t_12) {

    /* "pandas/src/generated.pyx":5744
 *     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;

      /* "pandas/src/generated.pyx":5745
 *     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)) != 0);
        if (__pyx_t_12) {
          __pyx_t_15 = __pyx_v_b;
          __pyx_t_16 = ((__pyx_v_i >= (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_bins.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_bins.diminfo[0].strides))) != 0);
          __pyx_t_17 = __pyx_t_16;
        } else {
          __pyx_t_17 = __pyx_t_12;
        }
        if (!__pyx_t_17) break;

        /* "pandas/src/generated.pyx":5746
 *         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);
      }

      /* "pandas/src/generated.pyx":5748
 *                 b += 1
 * 
 *             counts[b] += 1             # <<<<<<<<<<<<<<
 * 
 *             for j in range(K):
 */
      __pyx_t_18 = __pyx_v_b;
      *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_counts.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_counts.diminfo[0].strides) += 1;

      /* "pandas/src/generated.pyx":5750
 *             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;

        /* "pandas/src/generated.pyx":5751
 * 
 *             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_float32_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_values.diminfo[0].strides, __pyx_t_22, __pyx_pybuffernd_values.diminfo[1].strides));

        /* "pandas/src/generated.pyx":5754
 * 
 *                 # not nan
 *                 if val == val:             # <<<<<<<<<<<<<<
 *                     nobs[b, j] += 1
 *                     sumx[b, j] += val
 */
        __pyx_t_17 = ((__pyx_v_val == __pyx_v_val) != 0);
        if (__pyx_t_17) {

          /* "pandas/src/generated.pyx":5755
 *                 # 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_float32_t *, __pyx_pybuffernd_nobs.rcbuffer->pybuffer.buf, __pyx_t_23, __pyx_pybuffernd_nobs.diminfo[0].strides, __pyx_t_24, __pyx_pybuffernd_nobs.diminfo[1].strides) += 1.0;

          /* "pandas/src/generated.pyx":5756
 *                 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_float32_t *, __pyx_pybuffernd_sumx.rcbuffer->pybuffer.buf, __pyx_t_25, __pyx_pybuffernd_sumx.diminfo[0].strides, __pyx_t_26, __pyx_pybuffernd_sumx.diminfo[1].strides) += __pyx_v_val;

          /* "pandas/src/generated.pyx":5757
 *                     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_float32_t *, __pyx_pybuffernd_sumxx.rcbuffer->pybuffer.buf, __pyx_t_27, __pyx_pybuffernd_sumxx.diminfo[0].strides, __pyx_t_28, __pyx_pybuffernd_sumxx.diminfo[1].strides) += (__pyx_v_val * __pyx_v_val);
          goto __pyx_L13;
        }
        __pyx_L13:;
      }
    }
    goto __pyx_L6;
  }
  /*else*/ {

    /* "pandas/src/generated.pyx":5759
 *                     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;

      /* "pandas/src/generated.pyx":5760
 *     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)) != 0);
        if (__pyx_t_17) {
          __pyx_t_19 = __pyx_v_b;
          __pyx_t_12 = ((__pyx_v_i >= (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_bins.rcbuffer->pybuffer.buf, __pyx_t_19, __pyx_pybuffernd_bins.diminfo[0].strides))) != 0);
          __pyx_t_16 = __pyx_t_12;
        } else {
          __pyx_t_16 = __pyx_t_17;
        }
        if (!__pyx_t_16) break;

        /* "pandas/src/generated.pyx":5761
 *         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);
      }

      /* "pandas/src/generated.pyx":5763
 *                 b += 1
 * 
 *             counts[b] += 1             # <<<<<<<<<<<<<<
 *             val = values[i, 0]
 * 
 */
      __pyx_t_20 = __pyx_v_b;
      *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_counts.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_counts.diminfo[0].strides) += 1;

      /* "pandas/src/generated.pyx":5764
 * 
 *             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_float32_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_29, __pyx_pybuffernd_values.diminfo[0].strides, __pyx_t_30, __pyx_pybuffernd_values.diminfo[1].strides));

      /* "pandas/src/generated.pyx":5767
 * 
 *             # not nan
 *             if val == val:             # <<<<<<<<<<<<<<
 *                 nobs[b, 0] += 1
 *                 sumx[b, 0] += val
 */
      __pyx_t_16 = ((__pyx_v_val == __pyx_v_val) != 0);
      if (__pyx_t_16) {

        /* "pandas/src/generated.pyx":5768
 *             # 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_float32_t *, __pyx_pybuffernd_nobs.rcbuffer->pybuffer.buf, __pyx_t_31, __pyx_pybuffernd_nobs.diminfo[0].strides, __pyx_t_32, __pyx_pybuffernd_nobs.diminfo[1].strides) += 1.0;

        /* "pandas/src/generated.pyx":5769
 *             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_float32_t *, __pyx_pybuffernd_sumx.rcbuffer->pybuffer.buf, __pyx_t_33, __pyx_pybuffernd_sumx.diminfo[0].strides, __pyx_t_34, __pyx_pybuffernd_sumx.diminfo[1].strides) += __pyx_v_val;

        /* "pandas/src/generated.pyx":5770
 *                 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_float32_t *, __pyx_pybuffernd_sumxx.rcbuffer->pybuffer.buf, __pyx_t_35, __pyx_pybuffernd_sumxx.diminfo[0].strides, __pyx_t_36, __pyx_pybuffernd_sumxx.diminfo[1].strides) += (__pyx_v_val * __pyx_v_val);
        goto __pyx_L18;
      }
      __pyx_L18:;
    }
  }
  __pyx_L6:;

  /* "pandas/src/generated.pyx":5772
 *                 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;

    /* "pandas/src/generated.pyx":5773
 * 
 *     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;

      /* "pandas/src/generated.pyx":5774
 *     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_float32_t *, __pyx_pybuffernd_nobs.rcbuffer->pybuffer.buf, __pyx_t_39, __pyx_pybuffernd_nobs.diminfo[0].strides, __pyx_t_40, __pyx_pybuffernd_nobs.diminfo[1].strides));

      /* "pandas/src/generated.pyx":5775
 *         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) != 0);
      if (__pyx_t_16) {

        /* "pandas/src/generated.pyx":5776
 *             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_float32_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_41, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_42, __pyx_pybuffernd_out.diminfo[1].strides) = __pyx_v_6pandas_5algos_nan;
        goto __pyx_L23;
      }
      /*else*/ {

        /* "pandas/src/generated.pyx":5778
 *                 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_float32_t *, __pyx_pybuffernd_sumxx.rcbuffer->pybuffer.buf, __pyx_t_43, __pyx_pybuffernd_sumxx.diminfo[0].strides, __pyx_t_44, __pyx_pybuffernd_sumxx.diminfo[1].strides))) - ((*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_sumx.rcbuffer->pybuffer.buf, __pyx_t_45, __pyx_pybuffernd_sumx.diminfo[0].strides, __pyx_t_46, __pyx_pybuffernd_sumx.diminfo[1].strides)) * (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_sumx.rcbuffer->pybuffer.buf, __pyx_t_47, __pyx_pybuffernd_sumx.diminfo[0].strides, __pyx_t_48, __pyx_pybuffernd_sumx.diminfo[1].strides))));

        /* "pandas/src/generated.pyx":5779
 *             else:
 *                 out[i, j] = ((ct * sumxx[i, j] - sumx[i, j] * sumx[i, j]) /
 *                              (ct * ct - ct))             # <<<<<<<<<<<<<<
 * 
 * @cython.wraparound(False)
 */
        __pyx_t_50 = ((__pyx_v_ct * __pyx_v_ct) - __pyx_v_ct);

        /* "pandas/src/generated.pyx":5778
 *                 out[i, j] = nan
 *             else:
 *                 out[i, j] = ((ct * sumxx[i, j] - sumx[i, j] * sumx[i, j]) /             # <<<<<<<<<<<<<<
 *                              (ct * ct - ct))
 * 
 */
        if (unlikely(__pyx_t_50 == 0)) {
          #ifdef WITH_THREAD
          PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
          #endif
          PyErr_SetString(PyExc_ZeroDivisionError, "float division");
          #ifdef WITH_THREAD
          PyGILState_Release(__pyx_gilstate_save);
          #endif
          {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5778; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        __pyx_t_51 = __pyx_v_i;
        __pyx_t_52 = __pyx_v_j;
        *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_51, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_52, __pyx_pybuffernd_out.diminfo[1].strides) = (__pyx_t_49 / __pyx_t_50);
      }
      __pyx_L23:;
    }
  }

  /* "pandas/src/generated.pyx":5721
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def group_var_bin_float32(ndarray[float32_t, ndim=2] out,             # <<<<<<<<<<<<<<
 *                   ndarray[int64_t] counts,
 *                   ndarray[float32_t, ndim=2] values,
 */

  /* function exit code */
  __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_pybuffernd_bins.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_counts.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_sumx.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_sumxx.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas.algos.group_var_bin_float32", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_bins.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_counts.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_sumx.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_sumxx.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer);
  __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;
}

/* "pandas/src/generated.pyx":5783
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def group_mean_float64(ndarray[float64_t, ndim=2] out,             # <<<<<<<<<<<<<<
 *                ndarray[int64_t] counts,
 *                ndarray[float64_t, ndim=2] values,
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pandas_5algos_427group_mean_float64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_5algos_427group_mean_float64 = {__Pyx_NAMESTR("group_mean_float64"), (PyCFunction)__pyx_pw_6pandas_5algos_427group_mean_float64, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pw_6pandas_5algos_427group_mean_float64(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;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("group_mean_float64 (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_out,&__pyx_n_s_counts,&__pyx_n_s_values,&__pyx_n_s_labels,0};
    PyObject* values[4] = {0,0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_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 (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_out)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_counts)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("group_mean_float64", 1, 4, 4, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5783; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("group_mean_float64", 1, 4, 4, 2); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5783; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  3:
        if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_labels)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("group_mean_float64", 1, 4, 4, 3); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5783; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "group_mean_float64") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5783; __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_float64", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5783; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas.algos.group_mean_float64", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_out), __pyx_ptype_5numpy_ndarray, 1, "out", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5783; __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[2]; __pyx_lineno = 5784; __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[2]; __pyx_lineno = 5785; __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[2]; __pyx_lineno = 5786; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_426group_mean_float64(__pyx_self, __pyx_v_out, __pyx_v_counts, __pyx_v_values, __pyx_v_labels);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pandas_5algos_426group_mean_float64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_out, PyArrayObject *__pyx_v_counts, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_labels) {
  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;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_counts;
  __Pyx_Buffer __pyx_pybuffer_counts;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_labels;
  __Pyx_Buffer __pyx_pybuffer_labels;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_nobs;
  __Pyx_Buffer __pyx_pybuffer_nobs;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_out;
  __Pyx_Buffer __pyx_pybuffer_out;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_sumx;
  __Pyx_Buffer __pyx_pybuffer_sumx;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_values;
  __Pyx_Buffer __pyx_pybuffer_values;
  PyObject *__pyx_r = NULL;
  __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;
  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;
  PyObject *__pyx_t_12 = NULL;
  PyObject *(*__pyx_t_13)(PyObject *);
  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;
  __Pyx_RefNannySetupContext("group_mean_float64", 0);
  __pyx_pybuffer_sumx.pybuffer.buf = NULL;
  __pyx_pybuffer_sumx.refcount = 0;
  __pyx_pybuffernd_sumx.data = NULL;
  __pyx_pybuffernd_sumx.rcbuffer = &__pyx_pybuffer_sumx;
  __pyx_pybuffer_nobs.pybuffer.buf = NULL;
  __pyx_pybuffer_nobs.refcount = 0;
  __pyx_pybuffernd_nobs.data = NULL;
  __pyx_pybuffernd_nobs.rcbuffer = &__pyx_pybuffer_nobs;
  __pyx_pybuffer_out.pybuffer.buf = NULL;
  __pyx_pybuffer_out.refcount = 0;
  __pyx_pybuffernd_out.data = NULL;
  __pyx_pybuffernd_out.rcbuffer = &__pyx_pybuffer_out;
  __pyx_pybuffer_counts.pybuffer.buf = NULL;
  __pyx_pybuffer_counts.refcount = 0;
  __pyx_pybuffernd_counts.data = NULL;
  __pyx_pybuffernd_counts.rcbuffer = &__pyx_pybuffer_counts;
  __pyx_pybuffer_values.pybuffer.buf = NULL;
  __pyx_pybuffer_values.refcount = 0;
  __pyx_pybuffernd_values.data = NULL;
  __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values;
  __pyx_pybuffer_labels.pybuffer.buf = NULL;
  __pyx_pybuffer_labels.refcount = 0;
  __pyx_pybuffernd_labels.data = NULL;
  __pyx_pybuffernd_labels.rcbuffer = &__pyx_pybuffer_labels;
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_out.rcbuffer->pybuffer, (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[2]; __pyx_lineno = 5783; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_out.diminfo[0].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_out.diminfo[0].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_out.diminfo[1].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_out.diminfo[1].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[1];
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_counts.rcbuffer->pybuffer, (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[2]; __pyx_lineno = 5783; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_counts.diminfo[0].strides = __pyx_pybuffernd_counts.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_counts.diminfo[0].shape = __pyx_pybuffernd_counts.rcbuffer->pybuffer.shape[0];
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (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[2]; __pyx_lineno = 5783; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_values.diminfo[1].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_values.diminfo[1].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[1];
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_labels.rcbuffer->pybuffer, (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[2]; __pyx_lineno = 5783; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_labels.diminfo[0].strides = __pyx_pybuffernd_labels.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_labels.diminfo[0].shape = __pyx_pybuffernd_labels.rcbuffer->pybuffer.shape[0];

  /* "pandas/src/generated.pyx":5792
 *         ndarray[float64_t, ndim=2] sumx, nobs
 * 
 *     if not len(values) == len(labels):             # <<<<<<<<<<<<<<
 *        raise AssertionError("len(index) != len(labels)")
 * 
 */
  __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_values)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5792; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_2 = PyObject_Length(((PyObject *)__pyx_v_labels)); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5792; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_3 = ((!((__pyx_t_1 == __pyx_t_2) != 0)) != 0);
  if (__pyx_t_3) {

    /* "pandas/src/generated.pyx":5793
 * 
 *     if not len(values) == len(labels):
 *        raise AssertionError("len(index) != len(labels)")             # <<<<<<<<<<<<<<
 * 
 *     nobs = np.zeros_like(out)
 */
    __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_AssertionError, __pyx_tuple__202, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5793; __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[2]; __pyx_lineno = 5793; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }

  /* "pandas/src/generated.pyx":5795
 *        raise AssertionError("len(index) != len(labels)")
 * 
 *     nobs = np.zeros_like(out)             # <<<<<<<<<<<<<<
 *     sumx = np.zeros_like(out)
 * 
 */
  __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5795; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_zeros_like); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5795; __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[2]; __pyx_lineno = 5795; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_INCREF(((PyObject *)__pyx_v_out));
  PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_v_out));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_out));
  __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_4, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5795; __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_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[2]; __pyx_lineno = 5795; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_7 = ((PyArrayObject *)__pyx_t_6);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer);
    __pyx_t_8 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer, (PyObject*)__pyx_t_7, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 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_pybuffernd_nobs.rcbuffer->pybuffer, (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_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_pybuffernd_nobs.diminfo[0].strides = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_nobs.diminfo[0].shape = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_nobs.diminfo[1].strides = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_nobs.diminfo[1].shape = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.shape[1];
    if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5795; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_7 = 0;
  __pyx_v_nobs = ((PyArrayObject *)__pyx_t_6);
  __pyx_t_6 = 0;

  /* "pandas/src/generated.pyx":5796
 * 
 *     nobs = np.zeros_like(out)
 *     sumx = np.zeros_like(out)             # <<<<<<<<<<<<<<
 * 
 *     N, K = (<object> values).shape
 */
  __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5796; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_zeros_like); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5796; __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[2]; __pyx_lineno = 5796; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_INCREF(((PyObject *)__pyx_v_out));
  PyTuple_SET_ITEM(__pyx_t_6, 0, ((PyObject *)__pyx_v_out));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_out));
  __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5796; __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;
  if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5796; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_7 = ((PyArrayObject *)__pyx_t_5);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_sumx.rcbuffer->pybuffer);
    __pyx_t_8 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_sumx.rcbuffer->pybuffer, (PyObject*)__pyx_t_7, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 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_pybuffernd_sumx.rcbuffer->pybuffer, (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_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_pybuffernd_sumx.diminfo[0].strides = __pyx_pybuffernd_sumx.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_sumx.diminfo[0].shape = __pyx_pybuffernd_sumx.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_sumx.diminfo[1].strides = __pyx_pybuffernd_sumx.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_sumx.diminfo[1].shape = __pyx_pybuffernd_sumx.rcbuffer->pybuffer.shape[1];
    if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5796; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_7 = 0;
  __pyx_v_sumx = ((PyArrayObject *)__pyx_t_5);
  __pyx_t_5 = 0;

  /* "pandas/src/generated.pyx":5798
 *     sumx = np.zeros_like(out)
 * 
 *     N, K = (<object> values).shape             # <<<<<<<<<<<<<<
 * 
 *     if K > 1:
 */
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_values), __pyx_n_s_shape); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5798; __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 CYTHON_COMPILING_IN_CPYTHON
    Py_ssize_t size = Py_SIZE(sequence);
    #else
    Py_ssize_t size = PySequence_Size(sequence);
    #endif
    if (unlikely(size != 2)) {
      if (size > 2) __Pyx_RaiseTooManyValuesError(2);
      else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
      {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5798; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    #if CYTHON_COMPILING_IN_CPYTHON
    if (likely(PyTuple_CheckExact(sequence))) {
      __pyx_t_6 = PyTuple_GET_ITEM(sequence, 0); 
      __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1); 
    } else {
      __pyx_t_6 = PyList_GET_ITEM(sequence, 0); 
      __pyx_t_4 = PyList_GET_ITEM(sequence, 1); 
    }
    __Pyx_INCREF(__pyx_t_6);
    __Pyx_INCREF(__pyx_t_4);
    #else
    __pyx_t_6 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5798; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5798; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    #endif
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  } else {
    Py_ssize_t index = -1;
    __pyx_t_12 = PyObject_GetIter(__pyx_t_5); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5798; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_12);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_13 = Py_TYPE(__pyx_t_12)->tp_iternext;
    index = 0; __pyx_t_6 = __pyx_t_13(__pyx_t_12); if (unlikely(!__pyx_t_6)) goto __pyx_L4_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_6);
    index = 1; __pyx_t_4 = __pyx_t_13(__pyx_t_12); if (unlikely(!__pyx_t_4)) goto __pyx_L4_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_4);
    if (__Pyx_IternextUnpackEndCheck(__pyx_t_13(__pyx_t_12), 2) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5798; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_13 = NULL;
    __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
    goto __pyx_L5_unpacking_done;
    __pyx_L4_unpacking_failed:;
    __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
    __pyx_t_13 = NULL;
    if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
    {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5798; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_L5_unpacking_done:;
  }
  __pyx_t_2 = __Pyx_PyIndex_AsSsize_t(__pyx_t_6); if (unlikely((__pyx_t_2 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5798; __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_4); if (unlikely((__pyx_t_1 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5798; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_v_N = __pyx_t_2;
  __pyx_v_K = __pyx_t_1;

  /* "pandas/src/generated.pyx":5800
 *     N, K = (<object> values).shape
 * 
 *     if K > 1:             # <<<<<<<<<<<<<<
 *         for i in range(N):
 *             lab = labels[i]
 */
  __pyx_t_3 = ((__pyx_v_K > 1) != 0);
  if (__pyx_t_3) {

    /* "pandas/src/generated.pyx":5801
 * 
 *     if K > 1:
 *         for i in range(N):             # <<<<<<<<<<<<<<
 *             lab = labels[i]
 *             if lab < 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;

      /* "pandas/src/generated.pyx":5802
 *     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_pybuffernd_labels.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_labels.diminfo[0].strides));

      /* "pandas/src/generated.pyx":5803
 *         for i in range(N):
 *             lab = labels[i]
 *             if lab < 0:             # <<<<<<<<<<<<<<
 *                 continue
 * 
 */
      __pyx_t_3 = ((__pyx_v_lab < 0) != 0);
      if (__pyx_t_3) {

        /* "pandas/src/generated.pyx":5804
 *             lab = labels[i]
 *             if lab < 0:
 *                 continue             # <<<<<<<<<<<<<<
 * 
 *             counts[lab] += 1
 */
        goto __pyx_L7_continue;
      }

      /* "pandas/src/generated.pyx":5806
 *                 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_pybuffernd_counts.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_counts.diminfo[0].strides) += 1;

      /* "pandas/src/generated.pyx":5807
 * 
 *             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;

        /* "pandas/src/generated.pyx":5808
 *             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_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_values.diminfo[0].strides, __pyx_t_19, __pyx_pybuffernd_values.diminfo[1].strides));

        /* "pandas/src/generated.pyx":5810
 *                 val = values[i, j]
 *                 # not nan
 *                 if val == val:             # <<<<<<<<<<<<<<
 *                     nobs[lab, j] += 1
 *                     sumx[lab, j] += val
 */
        __pyx_t_3 = ((__pyx_v_val == __pyx_v_val) != 0);
        if (__pyx_t_3) {

          /* "pandas/src/generated.pyx":5811
 *                 # 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_pybuffernd_nobs.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_nobs.diminfo[0].strides, __pyx_t_21, __pyx_pybuffernd_nobs.diminfo[1].strides) += 1.0;

          /* "pandas/src/generated.pyx":5812
 *                 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_pybuffernd_sumx.rcbuffer->pybuffer.buf, __pyx_t_22, __pyx_pybuffernd_sumx.diminfo[0].strides, __pyx_t_23, __pyx_pybuffernd_sumx.diminfo[1].strides) += __pyx_v_val;
          goto __pyx_L12;
        }
        __pyx_L12:;
      }
      __pyx_L7_continue:;
    }
    goto __pyx_L6;
  }
  /*else*/ {

    /* "pandas/src/generated.pyx":5814
 *                     sumx[lab, j] += val
 *     else:
 *         for i in range(N):             # <<<<<<<<<<<<<<
 *             lab = labels[i]
 *             if lab < 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;

      /* "pandas/src/generated.pyx":5815
 *     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_pybuffernd_labels.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_labels.diminfo[0].strides));

      /* "pandas/src/generated.pyx":5816
 *         for i in range(N):
 *             lab = labels[i]
 *             if lab < 0:             # <<<<<<<<<<<<<<
 *                 continue
 * 
 */
      __pyx_t_3 = ((__pyx_v_lab < 0) != 0);
      if (__pyx_t_3) {

        /* "pandas/src/generated.pyx":5817
 *             lab = labels[i]
 *             if lab < 0:
 *                 continue             # <<<<<<<<<<<<<<
 * 
 *             counts[lab] += 1
 */
        goto __pyx_L13_continue;
      }

      /* "pandas/src/generated.pyx":5819
 *                 continue
 * 
 *             counts[lab] += 1             # <<<<<<<<<<<<<<
 *             val = values[i, 0]
 *             # not nan
 */
      __pyx_t_17 = __pyx_v_lab;
      *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_counts.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_counts.diminfo[0].strides) += 1;

      /* "pandas/src/generated.pyx":5820
 * 
 *             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_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_24, __pyx_pybuffernd_values.diminfo[0].strides, __pyx_t_25, __pyx_pybuffernd_values.diminfo[1].strides));

      /* "pandas/src/generated.pyx":5822
 *             val = values[i, 0]
 *             # not nan
 *             if val == val:             # <<<<<<<<<<<<<<
 *                 nobs[lab, 0] += 1
 *                 sumx[lab, 0] += val
 */
      __pyx_t_3 = ((__pyx_v_val == __pyx_v_val) != 0);
      if (__pyx_t_3) {

        /* "pandas/src/generated.pyx":5823
 *             # 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_pybuffernd_nobs.rcbuffer->pybuffer.buf, __pyx_t_26, __pyx_pybuffernd_nobs.diminfo[0].strides, __pyx_t_27, __pyx_pybuffernd_nobs.diminfo[1].strides) += 1.0;

        /* "pandas/src/generated.pyx":5824
 *             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_pybuffernd_sumx.rcbuffer->pybuffer.buf, __pyx_t_28, __pyx_pybuffernd_sumx.diminfo[0].strides, __pyx_t_29, __pyx_pybuffernd_sumx.diminfo[1].strides) += __pyx_v_val;
        goto __pyx_L16;
      }
      __pyx_L16:;
      __pyx_L13_continue:;
    }
  }
  __pyx_L6:;

  /* "pandas/src/generated.pyx":5826
 *                 sumx[lab, 0] += val
 * 
 *     for i in range(len(counts)):             # <<<<<<<<<<<<<<
 *         for j in range(K):
 *             count = nobs[i, j]
 */
  __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_counts)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5826; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) {
    __pyx_v_i = __pyx_t_2;

    /* "pandas/src/generated.pyx":5827
 * 
 *     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;

      /* "pandas/src/generated.pyx":5828
 *     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_pybuffernd_nobs.rcbuffer->pybuffer.buf, __pyx_t_32, __pyx_pybuffernd_nobs.diminfo[0].strides, __pyx_t_33, __pyx_pybuffernd_nobs.diminfo[1].strides));

      /* "pandas/src/generated.pyx":5829
 *         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_3 = (((*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_nobs.rcbuffer->pybuffer.buf, __pyx_t_34, __pyx_pybuffernd_nobs.diminfo[0].strides, __pyx_t_35, __pyx_pybuffernd_nobs.diminfo[1].strides)) == 0.0) != 0);
      if (__pyx_t_3) {

        /* "pandas/src/generated.pyx":5830
 *             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_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_36, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_37, __pyx_pybuffernd_out.diminfo[1].strides) = __pyx_v_6pandas_5algos_nan;
        goto __pyx_L21;
      }
      /*else*/ {

        /* "pandas/src/generated.pyx":5832
 *                 out[i, j] = nan
 *             else:
 *                 out[i, j] = sumx[i, j] / count             # <<<<<<<<<<<<<<
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 */
        __pyx_t_38 = __pyx_v_i;
        __pyx_t_39 = __pyx_v_j;
        __pyx_t_40 = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_sumx.rcbuffer->pybuffer.buf, __pyx_t_38, __pyx_pybuffernd_sumx.diminfo[0].strides, __pyx_t_39, __pyx_pybuffernd_sumx.diminfo[1].strides));
        if (unlikely(__pyx_v_count == 0)) {
          #ifdef WITH_THREAD
          PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
          #endif
          PyErr_SetString(PyExc_ZeroDivisionError, "float division");
          #ifdef WITH_THREAD
          PyGILState_Release(__pyx_gilstate_save);
          #endif
          {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5832; __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_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_41, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_42, __pyx_pybuffernd_out.diminfo[1].strides) = (__pyx_t_40 / __pyx_v_count);
      }
      __pyx_L21:;
    }
  }

  /* "pandas/src/generated.pyx":5783
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def group_mean_float64(ndarray[float64_t, ndim=2] out,             # <<<<<<<<<<<<<<
 *                ndarray[int64_t] counts,
 *                ndarray[float64_t, ndim=2] values,
 */

  /* function exit code */
  __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_12);
  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
    __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_counts.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_labels.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_sumx.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas.algos.group_mean_float64", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_counts.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_labels.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_sumx.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer);
  __pyx_L2:;
  __Pyx_XDECREF((PyObject *)__pyx_v_sumx);
  __Pyx_XDECREF((PyObject *)__pyx_v_nobs);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/src/generated.pyx":5835
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def group_mean_float32(ndarray[float32_t, ndim=2] out,             # <<<<<<<<<<<<<<
 *                ndarray[int64_t] counts,
 *                ndarray[float32_t, ndim=2] values,
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pandas_5algos_429group_mean_float32(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_5algos_429group_mean_float32 = {__Pyx_NAMESTR("group_mean_float32"), (PyCFunction)__pyx_pw_6pandas_5algos_429group_mean_float32, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pw_6pandas_5algos_429group_mean_float32(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;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("group_mean_float32 (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_out,&__pyx_n_s_counts,&__pyx_n_s_values,&__pyx_n_s_labels,0};
    PyObject* values[4] = {0,0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_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 (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_out)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_counts)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("group_mean_float32", 1, 4, 4, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5835; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("group_mean_float32", 1, 4, 4, 2); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5835; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  3:
        if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_labels)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("group_mean_float32", 1, 4, 4, 3); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5835; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "group_mean_float32") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5835; __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_float32", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5835; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas.algos.group_mean_float32", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_out), __pyx_ptype_5numpy_ndarray, 1, "out", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5835; __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[2]; __pyx_lineno = 5836; __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[2]; __pyx_lineno = 5837; __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[2]; __pyx_lineno = 5838; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_428group_mean_float32(__pyx_self, __pyx_v_out, __pyx_v_counts, __pyx_v_values, __pyx_v_labels);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pandas_5algos_428group_mean_float32(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_out, PyArrayObject *__pyx_v_counts, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_labels) {
  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_float32_t __pyx_v_val;
  __pyx_t_5numpy_float32_t __pyx_v_count;
  PyArrayObject *__pyx_v_sumx = 0;
  PyArrayObject *__pyx_v_nobs = 0;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_counts;
  __Pyx_Buffer __pyx_pybuffer_counts;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_labels;
  __Pyx_Buffer __pyx_pybuffer_labels;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_nobs;
  __Pyx_Buffer __pyx_pybuffer_nobs;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_out;
  __Pyx_Buffer __pyx_pybuffer_out;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_sumx;
  __Pyx_Buffer __pyx_pybuffer_sumx;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_values;
  __Pyx_Buffer __pyx_pybuffer_values;
  PyObject *__pyx_r = NULL;
  __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;
  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;
  PyObject *__pyx_t_12 = NULL;
  PyObject *(*__pyx_t_13)(PyObject *);
  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_float32_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;
  __Pyx_RefNannySetupContext("group_mean_float32", 0);
  __pyx_pybuffer_sumx.pybuffer.buf = NULL;
  __pyx_pybuffer_sumx.refcount = 0;
  __pyx_pybuffernd_sumx.data = NULL;
  __pyx_pybuffernd_sumx.rcbuffer = &__pyx_pybuffer_sumx;
  __pyx_pybuffer_nobs.pybuffer.buf = NULL;
  __pyx_pybuffer_nobs.refcount = 0;
  __pyx_pybuffernd_nobs.data = NULL;
  __pyx_pybuffernd_nobs.rcbuffer = &__pyx_pybuffer_nobs;
  __pyx_pybuffer_out.pybuffer.buf = NULL;
  __pyx_pybuffer_out.refcount = 0;
  __pyx_pybuffernd_out.data = NULL;
  __pyx_pybuffernd_out.rcbuffer = &__pyx_pybuffer_out;
  __pyx_pybuffer_counts.pybuffer.buf = NULL;
  __pyx_pybuffer_counts.refcount = 0;
  __pyx_pybuffernd_counts.data = NULL;
  __pyx_pybuffernd_counts.rcbuffer = &__pyx_pybuffer_counts;
  __pyx_pybuffer_values.pybuffer.buf = NULL;
  __pyx_pybuffer_values.refcount = 0;
  __pyx_pybuffernd_values.data = NULL;
  __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values;
  __pyx_pybuffer_labels.pybuffer.buf = NULL;
  __pyx_pybuffer_labels.refcount = 0;
  __pyx_pybuffernd_labels.data = NULL;
  __pyx_pybuffernd_labels.rcbuffer = &__pyx_pybuffer_labels;
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_out.rcbuffer->pybuffer, (PyObject*)__pyx_v_out, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5835; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_out.diminfo[0].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_out.diminfo[0].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_out.diminfo[1].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_out.diminfo[1].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[1];
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_counts.rcbuffer->pybuffer, (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[2]; __pyx_lineno = 5835; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_counts.diminfo[0].strides = __pyx_pybuffernd_counts.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_counts.diminfo[0].shape = __pyx_pybuffernd_counts.rcbuffer->pybuffer.shape[0];
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5835; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_values.diminfo[1].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_values.diminfo[1].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[1];
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_labels.rcbuffer->pybuffer, (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[2]; __pyx_lineno = 5835; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_labels.diminfo[0].strides = __pyx_pybuffernd_labels.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_labels.diminfo[0].shape = __pyx_pybuffernd_labels.rcbuffer->pybuffer.shape[0];

  /* "pandas/src/generated.pyx":5844
 *         ndarray[float32_t, ndim=2] sumx, nobs
 * 
 *     if not len(values) == len(labels):             # <<<<<<<<<<<<<<
 *        raise AssertionError("len(index) != len(labels)")
 * 
 */
  __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_values)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5844; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_2 = PyObject_Length(((PyObject *)__pyx_v_labels)); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5844; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_3 = ((!((__pyx_t_1 == __pyx_t_2) != 0)) != 0);
  if (__pyx_t_3) {

    /* "pandas/src/generated.pyx":5845
 * 
 *     if not len(values) == len(labels):
 *        raise AssertionError("len(index) != len(labels)")             # <<<<<<<<<<<<<<
 * 
 *     nobs = np.zeros_like(out)
 */
    __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_AssertionError, __pyx_tuple__203, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5845; __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[2]; __pyx_lineno = 5845; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }

  /* "pandas/src/generated.pyx":5847
 *        raise AssertionError("len(index) != len(labels)")
 * 
 *     nobs = np.zeros_like(out)             # <<<<<<<<<<<<<<
 *     sumx = np.zeros_like(out)
 * 
 */
  __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5847; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_zeros_like); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5847; __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[2]; __pyx_lineno = 5847; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_INCREF(((PyObject *)__pyx_v_out));
  PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_v_out));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_out));
  __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_4, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5847; __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_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[2]; __pyx_lineno = 5847; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_7 = ((PyArrayObject *)__pyx_t_6);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer);
    __pyx_t_8 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer, (PyObject*)__pyx_t_7, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 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_pybuffernd_nobs.rcbuffer->pybuffer, (PyObject*)__pyx_v_nobs, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, 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_pybuffernd_nobs.diminfo[0].strides = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_nobs.diminfo[0].shape = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_nobs.diminfo[1].strides = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_nobs.diminfo[1].shape = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.shape[1];
    if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5847; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_7 = 0;
  __pyx_v_nobs = ((PyArrayObject *)__pyx_t_6);
  __pyx_t_6 = 0;

  /* "pandas/src/generated.pyx":5848
 * 
 *     nobs = np.zeros_like(out)
 *     sumx = np.zeros_like(out)             # <<<<<<<<<<<<<<
 * 
 *     N, K = (<object> values).shape
 */
  __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5848; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_zeros_like); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5848; __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[2]; __pyx_lineno = 5848; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_INCREF(((PyObject *)__pyx_v_out));
  PyTuple_SET_ITEM(__pyx_t_6, 0, ((PyObject *)__pyx_v_out));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_out));
  __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5848; __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;
  if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5848; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_7 = ((PyArrayObject *)__pyx_t_5);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_sumx.rcbuffer->pybuffer);
    __pyx_t_8 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_sumx.rcbuffer->pybuffer, (PyObject*)__pyx_t_7, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 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_pybuffernd_sumx.rcbuffer->pybuffer, (PyObject*)__pyx_v_sumx, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 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_pybuffernd_sumx.diminfo[0].strides = __pyx_pybuffernd_sumx.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_sumx.diminfo[0].shape = __pyx_pybuffernd_sumx.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_sumx.diminfo[1].strides = __pyx_pybuffernd_sumx.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_sumx.diminfo[1].shape = __pyx_pybuffernd_sumx.rcbuffer->pybuffer.shape[1];
    if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5848; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_7 = 0;
  __pyx_v_sumx = ((PyArrayObject *)__pyx_t_5);
  __pyx_t_5 = 0;

  /* "pandas/src/generated.pyx":5850
 *     sumx = np.zeros_like(out)
 * 
 *     N, K = (<object> values).shape             # <<<<<<<<<<<<<<
 * 
 *     if K > 1:
 */
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_values), __pyx_n_s_shape); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5850; __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 CYTHON_COMPILING_IN_CPYTHON
    Py_ssize_t size = Py_SIZE(sequence);
    #else
    Py_ssize_t size = PySequence_Size(sequence);
    #endif
    if (unlikely(size != 2)) {
      if (size > 2) __Pyx_RaiseTooManyValuesError(2);
      else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
      {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5850; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    #if CYTHON_COMPILING_IN_CPYTHON
    if (likely(PyTuple_CheckExact(sequence))) {
      __pyx_t_6 = PyTuple_GET_ITEM(sequence, 0); 
      __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1); 
    } else {
      __pyx_t_6 = PyList_GET_ITEM(sequence, 0); 
      __pyx_t_4 = PyList_GET_ITEM(sequence, 1); 
    }
    __Pyx_INCREF(__pyx_t_6);
    __Pyx_INCREF(__pyx_t_4);
    #else
    __pyx_t_6 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5850; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5850; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    #endif
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  } else {
    Py_ssize_t index = -1;
    __pyx_t_12 = PyObject_GetIter(__pyx_t_5); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5850; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_12);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_13 = Py_TYPE(__pyx_t_12)->tp_iternext;
    index = 0; __pyx_t_6 = __pyx_t_13(__pyx_t_12); if (unlikely(!__pyx_t_6)) goto __pyx_L4_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_6);
    index = 1; __pyx_t_4 = __pyx_t_13(__pyx_t_12); if (unlikely(!__pyx_t_4)) goto __pyx_L4_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_4);
    if (__Pyx_IternextUnpackEndCheck(__pyx_t_13(__pyx_t_12), 2) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5850; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_13 = NULL;
    __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
    goto __pyx_L5_unpacking_done;
    __pyx_L4_unpacking_failed:;
    __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
    __pyx_t_13 = NULL;
    if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
    {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5850; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_L5_unpacking_done:;
  }
  __pyx_t_2 = __Pyx_PyIndex_AsSsize_t(__pyx_t_6); if (unlikely((__pyx_t_2 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5850; __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_4); if (unlikely((__pyx_t_1 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5850; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_v_N = __pyx_t_2;
  __pyx_v_K = __pyx_t_1;

  /* "pandas/src/generated.pyx":5852
 *     N, K = (<object> values).shape
 * 
 *     if K > 1:             # <<<<<<<<<<<<<<
 *         for i in range(N):
 *             lab = labels[i]
 */
  __pyx_t_3 = ((__pyx_v_K > 1) != 0);
  if (__pyx_t_3) {

    /* "pandas/src/generated.pyx":5853
 * 
 *     if K > 1:
 *         for i in range(N):             # <<<<<<<<<<<<<<
 *             lab = labels[i]
 *             if lab < 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;

      /* "pandas/src/generated.pyx":5854
 *     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_pybuffernd_labels.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_labels.diminfo[0].strides));

      /* "pandas/src/generated.pyx":5855
 *         for i in range(N):
 *             lab = labels[i]
 *             if lab < 0:             # <<<<<<<<<<<<<<
 *                 continue
 * 
 */
      __pyx_t_3 = ((__pyx_v_lab < 0) != 0);
      if (__pyx_t_3) {

        /* "pandas/src/generated.pyx":5856
 *             lab = labels[i]
 *             if lab < 0:
 *                 continue             # <<<<<<<<<<<<<<
 * 
 *             counts[lab] += 1
 */
        goto __pyx_L7_continue;
      }

      /* "pandas/src/generated.pyx":5858
 *                 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_pybuffernd_counts.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_counts.diminfo[0].strides) += 1;

      /* "pandas/src/generated.pyx":5859
 * 
 *             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;

        /* "pandas/src/generated.pyx":5860
 *             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_float32_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_values.diminfo[0].strides, __pyx_t_19, __pyx_pybuffernd_values.diminfo[1].strides));

        /* "pandas/src/generated.pyx":5862
 *                 val = values[i, j]
 *                 # not nan
 *                 if val == val:             # <<<<<<<<<<<<<<
 *                     nobs[lab, j] += 1
 *                     sumx[lab, j] += val
 */
        __pyx_t_3 = ((__pyx_v_val == __pyx_v_val) != 0);
        if (__pyx_t_3) {

          /* "pandas/src/generated.pyx":5863
 *                 # 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_float32_t *, __pyx_pybuffernd_nobs.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_nobs.diminfo[0].strides, __pyx_t_21, __pyx_pybuffernd_nobs.diminfo[1].strides) += 1.0;

          /* "pandas/src/generated.pyx":5864
 *                 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_float32_t *, __pyx_pybuffernd_sumx.rcbuffer->pybuffer.buf, __pyx_t_22, __pyx_pybuffernd_sumx.diminfo[0].strides, __pyx_t_23, __pyx_pybuffernd_sumx.diminfo[1].strides) += __pyx_v_val;
          goto __pyx_L12;
        }
        __pyx_L12:;
      }
      __pyx_L7_continue:;
    }
    goto __pyx_L6;
  }
  /*else*/ {

    /* "pandas/src/generated.pyx":5866
 *                     sumx[lab, j] += val
 *     else:
 *         for i in range(N):             # <<<<<<<<<<<<<<
 *             lab = labels[i]
 *             if lab < 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;

      /* "pandas/src/generated.pyx":5867
 *     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_pybuffernd_labels.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_labels.diminfo[0].strides));

      /* "pandas/src/generated.pyx":5868
 *         for i in range(N):
 *             lab = labels[i]
 *             if lab < 0:             # <<<<<<<<<<<<<<
 *                 continue
 * 
 */
      __pyx_t_3 = ((__pyx_v_lab < 0) != 0);
      if (__pyx_t_3) {

        /* "pandas/src/generated.pyx":5869
 *             lab = labels[i]
 *             if lab < 0:
 *                 continue             # <<<<<<<<<<<<<<
 * 
 *             counts[lab] += 1
 */
        goto __pyx_L13_continue;
      }

      /* "pandas/src/generated.pyx":5871
 *                 continue
 * 
 *             counts[lab] += 1             # <<<<<<<<<<<<<<
 *             val = values[i, 0]
 *             # not nan
 */
      __pyx_t_17 = __pyx_v_lab;
      *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_counts.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_counts.diminfo[0].strides) += 1;

      /* "pandas/src/generated.pyx":5872
 * 
 *             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_float32_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_24, __pyx_pybuffernd_values.diminfo[0].strides, __pyx_t_25, __pyx_pybuffernd_values.diminfo[1].strides));

      /* "pandas/src/generated.pyx":5874
 *             val = values[i, 0]
 *             # not nan
 *             if val == val:             # <<<<<<<<<<<<<<
 *                 nobs[lab, 0] += 1
 *                 sumx[lab, 0] += val
 */
      __pyx_t_3 = ((__pyx_v_val == __pyx_v_val) != 0);
      if (__pyx_t_3) {

        /* "pandas/src/generated.pyx":5875
 *             # 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_float32_t *, __pyx_pybuffernd_nobs.rcbuffer->pybuffer.buf, __pyx_t_26, __pyx_pybuffernd_nobs.diminfo[0].strides, __pyx_t_27, __pyx_pybuffernd_nobs.diminfo[1].strides) += 1.0;

        /* "pandas/src/generated.pyx":5876
 *             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_float32_t *, __pyx_pybuffernd_sumx.rcbuffer->pybuffer.buf, __pyx_t_28, __pyx_pybuffernd_sumx.diminfo[0].strides, __pyx_t_29, __pyx_pybuffernd_sumx.diminfo[1].strides) += __pyx_v_val;
        goto __pyx_L16;
      }
      __pyx_L16:;
      __pyx_L13_continue:;
    }
  }
  __pyx_L6:;

  /* "pandas/src/generated.pyx":5878
 *                 sumx[lab, 0] += val
 * 
 *     for i in range(len(counts)):             # <<<<<<<<<<<<<<
 *         for j in range(K):
 *             count = nobs[i, j]
 */
  __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_counts)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5878; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) {
    __pyx_v_i = __pyx_t_2;

    /* "pandas/src/generated.pyx":5879
 * 
 *     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;

      /* "pandas/src/generated.pyx":5880
 *     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_float32_t *, __pyx_pybuffernd_nobs.rcbuffer->pybuffer.buf, __pyx_t_32, __pyx_pybuffernd_nobs.diminfo[0].strides, __pyx_t_33, __pyx_pybuffernd_nobs.diminfo[1].strides));

      /* "pandas/src/generated.pyx":5881
 *         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_3 = (((*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_nobs.rcbuffer->pybuffer.buf, __pyx_t_34, __pyx_pybuffernd_nobs.diminfo[0].strides, __pyx_t_35, __pyx_pybuffernd_nobs.diminfo[1].strides)) == 0.0) != 0);
      if (__pyx_t_3) {

        /* "pandas/src/generated.pyx":5882
 *             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_float32_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_36, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_37, __pyx_pybuffernd_out.diminfo[1].strides) = __pyx_v_6pandas_5algos_nan;
        goto __pyx_L21;
      }
      /*else*/ {

        /* "pandas/src/generated.pyx":5884
 *                 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_float32_t *, __pyx_pybuffernd_sumx.rcbuffer->pybuffer.buf, __pyx_t_38, __pyx_pybuffernd_sumx.diminfo[0].strides, __pyx_t_39, __pyx_pybuffernd_sumx.diminfo[1].strides));
        if (unlikely(__pyx_v_count == 0)) {
          #ifdef WITH_THREAD
          PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
          #endif
          PyErr_SetString(PyExc_ZeroDivisionError, "float division");
          #ifdef WITH_THREAD
          PyGILState_Release(__pyx_gilstate_save);
          #endif
          {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5884; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        __pyx_t_41 = __pyx_v_i;
        __pyx_t_42 = __pyx_v_j;
        *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_41, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_42, __pyx_pybuffernd_out.diminfo[1].strides) = (__pyx_t_40 / __pyx_v_count);
      }
      __pyx_L21:;
    }
  }

  /* "pandas/src/generated.pyx":5835
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def group_mean_float32(ndarray[float32_t, ndim=2] out,             # <<<<<<<<<<<<<<
 *                ndarray[int64_t] counts,
 *                ndarray[float32_t, ndim=2] values,
 */

  /* function exit code */
  __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_12);
  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
    __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_counts.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_labels.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_sumx.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas.algos.group_mean_float32", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_counts.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_labels.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_sumx.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer);
  __pyx_L2:;
  __Pyx_XDECREF((PyObject *)__pyx_v_sumx);
  __Pyx_XDECREF((PyObject *)__pyx_v_nobs);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/src/generated.pyx":5887
 * 
 * 
 * def group_mean_bin_float64(ndarray[float64_t, ndim=2] out,             # <<<<<<<<<<<<<<
 *                    ndarray[int64_t] counts,
 *                    ndarray[float64_t, ndim=2] values,
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pandas_5algos_431group_mean_bin_float64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_5algos_431group_mean_bin_float64 = {__Pyx_NAMESTR("group_mean_bin_float64"), (PyCFunction)__pyx_pw_6pandas_5algos_431group_mean_bin_float64, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pw_6pandas_5algos_431group_mean_bin_float64(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;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("group_mean_bin_float64 (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_out,&__pyx_n_s_counts,&__pyx_n_s_values,&__pyx_n_s_bins,0};
    PyObject* values[4] = {0,0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_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 (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_out)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_counts)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("group_mean_bin_float64", 1, 4, 4, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5887; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("group_mean_bin_float64", 1, 4, 4, 2); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5887; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  3:
        if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_bins)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("group_mean_bin_float64", 1, 4, 4, 3); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5887; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "group_mean_bin_float64") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5887; __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_float64", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5887; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas.algos.group_mean_bin_float64", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_out), __pyx_ptype_5numpy_ndarray, 1, "out", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5887; __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[2]; __pyx_lineno = 5888; __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[2]; __pyx_lineno = 5889; __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[2]; __pyx_lineno = 5890; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_430group_mean_bin_float64(__pyx_self, __pyx_v_out, __pyx_v_counts, __pyx_v_values, __pyx_v_bins);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pandas_5algos_430group_mean_bin_float64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_out, PyArrayObject *__pyx_v_counts, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_bins) {
  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;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_bins;
  __Pyx_Buffer __pyx_pybuffer_bins;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_counts;
  __Pyx_Buffer __pyx_pybuffer_counts;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_nobs;
  __Pyx_Buffer __pyx_pybuffer_nobs;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_out;
  __Pyx_Buffer __pyx_pybuffer_out;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_sumx;
  __Pyx_Buffer __pyx_pybuffer_sumx;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_values;
  __Pyx_Buffer __pyx_pybuffer_values;
  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;
  __Pyx_RefNannySetupContext("group_mean_bin_float64", 0);
  __pyx_pybuffer_sumx.pybuffer.buf = NULL;
  __pyx_pybuffer_sumx.refcount = 0;
  __pyx_pybuffernd_sumx.data = NULL;
  __pyx_pybuffernd_sumx.rcbuffer = &__pyx_pybuffer_sumx;
  __pyx_pybuffer_nobs.pybuffer.buf = NULL;
  __pyx_pybuffer_nobs.refcount = 0;
  __pyx_pybuffernd_nobs.data = NULL;
  __pyx_pybuffernd_nobs.rcbuffer = &__pyx_pybuffer_nobs;
  __pyx_pybuffer_out.pybuffer.buf = NULL;
  __pyx_pybuffer_out.refcount = 0;
  __pyx_pybuffernd_out.data = NULL;
  __pyx_pybuffernd_out.rcbuffer = &__pyx_pybuffer_out;
  __pyx_pybuffer_counts.pybuffer.buf = NULL;
  __pyx_pybuffer_counts.refcount = 0;
  __pyx_pybuffernd_counts.data = NULL;
  __pyx_pybuffernd_counts.rcbuffer = &__pyx_pybuffer_counts;
  __pyx_pybuffer_values.pybuffer.buf = NULL;
  __pyx_pybuffer_values.refcount = 0;
  __pyx_pybuffernd_values.data = NULL;
  __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values;
  __pyx_pybuffer_bins.pybuffer.buf = NULL;
  __pyx_pybuffer_bins.refcount = 0;
  __pyx_pybuffernd_bins.data = NULL;
  __pyx_pybuffernd_bins.rcbuffer = &__pyx_pybuffer_bins;
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_out.rcbuffer->pybuffer, (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[2]; __pyx_lineno = 5887; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_out.diminfo[0].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_out.diminfo[0].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_out.diminfo[1].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_out.diminfo[1].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[1];
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_counts.rcbuffer->pybuffer, (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[2]; __pyx_lineno = 5887; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_counts.diminfo[0].strides = __pyx_pybuffernd_counts.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_counts.diminfo[0].shape = __pyx_pybuffernd_counts.rcbuffer->pybuffer.shape[0];
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (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[2]; __pyx_lineno = 5887; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_values.diminfo[1].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_values.diminfo[1].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[1];
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_bins.rcbuffer->pybuffer, (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[2]; __pyx_lineno = 5887; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_bins.diminfo[0].strides = __pyx_pybuffernd_bins.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_bins.diminfo[0].shape = __pyx_pybuffernd_bins.rcbuffer->pybuffer.shape[0];

  /* "pandas/src/generated.pyx":5896
 *         ndarray[float64_t, ndim=2] sumx, nobs
 * 
 *     nobs = np.zeros_like(out)             # <<<<<<<<<<<<<<
 *     sumx = np.zeros_like(out)
 * 
 */
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5896; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros_like); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5896; __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[2]; __pyx_lineno = 5896; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__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 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5896; __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 (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5896; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_4 = ((PyArrayObject *)__pyx_t_3);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer);
    __pyx_t_5 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer, (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_pybuffernd_nobs.rcbuffer->pybuffer, (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_pybuffernd_nobs.diminfo[0].strides = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_nobs.diminfo[0].shape = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_nobs.diminfo[1].strides = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_nobs.diminfo[1].shape = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.shape[1];
    if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5896; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_4 = 0;
  __pyx_v_nobs = ((PyArrayObject *)__pyx_t_3);
  __pyx_t_3 = 0;

  /* "pandas/src/generated.pyx":5897
 * 
 *     nobs = np.zeros_like(out)
 *     sumx = np.zeros_like(out)             # <<<<<<<<<<<<<<
 * 
 *     N, K = (<object> values).shape
 */
  __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5897; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_zeros_like); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5897; __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[2]; __pyx_lineno = 5897; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__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 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5897; __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;
  if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5897; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_4 = ((PyArrayObject *)__pyx_t_2);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_sumx.rcbuffer->pybuffer);
    __pyx_t_5 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_sumx.rcbuffer->pybuffer, (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_pybuffernd_sumx.rcbuffer->pybuffer, (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_pybuffernd_sumx.diminfo[0].strides = __pyx_pybuffernd_sumx.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_sumx.diminfo[0].shape = __pyx_pybuffernd_sumx.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_sumx.diminfo[1].strides = __pyx_pybuffernd_sumx.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_sumx.diminfo[1].shape = __pyx_pybuffernd_sumx.rcbuffer->pybuffer.shape[1];
    if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5897; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_4 = 0;
  __pyx_v_sumx = ((PyArrayObject *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "pandas/src/generated.pyx":5899
 *     sumx = np.zeros_like(out)
 * 
 *     N, K = (<object> values).shape             # <<<<<<<<<<<<<<
 *     if bins[len(bins) - 1] == len(values):
 *         ngroups = len(bins)
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_values), __pyx_n_s_shape); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5899; __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 CYTHON_COMPILING_IN_CPYTHON
    Py_ssize_t size = Py_SIZE(sequence);
    #else
    Py_ssize_t size = PySequence_Size(sequence);
    #endif
    if (unlikely(size != 2)) {
      if (size > 2) __Pyx_RaiseTooManyValuesError(2);
      else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
      {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5899; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    #if CYTHON_COMPILING_IN_CPYTHON
    if (likely(PyTuple_CheckExact(sequence))) {
      __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0); 
      __pyx_t_1 = PyTuple_GET_ITEM(sequence, 1); 
    } else {
      __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);
    #else
    __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5899; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_1 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5899; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    #endif
    __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[2]; __pyx_lineno = 5899; __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_L3_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_L3_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_1);
    if (__Pyx_IternextUnpackEndCheck(__pyx_t_10(__pyx_t_9), 2) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5899; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_10 = NULL;
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    goto __pyx_L4_unpacking_done;
    __pyx_L3_unpacking_failed:;
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    __pyx_t_10 = NULL;
    if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
    {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5899; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_L4_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[2]; __pyx_lineno = 5899; __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[2]; __pyx_lineno = 5899; __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;

  /* "pandas/src/generated.pyx":5900
 * 
 *     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[2]; __pyx_lineno = 5900; __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_pybuffernd_bins.diminfo[0].shape;
    if (unlikely(__pyx_t_11 < 0)) __pyx_t_5 = 0;
  } else if (unlikely(__pyx_t_11 >= __pyx_pybuffernd_bins.diminfo[0].shape)) __pyx_t_5 = 0;
  if (unlikely(__pyx_t_5 != -1)) {
    __Pyx_RaiseBufferIndexError(__pyx_t_5);
    {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5900; __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[2]; __pyx_lineno = 5900; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_14 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_bins.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_bins.diminfo[0].strides)) == __pyx_t_13) != 0);
  if (__pyx_t_14) {

    /* "pandas/src/generated.pyx":5901
 *     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[2]; __pyx_lineno = 5901; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_v_ngroups = __pyx_t_13;
    goto __pyx_L5;
  }
  /*else*/ {

    /* "pandas/src/generated.pyx":5903
 *         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[2]; __pyx_lineno = 5903; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_v_ngroups = (__pyx_t_13 + 1);
  }
  __pyx_L5:;

  /* "pandas/src/generated.pyx":5905
 *         ngroups = len(bins) + 1
 * 
 *     b = 0             # <<<<<<<<<<<<<<
 *     if K > 1:
 *         for i in range(N):
 */
  __pyx_v_b = 0;

  /* "pandas/src/generated.pyx":5906
 * 
 *     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) != 0);
  if (__pyx_t_14) {

    /* "pandas/src/generated.pyx":5907
 *     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;

      /* "pandas/src/generated.pyx":5908
 *     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)) != 0);
        if (__pyx_t_14) {
          __pyx_t_15 = __pyx_v_b;
          __pyx_t_5 = -1;
          if (__pyx_t_15 < 0) {
            __pyx_t_15 += __pyx_pybuffernd_bins.diminfo[0].shape;
            if (unlikely(__pyx_t_15 < 0)) __pyx_t_5 = 0;
          } else if (unlikely(__pyx_t_15 >= __pyx_pybuffernd_bins.diminfo[0].shape)) __pyx_t_5 = 0;
          if (unlikely(__pyx_t_5 != -1)) {
            __Pyx_RaiseBufferIndexError(__pyx_t_5);
            {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5908; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          }
          __pyx_t_16 = ((__pyx_v_i >= (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_bins.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_bins.diminfo[0].strides))) != 0);
          __pyx_t_17 = __pyx_t_16;
        } else {
          __pyx_t_17 = __pyx_t_14;
        }
        if (!__pyx_t_17) break;

        /* "pandas/src/generated.pyx":5909
 *         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);
      }

      /* "pandas/src/generated.pyx":5911
 *                 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_pybuffernd_counts.diminfo[0].shape;
        if (unlikely(__pyx_t_18 < 0)) __pyx_t_5 = 0;
      } else if (unlikely(__pyx_t_18 >= __pyx_pybuffernd_counts.diminfo[0].shape)) __pyx_t_5 = 0;
      if (unlikely(__pyx_t_5 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_5);
        {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5911; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_counts.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_counts.diminfo[0].strides) += 1;

      /* "pandas/src/generated.pyx":5912
 * 
 *             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;

        /* "pandas/src/generated.pyx":5913
 *             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_pybuffernd_values.diminfo[0].shape;
          if (unlikely(__pyx_t_21 < 0)) __pyx_t_5 = 0;
        } else if (unlikely(__pyx_t_21 >= __pyx_pybuffernd_values.diminfo[0].shape)) __pyx_t_5 = 0;
        if (__pyx_t_22 < 0) {
          __pyx_t_22 += __pyx_pybuffernd_values.diminfo[1].shape;
          if (unlikely(__pyx_t_22 < 0)) __pyx_t_5 = 1;
        } else if (unlikely(__pyx_t_22 >= __pyx_pybuffernd_values.diminfo[1].shape)) __pyx_t_5 = 1;
        if (unlikely(__pyx_t_5 != -1)) {
          __Pyx_RaiseBufferIndexError(__pyx_t_5);
          {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5913; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        __pyx_v_val = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_values.diminfo[0].strides, __pyx_t_22, __pyx_pybuffernd_values.diminfo[1].strides));

        /* "pandas/src/generated.pyx":5916
 * 
 *                 # not nan
 *                 if val == val:             # <<<<<<<<<<<<<<
 *                     nobs[b, j] += 1
 *                     sumx[b, j] += val
 */
        __pyx_t_17 = ((__pyx_v_val == __pyx_v_val) != 0);
        if (__pyx_t_17) {

          /* "pandas/src/generated.pyx":5917
 *                 # 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_pybuffernd_nobs.diminfo[0].shape;
            if (unlikely(__pyx_t_23 < 0)) __pyx_t_5 = 0;
          } else if (unlikely(__pyx_t_23 >= __pyx_pybuffernd_nobs.diminfo[0].shape)) __pyx_t_5 = 0;
          if (__pyx_t_24 < 0) {
            __pyx_t_24 += __pyx_pybuffernd_nobs.diminfo[1].shape;
            if (unlikely(__pyx_t_24 < 0)) __pyx_t_5 = 1;
          } else if (unlikely(__pyx_t_24 >= __pyx_pybuffernd_nobs.diminfo[1].shape)) __pyx_t_5 = 1;
          if (unlikely(__pyx_t_5 != -1)) {
            __Pyx_RaiseBufferIndexError(__pyx_t_5);
            {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5917; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          }
          *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_nobs.rcbuffer->pybuffer.buf, __pyx_t_23, __pyx_pybuffernd_nobs.diminfo[0].strides, __pyx_t_24, __pyx_pybuffernd_nobs.diminfo[1].strides) += 1.0;

          /* "pandas/src/generated.pyx":5918
 *                 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_pybuffernd_sumx.diminfo[0].shape;
            if (unlikely(__pyx_t_25 < 0)) __pyx_t_5 = 0;
          } else if (unlikely(__pyx_t_25 >= __pyx_pybuffernd_sumx.diminfo[0].shape)) __pyx_t_5 = 0;
          if (__pyx_t_26 < 0) {
            __pyx_t_26 += __pyx_pybuffernd_sumx.diminfo[1].shape;
            if (unlikely(__pyx_t_26 < 0)) __pyx_t_5 = 1;
          } else if (unlikely(__pyx_t_26 >= __pyx_pybuffernd_sumx.diminfo[1].shape)) __pyx_t_5 = 1;
          if (unlikely(__pyx_t_5 != -1)) {
            __Pyx_RaiseBufferIndexError(__pyx_t_5);
            {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5918; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          }
          *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_sumx.rcbuffer->pybuffer.buf, __pyx_t_25, __pyx_pybuffernd_sumx.diminfo[0].strides, __pyx_t_26, __pyx_pybuffernd_sumx.diminfo[1].strides) += __pyx_v_val;
          goto __pyx_L13;
        }
        __pyx_L13:;
      }
    }
    goto __pyx_L6;
  }
  /*else*/ {

    /* "pandas/src/generated.pyx":5920
 *                     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;

      /* "pandas/src/generated.pyx":5921
 *     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)) != 0);
        if (__pyx_t_17) {
          __pyx_t_19 = __pyx_v_b;
          __pyx_t_5 = -1;
          if (__pyx_t_19 < 0) {
            __pyx_t_19 += __pyx_pybuffernd_bins.diminfo[0].shape;
            if (unlikely(__pyx_t_19 < 0)) __pyx_t_5 = 0;
          } else if (unlikely(__pyx_t_19 >= __pyx_pybuffernd_bins.diminfo[0].shape)) __pyx_t_5 = 0;
          if (unlikely(__pyx_t_5 != -1)) {
            __Pyx_RaiseBufferIndexError(__pyx_t_5);
            {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5921; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          }
          __pyx_t_14 = ((__pyx_v_i >= (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_bins.rcbuffer->pybuffer.buf, __pyx_t_19, __pyx_pybuffernd_bins.diminfo[0].strides))) != 0);
          __pyx_t_16 = __pyx_t_14;
        } else {
          __pyx_t_16 = __pyx_t_17;
        }
        if (!__pyx_t_16) break;

        /* "pandas/src/generated.pyx":5922
 *         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);
      }

      /* "pandas/src/generated.pyx":5924
 *                 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_pybuffernd_counts.diminfo[0].shape;
        if (unlikely(__pyx_t_20 < 0)) __pyx_t_5 = 0;
      } else if (unlikely(__pyx_t_20 >= __pyx_pybuffernd_counts.diminfo[0].shape)) __pyx_t_5 = 0;
      if (unlikely(__pyx_t_5 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_5);
        {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5924; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_counts.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_counts.diminfo[0].strides) += 1;

      /* "pandas/src/generated.pyx":5925
 * 
 *             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_pybuffernd_values.diminfo[0].shape;
        if (unlikely(__pyx_t_27 < 0)) __pyx_t_5 = 0;
      } else if (unlikely(__pyx_t_27 >= __pyx_pybuffernd_values.diminfo[0].shape)) __pyx_t_5 = 0;
      if (__pyx_t_28 < 0) {
        __pyx_t_28 += __pyx_pybuffernd_values.diminfo[1].shape;
        if (unlikely(__pyx_t_28 < 0)) __pyx_t_5 = 1;
      } else if (unlikely(__pyx_t_28 >= __pyx_pybuffernd_values.diminfo[1].shape)) __pyx_t_5 = 1;
      if (unlikely(__pyx_t_5 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_5);
        {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5925; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_v_val = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_27, __pyx_pybuffernd_values.diminfo[0].strides, __pyx_t_28, __pyx_pybuffernd_values.diminfo[1].strides));

      /* "pandas/src/generated.pyx":5928
 * 
 *             # not nan
 *             if val == val:             # <<<<<<<<<<<<<<
 *                 nobs[b, 0] += 1
 *                 sumx[b, 0] += val
 */
      __pyx_t_16 = ((__pyx_v_val == __pyx_v_val) != 0);
      if (__pyx_t_16) {

        /* "pandas/src/generated.pyx":5929
 *             # 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_pybuffernd_nobs.diminfo[0].shape;
          if (unlikely(__pyx_t_29 < 0)) __pyx_t_5 = 0;
        } else if (unlikely(__pyx_t_29 >= __pyx_pybuffernd_nobs.diminfo[0].shape)) __pyx_t_5 = 0;
        if (__pyx_t_30 < 0) {
          __pyx_t_30 += __pyx_pybuffernd_nobs.diminfo[1].shape;
          if (unlikely(__pyx_t_30 < 0)) __pyx_t_5 = 1;
        } else if (unlikely(__pyx_t_30 >= __pyx_pybuffernd_nobs.diminfo[1].shape)) __pyx_t_5 = 1;
        if (unlikely(__pyx_t_5 != -1)) {
          __Pyx_RaiseBufferIndexError(__pyx_t_5);
          {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5929; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_nobs.rcbuffer->pybuffer.buf, __pyx_t_29, __pyx_pybuffernd_nobs.diminfo[0].strides, __pyx_t_30, __pyx_pybuffernd_nobs.diminfo[1].strides) += 1.0;

        /* "pandas/src/generated.pyx":5930
 *             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_pybuffernd_sumx.diminfo[0].shape;
          if (unlikely(__pyx_t_31 < 0)) __pyx_t_5 = 0;
        } else if (unlikely(__pyx_t_31 >= __pyx_pybuffernd_sumx.diminfo[0].shape)) __pyx_t_5 = 0;
        if (__pyx_t_32 < 0) {
          __pyx_t_32 += __pyx_pybuffernd_sumx.diminfo[1].shape;
          if (unlikely(__pyx_t_32 < 0)) __pyx_t_5 = 1;
        } else if (unlikely(__pyx_t_32 >= __pyx_pybuffernd_sumx.diminfo[1].shape)) __pyx_t_5 = 1;
        if (unlikely(__pyx_t_5 != -1)) {
          __Pyx_RaiseBufferIndexError(__pyx_t_5);
          {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5930; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_sumx.rcbuffer->pybuffer.buf, __pyx_t_31, __pyx_pybuffernd_sumx.diminfo[0].strides, __pyx_t_32, __pyx_pybuffernd_sumx.diminfo[1].strides) += __pyx_v_val;
        goto __pyx_L18;
      }
      __pyx_L18:;
    }
  }
  __pyx_L6:;

  /* "pandas/src/generated.pyx":5932
 *                 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;

    /* "pandas/src/generated.pyx":5933
 * 
 *     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;

      /* "pandas/src/generated.pyx":5934
 *     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_pybuffernd_nobs.diminfo[0].shape;
        if (unlikely(__pyx_t_35 < 0)) __pyx_t_5 = 0;
      } else if (unlikely(__pyx_t_35 >= __pyx_pybuffernd_nobs.diminfo[0].shape)) __pyx_t_5 = 0;
      if (__pyx_t_36 < 0) {
        __pyx_t_36 += __pyx_pybuffernd_nobs.diminfo[1].shape;
        if (unlikely(__pyx_t_36 < 0)) __pyx_t_5 = 1;
      } else if (unlikely(__pyx_t_36 >= __pyx_pybuffernd_nobs.diminfo[1].shape)) __pyx_t_5 = 1;
      if (unlikely(__pyx_t_5 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_5);
        {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5934; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_v_count = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_nobs.rcbuffer->pybuffer.buf, __pyx_t_35, __pyx_pybuffernd_nobs.diminfo[0].strides, __pyx_t_36, __pyx_pybuffernd_nobs.diminfo[1].strides));

      /* "pandas/src/generated.pyx":5935
 *         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_pybuffernd_nobs.diminfo[0].shape;
        if (unlikely(__pyx_t_37 < 0)) __pyx_t_5 = 0;
      } else if (unlikely(__pyx_t_37 >= __pyx_pybuffernd_nobs.diminfo[0].shape)) __pyx_t_5 = 0;
      if (__pyx_t_38 < 0) {
        __pyx_t_38 += __pyx_pybuffernd_nobs.diminfo[1].shape;
        if (unlikely(__pyx_t_38 < 0)) __pyx_t_5 = 1;
      } else if (unlikely(__pyx_t_38 >= __pyx_pybuffernd_nobs.diminfo[1].shape)) __pyx_t_5 = 1;
      if (unlikely(__pyx_t_5 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_5);
        {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5935; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_t_16 = (((*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_nobs.rcbuffer->pybuffer.buf, __pyx_t_37, __pyx_pybuffernd_nobs.diminfo[0].strides, __pyx_t_38, __pyx_pybuffernd_nobs.diminfo[1].strides)) == 0.0) != 0);
      if (__pyx_t_16) {

        /* "pandas/src/generated.pyx":5936
 *             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_pybuffernd_out.diminfo[0].shape;
          if (unlikely(__pyx_t_39 < 0)) __pyx_t_5 = 0;
        } else if (unlikely(__pyx_t_39 >= __pyx_pybuffernd_out.diminfo[0].shape)) __pyx_t_5 = 0;
        if (__pyx_t_40 < 0) {
          __pyx_t_40 += __pyx_pybuffernd_out.diminfo[1].shape;
          if (unlikely(__pyx_t_40 < 0)) __pyx_t_5 = 1;
        } else if (unlikely(__pyx_t_40 >= __pyx_pybuffernd_out.diminfo[1].shape)) __pyx_t_5 = 1;
        if (unlikely(__pyx_t_5 != -1)) {
          __Pyx_RaiseBufferIndexError(__pyx_t_5);
          {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5936; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_39, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_40, __pyx_pybuffernd_out.diminfo[1].strides) = __pyx_v_6pandas_5algos_nan;
        goto __pyx_L23;
      }
      /*else*/ {

        /* "pandas/src/generated.pyx":5938
 *                 out[i, j] = nan
 *             else:
 *                 out[i, j] = sumx[i, j] / count             # <<<<<<<<<<<<<<
 * 
 * def group_mean_bin_float32(ndarray[float32_t, ndim=2] out,
 */
        __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_pybuffernd_sumx.diminfo[0].shape;
          if (unlikely(__pyx_t_41 < 0)) __pyx_t_5 = 0;
        } else if (unlikely(__pyx_t_41 >= __pyx_pybuffernd_sumx.diminfo[0].shape)) __pyx_t_5 = 0;
        if (__pyx_t_42 < 0) {
          __pyx_t_42 += __pyx_pybuffernd_sumx.diminfo[1].shape;
          if (unlikely(__pyx_t_42 < 0)) __pyx_t_5 = 1;
        } else if (unlikely(__pyx_t_42 >= __pyx_pybuffernd_sumx.diminfo[1].shape)) __pyx_t_5 = 1;
        if (unlikely(__pyx_t_5 != -1)) {
          __Pyx_RaiseBufferIndexError(__pyx_t_5);
          {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5938; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        __pyx_t_43 = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_sumx.rcbuffer->pybuffer.buf, __pyx_t_41, __pyx_pybuffernd_sumx.diminfo[0].strides, __pyx_t_42, __pyx_pybuffernd_sumx.diminfo[1].strides));
        if (unlikely(__pyx_v_count == 0)) {
          #ifdef WITH_THREAD
          PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
          #endif
          PyErr_SetString(PyExc_ZeroDivisionError, "float division");
          #ifdef WITH_THREAD
          PyGILState_Release(__pyx_gilstate_save);
          #endif
          {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5938; __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_pybuffernd_out.diminfo[0].shape;
          if (unlikely(__pyx_t_44 < 0)) __pyx_t_5 = 0;
        } else if (unlikely(__pyx_t_44 >= __pyx_pybuffernd_out.diminfo[0].shape)) __pyx_t_5 = 0;
        if (__pyx_t_45 < 0) {
          __pyx_t_45 += __pyx_pybuffernd_out.diminfo[1].shape;
          if (unlikely(__pyx_t_45 < 0)) __pyx_t_5 = 1;
        } else if (unlikely(__pyx_t_45 >= __pyx_pybuffernd_out.diminfo[1].shape)) __pyx_t_5 = 1;
        if (unlikely(__pyx_t_5 != -1)) {
          __Pyx_RaiseBufferIndexError(__pyx_t_5);
          {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5938; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_44, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_45, __pyx_pybuffernd_out.diminfo[1].strides) = (__pyx_t_43 / __pyx_v_count);
      }
      __pyx_L23:;
    }
  }

  /* "pandas/src/generated.pyx":5887
 * 
 * 
 * def group_mean_bin_float64(ndarray[float64_t, ndim=2] out,             # <<<<<<<<<<<<<<
 *                    ndarray[int64_t] counts,
 *                    ndarray[float64_t, ndim=2] values,
 */

  /* function exit code */
  __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_pybuffernd_bins.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_counts.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_sumx.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas.algos.group_mean_bin_float64", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_bins.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_counts.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_sumx.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer);
  __pyx_L2:;
  __Pyx_XDECREF((PyObject *)__pyx_v_sumx);
  __Pyx_XDECREF((PyObject *)__pyx_v_nobs);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/src/generated.pyx":5940
 *                 out[i, j] = sumx[i, j] / count
 * 
 * def group_mean_bin_float32(ndarray[float32_t, ndim=2] out,             # <<<<<<<<<<<<<<
 *                    ndarray[int64_t] counts,
 *                    ndarray[float32_t, ndim=2] values,
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pandas_5algos_433group_mean_bin_float32(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_5algos_433group_mean_bin_float32 = {__Pyx_NAMESTR("group_mean_bin_float32"), (PyCFunction)__pyx_pw_6pandas_5algos_433group_mean_bin_float32, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pw_6pandas_5algos_433group_mean_bin_float32(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;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("group_mean_bin_float32 (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_out,&__pyx_n_s_counts,&__pyx_n_s_values,&__pyx_n_s_bins,0};
    PyObject* values[4] = {0,0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_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 (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_out)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_counts)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("group_mean_bin_float32", 1, 4, 4, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5940; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("group_mean_bin_float32", 1, 4, 4, 2); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5940; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  3:
        if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_bins)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("group_mean_bin_float32", 1, 4, 4, 3); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5940; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "group_mean_bin_float32") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5940; __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_float32", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5940; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas.algos.group_mean_bin_float32", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_out), __pyx_ptype_5numpy_ndarray, 1, "out", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5940; __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[2]; __pyx_lineno = 5941; __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[2]; __pyx_lineno = 5942; __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[2]; __pyx_lineno = 5943; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_432group_mean_bin_float32(__pyx_self, __pyx_v_out, __pyx_v_counts, __pyx_v_values, __pyx_v_bins);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pandas_5algos_432group_mean_bin_float32(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_out, PyArrayObject *__pyx_v_counts, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_bins) {
  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_float32_t __pyx_v_val;
  __pyx_t_5numpy_float32_t __pyx_v_count;
  PyArrayObject *__pyx_v_sumx = 0;
  PyArrayObject *__pyx_v_nobs = 0;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_bins;
  __Pyx_Buffer __pyx_pybuffer_bins;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_counts;
  __Pyx_Buffer __pyx_pybuffer_counts;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_nobs;
  __Pyx_Buffer __pyx_pybuffer_nobs;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_out;
  __Pyx_Buffer __pyx_pybuffer_out;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_sumx;
  __Pyx_Buffer __pyx_pybuffer_sumx;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_values;
  __Pyx_Buffer __pyx_pybuffer_values;
  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_float32_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;
  __Pyx_RefNannySetupContext("group_mean_bin_float32", 0);
  __pyx_pybuffer_sumx.pybuffer.buf = NULL;
  __pyx_pybuffer_sumx.refcount = 0;
  __pyx_pybuffernd_sumx.data = NULL;
  __pyx_pybuffernd_sumx.rcbuffer = &__pyx_pybuffer_sumx;
  __pyx_pybuffer_nobs.pybuffer.buf = NULL;
  __pyx_pybuffer_nobs.refcount = 0;
  __pyx_pybuffernd_nobs.data = NULL;
  __pyx_pybuffernd_nobs.rcbuffer = &__pyx_pybuffer_nobs;
  __pyx_pybuffer_out.pybuffer.buf = NULL;
  __pyx_pybuffer_out.refcount = 0;
  __pyx_pybuffernd_out.data = NULL;
  __pyx_pybuffernd_out.rcbuffer = &__pyx_pybuffer_out;
  __pyx_pybuffer_counts.pybuffer.buf = NULL;
  __pyx_pybuffer_counts.refcount = 0;
  __pyx_pybuffernd_counts.data = NULL;
  __pyx_pybuffernd_counts.rcbuffer = &__pyx_pybuffer_counts;
  __pyx_pybuffer_values.pybuffer.buf = NULL;
  __pyx_pybuffer_values.refcount = 0;
  __pyx_pybuffernd_values.data = NULL;
  __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values;
  __pyx_pybuffer_bins.pybuffer.buf = NULL;
  __pyx_pybuffer_bins.refcount = 0;
  __pyx_pybuffernd_bins.data = NULL;
  __pyx_pybuffernd_bins.rcbuffer = &__pyx_pybuffer_bins;
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_out.rcbuffer->pybuffer, (PyObject*)__pyx_v_out, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5940; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_out.diminfo[0].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_out.diminfo[0].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_out.diminfo[1].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_out.diminfo[1].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[1];
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_counts.rcbuffer->pybuffer, (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[2]; __pyx_lineno = 5940; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_counts.diminfo[0].strides = __pyx_pybuffernd_counts.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_counts.diminfo[0].shape = __pyx_pybuffernd_counts.rcbuffer->pybuffer.shape[0];
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5940; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_values.diminfo[1].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_values.diminfo[1].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[1];
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_bins.rcbuffer->pybuffer, (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[2]; __pyx_lineno = 5940; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_bins.diminfo[0].strides = __pyx_pybuffernd_bins.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_bins.diminfo[0].shape = __pyx_pybuffernd_bins.rcbuffer->pybuffer.shape[0];

  /* "pandas/src/generated.pyx":5949
 *         ndarray[float32_t, ndim=2] sumx, nobs
 * 
 *     nobs = np.zeros_like(out)             # <<<<<<<<<<<<<<
 *     sumx = np.zeros_like(out)
 * 
 */
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5949; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros_like); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5949; __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[2]; __pyx_lineno = 5949; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__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 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5949; __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 (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5949; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_4 = ((PyArrayObject *)__pyx_t_3);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer);
    __pyx_t_5 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer, (PyObject*)__pyx_t_4, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_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_pybuffernd_nobs.rcbuffer->pybuffer, (PyObject*)__pyx_v_nobs, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_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_pybuffernd_nobs.diminfo[0].strides = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_nobs.diminfo[0].shape = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_nobs.diminfo[1].strides = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_nobs.diminfo[1].shape = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.shape[1];
    if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5949; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_4 = 0;
  __pyx_v_nobs = ((PyArrayObject *)__pyx_t_3);
  __pyx_t_3 = 0;

  /* "pandas/src/generated.pyx":5950
 * 
 *     nobs = np.zeros_like(out)
 *     sumx = np.zeros_like(out)             # <<<<<<<<<<<<<<
 * 
 *     N, K = (<object> values).shape
 */
  __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5950; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_zeros_like); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5950; __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[2]; __pyx_lineno = 5950; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__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 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5950; __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;
  if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5950; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_4 = ((PyArrayObject *)__pyx_t_2);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_sumx.rcbuffer->pybuffer);
    __pyx_t_5 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_sumx.rcbuffer->pybuffer, (PyObject*)__pyx_t_4, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_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_pybuffernd_sumx.rcbuffer->pybuffer, (PyObject*)__pyx_v_sumx, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_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_pybuffernd_sumx.diminfo[0].strides = __pyx_pybuffernd_sumx.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_sumx.diminfo[0].shape = __pyx_pybuffernd_sumx.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_sumx.diminfo[1].strides = __pyx_pybuffernd_sumx.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_sumx.diminfo[1].shape = __pyx_pybuffernd_sumx.rcbuffer->pybuffer.shape[1];
    if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5950; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_4 = 0;
  __pyx_v_sumx = ((PyArrayObject *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "pandas/src/generated.pyx":5952
 *     sumx = np.zeros_like(out)
 * 
 *     N, K = (<object> values).shape             # <<<<<<<<<<<<<<
 *     if bins[len(bins) - 1] == len(values):
 *         ngroups = len(bins)
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_values), __pyx_n_s_shape); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5952; __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 CYTHON_COMPILING_IN_CPYTHON
    Py_ssize_t size = Py_SIZE(sequence);
    #else
    Py_ssize_t size = PySequence_Size(sequence);
    #endif
    if (unlikely(size != 2)) {
      if (size > 2) __Pyx_RaiseTooManyValuesError(2);
      else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
      {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5952; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    #if CYTHON_COMPILING_IN_CPYTHON
    if (likely(PyTuple_CheckExact(sequence))) {
      __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0); 
      __pyx_t_1 = PyTuple_GET_ITEM(sequence, 1); 
    } else {
      __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);
    #else
    __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5952; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_1 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5952; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    #endif
    __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[2]; __pyx_lineno = 5952; __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_L3_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_L3_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_1);
    if (__Pyx_IternextUnpackEndCheck(__pyx_t_10(__pyx_t_9), 2) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5952; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_10 = NULL;
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    goto __pyx_L4_unpacking_done;
    __pyx_L3_unpacking_failed:;
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    __pyx_t_10 = NULL;
    if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
    {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5952; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_L4_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[2]; __pyx_lineno = 5952; __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[2]; __pyx_lineno = 5952; __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;

  /* "pandas/src/generated.pyx":5953
 * 
 *     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[2]; __pyx_lineno = 5953; __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_pybuffernd_bins.diminfo[0].shape;
    if (unlikely(__pyx_t_11 < 0)) __pyx_t_5 = 0;
  } else if (unlikely(__pyx_t_11 >= __pyx_pybuffernd_bins.diminfo[0].shape)) __pyx_t_5 = 0;
  if (unlikely(__pyx_t_5 != -1)) {
    __Pyx_RaiseBufferIndexError(__pyx_t_5);
    {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5953; __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[2]; __pyx_lineno = 5953; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_14 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_bins.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_bins.diminfo[0].strides)) == __pyx_t_13) != 0);
  if (__pyx_t_14) {

    /* "pandas/src/generated.pyx":5954
 *     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[2]; __pyx_lineno = 5954; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_v_ngroups = __pyx_t_13;
    goto __pyx_L5;
  }
  /*else*/ {

    /* "pandas/src/generated.pyx":5956
 *         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[2]; __pyx_lineno = 5956; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_v_ngroups = (__pyx_t_13 + 1);
  }
  __pyx_L5:;

  /* "pandas/src/generated.pyx":5958
 *         ngroups = len(bins) + 1
 * 
 *     b = 0             # <<<<<<<<<<<<<<
 *     if K > 1:
 *         for i in range(N):
 */
  __pyx_v_b = 0;

  /* "pandas/src/generated.pyx":5959
 * 
 *     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) != 0);
  if (__pyx_t_14) {

    /* "pandas/src/generated.pyx":5960
 *     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;

      /* "pandas/src/generated.pyx":5961
 *     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)) != 0);
        if (__pyx_t_14) {
          __pyx_t_15 = __pyx_v_b;
          __pyx_t_5 = -1;
          if (__pyx_t_15 < 0) {
            __pyx_t_15 += __pyx_pybuffernd_bins.diminfo[0].shape;
            if (unlikely(__pyx_t_15 < 0)) __pyx_t_5 = 0;
          } else if (unlikely(__pyx_t_15 >= __pyx_pybuffernd_bins.diminfo[0].shape)) __pyx_t_5 = 0;
          if (unlikely(__pyx_t_5 != -1)) {
            __Pyx_RaiseBufferIndexError(__pyx_t_5);
            {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5961; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          }
          __pyx_t_16 = ((__pyx_v_i >= (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_bins.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_bins.diminfo[0].strides))) != 0);
          __pyx_t_17 = __pyx_t_16;
        } else {
          __pyx_t_17 = __pyx_t_14;
        }
        if (!__pyx_t_17) break;

        /* "pandas/src/generated.pyx":5962
 *         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);
      }

      /* "pandas/src/generated.pyx":5964
 *                 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_pybuffernd_counts.diminfo[0].shape;
        if (unlikely(__pyx_t_18 < 0)) __pyx_t_5 = 0;
      } else if (unlikely(__pyx_t_18 >= __pyx_pybuffernd_counts.diminfo[0].shape)) __pyx_t_5 = 0;
      if (unlikely(__pyx_t_5 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_5);
        {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5964; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_counts.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_counts.diminfo[0].strides) += 1;

      /* "pandas/src/generated.pyx":5965
 * 
 *             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;

        /* "pandas/src/generated.pyx":5966
 *             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_pybuffernd_values.diminfo[0].shape;
          if (unlikely(__pyx_t_21 < 0)) __pyx_t_5 = 0;
        } else if (unlikely(__pyx_t_21 >= __pyx_pybuffernd_values.diminfo[0].shape)) __pyx_t_5 = 0;
        if (__pyx_t_22 < 0) {
          __pyx_t_22 += __pyx_pybuffernd_values.diminfo[1].shape;
          if (unlikely(__pyx_t_22 < 0)) __pyx_t_5 = 1;
        } else if (unlikely(__pyx_t_22 >= __pyx_pybuffernd_values.diminfo[1].shape)) __pyx_t_5 = 1;
        if (unlikely(__pyx_t_5 != -1)) {
          __Pyx_RaiseBufferIndexError(__pyx_t_5);
          {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5966; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        __pyx_v_val = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_values.diminfo[0].strides, __pyx_t_22, __pyx_pybuffernd_values.diminfo[1].strides));

        /* "pandas/src/generated.pyx":5969
 * 
 *                 # not nan
 *                 if val == val:             # <<<<<<<<<<<<<<
 *                     nobs[b, j] += 1
 *                     sumx[b, j] += val
 */
        __pyx_t_17 = ((__pyx_v_val == __pyx_v_val) != 0);
        if (__pyx_t_17) {

          /* "pandas/src/generated.pyx":5970
 *                 # 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_pybuffernd_nobs.diminfo[0].shape;
            if (unlikely(__pyx_t_23 < 0)) __pyx_t_5 = 0;
          } else if (unlikely(__pyx_t_23 >= __pyx_pybuffernd_nobs.diminfo[0].shape)) __pyx_t_5 = 0;
          if (__pyx_t_24 < 0) {
            __pyx_t_24 += __pyx_pybuffernd_nobs.diminfo[1].shape;
            if (unlikely(__pyx_t_24 < 0)) __pyx_t_5 = 1;
          } else if (unlikely(__pyx_t_24 >= __pyx_pybuffernd_nobs.diminfo[1].shape)) __pyx_t_5 = 1;
          if (unlikely(__pyx_t_5 != -1)) {
            __Pyx_RaiseBufferIndexError(__pyx_t_5);
            {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5970; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          }
          *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_nobs.rcbuffer->pybuffer.buf, __pyx_t_23, __pyx_pybuffernd_nobs.diminfo[0].strides, __pyx_t_24, __pyx_pybuffernd_nobs.diminfo[1].strides) += 1.0;

          /* "pandas/src/generated.pyx":5971
 *                 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_pybuffernd_sumx.diminfo[0].shape;
            if (unlikely(__pyx_t_25 < 0)) __pyx_t_5 = 0;
          } else if (unlikely(__pyx_t_25 >= __pyx_pybuffernd_sumx.diminfo[0].shape)) __pyx_t_5 = 0;
          if (__pyx_t_26 < 0) {
            __pyx_t_26 += __pyx_pybuffernd_sumx.diminfo[1].shape;
            if (unlikely(__pyx_t_26 < 0)) __pyx_t_5 = 1;
          } else if (unlikely(__pyx_t_26 >= __pyx_pybuffernd_sumx.diminfo[1].shape)) __pyx_t_5 = 1;
          if (unlikely(__pyx_t_5 != -1)) {
            __Pyx_RaiseBufferIndexError(__pyx_t_5);
            {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5971; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          }
          *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_sumx.rcbuffer->pybuffer.buf, __pyx_t_25, __pyx_pybuffernd_sumx.diminfo[0].strides, __pyx_t_26, __pyx_pybuffernd_sumx.diminfo[1].strides) += __pyx_v_val;
          goto __pyx_L13;
        }
        __pyx_L13:;
      }
    }
    goto __pyx_L6;
  }
  /*else*/ {

    /* "pandas/src/generated.pyx":5973
 *                     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;

      /* "pandas/src/generated.pyx":5974
 *     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)) != 0);
        if (__pyx_t_17) {
          __pyx_t_19 = __pyx_v_b;
          __pyx_t_5 = -1;
          if (__pyx_t_19 < 0) {
            __pyx_t_19 += __pyx_pybuffernd_bins.diminfo[0].shape;
            if (unlikely(__pyx_t_19 < 0)) __pyx_t_5 = 0;
          } else if (unlikely(__pyx_t_19 >= __pyx_pybuffernd_bins.diminfo[0].shape)) __pyx_t_5 = 0;
          if (unlikely(__pyx_t_5 != -1)) {
            __Pyx_RaiseBufferIndexError(__pyx_t_5);
            {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5974; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          }
          __pyx_t_14 = ((__pyx_v_i >= (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_bins.rcbuffer->pybuffer.buf, __pyx_t_19, __pyx_pybuffernd_bins.diminfo[0].strides))) != 0);
          __pyx_t_16 = __pyx_t_14;
        } else {
          __pyx_t_16 = __pyx_t_17;
        }
        if (!__pyx_t_16) break;

        /* "pandas/src/generated.pyx":5975
 *         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);
      }

      /* "pandas/src/generated.pyx":5977
 *                 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_pybuffernd_counts.diminfo[0].shape;
        if (unlikely(__pyx_t_20 < 0)) __pyx_t_5 = 0;
      } else if (unlikely(__pyx_t_20 >= __pyx_pybuffernd_counts.diminfo[0].shape)) __pyx_t_5 = 0;
      if (unlikely(__pyx_t_5 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_5);
        {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5977; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_counts.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_counts.diminfo[0].strides) += 1;

      /* "pandas/src/generated.pyx":5978
 * 
 *             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_pybuffernd_values.diminfo[0].shape;
        if (unlikely(__pyx_t_27 < 0)) __pyx_t_5 = 0;
      } else if (unlikely(__pyx_t_27 >= __pyx_pybuffernd_values.diminfo[0].shape)) __pyx_t_5 = 0;
      if (__pyx_t_28 < 0) {
        __pyx_t_28 += __pyx_pybuffernd_values.diminfo[1].shape;
        if (unlikely(__pyx_t_28 < 0)) __pyx_t_5 = 1;
      } else if (unlikely(__pyx_t_28 >= __pyx_pybuffernd_values.diminfo[1].shape)) __pyx_t_5 = 1;
      if (unlikely(__pyx_t_5 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_5);
        {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5978; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_v_val = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_27, __pyx_pybuffernd_values.diminfo[0].strides, __pyx_t_28, __pyx_pybuffernd_values.diminfo[1].strides));

      /* "pandas/src/generated.pyx":5981
 * 
 *             # not nan
 *             if val == val:             # <<<<<<<<<<<<<<
 *                 nobs[b, 0] += 1
 *                 sumx[b, 0] += val
 */
      __pyx_t_16 = ((__pyx_v_val == __pyx_v_val) != 0);
      if (__pyx_t_16) {

        /* "pandas/src/generated.pyx":5982
 *             # 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_pybuffernd_nobs.diminfo[0].shape;
          if (unlikely(__pyx_t_29 < 0)) __pyx_t_5 = 0;
        } else if (unlikely(__pyx_t_29 >= __pyx_pybuffernd_nobs.diminfo[0].shape)) __pyx_t_5 = 0;
        if (__pyx_t_30 < 0) {
          __pyx_t_30 += __pyx_pybuffernd_nobs.diminfo[1].shape;
          if (unlikely(__pyx_t_30 < 0)) __pyx_t_5 = 1;
        } else if (unlikely(__pyx_t_30 >= __pyx_pybuffernd_nobs.diminfo[1].shape)) __pyx_t_5 = 1;
        if (unlikely(__pyx_t_5 != -1)) {
          __Pyx_RaiseBufferIndexError(__pyx_t_5);
          {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5982; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_nobs.rcbuffer->pybuffer.buf, __pyx_t_29, __pyx_pybuffernd_nobs.diminfo[0].strides, __pyx_t_30, __pyx_pybuffernd_nobs.diminfo[1].strides) += 1.0;

        /* "pandas/src/generated.pyx":5983
 *             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_pybuffernd_sumx.diminfo[0].shape;
          if (unlikely(__pyx_t_31 < 0)) __pyx_t_5 = 0;
        } else if (unlikely(__pyx_t_31 >= __pyx_pybuffernd_sumx.diminfo[0].shape)) __pyx_t_5 = 0;
        if (__pyx_t_32 < 0) {
          __pyx_t_32 += __pyx_pybuffernd_sumx.diminfo[1].shape;
          if (unlikely(__pyx_t_32 < 0)) __pyx_t_5 = 1;
        } else if (unlikely(__pyx_t_32 >= __pyx_pybuffernd_sumx.diminfo[1].shape)) __pyx_t_5 = 1;
        if (unlikely(__pyx_t_5 != -1)) {
          __Pyx_RaiseBufferIndexError(__pyx_t_5);
          {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5983; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_sumx.rcbuffer->pybuffer.buf, __pyx_t_31, __pyx_pybuffernd_sumx.diminfo[0].strides, __pyx_t_32, __pyx_pybuffernd_sumx.diminfo[1].strides) += __pyx_v_val;
        goto __pyx_L18;
      }
      __pyx_L18:;
    }
  }
  __pyx_L6:;

  /* "pandas/src/generated.pyx":5985
 *                 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;

    /* "pandas/src/generated.pyx":5986
 * 
 *     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;

      /* "pandas/src/generated.pyx":5987
 *     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_pybuffernd_nobs.diminfo[0].shape;
        if (unlikely(__pyx_t_35 < 0)) __pyx_t_5 = 0;
      } else if (unlikely(__pyx_t_35 >= __pyx_pybuffernd_nobs.diminfo[0].shape)) __pyx_t_5 = 0;
      if (__pyx_t_36 < 0) {
        __pyx_t_36 += __pyx_pybuffernd_nobs.diminfo[1].shape;
        if (unlikely(__pyx_t_36 < 0)) __pyx_t_5 = 1;
      } else if (unlikely(__pyx_t_36 >= __pyx_pybuffernd_nobs.diminfo[1].shape)) __pyx_t_5 = 1;
      if (unlikely(__pyx_t_5 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_5);
        {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5987; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_v_count = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_nobs.rcbuffer->pybuffer.buf, __pyx_t_35, __pyx_pybuffernd_nobs.diminfo[0].strides, __pyx_t_36, __pyx_pybuffernd_nobs.diminfo[1].strides));

      /* "pandas/src/generated.pyx":5988
 *         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_pybuffernd_nobs.diminfo[0].shape;
        if (unlikely(__pyx_t_37 < 0)) __pyx_t_5 = 0;
      } else if (unlikely(__pyx_t_37 >= __pyx_pybuffernd_nobs.diminfo[0].shape)) __pyx_t_5 = 0;
      if (__pyx_t_38 < 0) {
        __pyx_t_38 += __pyx_pybuffernd_nobs.diminfo[1].shape;
        if (unlikely(__pyx_t_38 < 0)) __pyx_t_5 = 1;
      } else if (unlikely(__pyx_t_38 >= __pyx_pybuffernd_nobs.diminfo[1].shape)) __pyx_t_5 = 1;
      if (unlikely(__pyx_t_5 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_5);
        {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5988; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_t_16 = (((*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_nobs.rcbuffer->pybuffer.buf, __pyx_t_37, __pyx_pybuffernd_nobs.diminfo[0].strides, __pyx_t_38, __pyx_pybuffernd_nobs.diminfo[1].strides)) == 0.0) != 0);
      if (__pyx_t_16) {

        /* "pandas/src/generated.pyx":5989
 *             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_pybuffernd_out.diminfo[0].shape;
          if (unlikely(__pyx_t_39 < 0)) __pyx_t_5 = 0;
        } else if (unlikely(__pyx_t_39 >= __pyx_pybuffernd_out.diminfo[0].shape)) __pyx_t_5 = 0;
        if (__pyx_t_40 < 0) {
          __pyx_t_40 += __pyx_pybuffernd_out.diminfo[1].shape;
          if (unlikely(__pyx_t_40 < 0)) __pyx_t_5 = 1;
        } else if (unlikely(__pyx_t_40 >= __pyx_pybuffernd_out.diminfo[1].shape)) __pyx_t_5 = 1;
        if (unlikely(__pyx_t_5 != -1)) {
          __Pyx_RaiseBufferIndexError(__pyx_t_5);
          {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5989; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_39, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_40, __pyx_pybuffernd_out.diminfo[1].strides) = __pyx_v_6pandas_5algos_nan;
        goto __pyx_L23;
      }
      /*else*/ {

        /* "pandas/src/generated.pyx":5991
 *                 out[i, j] = nan
 *             else:
 *                 out[i, j] = sumx[i, j] / count             # <<<<<<<<<<<<<<
 * 
 * @cython.wraparound(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_pybuffernd_sumx.diminfo[0].shape;
          if (unlikely(__pyx_t_41 < 0)) __pyx_t_5 = 0;
        } else if (unlikely(__pyx_t_41 >= __pyx_pybuffernd_sumx.diminfo[0].shape)) __pyx_t_5 = 0;
        if (__pyx_t_42 < 0) {
          __pyx_t_42 += __pyx_pybuffernd_sumx.diminfo[1].shape;
          if (unlikely(__pyx_t_42 < 0)) __pyx_t_5 = 1;
        } else if (unlikely(__pyx_t_42 >= __pyx_pybuffernd_sumx.diminfo[1].shape)) __pyx_t_5 = 1;
        if (unlikely(__pyx_t_5 != -1)) {
          __Pyx_RaiseBufferIndexError(__pyx_t_5);
          {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5991; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        __pyx_t_43 = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_sumx.rcbuffer->pybuffer.buf, __pyx_t_41, __pyx_pybuffernd_sumx.diminfo[0].strides, __pyx_t_42, __pyx_pybuffernd_sumx.diminfo[1].strides));
        if (unlikely(__pyx_v_count == 0)) {
          #ifdef WITH_THREAD
          PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
          #endif
          PyErr_SetString(PyExc_ZeroDivisionError, "float division");
          #ifdef WITH_THREAD
          PyGILState_Release(__pyx_gilstate_save);
          #endif
          {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5991; __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_pybuffernd_out.diminfo[0].shape;
          if (unlikely(__pyx_t_44 < 0)) __pyx_t_5 = 0;
        } else if (unlikely(__pyx_t_44 >= __pyx_pybuffernd_out.diminfo[0].shape)) __pyx_t_5 = 0;
        if (__pyx_t_45 < 0) {
          __pyx_t_45 += __pyx_pybuffernd_out.diminfo[1].shape;
          if (unlikely(__pyx_t_45 < 0)) __pyx_t_5 = 1;
        } else if (unlikely(__pyx_t_45 >= __pyx_pybuffernd_out.diminfo[1].shape)) __pyx_t_5 = 1;
        if (unlikely(__pyx_t_5 != -1)) {
          __Pyx_RaiseBufferIndexError(__pyx_t_5);
          {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5991; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_44, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_45, __pyx_pybuffernd_out.diminfo[1].strides) = (__pyx_t_43 / __pyx_v_count);
      }
      __pyx_L23:;
    }
  }

  /* "pandas/src/generated.pyx":5940
 *                 out[i, j] = sumx[i, j] / count
 * 
 * def group_mean_bin_float32(ndarray[float32_t, ndim=2] out,             # <<<<<<<<<<<<<<
 *                    ndarray[int64_t] counts,
 *                    ndarray[float32_t, ndim=2] values,
 */

  /* function exit code */
  __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_pybuffernd_bins.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_counts.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_sumx.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas.algos.group_mean_bin_float32", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_bins.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_counts.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_sumx.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer);
  __pyx_L2:;
  __Pyx_XDECREF((PyObject *)__pyx_v_sumx);
  __Pyx_XDECREF((PyObject *)__pyx_v_nobs);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/src/generated.pyx":5995
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def group_min_float64(ndarray[float64_t, ndim=2] out,             # <<<<<<<<<<<<<<
 *               ndarray[int64_t] counts,
 *               ndarray[float64_t, ndim=2] values,
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pandas_5algos_435group_min_float64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6pandas_5algos_434group_min_float64[] = "\n    Only aggregates on axis=0\n    ";
static PyMethodDef __pyx_mdef_6pandas_5algos_435group_min_float64 = {__Pyx_NAMESTR("group_min_float64"), (PyCFunction)__pyx_pw_6pandas_5algos_435group_min_float64, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6pandas_5algos_434group_min_float64)};
static PyObject *__pyx_pw_6pandas_5algos_435group_min_float64(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;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("group_min_float64 (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_out,&__pyx_n_s_counts,&__pyx_n_s_values,&__pyx_n_s_labels,0};
    PyObject* values[4] = {0,0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_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 (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_out)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_counts)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("group_min_float64", 1, 4, 4, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5995; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("group_min_float64", 1, 4, 4, 2); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5995; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  3:
        if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_labels)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("group_min_float64", 1, 4, 4, 3); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5995; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "group_min_float64") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5995; __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_float64", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5995; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas.algos.group_min_float64", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_out), __pyx_ptype_5numpy_ndarray, 1, "out", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5995; __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[2]; __pyx_lineno = 5996; __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[2]; __pyx_lineno = 5997; __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[2]; __pyx_lineno = 5998; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_434group_min_float64(__pyx_self, __pyx_v_out, __pyx_v_counts, __pyx_v_values, __pyx_v_labels);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pandas_5algos_434group_min_float64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_out, PyArrayObject *__pyx_v_counts, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_labels) {
  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;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_counts;
  __Pyx_Buffer __pyx_pybuffer_counts;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_labels;
  __Pyx_Buffer __pyx_pybuffer_labels;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_minx;
  __Pyx_Buffer __pyx_pybuffer_minx;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_nobs;
  __Pyx_Buffer __pyx_pybuffer_nobs;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_out;
  __Pyx_Buffer __pyx_pybuffer_out;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_values;
  __Pyx_Buffer __pyx_pybuffer_values;
  PyObject *__pyx_r = NULL;
  __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;
  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;
  PyObject *__pyx_t_12 = NULL;
  PyObject *(*__pyx_t_13)(PyObject *);
  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;
  __Pyx_RefNannySetupContext("group_min_float64", 0);
  __pyx_pybuffer_minx.pybuffer.buf = NULL;
  __pyx_pybuffer_minx.refcount = 0;
  __pyx_pybuffernd_minx.data = NULL;
  __pyx_pybuffernd_minx.rcbuffer = &__pyx_pybuffer_minx;
  __pyx_pybuffer_nobs.pybuffer.buf = NULL;
  __pyx_pybuffer_nobs.refcount = 0;
  __pyx_pybuffernd_nobs.data = NULL;
  __pyx_pybuffernd_nobs.rcbuffer = &__pyx_pybuffer_nobs;
  __pyx_pybuffer_out.pybuffer.buf = NULL;
  __pyx_pybuffer_out.refcount = 0;
  __pyx_pybuffernd_out.data = NULL;
  __pyx_pybuffernd_out.rcbuffer = &__pyx_pybuffer_out;
  __pyx_pybuffer_counts.pybuffer.buf = NULL;
  __pyx_pybuffer_counts.refcount = 0;
  __pyx_pybuffernd_counts.data = NULL;
  __pyx_pybuffernd_counts.rcbuffer = &__pyx_pybuffer_counts;
  __pyx_pybuffer_values.pybuffer.buf = NULL;
  __pyx_pybuffer_values.refcount = 0;
  __pyx_pybuffernd_values.data = NULL;
  __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values;
  __pyx_pybuffer_labels.pybuffer.buf = NULL;
  __pyx_pybuffer_labels.refcount = 0;
  __pyx_pybuffernd_labels.data = NULL;
  __pyx_pybuffernd_labels.rcbuffer = &__pyx_pybuffer_labels;
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_out.rcbuffer->pybuffer, (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[2]; __pyx_lineno = 5995; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_out.diminfo[0].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_out.diminfo[0].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_out.diminfo[1].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_out.diminfo[1].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[1];
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_counts.rcbuffer->pybuffer, (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[2]; __pyx_lineno = 5995; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_counts.diminfo[0].strides = __pyx_pybuffernd_counts.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_counts.diminfo[0].shape = __pyx_pybuffernd_counts.rcbuffer->pybuffer.shape[0];
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (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[2]; __pyx_lineno = 5995; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_values.diminfo[1].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_values.diminfo[1].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[1];
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_labels.rcbuffer->pybuffer, (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[2]; __pyx_lineno = 5995; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_labels.diminfo[0].strides = __pyx_pybuffernd_labels.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_labels.diminfo[0].shape = __pyx_pybuffernd_labels.rcbuffer->pybuffer.shape[0];

  /* "pandas/src/generated.pyx":6007
 *         ndarray[float64_t, ndim=2] minx, nobs
 * 
 *     if not len(values) == len(labels):             # <<<<<<<<<<<<<<
 *        raise AssertionError("len(index) != len(labels)")
 * 
 */
  __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_values)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6007; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_2 = PyObject_Length(((PyObject *)__pyx_v_labels)); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6007; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_3 = ((!((__pyx_t_1 == __pyx_t_2) != 0)) != 0);
  if (__pyx_t_3) {

    /* "pandas/src/generated.pyx":6008
 * 
 *     if not len(values) == len(labels):
 *        raise AssertionError("len(index) != len(labels)")             # <<<<<<<<<<<<<<
 * 
 *     nobs = np.zeros_like(out)
 */
    __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_AssertionError, __pyx_tuple__204, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6008; __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[2]; __pyx_lineno = 6008; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }

  /* "pandas/src/generated.pyx":6010
 *        raise AssertionError("len(index) != len(labels)")
 * 
 *     nobs = np.zeros_like(out)             # <<<<<<<<<<<<<<
 * 
 *     minx = np.empty_like(out)
 */
  __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6010; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_zeros_like); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6010; __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[2]; __pyx_lineno = 6010; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_INCREF(((PyObject *)__pyx_v_out));
  PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_v_out));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_out));
  __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_4, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6010; __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_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[2]; __pyx_lineno = 6010; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_7 = ((PyArrayObject *)__pyx_t_6);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer);
    __pyx_t_8 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer, (PyObject*)__pyx_t_7, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 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_pybuffernd_nobs.rcbuffer->pybuffer, (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_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_pybuffernd_nobs.diminfo[0].strides = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_nobs.diminfo[0].shape = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_nobs.diminfo[1].strides = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_nobs.diminfo[1].shape = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.shape[1];
    if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6010; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_7 = 0;
  __pyx_v_nobs = ((PyArrayObject *)__pyx_t_6);
  __pyx_t_6 = 0;

  /* "pandas/src/generated.pyx":6012
 *     nobs = np.zeros_like(out)
 * 
 *     minx = np.empty_like(out)             # <<<<<<<<<<<<<<
 *     minx.fill(np.inf)
 * 
 */
  __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6012; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_empty_like); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6012; __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[2]; __pyx_lineno = 6012; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_INCREF(((PyObject *)__pyx_v_out));
  PyTuple_SET_ITEM(__pyx_t_6, 0, ((PyObject *)__pyx_v_out));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_out));
  __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6012; __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;
  if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6012; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_7 = ((PyArrayObject *)__pyx_t_5);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_minx.rcbuffer->pybuffer);
    __pyx_t_8 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_minx.rcbuffer->pybuffer, (PyObject*)__pyx_t_7, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 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_pybuffernd_minx.rcbuffer->pybuffer, (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_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_pybuffernd_minx.diminfo[0].strides = __pyx_pybuffernd_minx.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_minx.diminfo[0].shape = __pyx_pybuffernd_minx.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_minx.diminfo[1].strides = __pyx_pybuffernd_minx.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_minx.diminfo[1].shape = __pyx_pybuffernd_minx.rcbuffer->pybuffer.shape[1];
    if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6012; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_7 = 0;
  __pyx_v_minx = ((PyArrayObject *)__pyx_t_5);
  __pyx_t_5 = 0;

  /* "pandas/src/generated.pyx":6013
 * 
 *     minx = np.empty_like(out)
 *     minx.fill(np.inf)             # <<<<<<<<<<<<<<
 * 
 *     N, K = (<object> values).shape
 */
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_minx), __pyx_n_s_fill); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6013; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6013; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_inf); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6013; __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[2]; __pyx_lineno = 6013; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__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 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_6, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6013; __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_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "pandas/src/generated.pyx":6015
 *     minx.fill(np.inf)
 * 
 *     N, K = (<object> values).shape             # <<<<<<<<<<<<<<
 * 
 *     if K > 1:
 */
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_values), __pyx_n_s_shape); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6015; __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 CYTHON_COMPILING_IN_CPYTHON
    Py_ssize_t size = Py_SIZE(sequence);
    #else
    Py_ssize_t size = PySequence_Size(sequence);
    #endif
    if (unlikely(size != 2)) {
      if (size > 2) __Pyx_RaiseTooManyValuesError(2);
      else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
      {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6015; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    #if CYTHON_COMPILING_IN_CPYTHON
    if (likely(PyTuple_CheckExact(sequence))) {
      __pyx_t_6 = PyTuple_GET_ITEM(sequence, 0); 
      __pyx_t_5 = PyTuple_GET_ITEM(sequence, 1); 
    } else {
      __pyx_t_6 = PyList_GET_ITEM(sequence, 0); 
      __pyx_t_5 = PyList_GET_ITEM(sequence, 1); 
    }
    __Pyx_INCREF(__pyx_t_6);
    __Pyx_INCREF(__pyx_t_5);
    #else
    __pyx_t_6 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6015; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6015; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    #endif
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  } else {
    Py_ssize_t index = -1;
    __pyx_t_12 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6015; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_12);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_13 = Py_TYPE(__pyx_t_12)->tp_iternext;
    index = 0; __pyx_t_6 = __pyx_t_13(__pyx_t_12); if (unlikely(!__pyx_t_6)) goto __pyx_L4_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_6);
    index = 1; __pyx_t_5 = __pyx_t_13(__pyx_t_12); if (unlikely(!__pyx_t_5)) goto __pyx_L4_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_5);
    if (__Pyx_IternextUnpackEndCheck(__pyx_t_13(__pyx_t_12), 2) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6015; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_13 = NULL;
    __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
    goto __pyx_L5_unpacking_done;
    __pyx_L4_unpacking_failed:;
    __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
    __pyx_t_13 = NULL;
    if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
    {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6015; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_L5_unpacking_done:;
  }
  __pyx_t_2 = __Pyx_PyIndex_AsSsize_t(__pyx_t_6); if (unlikely((__pyx_t_2 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6015; __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_5); if (unlikely((__pyx_t_1 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6015; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_v_N = __pyx_t_2;
  __pyx_v_K = __pyx_t_1;

  /* "pandas/src/generated.pyx":6017
 *     N, K = (<object> values).shape
 * 
 *     if K > 1:             # <<<<<<<<<<<<<<
 *         for i in range(N):
 *             lab = labels[i]
 */
  __pyx_t_3 = ((__pyx_v_K > 1) != 0);
  if (__pyx_t_3) {

    /* "pandas/src/generated.pyx":6018
 * 
 *     if K > 1:
 *         for i in range(N):             # <<<<<<<<<<<<<<
 *             lab = labels[i]
 *             if lab < 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;

      /* "pandas/src/generated.pyx":6019
 *     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_pybuffernd_labels.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_labels.diminfo[0].strides));

      /* "pandas/src/generated.pyx":6020
 *         for i in range(N):
 *             lab = labels[i]
 *             if lab < 0:             # <<<<<<<<<<<<<<
 *                 continue
 * 
 */
      __pyx_t_3 = ((__pyx_v_lab < 0) != 0);
      if (__pyx_t_3) {

        /* "pandas/src/generated.pyx":6021
 *             lab = labels[i]
 *             if lab < 0:
 *                 continue             # <<<<<<<<<<<<<<
 * 
 *             counts[lab] += 1
 */
        goto __pyx_L7_continue;
      }

      /* "pandas/src/generated.pyx":6023
 *                 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_pybuffernd_counts.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_counts.diminfo[0].strides) += 1;

      /* "pandas/src/generated.pyx":6024
 * 
 *             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;

        /* "pandas/src/generated.pyx":6025
 *             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_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_values.diminfo[0].strides, __pyx_t_19, __pyx_pybuffernd_values.diminfo[1].strides));

        /* "pandas/src/generated.pyx":6028
 * 
 *                 # not nan
 *                 if val == val:             # <<<<<<<<<<<<<<
 *                     nobs[lab, j] += 1
 *                     if val < minx[lab, j]:
 */
        __pyx_t_3 = ((__pyx_v_val == __pyx_v_val) != 0);
        if (__pyx_t_3) {

          /* "pandas/src/generated.pyx":6029
 *                 # 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_pybuffernd_nobs.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_nobs.diminfo[0].strides, __pyx_t_21, __pyx_pybuffernd_nobs.diminfo[1].strides) += 1.0;

          /* "pandas/src/generated.pyx":6030
 *                 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_3 = ((__pyx_v_val < (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_minx.rcbuffer->pybuffer.buf, __pyx_t_22, __pyx_pybuffernd_minx.diminfo[0].strides, __pyx_t_23, __pyx_pybuffernd_minx.diminfo[1].strides))) != 0);
          if (__pyx_t_3) {

            /* "pandas/src/generated.pyx":6031
 *                     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_pybuffernd_minx.rcbuffer->pybuffer.buf, __pyx_t_24, __pyx_pybuffernd_minx.diminfo[0].strides, __pyx_t_25, __pyx_pybuffernd_minx.diminfo[1].strides) = __pyx_v_val;
            goto __pyx_L13;
          }
          __pyx_L13:;
          goto __pyx_L12;
        }
        __pyx_L12:;
      }
      __pyx_L7_continue:;
    }
    goto __pyx_L6;
  }
  /*else*/ {

    /* "pandas/src/generated.pyx":6033
 *                         minx[lab, j] = val
 *     else:
 *         for i in range(N):             # <<<<<<<<<<<<<<
 *             lab = labels[i]
 *             if lab < 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;

      /* "pandas/src/generated.pyx":6034
 *     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_pybuffernd_labels.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_labels.diminfo[0].strides));

      /* "pandas/src/generated.pyx":6035
 *         for i in range(N):
 *             lab = labels[i]
 *             if lab < 0:             # <<<<<<<<<<<<<<
 *                 continue
 * 
 */
      __pyx_t_3 = ((__pyx_v_lab < 0) != 0);
      if (__pyx_t_3) {

        /* "pandas/src/generated.pyx":6036
 *             lab = labels[i]
 *             if lab < 0:
 *                 continue             # <<<<<<<<<<<<<<
 * 
 *             counts[lab] += 1
 */
        goto __pyx_L14_continue;
      }

      /* "pandas/src/generated.pyx":6038
 *                 continue
 * 
 *             counts[lab] += 1             # <<<<<<<<<<<<<<
 *             val = values[i, 0]
 * 
 */
      __pyx_t_17 = __pyx_v_lab;
      *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_counts.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_counts.diminfo[0].strides) += 1;

      /* "pandas/src/generated.pyx":6039
 * 
 *             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_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_26, __pyx_pybuffernd_values.diminfo[0].strides, __pyx_t_27, __pyx_pybuffernd_values.diminfo[1].strides));

      /* "pandas/src/generated.pyx":6042
 * 
 *             # not nan
 *             if val == val:             # <<<<<<<<<<<<<<
 *                 nobs[lab, 0] += 1
 *                 if val < minx[lab, 0]:
 */
      __pyx_t_3 = ((__pyx_v_val == __pyx_v_val) != 0);
      if (__pyx_t_3) {

        /* "pandas/src/generated.pyx":6043
 *             # 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_pybuffernd_nobs.rcbuffer->pybuffer.buf, __pyx_t_28, __pyx_pybuffernd_nobs.diminfo[0].strides, __pyx_t_29, __pyx_pybuffernd_nobs.diminfo[1].strides) += 1.0;

        /* "pandas/src/generated.pyx":6044
 *             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_3 = ((__pyx_v_val < (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_minx.rcbuffer->pybuffer.buf, __pyx_t_30, __pyx_pybuffernd_minx.diminfo[0].strides, __pyx_t_31, __pyx_pybuffernd_minx.diminfo[1].strides))) != 0);
        if (__pyx_t_3) {

          /* "pandas/src/generated.pyx":6045
 *                 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_pybuffernd_minx.rcbuffer->pybuffer.buf, __pyx_t_32, __pyx_pybuffernd_minx.diminfo[0].strides, __pyx_t_33, __pyx_pybuffernd_minx.diminfo[1].strides) = __pyx_v_val;
          goto __pyx_L18;
        }
        __pyx_L18:;
        goto __pyx_L17;
      }
      __pyx_L17:;
      __pyx_L14_continue:;
    }
  }
  __pyx_L6:;

  /* "pandas/src/generated.pyx":6047
 *                     minx[lab, 0] = val
 * 
 *     for i in range(len(counts)):             # <<<<<<<<<<<<<<
 *         for j in range(K):
 *             if nobs[i, j] == 0:
 */
  __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_counts)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6047; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) {
    __pyx_v_i = __pyx_t_2;

    /* "pandas/src/generated.pyx":6048
 * 
 *     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;

      /* "pandas/src/generated.pyx":6049
 *     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_3 = (((*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_nobs.rcbuffer->pybuffer.buf, __pyx_t_36, __pyx_pybuffernd_nobs.diminfo[0].strides, __pyx_t_37, __pyx_pybuffernd_nobs.diminfo[1].strides)) == 0.0) != 0);
      if (__pyx_t_3) {

        /* "pandas/src/generated.pyx":6050
 *         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_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_38, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_39, __pyx_pybuffernd_out.diminfo[1].strides) = __pyx_v_6pandas_5algos_nan;
        goto __pyx_L23;
      }
      /*else*/ {

        /* "pandas/src/generated.pyx":6052
 *                 out[i, j] = nan
 *             else:
 *                 out[i, j] = minx[i, j]             # <<<<<<<<<<<<<<
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 */
        __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_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_42, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_43, __pyx_pybuffernd_out.diminfo[1].strides) = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_minx.rcbuffer->pybuffer.buf, __pyx_t_40, __pyx_pybuffernd_minx.diminfo[0].strides, __pyx_t_41, __pyx_pybuffernd_minx.diminfo[1].strides));
      }
      __pyx_L23:;
    }
  }

  /* "pandas/src/generated.pyx":5995
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def group_min_float64(ndarray[float64_t, ndim=2] out,             # <<<<<<<<<<<<<<
 *               ndarray[int64_t] counts,
 *               ndarray[float64_t, ndim=2] values,
 */

  /* function exit code */
  __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_12);
  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
    __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_counts.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_labels.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_minx.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas.algos.group_min_float64", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_counts.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_labels.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_minx.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer);
  __pyx_L2:;
  __Pyx_XDECREF((PyObject *)__pyx_v_minx);
  __Pyx_XDECREF((PyObject *)__pyx_v_nobs);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/src/generated.pyx":6055
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def group_min_float32(ndarray[float32_t, ndim=2] out,             # <<<<<<<<<<<<<<
 *               ndarray[int64_t] counts,
 *               ndarray[float32_t, ndim=2] values,
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pandas_5algos_437group_min_float32(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6pandas_5algos_436group_min_float32[] = "\n    Only aggregates on axis=0\n    ";
static PyMethodDef __pyx_mdef_6pandas_5algos_437group_min_float32 = {__Pyx_NAMESTR("group_min_float32"), (PyCFunction)__pyx_pw_6pandas_5algos_437group_min_float32, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6pandas_5algos_436group_min_float32)};
static PyObject *__pyx_pw_6pandas_5algos_437group_min_float32(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;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("group_min_float32 (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_out,&__pyx_n_s_counts,&__pyx_n_s_values,&__pyx_n_s_labels,0};
    PyObject* values[4] = {0,0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_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 (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_out)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_counts)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("group_min_float32", 1, 4, 4, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6055; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("group_min_float32", 1, 4, 4, 2); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6055; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  3:
        if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_labels)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("group_min_float32", 1, 4, 4, 3); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6055; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "group_min_float32") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6055; __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_float32", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6055; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas.algos.group_min_float32", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_out), __pyx_ptype_5numpy_ndarray, 1, "out", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6055; __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[2]; __pyx_lineno = 6056; __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[2]; __pyx_lineno = 6057; __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[2]; __pyx_lineno = 6058; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_436group_min_float32(__pyx_self, __pyx_v_out, __pyx_v_counts, __pyx_v_values, __pyx_v_labels);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pandas_5algos_436group_min_float32(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_out, PyArrayObject *__pyx_v_counts, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_labels) {
  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_float32_t __pyx_v_val;
  PyArrayObject *__pyx_v_minx = 0;
  PyArrayObject *__pyx_v_nobs = 0;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_counts;
  __Pyx_Buffer __pyx_pybuffer_counts;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_labels;
  __Pyx_Buffer __pyx_pybuffer_labels;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_minx;
  __Pyx_Buffer __pyx_pybuffer_minx;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_nobs;
  __Pyx_Buffer __pyx_pybuffer_nobs;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_out;
  __Pyx_Buffer __pyx_pybuffer_out;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_values;
  __Pyx_Buffer __pyx_pybuffer_values;
  PyObject *__pyx_r = NULL;
  __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;
  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;
  PyObject *__pyx_t_12 = NULL;
  PyObject *(*__pyx_t_13)(PyObject *);
  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;
  __Pyx_RefNannySetupContext("group_min_float32", 0);
  __pyx_pybuffer_minx.pybuffer.buf = NULL;
  __pyx_pybuffer_minx.refcount = 0;
  __pyx_pybuffernd_minx.data = NULL;
  __pyx_pybuffernd_minx.rcbuffer = &__pyx_pybuffer_minx;
  __pyx_pybuffer_nobs.pybuffer.buf = NULL;
  __pyx_pybuffer_nobs.refcount = 0;
  __pyx_pybuffernd_nobs.data = NULL;
  __pyx_pybuffernd_nobs.rcbuffer = &__pyx_pybuffer_nobs;
  __pyx_pybuffer_out.pybuffer.buf = NULL;
  __pyx_pybuffer_out.refcount = 0;
  __pyx_pybuffernd_out.data = NULL;
  __pyx_pybuffernd_out.rcbuffer = &__pyx_pybuffer_out;
  __pyx_pybuffer_counts.pybuffer.buf = NULL;
  __pyx_pybuffer_counts.refcount = 0;
  __pyx_pybuffernd_counts.data = NULL;
  __pyx_pybuffernd_counts.rcbuffer = &__pyx_pybuffer_counts;
  __pyx_pybuffer_values.pybuffer.buf = NULL;
  __pyx_pybuffer_values.refcount = 0;
  __pyx_pybuffernd_values.data = NULL;
  __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values;
  __pyx_pybuffer_labels.pybuffer.buf = NULL;
  __pyx_pybuffer_labels.refcount = 0;
  __pyx_pybuffernd_labels.data = NULL;
  __pyx_pybuffernd_labels.rcbuffer = &__pyx_pybuffer_labels;
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_out.rcbuffer->pybuffer, (PyObject*)__pyx_v_out, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6055; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_out.diminfo[0].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_out.diminfo[0].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_out.diminfo[1].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_out.diminfo[1].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[1];
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_counts.rcbuffer->pybuffer, (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[2]; __pyx_lineno = 6055; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_counts.diminfo[0].strides = __pyx_pybuffernd_counts.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_counts.diminfo[0].shape = __pyx_pybuffernd_counts.rcbuffer->pybuffer.shape[0];
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6055; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_values.diminfo[1].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_values.diminfo[1].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[1];
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_labels.rcbuffer->pybuffer, (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[2]; __pyx_lineno = 6055; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_labels.diminfo[0].strides = __pyx_pybuffernd_labels.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_labels.diminfo[0].shape = __pyx_pybuffernd_labels.rcbuffer->pybuffer.shape[0];

  /* "pandas/src/generated.pyx":6067
 *         ndarray[float32_t, ndim=2] minx, nobs
 * 
 *     if not len(values) == len(labels):             # <<<<<<<<<<<<<<
 *        raise AssertionError("len(index) != len(labels)")
 * 
 */
  __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_values)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6067; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_2 = PyObject_Length(((PyObject *)__pyx_v_labels)); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6067; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_3 = ((!((__pyx_t_1 == __pyx_t_2) != 0)) != 0);
  if (__pyx_t_3) {

    /* "pandas/src/generated.pyx":6068
 * 
 *     if not len(values) == len(labels):
 *        raise AssertionError("len(index) != len(labels)")             # <<<<<<<<<<<<<<
 * 
 *     nobs = np.zeros_like(out)
 */
    __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_AssertionError, __pyx_tuple__205, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6068; __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[2]; __pyx_lineno = 6068; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }

  /* "pandas/src/generated.pyx":6070
 *        raise AssertionError("len(index) != len(labels)")
 * 
 *     nobs = np.zeros_like(out)             # <<<<<<<<<<<<<<
 * 
 *     minx = np.empty_like(out)
 */
  __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6070; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_zeros_like); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6070; __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[2]; __pyx_lineno = 6070; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_INCREF(((PyObject *)__pyx_v_out));
  PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_v_out));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_out));
  __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_4, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6070; __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_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[2]; __pyx_lineno = 6070; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_7 = ((PyArrayObject *)__pyx_t_6);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer);
    __pyx_t_8 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer, (PyObject*)__pyx_t_7, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 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_pybuffernd_nobs.rcbuffer->pybuffer, (PyObject*)__pyx_v_nobs, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, 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_pybuffernd_nobs.diminfo[0].strides = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_nobs.diminfo[0].shape = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_nobs.diminfo[1].strides = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_nobs.diminfo[1].shape = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.shape[1];
    if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6070; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_7 = 0;
  __pyx_v_nobs = ((PyArrayObject *)__pyx_t_6);
  __pyx_t_6 = 0;

  /* "pandas/src/generated.pyx":6072
 *     nobs = np.zeros_like(out)
 * 
 *     minx = np.empty_like(out)             # <<<<<<<<<<<<<<
 *     minx.fill(np.inf)
 * 
 */
  __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6072; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_empty_like); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6072; __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[2]; __pyx_lineno = 6072; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_INCREF(((PyObject *)__pyx_v_out));
  PyTuple_SET_ITEM(__pyx_t_6, 0, ((PyObject *)__pyx_v_out));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_out));
  __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6072; __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;
  if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6072; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_7 = ((PyArrayObject *)__pyx_t_5);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_minx.rcbuffer->pybuffer);
    __pyx_t_8 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_minx.rcbuffer->pybuffer, (PyObject*)__pyx_t_7, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 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_pybuffernd_minx.rcbuffer->pybuffer, (PyObject*)__pyx_v_minx, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 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_pybuffernd_minx.diminfo[0].strides = __pyx_pybuffernd_minx.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_minx.diminfo[0].shape = __pyx_pybuffernd_minx.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_minx.diminfo[1].strides = __pyx_pybuffernd_minx.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_minx.diminfo[1].shape = __pyx_pybuffernd_minx.rcbuffer->pybuffer.shape[1];
    if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6072; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_7 = 0;
  __pyx_v_minx = ((PyArrayObject *)__pyx_t_5);
  __pyx_t_5 = 0;

  /* "pandas/src/generated.pyx":6073
 * 
 *     minx = np.empty_like(out)
 *     minx.fill(np.inf)             # <<<<<<<<<<<<<<
 * 
 *     N, K = (<object> values).shape
 */
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_minx), __pyx_n_s_fill); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6073; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6073; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_inf); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6073; __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[2]; __pyx_lineno = 6073; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__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 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_6, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6073; __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_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "pandas/src/generated.pyx":6075
 *     minx.fill(np.inf)
 * 
 *     N, K = (<object> values).shape             # <<<<<<<<<<<<<<
 * 
 *     if K > 1:
 */
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_values), __pyx_n_s_shape); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6075; __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 CYTHON_COMPILING_IN_CPYTHON
    Py_ssize_t size = Py_SIZE(sequence);
    #else
    Py_ssize_t size = PySequence_Size(sequence);
    #endif
    if (unlikely(size != 2)) {
      if (size > 2) __Pyx_RaiseTooManyValuesError(2);
      else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
      {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6075; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    #if CYTHON_COMPILING_IN_CPYTHON
    if (likely(PyTuple_CheckExact(sequence))) {
      __pyx_t_6 = PyTuple_GET_ITEM(sequence, 0); 
      __pyx_t_5 = PyTuple_GET_ITEM(sequence, 1); 
    } else {
      __pyx_t_6 = PyList_GET_ITEM(sequence, 0); 
      __pyx_t_5 = PyList_GET_ITEM(sequence, 1); 
    }
    __Pyx_INCREF(__pyx_t_6);
    __Pyx_INCREF(__pyx_t_5);
    #else
    __pyx_t_6 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6075; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6075; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    #endif
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  } else {
    Py_ssize_t index = -1;
    __pyx_t_12 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6075; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_12);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_13 = Py_TYPE(__pyx_t_12)->tp_iternext;
    index = 0; __pyx_t_6 = __pyx_t_13(__pyx_t_12); if (unlikely(!__pyx_t_6)) goto __pyx_L4_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_6);
    index = 1; __pyx_t_5 = __pyx_t_13(__pyx_t_12); if (unlikely(!__pyx_t_5)) goto __pyx_L4_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_5);
    if (__Pyx_IternextUnpackEndCheck(__pyx_t_13(__pyx_t_12), 2) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6075; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_13 = NULL;
    __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
    goto __pyx_L5_unpacking_done;
    __pyx_L4_unpacking_failed:;
    __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
    __pyx_t_13 = NULL;
    if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
    {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6075; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_L5_unpacking_done:;
  }
  __pyx_t_2 = __Pyx_PyIndex_AsSsize_t(__pyx_t_6); if (unlikely((__pyx_t_2 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6075; __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_5); if (unlikely((__pyx_t_1 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6075; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_v_N = __pyx_t_2;
  __pyx_v_K = __pyx_t_1;

  /* "pandas/src/generated.pyx":6077
 *     N, K = (<object> values).shape
 * 
 *     if K > 1:             # <<<<<<<<<<<<<<
 *         for i in range(N):
 *             lab = labels[i]
 */
  __pyx_t_3 = ((__pyx_v_K > 1) != 0);
  if (__pyx_t_3) {

    /* "pandas/src/generated.pyx":6078
 * 
 *     if K > 1:
 *         for i in range(N):             # <<<<<<<<<<<<<<
 *             lab = labels[i]
 *             if lab < 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;

      /* "pandas/src/generated.pyx":6079
 *     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_pybuffernd_labels.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_labels.diminfo[0].strides));

      /* "pandas/src/generated.pyx":6080
 *         for i in range(N):
 *             lab = labels[i]
 *             if lab < 0:             # <<<<<<<<<<<<<<
 *                 continue
 * 
 */
      __pyx_t_3 = ((__pyx_v_lab < 0) != 0);
      if (__pyx_t_3) {

        /* "pandas/src/generated.pyx":6081
 *             lab = labels[i]
 *             if lab < 0:
 *                 continue             # <<<<<<<<<<<<<<
 * 
 *             counts[lab] += 1
 */
        goto __pyx_L7_continue;
      }

      /* "pandas/src/generated.pyx":6083
 *                 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_pybuffernd_counts.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_counts.diminfo[0].strides) += 1;

      /* "pandas/src/generated.pyx":6084
 * 
 *             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;

        /* "pandas/src/generated.pyx":6085
 *             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_float32_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_values.diminfo[0].strides, __pyx_t_19, __pyx_pybuffernd_values.diminfo[1].strides));

        /* "pandas/src/generated.pyx":6088
 * 
 *                 # not nan
 *                 if val == val:             # <<<<<<<<<<<<<<
 *                     nobs[lab, j] += 1
 *                     if val < minx[lab, j]:
 */
        __pyx_t_3 = ((__pyx_v_val == __pyx_v_val) != 0);
        if (__pyx_t_3) {

          /* "pandas/src/generated.pyx":6089
 *                 # 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_float32_t *, __pyx_pybuffernd_nobs.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_nobs.diminfo[0].strides, __pyx_t_21, __pyx_pybuffernd_nobs.diminfo[1].strides) += 1.0;

          /* "pandas/src/generated.pyx":6090
 *                 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_3 = ((__pyx_v_val < (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_minx.rcbuffer->pybuffer.buf, __pyx_t_22, __pyx_pybuffernd_minx.diminfo[0].strides, __pyx_t_23, __pyx_pybuffernd_minx.diminfo[1].strides))) != 0);
          if (__pyx_t_3) {

            /* "pandas/src/generated.pyx":6091
 *                     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_float32_t *, __pyx_pybuffernd_minx.rcbuffer->pybuffer.buf, __pyx_t_24, __pyx_pybuffernd_minx.diminfo[0].strides, __pyx_t_25, __pyx_pybuffernd_minx.diminfo[1].strides) = __pyx_v_val;
            goto __pyx_L13;
          }
          __pyx_L13:;
          goto __pyx_L12;
        }
        __pyx_L12:;
      }
      __pyx_L7_continue:;
    }
    goto __pyx_L6;
  }
  /*else*/ {

    /* "pandas/src/generated.pyx":6093
 *                         minx[lab, j] = val
 *     else:
 *         for i in range(N):             # <<<<<<<<<<<<<<
 *             lab = labels[i]
 *             if lab < 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;

      /* "pandas/src/generated.pyx":6094
 *     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_pybuffernd_labels.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_labels.diminfo[0].strides));

      /* "pandas/src/generated.pyx":6095
 *         for i in range(N):
 *             lab = labels[i]
 *             if lab < 0:             # <<<<<<<<<<<<<<
 *                 continue
 * 
 */
      __pyx_t_3 = ((__pyx_v_lab < 0) != 0);
      if (__pyx_t_3) {

        /* "pandas/src/generated.pyx":6096
 *             lab = labels[i]
 *             if lab < 0:
 *                 continue             # <<<<<<<<<<<<<<
 * 
 *             counts[lab] += 1
 */
        goto __pyx_L14_continue;
      }

      /* "pandas/src/generated.pyx":6098
 *                 continue
 * 
 *             counts[lab] += 1             # <<<<<<<<<<<<<<
 *             val = values[i, 0]
 * 
 */
      __pyx_t_17 = __pyx_v_lab;
      *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_counts.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_counts.diminfo[0].strides) += 1;

      /* "pandas/src/generated.pyx":6099
 * 
 *             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_float32_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_26, __pyx_pybuffernd_values.diminfo[0].strides, __pyx_t_27, __pyx_pybuffernd_values.diminfo[1].strides));

      /* "pandas/src/generated.pyx":6102
 * 
 *             # not nan
 *             if val == val:             # <<<<<<<<<<<<<<
 *                 nobs[lab, 0] += 1
 *                 if val < minx[lab, 0]:
 */
      __pyx_t_3 = ((__pyx_v_val == __pyx_v_val) != 0);
      if (__pyx_t_3) {

        /* "pandas/src/generated.pyx":6103
 *             # 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_float32_t *, __pyx_pybuffernd_nobs.rcbuffer->pybuffer.buf, __pyx_t_28, __pyx_pybuffernd_nobs.diminfo[0].strides, __pyx_t_29, __pyx_pybuffernd_nobs.diminfo[1].strides) += 1.0;

        /* "pandas/src/generated.pyx":6104
 *             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_3 = ((__pyx_v_val < (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_minx.rcbuffer->pybuffer.buf, __pyx_t_30, __pyx_pybuffernd_minx.diminfo[0].strides, __pyx_t_31, __pyx_pybuffernd_minx.diminfo[1].strides))) != 0);
        if (__pyx_t_3) {

          /* "pandas/src/generated.pyx":6105
 *                 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_float32_t *, __pyx_pybuffernd_minx.rcbuffer->pybuffer.buf, __pyx_t_32, __pyx_pybuffernd_minx.diminfo[0].strides, __pyx_t_33, __pyx_pybuffernd_minx.diminfo[1].strides) = __pyx_v_val;
          goto __pyx_L18;
        }
        __pyx_L18:;
        goto __pyx_L17;
      }
      __pyx_L17:;
      __pyx_L14_continue:;
    }
  }
  __pyx_L6:;

  /* "pandas/src/generated.pyx":6107
 *                     minx[lab, 0] = val
 * 
 *     for i in range(len(counts)):             # <<<<<<<<<<<<<<
 *         for j in range(K):
 *             if nobs[i, j] == 0:
 */
  __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_counts)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6107; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) {
    __pyx_v_i = __pyx_t_2;

    /* "pandas/src/generated.pyx":6108
 * 
 *     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;

      /* "pandas/src/generated.pyx":6109
 *     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_3 = (((*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_nobs.rcbuffer->pybuffer.buf, __pyx_t_36, __pyx_pybuffernd_nobs.diminfo[0].strides, __pyx_t_37, __pyx_pybuffernd_nobs.diminfo[1].strides)) == 0.0) != 0);
      if (__pyx_t_3) {

        /* "pandas/src/generated.pyx":6110
 *         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_float32_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_38, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_39, __pyx_pybuffernd_out.diminfo[1].strides) = __pyx_v_6pandas_5algos_nan;
        goto __pyx_L23;
      }
      /*else*/ {

        /* "pandas/src/generated.pyx":6112
 *                 out[i, j] = nan
 *             else:
 *                 out[i, j] = minx[i, j]             # <<<<<<<<<<<<<<
 * 
 * @cython.wraparound(False)
 */
        __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_float32_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_42, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_43, __pyx_pybuffernd_out.diminfo[1].strides) = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_minx.rcbuffer->pybuffer.buf, __pyx_t_40, __pyx_pybuffernd_minx.diminfo[0].strides, __pyx_t_41, __pyx_pybuffernd_minx.diminfo[1].strides));
      }
      __pyx_L23:;
    }
  }

  /* "pandas/src/generated.pyx":6055
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def group_min_float32(ndarray[float32_t, ndim=2] out,             # <<<<<<<<<<<<<<
 *               ndarray[int64_t] counts,
 *               ndarray[float32_t, ndim=2] values,
 */

  /* function exit code */
  __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_12);
  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
    __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_counts.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_labels.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_minx.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas.algos.group_min_float32", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_counts.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_labels.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_minx.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer);
  __pyx_L2:;
  __Pyx_XDECREF((PyObject *)__pyx_v_minx);
  __Pyx_XDECREF((PyObject *)__pyx_v_nobs);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/src/generated.pyx":6116
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def group_min_bin_float64(ndarray[float64_t, ndim=2] out,             # <<<<<<<<<<<<<<
 *                    ndarray[int64_t] counts,
 *                    ndarray[float64_t, ndim=2] values,
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pandas_5algos_439group_min_bin_float64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6pandas_5algos_438group_min_bin_float64[] = "\n    Only aggregates on axis=0\n    ";
static PyMethodDef __pyx_mdef_6pandas_5algos_439group_min_bin_float64 = {__Pyx_NAMESTR("group_min_bin_float64"), (PyCFunction)__pyx_pw_6pandas_5algos_439group_min_bin_float64, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6pandas_5algos_438group_min_bin_float64)};
static PyObject *__pyx_pw_6pandas_5algos_439group_min_bin_float64(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;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("group_min_bin_float64 (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_out,&__pyx_n_s_counts,&__pyx_n_s_values,&__pyx_n_s_bins,0};
    PyObject* values[4] = {0,0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_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 (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_out)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_counts)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("group_min_bin_float64", 1, 4, 4, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6116; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("group_min_bin_float64", 1, 4, 4, 2); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6116; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  3:
        if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_bins)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("group_min_bin_float64", 1, 4, 4, 3); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6116; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "group_min_bin_float64") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6116; __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_float64", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6116; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas.algos.group_min_bin_float64", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_out), __pyx_ptype_5numpy_ndarray, 1, "out", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6116; __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[2]; __pyx_lineno = 6117; __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[2]; __pyx_lineno = 6118; __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[2]; __pyx_lineno = 6119; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_438group_min_bin_float64(__pyx_self, __pyx_v_out, __pyx_v_counts, __pyx_v_values, __pyx_v_bins);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pandas_5algos_438group_min_bin_float64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_out, PyArrayObject *__pyx_v_counts, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_bins) {
  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;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_bins;
  __Pyx_Buffer __pyx_pybuffer_bins;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_counts;
  __Pyx_Buffer __pyx_pybuffer_counts;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_minx;
  __Pyx_Buffer __pyx_pybuffer_minx;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_nobs;
  __Pyx_Buffer __pyx_pybuffer_nobs;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_out;
  __Pyx_Buffer __pyx_pybuffer_out;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_values;
  __Pyx_Buffer __pyx_pybuffer_values;
  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;
  __Pyx_RefNannySetupContext("group_min_bin_float64", 0);
  __pyx_pybuffer_minx.pybuffer.buf = NULL;
  __pyx_pybuffer_minx.refcount = 0;
  __pyx_pybuffernd_minx.data = NULL;
  __pyx_pybuffernd_minx.rcbuffer = &__pyx_pybuffer_minx;
  __pyx_pybuffer_nobs.pybuffer.buf = NULL;
  __pyx_pybuffer_nobs.refcount = 0;
  __pyx_pybuffernd_nobs.data = NULL;
  __pyx_pybuffernd_nobs.rcbuffer = &__pyx_pybuffer_nobs;
  __pyx_pybuffer_out.pybuffer.buf = NULL;
  __pyx_pybuffer_out.refcount = 0;
  __pyx_pybuffernd_out.data = NULL;
  __pyx_pybuffernd_out.rcbuffer = &__pyx_pybuffer_out;
  __pyx_pybuffer_counts.pybuffer.buf = NULL;
  __pyx_pybuffer_counts.refcount = 0;
  __pyx_pybuffernd_counts.data = NULL;
  __pyx_pybuffernd_counts.rcbuffer = &__pyx_pybuffer_counts;
  __pyx_pybuffer_values.pybuffer.buf = NULL;
  __pyx_pybuffer_values.refcount = 0;
  __pyx_pybuffernd_values.data = NULL;
  __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values;
  __pyx_pybuffer_bins.pybuffer.buf = NULL;
  __pyx_pybuffer_bins.refcount = 0;
  __pyx_pybuffernd_bins.data = NULL;
  __pyx_pybuffernd_bins.rcbuffer = &__pyx_pybuffer_bins;
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_out.rcbuffer->pybuffer, (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[2]; __pyx_lineno = 6116; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_out.diminfo[0].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_out.diminfo[0].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_out.diminfo[1].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_out.diminfo[1].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[1];
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_counts.rcbuffer->pybuffer, (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[2]; __pyx_lineno = 6116; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_counts.diminfo[0].strides = __pyx_pybuffernd_counts.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_counts.diminfo[0].shape = __pyx_pybuffernd_counts.rcbuffer->pybuffer.shape[0];
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (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[2]; __pyx_lineno = 6116; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_values.diminfo[1].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_values.diminfo[1].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[1];
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_bins.rcbuffer->pybuffer, (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[2]; __pyx_lineno = 6116; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_bins.diminfo[0].strides = __pyx_pybuffernd_bins.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_bins.diminfo[0].shape = __pyx_pybuffernd_bins.rcbuffer->pybuffer.shape[0];

  /* "pandas/src/generated.pyx":6128
 *         ndarray[float64_t, ndim=2] minx, nobs
 * 
 *     nobs = np.zeros_like(out)             # <<<<<<<<<<<<<<
 * 
 *     minx = np.empty_like(out)
 */
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6128; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros_like); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6128; __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[2]; __pyx_lineno = 6128; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__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 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6128; __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 (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6128; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_4 = ((PyArrayObject *)__pyx_t_3);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer);
    __pyx_t_5 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer, (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_pybuffernd_nobs.rcbuffer->pybuffer, (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_pybuffernd_nobs.diminfo[0].strides = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_nobs.diminfo[0].shape = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_nobs.diminfo[1].strides = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_nobs.diminfo[1].shape = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.shape[1];
    if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6128; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_4 = 0;
  __pyx_v_nobs = ((PyArrayObject *)__pyx_t_3);
  __pyx_t_3 = 0;

  /* "pandas/src/generated.pyx":6130
 *     nobs = np.zeros_like(out)
 * 
 *     minx = np.empty_like(out)             # <<<<<<<<<<<<<<
 *     minx.fill(np.inf)
 * 
 */
  __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6130; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_empty_like); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6130; __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[2]; __pyx_lineno = 6130; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__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 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6130; __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;
  if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6130; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_4 = ((PyArrayObject *)__pyx_t_2);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_minx.rcbuffer->pybuffer);
    __pyx_t_5 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_minx.rcbuffer->pybuffer, (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_pybuffernd_minx.rcbuffer->pybuffer, (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_pybuffernd_minx.diminfo[0].strides = __pyx_pybuffernd_minx.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_minx.diminfo[0].shape = __pyx_pybuffernd_minx.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_minx.diminfo[1].strides = __pyx_pybuffernd_minx.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_minx.diminfo[1].shape = __pyx_pybuffernd_minx.rcbuffer->pybuffer.shape[1];
    if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6130; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_4 = 0;
  __pyx_v_minx = ((PyArrayObject *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "pandas/src/generated.pyx":6131
 * 
 *     minx = np.empty_like(out)
 *     minx.fill(np.inf)             # <<<<<<<<<<<<<<
 * 
 *     if bins[len(bins) - 1] == len(values):
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_minx), __pyx_n_s_fill); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6131; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6131; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_inf); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6131; __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[2]; __pyx_lineno = 6131; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__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 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6131; __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_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pandas/src/generated.pyx":6133
 *     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[2]; __pyx_lineno = 6133; __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[2]; __pyx_lineno = 6133; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_12 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_bins.rcbuffer->pybuffer.buf, __pyx_t_10, __pyx_pybuffernd_bins.diminfo[0].strides)) == __pyx_t_11) != 0);
  if (__pyx_t_12) {

    /* "pandas/src/generated.pyx":6134
 * 
 *     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[2]; __pyx_lineno = 6134; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_v_ngroups = __pyx_t_11;
    goto __pyx_L3;
  }
  /*else*/ {

    /* "pandas/src/generated.pyx":6136
 *         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[2]; __pyx_lineno = 6136; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_v_ngroups = (__pyx_t_11 + 1);
  }
  __pyx_L3:;

  /* "pandas/src/generated.pyx":6138
 *         ngroups = len(bins) + 1
 * 
 *     N, K = (<object> values).shape             # <<<<<<<<<<<<<<
 * 
 *     b = 0
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_values), __pyx_n_s_shape); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6138; __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 CYTHON_COMPILING_IN_CPYTHON
    Py_ssize_t size = Py_SIZE(sequence);
    #else
    Py_ssize_t size = PySequence_Size(sequence);
    #endif
    if (unlikely(size != 2)) {
      if (size > 2) __Pyx_RaiseTooManyValuesError(2);
      else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
      {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6138; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    #if CYTHON_COMPILING_IN_CPYTHON
    if (likely(PyTuple_CheckExact(sequence))) {
      __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0); 
      __pyx_t_2 = PyTuple_GET_ITEM(sequence, 1); 
    } else {
      __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);
    #else
    __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6138; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_2 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6138; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    #endif
    __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[2]; __pyx_lineno = 6138; __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_L4_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_L4_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_2);
    if (__Pyx_IternextUnpackEndCheck(__pyx_t_14(__pyx_t_13), 2) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6138; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_14 = NULL;
    __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
    goto __pyx_L5_unpacking_done;
    __pyx_L4_unpacking_failed:;
    __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
    __pyx_t_14 = NULL;
    if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
    {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6138; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_L5_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[2]; __pyx_lineno = 6138; __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[2]; __pyx_lineno = 6138; __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;

  /* "pandas/src/generated.pyx":6140
 *     N, K = (<object> values).shape
 * 
 *     b = 0             # <<<<<<<<<<<<<<
 *     if K > 1:
 *         for i in range(N):
 */
  __pyx_v_b = 0;

  /* "pandas/src/generated.pyx":6141
 * 
 *     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) != 0);
  if (__pyx_t_12) {

    /* "pandas/src/generated.pyx":6142
 *     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;

      /* "pandas/src/generated.pyx":6143
 *     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)) != 0);
        if (__pyx_t_12) {
          __pyx_t_15 = __pyx_v_b;
          __pyx_t_16 = ((__pyx_v_i >= (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_bins.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_bins.diminfo[0].strides))) != 0);
          __pyx_t_17 = __pyx_t_16;
        } else {
          __pyx_t_17 = __pyx_t_12;
        }
        if (!__pyx_t_17) break;

        /* "pandas/src/generated.pyx":6144
 *         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);
      }

      /* "pandas/src/generated.pyx":6146
 *                 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_pybuffernd_counts.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_counts.diminfo[0].strides) += 1;

      /* "pandas/src/generated.pyx":6147
 * 
 *             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;

        /* "pandas/src/generated.pyx":6148
 *             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_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_values.diminfo[0].strides, __pyx_t_22, __pyx_pybuffernd_values.diminfo[1].strides));

        /* "pandas/src/generated.pyx":6151
 * 
 *                 # not nan
 *                 if val == val:             # <<<<<<<<<<<<<<
 *                     nobs[b, j] += 1
 *                     if val < minx[b, j]:
 */
        __pyx_t_17 = ((__pyx_v_val == __pyx_v_val) != 0);
        if (__pyx_t_17) {

          /* "pandas/src/generated.pyx":6152
 *                 # 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_pybuffernd_nobs.rcbuffer->pybuffer.buf, __pyx_t_23, __pyx_pybuffernd_nobs.diminfo[0].strides, __pyx_t_24, __pyx_pybuffernd_nobs.diminfo[1].strides) += 1.0;

          /* "pandas/src/generated.pyx":6153
 *                 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_pybuffernd_minx.rcbuffer->pybuffer.buf, __pyx_t_25, __pyx_pybuffernd_minx.diminfo[0].strides, __pyx_t_26, __pyx_pybuffernd_minx.diminfo[1].strides))) != 0);
          if (__pyx_t_17) {

            /* "pandas/src/generated.pyx":6154
 *                     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_pybuffernd_minx.rcbuffer->pybuffer.buf, __pyx_t_27, __pyx_pybuffernd_minx.diminfo[0].strides, __pyx_t_28, __pyx_pybuffernd_minx.diminfo[1].strides) = __pyx_v_val;
            goto __pyx_L14;
          }
          __pyx_L14:;
          goto __pyx_L13;
        }
        __pyx_L13:;
      }
    }
    goto __pyx_L6;
  }
  /*else*/ {

    /* "pandas/src/generated.pyx":6156
 *                         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;

      /* "pandas/src/generated.pyx":6157
 *     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)) != 0);
        if (__pyx_t_17) {
          __pyx_t_19 = __pyx_v_b;
          __pyx_t_12 = ((__pyx_v_i >= (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_bins.rcbuffer->pybuffer.buf, __pyx_t_19, __pyx_pybuffernd_bins.diminfo[0].strides))) != 0);
          __pyx_t_16 = __pyx_t_12;
        } else {
          __pyx_t_16 = __pyx_t_17;
        }
        if (!__pyx_t_16) break;

        /* "pandas/src/generated.pyx":6158
 *         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);
      }

      /* "pandas/src/generated.pyx":6160
 *                 b += 1
 * 
 *             counts[b] += 1             # <<<<<<<<<<<<<<
 *             val = values[i, 0]
 * 
 */
      __pyx_t_20 = __pyx_v_b;
      *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_counts.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_counts.diminfo[0].strides) += 1;

      /* "pandas/src/generated.pyx":6161
 * 
 *             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_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_29, __pyx_pybuffernd_values.diminfo[0].strides, __pyx_t_30, __pyx_pybuffernd_values.diminfo[1].strides));

      /* "pandas/src/generated.pyx":6164
 * 
 *             # not nan
 *             if val == val:             # <<<<<<<<<<<<<<
 *                 nobs[b, 0] += 1
 *                 if val < minx[b, 0]:
 */
      __pyx_t_16 = ((__pyx_v_val == __pyx_v_val) != 0);
      if (__pyx_t_16) {

        /* "pandas/src/generated.pyx":6165
 *             # 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_pybuffernd_nobs.rcbuffer->pybuffer.buf, __pyx_t_31, __pyx_pybuffernd_nobs.diminfo[0].strides, __pyx_t_32, __pyx_pybuffernd_nobs.diminfo[1].strides) += 1.0;

        /* "pandas/src/generated.pyx":6166
 *             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_pybuffernd_minx.rcbuffer->pybuffer.buf, __pyx_t_33, __pyx_pybuffernd_minx.diminfo[0].strides, __pyx_t_34, __pyx_pybuffernd_minx.diminfo[1].strides))) != 0);
        if (__pyx_t_16) {

          /* "pandas/src/generated.pyx":6167
 *                 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_pybuffernd_minx.rcbuffer->pybuffer.buf, __pyx_t_35, __pyx_pybuffernd_minx.diminfo[0].strides, __pyx_t_36, __pyx_pybuffernd_minx.diminfo[1].strides) = __pyx_v_val;
          goto __pyx_L20;
        }
        __pyx_L20:;
        goto __pyx_L19;
      }
      __pyx_L19:;
    }
  }
  __pyx_L6:;

  /* "pandas/src/generated.pyx":6169
 *                     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;

    /* "pandas/src/generated.pyx":6170
 * 
 *     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;

      /* "pandas/src/generated.pyx":6171
 *     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_pybuffernd_nobs.rcbuffer->pybuffer.buf, __pyx_t_39, __pyx_pybuffernd_nobs.diminfo[0].strides, __pyx_t_40, __pyx_pybuffernd_nobs.diminfo[1].strides)) == 0.0) != 0);
      if (__pyx_t_16) {

        /* "pandas/src/generated.pyx":6172
 *         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_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_41, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_42, __pyx_pybuffernd_out.diminfo[1].strides) = __pyx_v_6pandas_5algos_nan;
        goto __pyx_L25;
      }
      /*else*/ {

        /* "pandas/src/generated.pyx":6174
 *                 out[i, j] = nan
 *             else:
 *                 out[i, j] = minx[i, j]             # <<<<<<<<<<<<<<
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 */
        __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_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_45, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_46, __pyx_pybuffernd_out.diminfo[1].strides) = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_minx.rcbuffer->pybuffer.buf, __pyx_t_43, __pyx_pybuffernd_minx.diminfo[0].strides, __pyx_t_44, __pyx_pybuffernd_minx.diminfo[1].strides));
      }
      __pyx_L25:;
    }
  }

  /* "pandas/src/generated.pyx":6116
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def group_min_bin_float64(ndarray[float64_t, ndim=2] out,             # <<<<<<<<<<<<<<
 *                    ndarray[int64_t] counts,
 *                    ndarray[float64_t, ndim=2] values,
 */

  /* function exit code */
  __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_pybuffernd_bins.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_counts.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_minx.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas.algos.group_min_bin_float64", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_bins.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_counts.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_minx.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer);
  __pyx_L2:;
  __Pyx_XDECREF((PyObject *)__pyx_v_minx);
  __Pyx_XDECREF((PyObject *)__pyx_v_nobs);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/src/generated.pyx":6177
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def group_min_bin_float32(ndarray[float32_t, ndim=2] out,             # <<<<<<<<<<<<<<
 *                    ndarray[int64_t] counts,
 *                    ndarray[float32_t, ndim=2] values,
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pandas_5algos_441group_min_bin_float32(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6pandas_5algos_440group_min_bin_float32[] = "\n    Only aggregates on axis=0\n    ";
static PyMethodDef __pyx_mdef_6pandas_5algos_441group_min_bin_float32 = {__Pyx_NAMESTR("group_min_bin_float32"), (PyCFunction)__pyx_pw_6pandas_5algos_441group_min_bin_float32, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6pandas_5algos_440group_min_bin_float32)};
static PyObject *__pyx_pw_6pandas_5algos_441group_min_bin_float32(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;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("group_min_bin_float32 (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_out,&__pyx_n_s_counts,&__pyx_n_s_values,&__pyx_n_s_bins,0};
    PyObject* values[4] = {0,0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_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 (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_out)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_counts)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("group_min_bin_float32", 1, 4, 4, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6177; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("group_min_bin_float32", 1, 4, 4, 2); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6177; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  3:
        if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_bins)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("group_min_bin_float32", 1, 4, 4, 3); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6177; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "group_min_bin_float32") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6177; __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_float32", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6177; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas.algos.group_min_bin_float32", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_out), __pyx_ptype_5numpy_ndarray, 1, "out", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6177; __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[2]; __pyx_lineno = 6178; __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[2]; __pyx_lineno = 6179; __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[2]; __pyx_lineno = 6180; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_440group_min_bin_float32(__pyx_self, __pyx_v_out, __pyx_v_counts, __pyx_v_values, __pyx_v_bins);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pandas_5algos_440group_min_bin_float32(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_out, PyArrayObject *__pyx_v_counts, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_bins) {
  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_float32_t __pyx_v_val;
  PyArrayObject *__pyx_v_minx = 0;
  PyArrayObject *__pyx_v_nobs = 0;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_bins;
  __Pyx_Buffer __pyx_pybuffer_bins;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_counts;
  __Pyx_Buffer __pyx_pybuffer_counts;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_minx;
  __Pyx_Buffer __pyx_pybuffer_minx;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_nobs;
  __Pyx_Buffer __pyx_pybuffer_nobs;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_out;
  __Pyx_Buffer __pyx_pybuffer_out;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_values;
  __Pyx_Buffer __pyx_pybuffer_values;
  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;
  __Pyx_RefNannySetupContext("group_min_bin_float32", 0);
  __pyx_pybuffer_minx.pybuffer.buf = NULL;
  __pyx_pybuffer_minx.refcount = 0;
  __pyx_pybuffernd_minx.data = NULL;
  __pyx_pybuffernd_minx.rcbuffer = &__pyx_pybuffer_minx;
  __pyx_pybuffer_nobs.pybuffer.buf = NULL;
  __pyx_pybuffer_nobs.refcount = 0;
  __pyx_pybuffernd_nobs.data = NULL;
  __pyx_pybuffernd_nobs.rcbuffer = &__pyx_pybuffer_nobs;
  __pyx_pybuffer_out.pybuffer.buf = NULL;
  __pyx_pybuffer_out.refcount = 0;
  __pyx_pybuffernd_out.data = NULL;
  __pyx_pybuffernd_out.rcbuffer = &__pyx_pybuffer_out;
  __pyx_pybuffer_counts.pybuffer.buf = NULL;
  __pyx_pybuffer_counts.refcount = 0;
  __pyx_pybuffernd_counts.data = NULL;
  __pyx_pybuffernd_counts.rcbuffer = &__pyx_pybuffer_counts;
  __pyx_pybuffer_values.pybuffer.buf = NULL;
  __pyx_pybuffer_values.refcount = 0;
  __pyx_pybuffernd_values.data = NULL;
  __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values;
  __pyx_pybuffer_bins.pybuffer.buf = NULL;
  __pyx_pybuffer_bins.refcount = 0;
  __pyx_pybuffernd_bins.data = NULL;
  __pyx_pybuffernd_bins.rcbuffer = &__pyx_pybuffer_bins;
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_out.rcbuffer->pybuffer, (PyObject*)__pyx_v_out, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6177; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_out.diminfo[0].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_out.diminfo[0].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_out.diminfo[1].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_out.diminfo[1].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[1];
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_counts.rcbuffer->pybuffer, (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[2]; __pyx_lineno = 6177; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_counts.diminfo[0].strides = __pyx_pybuffernd_counts.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_counts.diminfo[0].shape = __pyx_pybuffernd_counts.rcbuffer->pybuffer.shape[0];
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6177; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_values.diminfo[1].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_values.diminfo[1].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[1];
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_bins.rcbuffer->pybuffer, (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[2]; __pyx_lineno = 6177; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_bins.diminfo[0].strides = __pyx_pybuffernd_bins.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_bins.diminfo[0].shape = __pyx_pybuffernd_bins.rcbuffer->pybuffer.shape[0];

  /* "pandas/src/generated.pyx":6189
 *         ndarray[float32_t, ndim=2] minx, nobs
 * 
 *     nobs = np.zeros_like(out)             # <<<<<<<<<<<<<<
 * 
 *     minx = np.empty_like(out)
 */
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6189; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros_like); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6189; __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[2]; __pyx_lineno = 6189; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__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 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6189; __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 (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6189; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_4 = ((PyArrayObject *)__pyx_t_3);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer);
    __pyx_t_5 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer, (PyObject*)__pyx_t_4, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_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_pybuffernd_nobs.rcbuffer->pybuffer, (PyObject*)__pyx_v_nobs, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_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_pybuffernd_nobs.diminfo[0].strides = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_nobs.diminfo[0].shape = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_nobs.diminfo[1].strides = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_nobs.diminfo[1].shape = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.shape[1];
    if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6189; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_4 = 0;
  __pyx_v_nobs = ((PyArrayObject *)__pyx_t_3);
  __pyx_t_3 = 0;

  /* "pandas/src/generated.pyx":6191
 *     nobs = np.zeros_like(out)
 * 
 *     minx = np.empty_like(out)             # <<<<<<<<<<<<<<
 *     minx.fill(np.inf)
 * 
 */
  __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6191; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_empty_like); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6191; __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[2]; __pyx_lineno = 6191; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__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 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6191; __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;
  if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6191; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_4 = ((PyArrayObject *)__pyx_t_2);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_minx.rcbuffer->pybuffer);
    __pyx_t_5 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_minx.rcbuffer->pybuffer, (PyObject*)__pyx_t_4, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_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_pybuffernd_minx.rcbuffer->pybuffer, (PyObject*)__pyx_v_minx, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_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_pybuffernd_minx.diminfo[0].strides = __pyx_pybuffernd_minx.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_minx.diminfo[0].shape = __pyx_pybuffernd_minx.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_minx.diminfo[1].strides = __pyx_pybuffernd_minx.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_minx.diminfo[1].shape = __pyx_pybuffernd_minx.rcbuffer->pybuffer.shape[1];
    if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6191; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_4 = 0;
  __pyx_v_minx = ((PyArrayObject *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "pandas/src/generated.pyx":6192
 * 
 *     minx = np.empty_like(out)
 *     minx.fill(np.inf)             # <<<<<<<<<<<<<<
 * 
 *     if bins[len(bins) - 1] == len(values):
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_minx), __pyx_n_s_fill); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6192; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6192; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_inf); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6192; __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[2]; __pyx_lineno = 6192; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__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 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6192; __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_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pandas/src/generated.pyx":6194
 *     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[2]; __pyx_lineno = 6194; __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[2]; __pyx_lineno = 6194; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_12 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_bins.rcbuffer->pybuffer.buf, __pyx_t_10, __pyx_pybuffernd_bins.diminfo[0].strides)) == __pyx_t_11) != 0);
  if (__pyx_t_12) {

    /* "pandas/src/generated.pyx":6195
 * 
 *     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[2]; __pyx_lineno = 6195; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_v_ngroups = __pyx_t_11;
    goto __pyx_L3;
  }
  /*else*/ {

    /* "pandas/src/generated.pyx":6197
 *         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[2]; __pyx_lineno = 6197; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_v_ngroups = (__pyx_t_11 + 1);
  }
  __pyx_L3:;

  /* "pandas/src/generated.pyx":6199
 *         ngroups = len(bins) + 1
 * 
 *     N, K = (<object> values).shape             # <<<<<<<<<<<<<<
 * 
 *     b = 0
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_values), __pyx_n_s_shape); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6199; __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 CYTHON_COMPILING_IN_CPYTHON
    Py_ssize_t size = Py_SIZE(sequence);
    #else
    Py_ssize_t size = PySequence_Size(sequence);
    #endif
    if (unlikely(size != 2)) {
      if (size > 2) __Pyx_RaiseTooManyValuesError(2);
      else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
      {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6199; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    #if CYTHON_COMPILING_IN_CPYTHON
    if (likely(PyTuple_CheckExact(sequence))) {
      __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0); 
      __pyx_t_2 = PyTuple_GET_ITEM(sequence, 1); 
    } else {
      __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);
    #else
    __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6199; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_2 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6199; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    #endif
    __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[2]; __pyx_lineno = 6199; __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_L4_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_L4_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_2);
    if (__Pyx_IternextUnpackEndCheck(__pyx_t_14(__pyx_t_13), 2) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6199; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_14 = NULL;
    __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
    goto __pyx_L5_unpacking_done;
    __pyx_L4_unpacking_failed:;
    __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
    __pyx_t_14 = NULL;
    if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
    {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6199; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_L5_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[2]; __pyx_lineno = 6199; __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[2]; __pyx_lineno = 6199; __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;

  /* "pandas/src/generated.pyx":6201
 *     N, K = (<object> values).shape
 * 
 *     b = 0             # <<<<<<<<<<<<<<
 *     if K > 1:
 *         for i in range(N):
 */
  __pyx_v_b = 0;

  /* "pandas/src/generated.pyx":6202
 * 
 *     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) != 0);
  if (__pyx_t_12) {

    /* "pandas/src/generated.pyx":6203
 *     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;

      /* "pandas/src/generated.pyx":6204
 *     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)) != 0);
        if (__pyx_t_12) {
          __pyx_t_15 = __pyx_v_b;
          __pyx_t_16 = ((__pyx_v_i >= (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_bins.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_bins.diminfo[0].strides))) != 0);
          __pyx_t_17 = __pyx_t_16;
        } else {
          __pyx_t_17 = __pyx_t_12;
        }
        if (!__pyx_t_17) break;

        /* "pandas/src/generated.pyx":6205
 *         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);
      }

      /* "pandas/src/generated.pyx":6207
 *                 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_pybuffernd_counts.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_counts.diminfo[0].strides) += 1;

      /* "pandas/src/generated.pyx":6208
 * 
 *             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;

        /* "pandas/src/generated.pyx":6209
 *             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_float32_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_values.diminfo[0].strides, __pyx_t_22, __pyx_pybuffernd_values.diminfo[1].strides));

        /* "pandas/src/generated.pyx":6212
 * 
 *                 # not nan
 *                 if val == val:             # <<<<<<<<<<<<<<
 *                     nobs[b, j] += 1
 *                     if val < minx[b, j]:
 */
        __pyx_t_17 = ((__pyx_v_val == __pyx_v_val) != 0);
        if (__pyx_t_17) {

          /* "pandas/src/generated.pyx":6213
 *                 # 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_float32_t *, __pyx_pybuffernd_nobs.rcbuffer->pybuffer.buf, __pyx_t_23, __pyx_pybuffernd_nobs.diminfo[0].strides, __pyx_t_24, __pyx_pybuffernd_nobs.diminfo[1].strides) += 1.0;

          /* "pandas/src/generated.pyx":6214
 *                 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_float32_t *, __pyx_pybuffernd_minx.rcbuffer->pybuffer.buf, __pyx_t_25, __pyx_pybuffernd_minx.diminfo[0].strides, __pyx_t_26, __pyx_pybuffernd_minx.diminfo[1].strides))) != 0);
          if (__pyx_t_17) {

            /* "pandas/src/generated.pyx":6215
 *                     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_float32_t *, __pyx_pybuffernd_minx.rcbuffer->pybuffer.buf, __pyx_t_27, __pyx_pybuffernd_minx.diminfo[0].strides, __pyx_t_28, __pyx_pybuffernd_minx.diminfo[1].strides) = __pyx_v_val;
            goto __pyx_L14;
          }
          __pyx_L14:;
          goto __pyx_L13;
        }
        __pyx_L13:;
      }
    }
    goto __pyx_L6;
  }
  /*else*/ {

    /* "pandas/src/generated.pyx":6217
 *                         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;

      /* "pandas/src/generated.pyx":6218
 *     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)) != 0);
        if (__pyx_t_17) {
          __pyx_t_19 = __pyx_v_b;
          __pyx_t_12 = ((__pyx_v_i >= (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_bins.rcbuffer->pybuffer.buf, __pyx_t_19, __pyx_pybuffernd_bins.diminfo[0].strides))) != 0);
          __pyx_t_16 = __pyx_t_12;
        } else {
          __pyx_t_16 = __pyx_t_17;
        }
        if (!__pyx_t_16) break;

        /* "pandas/src/generated.pyx":6219
 *         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);
      }

      /* "pandas/src/generated.pyx":6221
 *                 b += 1
 * 
 *             counts[b] += 1             # <<<<<<<<<<<<<<
 *             val = values[i, 0]
 * 
 */
      __pyx_t_20 = __pyx_v_b;
      *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_counts.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_counts.diminfo[0].strides) += 1;

      /* "pandas/src/generated.pyx":6222
 * 
 *             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_float32_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_29, __pyx_pybuffernd_values.diminfo[0].strides, __pyx_t_30, __pyx_pybuffernd_values.diminfo[1].strides));

      /* "pandas/src/generated.pyx":6225
 * 
 *             # not nan
 *             if val == val:             # <<<<<<<<<<<<<<
 *                 nobs[b, 0] += 1
 *                 if val < minx[b, 0]:
 */
      __pyx_t_16 = ((__pyx_v_val == __pyx_v_val) != 0);
      if (__pyx_t_16) {

        /* "pandas/src/generated.pyx":6226
 *             # 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_float32_t *, __pyx_pybuffernd_nobs.rcbuffer->pybuffer.buf, __pyx_t_31, __pyx_pybuffernd_nobs.diminfo[0].strides, __pyx_t_32, __pyx_pybuffernd_nobs.diminfo[1].strides) += 1.0;

        /* "pandas/src/generated.pyx":6227
 *             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_float32_t *, __pyx_pybuffernd_minx.rcbuffer->pybuffer.buf, __pyx_t_33, __pyx_pybuffernd_minx.diminfo[0].strides, __pyx_t_34, __pyx_pybuffernd_minx.diminfo[1].strides))) != 0);
        if (__pyx_t_16) {

          /* "pandas/src/generated.pyx":6228
 *                 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_float32_t *, __pyx_pybuffernd_minx.rcbuffer->pybuffer.buf, __pyx_t_35, __pyx_pybuffernd_minx.diminfo[0].strides, __pyx_t_36, __pyx_pybuffernd_minx.diminfo[1].strides) = __pyx_v_val;
          goto __pyx_L20;
        }
        __pyx_L20:;
        goto __pyx_L19;
      }
      __pyx_L19:;
    }
  }
  __pyx_L6:;

  /* "pandas/src/generated.pyx":6230
 *                     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;

    /* "pandas/src/generated.pyx":6231
 * 
 *     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;

      /* "pandas/src/generated.pyx":6232
 *     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_float32_t *, __pyx_pybuffernd_nobs.rcbuffer->pybuffer.buf, __pyx_t_39, __pyx_pybuffernd_nobs.diminfo[0].strides, __pyx_t_40, __pyx_pybuffernd_nobs.diminfo[1].strides)) == 0.0) != 0);
      if (__pyx_t_16) {

        /* "pandas/src/generated.pyx":6233
 *         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_float32_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_41, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_42, __pyx_pybuffernd_out.diminfo[1].strides) = __pyx_v_6pandas_5algos_nan;
        goto __pyx_L25;
      }
      /*else*/ {

        /* "pandas/src/generated.pyx":6235
 *                 out[i, j] = nan
 *             else:
 *                 out[i, j] = minx[i, j]             # <<<<<<<<<<<<<<
 * 
 * @cython.wraparound(False)
 */
        __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_float32_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_45, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_46, __pyx_pybuffernd_out.diminfo[1].strides) = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_minx.rcbuffer->pybuffer.buf, __pyx_t_43, __pyx_pybuffernd_minx.diminfo[0].strides, __pyx_t_44, __pyx_pybuffernd_minx.diminfo[1].strides));
      }
      __pyx_L25:;
    }
  }

  /* "pandas/src/generated.pyx":6177
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def group_min_bin_float32(ndarray[float32_t, ndim=2] out,             # <<<<<<<<<<<<<<
 *                    ndarray[int64_t] counts,
 *                    ndarray[float32_t, ndim=2] values,
 */

  /* function exit code */
  __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_pybuffernd_bins.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_counts.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_minx.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas.algos.group_min_bin_float32", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_bins.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_counts.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_minx.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer);
  __pyx_L2:;
  __Pyx_XDECREF((PyObject *)__pyx_v_minx);
  __Pyx_XDECREF((PyObject *)__pyx_v_nobs);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/src/generated.pyx":6239
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def group_max_float64(ndarray[float64_t, ndim=2] out,             # <<<<<<<<<<<<<<
 *               ndarray[int64_t] counts,
 *               ndarray[float64_t, ndim=2] values,
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pandas_5algos_443group_max_float64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6pandas_5algos_442group_max_float64[] = "\n    Only aggregates on axis=0\n    ";
static PyMethodDef __pyx_mdef_6pandas_5algos_443group_max_float64 = {__Pyx_NAMESTR("group_max_float64"), (PyCFunction)__pyx_pw_6pandas_5algos_443group_max_float64, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6pandas_5algos_442group_max_float64)};
static PyObject *__pyx_pw_6pandas_5algos_443group_max_float64(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;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("group_max_float64 (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_out,&__pyx_n_s_counts,&__pyx_n_s_values,&__pyx_n_s_labels,0};
    PyObject* values[4] = {0,0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_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 (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_out)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_counts)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("group_max_float64", 1, 4, 4, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6239; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("group_max_float64", 1, 4, 4, 2); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6239; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  3:
        if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_labels)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("group_max_float64", 1, 4, 4, 3); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6239; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "group_max_float64") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6239; __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_float64", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6239; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas.algos.group_max_float64", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_out), __pyx_ptype_5numpy_ndarray, 1, "out", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6239; __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[2]; __pyx_lineno = 6240; __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[2]; __pyx_lineno = 6241; __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[2]; __pyx_lineno = 6242; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_442group_max_float64(__pyx_self, __pyx_v_out, __pyx_v_counts, __pyx_v_values, __pyx_v_labels);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pandas_5algos_442group_max_float64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_out, PyArrayObject *__pyx_v_counts, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_labels) {
  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;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_counts;
  __Pyx_Buffer __pyx_pybuffer_counts;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_labels;
  __Pyx_Buffer __pyx_pybuffer_labels;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_maxx;
  __Pyx_Buffer __pyx_pybuffer_maxx;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_nobs;
  __Pyx_Buffer __pyx_pybuffer_nobs;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_out;
  __Pyx_Buffer __pyx_pybuffer_out;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_values;
  __Pyx_Buffer __pyx_pybuffer_values;
  PyObject *__pyx_r = NULL;
  __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;
  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;
  PyObject *__pyx_t_12 = NULL;
  PyObject *(*__pyx_t_13)(PyObject *);
  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;
  __Pyx_RefNannySetupContext("group_max_float64", 0);
  __pyx_pybuffer_maxx.pybuffer.buf = NULL;
  __pyx_pybuffer_maxx.refcount = 0;
  __pyx_pybuffernd_maxx.data = NULL;
  __pyx_pybuffernd_maxx.rcbuffer = &__pyx_pybuffer_maxx;
  __pyx_pybuffer_nobs.pybuffer.buf = NULL;
  __pyx_pybuffer_nobs.refcount = 0;
  __pyx_pybuffernd_nobs.data = NULL;
  __pyx_pybuffernd_nobs.rcbuffer = &__pyx_pybuffer_nobs;
  __pyx_pybuffer_out.pybuffer.buf = NULL;
  __pyx_pybuffer_out.refcount = 0;
  __pyx_pybuffernd_out.data = NULL;
  __pyx_pybuffernd_out.rcbuffer = &__pyx_pybuffer_out;
  __pyx_pybuffer_counts.pybuffer.buf = NULL;
  __pyx_pybuffer_counts.refcount = 0;
  __pyx_pybuffernd_counts.data = NULL;
  __pyx_pybuffernd_counts.rcbuffer = &__pyx_pybuffer_counts;
  __pyx_pybuffer_values.pybuffer.buf = NULL;
  __pyx_pybuffer_values.refcount = 0;
  __pyx_pybuffernd_values.data = NULL;
  __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values;
  __pyx_pybuffer_labels.pybuffer.buf = NULL;
  __pyx_pybuffer_labels.refcount = 0;
  __pyx_pybuffernd_labels.data = NULL;
  __pyx_pybuffernd_labels.rcbuffer = &__pyx_pybuffer_labels;
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_out.rcbuffer->pybuffer, (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[2]; __pyx_lineno = 6239; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_out.diminfo[0].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_out.diminfo[0].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_out.diminfo[1].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_out.diminfo[1].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[1];
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_counts.rcbuffer->pybuffer, (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[2]; __pyx_lineno = 6239; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_counts.diminfo[0].strides = __pyx_pybuffernd_counts.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_counts.diminfo[0].shape = __pyx_pybuffernd_counts.rcbuffer->pybuffer.shape[0];
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (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[2]; __pyx_lineno = 6239; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_values.diminfo[1].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_values.diminfo[1].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[1];
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_labels.rcbuffer->pybuffer, (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[2]; __pyx_lineno = 6239; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_labels.diminfo[0].strides = __pyx_pybuffernd_labels.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_labels.diminfo[0].shape = __pyx_pybuffernd_labels.rcbuffer->pybuffer.shape[0];

  /* "pandas/src/generated.pyx":6251
 *         ndarray[float64_t, ndim=2] maxx, nobs
 * 
 *     if not len(values) == len(labels):             # <<<<<<<<<<<<<<
 *        raise AssertionError("len(index) != len(labels)")
 * 
 */
  __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_values)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6251; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_2 = PyObject_Length(((PyObject *)__pyx_v_labels)); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6251; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_3 = ((!((__pyx_t_1 == __pyx_t_2) != 0)) != 0);
  if (__pyx_t_3) {

    /* "pandas/src/generated.pyx":6252
 * 
 *     if not len(values) == len(labels):
 *        raise AssertionError("len(index) != len(labels)")             # <<<<<<<<<<<<<<
 * 
 *     nobs = np.zeros_like(out)
 */
    __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_AssertionError, __pyx_tuple__206, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6252; __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[2]; __pyx_lineno = 6252; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }

  /* "pandas/src/generated.pyx":6254
 *        raise AssertionError("len(index) != len(labels)")
 * 
 *     nobs = np.zeros_like(out)             # <<<<<<<<<<<<<<
 * 
 *     maxx = np.empty_like(out)
 */
  __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6254; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_zeros_like); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6254; __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[2]; __pyx_lineno = 6254; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_INCREF(((PyObject *)__pyx_v_out));
  PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_v_out));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_out));
  __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_4, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6254; __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_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[2]; __pyx_lineno = 6254; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_7 = ((PyArrayObject *)__pyx_t_6);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer);
    __pyx_t_8 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer, (PyObject*)__pyx_t_7, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 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_pybuffernd_nobs.rcbuffer->pybuffer, (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_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_pybuffernd_nobs.diminfo[0].strides = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_nobs.diminfo[0].shape = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_nobs.diminfo[1].strides = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_nobs.diminfo[1].shape = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.shape[1];
    if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6254; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_7 = 0;
  __pyx_v_nobs = ((PyArrayObject *)__pyx_t_6);
  __pyx_t_6 = 0;

  /* "pandas/src/generated.pyx":6256
 *     nobs = np.zeros_like(out)
 * 
 *     maxx = np.empty_like(out)             # <<<<<<<<<<<<<<
 *     maxx.fill(-np.inf)
 * 
 */
  __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6256; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_empty_like); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6256; __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[2]; __pyx_lineno = 6256; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_INCREF(((PyObject *)__pyx_v_out));
  PyTuple_SET_ITEM(__pyx_t_6, 0, ((PyObject *)__pyx_v_out));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_out));
  __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6256; __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;
  if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6256; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_7 = ((PyArrayObject *)__pyx_t_5);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_maxx.rcbuffer->pybuffer);
    __pyx_t_8 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_maxx.rcbuffer->pybuffer, (PyObject*)__pyx_t_7, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 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_pybuffernd_maxx.rcbuffer->pybuffer, (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_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_pybuffernd_maxx.diminfo[0].strides = __pyx_pybuffernd_maxx.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_maxx.diminfo[0].shape = __pyx_pybuffernd_maxx.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_maxx.diminfo[1].strides = __pyx_pybuffernd_maxx.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_maxx.diminfo[1].shape = __pyx_pybuffernd_maxx.rcbuffer->pybuffer.shape[1];
    if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6256; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_7 = 0;
  __pyx_v_maxx = ((PyArrayObject *)__pyx_t_5);
  __pyx_t_5 = 0;

  /* "pandas/src/generated.pyx":6257
 * 
 *     maxx = np.empty_like(out)
 *     maxx.fill(-np.inf)             # <<<<<<<<<<<<<<
 * 
 *     N, K = (<object> values).shape
 */
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_maxx), __pyx_n_s_fill); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6257; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6257; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_inf); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6257; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_6 = PyNumber_Negative(__pyx_t_4); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6257; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __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 = 6257; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__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 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_4, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6257; __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_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "pandas/src/generated.pyx":6259
 *     maxx.fill(-np.inf)
 * 
 *     N, K = (<object> values).shape             # <<<<<<<<<<<<<<
 * 
 *     if K > 1:
 */
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_values), __pyx_n_s_shape); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6259; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  if ((likely(PyTuple_CheckExact(__pyx_t_6))) || (PyList_CheckExact(__pyx_t_6))) {
    PyObject* sequence = __pyx_t_6;
    #if CYTHON_COMPILING_IN_CPYTHON
    Py_ssize_t size = Py_SIZE(sequence);
    #else
    Py_ssize_t size = PySequence_Size(sequence);
    #endif
    if (unlikely(size != 2)) {
      if (size > 2) __Pyx_RaiseTooManyValuesError(2);
      else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
      {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6259; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    #if CYTHON_COMPILING_IN_CPYTHON
    if (likely(PyTuple_CheckExact(sequence))) {
      __pyx_t_4 = PyTuple_GET_ITEM(sequence, 0); 
      __pyx_t_5 = PyTuple_GET_ITEM(sequence, 1); 
    } else {
      __pyx_t_4 = PyList_GET_ITEM(sequence, 0); 
      __pyx_t_5 = PyList_GET_ITEM(sequence, 1); 
    }
    __Pyx_INCREF(__pyx_t_4);
    __Pyx_INCREF(__pyx_t_5);
    #else
    __pyx_t_4 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6259; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6259; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    #endif
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  } else {
    Py_ssize_t index = -1;
    __pyx_t_12 = PyObject_GetIter(__pyx_t_6); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6259; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_12);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_13 = Py_TYPE(__pyx_t_12)->tp_iternext;
    index = 0; __pyx_t_4 = __pyx_t_13(__pyx_t_12); if (unlikely(!__pyx_t_4)) goto __pyx_L4_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_4);
    index = 1; __pyx_t_5 = __pyx_t_13(__pyx_t_12); if (unlikely(!__pyx_t_5)) goto __pyx_L4_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_5);
    if (__Pyx_IternextUnpackEndCheck(__pyx_t_13(__pyx_t_12), 2) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6259; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_13 = NULL;
    __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
    goto __pyx_L5_unpacking_done;
    __pyx_L4_unpacking_failed:;
    __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
    __pyx_t_13 = NULL;
    if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
    {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6259; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_L5_unpacking_done:;
  }
  __pyx_t_2 = __Pyx_PyIndex_AsSsize_t(__pyx_t_4); if (unlikely((__pyx_t_2 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6259; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_1 = __Pyx_PyIndex_AsSsize_t(__pyx_t_5); if (unlikely((__pyx_t_1 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6259; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_v_N = __pyx_t_2;
  __pyx_v_K = __pyx_t_1;

  /* "pandas/src/generated.pyx":6261
 *     N, K = (<object> values).shape
 * 
 *     if K > 1:             # <<<<<<<<<<<<<<
 *         for i in range(N):
 *             lab = labels[i]
 */
  __pyx_t_3 = ((__pyx_v_K > 1) != 0);
  if (__pyx_t_3) {

    /* "pandas/src/generated.pyx":6262
 * 
 *     if K > 1:
 *         for i in range(N):             # <<<<<<<<<<<<<<
 *             lab = labels[i]
 *             if lab < 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;

      /* "pandas/src/generated.pyx":6263
 *     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_pybuffernd_labels.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_labels.diminfo[0].strides));

      /* "pandas/src/generated.pyx":6264
 *         for i in range(N):
 *             lab = labels[i]
 *             if lab < 0:             # <<<<<<<<<<<<<<
 *                 continue
 * 
 */
      __pyx_t_3 = ((__pyx_v_lab < 0) != 0);
      if (__pyx_t_3) {

        /* "pandas/src/generated.pyx":6265
 *             lab = labels[i]
 *             if lab < 0:
 *                 continue             # <<<<<<<<<<<<<<
 * 
 *             counts[lab] += 1
 */
        goto __pyx_L7_continue;
      }

      /* "pandas/src/generated.pyx":6267
 *                 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_pybuffernd_counts.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_counts.diminfo[0].strides) += 1;

      /* "pandas/src/generated.pyx":6268
 * 
 *             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;

        /* "pandas/src/generated.pyx":6269
 *             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_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_values.diminfo[0].strides, __pyx_t_19, __pyx_pybuffernd_values.diminfo[1].strides));

        /* "pandas/src/generated.pyx":6272
 * 
 *                 # not nan
 *                 if val == val:             # <<<<<<<<<<<<<<
 *                     nobs[lab, j] += 1
 *                     if val > maxx[lab, j]:
 */
        __pyx_t_3 = ((__pyx_v_val == __pyx_v_val) != 0);
        if (__pyx_t_3) {

          /* "pandas/src/generated.pyx":6273
 *                 # 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_pybuffernd_nobs.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_nobs.diminfo[0].strides, __pyx_t_21, __pyx_pybuffernd_nobs.diminfo[1].strides) += 1.0;

          /* "pandas/src/generated.pyx":6274
 *                 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_3 = ((__pyx_v_val > (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_maxx.rcbuffer->pybuffer.buf, __pyx_t_22, __pyx_pybuffernd_maxx.diminfo[0].strides, __pyx_t_23, __pyx_pybuffernd_maxx.diminfo[1].strides))) != 0);
          if (__pyx_t_3) {

            /* "pandas/src/generated.pyx":6275
 *                     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_pybuffernd_maxx.rcbuffer->pybuffer.buf, __pyx_t_24, __pyx_pybuffernd_maxx.diminfo[0].strides, __pyx_t_25, __pyx_pybuffernd_maxx.diminfo[1].strides) = __pyx_v_val;
            goto __pyx_L13;
          }
          __pyx_L13:;
          goto __pyx_L12;
        }
        __pyx_L12:;
      }
      __pyx_L7_continue:;
    }
    goto __pyx_L6;
  }
  /*else*/ {

    /* "pandas/src/generated.pyx":6277
 *                         maxx[lab, j] = val
 *     else:
 *         for i in range(N):             # <<<<<<<<<<<<<<
 *             lab = labels[i]
 *             if lab < 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;

      /* "pandas/src/generated.pyx":6278
 *     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_pybuffernd_labels.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_labels.diminfo[0].strides));

      /* "pandas/src/generated.pyx":6279
 *         for i in range(N):
 *             lab = labels[i]
 *             if lab < 0:             # <<<<<<<<<<<<<<
 *                 continue
 * 
 */
      __pyx_t_3 = ((__pyx_v_lab < 0) != 0);
      if (__pyx_t_3) {

        /* "pandas/src/generated.pyx":6280
 *             lab = labels[i]
 *             if lab < 0:
 *                 continue             # <<<<<<<<<<<<<<
 * 
 *             counts[lab] += 1
 */
        goto __pyx_L14_continue;
      }

      /* "pandas/src/generated.pyx":6282
 *                 continue
 * 
 *             counts[lab] += 1             # <<<<<<<<<<<<<<
 *             val = values[i, 0]
 * 
 */
      __pyx_t_17 = __pyx_v_lab;
      *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_counts.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_counts.diminfo[0].strides) += 1;

      /* "pandas/src/generated.pyx":6283
 * 
 *             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_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_26, __pyx_pybuffernd_values.diminfo[0].strides, __pyx_t_27, __pyx_pybuffernd_values.diminfo[1].strides));

      /* "pandas/src/generated.pyx":6286
 * 
 *             # not nan
 *             if val == val:             # <<<<<<<<<<<<<<
 *                 nobs[lab, 0] += 1
 *                 if val > maxx[lab, 0]:
 */
      __pyx_t_3 = ((__pyx_v_val == __pyx_v_val) != 0);
      if (__pyx_t_3) {

        /* "pandas/src/generated.pyx":6287
 *             # 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_pybuffernd_nobs.rcbuffer->pybuffer.buf, __pyx_t_28, __pyx_pybuffernd_nobs.diminfo[0].strides, __pyx_t_29, __pyx_pybuffernd_nobs.diminfo[1].strides) += 1.0;

        /* "pandas/src/generated.pyx":6288
 *             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_3 = ((__pyx_v_val > (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_maxx.rcbuffer->pybuffer.buf, __pyx_t_30, __pyx_pybuffernd_maxx.diminfo[0].strides, __pyx_t_31, __pyx_pybuffernd_maxx.diminfo[1].strides))) != 0);
        if (__pyx_t_3) {

          /* "pandas/src/generated.pyx":6289
 *                 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_pybuffernd_maxx.rcbuffer->pybuffer.buf, __pyx_t_32, __pyx_pybuffernd_maxx.diminfo[0].strides, __pyx_t_33, __pyx_pybuffernd_maxx.diminfo[1].strides) = __pyx_v_val;
          goto __pyx_L18;
        }
        __pyx_L18:;
        goto __pyx_L17;
      }
      __pyx_L17:;
      __pyx_L14_continue:;
    }
  }
  __pyx_L6:;

  /* "pandas/src/generated.pyx":6291
 *                     maxx[lab, 0] = val
 * 
 *     for i in range(len(counts)):             # <<<<<<<<<<<<<<
 *         for j in range(K):
 *             if nobs[i, j] == 0:
 */
  __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_counts)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6291; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) {
    __pyx_v_i = __pyx_t_2;

    /* "pandas/src/generated.pyx":6292
 * 
 *     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;

      /* "pandas/src/generated.pyx":6293
 *     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_3 = (((*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_nobs.rcbuffer->pybuffer.buf, __pyx_t_36, __pyx_pybuffernd_nobs.diminfo[0].strides, __pyx_t_37, __pyx_pybuffernd_nobs.diminfo[1].strides)) == 0.0) != 0);
      if (__pyx_t_3) {

        /* "pandas/src/generated.pyx":6294
 *         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_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_38, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_39, __pyx_pybuffernd_out.diminfo[1].strides) = __pyx_v_6pandas_5algos_nan;
        goto __pyx_L23;
      }
      /*else*/ {

        /* "pandas/src/generated.pyx":6296
 *                 out[i, j] = nan
 *             else:
 *                 out[i, j] = maxx[i, j]             # <<<<<<<<<<<<<<
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 */
        __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_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_42, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_43, __pyx_pybuffernd_out.diminfo[1].strides) = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_maxx.rcbuffer->pybuffer.buf, __pyx_t_40, __pyx_pybuffernd_maxx.diminfo[0].strides, __pyx_t_41, __pyx_pybuffernd_maxx.diminfo[1].strides));
      }
      __pyx_L23:;
    }
  }

  /* "pandas/src/generated.pyx":6239
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def group_max_float64(ndarray[float64_t, ndim=2] out,             # <<<<<<<<<<<<<<
 *               ndarray[int64_t] counts,
 *               ndarray[float64_t, ndim=2] values,
 */

  /* function exit code */
  __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_12);
  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
    __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_counts.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_labels.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_maxx.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas.algos.group_max_float64", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_counts.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_labels.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_maxx.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer);
  __pyx_L2:;
  __Pyx_XDECREF((PyObject *)__pyx_v_maxx);
  __Pyx_XDECREF((PyObject *)__pyx_v_nobs);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/src/generated.pyx":6299
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def group_max_float32(ndarray[float32_t, ndim=2] out,             # <<<<<<<<<<<<<<
 *               ndarray[int64_t] counts,
 *               ndarray[float32_t, ndim=2] values,
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pandas_5algos_445group_max_float32(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6pandas_5algos_444group_max_float32[] = "\n    Only aggregates on axis=0\n    ";
static PyMethodDef __pyx_mdef_6pandas_5algos_445group_max_float32 = {__Pyx_NAMESTR("group_max_float32"), (PyCFunction)__pyx_pw_6pandas_5algos_445group_max_float32, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6pandas_5algos_444group_max_float32)};
static PyObject *__pyx_pw_6pandas_5algos_445group_max_float32(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;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("group_max_float32 (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_out,&__pyx_n_s_counts,&__pyx_n_s_values,&__pyx_n_s_labels,0};
    PyObject* values[4] = {0,0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_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 (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_out)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_counts)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("group_max_float32", 1, 4, 4, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6299; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("group_max_float32", 1, 4, 4, 2); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6299; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  3:
        if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_labels)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("group_max_float32", 1, 4, 4, 3); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6299; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "group_max_float32") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6299; __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_float32", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6299; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas.algos.group_max_float32", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_out), __pyx_ptype_5numpy_ndarray, 1, "out", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6299; __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[2]; __pyx_lineno = 6300; __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[2]; __pyx_lineno = 6301; __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[2]; __pyx_lineno = 6302; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_444group_max_float32(__pyx_self, __pyx_v_out, __pyx_v_counts, __pyx_v_values, __pyx_v_labels);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pandas_5algos_444group_max_float32(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_out, PyArrayObject *__pyx_v_counts, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_labels) {
  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_float32_t __pyx_v_val;
  PyArrayObject *__pyx_v_maxx = 0;
  PyArrayObject *__pyx_v_nobs = 0;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_counts;
  __Pyx_Buffer __pyx_pybuffer_counts;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_labels;
  __Pyx_Buffer __pyx_pybuffer_labels;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_maxx;
  __Pyx_Buffer __pyx_pybuffer_maxx;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_nobs;
  __Pyx_Buffer __pyx_pybuffer_nobs;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_out;
  __Pyx_Buffer __pyx_pybuffer_out;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_values;
  __Pyx_Buffer __pyx_pybuffer_values;
  PyObject *__pyx_r = NULL;
  __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;
  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;
  PyObject *__pyx_t_12 = NULL;
  PyObject *(*__pyx_t_13)(PyObject *);
  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;
  __Pyx_RefNannySetupContext("group_max_float32", 0);
  __pyx_pybuffer_maxx.pybuffer.buf = NULL;
  __pyx_pybuffer_maxx.refcount = 0;
  __pyx_pybuffernd_maxx.data = NULL;
  __pyx_pybuffernd_maxx.rcbuffer = &__pyx_pybuffer_maxx;
  __pyx_pybuffer_nobs.pybuffer.buf = NULL;
  __pyx_pybuffer_nobs.refcount = 0;
  __pyx_pybuffernd_nobs.data = NULL;
  __pyx_pybuffernd_nobs.rcbuffer = &__pyx_pybuffer_nobs;
  __pyx_pybuffer_out.pybuffer.buf = NULL;
  __pyx_pybuffer_out.refcount = 0;
  __pyx_pybuffernd_out.data = NULL;
  __pyx_pybuffernd_out.rcbuffer = &__pyx_pybuffer_out;
  __pyx_pybuffer_counts.pybuffer.buf = NULL;
  __pyx_pybuffer_counts.refcount = 0;
  __pyx_pybuffernd_counts.data = NULL;
  __pyx_pybuffernd_counts.rcbuffer = &__pyx_pybuffer_counts;
  __pyx_pybuffer_values.pybuffer.buf = NULL;
  __pyx_pybuffer_values.refcount = 0;
  __pyx_pybuffernd_values.data = NULL;
  __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values;
  __pyx_pybuffer_labels.pybuffer.buf = NULL;
  __pyx_pybuffer_labels.refcount = 0;
  __pyx_pybuffernd_labels.data = NULL;
  __pyx_pybuffernd_labels.rcbuffer = &__pyx_pybuffer_labels;
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_out.rcbuffer->pybuffer, (PyObject*)__pyx_v_out, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6299; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_out.diminfo[0].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_out.diminfo[0].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_out.diminfo[1].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_out.diminfo[1].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[1];
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_counts.rcbuffer->pybuffer, (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[2]; __pyx_lineno = 6299; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_counts.diminfo[0].strides = __pyx_pybuffernd_counts.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_counts.diminfo[0].shape = __pyx_pybuffernd_counts.rcbuffer->pybuffer.shape[0];
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6299; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_values.diminfo[1].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_values.diminfo[1].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[1];
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_labels.rcbuffer->pybuffer, (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[2]; __pyx_lineno = 6299; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_labels.diminfo[0].strides = __pyx_pybuffernd_labels.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_labels.diminfo[0].shape = __pyx_pybuffernd_labels.rcbuffer->pybuffer.shape[0];

  /* "pandas/src/generated.pyx":6311
 *         ndarray[float32_t, ndim=2] maxx, nobs
 * 
 *     if not len(values) == len(labels):             # <<<<<<<<<<<<<<
 *        raise AssertionError("len(index) != len(labels)")
 * 
 */
  __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_values)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6311; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_2 = PyObject_Length(((PyObject *)__pyx_v_labels)); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6311; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_3 = ((!((__pyx_t_1 == __pyx_t_2) != 0)) != 0);
  if (__pyx_t_3) {

    /* "pandas/src/generated.pyx":6312
 * 
 *     if not len(values) == len(labels):
 *        raise AssertionError("len(index) != len(labels)")             # <<<<<<<<<<<<<<
 * 
 *     nobs = np.zeros_like(out)
 */
    __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_AssertionError, __pyx_tuple__207, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6312; __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[2]; __pyx_lineno = 6312; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }

  /* "pandas/src/generated.pyx":6314
 *        raise AssertionError("len(index) != len(labels)")
 * 
 *     nobs = np.zeros_like(out)             # <<<<<<<<<<<<<<
 * 
 *     maxx = np.empty_like(out)
 */
  __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6314; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_zeros_like); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6314; __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[2]; __pyx_lineno = 6314; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_INCREF(((PyObject *)__pyx_v_out));
  PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_v_out));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_out));
  __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_4, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6314; __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_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[2]; __pyx_lineno = 6314; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_7 = ((PyArrayObject *)__pyx_t_6);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer);
    __pyx_t_8 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer, (PyObject*)__pyx_t_7, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 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_pybuffernd_nobs.rcbuffer->pybuffer, (PyObject*)__pyx_v_nobs, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, 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_pybuffernd_nobs.diminfo[0].strides = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_nobs.diminfo[0].shape = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_nobs.diminfo[1].strides = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_nobs.diminfo[1].shape = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.shape[1];
    if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6314; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_7 = 0;
  __pyx_v_nobs = ((PyArrayObject *)__pyx_t_6);
  __pyx_t_6 = 0;

  /* "pandas/src/generated.pyx":6316
 *     nobs = np.zeros_like(out)
 * 
 *     maxx = np.empty_like(out)             # <<<<<<<<<<<<<<
 *     maxx.fill(-np.inf)
 * 
 */
  __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6316; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_empty_like); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6316; __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[2]; __pyx_lineno = 6316; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_INCREF(((PyObject *)__pyx_v_out));
  PyTuple_SET_ITEM(__pyx_t_6, 0, ((PyObject *)__pyx_v_out));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_out));
  __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6316; __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;
  if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6316; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_7 = ((PyArrayObject *)__pyx_t_5);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_maxx.rcbuffer->pybuffer);
    __pyx_t_8 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_maxx.rcbuffer->pybuffer, (PyObject*)__pyx_t_7, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 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_pybuffernd_maxx.rcbuffer->pybuffer, (PyObject*)__pyx_v_maxx, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 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_pybuffernd_maxx.diminfo[0].strides = __pyx_pybuffernd_maxx.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_maxx.diminfo[0].shape = __pyx_pybuffernd_maxx.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_maxx.diminfo[1].strides = __pyx_pybuffernd_maxx.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_maxx.diminfo[1].shape = __pyx_pybuffernd_maxx.rcbuffer->pybuffer.shape[1];
    if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6316; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_7 = 0;
  __pyx_v_maxx = ((PyArrayObject *)__pyx_t_5);
  __pyx_t_5 = 0;

  /* "pandas/src/generated.pyx":6317
 * 
 *     maxx = np.empty_like(out)
 *     maxx.fill(-np.inf)             # <<<<<<<<<<<<<<
 * 
 *     N, K = (<object> values).shape
 */
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_maxx), __pyx_n_s_fill); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6317; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6317; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_inf); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6317; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_6 = PyNumber_Negative(__pyx_t_4); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6317; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __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 = 6317; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__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 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_4, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6317; __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_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "pandas/src/generated.pyx":6319
 *     maxx.fill(-np.inf)
 * 
 *     N, K = (<object> values).shape             # <<<<<<<<<<<<<<
 * 
 *     if K > 1:
 */
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_values), __pyx_n_s_shape); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6319; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  if ((likely(PyTuple_CheckExact(__pyx_t_6))) || (PyList_CheckExact(__pyx_t_6))) {
    PyObject* sequence = __pyx_t_6;
    #if CYTHON_COMPILING_IN_CPYTHON
    Py_ssize_t size = Py_SIZE(sequence);
    #else
    Py_ssize_t size = PySequence_Size(sequence);
    #endif
    if (unlikely(size != 2)) {
      if (size > 2) __Pyx_RaiseTooManyValuesError(2);
      else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
      {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6319; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    #if CYTHON_COMPILING_IN_CPYTHON
    if (likely(PyTuple_CheckExact(sequence))) {
      __pyx_t_4 = PyTuple_GET_ITEM(sequence, 0); 
      __pyx_t_5 = PyTuple_GET_ITEM(sequence, 1); 
    } else {
      __pyx_t_4 = PyList_GET_ITEM(sequence, 0); 
      __pyx_t_5 = PyList_GET_ITEM(sequence, 1); 
    }
    __Pyx_INCREF(__pyx_t_4);
    __Pyx_INCREF(__pyx_t_5);
    #else
    __pyx_t_4 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6319; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6319; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    #endif
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  } else {
    Py_ssize_t index = -1;
    __pyx_t_12 = PyObject_GetIter(__pyx_t_6); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6319; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_12);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_13 = Py_TYPE(__pyx_t_12)->tp_iternext;
    index = 0; __pyx_t_4 = __pyx_t_13(__pyx_t_12); if (unlikely(!__pyx_t_4)) goto __pyx_L4_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_4);
    index = 1; __pyx_t_5 = __pyx_t_13(__pyx_t_12); if (unlikely(!__pyx_t_5)) goto __pyx_L4_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_5);
    if (__Pyx_IternextUnpackEndCheck(__pyx_t_13(__pyx_t_12), 2) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6319; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_13 = NULL;
    __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
    goto __pyx_L5_unpacking_done;
    __pyx_L4_unpacking_failed:;
    __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
    __pyx_t_13 = NULL;
    if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
    {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6319; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_L5_unpacking_done:;
  }
  __pyx_t_2 = __Pyx_PyIndex_AsSsize_t(__pyx_t_4); if (unlikely((__pyx_t_2 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6319; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_1 = __Pyx_PyIndex_AsSsize_t(__pyx_t_5); if (unlikely((__pyx_t_1 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6319; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_v_N = __pyx_t_2;
  __pyx_v_K = __pyx_t_1;

  /* "pandas/src/generated.pyx":6321
 *     N, K = (<object> values).shape
 * 
 *     if K > 1:             # <<<<<<<<<<<<<<
 *         for i in range(N):
 *             lab = labels[i]
 */
  __pyx_t_3 = ((__pyx_v_K > 1) != 0);
  if (__pyx_t_3) {

    /* "pandas/src/generated.pyx":6322
 * 
 *     if K > 1:
 *         for i in range(N):             # <<<<<<<<<<<<<<
 *             lab = labels[i]
 *             if lab < 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;

      /* "pandas/src/generated.pyx":6323
 *     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_pybuffernd_labels.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_labels.diminfo[0].strides));

      /* "pandas/src/generated.pyx":6324
 *         for i in range(N):
 *             lab = labels[i]
 *             if lab < 0:             # <<<<<<<<<<<<<<
 *                 continue
 * 
 */
      __pyx_t_3 = ((__pyx_v_lab < 0) != 0);
      if (__pyx_t_3) {

        /* "pandas/src/generated.pyx":6325
 *             lab = labels[i]
 *             if lab < 0:
 *                 continue             # <<<<<<<<<<<<<<
 * 
 *             counts[lab] += 1
 */
        goto __pyx_L7_continue;
      }

      /* "pandas/src/generated.pyx":6327
 *                 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_pybuffernd_counts.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_counts.diminfo[0].strides) += 1;

      /* "pandas/src/generated.pyx":6328
 * 
 *             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;

        /* "pandas/src/generated.pyx":6329
 *             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_float32_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_values.diminfo[0].strides, __pyx_t_19, __pyx_pybuffernd_values.diminfo[1].strides));

        /* "pandas/src/generated.pyx":6332
 * 
 *                 # not nan
 *                 if val == val:             # <<<<<<<<<<<<<<
 *                     nobs[lab, j] += 1
 *                     if val > maxx[lab, j]:
 */
        __pyx_t_3 = ((__pyx_v_val == __pyx_v_val) != 0);
        if (__pyx_t_3) {

          /* "pandas/src/generated.pyx":6333
 *                 # 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_float32_t *, __pyx_pybuffernd_nobs.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_nobs.diminfo[0].strides, __pyx_t_21, __pyx_pybuffernd_nobs.diminfo[1].strides) += 1.0;

          /* "pandas/src/generated.pyx":6334
 *                 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_3 = ((__pyx_v_val > (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_maxx.rcbuffer->pybuffer.buf, __pyx_t_22, __pyx_pybuffernd_maxx.diminfo[0].strides, __pyx_t_23, __pyx_pybuffernd_maxx.diminfo[1].strides))) != 0);
          if (__pyx_t_3) {

            /* "pandas/src/generated.pyx":6335
 *                     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_float32_t *, __pyx_pybuffernd_maxx.rcbuffer->pybuffer.buf, __pyx_t_24, __pyx_pybuffernd_maxx.diminfo[0].strides, __pyx_t_25, __pyx_pybuffernd_maxx.diminfo[1].strides) = __pyx_v_val;
            goto __pyx_L13;
          }
          __pyx_L13:;
          goto __pyx_L12;
        }
        __pyx_L12:;
      }
      __pyx_L7_continue:;
    }
    goto __pyx_L6;
  }
  /*else*/ {

    /* "pandas/src/generated.pyx":6337
 *                         maxx[lab, j] = val
 *     else:
 *         for i in range(N):             # <<<<<<<<<<<<<<
 *             lab = labels[i]
 *             if lab < 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;

      /* "pandas/src/generated.pyx":6338
 *     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_pybuffernd_labels.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_labels.diminfo[0].strides));

      /* "pandas/src/generated.pyx":6339
 *         for i in range(N):
 *             lab = labels[i]
 *             if lab < 0:             # <<<<<<<<<<<<<<
 *                 continue
 * 
 */
      __pyx_t_3 = ((__pyx_v_lab < 0) != 0);
      if (__pyx_t_3) {

        /* "pandas/src/generated.pyx":6340
 *             lab = labels[i]
 *             if lab < 0:
 *                 continue             # <<<<<<<<<<<<<<
 * 
 *             counts[lab] += 1
 */
        goto __pyx_L14_continue;
      }

      /* "pandas/src/generated.pyx":6342
 *                 continue
 * 
 *             counts[lab] += 1             # <<<<<<<<<<<<<<
 *             val = values[i, 0]
 * 
 */
      __pyx_t_17 = __pyx_v_lab;
      *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_counts.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_counts.diminfo[0].strides) += 1;

      /* "pandas/src/generated.pyx":6343
 * 
 *             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_float32_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_26, __pyx_pybuffernd_values.diminfo[0].strides, __pyx_t_27, __pyx_pybuffernd_values.diminfo[1].strides));

      /* "pandas/src/generated.pyx":6346
 * 
 *             # not nan
 *             if val == val:             # <<<<<<<<<<<<<<
 *                 nobs[lab, 0] += 1
 *                 if val > maxx[lab, 0]:
 */
      __pyx_t_3 = ((__pyx_v_val == __pyx_v_val) != 0);
      if (__pyx_t_3) {

        /* "pandas/src/generated.pyx":6347
 *             # 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_float32_t *, __pyx_pybuffernd_nobs.rcbuffer->pybuffer.buf, __pyx_t_28, __pyx_pybuffernd_nobs.diminfo[0].strides, __pyx_t_29, __pyx_pybuffernd_nobs.diminfo[1].strides) += 1.0;

        /* "pandas/src/generated.pyx":6348
 *             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_3 = ((__pyx_v_val > (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_maxx.rcbuffer->pybuffer.buf, __pyx_t_30, __pyx_pybuffernd_maxx.diminfo[0].strides, __pyx_t_31, __pyx_pybuffernd_maxx.diminfo[1].strides))) != 0);
        if (__pyx_t_3) {

          /* "pandas/src/generated.pyx":6349
 *                 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_float32_t *, __pyx_pybuffernd_maxx.rcbuffer->pybuffer.buf, __pyx_t_32, __pyx_pybuffernd_maxx.diminfo[0].strides, __pyx_t_33, __pyx_pybuffernd_maxx.diminfo[1].strides) = __pyx_v_val;
          goto __pyx_L18;
        }
        __pyx_L18:;
        goto __pyx_L17;
      }
      __pyx_L17:;
      __pyx_L14_continue:;
    }
  }
  __pyx_L6:;

  /* "pandas/src/generated.pyx":6351
 *                     maxx[lab, 0] = val
 * 
 *     for i in range(len(counts)):             # <<<<<<<<<<<<<<
 *         for j in range(K):
 *             if nobs[i, j] == 0:
 */
  __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_counts)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6351; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) {
    __pyx_v_i = __pyx_t_2;

    /* "pandas/src/generated.pyx":6352
 * 
 *     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;

      /* "pandas/src/generated.pyx":6353
 *     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_3 = (((*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_nobs.rcbuffer->pybuffer.buf, __pyx_t_36, __pyx_pybuffernd_nobs.diminfo[0].strides, __pyx_t_37, __pyx_pybuffernd_nobs.diminfo[1].strides)) == 0.0) != 0);
      if (__pyx_t_3) {

        /* "pandas/src/generated.pyx":6354
 *         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_float32_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_38, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_39, __pyx_pybuffernd_out.diminfo[1].strides) = __pyx_v_6pandas_5algos_nan;
        goto __pyx_L23;
      }
      /*else*/ {

        /* "pandas/src/generated.pyx":6356
 *                 out[i, j] = nan
 *             else:
 *                 out[i, j] = maxx[i, j]             # <<<<<<<<<<<<<<
 * 
 * @cython.wraparound(False)
 */
        __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_float32_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_42, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_43, __pyx_pybuffernd_out.diminfo[1].strides) = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_maxx.rcbuffer->pybuffer.buf, __pyx_t_40, __pyx_pybuffernd_maxx.diminfo[0].strides, __pyx_t_41, __pyx_pybuffernd_maxx.diminfo[1].strides));
      }
      __pyx_L23:;
    }
  }

  /* "pandas/src/generated.pyx":6299
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def group_max_float32(ndarray[float32_t, ndim=2] out,             # <<<<<<<<<<<<<<
 *               ndarray[int64_t] counts,
 *               ndarray[float32_t, ndim=2] values,
 */

  /* function exit code */
  __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_12);
  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
    __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_counts.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_labels.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_maxx.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas.algos.group_max_float32", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_counts.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_labels.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_maxx.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer);
  __pyx_L2:;
  __Pyx_XDECREF((PyObject *)__pyx_v_maxx);
  __Pyx_XDECREF((PyObject *)__pyx_v_nobs);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/src/generated.pyx":6360
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def group_max_bin_float64(ndarray[float64_t, ndim=2] out,             # <<<<<<<<<<<<<<
 *                   ndarray[int64_t] counts,
 *                   ndarray[float64_t, ndim=2] values,
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pandas_5algos_447group_max_bin_float64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6pandas_5algos_446group_max_bin_float64[] = "\n    Only aggregates on axis=0\n    ";
static PyMethodDef __pyx_mdef_6pandas_5algos_447group_max_bin_float64 = {__Pyx_NAMESTR("group_max_bin_float64"), (PyCFunction)__pyx_pw_6pandas_5algos_447group_max_bin_float64, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6pandas_5algos_446group_max_bin_float64)};
static PyObject *__pyx_pw_6pandas_5algos_447group_max_bin_float64(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;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("group_max_bin_float64 (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_out,&__pyx_n_s_counts,&__pyx_n_s_values,&__pyx_n_s_bins,0};
    PyObject* values[4] = {0,0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_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 (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_out)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_counts)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("group_max_bin_float64", 1, 4, 4, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6360; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("group_max_bin_float64", 1, 4, 4, 2); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6360; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  3:
        if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_bins)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("group_max_bin_float64", 1, 4, 4, 3); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6360; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "group_max_bin_float64") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6360; __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_float64", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6360; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas.algos.group_max_bin_float64", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_out), __pyx_ptype_5numpy_ndarray, 1, "out", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6360; __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[2]; __pyx_lineno = 6361; __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[2]; __pyx_lineno = 6362; __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[2]; __pyx_lineno = 6363; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_446group_max_bin_float64(__pyx_self, __pyx_v_out, __pyx_v_counts, __pyx_v_values, __pyx_v_bins);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pandas_5algos_446group_max_bin_float64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_out, PyArrayObject *__pyx_v_counts, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_bins) {
  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;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_bins;
  __Pyx_Buffer __pyx_pybuffer_bins;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_counts;
  __Pyx_Buffer __pyx_pybuffer_counts;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_maxx;
  __Pyx_Buffer __pyx_pybuffer_maxx;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_nobs;
  __Pyx_Buffer __pyx_pybuffer_nobs;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_out;
  __Pyx_Buffer __pyx_pybuffer_out;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_values;
  __Pyx_Buffer __pyx_pybuffer_values;
  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;
  __Pyx_RefNannySetupContext("group_max_bin_float64", 0);
  __pyx_pybuffer_maxx.pybuffer.buf = NULL;
  __pyx_pybuffer_maxx.refcount = 0;
  __pyx_pybuffernd_maxx.data = NULL;
  __pyx_pybuffernd_maxx.rcbuffer = &__pyx_pybuffer_maxx;
  __pyx_pybuffer_nobs.pybuffer.buf = NULL;
  __pyx_pybuffer_nobs.refcount = 0;
  __pyx_pybuffernd_nobs.data = NULL;
  __pyx_pybuffernd_nobs.rcbuffer = &__pyx_pybuffer_nobs;
  __pyx_pybuffer_out.pybuffer.buf = NULL;
  __pyx_pybuffer_out.refcount = 0;
  __pyx_pybuffernd_out.data = NULL;
  __pyx_pybuffernd_out.rcbuffer = &__pyx_pybuffer_out;
  __pyx_pybuffer_counts.pybuffer.buf = NULL;
  __pyx_pybuffer_counts.refcount = 0;
  __pyx_pybuffernd_counts.data = NULL;
  __pyx_pybuffernd_counts.rcbuffer = &__pyx_pybuffer_counts;
  __pyx_pybuffer_values.pybuffer.buf = NULL;
  __pyx_pybuffer_values.refcount = 0;
  __pyx_pybuffernd_values.data = NULL;
  __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values;
  __pyx_pybuffer_bins.pybuffer.buf = NULL;
  __pyx_pybuffer_bins.refcount = 0;
  __pyx_pybuffernd_bins.data = NULL;
  __pyx_pybuffernd_bins.rcbuffer = &__pyx_pybuffer_bins;
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_out.rcbuffer->pybuffer, (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[2]; __pyx_lineno = 6360; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_out.diminfo[0].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_out.diminfo[0].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_out.diminfo[1].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_out.diminfo[1].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[1];
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_counts.rcbuffer->pybuffer, (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[2]; __pyx_lineno = 6360; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_counts.diminfo[0].strides = __pyx_pybuffernd_counts.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_counts.diminfo[0].shape = __pyx_pybuffernd_counts.rcbuffer->pybuffer.shape[0];
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (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[2]; __pyx_lineno = 6360; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_values.diminfo[1].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_values.diminfo[1].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[1];
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_bins.rcbuffer->pybuffer, (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[2]; __pyx_lineno = 6360; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_bins.diminfo[0].strides = __pyx_pybuffernd_bins.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_bins.diminfo[0].shape = __pyx_pybuffernd_bins.rcbuffer->pybuffer.shape[0];

  /* "pandas/src/generated.pyx":6372
 *         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_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6372; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros_like); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6372; __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[2]; __pyx_lineno = 6372; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__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 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6372; __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 (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6372; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_4 = ((PyArrayObject *)__pyx_t_3);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer);
    __pyx_t_5 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer, (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_pybuffernd_nobs.rcbuffer->pybuffer, (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_pybuffernd_nobs.diminfo[0].strides = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_nobs.diminfo[0].shape = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_nobs.diminfo[1].strides = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_nobs.diminfo[1].shape = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.shape[1];
    if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6372; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_4 = 0;
  __pyx_v_nobs = ((PyArrayObject *)__pyx_t_3);
  __pyx_t_3 = 0;

  /* "pandas/src/generated.pyx":6373
 * 
 *     nobs = np.zeros_like(out)
 *     maxx = np.empty_like(out)             # <<<<<<<<<<<<<<
 *     maxx.fill(-np.inf)
 * 
 */
  __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6373; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_empty_like); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6373; __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[2]; __pyx_lineno = 6373; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__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 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6373; __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;
  if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6373; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_4 = ((PyArrayObject *)__pyx_t_2);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_maxx.rcbuffer->pybuffer);
    __pyx_t_5 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_maxx.rcbuffer->pybuffer, (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_pybuffernd_maxx.rcbuffer->pybuffer, (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_pybuffernd_maxx.diminfo[0].strides = __pyx_pybuffernd_maxx.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_maxx.diminfo[0].shape = __pyx_pybuffernd_maxx.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_maxx.diminfo[1].strides = __pyx_pybuffernd_maxx.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_maxx.diminfo[1].shape = __pyx_pybuffernd_maxx.rcbuffer->pybuffer.shape[1];
    if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6373; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_4 = 0;
  __pyx_v_maxx = ((PyArrayObject *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "pandas/src/generated.pyx":6374
 *     nobs = np.zeros_like(out)
 *     maxx = np.empty_like(out)
 *     maxx.fill(-np.inf)             # <<<<<<<<<<<<<<
 * 
 *     if bins[len(bins) - 1] == len(values):
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_maxx), __pyx_n_s_fill); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6374; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6374; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_inf); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6374; __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[2]; __pyx_lineno = 6374; __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[2]; __pyx_lineno = 6374; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__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 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6374; __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;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "pandas/src/generated.pyx":6376
 *     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[2]; __pyx_lineno = 6376; __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[2]; __pyx_lineno = 6376; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_12 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_bins.rcbuffer->pybuffer.buf, __pyx_t_10, __pyx_pybuffernd_bins.diminfo[0].strides)) == __pyx_t_11) != 0);
  if (__pyx_t_12) {

    /* "pandas/src/generated.pyx":6377
 * 
 *     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[2]; __pyx_lineno = 6377; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_v_ngroups = __pyx_t_11;
    goto __pyx_L3;
  }
  /*else*/ {

    /* "pandas/src/generated.pyx":6379
 *         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[2]; __pyx_lineno = 6379; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_v_ngroups = (__pyx_t_11 + 1);
  }
  __pyx_L3:;

  /* "pandas/src/generated.pyx":6381
 *         ngroups = len(bins) + 1
 * 
 *     N, K = (<object> values).shape             # <<<<<<<<<<<<<<
 * 
 *     b = 0
 */
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_values), __pyx_n_s_shape); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6381; __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 CYTHON_COMPILING_IN_CPYTHON
    Py_ssize_t size = Py_SIZE(sequence);
    #else
    Py_ssize_t size = PySequence_Size(sequence);
    #endif
    if (unlikely(size != 2)) {
      if (size > 2) __Pyx_RaiseTooManyValuesError(2);
      else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
      {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6381; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    #if CYTHON_COMPILING_IN_CPYTHON
    if (likely(PyTuple_CheckExact(sequence))) {
      __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0); 
      __pyx_t_2 = PyTuple_GET_ITEM(sequence, 1); 
    } else {
      __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);
    #else
    __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6381; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6381; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    #endif
    __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[2]; __pyx_lineno = 6381; __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_L4_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_L4_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_2);
    if (__Pyx_IternextUnpackEndCheck(__pyx_t_14(__pyx_t_13), 2) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6381; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_14 = NULL;
    __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
    goto __pyx_L5_unpacking_done;
    __pyx_L4_unpacking_failed:;
    __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
    __pyx_t_14 = NULL;
    if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
    {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6381; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_L5_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[2]; __pyx_lineno = 6381; __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[2]; __pyx_lineno = 6381; __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;

  /* "pandas/src/generated.pyx":6383
 *     N, K = (<object> values).shape
 * 
 *     b = 0             # <<<<<<<<<<<<<<
 *     if K > 1:
 *         for i in range(N):
 */
  __pyx_v_b = 0;

  /* "pandas/src/generated.pyx":6384
 * 
 *     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) != 0);
  if (__pyx_t_12) {

    /* "pandas/src/generated.pyx":6385
 *     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;

      /* "pandas/src/generated.pyx":6386
 *     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)) != 0);
        if (__pyx_t_12) {
          __pyx_t_15 = __pyx_v_b;
          __pyx_t_16 = ((__pyx_v_i >= (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_bins.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_bins.diminfo[0].strides))) != 0);
          __pyx_t_17 = __pyx_t_16;
        } else {
          __pyx_t_17 = __pyx_t_12;
        }
        if (!__pyx_t_17) break;

        /* "pandas/src/generated.pyx":6387
 *         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);
      }

      /* "pandas/src/generated.pyx":6389
 *                 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_pybuffernd_counts.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_counts.diminfo[0].strides) += 1;

      /* "pandas/src/generated.pyx":6390
 * 
 *             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;

        /* "pandas/src/generated.pyx":6391
 *             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_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_values.diminfo[0].strides, __pyx_t_22, __pyx_pybuffernd_values.diminfo[1].strides));

        /* "pandas/src/generated.pyx":6394
 * 
 *                 # not nan
 *                 if val == val:             # <<<<<<<<<<<<<<
 *                     nobs[b, j] += 1
 *                     if val > maxx[b, j]:
 */
        __pyx_t_17 = ((__pyx_v_val == __pyx_v_val) != 0);
        if (__pyx_t_17) {

          /* "pandas/src/generated.pyx":6395
 *                 # 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_pybuffernd_nobs.rcbuffer->pybuffer.buf, __pyx_t_23, __pyx_pybuffernd_nobs.diminfo[0].strides, __pyx_t_24, __pyx_pybuffernd_nobs.diminfo[1].strides) += 1.0;

          /* "pandas/src/generated.pyx":6396
 *                 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_pybuffernd_maxx.rcbuffer->pybuffer.buf, __pyx_t_25, __pyx_pybuffernd_maxx.diminfo[0].strides, __pyx_t_26, __pyx_pybuffernd_maxx.diminfo[1].strides))) != 0);
          if (__pyx_t_17) {

            /* "pandas/src/generated.pyx":6397
 *                     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_pybuffernd_maxx.rcbuffer->pybuffer.buf, __pyx_t_27, __pyx_pybuffernd_maxx.diminfo[0].strides, __pyx_t_28, __pyx_pybuffernd_maxx.diminfo[1].strides) = __pyx_v_val;
            goto __pyx_L14;
          }
          __pyx_L14:;
          goto __pyx_L13;
        }
        __pyx_L13:;
      }
    }
    goto __pyx_L6;
  }
  /*else*/ {

    /* "pandas/src/generated.pyx":6399
 *                         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;

      /* "pandas/src/generated.pyx":6400
 *     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)) != 0);
        if (__pyx_t_17) {
          __pyx_t_19 = __pyx_v_b;
          __pyx_t_12 = ((__pyx_v_i >= (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_bins.rcbuffer->pybuffer.buf, __pyx_t_19, __pyx_pybuffernd_bins.diminfo[0].strides))) != 0);
          __pyx_t_16 = __pyx_t_12;
        } else {
          __pyx_t_16 = __pyx_t_17;
        }
        if (!__pyx_t_16) break;

        /* "pandas/src/generated.pyx":6401
 *         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);
      }

      /* "pandas/src/generated.pyx":6403
 *                 b += 1
 * 
 *             counts[b] += 1             # <<<<<<<<<<<<<<
 *             val = values[i, 0]
 * 
 */
      __pyx_t_20 = __pyx_v_b;
      *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_counts.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_counts.diminfo[0].strides) += 1;

      /* "pandas/src/generated.pyx":6404
 * 
 *             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_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_29, __pyx_pybuffernd_values.diminfo[0].strides, __pyx_t_30, __pyx_pybuffernd_values.diminfo[1].strides));

      /* "pandas/src/generated.pyx":6407
 * 
 *             # not nan
 *             if val == val:             # <<<<<<<<<<<<<<
 *                 nobs[b, 0] += 1
 *                 if val > maxx[b, 0]:
 */
      __pyx_t_16 = ((__pyx_v_val == __pyx_v_val) != 0);
      if (__pyx_t_16) {

        /* "pandas/src/generated.pyx":6408
 *             # 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_pybuffernd_nobs.rcbuffer->pybuffer.buf, __pyx_t_31, __pyx_pybuffernd_nobs.diminfo[0].strides, __pyx_t_32, __pyx_pybuffernd_nobs.diminfo[1].strides) += 1.0;

        /* "pandas/src/generated.pyx":6409
 *             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_pybuffernd_maxx.rcbuffer->pybuffer.buf, __pyx_t_33, __pyx_pybuffernd_maxx.diminfo[0].strides, __pyx_t_34, __pyx_pybuffernd_maxx.diminfo[1].strides))) != 0);
        if (__pyx_t_16) {

          /* "pandas/src/generated.pyx":6410
 *                 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_pybuffernd_maxx.rcbuffer->pybuffer.buf, __pyx_t_35, __pyx_pybuffernd_maxx.diminfo[0].strides, __pyx_t_36, __pyx_pybuffernd_maxx.diminfo[1].strides) = __pyx_v_val;
          goto __pyx_L20;
        }
        __pyx_L20:;
        goto __pyx_L19;
      }
      __pyx_L19:;
    }
  }
  __pyx_L6:;

  /* "pandas/src/generated.pyx":6412
 *                     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;

    /* "pandas/src/generated.pyx":6413
 * 
 *     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;

      /* "pandas/src/generated.pyx":6414
 *     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_pybuffernd_nobs.rcbuffer->pybuffer.buf, __pyx_t_39, __pyx_pybuffernd_nobs.diminfo[0].strides, __pyx_t_40, __pyx_pybuffernd_nobs.diminfo[1].strides)) == 0.0) != 0);
      if (__pyx_t_16) {

        /* "pandas/src/generated.pyx":6415
 *         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_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_41, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_42, __pyx_pybuffernd_out.diminfo[1].strides) = __pyx_v_6pandas_5algos_nan;
        goto __pyx_L25;
      }
      /*else*/ {

        /* "pandas/src/generated.pyx":6417
 *                 out[i, j] = nan
 *             else:
 *                 out[i, j] = maxx[i, j]             # <<<<<<<<<<<<<<
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 */
        __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_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_45, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_46, __pyx_pybuffernd_out.diminfo[1].strides) = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_maxx.rcbuffer->pybuffer.buf, __pyx_t_43, __pyx_pybuffernd_maxx.diminfo[0].strides, __pyx_t_44, __pyx_pybuffernd_maxx.diminfo[1].strides));
      }
      __pyx_L25:;
    }
  }

  /* "pandas/src/generated.pyx":6360
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def group_max_bin_float64(ndarray[float64_t, ndim=2] out,             # <<<<<<<<<<<<<<
 *                   ndarray[int64_t] counts,
 *                   ndarray[float64_t, ndim=2] values,
 */

  /* function exit code */
  __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_pybuffernd_bins.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_counts.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_maxx.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas.algos.group_max_bin_float64", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_bins.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_counts.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_maxx.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer);
  __pyx_L2:;
  __Pyx_XDECREF((PyObject *)__pyx_v_maxx);
  __Pyx_XDECREF((PyObject *)__pyx_v_nobs);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/src/generated.pyx":6420
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def group_max_bin_float32(ndarray[float32_t, ndim=2] out,             # <<<<<<<<<<<<<<
 *                   ndarray[int64_t] counts,
 *                   ndarray[float32_t, ndim=2] values,
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pandas_5algos_449group_max_bin_float32(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6pandas_5algos_448group_max_bin_float32[] = "\n    Only aggregates on axis=0\n    ";
static PyMethodDef __pyx_mdef_6pandas_5algos_449group_max_bin_float32 = {__Pyx_NAMESTR("group_max_bin_float32"), (PyCFunction)__pyx_pw_6pandas_5algos_449group_max_bin_float32, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6pandas_5algos_448group_max_bin_float32)};
static PyObject *__pyx_pw_6pandas_5algos_449group_max_bin_float32(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;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("group_max_bin_float32 (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_out,&__pyx_n_s_counts,&__pyx_n_s_values,&__pyx_n_s_bins,0};
    PyObject* values[4] = {0,0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_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 (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_out)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_counts)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("group_max_bin_float32", 1, 4, 4, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6420; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("group_max_bin_float32", 1, 4, 4, 2); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6420; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  3:
        if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_bins)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("group_max_bin_float32", 1, 4, 4, 3); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6420; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "group_max_bin_float32") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6420; __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_float32", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6420; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas.algos.group_max_bin_float32", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_out), __pyx_ptype_5numpy_ndarray, 1, "out", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6420; __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[2]; __pyx_lineno = 6421; __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[2]; __pyx_lineno = 6422; __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[2]; __pyx_lineno = 6423; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_448group_max_bin_float32(__pyx_self, __pyx_v_out, __pyx_v_counts, __pyx_v_values, __pyx_v_bins);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pandas_5algos_448group_max_bin_float32(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_out, PyArrayObject *__pyx_v_counts, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_bins) {
  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_float32_t __pyx_v_val;
  PyArrayObject *__pyx_v_maxx = 0;
  PyArrayObject *__pyx_v_nobs = 0;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_bins;
  __Pyx_Buffer __pyx_pybuffer_bins;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_counts;
  __Pyx_Buffer __pyx_pybuffer_counts;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_maxx;
  __Pyx_Buffer __pyx_pybuffer_maxx;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_nobs;
  __Pyx_Buffer __pyx_pybuffer_nobs;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_out;
  __Pyx_Buffer __pyx_pybuffer_out;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_values;
  __Pyx_Buffer __pyx_pybuffer_values;
  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;
  __Pyx_RefNannySetupContext("group_max_bin_float32", 0);
  __pyx_pybuffer_maxx.pybuffer.buf = NULL;
  __pyx_pybuffer_maxx.refcount = 0;
  __pyx_pybuffernd_maxx.data = NULL;
  __pyx_pybuffernd_maxx.rcbuffer = &__pyx_pybuffer_maxx;
  __pyx_pybuffer_nobs.pybuffer.buf = NULL;
  __pyx_pybuffer_nobs.refcount = 0;
  __pyx_pybuffernd_nobs.data = NULL;
  __pyx_pybuffernd_nobs.rcbuffer = &__pyx_pybuffer_nobs;
  __pyx_pybuffer_out.pybuffer.buf = NULL;
  __pyx_pybuffer_out.refcount = 0;
  __pyx_pybuffernd_out.data = NULL;
  __pyx_pybuffernd_out.rcbuffer = &__pyx_pybuffer_out;
  __pyx_pybuffer_counts.pybuffer.buf = NULL;
  __pyx_pybuffer_counts.refcount = 0;
  __pyx_pybuffernd_counts.data = NULL;
  __pyx_pybuffernd_counts.rcbuffer = &__pyx_pybuffer_counts;
  __pyx_pybuffer_values.pybuffer.buf = NULL;
  __pyx_pybuffer_values.refcount = 0;
  __pyx_pybuffernd_values.data = NULL;
  __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values;
  __pyx_pybuffer_bins.pybuffer.buf = NULL;
  __pyx_pybuffer_bins.refcount = 0;
  __pyx_pybuffernd_bins.data = NULL;
  __pyx_pybuffernd_bins.rcbuffer = &__pyx_pybuffer_bins;
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_out.rcbuffer->pybuffer, (PyObject*)__pyx_v_out, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6420; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_out.diminfo[0].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_out.diminfo[0].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_out.diminfo[1].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_out.diminfo[1].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[1];
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_counts.rcbuffer->pybuffer, (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[2]; __pyx_lineno = 6420; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_counts.diminfo[0].strides = __pyx_pybuffernd_counts.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_counts.diminfo[0].shape = __pyx_pybuffernd_counts.rcbuffer->pybuffer.shape[0];
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6420; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_values.diminfo[1].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_values.diminfo[1].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[1];
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_bins.rcbuffer->pybuffer, (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[2]; __pyx_lineno = 6420; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_bins.diminfo[0].strides = __pyx_pybuffernd_bins.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_bins.diminfo[0].shape = __pyx_pybuffernd_bins.rcbuffer->pybuffer.shape[0];

  /* "pandas/src/generated.pyx":6432
 *         ndarray[float32_t, ndim=2] maxx, nobs
 * 
 *     nobs = np.zeros_like(out)             # <<<<<<<<<<<<<<
 *     maxx = np.empty_like(out)
 *     maxx.fill(-np.inf)
 */
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6432; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros_like); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6432; __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[2]; __pyx_lineno = 6432; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__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 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6432; __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 (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6432; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_4 = ((PyArrayObject *)__pyx_t_3);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer);
    __pyx_t_5 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer, (PyObject*)__pyx_t_4, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_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_pybuffernd_nobs.rcbuffer->pybuffer, (PyObject*)__pyx_v_nobs, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_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_pybuffernd_nobs.diminfo[0].strides = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_nobs.diminfo[0].shape = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_nobs.diminfo[1].strides = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_nobs.diminfo[1].shape = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.shape[1];
    if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6432; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_4 = 0;
  __pyx_v_nobs = ((PyArrayObject *)__pyx_t_3);
  __pyx_t_3 = 0;

  /* "pandas/src/generated.pyx":6433
 * 
 *     nobs = np.zeros_like(out)
 *     maxx = np.empty_like(out)             # <<<<<<<<<<<<<<
 *     maxx.fill(-np.inf)
 * 
 */
  __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6433; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_empty_like); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6433; __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[2]; __pyx_lineno = 6433; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__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 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6433; __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;
  if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6433; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_4 = ((PyArrayObject *)__pyx_t_2);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_maxx.rcbuffer->pybuffer);
    __pyx_t_5 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_maxx.rcbuffer->pybuffer, (PyObject*)__pyx_t_4, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_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_pybuffernd_maxx.rcbuffer->pybuffer, (PyObject*)__pyx_v_maxx, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_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_pybuffernd_maxx.diminfo[0].strides = __pyx_pybuffernd_maxx.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_maxx.diminfo[0].shape = __pyx_pybuffernd_maxx.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_maxx.diminfo[1].strides = __pyx_pybuffernd_maxx.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_maxx.diminfo[1].shape = __pyx_pybuffernd_maxx.rcbuffer->pybuffer.shape[1];
    if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6433; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_4 = 0;
  __pyx_v_maxx = ((PyArrayObject *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "pandas/src/generated.pyx":6434
 *     nobs = np.zeros_like(out)
 *     maxx = np.empty_like(out)
 *     maxx.fill(-np.inf)             # <<<<<<<<<<<<<<
 * 
 *     if bins[len(bins) - 1] == len(values):
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_maxx), __pyx_n_s_fill); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6434; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6434; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_inf); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6434; __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[2]; __pyx_lineno = 6434; __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[2]; __pyx_lineno = 6434; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__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 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6434; __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;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "pandas/src/generated.pyx":6436
 *     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[2]; __pyx_lineno = 6436; __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[2]; __pyx_lineno = 6436; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_12 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_bins.rcbuffer->pybuffer.buf, __pyx_t_10, __pyx_pybuffernd_bins.diminfo[0].strides)) == __pyx_t_11) != 0);
  if (__pyx_t_12) {

    /* "pandas/src/generated.pyx":6437
 * 
 *     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[2]; __pyx_lineno = 6437; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_v_ngroups = __pyx_t_11;
    goto __pyx_L3;
  }
  /*else*/ {

    /* "pandas/src/generated.pyx":6439
 *         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[2]; __pyx_lineno = 6439; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_v_ngroups = (__pyx_t_11 + 1);
  }
  __pyx_L3:;

  /* "pandas/src/generated.pyx":6441
 *         ngroups = len(bins) + 1
 * 
 *     N, K = (<object> values).shape             # <<<<<<<<<<<<<<
 * 
 *     b = 0
 */
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_values), __pyx_n_s_shape); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6441; __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 CYTHON_COMPILING_IN_CPYTHON
    Py_ssize_t size = Py_SIZE(sequence);
    #else
    Py_ssize_t size = PySequence_Size(sequence);
    #endif
    if (unlikely(size != 2)) {
      if (size > 2) __Pyx_RaiseTooManyValuesError(2);
      else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
      {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6441; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    #if CYTHON_COMPILING_IN_CPYTHON
    if (likely(PyTuple_CheckExact(sequence))) {
      __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0); 
      __pyx_t_2 = PyTuple_GET_ITEM(sequence, 1); 
    } else {
      __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);
    #else
    __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6441; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6441; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    #endif
    __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[2]; __pyx_lineno = 6441; __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_L4_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_L4_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_2);
    if (__Pyx_IternextUnpackEndCheck(__pyx_t_14(__pyx_t_13), 2) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6441; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_14 = NULL;
    __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
    goto __pyx_L5_unpacking_done;
    __pyx_L4_unpacking_failed:;
    __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
    __pyx_t_14 = NULL;
    if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
    {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6441; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_L5_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[2]; __pyx_lineno = 6441; __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[2]; __pyx_lineno = 6441; __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;

  /* "pandas/src/generated.pyx":6443
 *     N, K = (<object> values).shape
 * 
 *     b = 0             # <<<<<<<<<<<<<<
 *     if K > 1:
 *         for i in range(N):
 */
  __pyx_v_b = 0;

  /* "pandas/src/generated.pyx":6444
 * 
 *     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) != 0);
  if (__pyx_t_12) {

    /* "pandas/src/generated.pyx":6445
 *     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;

      /* "pandas/src/generated.pyx":6446
 *     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)) != 0);
        if (__pyx_t_12) {
          __pyx_t_15 = __pyx_v_b;
          __pyx_t_16 = ((__pyx_v_i >= (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_bins.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_bins.diminfo[0].strides))) != 0);
          __pyx_t_17 = __pyx_t_16;
        } else {
          __pyx_t_17 = __pyx_t_12;
        }
        if (!__pyx_t_17) break;

        /* "pandas/src/generated.pyx":6447
 *         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);
      }

      /* "pandas/src/generated.pyx":6449
 *                 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_pybuffernd_counts.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_counts.diminfo[0].strides) += 1;

      /* "pandas/src/generated.pyx":6450
 * 
 *             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;

        /* "pandas/src/generated.pyx":6451
 *             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_float32_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_values.diminfo[0].strides, __pyx_t_22, __pyx_pybuffernd_values.diminfo[1].strides));

        /* "pandas/src/generated.pyx":6454
 * 
 *                 # not nan
 *                 if val == val:             # <<<<<<<<<<<<<<
 *                     nobs[b, j] += 1
 *                     if val > maxx[b, j]:
 */
        __pyx_t_17 = ((__pyx_v_val == __pyx_v_val) != 0);
        if (__pyx_t_17) {

          /* "pandas/src/generated.pyx":6455
 *                 # 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_float32_t *, __pyx_pybuffernd_nobs.rcbuffer->pybuffer.buf, __pyx_t_23, __pyx_pybuffernd_nobs.diminfo[0].strides, __pyx_t_24, __pyx_pybuffernd_nobs.diminfo[1].strides) += 1.0;

          /* "pandas/src/generated.pyx":6456
 *                 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_float32_t *, __pyx_pybuffernd_maxx.rcbuffer->pybuffer.buf, __pyx_t_25, __pyx_pybuffernd_maxx.diminfo[0].strides, __pyx_t_26, __pyx_pybuffernd_maxx.diminfo[1].strides))) != 0);
          if (__pyx_t_17) {

            /* "pandas/src/generated.pyx":6457
 *                     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_float32_t *, __pyx_pybuffernd_maxx.rcbuffer->pybuffer.buf, __pyx_t_27, __pyx_pybuffernd_maxx.diminfo[0].strides, __pyx_t_28, __pyx_pybuffernd_maxx.diminfo[1].strides) = __pyx_v_val;
            goto __pyx_L14;
          }
          __pyx_L14:;
          goto __pyx_L13;
        }
        __pyx_L13:;
      }
    }
    goto __pyx_L6;
  }
  /*else*/ {

    /* "pandas/src/generated.pyx":6459
 *                         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;

      /* "pandas/src/generated.pyx":6460
 *     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)) != 0);
        if (__pyx_t_17) {
          __pyx_t_19 = __pyx_v_b;
          __pyx_t_12 = ((__pyx_v_i >= (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_bins.rcbuffer->pybuffer.buf, __pyx_t_19, __pyx_pybuffernd_bins.diminfo[0].strides))) != 0);
          __pyx_t_16 = __pyx_t_12;
        } else {
          __pyx_t_16 = __pyx_t_17;
        }
        if (!__pyx_t_16) break;

        /* "pandas/src/generated.pyx":6461
 *         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);
      }

      /* "pandas/src/generated.pyx":6463
 *                 b += 1
 * 
 *             counts[b] += 1             # <<<<<<<<<<<<<<
 *             val = values[i, 0]
 * 
 */
      __pyx_t_20 = __pyx_v_b;
      *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_counts.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_counts.diminfo[0].strides) += 1;

      /* "pandas/src/generated.pyx":6464
 * 
 *             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_float32_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_29, __pyx_pybuffernd_values.diminfo[0].strides, __pyx_t_30, __pyx_pybuffernd_values.diminfo[1].strides));

      /* "pandas/src/generated.pyx":6467
 * 
 *             # not nan
 *             if val == val:             # <<<<<<<<<<<<<<
 *                 nobs[b, 0] += 1
 *                 if val > maxx[b, 0]:
 */
      __pyx_t_16 = ((__pyx_v_val == __pyx_v_val) != 0);
      if (__pyx_t_16) {

        /* "pandas/src/generated.pyx":6468
 *             # 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_float32_t *, __pyx_pybuffernd_nobs.rcbuffer->pybuffer.buf, __pyx_t_31, __pyx_pybuffernd_nobs.diminfo[0].strides, __pyx_t_32, __pyx_pybuffernd_nobs.diminfo[1].strides) += 1.0;

        /* "pandas/src/generated.pyx":6469
 *             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_float32_t *, __pyx_pybuffernd_maxx.rcbuffer->pybuffer.buf, __pyx_t_33, __pyx_pybuffernd_maxx.diminfo[0].strides, __pyx_t_34, __pyx_pybuffernd_maxx.diminfo[1].strides))) != 0);
        if (__pyx_t_16) {

          /* "pandas/src/generated.pyx":6470
 *                 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_float32_t *, __pyx_pybuffernd_maxx.rcbuffer->pybuffer.buf, __pyx_t_35, __pyx_pybuffernd_maxx.diminfo[0].strides, __pyx_t_36, __pyx_pybuffernd_maxx.diminfo[1].strides) = __pyx_v_val;
          goto __pyx_L20;
        }
        __pyx_L20:;
        goto __pyx_L19;
      }
      __pyx_L19:;
    }
  }
  __pyx_L6:;

  /* "pandas/src/generated.pyx":6472
 *                     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;

    /* "pandas/src/generated.pyx":6473
 * 
 *     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;

      /* "pandas/src/generated.pyx":6474
 *     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_float32_t *, __pyx_pybuffernd_nobs.rcbuffer->pybuffer.buf, __pyx_t_39, __pyx_pybuffernd_nobs.diminfo[0].strides, __pyx_t_40, __pyx_pybuffernd_nobs.diminfo[1].strides)) == 0.0) != 0);
      if (__pyx_t_16) {

        /* "pandas/src/generated.pyx":6475
 *         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_float32_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_41, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_42, __pyx_pybuffernd_out.diminfo[1].strides) = __pyx_v_6pandas_5algos_nan;
        goto __pyx_L25;
      }
      /*else*/ {

        /* "pandas/src/generated.pyx":6477
 *                 out[i, j] = nan
 *             else:
 *                 out[i, j] = maxx[i, j]             # <<<<<<<<<<<<<<
 * 
 * @cython.wraparound(False)
 */
        __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_float32_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_45, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_46, __pyx_pybuffernd_out.diminfo[1].strides) = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_maxx.rcbuffer->pybuffer.buf, __pyx_t_43, __pyx_pybuffernd_maxx.diminfo[0].strides, __pyx_t_44, __pyx_pybuffernd_maxx.diminfo[1].strides));
      }
      __pyx_L25:;
    }
  }

  /* "pandas/src/generated.pyx":6420
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def group_max_bin_float32(ndarray[float32_t, ndim=2] out,             # <<<<<<<<<<<<<<
 *                   ndarray[int64_t] counts,
 *                   ndarray[float32_t, ndim=2] values,
 */

  /* function exit code */
  __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_pybuffernd_bins.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_counts.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_maxx.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas.algos.group_max_bin_float32", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_bins.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_counts.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_maxx.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer);
  __pyx_L2:;
  __Pyx_XDECREF((PyObject *)__pyx_v_maxx);
  __Pyx_XDECREF((PyObject *)__pyx_v_nobs);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/src/generated.pyx":6481
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def group_ohlc_float64(ndarray[float64_t, ndim=2] out,             # <<<<<<<<<<<<<<
 *                   ndarray[int64_t] counts,
 *                   ndarray[float64_t, ndim=2] values,
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pandas_5algos_451group_ohlc_float64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6pandas_5algos_450group_ohlc_float64[] = "\n    Only aggregates on axis=0\n    ";
static PyMethodDef __pyx_mdef_6pandas_5algos_451group_ohlc_float64 = {__Pyx_NAMESTR("group_ohlc_float64"), (PyCFunction)__pyx_pw_6pandas_5algos_451group_ohlc_float64, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6pandas_5algos_450group_ohlc_float64)};
static PyObject *__pyx_pw_6pandas_5algos_451group_ohlc_float64(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;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("group_ohlc_float64 (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_out,&__pyx_n_s_counts,&__pyx_n_s_values,&__pyx_n_s_bins,0};
    PyObject* values[4] = {0,0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_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 (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_out)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_counts)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("group_ohlc_float64", 1, 4, 4, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6481; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("group_ohlc_float64", 1, 4, 4, 2); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6481; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  3:
        if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_bins)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("group_ohlc_float64", 1, 4, 4, 3); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6481; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "group_ohlc_float64") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6481; __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_float64", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6481; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas.algos.group_ohlc_float64", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_out), __pyx_ptype_5numpy_ndarray, 1, "out", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6481; __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[2]; __pyx_lineno = 6482; __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[2]; __pyx_lineno = 6483; __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[2]; __pyx_lineno = 6484; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_450group_ohlc_float64(__pyx_self, __pyx_v_out, __pyx_v_counts, __pyx_v_values, __pyx_v_bins);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pandas_5algos_450group_ohlc_float64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_out, PyArrayObject *__pyx_v_counts, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_bins) {
  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;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_bins;
  __Pyx_Buffer __pyx_pybuffer_bins;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_counts;
  __Pyx_Buffer __pyx_pybuffer_counts;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_out;
  __Pyx_Buffer __pyx_pybuffer_out;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_values;
  __Pyx_Buffer __pyx_pybuffer_values;
  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;
  __Pyx_RefNannySetupContext("group_ohlc_float64", 0);
  __pyx_pybuffer_out.pybuffer.buf = NULL;
  __pyx_pybuffer_out.refcount = 0;
  __pyx_pybuffernd_out.data = NULL;
  __pyx_pybuffernd_out.rcbuffer = &__pyx_pybuffer_out;
  __pyx_pybuffer_counts.pybuffer.buf = NULL;
  __pyx_pybuffer_counts.refcount = 0;
  __pyx_pybuffernd_counts.data = NULL;
  __pyx_pybuffernd_counts.rcbuffer = &__pyx_pybuffer_counts;
  __pyx_pybuffer_values.pybuffer.buf = NULL;
  __pyx_pybuffer_values.refcount = 0;
  __pyx_pybuffernd_values.data = NULL;
  __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values;
  __pyx_pybuffer_bins.pybuffer.buf = NULL;
  __pyx_pybuffer_bins.refcount = 0;
  __pyx_pybuffernd_bins.data = NULL;
  __pyx_pybuffernd_bins.rcbuffer = &__pyx_pybuffer_bins;
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_out.rcbuffer->pybuffer, (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[2]; __pyx_lineno = 6481; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_out.diminfo[0].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_out.diminfo[0].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_out.diminfo[1].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_out.diminfo[1].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[1];
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_counts.rcbuffer->pybuffer, (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[2]; __pyx_lineno = 6481; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_counts.diminfo[0].strides = __pyx_pybuffernd_counts.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_counts.diminfo[0].shape = __pyx_pybuffernd_counts.rcbuffer->pybuffer.shape[0];
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (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[2]; __pyx_lineno = 6481; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_values.diminfo[1].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_values.diminfo[1].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[1];
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_bins.rcbuffer->pybuffer, (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[2]; __pyx_lineno = 6481; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_bins.diminfo[0].strides = __pyx_pybuffernd_bins.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_bins.diminfo[0].shape = __pyx_pybuffernd_bins.rcbuffer->pybuffer.shape[0];

  /* "pandas/src/generated.pyx":6492
 *         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;

  /* "pandas/src/generated.pyx":6494
 *         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[2]; __pyx_lineno = 6494; __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[2]; __pyx_lineno = 6494; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_4 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_bins.rcbuffer->pybuffer.buf, __pyx_t_2, __pyx_pybuffernd_bins.diminfo[0].strides)) == __pyx_t_3) != 0);
  if (__pyx_t_4) {

    /* "pandas/src/generated.pyx":6495
 * 
 *     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[2]; __pyx_lineno = 6495; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_v_ngroups = __pyx_t_3;
    goto __pyx_L3;
  }
  /*else*/ {

    /* "pandas/src/generated.pyx":6497
 *         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[2]; __pyx_lineno = 6497; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_v_ngroups = (__pyx_t_3 + 1);
  }
  __pyx_L3:;

  /* "pandas/src/generated.pyx":6499
 *         ngroups = len(bins) + 1
 * 
 *     N, K = (<object> values).shape             # <<<<<<<<<<<<<<
 * 
 *     if out.shape[1] != 4:
 */
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_values), __pyx_n_s_shape); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6499; __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 CYTHON_COMPILING_IN_CPYTHON
    Py_ssize_t size = Py_SIZE(sequence);
    #else
    Py_ssize_t size = PySequence_Size(sequence);
    #endif
    if (unlikely(size != 2)) {
      if (size > 2) __Pyx_RaiseTooManyValuesError(2);
      else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
      {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6499; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    #if CYTHON_COMPILING_IN_CPYTHON
    if (likely(PyTuple_CheckExact(sequence))) {
      __pyx_t_6 = PyTuple_GET_ITEM(sequence, 0); 
      __pyx_t_7 = PyTuple_GET_ITEM(sequence, 1); 
    } else {
      __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);
    #else
    __pyx_t_6 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6499; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_7 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6499; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_7);
    #endif
    __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[2]; __pyx_lineno = 6499; __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_L4_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_L4_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_7);
    if (__Pyx_IternextUnpackEndCheck(__pyx_t_9(__pyx_t_8), 2) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6499; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_9 = NULL;
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    goto __pyx_L5_unpacking_done;
    __pyx_L4_unpacking_failed:;
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __pyx_t_9 = NULL;
    if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
    {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6499; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_L5_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[2]; __pyx_lineno = 6499; __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[2]; __pyx_lineno = 6499; __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;

  /* "pandas/src/generated.pyx":6501
 *     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) != 0);
  if (__pyx_t_4) {

    /* "pandas/src/generated.pyx":6502
 * 
 *     if out.shape[1] != 4:
 *         raise ValueError('Output array must have 4 columns')             # <<<<<<<<<<<<<<
 * 
 *     NA = np.nan
 */
    __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__208, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6502; __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[2]; __pyx_lineno = 6502; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }

  /* "pandas/src/generated.pyx":6504
 *         raise ValueError('Output array must have 4 columns')
 * 
 *     NA = np.nan             # <<<<<<<<<<<<<<
 * 
 *     b = 0
 */
  __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6504; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_nan); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6504; __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[2]; __pyx_lineno = 6504; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __pyx_v_NA = __pyx_t_10;

  /* "pandas/src/generated.pyx":6506
 *     NA = np.nan
 * 
 *     b = 0             # <<<<<<<<<<<<<<
 *     if K > 1:
 *         raise NotImplementedError
 */
  __pyx_v_b = 0;

  /* "pandas/src/generated.pyx":6507
 * 
 *     b = 0
 *     if K > 1:             # <<<<<<<<<<<<<<
 *         raise NotImplementedError
 *     else:
 */
  __pyx_t_4 = ((__pyx_v_K > 1) != 0);
  if (__pyx_t_4) {

    /* "pandas/src/generated.pyx":6508
 *     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[2]; __pyx_lineno = 6508; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  /*else*/ {

    /* "pandas/src/generated.pyx":6510
 *         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;

      /* "pandas/src/generated.pyx":6511
 *     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)) != 0);
        if (__pyx_t_4) {
          __pyx_t_11 = __pyx_v_b;
          __pyx_t_12 = ((__pyx_v_i >= (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_bins.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_bins.diminfo[0].strides))) != 0);
          __pyx_t_13 = __pyx_t_12;
        } else {
          __pyx_t_13 = __pyx_t_4;
        }
        if (!__pyx_t_13) break;

        /* "pandas/src/generated.pyx":6512
 *         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 != 0)) != 0);
        if (__pyx_t_13) {

          /* "pandas/src/generated.pyx":6513
 *             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_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_15, __pyx_pybuffernd_out.diminfo[1].strides) = __pyx_v_NA;

          /* "pandas/src/generated.pyx":6514
 *                 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_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_17, __pyx_pybuffernd_out.diminfo[1].strides) = __pyx_v_NA;

          /* "pandas/src/generated.pyx":6515
 *                     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_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_19, __pyx_pybuffernd_out.diminfo[1].strides) = __pyx_v_NA;

          /* "pandas/src/generated.pyx":6516
 *                     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_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_21, __pyx_pybuffernd_out.diminfo[1].strides) = __pyx_v_NA;
          goto __pyx_L12;
        }
        /*else*/ {

          /* "pandas/src/generated.pyx":6518
 *                     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_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_22, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_23, __pyx_pybuffernd_out.diminfo[1].strides) = __pyx_v_vopen;

          /* "pandas/src/generated.pyx":6519
 *                 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_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_24, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_25, __pyx_pybuffernd_out.diminfo[1].strides) = __pyx_v_vhigh;

          /* "pandas/src/generated.pyx":6520
 *                     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_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_26, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_27, __pyx_pybuffernd_out.diminfo[1].strides) = __pyx_v_vlow;

          /* "pandas/src/generated.pyx":6521
 *                     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_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_28, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_29, __pyx_pybuffernd_out.diminfo[1].strides) = __pyx_v_vclose;
        }
        __pyx_L12:;

        /* "pandas/src/generated.pyx":6522
 *                     out[b, 2] = vlow
 *                     out[b, 3] = vclose
 *                 b += 1             # <<<<<<<<<<<<<<
 *                 got_first = 0
 * 
 */
        __pyx_v_b = (__pyx_v_b + 1);

        /* "pandas/src/generated.pyx":6523
 *                     out[b, 3] = vclose
 *                 b += 1
 *                 got_first = 0             # <<<<<<<<<<<<<<
 * 
 *             counts[b] += 1
 */
        __pyx_v_got_first = 0;
      }

      /* "pandas/src/generated.pyx":6525
 *                 got_first = 0
 * 
 *             counts[b] += 1             # <<<<<<<<<<<<<<
 *             val = values[i, 0]
 * 
 */
      __pyx_t_30 = __pyx_v_b;
      *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_counts.rcbuffer->pybuffer.buf, __pyx_t_30, __pyx_pybuffernd_counts.diminfo[0].strides) += 1;

      /* "pandas/src/generated.pyx":6526
 * 
 *             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_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_31, __pyx_pybuffernd_values.diminfo[0].strides, __pyx_t_32, __pyx_pybuffernd_values.diminfo[1].strides));

      /* "pandas/src/generated.pyx":6529
 * 
 *             # not nan
 *             if val == val:             # <<<<<<<<<<<<<<
 *                 if not got_first:
 *                     got_first = 1
 */
      __pyx_t_13 = ((__pyx_v_val == __pyx_v_val) != 0);
      if (__pyx_t_13) {

        /* "pandas/src/generated.pyx":6530
 *             # not nan
 *             if val == val:
 *                 if not got_first:             # <<<<<<<<<<<<<<
 *                     got_first = 1
 *                     vopen = val
 */
        __pyx_t_13 = ((!(__pyx_v_got_first != 0)) != 0);
        if (__pyx_t_13) {

          /* "pandas/src/generated.pyx":6531
 *             if val == val:
 *                 if not got_first:
 *                     got_first = 1             # <<<<<<<<<<<<<<
 *                     vopen = val
 *                     vlow = val
 */
          __pyx_v_got_first = 1;

          /* "pandas/src/generated.pyx":6532
 *                 if not got_first:
 *                     got_first = 1
 *                     vopen = val             # <<<<<<<<<<<<<<
 *                     vlow = val
 *                     vhigh = val
 */
          __pyx_v_vopen = __pyx_v_val;

          /* "pandas/src/generated.pyx":6533
 *                     got_first = 1
 *                     vopen = val
 *                     vlow = val             # <<<<<<<<<<<<<<
 *                     vhigh = val
 *                 else:
 */
          __pyx_v_vlow = __pyx_v_val;

          /* "pandas/src/generated.pyx":6534
 *                     vopen = val
 *                     vlow = val
 *                     vhigh = val             # <<<<<<<<<<<<<<
 *                 else:
 *                     if val < vlow:
 */
          __pyx_v_vhigh = __pyx_v_val;
          goto __pyx_L14;
        }
        /*else*/ {

          /* "pandas/src/generated.pyx":6536
 *                     vhigh = val
 *                 else:
 *                     if val < vlow:             # <<<<<<<<<<<<<<
 *                         vlow = val
 *                     if val > vhigh:
 */
          __pyx_t_13 = ((__pyx_v_val < __pyx_v_vlow) != 0);
          if (__pyx_t_13) {

            /* "pandas/src/generated.pyx":6537
 *                 else:
 *                     if val < vlow:
 *                         vlow = val             # <<<<<<<<<<<<<<
 *                     if val > vhigh:
 *                         vhigh = val
 */
            __pyx_v_vlow = __pyx_v_val;
            goto __pyx_L15;
          }
          __pyx_L15:;

          /* "pandas/src/generated.pyx":6538
 *                     if val < vlow:
 *                         vlow = val
 *                     if val > vhigh:             # <<<<<<<<<<<<<<
 *                         vhigh = val
 *                 vclose = val
 */
          __pyx_t_13 = ((__pyx_v_val > __pyx_v_vhigh) != 0);
          if (__pyx_t_13) {

            /* "pandas/src/generated.pyx":6539
 *                         vlow = val
 *                     if val > vhigh:
 *                         vhigh = val             # <<<<<<<<<<<<<<
 *                 vclose = val
 * 
 */
            __pyx_v_vhigh = __pyx_v_val;
            goto __pyx_L16;
          }
          __pyx_L16:;
        }
        __pyx_L14:;

        /* "pandas/src/generated.pyx":6540
 *                     if val > vhigh:
 *                         vhigh = val
 *                 vclose = val             # <<<<<<<<<<<<<<
 * 
 *         if not got_first:
 */
        __pyx_v_vclose = __pyx_v_val;
        goto __pyx_L13;
      }
      __pyx_L13:;
    }

    /* "pandas/src/generated.pyx":6542
 *                 vclose = val
 * 
 *         if not got_first:             # <<<<<<<<<<<<<<
 *             out[b, 0] = NA
 *             out[b, 1] = NA
 */
    __pyx_t_13 = ((!(__pyx_v_got_first != 0)) != 0);
    if (__pyx_t_13) {

      /* "pandas/src/generated.pyx":6543
 * 
 *         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_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_1, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_33, __pyx_pybuffernd_out.diminfo[1].strides) = __pyx_v_NA;

      /* "pandas/src/generated.pyx":6544
 *         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_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_3, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_34, __pyx_pybuffernd_out.diminfo[1].strides) = __pyx_v_NA;

      /* "pandas/src/generated.pyx":6545
 *             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_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_35, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_36, __pyx_pybuffernd_out.diminfo[1].strides) = __pyx_v_NA;

      /* "pandas/src/generated.pyx":6546
 *             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_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_37, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_38, __pyx_pybuffernd_out.diminfo[1].strides) = __pyx_v_NA;
      goto __pyx_L17;
    }
    /*else*/ {

      /* "pandas/src/generated.pyx":6548
 *             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_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_39, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_40, __pyx_pybuffernd_out.diminfo[1].strides) = __pyx_v_vopen;

      /* "pandas/src/generated.pyx":6549
 *         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_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_41, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_42, __pyx_pybuffernd_out.diminfo[1].strides) = __pyx_v_vhigh;

      /* "pandas/src/generated.pyx":6550
 *             out[b, 0] = vopen
 *             out[b, 1] = vhigh
 *             out[b, 2] = vlow             # <<<<<<<<<<<<<<
 *             out[b, 3] = vclose
 * @cython.wraparound(False)
 */
      __pyx_t_43 = __pyx_v_b;
      __pyx_t_44 = 2;
      *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_43, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_44, __pyx_pybuffernd_out.diminfo[1].strides) = __pyx_v_vlow;

      /* "pandas/src/generated.pyx":6551
 *             out[b, 1] = vhigh
 *             out[b, 2] = vlow
 *             out[b, 3] = vclose             # <<<<<<<<<<<<<<
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 */
      __pyx_t_45 = __pyx_v_b;
      __pyx_t_46 = 3;
      *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_45, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_46, __pyx_pybuffernd_out.diminfo[1].strides) = __pyx_v_vclose;
    }
    __pyx_L17:;
  }

  /* "pandas/src/generated.pyx":6481
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def group_ohlc_float64(ndarray[float64_t, ndim=2] out,             # <<<<<<<<<<<<<<
 *                   ndarray[int64_t] counts,
 *                   ndarray[float64_t, ndim=2] values,
 */

  /* function exit code */
  __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_pybuffernd_bins.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_counts.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas.algos.group_ohlc_float64", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_bins.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_counts.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer);
  __pyx_L2:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/src/generated.pyx":6554
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def group_ohlc_float32(ndarray[float32_t, ndim=2] out,             # <<<<<<<<<<<<<<
 *                   ndarray[int64_t] counts,
 *                   ndarray[float32_t, ndim=2] values,
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pandas_5algos_453group_ohlc_float32(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6pandas_5algos_452group_ohlc_float32[] = "\n    Only aggregates on axis=0\n    ";
static PyMethodDef __pyx_mdef_6pandas_5algos_453group_ohlc_float32 = {__Pyx_NAMESTR("group_ohlc_float32"), (PyCFunction)__pyx_pw_6pandas_5algos_453group_ohlc_float32, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6pandas_5algos_452group_ohlc_float32)};
static PyObject *__pyx_pw_6pandas_5algos_453group_ohlc_float32(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;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("group_ohlc_float32 (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_out,&__pyx_n_s_counts,&__pyx_n_s_values,&__pyx_n_s_bins,0};
    PyObject* values[4] = {0,0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_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 (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_out)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_counts)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("group_ohlc_float32", 1, 4, 4, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6554; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("group_ohlc_float32", 1, 4, 4, 2); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6554; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  3:
        if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_bins)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("group_ohlc_float32", 1, 4, 4, 3); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6554; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "group_ohlc_float32") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6554; __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_float32", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6554; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas.algos.group_ohlc_float32", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_out), __pyx_ptype_5numpy_ndarray, 1, "out", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6554; __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[2]; __pyx_lineno = 6555; __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[2]; __pyx_lineno = 6556; __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[2]; __pyx_lineno = 6557; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_452group_ohlc_float32(__pyx_self, __pyx_v_out, __pyx_v_counts, __pyx_v_values, __pyx_v_bins);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pandas_5algos_452group_ohlc_float32(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_out, PyArrayObject *__pyx_v_counts, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_bins) {
  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_float32_t __pyx_v_val;
  __pyx_t_5numpy_float32_t __pyx_v_vopen;
  __pyx_t_5numpy_float32_t __pyx_v_vhigh;
  __pyx_t_5numpy_float32_t __pyx_v_vlow;
  __pyx_t_5numpy_float32_t __pyx_v_vclose;
  __pyx_t_5numpy_float32_t __pyx_v_NA;
  int __pyx_v_got_first;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_bins;
  __Pyx_Buffer __pyx_pybuffer_bins;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_counts;
  __Pyx_Buffer __pyx_pybuffer_counts;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_out;
  __Pyx_Buffer __pyx_pybuffer_out;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_values;
  __Pyx_Buffer __pyx_pybuffer_values;
  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_float32_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;
  __Pyx_RefNannySetupContext("group_ohlc_float32", 0);
  __pyx_pybuffer_out.pybuffer.buf = NULL;
  __pyx_pybuffer_out.refcount = 0;
  __pyx_pybuffernd_out.data = NULL;
  __pyx_pybuffernd_out.rcbuffer = &__pyx_pybuffer_out;
  __pyx_pybuffer_counts.pybuffer.buf = NULL;
  __pyx_pybuffer_counts.refcount = 0;
  __pyx_pybuffernd_counts.data = NULL;
  __pyx_pybuffernd_counts.rcbuffer = &__pyx_pybuffer_counts;
  __pyx_pybuffer_values.pybuffer.buf = NULL;
  __pyx_pybuffer_values.refcount = 0;
  __pyx_pybuffernd_values.data = NULL;
  __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values;
  __pyx_pybuffer_bins.pybuffer.buf = NULL;
  __pyx_pybuffer_bins.refcount = 0;
  __pyx_pybuffernd_bins.data = NULL;
  __pyx_pybuffernd_bins.rcbuffer = &__pyx_pybuffer_bins;
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_out.rcbuffer->pybuffer, (PyObject*)__pyx_v_out, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6554; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_out.diminfo[0].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_out.diminfo[0].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_out.diminfo[1].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_out.diminfo[1].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[1];
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_counts.rcbuffer->pybuffer, (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[2]; __pyx_lineno = 6554; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_counts.diminfo[0].strides = __pyx_pybuffernd_counts.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_counts.diminfo[0].shape = __pyx_pybuffernd_counts.rcbuffer->pybuffer.shape[0];
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6554; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_values.diminfo[1].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_values.diminfo[1].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[1];
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_bins.rcbuffer->pybuffer, (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[2]; __pyx_lineno = 6554; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_bins.diminfo[0].strides = __pyx_pybuffernd_bins.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_bins.diminfo[0].shape = __pyx_pybuffernd_bins.rcbuffer->pybuffer.shape[0];

  /* "pandas/src/generated.pyx":6565
 *         float32_t val, count
 *         float32_t vopen, vhigh, vlow, vclose, NA
 *         bint got_first = 0             # <<<<<<<<<<<<<<
 * 
 *     if bins[len(bins) - 1] == len(values):
 */
  __pyx_v_got_first = 0;

  /* "pandas/src/generated.pyx":6567
 *         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[2]; __pyx_lineno = 6567; __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[2]; __pyx_lineno = 6567; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_4 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_bins.rcbuffer->pybuffer.buf, __pyx_t_2, __pyx_pybuffernd_bins.diminfo[0].strides)) == __pyx_t_3) != 0);
  if (__pyx_t_4) {

    /* "pandas/src/generated.pyx":6568
 * 
 *     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[2]; __pyx_lineno = 6568; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_v_ngroups = __pyx_t_3;
    goto __pyx_L3;
  }
  /*else*/ {

    /* "pandas/src/generated.pyx":6570
 *         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[2]; __pyx_lineno = 6570; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_v_ngroups = (__pyx_t_3 + 1);
  }
  __pyx_L3:;

  /* "pandas/src/generated.pyx":6572
 *         ngroups = len(bins) + 1
 * 
 *     N, K = (<object> values).shape             # <<<<<<<<<<<<<<
 * 
 *     if out.shape[1] != 4:
 */
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_values), __pyx_n_s_shape); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6572; __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 CYTHON_COMPILING_IN_CPYTHON
    Py_ssize_t size = Py_SIZE(sequence);
    #else
    Py_ssize_t size = PySequence_Size(sequence);
    #endif
    if (unlikely(size != 2)) {
      if (size > 2) __Pyx_RaiseTooManyValuesError(2);
      else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
      {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6572; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    #if CYTHON_COMPILING_IN_CPYTHON
    if (likely(PyTuple_CheckExact(sequence))) {
      __pyx_t_6 = PyTuple_GET_ITEM(sequence, 0); 
      __pyx_t_7 = PyTuple_GET_ITEM(sequence, 1); 
    } else {
      __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);
    #else
    __pyx_t_6 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6572; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_7 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6572; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_7);
    #endif
    __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[2]; __pyx_lineno = 6572; __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_L4_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_L4_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_7);
    if (__Pyx_IternextUnpackEndCheck(__pyx_t_9(__pyx_t_8), 2) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6572; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_9 = NULL;
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    goto __pyx_L5_unpacking_done;
    __pyx_L4_unpacking_failed:;
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __pyx_t_9 = NULL;
    if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
    {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6572; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_L5_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[2]; __pyx_lineno = 6572; __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[2]; __pyx_lineno = 6572; __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;

  /* "pandas/src/generated.pyx":6574
 *     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) != 0);
  if (__pyx_t_4) {

    /* "pandas/src/generated.pyx":6575
 * 
 *     if out.shape[1] != 4:
 *         raise ValueError('Output array must have 4 columns')             # <<<<<<<<<<<<<<
 * 
 *     NA = np.nan
 */
    __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__209, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6575; __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[2]; __pyx_lineno = 6575; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }

  /* "pandas/src/generated.pyx":6577
 *         raise ValueError('Output array must have 4 columns')
 * 
 *     NA = np.nan             # <<<<<<<<<<<<<<
 * 
 *     b = 0
 */
  __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6577; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_nan); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6577; __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_AsFloat(__pyx_t_7); if (unlikely((__pyx_t_10 == (npy_float32)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6577; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __pyx_v_NA = __pyx_t_10;

  /* "pandas/src/generated.pyx":6579
 *     NA = np.nan
 * 
 *     b = 0             # <<<<<<<<<<<<<<
 *     if K > 1:
 *         raise NotImplementedError
 */
  __pyx_v_b = 0;

  /* "pandas/src/generated.pyx":6580
 * 
 *     b = 0
 *     if K > 1:             # <<<<<<<<<<<<<<
 *         raise NotImplementedError
 *     else:
 */
  __pyx_t_4 = ((__pyx_v_K > 1) != 0);
  if (__pyx_t_4) {

    /* "pandas/src/generated.pyx":6581
 *     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[2]; __pyx_lineno = 6581; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  /*else*/ {

    /* "pandas/src/generated.pyx":6583
 *         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;

      /* "pandas/src/generated.pyx":6584
 *     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)) != 0);
        if (__pyx_t_4) {
          __pyx_t_11 = __pyx_v_b;
          __pyx_t_12 = ((__pyx_v_i >= (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_bins.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_bins.diminfo[0].strides))) != 0);
          __pyx_t_13 = __pyx_t_12;
        } else {
          __pyx_t_13 = __pyx_t_4;
        }
        if (!__pyx_t_13) break;

        /* "pandas/src/generated.pyx":6585
 *         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 != 0)) != 0);
        if (__pyx_t_13) {

          /* "pandas/src/generated.pyx":6586
 *             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_float32_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_15, __pyx_pybuffernd_out.diminfo[1].strides) = __pyx_v_NA;

          /* "pandas/src/generated.pyx":6587
 *                 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_float32_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_17, __pyx_pybuffernd_out.diminfo[1].strides) = __pyx_v_NA;

          /* "pandas/src/generated.pyx":6588
 *                     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_float32_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_19, __pyx_pybuffernd_out.diminfo[1].strides) = __pyx_v_NA;

          /* "pandas/src/generated.pyx":6589
 *                     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_float32_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_21, __pyx_pybuffernd_out.diminfo[1].strides) = __pyx_v_NA;
          goto __pyx_L12;
        }
        /*else*/ {

          /* "pandas/src/generated.pyx":6591
 *                     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_float32_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_22, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_23, __pyx_pybuffernd_out.diminfo[1].strides) = __pyx_v_vopen;

          /* "pandas/src/generated.pyx":6592
 *                 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_float32_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_24, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_25, __pyx_pybuffernd_out.diminfo[1].strides) = __pyx_v_vhigh;

          /* "pandas/src/generated.pyx":6593
 *                     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_float32_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_26, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_27, __pyx_pybuffernd_out.diminfo[1].strides) = __pyx_v_vlow;

          /* "pandas/src/generated.pyx":6594
 *                     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_float32_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_28, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_29, __pyx_pybuffernd_out.diminfo[1].strides) = __pyx_v_vclose;
        }
        __pyx_L12:;

        /* "pandas/src/generated.pyx":6595
 *                     out[b, 2] = vlow
 *                     out[b, 3] = vclose
 *                 b += 1             # <<<<<<<<<<<<<<
 *                 got_first = 0
 * 
 */
        __pyx_v_b = (__pyx_v_b + 1);

        /* "pandas/src/generated.pyx":6596
 *                     out[b, 3] = vclose
 *                 b += 1
 *                 got_first = 0             # <<<<<<<<<<<<<<
 * 
 *             counts[b] += 1
 */
        __pyx_v_got_first = 0;
      }

      /* "pandas/src/generated.pyx":6598
 *                 got_first = 0
 * 
 *             counts[b] += 1             # <<<<<<<<<<<<<<
 *             val = values[i, 0]
 * 
 */
      __pyx_t_30 = __pyx_v_b;
      *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_counts.rcbuffer->pybuffer.buf, __pyx_t_30, __pyx_pybuffernd_counts.diminfo[0].strides) += 1;

      /* "pandas/src/generated.pyx":6599
 * 
 *             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_float32_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_31, __pyx_pybuffernd_values.diminfo[0].strides, __pyx_t_32, __pyx_pybuffernd_values.diminfo[1].strides));

      /* "pandas/src/generated.pyx":6602
 * 
 *             # not nan
 *             if val == val:             # <<<<<<<<<<<<<<
 *                 if not got_first:
 *                     got_first = 1
 */
      __pyx_t_13 = ((__pyx_v_val == __pyx_v_val) != 0);
      if (__pyx_t_13) {

        /* "pandas/src/generated.pyx":6603
 *             # not nan
 *             if val == val:
 *                 if not got_first:             # <<<<<<<<<<<<<<
 *                     got_first = 1
 *                     vopen = val
 */
        __pyx_t_13 = ((!(__pyx_v_got_first != 0)) != 0);
        if (__pyx_t_13) {

          /* "pandas/src/generated.pyx":6604
 *             if val == val:
 *                 if not got_first:
 *                     got_first = 1             # <<<<<<<<<<<<<<
 *                     vopen = val
 *                     vlow = val
 */
          __pyx_v_got_first = 1;

          /* "pandas/src/generated.pyx":6605
 *                 if not got_first:
 *                     got_first = 1
 *                     vopen = val             # <<<<<<<<<<<<<<
 *                     vlow = val
 *                     vhigh = val
 */
          __pyx_v_vopen = __pyx_v_val;

          /* "pandas/src/generated.pyx":6606
 *                     got_first = 1
 *                     vopen = val
 *                     vlow = val             # <<<<<<<<<<<<<<
 *                     vhigh = val
 *                 else:
 */
          __pyx_v_vlow = __pyx_v_val;

          /* "pandas/src/generated.pyx":6607
 *                     vopen = val
 *                     vlow = val
 *                     vhigh = val             # <<<<<<<<<<<<<<
 *                 else:
 *                     if val < vlow:
 */
          __pyx_v_vhigh = __pyx_v_val;
          goto __pyx_L14;
        }
        /*else*/ {

          /* "pandas/src/generated.pyx":6609
 *                     vhigh = val
 *                 else:
 *                     if val < vlow:             # <<<<<<<<<<<<<<
 *                         vlow = val
 *                     if val > vhigh:
 */
          __pyx_t_13 = ((__pyx_v_val < __pyx_v_vlow) != 0);
          if (__pyx_t_13) {

            /* "pandas/src/generated.pyx":6610
 *                 else:
 *                     if val < vlow:
 *                         vlow = val             # <<<<<<<<<<<<<<
 *                     if val > vhigh:
 *                         vhigh = val
 */
            __pyx_v_vlow = __pyx_v_val;
            goto __pyx_L15;
          }
          __pyx_L15:;

          /* "pandas/src/generated.pyx":6611
 *                     if val < vlow:
 *                         vlow = val
 *                     if val > vhigh:             # <<<<<<<<<<<<<<
 *                         vhigh = val
 *                 vclose = val
 */
          __pyx_t_13 = ((__pyx_v_val > __pyx_v_vhigh) != 0);
          if (__pyx_t_13) {

            /* "pandas/src/generated.pyx":6612
 *                         vlow = val
 *                     if val > vhigh:
 *                         vhigh = val             # <<<<<<<<<<<<<<
 *                 vclose = val
 * 
 */
            __pyx_v_vhigh = __pyx_v_val;
            goto __pyx_L16;
          }
          __pyx_L16:;
        }
        __pyx_L14:;

        /* "pandas/src/generated.pyx":6613
 *                     if val > vhigh:
 *                         vhigh = val
 *                 vclose = val             # <<<<<<<<<<<<<<
 * 
 *         if not got_first:
 */
        __pyx_v_vclose = __pyx_v_val;
        goto __pyx_L13;
      }
      __pyx_L13:;
    }

    /* "pandas/src/generated.pyx":6615
 *                 vclose = val
 * 
 *         if not got_first:             # <<<<<<<<<<<<<<
 *             out[b, 0] = NA
 *             out[b, 1] = NA
 */
    __pyx_t_13 = ((!(__pyx_v_got_first != 0)) != 0);
    if (__pyx_t_13) {

      /* "pandas/src/generated.pyx":6616
 * 
 *         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_float32_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_1, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_33, __pyx_pybuffernd_out.diminfo[1].strides) = __pyx_v_NA;

      /* "pandas/src/generated.pyx":6617
 *         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_float32_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_3, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_34, __pyx_pybuffernd_out.diminfo[1].strides) = __pyx_v_NA;

      /* "pandas/src/generated.pyx":6618
 *             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_float32_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_35, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_36, __pyx_pybuffernd_out.diminfo[1].strides) = __pyx_v_NA;

      /* "pandas/src/generated.pyx":6619
 *             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_float32_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_37, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_38, __pyx_pybuffernd_out.diminfo[1].strides) = __pyx_v_NA;
      goto __pyx_L17;
    }
    /*else*/ {

      /* "pandas/src/generated.pyx":6621
 *             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_float32_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_39, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_40, __pyx_pybuffernd_out.diminfo[1].strides) = __pyx_v_vopen;

      /* "pandas/src/generated.pyx":6622
 *         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_float32_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_41, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_42, __pyx_pybuffernd_out.diminfo[1].strides) = __pyx_v_vhigh;

      /* "pandas/src/generated.pyx":6623
 *             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_float32_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_43, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_44, __pyx_pybuffernd_out.diminfo[1].strides) = __pyx_v_vlow;

      /* "pandas/src/generated.pyx":6624
 *             out[b, 1] = vhigh
 *             out[b, 2] = vlow
 *             out[b, 3] = vclose             # <<<<<<<<<<<<<<
 * 
 * @cython.boundscheck(False)
 */
      __pyx_t_45 = __pyx_v_b;
      __pyx_t_46 = 3;
      *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_45, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_46, __pyx_pybuffernd_out.diminfo[1].strides) = __pyx_v_vclose;
    }
    __pyx_L17:;
  }

  /* "pandas/src/generated.pyx":6554
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def group_ohlc_float32(ndarray[float32_t, ndim=2] out,             # <<<<<<<<<<<<<<
 *                   ndarray[int64_t] counts,
 *                   ndarray[float32_t, ndim=2] values,
 */

  /* function exit code */
  __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_pybuffernd_bins.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_counts.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas.algos.group_ohlc_float32", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_bins.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_counts.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer);
  __pyx_L2:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/src/generated.pyx":6628
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def group_count_float64(ndarray[float64_t, ndim=2] out,             # <<<<<<<<<<<<<<
 *                          ndarray[int64_t] counts,
 *                          ndarray[float64_t, ndim=2] values,
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pandas_5algos_455group_count_float64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6pandas_5algos_454group_count_float64[] = "\n    Only aggregates on axis=0\n    ";
static PyMethodDef __pyx_mdef_6pandas_5algos_455group_count_float64 = {__Pyx_NAMESTR("group_count_float64"), (PyCFunction)__pyx_pw_6pandas_5algos_455group_count_float64, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6pandas_5algos_454group_count_float64)};
static PyObject *__pyx_pw_6pandas_5algos_455group_count_float64(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;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("group_count_float64 (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_out,&__pyx_n_s_counts,&__pyx_n_s_values,&__pyx_n_s_labels,0};
    PyObject* values[4] = {0,0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_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 (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_out)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_counts)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("group_count_float64", 1, 4, 4, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6628; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("group_count_float64", 1, 4, 4, 2); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6628; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  3:
        if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_labels)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("group_count_float64", 1, 4, 4, 3); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6628; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "group_count_float64") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6628; __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_count_float64", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6628; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas.algos.group_count_float64", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_out), __pyx_ptype_5numpy_ndarray, 1, "out", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6628; __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[2]; __pyx_lineno = 6629; __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[2]; __pyx_lineno = 6630; __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[2]; __pyx_lineno = 6631; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_454group_count_float64(__pyx_self, __pyx_v_out, __pyx_v_counts, __pyx_v_values, __pyx_v_labels);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pandas_5algos_454group_count_float64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_out, PyArrayObject *__pyx_v_counts, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_labels) {
  Py_ssize_t __pyx_v_i;
  Py_ssize_t __pyx_v_j;
  Py_ssize_t __pyx_v_lab;
  Py_ssize_t __pyx_v_N;
  Py_ssize_t __pyx_v_K;
  __pyx_t_5numpy_float64_t __pyx_v_val;
  PyArrayObject *__pyx_v_nobs = 0;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_counts;
  __Pyx_Buffer __pyx_pybuffer_counts;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_labels;
  __Pyx_Buffer __pyx_pybuffer_labels;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_nobs;
  __Pyx_Buffer __pyx_pybuffer_nobs;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_out;
  __Pyx_Buffer __pyx_pybuffer_out;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_values;
  __Pyx_Buffer __pyx_pybuffer_values;
  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;
  Py_ssize_t __pyx_t_7;
  Py_ssize_t __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_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;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("group_count_float64", 0);
  __pyx_pybuffer_nobs.pybuffer.buf = NULL;
  __pyx_pybuffer_nobs.refcount = 0;
  __pyx_pybuffernd_nobs.data = NULL;
  __pyx_pybuffernd_nobs.rcbuffer = &__pyx_pybuffer_nobs;
  __pyx_pybuffer_out.pybuffer.buf = NULL;
  __pyx_pybuffer_out.refcount = 0;
  __pyx_pybuffernd_out.data = NULL;
  __pyx_pybuffernd_out.rcbuffer = &__pyx_pybuffer_out;
  __pyx_pybuffer_counts.pybuffer.buf = NULL;
  __pyx_pybuffer_counts.refcount = 0;
  __pyx_pybuffernd_counts.data = NULL;
  __pyx_pybuffernd_counts.rcbuffer = &__pyx_pybuffer_counts;
  __pyx_pybuffer_values.pybuffer.buf = NULL;
  __pyx_pybuffer_values.refcount = 0;
  __pyx_pybuffernd_values.data = NULL;
  __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values;
  __pyx_pybuffer_labels.pybuffer.buf = NULL;
  __pyx_pybuffer_labels.refcount = 0;
  __pyx_pybuffernd_labels.data = NULL;
  __pyx_pybuffernd_labels.rcbuffer = &__pyx_pybuffer_labels;
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_out.rcbuffer->pybuffer, (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[2]; __pyx_lineno = 6628; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_out.diminfo[0].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_out.diminfo[0].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_out.diminfo[1].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_out.diminfo[1].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[1];
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_counts.rcbuffer->pybuffer, (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[2]; __pyx_lineno = 6628; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_counts.diminfo[0].strides = __pyx_pybuffernd_counts.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_counts.diminfo[0].shape = __pyx_pybuffernd_counts.rcbuffer->pybuffer.shape[0];
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (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[2]; __pyx_lineno = 6628; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_values.diminfo[1].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_values.diminfo[1].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[1];
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_labels.rcbuffer->pybuffer, (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[2]; __pyx_lineno = 6628; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_labels.diminfo[0].strides = __pyx_pybuffernd_labels.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_labels.diminfo[0].shape = __pyx_pybuffernd_labels.rcbuffer->pybuffer.shape[0];

  /* "pandas/src/generated.pyx":6637
 *     cdef:
 *         Py_ssize_t i, j, lab
 *         Py_ssize_t N = values.shape[0], K = values.shape[1]             # <<<<<<<<<<<<<<
 *         float64_t val
 *         ndarray[int64_t, ndim=2] nobs = np.zeros((out.shape[0], out.shape[1]),
 */
  __pyx_v_N = (__pyx_v_values->dimensions[0]);
  __pyx_v_K = (__pyx_v_values->dimensions[1]);

  /* "pandas/src/generated.pyx":6639
 *         Py_ssize_t N = values.shape[0], K = values.shape[1]
 *         float64_t val
 *         ndarray[int64_t, ndim=2] nobs = np.zeros((out.shape[0], out.shape[1]),             # <<<<<<<<<<<<<<
 *                                                  dtype=np.int64)
 * 
 */
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6639; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6639; __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_PyInt_From_Py_intptr_t((__pyx_v_out->dimensions[0])); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6639; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_PyInt_From_Py_intptr_t((__pyx_v_out->dimensions[1])); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6639; __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[2]; __pyx_lineno = 6639; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__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_3);
  __Pyx_GIVEREF(__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[2]; __pyx_lineno = 6639; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__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[2]; __pyx_lineno = 6639; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);

  /* "pandas/src/generated.pyx":6640
 *         float64_t val
 *         ndarray[int64_t, ndim=2] nobs = np.zeros((out.shape[0], out.shape[1]),
 *                                                  dtype=np.int64)             # <<<<<<<<<<<<<<
 * 
 *     if len(values) != len(labels):
 */
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6640; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_int64); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6640; __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, __pyx_n_s_dtype, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6639; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "pandas/src/generated.pyx":6639
 *         Py_ssize_t N = values.shape[0], K = values.shape[1]
 *         float64_t val
 *         ndarray[int64_t, ndim=2] nobs = np.zeros((out.shape[0], out.shape[1]),             # <<<<<<<<<<<<<<
 *                                                  dtype=np.int64)
 * 
 */
  __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6639; __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_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__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[2]; __pyx_lineno = 6639; __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_pybuffernd_nobs.rcbuffer->pybuffer, (PyObject*)__pyx_t_6, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) {
      __pyx_v_nobs = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_nobs.rcbuffer->pybuffer.buf = NULL;
      {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6639; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    } else {__pyx_pybuffernd_nobs.diminfo[0].strides = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_nobs.diminfo[0].shape = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_nobs.diminfo[1].strides = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_nobs.diminfo[1].shape = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.shape[1];
    }
  }
  __pyx_t_6 = 0;
  __pyx_v_nobs = ((PyArrayObject *)__pyx_t_5);
  __pyx_t_5 = 0;

  /* "pandas/src/generated.pyx":6642
 *                                                  dtype=np.int64)
 * 
 *     if len(values) != len(labels):             # <<<<<<<<<<<<<<
 *        raise AssertionError("len(index) != len(labels)")
 * 
 */
  __pyx_t_7 = PyObject_Length(((PyObject *)__pyx_v_values)); if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6642; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_8 = PyObject_Length(((PyObject *)__pyx_v_labels)); if (unlikely(__pyx_t_8 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6642; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_9 = ((__pyx_t_7 != __pyx_t_8) != 0);
  if (__pyx_t_9) {

    /* "pandas/src/generated.pyx":6643
 * 
 *     if len(values) != len(labels):
 *        raise AssertionError("len(index) != len(labels)")             # <<<<<<<<<<<<<<
 * 
 *     for i in range(N):
 */
    __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_AssertionError, __pyx_tuple__210, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6643; __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[2]; __pyx_lineno = 6643; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }

  /* "pandas/src/generated.pyx":6645
 *        raise AssertionError("len(index) != len(labels)")
 * 
 *     for i in range(N):             # <<<<<<<<<<<<<<
 *         lab = labels[i]
 *         if lab < 0:
 */
  __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;

    /* "pandas/src/generated.pyx":6646
 * 
 *     for i in range(N):
 *         lab = labels[i]             # <<<<<<<<<<<<<<
 *         if lab < 0:
 *             continue
 */
    __pyx_t_10 = __pyx_v_i;
    __pyx_v_lab = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_labels.rcbuffer->pybuffer.buf, __pyx_t_10, __pyx_pybuffernd_labels.diminfo[0].strides));

    /* "pandas/src/generated.pyx":6647
 *     for i in range(N):
 *         lab = labels[i]
 *         if lab < 0:             # <<<<<<<<<<<<<<
 *             continue
 * 
 */
    __pyx_t_9 = ((__pyx_v_lab < 0) != 0);
    if (__pyx_t_9) {

      /* "pandas/src/generated.pyx":6648
 *         lab = labels[i]
 *         if lab < 0:
 *             continue             # <<<<<<<<<<<<<<
 * 
 *         counts[lab] += 1
 */
      goto __pyx_L4_continue;
    }

    /* "pandas/src/generated.pyx":6650
 *             continue
 * 
 *         counts[lab] += 1             # <<<<<<<<<<<<<<
 *         for j in range(K):
 *             val = values[i, j]
 */
    __pyx_t_11 = __pyx_v_lab;
    *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_counts.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_counts.diminfo[0].strides) += 1;

    /* "pandas/src/generated.pyx":6651
 * 
 *         counts[lab] += 1
 *         for j in range(K):             # <<<<<<<<<<<<<<
 *             val = values[i, j]
 * 
 */
    __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/generated.pyx":6652
 *         counts[lab] += 1
 *         for j in range(K):
 *             val = values[i, j]             # <<<<<<<<<<<<<<
 * 
 *             # not nan
 */
      __pyx_t_14 = __pyx_v_i;
      __pyx_t_15 = __pyx_v_j;
      __pyx_v_val = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_values.diminfo[0].strides, __pyx_t_15, __pyx_pybuffernd_values.diminfo[1].strides));

      /* "pandas/src/generated.pyx":6655
 * 
 *             # not nan
 *             nobs[lab, j] += val == val and val != iNaT             # <<<<<<<<<<<<<<
 * 
 *     for i in range(len(counts)):
 */
      __pyx_t_9 = (__pyx_v_val == __pyx_v_val);
      if (__pyx_t_9) {
        __pyx_t_16 = (__pyx_v_val != __pyx_v_6pandas_5algos_iNaT);
        __pyx_t_17 = __pyx_t_16;
      } else {
        __pyx_t_17 = __pyx_t_9;
      }
      __pyx_t_18 = __pyx_v_lab;
      __pyx_t_19 = __pyx_v_j;
      *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_nobs.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_nobs.diminfo[0].strides, __pyx_t_19, __pyx_pybuffernd_nobs.diminfo[1].strides) += __pyx_t_17;
    }
    __pyx_L4_continue:;
  }

  /* "pandas/src/generated.pyx":6657
 *             nobs[lab, j] += val == val and val != iNaT
 * 
 *     for i in range(len(counts)):             # <<<<<<<<<<<<<<
 *         for j in range(K):
 *             out[i, j] = nobs[i, j]
 */
  __pyx_t_8 = PyObject_Length(((PyObject *)__pyx_v_counts)); if (unlikely(__pyx_t_8 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6657; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_8; __pyx_t_7+=1) {
    __pyx_v_i = __pyx_t_7;

    /* "pandas/src/generated.pyx":6658
 * 
 *     for i in range(len(counts)):
 *         for j in range(K):             # <<<<<<<<<<<<<<
 *             out[i, j] = nobs[i, j]
 * 
 */
    __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/generated.pyx":6659
 *     for i in range(len(counts)):
 *         for j in range(K):
 *             out[i, j] = nobs[i, j]             # <<<<<<<<<<<<<<
 * 
 * 
 */
      __pyx_t_20 = __pyx_v_i;
      __pyx_t_21 = __pyx_v_j;
      __pyx_t_22 = __pyx_v_i;
      __pyx_t_23 = __pyx_v_j;
      *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_22, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_23, __pyx_pybuffernd_out.diminfo[1].strides) = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_nobs.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_nobs.diminfo[0].strides, __pyx_t_21, __pyx_pybuffernd_nobs.diminfo[1].strides));
    }
  }

  /* "pandas/src/generated.pyx":6628
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def group_count_float64(ndarray[float64_t, ndim=2] out,             # <<<<<<<<<<<<<<
 *                          ndarray[int64_t] counts,
 *                          ndarray[float64_t, ndim=2] values,
 */

  /* function exit code */
  __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_pybuffernd_counts.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_labels.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas.algos.group_count_float64", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_counts.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_labels.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer);
  __pyx_L2:;
  __Pyx_XDECREF((PyObject *)__pyx_v_nobs);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/src/generated.pyx":6664
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def group_count_float32(ndarray[float32_t, ndim=2] out,             # <<<<<<<<<<<<<<
 *                          ndarray[int64_t] counts,
 *                          ndarray[float32_t, ndim=2] values,
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pandas_5algos_457group_count_float32(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6pandas_5algos_456group_count_float32[] = "\n    Only aggregates on axis=0\n    ";
static PyMethodDef __pyx_mdef_6pandas_5algos_457group_count_float32 = {__Pyx_NAMESTR("group_count_float32"), (PyCFunction)__pyx_pw_6pandas_5algos_457group_count_float32, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6pandas_5algos_456group_count_float32)};
static PyObject *__pyx_pw_6pandas_5algos_457group_count_float32(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;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("group_count_float32 (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_out,&__pyx_n_s_counts,&__pyx_n_s_values,&__pyx_n_s_labels,0};
    PyObject* values[4] = {0,0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_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 (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_out)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_counts)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("group_count_float32", 1, 4, 4, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6664; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("group_count_float32", 1, 4, 4, 2); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6664; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  3:
        if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_labels)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("group_count_float32", 1, 4, 4, 3); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6664; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "group_count_float32") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6664; __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_count_float32", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6664; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas.algos.group_count_float32", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_out), __pyx_ptype_5numpy_ndarray, 1, "out", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6664; __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[2]; __pyx_lineno = 6665; __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[2]; __pyx_lineno = 6666; __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[2]; __pyx_lineno = 6667; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_456group_count_float32(__pyx_self, __pyx_v_out, __pyx_v_counts, __pyx_v_values, __pyx_v_labels);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pandas_5algos_456group_count_float32(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_out, PyArrayObject *__pyx_v_counts, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_labels) {
  Py_ssize_t __pyx_v_i;
  Py_ssize_t __pyx_v_j;
  Py_ssize_t __pyx_v_lab;
  Py_ssize_t __pyx_v_N;
  Py_ssize_t __pyx_v_K;
  __pyx_t_5numpy_float32_t __pyx_v_val;
  PyArrayObject *__pyx_v_nobs = 0;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_counts;
  __Pyx_Buffer __pyx_pybuffer_counts;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_labels;
  __Pyx_Buffer __pyx_pybuffer_labels;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_nobs;
  __Pyx_Buffer __pyx_pybuffer_nobs;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_out;
  __Pyx_Buffer __pyx_pybuffer_out;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_values;
  __Pyx_Buffer __pyx_pybuffer_values;
  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;
  Py_ssize_t __pyx_t_7;
  Py_ssize_t __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_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;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("group_count_float32", 0);
  __pyx_pybuffer_nobs.pybuffer.buf = NULL;
  __pyx_pybuffer_nobs.refcount = 0;
  __pyx_pybuffernd_nobs.data = NULL;
  __pyx_pybuffernd_nobs.rcbuffer = &__pyx_pybuffer_nobs;
  __pyx_pybuffer_out.pybuffer.buf = NULL;
  __pyx_pybuffer_out.refcount = 0;
  __pyx_pybuffernd_out.data = NULL;
  __pyx_pybuffernd_out.rcbuffer = &__pyx_pybuffer_out;
  __pyx_pybuffer_counts.pybuffer.buf = NULL;
  __pyx_pybuffer_counts.refcount = 0;
  __pyx_pybuffernd_counts.data = NULL;
  __pyx_pybuffernd_counts.rcbuffer = &__pyx_pybuffer_counts;
  __pyx_pybuffer_values.pybuffer.buf = NULL;
  __pyx_pybuffer_values.refcount = 0;
  __pyx_pybuffernd_values.data = NULL;
  __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values;
  __pyx_pybuffer_labels.pybuffer.buf = NULL;
  __pyx_pybuffer_labels.refcount = 0;
  __pyx_pybuffernd_labels.data = NULL;
  __pyx_pybuffernd_labels.rcbuffer = &__pyx_pybuffer_labels;
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_out.rcbuffer->pybuffer, (PyObject*)__pyx_v_out, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6664; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_out.diminfo[0].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_out.diminfo[0].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_out.diminfo[1].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_out.diminfo[1].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[1];
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_counts.rcbuffer->pybuffer, (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[2]; __pyx_lineno = 6664; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_counts.diminfo[0].strides = __pyx_pybuffernd_counts.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_counts.diminfo[0].shape = __pyx_pybuffernd_counts.rcbuffer->pybuffer.shape[0];
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6664; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_values.diminfo[1].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_values.diminfo[1].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[1];
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_labels.rcbuffer->pybuffer, (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[2]; __pyx_lineno = 6664; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_labels.diminfo[0].strides = __pyx_pybuffernd_labels.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_labels.diminfo[0].shape = __pyx_pybuffernd_labels.rcbuffer->pybuffer.shape[0];

  /* "pandas/src/generated.pyx":6673
 *     cdef:
 *         Py_ssize_t i, j, lab
 *         Py_ssize_t N = values.shape[0], K = values.shape[1]             # <<<<<<<<<<<<<<
 *         float32_t val
 *         ndarray[int64_t, ndim=2] nobs = np.zeros((out.shape[0], out.shape[1]),
 */
  __pyx_v_N = (__pyx_v_values->dimensions[0]);
  __pyx_v_K = (__pyx_v_values->dimensions[1]);

  /* "pandas/src/generated.pyx":6675
 *         Py_ssize_t N = values.shape[0], K = values.shape[1]
 *         float32_t val
 *         ndarray[int64_t, ndim=2] nobs = np.zeros((out.shape[0], out.shape[1]),             # <<<<<<<<<<<<<<
 *                                                  dtype=np.int64)
 * 
 */
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6675; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6675; __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_PyInt_From_Py_intptr_t((__pyx_v_out->dimensions[0])); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6675; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_PyInt_From_Py_intptr_t((__pyx_v_out->dimensions[1])); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6675; __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[2]; __pyx_lineno = 6675; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__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_3);
  __Pyx_GIVEREF(__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[2]; __pyx_lineno = 6675; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__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[2]; __pyx_lineno = 6675; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);

  /* "pandas/src/generated.pyx":6676
 *         float32_t val
 *         ndarray[int64_t, ndim=2] nobs = np.zeros((out.shape[0], out.shape[1]),
 *                                                  dtype=np.int64)             # <<<<<<<<<<<<<<
 * 
 *     if len(values) != len(labels):
 */
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6676; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_int64); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6676; __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, __pyx_n_s_dtype, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6675; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "pandas/src/generated.pyx":6675
 *         Py_ssize_t N = values.shape[0], K = values.shape[1]
 *         float32_t val
 *         ndarray[int64_t, ndim=2] nobs = np.zeros((out.shape[0], out.shape[1]),             # <<<<<<<<<<<<<<
 *                                                  dtype=np.int64)
 * 
 */
  __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6675; __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_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__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[2]; __pyx_lineno = 6675; __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_pybuffernd_nobs.rcbuffer->pybuffer, (PyObject*)__pyx_t_6, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) {
      __pyx_v_nobs = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_nobs.rcbuffer->pybuffer.buf = NULL;
      {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6675; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    } else {__pyx_pybuffernd_nobs.diminfo[0].strides = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_nobs.diminfo[0].shape = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_nobs.diminfo[1].strides = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_nobs.diminfo[1].shape = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.shape[1];
    }
  }
  __pyx_t_6 = 0;
  __pyx_v_nobs = ((PyArrayObject *)__pyx_t_5);
  __pyx_t_5 = 0;

  /* "pandas/src/generated.pyx":6678
 *                                                  dtype=np.int64)
 * 
 *     if len(values) != len(labels):             # <<<<<<<<<<<<<<
 *        raise AssertionError("len(index) != len(labels)")
 * 
 */
  __pyx_t_7 = PyObject_Length(((PyObject *)__pyx_v_values)); if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6678; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_8 = PyObject_Length(((PyObject *)__pyx_v_labels)); if (unlikely(__pyx_t_8 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6678; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_9 = ((__pyx_t_7 != __pyx_t_8) != 0);
  if (__pyx_t_9) {

    /* "pandas/src/generated.pyx":6679
 * 
 *     if len(values) != len(labels):
 *        raise AssertionError("len(index) != len(labels)")             # <<<<<<<<<<<<<<
 * 
 *     for i in range(N):
 */
    __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_AssertionError, __pyx_tuple__211, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6679; __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[2]; __pyx_lineno = 6679; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }

  /* "pandas/src/generated.pyx":6681
 *        raise AssertionError("len(index) != len(labels)")
 * 
 *     for i in range(N):             # <<<<<<<<<<<<<<
 *         lab = labels[i]
 *         if lab < 0:
 */
  __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;

    /* "pandas/src/generated.pyx":6682
 * 
 *     for i in range(N):
 *         lab = labels[i]             # <<<<<<<<<<<<<<
 *         if lab < 0:
 *             continue
 */
    __pyx_t_10 = __pyx_v_i;
    __pyx_v_lab = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_labels.rcbuffer->pybuffer.buf, __pyx_t_10, __pyx_pybuffernd_labels.diminfo[0].strides));

    /* "pandas/src/generated.pyx":6683
 *     for i in range(N):
 *         lab = labels[i]
 *         if lab < 0:             # <<<<<<<<<<<<<<
 *             continue
 * 
 */
    __pyx_t_9 = ((__pyx_v_lab < 0) != 0);
    if (__pyx_t_9) {

      /* "pandas/src/generated.pyx":6684
 *         lab = labels[i]
 *         if lab < 0:
 *             continue             # <<<<<<<<<<<<<<
 * 
 *         counts[lab] += 1
 */
      goto __pyx_L4_continue;
    }

    /* "pandas/src/generated.pyx":6686
 *             continue
 * 
 *         counts[lab] += 1             # <<<<<<<<<<<<<<
 *         for j in range(K):
 *             val = values[i, j]
 */
    __pyx_t_11 = __pyx_v_lab;
    *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_counts.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_counts.diminfo[0].strides) += 1;

    /* "pandas/src/generated.pyx":6687
 * 
 *         counts[lab] += 1
 *         for j in range(K):             # <<<<<<<<<<<<<<
 *             val = values[i, j]
 * 
 */
    __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/generated.pyx":6688
 *         counts[lab] += 1
 *         for j in range(K):
 *             val = values[i, j]             # <<<<<<<<<<<<<<
 * 
 *             # not nan
 */
      __pyx_t_14 = __pyx_v_i;
      __pyx_t_15 = __pyx_v_j;
      __pyx_v_val = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_values.diminfo[0].strides, __pyx_t_15, __pyx_pybuffernd_values.diminfo[1].strides));

      /* "pandas/src/generated.pyx":6691
 * 
 *             # not nan
 *             nobs[lab, j] += val == val and val != iNaT             # <<<<<<<<<<<<<<
 * 
 *     for i in range(len(counts)):
 */
      __pyx_t_9 = (__pyx_v_val == __pyx_v_val);
      if (__pyx_t_9) {
        __pyx_t_16 = (__pyx_v_val != __pyx_v_6pandas_5algos_iNaT);
        __pyx_t_17 = __pyx_t_16;
      } else {
        __pyx_t_17 = __pyx_t_9;
      }
      __pyx_t_18 = __pyx_v_lab;
      __pyx_t_19 = __pyx_v_j;
      *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_nobs.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_nobs.diminfo[0].strides, __pyx_t_19, __pyx_pybuffernd_nobs.diminfo[1].strides) += __pyx_t_17;
    }
    __pyx_L4_continue:;
  }

  /* "pandas/src/generated.pyx":6693
 *             nobs[lab, j] += val == val and val != iNaT
 * 
 *     for i in range(len(counts)):             # <<<<<<<<<<<<<<
 *         for j in range(K):
 *             out[i, j] = nobs[i, j]
 */
  __pyx_t_8 = PyObject_Length(((PyObject *)__pyx_v_counts)); if (unlikely(__pyx_t_8 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6693; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_8; __pyx_t_7+=1) {
    __pyx_v_i = __pyx_t_7;

    /* "pandas/src/generated.pyx":6694
 * 
 *     for i in range(len(counts)):
 *         for j in range(K):             # <<<<<<<<<<<<<<
 *             out[i, j] = nobs[i, j]
 * 
 */
    __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/generated.pyx":6695
 *     for i in range(len(counts)):
 *         for j in range(K):
 *             out[i, j] = nobs[i, j]             # <<<<<<<<<<<<<<
 * 
 * 
 */
      __pyx_t_20 = __pyx_v_i;
      __pyx_t_21 = __pyx_v_j;
      __pyx_t_22 = __pyx_v_i;
      __pyx_t_23 = __pyx_v_j;
      *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_22, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_23, __pyx_pybuffernd_out.diminfo[1].strides) = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_nobs.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_nobs.diminfo[0].strides, __pyx_t_21, __pyx_pybuffernd_nobs.diminfo[1].strides));
    }
  }

  /* "pandas/src/generated.pyx":6664
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def group_count_float32(ndarray[float32_t, ndim=2] out,             # <<<<<<<<<<<<<<
 *                          ndarray[int64_t] counts,
 *                          ndarray[float32_t, ndim=2] values,
 */

  /* function exit code */
  __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_pybuffernd_counts.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_labels.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas.algos.group_count_float32", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_counts.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_labels.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer);
  __pyx_L2:;
  __Pyx_XDECREF((PyObject *)__pyx_v_nobs);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/src/generated.pyx":6700
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def group_count_object(ndarray[float64_t, ndim=2] out,             # <<<<<<<<<<<<<<
 *                          ndarray[int64_t] counts,
 *                          ndarray[object, ndim=2] values,
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pandas_5algos_459group_count_object(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6pandas_5algos_458group_count_object[] = "\n    Only aggregates on axis=0\n    ";
static PyMethodDef __pyx_mdef_6pandas_5algos_459group_count_object = {__Pyx_NAMESTR("group_count_object"), (PyCFunction)__pyx_pw_6pandas_5algos_459group_count_object, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6pandas_5algos_458group_count_object)};
static PyObject *__pyx_pw_6pandas_5algos_459group_count_object(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;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("group_count_object (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_out,&__pyx_n_s_counts,&__pyx_n_s_values,&__pyx_n_s_labels,0};
    PyObject* values[4] = {0,0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_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 (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_out)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_counts)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("group_count_object", 1, 4, 4, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6700; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("group_count_object", 1, 4, 4, 2); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6700; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  3:
        if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_labels)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("group_count_object", 1, 4, 4, 3); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6700; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "group_count_object") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6700; __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_count_object", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6700; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas.algos.group_count_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_out), __pyx_ptype_5numpy_ndarray, 1, "out", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6700; __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[2]; __pyx_lineno = 6701; __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[2]; __pyx_lineno = 6702; __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[2]; __pyx_lineno = 6703; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_458group_count_object(__pyx_self, __pyx_v_out, __pyx_v_counts, __pyx_v_values, __pyx_v_labels);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pandas_5algos_458group_count_object(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_out, PyArrayObject *__pyx_v_counts, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_labels) {
  Py_ssize_t __pyx_v_i;
  Py_ssize_t __pyx_v_j;
  Py_ssize_t __pyx_v_lab;
  Py_ssize_t __pyx_v_N;
  Py_ssize_t __pyx_v_K;
  PyObject *__pyx_v_val = 0;
  PyArrayObject *__pyx_v_nobs = 0;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_counts;
  __Pyx_Buffer __pyx_pybuffer_counts;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_labels;
  __Pyx_Buffer __pyx_pybuffer_labels;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_nobs;
  __Pyx_Buffer __pyx_pybuffer_nobs;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_out;
  __Pyx_Buffer __pyx_pybuffer_out;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_values;
  __Pyx_Buffer __pyx_pybuffer_values;
  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;
  Py_ssize_t __pyx_t_7;
  Py_ssize_t __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;
  __pyx_t_5numpy_int64_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;
  __Pyx_RefNannySetupContext("group_count_object", 0);
  __pyx_pybuffer_nobs.pybuffer.buf = NULL;
  __pyx_pybuffer_nobs.refcount = 0;
  __pyx_pybuffernd_nobs.data = NULL;
  __pyx_pybuffernd_nobs.rcbuffer = &__pyx_pybuffer_nobs;
  __pyx_pybuffer_out.pybuffer.buf = NULL;
  __pyx_pybuffer_out.refcount = 0;
  __pyx_pybuffernd_out.data = NULL;
  __pyx_pybuffernd_out.rcbuffer = &__pyx_pybuffer_out;
  __pyx_pybuffer_counts.pybuffer.buf = NULL;
  __pyx_pybuffer_counts.refcount = 0;
  __pyx_pybuffernd_counts.data = NULL;
  __pyx_pybuffernd_counts.rcbuffer = &__pyx_pybuffer_counts;
  __pyx_pybuffer_values.pybuffer.buf = NULL;
  __pyx_pybuffer_values.refcount = 0;
  __pyx_pybuffernd_values.data = NULL;
  __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values;
  __pyx_pybuffer_labels.pybuffer.buf = NULL;
  __pyx_pybuffer_labels.refcount = 0;
  __pyx_pybuffernd_labels.data = NULL;
  __pyx_pybuffernd_labels.rcbuffer = &__pyx_pybuffer_labels;
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_out.rcbuffer->pybuffer, (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[2]; __pyx_lineno = 6700; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_out.diminfo[0].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_out.diminfo[0].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_out.diminfo[1].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_out.diminfo[1].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[1];
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_counts.rcbuffer->pybuffer, (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[2]; __pyx_lineno = 6700; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_counts.diminfo[0].strides = __pyx_pybuffernd_counts.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_counts.diminfo[0].shape = __pyx_pybuffernd_counts.rcbuffer->pybuffer.shape[0];
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6700; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_values.diminfo[1].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_values.diminfo[1].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[1];
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_labels.rcbuffer->pybuffer, (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[2]; __pyx_lineno = 6700; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_labels.diminfo[0].strides = __pyx_pybuffernd_labels.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_labels.diminfo[0].shape = __pyx_pybuffernd_labels.rcbuffer->pybuffer.shape[0];

  /* "pandas/src/generated.pyx":6709
 *     cdef:
 *         Py_ssize_t i, j, lab
 *         Py_ssize_t N = values.shape[0], K = values.shape[1]             # <<<<<<<<<<<<<<
 *         object val
 *         ndarray[int64_t, ndim=2] nobs = np.zeros((out.shape[0], out.shape[1]),
 */
  __pyx_v_N = (__pyx_v_values->dimensions[0]);
  __pyx_v_K = (__pyx_v_values->dimensions[1]);

  /* "pandas/src/generated.pyx":6711
 *         Py_ssize_t N = values.shape[0], K = values.shape[1]
 *         object val
 *         ndarray[int64_t, ndim=2] nobs = np.zeros((out.shape[0], out.shape[1]),             # <<<<<<<<<<<<<<
 *                                                  dtype=np.int64)
 * 
 */
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6711; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6711; __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_PyInt_From_Py_intptr_t((__pyx_v_out->dimensions[0])); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6711; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_PyInt_From_Py_intptr_t((__pyx_v_out->dimensions[1])); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6711; __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[2]; __pyx_lineno = 6711; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__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_3);
  __Pyx_GIVEREF(__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[2]; __pyx_lineno = 6711; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__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[2]; __pyx_lineno = 6711; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);

  /* "pandas/src/generated.pyx":6712
 *         object val
 *         ndarray[int64_t, ndim=2] nobs = np.zeros((out.shape[0], out.shape[1]),
 *                                                  dtype=np.int64)             # <<<<<<<<<<<<<<
 * 
 *     if len(values) != len(labels):
 */
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6712; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_int64); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6712; __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, __pyx_n_s_dtype, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6711; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "pandas/src/generated.pyx":6711
 *         Py_ssize_t N = values.shape[0], K = values.shape[1]
 *         object val
 *         ndarray[int64_t, ndim=2] nobs = np.zeros((out.shape[0], out.shape[1]),             # <<<<<<<<<<<<<<
 *                                                  dtype=np.int64)
 * 
 */
  __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6711; __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_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__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[2]; __pyx_lineno = 6711; __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_pybuffernd_nobs.rcbuffer->pybuffer, (PyObject*)__pyx_t_6, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) {
      __pyx_v_nobs = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_nobs.rcbuffer->pybuffer.buf = NULL;
      {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6711; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    } else {__pyx_pybuffernd_nobs.diminfo[0].strides = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_nobs.diminfo[0].shape = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_nobs.diminfo[1].strides = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_nobs.diminfo[1].shape = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.shape[1];
    }
  }
  __pyx_t_6 = 0;
  __pyx_v_nobs = ((PyArrayObject *)__pyx_t_5);
  __pyx_t_5 = 0;

  /* "pandas/src/generated.pyx":6714
 *                                                  dtype=np.int64)
 * 
 *     if len(values) != len(labels):             # <<<<<<<<<<<<<<
 *        raise AssertionError("len(index) != len(labels)")
 * 
 */
  __pyx_t_7 = PyObject_Length(((PyObject *)__pyx_v_values)); if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6714; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_8 = PyObject_Length(((PyObject *)__pyx_v_labels)); if (unlikely(__pyx_t_8 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6714; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_9 = ((__pyx_t_7 != __pyx_t_8) != 0);
  if (__pyx_t_9) {

    /* "pandas/src/generated.pyx":6715
 * 
 *     if len(values) != len(labels):
 *        raise AssertionError("len(index) != len(labels)")             # <<<<<<<<<<<<<<
 * 
 *     for i in range(N):
 */
    __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_AssertionError, __pyx_tuple__212, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6715; __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[2]; __pyx_lineno = 6715; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }

  /* "pandas/src/generated.pyx":6717
 *        raise AssertionError("len(index) != len(labels)")
 * 
 *     for i in range(N):             # <<<<<<<<<<<<<<
 *         lab = labels[i]
 *         if lab < 0:
 */
  __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;

    /* "pandas/src/generated.pyx":6718
 * 
 *     for i in range(N):
 *         lab = labels[i]             # <<<<<<<<<<<<<<
 *         if lab < 0:
 *             continue
 */
    __pyx_t_10 = __pyx_v_i;
    __pyx_v_lab = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_labels.rcbuffer->pybuffer.buf, __pyx_t_10, __pyx_pybuffernd_labels.diminfo[0].strides));

    /* "pandas/src/generated.pyx":6719
 *     for i in range(N):
 *         lab = labels[i]
 *         if lab < 0:             # <<<<<<<<<<<<<<
 *             continue
 * 
 */
    __pyx_t_9 = ((__pyx_v_lab < 0) != 0);
    if (__pyx_t_9) {

      /* "pandas/src/generated.pyx":6720
 *         lab = labels[i]
 *         if lab < 0:
 *             continue             # <<<<<<<<<<<<<<
 * 
 *         counts[lab] += 1
 */
      goto __pyx_L4_continue;
    }

    /* "pandas/src/generated.pyx":6722
 *             continue
 * 
 *         counts[lab] += 1             # <<<<<<<<<<<<<<
 *         for j in range(K):
 *             val = values[i, j]
 */
    __pyx_t_11 = __pyx_v_lab;
    *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_counts.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_counts.diminfo[0].strides) += 1;

    /* "pandas/src/generated.pyx":6723
 * 
 *         counts[lab] += 1
 *         for j in range(K):             # <<<<<<<<<<<<<<
 *             val = values[i, j]
 * 
 */
    __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/generated.pyx":6724
 *         counts[lab] += 1
 *         for j in range(K):
 *             val = values[i, j]             # <<<<<<<<<<<<<<
 * 
 *             # not nan
 */
      __pyx_t_14 = __pyx_v_i;
      __pyx_t_15 = __pyx_v_j;
      __pyx_t_5 = (PyObject *) *__Pyx_BufPtrStrided2d(PyObject **, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_values.diminfo[0].strides, __pyx_t_15, __pyx_pybuffernd_values.diminfo[1].strides);
      __Pyx_INCREF((PyObject*)__pyx_t_5);
      __Pyx_XDECREF_SET(__pyx_v_val, __pyx_t_5);
      __pyx_t_5 = 0;

      /* "pandas/src/generated.pyx":6727
 * 
 *             # not nan
 *             nobs[lab, j] += val == val and val != iNaT             # <<<<<<<<<<<<<<
 * 
 *     for i in range(len(counts)):
 */
      __pyx_t_5 = PyObject_RichCompare(__pyx_v_val, __pyx_v_val, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6727; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6727; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      if (__pyx_t_9) {
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __pyx_t_4 = __Pyx_PyInt_From_npy_int64(__pyx_v_6pandas_5algos_iNaT); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6727; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_4);
        __pyx_t_3 = PyObject_RichCompare(__pyx_v_val, __pyx_t_4, Py_NE); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6727; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __pyx_t_4 = __pyx_t_3;
        __pyx_t_3 = 0;
      } else {
        __pyx_t_4 = __pyx_t_5;
        __pyx_t_5 = 0;
      }
      __pyx_t_16 = __Pyx_PyInt_As_npy_int64(__pyx_t_4); if (unlikely((__pyx_t_16 == (npy_int64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6727; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_17 = __pyx_v_lab;
      __pyx_t_18 = __pyx_v_j;
      *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_nobs.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_nobs.diminfo[0].strides, __pyx_t_18, __pyx_pybuffernd_nobs.diminfo[1].strides) += __pyx_t_16;
    }
    __pyx_L4_continue:;
  }

  /* "pandas/src/generated.pyx":6729
 *             nobs[lab, j] += val == val and val != iNaT
 * 
 *     for i in range(len(counts)):             # <<<<<<<<<<<<<<
 *         for j in range(K):
 *             out[i, j] = nobs[i, j]
 */
  __pyx_t_8 = PyObject_Length(((PyObject *)__pyx_v_counts)); if (unlikely(__pyx_t_8 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6729; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_8; __pyx_t_7+=1) {
    __pyx_v_i = __pyx_t_7;

    /* "pandas/src/generated.pyx":6730
 * 
 *     for i in range(len(counts)):
 *         for j in range(K):             # <<<<<<<<<<<<<<
 *             out[i, j] = nobs[i, j]
 * 
 */
    __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/generated.pyx":6731
 *     for i in range(len(counts)):
 *         for j in range(K):
 *             out[i, j] = nobs[i, j]             # <<<<<<<<<<<<<<
 * 
 * 
 */
      __pyx_t_19 = __pyx_v_i;
      __pyx_t_20 = __pyx_v_j;
      __pyx_t_21 = __pyx_v_i;
      __pyx_t_22 = __pyx_v_j;
      *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_22, __pyx_pybuffernd_out.diminfo[1].strides) = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_nobs.rcbuffer->pybuffer.buf, __pyx_t_19, __pyx_pybuffernd_nobs.diminfo[0].strides, __pyx_t_20, __pyx_pybuffernd_nobs.diminfo[1].strides));
    }
  }

  /* "pandas/src/generated.pyx":6700
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def group_count_object(ndarray[float64_t, ndim=2] out,             # <<<<<<<<<<<<<<
 *                          ndarray[int64_t] counts,
 *                          ndarray[object, ndim=2] values,
 */

  /* function exit code */
  __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_pybuffernd_counts.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_labels.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas.algos.group_count_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_counts.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_labels.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer);
  __pyx_L2:;
  __Pyx_XDECREF(__pyx_v_val);
  __Pyx_XDECREF((PyObject *)__pyx_v_nobs);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/src/generated.pyx":6736
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def group_count_int64(ndarray[float64_t, ndim=2] out,             # <<<<<<<<<<<<<<
 *                          ndarray[int64_t] counts,
 *                          ndarray[int64_t, ndim=2] values,
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pandas_5algos_461group_count_int64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6pandas_5algos_460group_count_int64[] = "\n    Only aggregates on axis=0\n    ";
static PyMethodDef __pyx_mdef_6pandas_5algos_461group_count_int64 = {__Pyx_NAMESTR("group_count_int64"), (PyCFunction)__pyx_pw_6pandas_5algos_461group_count_int64, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6pandas_5algos_460group_count_int64)};
static PyObject *__pyx_pw_6pandas_5algos_461group_count_int64(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;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("group_count_int64 (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_out,&__pyx_n_s_counts,&__pyx_n_s_values,&__pyx_n_s_labels,0};
    PyObject* values[4] = {0,0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_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 (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_out)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_counts)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("group_count_int64", 1, 4, 4, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6736; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("group_count_int64", 1, 4, 4, 2); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6736; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  3:
        if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_labels)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("group_count_int64", 1, 4, 4, 3); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6736; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "group_count_int64") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6736; __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_count_int64", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6736; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas.algos.group_count_int64", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_out), __pyx_ptype_5numpy_ndarray, 1, "out", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6736; __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[2]; __pyx_lineno = 6737; __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[2]; __pyx_lineno = 6738; __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[2]; __pyx_lineno = 6739; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_460group_count_int64(__pyx_self, __pyx_v_out, __pyx_v_counts, __pyx_v_values, __pyx_v_labels);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pandas_5algos_460group_count_int64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_out, PyArrayObject *__pyx_v_counts, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_labels) {
  Py_ssize_t __pyx_v_i;
  Py_ssize_t __pyx_v_j;
  Py_ssize_t __pyx_v_lab;
  Py_ssize_t __pyx_v_N;
  Py_ssize_t __pyx_v_K;
  __pyx_t_5numpy_int64_t __pyx_v_val;
  PyArrayObject *__pyx_v_nobs = 0;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_counts;
  __Pyx_Buffer __pyx_pybuffer_counts;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_labels;
  __Pyx_Buffer __pyx_pybuffer_labels;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_nobs;
  __Pyx_Buffer __pyx_pybuffer_nobs;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_out;
  __Pyx_Buffer __pyx_pybuffer_out;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_values;
  __Pyx_Buffer __pyx_pybuffer_values;
  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;
  Py_ssize_t __pyx_t_7;
  Py_ssize_t __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_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;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("group_count_int64", 0);
  __pyx_pybuffer_nobs.pybuffer.buf = NULL;
  __pyx_pybuffer_nobs.refcount = 0;
  __pyx_pybuffernd_nobs.data = NULL;
  __pyx_pybuffernd_nobs.rcbuffer = &__pyx_pybuffer_nobs;
  __pyx_pybuffer_out.pybuffer.buf = NULL;
  __pyx_pybuffer_out.refcount = 0;
  __pyx_pybuffernd_out.data = NULL;
  __pyx_pybuffernd_out.rcbuffer = &__pyx_pybuffer_out;
  __pyx_pybuffer_counts.pybuffer.buf = NULL;
  __pyx_pybuffer_counts.refcount = 0;
  __pyx_pybuffernd_counts.data = NULL;
  __pyx_pybuffernd_counts.rcbuffer = &__pyx_pybuffer_counts;
  __pyx_pybuffer_values.pybuffer.buf = NULL;
  __pyx_pybuffer_values.refcount = 0;
  __pyx_pybuffernd_values.data = NULL;
  __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values;
  __pyx_pybuffer_labels.pybuffer.buf = NULL;
  __pyx_pybuffer_labels.refcount = 0;
  __pyx_pybuffernd_labels.data = NULL;
  __pyx_pybuffernd_labels.rcbuffer = &__pyx_pybuffer_labels;
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_out.rcbuffer->pybuffer, (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[2]; __pyx_lineno = 6736; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_out.diminfo[0].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_out.diminfo[0].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_out.diminfo[1].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_out.diminfo[1].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[1];
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_counts.rcbuffer->pybuffer, (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[2]; __pyx_lineno = 6736; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_counts.diminfo[0].strides = __pyx_pybuffernd_counts.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_counts.diminfo[0].shape = __pyx_pybuffernd_counts.rcbuffer->pybuffer.shape[0];
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (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[2]; __pyx_lineno = 6736; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_values.diminfo[1].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_values.diminfo[1].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[1];
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_labels.rcbuffer->pybuffer, (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[2]; __pyx_lineno = 6736; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_labels.diminfo[0].strides = __pyx_pybuffernd_labels.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_labels.diminfo[0].shape = __pyx_pybuffernd_labels.rcbuffer->pybuffer.shape[0];

  /* "pandas/src/generated.pyx":6745
 *     cdef:
 *         Py_ssize_t i, j, lab
 *         Py_ssize_t N = values.shape[0], K = values.shape[1]             # <<<<<<<<<<<<<<
 *         int64_t val
 *         ndarray[int64_t, ndim=2] nobs = np.zeros((out.shape[0], out.shape[1]),
 */
  __pyx_v_N = (__pyx_v_values->dimensions[0]);
  __pyx_v_K = (__pyx_v_values->dimensions[1]);

  /* "pandas/src/generated.pyx":6747
 *         Py_ssize_t N = values.shape[0], K = values.shape[1]
 *         int64_t val
 *         ndarray[int64_t, ndim=2] nobs = np.zeros((out.shape[0], out.shape[1]),             # <<<<<<<<<<<<<<
 *                                                  dtype=np.int64)
 * 
 */
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6747; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6747; __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_PyInt_From_Py_intptr_t((__pyx_v_out->dimensions[0])); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6747; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_PyInt_From_Py_intptr_t((__pyx_v_out->dimensions[1])); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6747; __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[2]; __pyx_lineno = 6747; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__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_3);
  __Pyx_GIVEREF(__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[2]; __pyx_lineno = 6747; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__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[2]; __pyx_lineno = 6747; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);

  /* "pandas/src/generated.pyx":6748
 *         int64_t val
 *         ndarray[int64_t, ndim=2] nobs = np.zeros((out.shape[0], out.shape[1]),
 *                                                  dtype=np.int64)             # <<<<<<<<<<<<<<
 * 
 *     if len(values) != len(labels):
 */
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6748; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_int64); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6748; __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, __pyx_n_s_dtype, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6747; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "pandas/src/generated.pyx":6747
 *         Py_ssize_t N = values.shape[0], K = values.shape[1]
 *         int64_t val
 *         ndarray[int64_t, ndim=2] nobs = np.zeros((out.shape[0], out.shape[1]),             # <<<<<<<<<<<<<<
 *                                                  dtype=np.int64)
 * 
 */
  __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6747; __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_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__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[2]; __pyx_lineno = 6747; __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_pybuffernd_nobs.rcbuffer->pybuffer, (PyObject*)__pyx_t_6, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) {
      __pyx_v_nobs = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_nobs.rcbuffer->pybuffer.buf = NULL;
      {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6747; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    } else {__pyx_pybuffernd_nobs.diminfo[0].strides = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_nobs.diminfo[0].shape = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_nobs.diminfo[1].strides = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_nobs.diminfo[1].shape = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.shape[1];
    }
  }
  __pyx_t_6 = 0;
  __pyx_v_nobs = ((PyArrayObject *)__pyx_t_5);
  __pyx_t_5 = 0;

  /* "pandas/src/generated.pyx":6750
 *                                                  dtype=np.int64)
 * 
 *     if len(values) != len(labels):             # <<<<<<<<<<<<<<
 *        raise AssertionError("len(index) != len(labels)")
 * 
 */
  __pyx_t_7 = PyObject_Length(((PyObject *)__pyx_v_values)); if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6750; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_8 = PyObject_Length(((PyObject *)__pyx_v_labels)); if (unlikely(__pyx_t_8 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6750; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_9 = ((__pyx_t_7 != __pyx_t_8) != 0);
  if (__pyx_t_9) {

    /* "pandas/src/generated.pyx":6751
 * 
 *     if len(values) != len(labels):
 *        raise AssertionError("len(index) != len(labels)")             # <<<<<<<<<<<<<<
 * 
 *     for i in range(N):
 */
    __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_AssertionError, __pyx_tuple__213, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6751; __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[2]; __pyx_lineno = 6751; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }

  /* "pandas/src/generated.pyx":6753
 *        raise AssertionError("len(index) != len(labels)")
 * 
 *     for i in range(N):             # <<<<<<<<<<<<<<
 *         lab = labels[i]
 *         if lab < 0:
 */
  __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;

    /* "pandas/src/generated.pyx":6754
 * 
 *     for i in range(N):
 *         lab = labels[i]             # <<<<<<<<<<<<<<
 *         if lab < 0:
 *             continue
 */
    __pyx_t_10 = __pyx_v_i;
    __pyx_v_lab = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_labels.rcbuffer->pybuffer.buf, __pyx_t_10, __pyx_pybuffernd_labels.diminfo[0].strides));

    /* "pandas/src/generated.pyx":6755
 *     for i in range(N):
 *         lab = labels[i]
 *         if lab < 0:             # <<<<<<<<<<<<<<
 *             continue
 * 
 */
    __pyx_t_9 = ((__pyx_v_lab < 0) != 0);
    if (__pyx_t_9) {

      /* "pandas/src/generated.pyx":6756
 *         lab = labels[i]
 *         if lab < 0:
 *             continue             # <<<<<<<<<<<<<<
 * 
 *         counts[lab] += 1
 */
      goto __pyx_L4_continue;
    }

    /* "pandas/src/generated.pyx":6758
 *             continue
 * 
 *         counts[lab] += 1             # <<<<<<<<<<<<<<
 *         for j in range(K):
 *             val = values[i, j]
 */
    __pyx_t_11 = __pyx_v_lab;
    *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_counts.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_counts.diminfo[0].strides) += 1;

    /* "pandas/src/generated.pyx":6759
 * 
 *         counts[lab] += 1
 *         for j in range(K):             # <<<<<<<<<<<<<<
 *             val = values[i, j]
 * 
 */
    __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/generated.pyx":6760
 *         counts[lab] += 1
 *         for j in range(K):
 *             val = values[i, j]             # <<<<<<<<<<<<<<
 * 
 *             # not nan
 */
      __pyx_t_14 = __pyx_v_i;
      __pyx_t_15 = __pyx_v_j;
      __pyx_v_val = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_values.diminfo[0].strides, __pyx_t_15, __pyx_pybuffernd_values.diminfo[1].strides));

      /* "pandas/src/generated.pyx":6763
 * 
 *             # not nan
 *             nobs[lab, j] += val == val and val != iNaT             # <<<<<<<<<<<<<<
 * 
 *     for i in range(len(counts)):
 */
      __pyx_t_9 = (__pyx_v_val == __pyx_v_val);
      if (__pyx_t_9) {
        __pyx_t_16 = (__pyx_v_val != __pyx_v_6pandas_5algos_iNaT);
        __pyx_t_17 = __pyx_t_16;
      } else {
        __pyx_t_17 = __pyx_t_9;
      }
      __pyx_t_18 = __pyx_v_lab;
      __pyx_t_19 = __pyx_v_j;
      *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_nobs.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_nobs.diminfo[0].strides, __pyx_t_19, __pyx_pybuffernd_nobs.diminfo[1].strides) += __pyx_t_17;
    }
    __pyx_L4_continue:;
  }

  /* "pandas/src/generated.pyx":6765
 *             nobs[lab, j] += val == val and val != iNaT
 * 
 *     for i in range(len(counts)):             # <<<<<<<<<<<<<<
 *         for j in range(K):
 *             out[i, j] = nobs[i, j]
 */
  __pyx_t_8 = PyObject_Length(((PyObject *)__pyx_v_counts)); if (unlikely(__pyx_t_8 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6765; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_8; __pyx_t_7+=1) {
    __pyx_v_i = __pyx_t_7;

    /* "pandas/src/generated.pyx":6766
 * 
 *     for i in range(len(counts)):
 *         for j in range(K):             # <<<<<<<<<<<<<<
 *             out[i, j] = nobs[i, j]
 * 
 */
    __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/generated.pyx":6767
 *     for i in range(len(counts)):
 *         for j in range(K):
 *             out[i, j] = nobs[i, j]             # <<<<<<<<<<<<<<
 * 
 * 
 */
      __pyx_t_20 = __pyx_v_i;
      __pyx_t_21 = __pyx_v_j;
      __pyx_t_22 = __pyx_v_i;
      __pyx_t_23 = __pyx_v_j;
      *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_22, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_23, __pyx_pybuffernd_out.diminfo[1].strides) = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_nobs.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_nobs.diminfo[0].strides, __pyx_t_21, __pyx_pybuffernd_nobs.diminfo[1].strides));
    }
  }

  /* "pandas/src/generated.pyx":6736
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def group_count_int64(ndarray[float64_t, ndim=2] out,             # <<<<<<<<<<<<<<
 *                          ndarray[int64_t] counts,
 *                          ndarray[int64_t, ndim=2] values,
 */

  /* function exit code */
  __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_pybuffernd_counts.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_labels.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas.algos.group_count_int64", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_counts.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_labels.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer);
  __pyx_L2:;
  __Pyx_XDECREF((PyObject *)__pyx_v_nobs);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/src/generated.pyx":6773
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def group_count_bin_float64(ndarray[float64_t, ndim=2] out,             # <<<<<<<<<<<<<<
 *                              ndarray[int64_t] counts,
 *                              ndarray[float64_t, ndim=2] values,
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pandas_5algos_463group_count_bin_float64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6pandas_5algos_462group_count_bin_float64[] = "\n    Only aggregates on axis=0\n    ";
static PyMethodDef __pyx_mdef_6pandas_5algos_463group_count_bin_float64 = {__Pyx_NAMESTR("group_count_bin_float64"), (PyCFunction)__pyx_pw_6pandas_5algos_463group_count_bin_float64, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6pandas_5algos_462group_count_bin_float64)};
static PyObject *__pyx_pw_6pandas_5algos_463group_count_bin_float64(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;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("group_count_bin_float64 (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_out,&__pyx_n_s_counts,&__pyx_n_s_values,&__pyx_n_s_bins,0};
    PyObject* values[4] = {0,0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_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 (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_out)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_counts)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("group_count_bin_float64", 1, 4, 4, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6773; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("group_count_bin_float64", 1, 4, 4, 2); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6773; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  3:
        if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_bins)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("group_count_bin_float64", 1, 4, 4, 3); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6773; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "group_count_bin_float64") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6773; __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_count_bin_float64", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6773; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas.algos.group_count_bin_float64", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_out), __pyx_ptype_5numpy_ndarray, 1, "out", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6773; __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[2]; __pyx_lineno = 6774; __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[2]; __pyx_lineno = 6775; __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[2]; __pyx_lineno = 6776; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_462group_count_bin_float64(__pyx_self, __pyx_v_out, __pyx_v_counts, __pyx_v_values, __pyx_v_bins);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pandas_5algos_462group_count_bin_float64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_out, PyArrayObject *__pyx_v_counts, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_bins) {
  Py_ssize_t __pyx_v_i;
  Py_ssize_t __pyx_v_j;
  Py_ssize_t __pyx_v_ngroups;
  Py_ssize_t __pyx_v_N;
  Py_ssize_t __pyx_v_K;
  Py_ssize_t __pyx_v_b;
  __pyx_t_5numpy_float64_t __pyx_v_val;
  PyArrayObject *__pyx_v_nobs = 0;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_bins;
  __Pyx_Buffer __pyx_pybuffer_bins;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_counts;
  __Pyx_Buffer __pyx_pybuffer_counts;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_nobs;
  __Pyx_Buffer __pyx_pybuffer_nobs;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_out;
  __Pyx_Buffer __pyx_pybuffer_out;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_values;
  __Pyx_Buffer __pyx_pybuffer_values;
  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;
  Py_ssize_t __pyx_t_7;
  Py_ssize_t __pyx_t_8;
  Py_ssize_t __pyx_t_9;
  int __pyx_t_10;
  Py_ssize_t __pyx_t_11;
  int __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;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("group_count_bin_float64", 0);
  __pyx_pybuffer_nobs.pybuffer.buf = NULL;
  __pyx_pybuffer_nobs.refcount = 0;
  __pyx_pybuffernd_nobs.data = NULL;
  __pyx_pybuffernd_nobs.rcbuffer = &__pyx_pybuffer_nobs;
  __pyx_pybuffer_out.pybuffer.buf = NULL;
  __pyx_pybuffer_out.refcount = 0;
  __pyx_pybuffernd_out.data = NULL;
  __pyx_pybuffernd_out.rcbuffer = &__pyx_pybuffer_out;
  __pyx_pybuffer_counts.pybuffer.buf = NULL;
  __pyx_pybuffer_counts.refcount = 0;
  __pyx_pybuffernd_counts.data = NULL;
  __pyx_pybuffernd_counts.rcbuffer = &__pyx_pybuffer_counts;
  __pyx_pybuffer_values.pybuffer.buf = NULL;
  __pyx_pybuffer_values.refcount = 0;
  __pyx_pybuffernd_values.data = NULL;
  __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values;
  __pyx_pybuffer_bins.pybuffer.buf = NULL;
  __pyx_pybuffer_bins.refcount = 0;
  __pyx_pybuffernd_bins.data = NULL;
  __pyx_pybuffernd_bins.rcbuffer = &__pyx_pybuffer_bins;
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_out.rcbuffer->pybuffer, (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[2]; __pyx_lineno = 6773; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_out.diminfo[0].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_out.diminfo[0].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_out.diminfo[1].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_out.diminfo[1].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[1];
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_counts.rcbuffer->pybuffer, (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[2]; __pyx_lineno = 6773; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_counts.diminfo[0].strides = __pyx_pybuffernd_counts.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_counts.diminfo[0].shape = __pyx_pybuffernd_counts.rcbuffer->pybuffer.shape[0];
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (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[2]; __pyx_lineno = 6773; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_values.diminfo[1].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_values.diminfo[1].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[1];
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_bins.rcbuffer->pybuffer, (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[2]; __pyx_lineno = 6773; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_bins.diminfo[0].strides = __pyx_pybuffernd_bins.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_bins.diminfo[0].shape = __pyx_pybuffernd_bins.rcbuffer->pybuffer.shape[0];

  /* "pandas/src/generated.pyx":6782
 *     cdef:
 *         Py_ssize_t i, j, ngroups
 *         Py_ssize_t N = values.shape[0], K = values.shape[1], b = 0             # <<<<<<<<<<<<<<
 *         float64_t val
 *         ndarray[int64_t, ndim=2] nobs = np.zeros((out.shape[0], out.shape[1]),
 */
  __pyx_v_N = (__pyx_v_values->dimensions[0]);
  __pyx_v_K = (__pyx_v_values->dimensions[1]);
  __pyx_v_b = 0;

  /* "pandas/src/generated.pyx":6784
 *         Py_ssize_t N = values.shape[0], K = values.shape[1], b = 0
 *         float64_t val
 *         ndarray[int64_t, ndim=2] nobs = np.zeros((out.shape[0], out.shape[1]),             # <<<<<<<<<<<<<<
 *                                                  dtype=np.int64)
 * 
 */
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6784; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6784; __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_PyInt_From_Py_intptr_t((__pyx_v_out->dimensions[0])); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6784; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_PyInt_From_Py_intptr_t((__pyx_v_out->dimensions[1])); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6784; __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[2]; __pyx_lineno = 6784; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__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_3);
  __Pyx_GIVEREF(__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[2]; __pyx_lineno = 6784; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__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[2]; __pyx_lineno = 6784; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);

  /* "pandas/src/generated.pyx":6785
 *         float64_t val
 *         ndarray[int64_t, ndim=2] nobs = np.zeros((out.shape[0], out.shape[1]),
 *                                                  dtype=np.int64)             # <<<<<<<<<<<<<<
 * 
 *     ngroups = len(bins) + (bins[len(bins) - 1] != N)
 */
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6785; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_int64); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6785; __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, __pyx_n_s_dtype, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6784; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "pandas/src/generated.pyx":6784
 *         Py_ssize_t N = values.shape[0], K = values.shape[1], b = 0
 *         float64_t val
 *         ndarray[int64_t, ndim=2] nobs = np.zeros((out.shape[0], out.shape[1]),             # <<<<<<<<<<<<<<
 *                                                  dtype=np.int64)
 * 
 */
  __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6784; __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_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__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[2]; __pyx_lineno = 6784; __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_pybuffernd_nobs.rcbuffer->pybuffer, (PyObject*)__pyx_t_6, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) {
      __pyx_v_nobs = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_nobs.rcbuffer->pybuffer.buf = NULL;
      {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6784; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    } else {__pyx_pybuffernd_nobs.diminfo[0].strides = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_nobs.diminfo[0].shape = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_nobs.diminfo[1].strides = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_nobs.diminfo[1].shape = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.shape[1];
    }
  }
  __pyx_t_6 = 0;
  __pyx_v_nobs = ((PyArrayObject *)__pyx_t_5);
  __pyx_t_5 = 0;

  /* "pandas/src/generated.pyx":6787
 *                                                  dtype=np.int64)
 * 
 *     ngroups = len(bins) + (bins[len(bins) - 1] != N)             # <<<<<<<<<<<<<<
 * 
 *     for i in range(N):
 */
  __pyx_t_7 = PyObject_Length(((PyObject *)__pyx_v_bins)); if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6787; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_8 = PyObject_Length(((PyObject *)__pyx_v_bins)); if (unlikely(__pyx_t_8 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6787; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_9 = (__pyx_t_8 - 1);
  __pyx_v_ngroups = (__pyx_t_7 + ((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_bins.rcbuffer->pybuffer.buf, __pyx_t_9, __pyx_pybuffernd_bins.diminfo[0].strides)) != __pyx_v_N));

  /* "pandas/src/generated.pyx":6789
 *     ngroups = len(bins) + (bins[len(bins) - 1] != N)
 * 
 *     for i in range(N):             # <<<<<<<<<<<<<<
 *         while b < ngroups - 1 and i >= bins[b]:
 *             b += 1
 */
  __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;

    /* "pandas/src/generated.pyx":6790
 * 
 *     for i in range(N):
 *         while b < ngroups - 1 and i >= bins[b]:             # <<<<<<<<<<<<<<
 *             b += 1
 * 
 */
    while (1) {
      __pyx_t_10 = ((__pyx_v_b < (__pyx_v_ngroups - 1)) != 0);
      if (__pyx_t_10) {
        __pyx_t_11 = __pyx_v_b;
        __pyx_t_12 = ((__pyx_v_i >= (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_bins.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_bins.diminfo[0].strides))) != 0);
        __pyx_t_13 = __pyx_t_12;
      } else {
        __pyx_t_13 = __pyx_t_10;
      }
      if (!__pyx_t_13) break;

      /* "pandas/src/generated.pyx":6791
 *     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);
    }

    /* "pandas/src/generated.pyx":6793
 *             b += 1
 * 
 *         counts[b] += 1             # <<<<<<<<<<<<<<
 *         for j in range(K):
 *             val = values[i, j]
 */
    __pyx_t_14 = __pyx_v_b;
    *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_counts.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_counts.diminfo[0].strides) += 1;

    /* "pandas/src/generated.pyx":6794
 * 
 *         counts[b] += 1
 *         for j in range(K):             # <<<<<<<<<<<<<<
 *             val = values[i, j]
 * 
 */
    __pyx_t_15 = __pyx_v_K;
    for (__pyx_t_16 = 0; __pyx_t_16 < __pyx_t_15; __pyx_t_16+=1) {
      __pyx_v_j = __pyx_t_16;

      /* "pandas/src/generated.pyx":6795
 *         counts[b] += 1
 *         for j in range(K):
 *             val = values[i, j]             # <<<<<<<<<<<<<<
 * 
 *             # not nan
 */
      __pyx_t_17 = __pyx_v_i;
      __pyx_t_18 = __pyx_v_j;
      __pyx_v_val = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_values.diminfo[0].strides, __pyx_t_18, __pyx_pybuffernd_values.diminfo[1].strides));

      /* "pandas/src/generated.pyx":6798
 * 
 *             # not nan
 *             nobs[b, j] += val == val and val != iNaT             # <<<<<<<<<<<<<<
 * 
 *     for i in range(ngroups):
 */
      __pyx_t_13 = (__pyx_v_val == __pyx_v_val);
      if (__pyx_t_13) {
        __pyx_t_10 = (__pyx_v_val != __pyx_v_6pandas_5algos_iNaT);
        __pyx_t_12 = __pyx_t_10;
      } else {
        __pyx_t_12 = __pyx_t_13;
      }
      __pyx_t_19 = __pyx_v_b;
      __pyx_t_20 = __pyx_v_j;
      *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_nobs.rcbuffer->pybuffer.buf, __pyx_t_19, __pyx_pybuffernd_nobs.diminfo[0].strides, __pyx_t_20, __pyx_pybuffernd_nobs.diminfo[1].strides) += __pyx_t_12;
    }
  }

  /* "pandas/src/generated.pyx":6800
 *             nobs[b, j] += val == val and val != iNaT
 * 
 *     for i in range(ngroups):             # <<<<<<<<<<<<<<
 *         for j in range(K):
 *             out[i, j] = nobs[i, j]
 */
  __pyx_t_8 = __pyx_v_ngroups;
  for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_8; __pyx_t_7+=1) {
    __pyx_v_i = __pyx_t_7;

    /* "pandas/src/generated.pyx":6801
 * 
 *     for i in range(ngroups):
 *         for j in range(K):             # <<<<<<<<<<<<<<
 *             out[i, j] = nobs[i, j]
 * 
 */
    __pyx_t_15 = __pyx_v_K;
    for (__pyx_t_16 = 0; __pyx_t_16 < __pyx_t_15; __pyx_t_16+=1) {
      __pyx_v_j = __pyx_t_16;

      /* "pandas/src/generated.pyx":6802
 *     for i in range(ngroups):
 *         for j in range(K):
 *             out[i, j] = nobs[i, j]             # <<<<<<<<<<<<<<
 * 
 * 
 */
      __pyx_t_21 = __pyx_v_i;
      __pyx_t_22 = __pyx_v_j;
      __pyx_t_23 = __pyx_v_i;
      __pyx_t_24 = __pyx_v_j;
      *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_23, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_24, __pyx_pybuffernd_out.diminfo[1].strides) = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_nobs.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_nobs.diminfo[0].strides, __pyx_t_22, __pyx_pybuffernd_nobs.diminfo[1].strides));
    }
  }

  /* "pandas/src/generated.pyx":6773
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def group_count_bin_float64(ndarray[float64_t, ndim=2] out,             # <<<<<<<<<<<<<<
 *                              ndarray[int64_t] counts,
 *                              ndarray[float64_t, ndim=2] values,
 */

  /* function exit code */
  __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_pybuffernd_bins.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_counts.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas.algos.group_count_bin_float64", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_bins.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_counts.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer);
  __pyx_L2:;
  __Pyx_XDECREF((PyObject *)__pyx_v_nobs);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/src/generated.pyx":6807
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def group_count_bin_float32(ndarray[float32_t, ndim=2] out,             # <<<<<<<<<<<<<<
 *                              ndarray[int64_t] counts,
 *                              ndarray[float32_t, ndim=2] values,
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pandas_5algos_465group_count_bin_float32(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6pandas_5algos_464group_count_bin_float32[] = "\n    Only aggregates on axis=0\n    ";
static PyMethodDef __pyx_mdef_6pandas_5algos_465group_count_bin_float32 = {__Pyx_NAMESTR("group_count_bin_float32"), (PyCFunction)__pyx_pw_6pandas_5algos_465group_count_bin_float32, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6pandas_5algos_464group_count_bin_float32)};
static PyObject *__pyx_pw_6pandas_5algos_465group_count_bin_float32(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;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("group_count_bin_float32 (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_out,&__pyx_n_s_counts,&__pyx_n_s_values,&__pyx_n_s_bins,0};
    PyObject* values[4] = {0,0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_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 (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_out)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_counts)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("group_count_bin_float32", 1, 4, 4, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6807; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("group_count_bin_float32", 1, 4, 4, 2); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6807; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  3:
        if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_bins)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("group_count_bin_float32", 1, 4, 4, 3); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6807; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "group_count_bin_float32") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6807; __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_count_bin_float32", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6807; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas.algos.group_count_bin_float32", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_out), __pyx_ptype_5numpy_ndarray, 1, "out", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6807; __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[2]; __pyx_lineno = 6808; __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[2]; __pyx_lineno = 6809; __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[2]; __pyx_lineno = 6810; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_464group_count_bin_float32(__pyx_self, __pyx_v_out, __pyx_v_counts, __pyx_v_values, __pyx_v_bins);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pandas_5algos_464group_count_bin_float32(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_out, PyArrayObject *__pyx_v_counts, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_bins) {
  Py_ssize_t __pyx_v_i;
  Py_ssize_t __pyx_v_j;
  Py_ssize_t __pyx_v_ngroups;
  Py_ssize_t __pyx_v_N;
  Py_ssize_t __pyx_v_K;
  Py_ssize_t __pyx_v_b;
  __pyx_t_5numpy_float32_t __pyx_v_val;
  PyArrayObject *__pyx_v_nobs = 0;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_bins;
  __Pyx_Buffer __pyx_pybuffer_bins;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_counts;
  __Pyx_Buffer __pyx_pybuffer_counts;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_nobs;
  __Pyx_Buffer __pyx_pybuffer_nobs;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_out;
  __Pyx_Buffer __pyx_pybuffer_out;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_values;
  __Pyx_Buffer __pyx_pybuffer_values;
  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;
  Py_ssize_t __pyx_t_7;
  Py_ssize_t __pyx_t_8;
  Py_ssize_t __pyx_t_9;
  int __pyx_t_10;
  Py_ssize_t __pyx_t_11;
  int __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;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("group_count_bin_float32", 0);
  __pyx_pybuffer_nobs.pybuffer.buf = NULL;
  __pyx_pybuffer_nobs.refcount = 0;
  __pyx_pybuffernd_nobs.data = NULL;
  __pyx_pybuffernd_nobs.rcbuffer = &__pyx_pybuffer_nobs;
  __pyx_pybuffer_out.pybuffer.buf = NULL;
  __pyx_pybuffer_out.refcount = 0;
  __pyx_pybuffernd_out.data = NULL;
  __pyx_pybuffernd_out.rcbuffer = &__pyx_pybuffer_out;
  __pyx_pybuffer_counts.pybuffer.buf = NULL;
  __pyx_pybuffer_counts.refcount = 0;
  __pyx_pybuffernd_counts.data = NULL;
  __pyx_pybuffernd_counts.rcbuffer = &__pyx_pybuffer_counts;
  __pyx_pybuffer_values.pybuffer.buf = NULL;
  __pyx_pybuffer_values.refcount = 0;
  __pyx_pybuffernd_values.data = NULL;
  __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values;
  __pyx_pybuffer_bins.pybuffer.buf = NULL;
  __pyx_pybuffer_bins.refcount = 0;
  __pyx_pybuffernd_bins.data = NULL;
  __pyx_pybuffernd_bins.rcbuffer = &__pyx_pybuffer_bins;
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_out.rcbuffer->pybuffer, (PyObject*)__pyx_v_out, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6807; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_out.diminfo[0].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_out.diminfo[0].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_out.diminfo[1].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_out.diminfo[1].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[1];
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_counts.rcbuffer->pybuffer, (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[2]; __pyx_lineno = 6807; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_counts.diminfo[0].strides = __pyx_pybuffernd_counts.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_counts.diminfo[0].shape = __pyx_pybuffernd_counts.rcbuffer->pybuffer.shape[0];
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6807; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_values.diminfo[1].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_values.diminfo[1].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[1];
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_bins.rcbuffer->pybuffer, (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[2]; __pyx_lineno = 6807; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_bins.diminfo[0].strides = __pyx_pybuffernd_bins.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_bins.diminfo[0].shape = __pyx_pybuffernd_bins.rcbuffer->pybuffer.shape[0];

  /* "pandas/src/generated.pyx":6816
 *     cdef:
 *         Py_ssize_t i, j, ngroups
 *         Py_ssize_t N = values.shape[0], K = values.shape[1], b = 0             # <<<<<<<<<<<<<<
 *         float32_t val
 *         ndarray[int64_t, ndim=2] nobs = np.zeros((out.shape[0], out.shape[1]),
 */
  __pyx_v_N = (__pyx_v_values->dimensions[0]);
  __pyx_v_K = (__pyx_v_values->dimensions[1]);
  __pyx_v_b = 0;

  /* "pandas/src/generated.pyx":6818
 *         Py_ssize_t N = values.shape[0], K = values.shape[1], b = 0
 *         float32_t val
 *         ndarray[int64_t, ndim=2] nobs = np.zeros((out.shape[0], out.shape[1]),             # <<<<<<<<<<<<<<
 *                                                  dtype=np.int64)
 * 
 */
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6818; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6818; __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_PyInt_From_Py_intptr_t((__pyx_v_out->dimensions[0])); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6818; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_PyInt_From_Py_intptr_t((__pyx_v_out->dimensions[1])); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6818; __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[2]; __pyx_lineno = 6818; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__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_3);
  __Pyx_GIVEREF(__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[2]; __pyx_lineno = 6818; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__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[2]; __pyx_lineno = 6818; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);

  /* "pandas/src/generated.pyx":6819
 *         float32_t val
 *         ndarray[int64_t, ndim=2] nobs = np.zeros((out.shape[0], out.shape[1]),
 *                                                  dtype=np.int64)             # <<<<<<<<<<<<<<
 * 
 *     ngroups = len(bins) + (bins[len(bins) - 1] != N)
 */
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6819; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_int64); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6819; __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, __pyx_n_s_dtype, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6818; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "pandas/src/generated.pyx":6818
 *         Py_ssize_t N = values.shape[0], K = values.shape[1], b = 0
 *         float32_t val
 *         ndarray[int64_t, ndim=2] nobs = np.zeros((out.shape[0], out.shape[1]),             # <<<<<<<<<<<<<<
 *                                                  dtype=np.int64)
 * 
 */
  __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6818; __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_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__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[2]; __pyx_lineno = 6818; __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_pybuffernd_nobs.rcbuffer->pybuffer, (PyObject*)__pyx_t_6, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) {
      __pyx_v_nobs = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_nobs.rcbuffer->pybuffer.buf = NULL;
      {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6818; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    } else {__pyx_pybuffernd_nobs.diminfo[0].strides = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_nobs.diminfo[0].shape = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_nobs.diminfo[1].strides = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_nobs.diminfo[1].shape = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.shape[1];
    }
  }
  __pyx_t_6 = 0;
  __pyx_v_nobs = ((PyArrayObject *)__pyx_t_5);
  __pyx_t_5 = 0;

  /* "pandas/src/generated.pyx":6821
 *                                                  dtype=np.int64)
 * 
 *     ngroups = len(bins) + (bins[len(bins) - 1] != N)             # <<<<<<<<<<<<<<
 * 
 *     for i in range(N):
 */
  __pyx_t_7 = PyObject_Length(((PyObject *)__pyx_v_bins)); if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6821; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_8 = PyObject_Length(((PyObject *)__pyx_v_bins)); if (unlikely(__pyx_t_8 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6821; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_9 = (__pyx_t_8 - 1);
  __pyx_v_ngroups = (__pyx_t_7 + ((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_bins.rcbuffer->pybuffer.buf, __pyx_t_9, __pyx_pybuffernd_bins.diminfo[0].strides)) != __pyx_v_N));

  /* "pandas/src/generated.pyx":6823
 *     ngroups = len(bins) + (bins[len(bins) - 1] != N)
 * 
 *     for i in range(N):             # <<<<<<<<<<<<<<
 *         while b < ngroups - 1 and i >= bins[b]:
 *             b += 1
 */
  __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;

    /* "pandas/src/generated.pyx":6824
 * 
 *     for i in range(N):
 *         while b < ngroups - 1 and i >= bins[b]:             # <<<<<<<<<<<<<<
 *             b += 1
 * 
 */
    while (1) {
      __pyx_t_10 = ((__pyx_v_b < (__pyx_v_ngroups - 1)) != 0);
      if (__pyx_t_10) {
        __pyx_t_11 = __pyx_v_b;
        __pyx_t_12 = ((__pyx_v_i >= (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_bins.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_bins.diminfo[0].strides))) != 0);
        __pyx_t_13 = __pyx_t_12;
      } else {
        __pyx_t_13 = __pyx_t_10;
      }
      if (!__pyx_t_13) break;

      /* "pandas/src/generated.pyx":6825
 *     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);
    }

    /* "pandas/src/generated.pyx":6827
 *             b += 1
 * 
 *         counts[b] += 1             # <<<<<<<<<<<<<<
 *         for j in range(K):
 *             val = values[i, j]
 */
    __pyx_t_14 = __pyx_v_b;
    *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_counts.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_counts.diminfo[0].strides) += 1;

    /* "pandas/src/generated.pyx":6828
 * 
 *         counts[b] += 1
 *         for j in range(K):             # <<<<<<<<<<<<<<
 *             val = values[i, j]
 * 
 */
    __pyx_t_15 = __pyx_v_K;
    for (__pyx_t_16 = 0; __pyx_t_16 < __pyx_t_15; __pyx_t_16+=1) {
      __pyx_v_j = __pyx_t_16;

      /* "pandas/src/generated.pyx":6829
 *         counts[b] += 1
 *         for j in range(K):
 *             val = values[i, j]             # <<<<<<<<<<<<<<
 * 
 *             # not nan
 */
      __pyx_t_17 = __pyx_v_i;
      __pyx_t_18 = __pyx_v_j;
      __pyx_v_val = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_values.diminfo[0].strides, __pyx_t_18, __pyx_pybuffernd_values.diminfo[1].strides));

      /* "pandas/src/generated.pyx":6832
 * 
 *             # not nan
 *             nobs[b, j] += val == val and val != iNaT             # <<<<<<<<<<<<<<
 * 
 *     for i in range(ngroups):
 */
      __pyx_t_13 = (__pyx_v_val == __pyx_v_val);
      if (__pyx_t_13) {
        __pyx_t_10 = (__pyx_v_val != __pyx_v_6pandas_5algos_iNaT);
        __pyx_t_12 = __pyx_t_10;
      } else {
        __pyx_t_12 = __pyx_t_13;
      }
      __pyx_t_19 = __pyx_v_b;
      __pyx_t_20 = __pyx_v_j;
      *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_nobs.rcbuffer->pybuffer.buf, __pyx_t_19, __pyx_pybuffernd_nobs.diminfo[0].strides, __pyx_t_20, __pyx_pybuffernd_nobs.diminfo[1].strides) += __pyx_t_12;
    }
  }

  /* "pandas/src/generated.pyx":6834
 *             nobs[b, j] += val == val and val != iNaT
 * 
 *     for i in range(ngroups):             # <<<<<<<<<<<<<<
 *         for j in range(K):
 *             out[i, j] = nobs[i, j]
 */
  __pyx_t_8 = __pyx_v_ngroups;
  for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_8; __pyx_t_7+=1) {
    __pyx_v_i = __pyx_t_7;

    /* "pandas/src/generated.pyx":6835
 * 
 *     for i in range(ngroups):
 *         for j in range(K):             # <<<<<<<<<<<<<<
 *             out[i, j] = nobs[i, j]
 * 
 */
    __pyx_t_15 = __pyx_v_K;
    for (__pyx_t_16 = 0; __pyx_t_16 < __pyx_t_15; __pyx_t_16+=1) {
      __pyx_v_j = __pyx_t_16;

      /* "pandas/src/generated.pyx":6836
 *     for i in range(ngroups):
 *         for j in range(K):
 *             out[i, j] = nobs[i, j]             # <<<<<<<<<<<<<<
 * 
 * 
 */
      __pyx_t_21 = __pyx_v_i;
      __pyx_t_22 = __pyx_v_j;
      __pyx_t_23 = __pyx_v_i;
      __pyx_t_24 = __pyx_v_j;
      *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_23, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_24, __pyx_pybuffernd_out.diminfo[1].strides) = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_nobs.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_nobs.diminfo[0].strides, __pyx_t_22, __pyx_pybuffernd_nobs.diminfo[1].strides));
    }
  }

  /* "pandas/src/generated.pyx":6807
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def group_count_bin_float32(ndarray[float32_t, ndim=2] out,             # <<<<<<<<<<<<<<
 *                              ndarray[int64_t] counts,
 *                              ndarray[float32_t, ndim=2] values,
 */

  /* function exit code */
  __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_pybuffernd_bins.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_counts.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas.algos.group_count_bin_float32", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_bins.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_counts.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer);
  __pyx_L2:;
  __Pyx_XDECREF((PyObject *)__pyx_v_nobs);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/src/generated.pyx":6841
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def group_count_bin_object(ndarray[float64_t, ndim=2] out,             # <<<<<<<<<<<<<<
 *                              ndarray[int64_t] counts,
 *                              ndarray[object, ndim=2] values,
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pandas_5algos_467group_count_bin_object(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6pandas_5algos_466group_count_bin_object[] = "\n    Only aggregates on axis=0\n    ";
static PyMethodDef __pyx_mdef_6pandas_5algos_467group_count_bin_object = {__Pyx_NAMESTR("group_count_bin_object"), (PyCFunction)__pyx_pw_6pandas_5algos_467group_count_bin_object, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6pandas_5algos_466group_count_bin_object)};
static PyObject *__pyx_pw_6pandas_5algos_467group_count_bin_object(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;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("group_count_bin_object (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_out,&__pyx_n_s_counts,&__pyx_n_s_values,&__pyx_n_s_bins,0};
    PyObject* values[4] = {0,0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_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 (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_out)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_counts)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("group_count_bin_object", 1, 4, 4, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6841; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("group_count_bin_object", 1, 4, 4, 2); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6841; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  3:
        if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_bins)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("group_count_bin_object", 1, 4, 4, 3); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6841; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "group_count_bin_object") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6841; __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_count_bin_object", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6841; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas.algos.group_count_bin_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_out), __pyx_ptype_5numpy_ndarray, 1, "out", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6841; __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[2]; __pyx_lineno = 6842; __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[2]; __pyx_lineno = 6843; __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[2]; __pyx_lineno = 6844; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_466group_count_bin_object(__pyx_self, __pyx_v_out, __pyx_v_counts, __pyx_v_values, __pyx_v_bins);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pandas_5algos_466group_count_bin_object(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_out, PyArrayObject *__pyx_v_counts, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_bins) {
  Py_ssize_t __pyx_v_i;
  Py_ssize_t __pyx_v_j;
  Py_ssize_t __pyx_v_ngroups;
  Py_ssize_t __pyx_v_N;
  Py_ssize_t __pyx_v_K;
  Py_ssize_t __pyx_v_b;
  PyObject *__pyx_v_val = 0;
  PyArrayObject *__pyx_v_nobs = 0;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_bins;
  __Pyx_Buffer __pyx_pybuffer_bins;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_counts;
  __Pyx_Buffer __pyx_pybuffer_counts;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_nobs;
  __Pyx_Buffer __pyx_pybuffer_nobs;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_out;
  __Pyx_Buffer __pyx_pybuffer_out;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_values;
  __Pyx_Buffer __pyx_pybuffer_values;
  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;
  Py_ssize_t __pyx_t_7;
  Py_ssize_t __pyx_t_8;
  Py_ssize_t __pyx_t_9;
  int __pyx_t_10;
  Py_ssize_t __pyx_t_11;
  int __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;
  __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;
  Py_ssize_t __pyx_t_25;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("group_count_bin_object", 0);
  __pyx_pybuffer_nobs.pybuffer.buf = NULL;
  __pyx_pybuffer_nobs.refcount = 0;
  __pyx_pybuffernd_nobs.data = NULL;
  __pyx_pybuffernd_nobs.rcbuffer = &__pyx_pybuffer_nobs;
  __pyx_pybuffer_out.pybuffer.buf = NULL;
  __pyx_pybuffer_out.refcount = 0;
  __pyx_pybuffernd_out.data = NULL;
  __pyx_pybuffernd_out.rcbuffer = &__pyx_pybuffer_out;
  __pyx_pybuffer_counts.pybuffer.buf = NULL;
  __pyx_pybuffer_counts.refcount = 0;
  __pyx_pybuffernd_counts.data = NULL;
  __pyx_pybuffernd_counts.rcbuffer = &__pyx_pybuffer_counts;
  __pyx_pybuffer_values.pybuffer.buf = NULL;
  __pyx_pybuffer_values.refcount = 0;
  __pyx_pybuffernd_values.data = NULL;
  __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values;
  __pyx_pybuffer_bins.pybuffer.buf = NULL;
  __pyx_pybuffer_bins.refcount = 0;
  __pyx_pybuffernd_bins.data = NULL;
  __pyx_pybuffernd_bins.rcbuffer = &__pyx_pybuffer_bins;
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_out.rcbuffer->pybuffer, (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[2]; __pyx_lineno = 6841; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_out.diminfo[0].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_out.diminfo[0].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_out.diminfo[1].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_out.diminfo[1].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[1];
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_counts.rcbuffer->pybuffer, (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[2]; __pyx_lineno = 6841; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_counts.diminfo[0].strides = __pyx_pybuffernd_counts.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_counts.diminfo[0].shape = __pyx_pybuffernd_counts.rcbuffer->pybuffer.shape[0];
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6841; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_values.diminfo[1].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_values.diminfo[1].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[1];
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_bins.rcbuffer->pybuffer, (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[2]; __pyx_lineno = 6841; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_bins.diminfo[0].strides = __pyx_pybuffernd_bins.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_bins.diminfo[0].shape = __pyx_pybuffernd_bins.rcbuffer->pybuffer.shape[0];

  /* "pandas/src/generated.pyx":6850
 *     cdef:
 *         Py_ssize_t i, j, ngroups
 *         Py_ssize_t N = values.shape[0], K = values.shape[1], b = 0             # <<<<<<<<<<<<<<
 *         object val
 *         ndarray[int64_t, ndim=2] nobs = np.zeros((out.shape[0], out.shape[1]),
 */
  __pyx_v_N = (__pyx_v_values->dimensions[0]);
  __pyx_v_K = (__pyx_v_values->dimensions[1]);
  __pyx_v_b = 0;

  /* "pandas/src/generated.pyx":6852
 *         Py_ssize_t N = values.shape[0], K = values.shape[1], b = 0
 *         object val
 *         ndarray[int64_t, ndim=2] nobs = np.zeros((out.shape[0], out.shape[1]),             # <<<<<<<<<<<<<<
 *                                                  dtype=np.int64)
 * 
 */
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6852; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6852; __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_PyInt_From_Py_intptr_t((__pyx_v_out->dimensions[0])); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6852; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_PyInt_From_Py_intptr_t((__pyx_v_out->dimensions[1])); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6852; __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[2]; __pyx_lineno = 6852; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__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_3);
  __Pyx_GIVEREF(__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[2]; __pyx_lineno = 6852; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__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[2]; __pyx_lineno = 6852; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);

  /* "pandas/src/generated.pyx":6853
 *         object val
 *         ndarray[int64_t, ndim=2] nobs = np.zeros((out.shape[0], out.shape[1]),
 *                                                  dtype=np.int64)             # <<<<<<<<<<<<<<
 * 
 *     ngroups = len(bins) + (bins[len(bins) - 1] != N)
 */
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6853; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_int64); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6853; __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, __pyx_n_s_dtype, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6852; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "pandas/src/generated.pyx":6852
 *         Py_ssize_t N = values.shape[0], K = values.shape[1], b = 0
 *         object val
 *         ndarray[int64_t, ndim=2] nobs = np.zeros((out.shape[0], out.shape[1]),             # <<<<<<<<<<<<<<
 *                                                  dtype=np.int64)
 * 
 */
  __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6852; __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_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__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[2]; __pyx_lineno = 6852; __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_pybuffernd_nobs.rcbuffer->pybuffer, (PyObject*)__pyx_t_6, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) {
      __pyx_v_nobs = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_nobs.rcbuffer->pybuffer.buf = NULL;
      {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6852; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    } else {__pyx_pybuffernd_nobs.diminfo[0].strides = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_nobs.diminfo[0].shape = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_nobs.diminfo[1].strides = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_nobs.diminfo[1].shape = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.shape[1];
    }
  }
  __pyx_t_6 = 0;
  __pyx_v_nobs = ((PyArrayObject *)__pyx_t_5);
  __pyx_t_5 = 0;

  /* "pandas/src/generated.pyx":6855
 *                                                  dtype=np.int64)
 * 
 *     ngroups = len(bins) + (bins[len(bins) - 1] != N)             # <<<<<<<<<<<<<<
 * 
 *     for i in range(N):
 */
  __pyx_t_7 = PyObject_Length(((PyObject *)__pyx_v_bins)); if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6855; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_8 = PyObject_Length(((PyObject *)__pyx_v_bins)); if (unlikely(__pyx_t_8 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6855; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_9 = (__pyx_t_8 - 1);
  __pyx_v_ngroups = (__pyx_t_7 + ((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_bins.rcbuffer->pybuffer.buf, __pyx_t_9, __pyx_pybuffernd_bins.diminfo[0].strides)) != __pyx_v_N));

  /* "pandas/src/generated.pyx":6857
 *     ngroups = len(bins) + (bins[len(bins) - 1] != N)
 * 
 *     for i in range(N):             # <<<<<<<<<<<<<<
 *         while b < ngroups - 1 and i >= bins[b]:
 *             b += 1
 */
  __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;

    /* "pandas/src/generated.pyx":6858
 * 
 *     for i in range(N):
 *         while b < ngroups - 1 and i >= bins[b]:             # <<<<<<<<<<<<<<
 *             b += 1
 * 
 */
    while (1) {
      __pyx_t_10 = ((__pyx_v_b < (__pyx_v_ngroups - 1)) != 0);
      if (__pyx_t_10) {
        __pyx_t_11 = __pyx_v_b;
        __pyx_t_12 = ((__pyx_v_i >= (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_bins.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_bins.diminfo[0].strides))) != 0);
        __pyx_t_13 = __pyx_t_12;
      } else {
        __pyx_t_13 = __pyx_t_10;
      }
      if (!__pyx_t_13) break;

      /* "pandas/src/generated.pyx":6859
 *     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);
    }

    /* "pandas/src/generated.pyx":6861
 *             b += 1
 * 
 *         counts[b] += 1             # <<<<<<<<<<<<<<
 *         for j in range(K):
 *             val = values[i, j]
 */
    __pyx_t_14 = __pyx_v_b;
    *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_counts.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_counts.diminfo[0].strides) += 1;

    /* "pandas/src/generated.pyx":6862
 * 
 *         counts[b] += 1
 *         for j in range(K):             # <<<<<<<<<<<<<<
 *             val = values[i, j]
 * 
 */
    __pyx_t_15 = __pyx_v_K;
    for (__pyx_t_16 = 0; __pyx_t_16 < __pyx_t_15; __pyx_t_16+=1) {
      __pyx_v_j = __pyx_t_16;

      /* "pandas/src/generated.pyx":6863
 *         counts[b] += 1
 *         for j in range(K):
 *             val = values[i, j]             # <<<<<<<<<<<<<<
 * 
 *             # not nan
 */
      __pyx_t_17 = __pyx_v_i;
      __pyx_t_18 = __pyx_v_j;
      __pyx_t_5 = (PyObject *) *__Pyx_BufPtrStrided2d(PyObject **, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_values.diminfo[0].strides, __pyx_t_18, __pyx_pybuffernd_values.diminfo[1].strides);
      __Pyx_INCREF((PyObject*)__pyx_t_5);
      __Pyx_XDECREF_SET(__pyx_v_val, __pyx_t_5);
      __pyx_t_5 = 0;

      /* "pandas/src/generated.pyx":6866
 * 
 *             # not nan
 *             nobs[b, j] += val == val and val != iNaT             # <<<<<<<<<<<<<<
 * 
 *     for i in range(ngroups):
 */
      __pyx_t_5 = PyObject_RichCompare(__pyx_v_val, __pyx_v_val, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6866; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_t_13 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_13 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6866; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      if (__pyx_t_13) {
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __pyx_t_4 = __Pyx_PyInt_From_npy_int64(__pyx_v_6pandas_5algos_iNaT); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6866; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_4);
        __pyx_t_3 = PyObject_RichCompare(__pyx_v_val, __pyx_t_4, Py_NE); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6866; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __pyx_t_4 = __pyx_t_3;
        __pyx_t_3 = 0;
      } else {
        __pyx_t_4 = __pyx_t_5;
        __pyx_t_5 = 0;
      }
      __pyx_t_19 = __Pyx_PyInt_As_npy_int64(__pyx_t_4); if (unlikely((__pyx_t_19 == (npy_int64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6866; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_20 = __pyx_v_b;
      __pyx_t_21 = __pyx_v_j;
      *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_nobs.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_nobs.diminfo[0].strides, __pyx_t_21, __pyx_pybuffernd_nobs.diminfo[1].strides) += __pyx_t_19;
    }
  }

  /* "pandas/src/generated.pyx":6868
 *             nobs[b, j] += val == val and val != iNaT
 * 
 *     for i in range(ngroups):             # <<<<<<<<<<<<<<
 *         for j in range(K):
 *             out[i, j] = nobs[i, j]
 */
  __pyx_t_8 = __pyx_v_ngroups;
  for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_8; __pyx_t_7+=1) {
    __pyx_v_i = __pyx_t_7;

    /* "pandas/src/generated.pyx":6869
 * 
 *     for i in range(ngroups):
 *         for j in range(K):             # <<<<<<<<<<<<<<
 *             out[i, j] = nobs[i, j]
 * 
 */
    __pyx_t_15 = __pyx_v_K;
    for (__pyx_t_16 = 0; __pyx_t_16 < __pyx_t_15; __pyx_t_16+=1) {
      __pyx_v_j = __pyx_t_16;

      /* "pandas/src/generated.pyx":6870
 *     for i in range(ngroups):
 *         for j in range(K):
 *             out[i, j] = nobs[i, j]             # <<<<<<<<<<<<<<
 * 
 * 
 */
      __pyx_t_22 = __pyx_v_i;
      __pyx_t_23 = __pyx_v_j;
      __pyx_t_24 = __pyx_v_i;
      __pyx_t_25 = __pyx_v_j;
      *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_24, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_25, __pyx_pybuffernd_out.diminfo[1].strides) = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_nobs.rcbuffer->pybuffer.buf, __pyx_t_22, __pyx_pybuffernd_nobs.diminfo[0].strides, __pyx_t_23, __pyx_pybuffernd_nobs.diminfo[1].strides));
    }
  }

  /* "pandas/src/generated.pyx":6841
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def group_count_bin_object(ndarray[float64_t, ndim=2] out,             # <<<<<<<<<<<<<<
 *                              ndarray[int64_t] counts,
 *                              ndarray[object, ndim=2] values,
 */

  /* function exit code */
  __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_pybuffernd_bins.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_counts.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas.algos.group_count_bin_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_bins.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_counts.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer);
  __pyx_L2:;
  __Pyx_XDECREF(__pyx_v_val);
  __Pyx_XDECREF((PyObject *)__pyx_v_nobs);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/src/generated.pyx":6875
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def group_count_bin_int64(ndarray[float64_t, ndim=2] out,             # <<<<<<<<<<<<<<
 *                              ndarray[int64_t] counts,
 *                              ndarray[int64_t, ndim=2] values,
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pandas_5algos_469group_count_bin_int64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6pandas_5algos_468group_count_bin_int64[] = "\n    Only aggregates on axis=0\n    ";
static PyMethodDef __pyx_mdef_6pandas_5algos_469group_count_bin_int64 = {__Pyx_NAMESTR("group_count_bin_int64"), (PyCFunction)__pyx_pw_6pandas_5algos_469group_count_bin_int64, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6pandas_5algos_468group_count_bin_int64)};
static PyObject *__pyx_pw_6pandas_5algos_469group_count_bin_int64(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;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("group_count_bin_int64 (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_out,&__pyx_n_s_counts,&__pyx_n_s_values,&__pyx_n_s_bins,0};
    PyObject* values[4] = {0,0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_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 (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_out)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_counts)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("group_count_bin_int64", 1, 4, 4, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6875; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("group_count_bin_int64", 1, 4, 4, 2); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6875; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  3:
        if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_bins)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("group_count_bin_int64", 1, 4, 4, 3); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6875; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "group_count_bin_int64") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6875; __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_count_bin_int64", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6875; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas.algos.group_count_bin_int64", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_out), __pyx_ptype_5numpy_ndarray, 1, "out", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6875; __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[2]; __pyx_lineno = 6876; __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[2]; __pyx_lineno = 6877; __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[2]; __pyx_lineno = 6878; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_468group_count_bin_int64(__pyx_self, __pyx_v_out, __pyx_v_counts, __pyx_v_values, __pyx_v_bins);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pandas_5algos_468group_count_bin_int64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_out, PyArrayObject *__pyx_v_counts, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_bins) {
  Py_ssize_t __pyx_v_i;
  Py_ssize_t __pyx_v_j;
  Py_ssize_t __pyx_v_ngroups;
  Py_ssize_t __pyx_v_N;
  Py_ssize_t __pyx_v_K;
  Py_ssize_t __pyx_v_b;
  __pyx_t_5numpy_int64_t __pyx_v_val;
  PyArrayObject *__pyx_v_nobs = 0;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_bins;
  __Pyx_Buffer __pyx_pybuffer_bins;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_counts;
  __Pyx_Buffer __pyx_pybuffer_counts;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_nobs;
  __Pyx_Buffer __pyx_pybuffer_nobs;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_out;
  __Pyx_Buffer __pyx_pybuffer_out;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_values;
  __Pyx_Buffer __pyx_pybuffer_values;
  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;
  Py_ssize_t __pyx_t_7;
  Py_ssize_t __pyx_t_8;
  Py_ssize_t __pyx_t_9;
  int __pyx_t_10;
  Py_ssize_t __pyx_t_11;
  int __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;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("group_count_bin_int64", 0);
  __pyx_pybuffer_nobs.pybuffer.buf = NULL;
  __pyx_pybuffer_nobs.refcount = 0;
  __pyx_pybuffernd_nobs.data = NULL;
  __pyx_pybuffernd_nobs.rcbuffer = &__pyx_pybuffer_nobs;
  __pyx_pybuffer_out.pybuffer.buf = NULL;
  __pyx_pybuffer_out.refcount = 0;
  __pyx_pybuffernd_out.data = NULL;
  __pyx_pybuffernd_out.rcbuffer = &__pyx_pybuffer_out;
  __pyx_pybuffer_counts.pybuffer.buf = NULL;
  __pyx_pybuffer_counts.refcount = 0;
  __pyx_pybuffernd_counts.data = NULL;
  __pyx_pybuffernd_counts.rcbuffer = &__pyx_pybuffer_counts;
  __pyx_pybuffer_values.pybuffer.buf = NULL;
  __pyx_pybuffer_values.refcount = 0;
  __pyx_pybuffernd_values.data = NULL;
  __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values;
  __pyx_pybuffer_bins.pybuffer.buf = NULL;
  __pyx_pybuffer_bins.refcount = 0;
  __pyx_pybuffernd_bins.data = NULL;
  __pyx_pybuffernd_bins.rcbuffer = &__pyx_pybuffer_bins;
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_out.rcbuffer->pybuffer, (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[2]; __pyx_lineno = 6875; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_out.diminfo[0].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_out.diminfo[0].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_out.diminfo[1].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_out.diminfo[1].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[1];
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_counts.rcbuffer->pybuffer, (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[2]; __pyx_lineno = 6875; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_counts.diminfo[0].strides = __pyx_pybuffernd_counts.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_counts.diminfo[0].shape = __pyx_pybuffernd_counts.rcbuffer->pybuffer.shape[0];
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (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[2]; __pyx_lineno = 6875; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_values.diminfo[1].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_values.diminfo[1].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[1];
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_bins.rcbuffer->pybuffer, (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[2]; __pyx_lineno = 6875; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_bins.diminfo[0].strides = __pyx_pybuffernd_bins.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_bins.diminfo[0].shape = __pyx_pybuffernd_bins.rcbuffer->pybuffer.shape[0];

  /* "pandas/src/generated.pyx":6884
 *     cdef:
 *         Py_ssize_t i, j, ngroups
 *         Py_ssize_t N = values.shape[0], K = values.shape[1], b = 0             # <<<<<<<<<<<<<<
 *         int64_t val
 *         ndarray[int64_t, ndim=2] nobs = np.zeros((out.shape[0], out.shape[1]),
 */
  __pyx_v_N = (__pyx_v_values->dimensions[0]);
  __pyx_v_K = (__pyx_v_values->dimensions[1]);
  __pyx_v_b = 0;

  /* "pandas/src/generated.pyx":6886
 *         Py_ssize_t N = values.shape[0], K = values.shape[1], b = 0
 *         int64_t val
 *         ndarray[int64_t, ndim=2] nobs = np.zeros((out.shape[0], out.shape[1]),             # <<<<<<<<<<<<<<
 *                                                  dtype=np.int64)
 * 
 */
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6886; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6886; __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_PyInt_From_Py_intptr_t((__pyx_v_out->dimensions[0])); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6886; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_PyInt_From_Py_intptr_t((__pyx_v_out->dimensions[1])); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6886; __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[2]; __pyx_lineno = 6886; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__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_3);
  __Pyx_GIVEREF(__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[2]; __pyx_lineno = 6886; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__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[2]; __pyx_lineno = 6886; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);

  /* "pandas/src/generated.pyx":6887
 *         int64_t val
 *         ndarray[int64_t, ndim=2] nobs = np.zeros((out.shape[0], out.shape[1]),
 *                                                  dtype=np.int64)             # <<<<<<<<<<<<<<
 * 
 *     ngroups = len(bins) + (bins[len(bins) - 1] != N)
 */
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6887; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_int64); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6887; __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, __pyx_n_s_dtype, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6886; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "pandas/src/generated.pyx":6886
 *         Py_ssize_t N = values.shape[0], K = values.shape[1], b = 0
 *         int64_t val
 *         ndarray[int64_t, ndim=2] nobs = np.zeros((out.shape[0], out.shape[1]),             # <<<<<<<<<<<<<<
 *                                                  dtype=np.int64)
 * 
 */
  __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6886; __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_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__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[2]; __pyx_lineno = 6886; __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_pybuffernd_nobs.rcbuffer->pybuffer, (PyObject*)__pyx_t_6, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) {
      __pyx_v_nobs = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_nobs.rcbuffer->pybuffer.buf = NULL;
      {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6886; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    } else {__pyx_pybuffernd_nobs.diminfo[0].strides = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_nobs.diminfo[0].shape = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_nobs.diminfo[1].strides = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_nobs.diminfo[1].shape = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.shape[1];
    }
  }
  __pyx_t_6 = 0;
  __pyx_v_nobs = ((PyArrayObject *)__pyx_t_5);
  __pyx_t_5 = 0;

  /* "pandas/src/generated.pyx":6889
 *                                                  dtype=np.int64)
 * 
 *     ngroups = len(bins) + (bins[len(bins) - 1] != N)             # <<<<<<<<<<<<<<
 * 
 *     for i in range(N):
 */
  __pyx_t_7 = PyObject_Length(((PyObject *)__pyx_v_bins)); if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6889; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_8 = PyObject_Length(((PyObject *)__pyx_v_bins)); if (unlikely(__pyx_t_8 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6889; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_9 = (__pyx_t_8 - 1);
  __pyx_v_ngroups = (__pyx_t_7 + ((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_bins.rcbuffer->pybuffer.buf, __pyx_t_9, __pyx_pybuffernd_bins.diminfo[0].strides)) != __pyx_v_N));

  /* "pandas/src/generated.pyx":6891
 *     ngroups = len(bins) + (bins[len(bins) - 1] != N)
 * 
 *     for i in range(N):             # <<<<<<<<<<<<<<
 *         while b < ngroups - 1 and i >= bins[b]:
 *             b += 1
 */
  __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;

    /* "pandas/src/generated.pyx":6892
 * 
 *     for i in range(N):
 *         while b < ngroups - 1 and i >= bins[b]:             # <<<<<<<<<<<<<<
 *             b += 1
 * 
 */
    while (1) {
      __pyx_t_10 = ((__pyx_v_b < (__pyx_v_ngroups - 1)) != 0);
      if (__pyx_t_10) {
        __pyx_t_11 = __pyx_v_b;
        __pyx_t_12 = ((__pyx_v_i >= (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_bins.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_bins.diminfo[0].strides))) != 0);
        __pyx_t_13 = __pyx_t_12;
      } else {
        __pyx_t_13 = __pyx_t_10;
      }
      if (!__pyx_t_13) break;

      /* "pandas/src/generated.pyx":6893
 *     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);
    }

    /* "pandas/src/generated.pyx":6895
 *             b += 1
 * 
 *         counts[b] += 1             # <<<<<<<<<<<<<<
 *         for j in range(K):
 *             val = values[i, j]
 */
    __pyx_t_14 = __pyx_v_b;
    *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_counts.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_counts.diminfo[0].strides) += 1;

    /* "pandas/src/generated.pyx":6896
 * 
 *         counts[b] += 1
 *         for j in range(K):             # <<<<<<<<<<<<<<
 *             val = values[i, j]
 * 
 */
    __pyx_t_15 = __pyx_v_K;
    for (__pyx_t_16 = 0; __pyx_t_16 < __pyx_t_15; __pyx_t_16+=1) {
      __pyx_v_j = __pyx_t_16;

      /* "pandas/src/generated.pyx":6897
 *         counts[b] += 1
 *         for j in range(K):
 *             val = values[i, j]             # <<<<<<<<<<<<<<
 * 
 *             # not nan
 */
      __pyx_t_17 = __pyx_v_i;
      __pyx_t_18 = __pyx_v_j;
      __pyx_v_val = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_values.diminfo[0].strides, __pyx_t_18, __pyx_pybuffernd_values.diminfo[1].strides));

      /* "pandas/src/generated.pyx":6900
 * 
 *             # not nan
 *             nobs[b, j] += val == val and val != iNaT             # <<<<<<<<<<<<<<
 * 
 *     for i in range(ngroups):
 */
      __pyx_t_13 = (__pyx_v_val == __pyx_v_val);
      if (__pyx_t_13) {
        __pyx_t_10 = (__pyx_v_val != __pyx_v_6pandas_5algos_iNaT);
        __pyx_t_12 = __pyx_t_10;
      } else {
        __pyx_t_12 = __pyx_t_13;
      }
      __pyx_t_19 = __pyx_v_b;
      __pyx_t_20 = __pyx_v_j;
      *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_nobs.rcbuffer->pybuffer.buf, __pyx_t_19, __pyx_pybuffernd_nobs.diminfo[0].strides, __pyx_t_20, __pyx_pybuffernd_nobs.diminfo[1].strides) += __pyx_t_12;
    }
  }

  /* "pandas/src/generated.pyx":6902
 *             nobs[b, j] += val == val and val != iNaT
 * 
 *     for i in range(ngroups):             # <<<<<<<<<<<<<<
 *         for j in range(K):
 *             out[i, j] = nobs[i, j]
 */
  __pyx_t_8 = __pyx_v_ngroups;
  for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_8; __pyx_t_7+=1) {
    __pyx_v_i = __pyx_t_7;

    /* "pandas/src/generated.pyx":6903
 * 
 *     for i in range(ngroups):
 *         for j in range(K):             # <<<<<<<<<<<<<<
 *             out[i, j] = nobs[i, j]
 * 
 */
    __pyx_t_15 = __pyx_v_K;
    for (__pyx_t_16 = 0; __pyx_t_16 < __pyx_t_15; __pyx_t_16+=1) {
      __pyx_v_j = __pyx_t_16;

      /* "pandas/src/generated.pyx":6904
 *     for i in range(ngroups):
 *         for j in range(K):
 *             out[i, j] = nobs[i, j]             # <<<<<<<<<<<<<<
 * 
 * 
 */
      __pyx_t_21 = __pyx_v_i;
      __pyx_t_22 = __pyx_v_j;
      __pyx_t_23 = __pyx_v_i;
      __pyx_t_24 = __pyx_v_j;
      *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_23, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_24, __pyx_pybuffernd_out.diminfo[1].strides) = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_nobs.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_nobs.diminfo[0].strides, __pyx_t_22, __pyx_pybuffernd_nobs.diminfo[1].strides));
    }
  }

  /* "pandas/src/generated.pyx":6875
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def group_count_bin_int64(ndarray[float64_t, ndim=2] out,             # <<<<<<<<<<<<<<
 *                              ndarray[int64_t] counts,
 *                              ndarray[int64_t, ndim=2] values,
 */

  /* function exit code */
  __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_pybuffernd_bins.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_counts.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas.algos.group_count_bin_int64", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_bins.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_counts.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer);
  __pyx_L2:;
  __Pyx_XDECREF((PyObject *)__pyx_v_nobs);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/src/generated.pyx":6910
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def left_join_indexer_unique_float64(ndarray[float64_t] left,             # <<<<<<<<<<<<<<
 *                                       ndarray[float64_t] right):
 *     cdef:
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pandas_5algos_471left_join_indexer_unique_float64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_5algos_471left_join_indexer_unique_float64 = {__Pyx_NAMESTR("left_join_indexer_unique_float64"), (PyCFunction)__pyx_pw_6pandas_5algos_471left_join_indexer_unique_float64, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pw_6pandas_5algos_471left_join_indexer_unique_float64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyArrayObject *__pyx_v_left = 0;
  PyArrayObject *__pyx_v_right = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("left_join_indexer_unique_float64 (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_left,&__pyx_n_s_right,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_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 (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_left)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_right)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("left_join_indexer_unique_float64", 1, 2, 2, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6910; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "left_join_indexer_unique_float64") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6910; __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("left_join_indexer_unique_float64", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6910; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas.algos.left_join_indexer_unique_float64", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_left), __pyx_ptype_5numpy_ndarray, 1, "left", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6910; __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[2]; __pyx_lineno = 6911; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_470left_join_indexer_unique_float64(__pyx_self, __pyx_v_left, __pyx_v_right);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pandas_5algos_470left_join_indexer_unique_float64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_left, PyArrayObject *__pyx_v_right) {
  Py_ssize_t __pyx_v_i;
  Py_ssize_t __pyx_v_j;
  Py_ssize_t __pyx_v_nleft;
  Py_ssize_t __pyx_v_nright;
  PyArrayObject *__pyx_v_indexer = 0;
  __pyx_t_5numpy_float64_t __pyx_v_rval;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_indexer;
  __Pyx_Buffer __pyx_pybuffer_indexer;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_left;
  __Pyx_Buffer __pyx_pybuffer_left;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_right;
  __Pyx_Buffer __pyx_pybuffer_right;
  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;
  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;
  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;
  __Pyx_RefNannySetupContext("left_join_indexer_unique_float64", 0);
  __pyx_pybuffer_indexer.pybuffer.buf = NULL;
  __pyx_pybuffer_indexer.refcount = 0;
  __pyx_pybuffernd_indexer.data = NULL;
  __pyx_pybuffernd_indexer.rcbuffer = &__pyx_pybuffer_indexer;
  __pyx_pybuffer_left.pybuffer.buf = NULL;
  __pyx_pybuffer_left.refcount = 0;
  __pyx_pybuffernd_left.data = NULL;
  __pyx_pybuffernd_left.rcbuffer = &__pyx_pybuffer_left;
  __pyx_pybuffer_right.pybuffer.buf = NULL;
  __pyx_pybuffer_right.refcount = 0;
  __pyx_pybuffernd_right.data = NULL;
  __pyx_pybuffernd_right.rcbuffer = &__pyx_pybuffer_right;
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_left.rcbuffer->pybuffer, (PyObject*)__pyx_v_left, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6910; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_left.diminfo[0].strides = __pyx_pybuffernd_left.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_left.diminfo[0].shape = __pyx_pybuffernd_left.rcbuffer->pybuffer.shape[0];
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_right.rcbuffer->pybuffer, (PyObject*)__pyx_v_right, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6910; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_right.diminfo[0].strides = __pyx_pybuffernd_right.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_right.diminfo[0].shape = __pyx_pybuffernd_right.rcbuffer->pybuffer.shape[0];

  /* "pandas/src/generated.pyx":6917
 *         float64_t lval, rval
 * 
 *     i = 0             # <<<<<<<<<<<<<<
 *     j = 0
 *     nleft = len(left)
 */
  __pyx_v_i = 0;

  /* "pandas/src/generated.pyx":6918
 * 
 *     i = 0
 *     j = 0             # <<<<<<<<<<<<<<
 *     nleft = len(left)
 *     nright = len(right)
 */
  __pyx_v_j = 0;

  /* "pandas/src/generated.pyx":6919
 *     i = 0
 *     j = 0
 *     nleft = len(left)             # <<<<<<<<<<<<<<
 *     nright = len(right)
 * 
 */
  __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_left)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6919; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_nleft = __pyx_t_1;

  /* "pandas/src/generated.pyx":6920
 *     j = 0
 *     nleft = len(left)
 *     nright = len(right)             # <<<<<<<<<<<<<<
 * 
 *     indexer = np.empty(nleft, dtype=np.int64)
 */
  __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_right)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6920; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_nright = __pyx_t_1;

  /* "pandas/src/generated.pyx":6922
 *     nright = len(right)
 * 
 *     indexer = np.empty(nleft, dtype=np.int64)             # <<<<<<<<<<<<<<
 *     while True:
 *         if i == nleft:
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6922; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_empty); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6922; __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_nleft); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6922; __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 = 6922; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__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 = 6922; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6922; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_int64); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6922; __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, __pyx_n_s_dtype, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6922; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6922; __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_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__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 = 6922; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_7 = ((PyArrayObject *)__pyx_t_6);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer);
    __pyx_t_8 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer, (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_pybuffernd_indexer.rcbuffer->pybuffer, (PyObject*)__pyx_v_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_pybuffernd_indexer.diminfo[0].strides = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_indexer.diminfo[0].shape = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.shape[0];
    if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6922; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_7 = 0;
  __pyx_v_indexer = ((PyArrayObject *)__pyx_t_6);
  __pyx_t_6 = 0;

  /* "pandas/src/generated.pyx":6923
 * 
 *     indexer = np.empty(nleft, dtype=np.int64)
 *     while True:             # <<<<<<<<<<<<<<
 *         if i == nleft:
 *             break
 */
  while (1) {

    /* "pandas/src/generated.pyx":6924
 *     indexer = np.empty(nleft, dtype=np.int64)
 *     while True:
 *         if i == nleft:             # <<<<<<<<<<<<<<
 *             break
 * 
 */
    __pyx_t_12 = ((__pyx_v_i == __pyx_v_nleft) != 0);
    if (__pyx_t_12) {

      /* "pandas/src/generated.pyx":6925
 *     while True:
 *         if i == nleft:
 *             break             # <<<<<<<<<<<<<<
 * 
 *         if j == nright:
 */
      goto __pyx_L4_break;
    }

    /* "pandas/src/generated.pyx":6927
 *             break
 * 
 *         if j == nright:             # <<<<<<<<<<<<<<
 *             indexer[i] = -1
 *             i += 1
 */
    __pyx_t_12 = ((__pyx_v_j == __pyx_v_nright) != 0);
    if (__pyx_t_12) {

      /* "pandas/src/generated.pyx":6928
 * 
 *         if j == nright:
 *             indexer[i] = -1             # <<<<<<<<<<<<<<
 *             i += 1
 *             continue
 */
      __pyx_t_1 = __pyx_v_i;
      *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_1, __pyx_pybuffernd_indexer.diminfo[0].strides) = -1;

      /* "pandas/src/generated.pyx":6929
 *         if j == nright:
 *             indexer[i] = -1
 *             i += 1             # <<<<<<<<<<<<<<
 *             continue
 * 
 */
      __pyx_v_i = (__pyx_v_i + 1);

      /* "pandas/src/generated.pyx":6930
 *             indexer[i] = -1
 *             i += 1
 *             continue             # <<<<<<<<<<<<<<
 * 
 *         rval = right[j]
 */
      goto __pyx_L3_continue;
    }

    /* "pandas/src/generated.pyx":6932
 *             continue
 * 
 *         rval = right[j]             # <<<<<<<<<<<<<<
 * 
 *         while i < nleft - 1 and left[i] == rval:
 */
    __pyx_t_13 = __pyx_v_j;
    __pyx_v_rval = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_right.rcbuffer->pybuffer.buf, __pyx_t_13, __pyx_pybuffernd_right.diminfo[0].strides));

    /* "pandas/src/generated.pyx":6934
 *         rval = right[j]
 * 
 *         while i < nleft - 1 and left[i] == rval:             # <<<<<<<<<<<<<<
 *             indexer[i] = j
 *             i += 1
 */
    while (1) {
      __pyx_t_12 = ((__pyx_v_i < (__pyx_v_nleft - 1)) != 0);
      if (__pyx_t_12) {
        __pyx_t_14 = __pyx_v_i;
        __pyx_t_15 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_left.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_left.diminfo[0].strides)) == __pyx_v_rval) != 0);
        __pyx_t_16 = __pyx_t_15;
      } else {
        __pyx_t_16 = __pyx_t_12;
      }
      if (!__pyx_t_16) break;

      /* "pandas/src/generated.pyx":6935
 * 
 *         while i < nleft - 1 and left[i] == rval:
 *             indexer[i] = j             # <<<<<<<<<<<<<<
 *             i += 1
 * 
 */
      __pyx_t_17 = __pyx_v_i;
      *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_indexer.diminfo[0].strides) = __pyx_v_j;

      /* "pandas/src/generated.pyx":6936
 *         while i < nleft - 1 and left[i] == rval:
 *             indexer[i] = j
 *             i += 1             # <<<<<<<<<<<<<<
 * 
 *         if left[i] == right[j]:
 */
      __pyx_v_i = (__pyx_v_i + 1);
    }

    /* "pandas/src/generated.pyx":6938
 *             i += 1
 * 
 *         if left[i] == right[j]:             # <<<<<<<<<<<<<<
 *             indexer[i] = j
 *             i += 1
 */
    __pyx_t_18 = __pyx_v_i;
    __pyx_t_19 = __pyx_v_j;
    __pyx_t_16 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_left.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_left.diminfo[0].strides)) == (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_right.rcbuffer->pybuffer.buf, __pyx_t_19, __pyx_pybuffernd_right.diminfo[0].strides))) != 0);
    if (__pyx_t_16) {

      /* "pandas/src/generated.pyx":6939
 * 
 *         if left[i] == right[j]:
 *             indexer[i] = j             # <<<<<<<<<<<<<<
 *             i += 1
 *             while i < nleft - 1 and left[i] == rval:
 */
      __pyx_t_20 = __pyx_v_i;
      *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_indexer.diminfo[0].strides) = __pyx_v_j;

      /* "pandas/src/generated.pyx":6940
 *         if left[i] == right[j]:
 *             indexer[i] = j
 *             i += 1             # <<<<<<<<<<<<<<
 *             while i < nleft - 1 and left[i] == rval:
 *                 indexer[i] = j
 */
      __pyx_v_i = (__pyx_v_i + 1);

      /* "pandas/src/generated.pyx":6941
 *             indexer[i] = j
 *             i += 1
 *             while i < nleft - 1 and left[i] == rval:             # <<<<<<<<<<<<<<
 *                 indexer[i] = j
 *                 i += 1
 */
      while (1) {
        __pyx_t_16 = ((__pyx_v_i < (__pyx_v_nleft - 1)) != 0);
        if (__pyx_t_16) {
          __pyx_t_21 = __pyx_v_i;
          __pyx_t_12 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_left.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_left.diminfo[0].strides)) == __pyx_v_rval) != 0);
          __pyx_t_15 = __pyx_t_12;
        } else {
          __pyx_t_15 = __pyx_t_16;
        }
        if (!__pyx_t_15) break;

        /* "pandas/src/generated.pyx":6942
 *             i += 1
 *             while i < nleft - 1 and left[i] == rval:
 *                 indexer[i] = j             # <<<<<<<<<<<<<<
 *                 i += 1
 *             j += 1
 */
        __pyx_t_22 = __pyx_v_i;
        *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_22, __pyx_pybuffernd_indexer.diminfo[0].strides) = __pyx_v_j;

        /* "pandas/src/generated.pyx":6943
 *             while i < nleft - 1 and left[i] == rval:
 *                 indexer[i] = j
 *                 i += 1             # <<<<<<<<<<<<<<
 *             j += 1
 *         elif left[i] > rval:
 */
        __pyx_v_i = (__pyx_v_i + 1);
      }

      /* "pandas/src/generated.pyx":6944
 *                 indexer[i] = j
 *                 i += 1
 *             j += 1             # <<<<<<<<<<<<<<
 *         elif left[i] > rval:
 *             indexer[i] = -1
 */
      __pyx_v_j = (__pyx_v_j + 1);
      goto __pyx_L9;
    }

    /* "pandas/src/generated.pyx":6945
 *                 i += 1
 *             j += 1
 *         elif left[i] > rval:             # <<<<<<<<<<<<<<
 *             indexer[i] = -1
 *             j += 1
 */
    __pyx_t_23 = __pyx_v_i;
    __pyx_t_15 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_left.rcbuffer->pybuffer.buf, __pyx_t_23, __pyx_pybuffernd_left.diminfo[0].strides)) > __pyx_v_rval) != 0);
    if (__pyx_t_15) {

      /* "pandas/src/generated.pyx":6946
 *             j += 1
 *         elif left[i] > rval:
 *             indexer[i] = -1             # <<<<<<<<<<<<<<
 *             j += 1
 *         else:
 */
      __pyx_t_24 = __pyx_v_i;
      *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_24, __pyx_pybuffernd_indexer.diminfo[0].strides) = -1;

      /* "pandas/src/generated.pyx":6947
 *         elif left[i] > rval:
 *             indexer[i] = -1
 *             j += 1             # <<<<<<<<<<<<<<
 *         else:
 *             indexer[i] = -1
 */
      __pyx_v_j = (__pyx_v_j + 1);
      goto __pyx_L9;
    }
    /*else*/ {

      /* "pandas/src/generated.pyx":6949
 *             j += 1
 *         else:
 *             indexer[i] = -1             # <<<<<<<<<<<<<<
 *             i += 1
 *     return indexer
 */
      __pyx_t_25 = __pyx_v_i;
      *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_25, __pyx_pybuffernd_indexer.diminfo[0].strides) = -1;

      /* "pandas/src/generated.pyx":6950
 *         else:
 *             indexer[i] = -1
 *             i += 1             # <<<<<<<<<<<<<<
 *     return indexer
 * 
 */
      __pyx_v_i = (__pyx_v_i + 1);
    }
    __pyx_L9:;
    __pyx_L3_continue:;
  }
  __pyx_L4_break:;

  /* "pandas/src/generated.pyx":6951
 *             indexer[i] = -1
 *             i += 1
 *     return indexer             # <<<<<<<<<<<<<<
 * 
 * @cython.wraparound(False)
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_indexer));
  __pyx_r = ((PyObject *)__pyx_v_indexer);
  goto __pyx_L0;

  /* "pandas/src/generated.pyx":6910
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def left_join_indexer_unique_float64(ndarray[float64_t] left,             # <<<<<<<<<<<<<<
 *                                       ndarray[float64_t] right):
 *     cdef:
 */

  /* function exit code */
  __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_pybuffernd_indexer.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_left.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_right.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas.algos.left_join_indexer_unique_float64", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_left.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_right.rcbuffer->pybuffer);
  __pyx_L2:;
  __Pyx_XDECREF((PyObject *)__pyx_v_indexer);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/src/generated.pyx":6955
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def left_join_indexer_unique_float32(ndarray[float32_t] left,             # <<<<<<<<<<<<<<
 *                                       ndarray[float32_t] right):
 *     cdef:
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pandas_5algos_473left_join_indexer_unique_float32(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_5algos_473left_join_indexer_unique_float32 = {__Pyx_NAMESTR("left_join_indexer_unique_float32"), (PyCFunction)__pyx_pw_6pandas_5algos_473left_join_indexer_unique_float32, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pw_6pandas_5algos_473left_join_indexer_unique_float32(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyArrayObject *__pyx_v_left = 0;
  PyArrayObject *__pyx_v_right = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("left_join_indexer_unique_float32 (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_left,&__pyx_n_s_right,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_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 (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_left)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_right)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("left_join_indexer_unique_float32", 1, 2, 2, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6955; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "left_join_indexer_unique_float32") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6955; __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("left_join_indexer_unique_float32", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6955; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas.algos.left_join_indexer_unique_float32", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_left), __pyx_ptype_5numpy_ndarray, 1, "left", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6955; __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[2]; __pyx_lineno = 6956; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_472left_join_indexer_unique_float32(__pyx_self, __pyx_v_left, __pyx_v_right);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pandas_5algos_472left_join_indexer_unique_float32(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_left, PyArrayObject *__pyx_v_right) {
  Py_ssize_t __pyx_v_i;
  Py_ssize_t __pyx_v_j;
  Py_ssize_t __pyx_v_nleft;
  Py_ssize_t __pyx_v_nright;
  PyArrayObject *__pyx_v_indexer = 0;
  __pyx_t_5numpy_float32_t __pyx_v_rval;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_indexer;
  __Pyx_Buffer __pyx_pybuffer_indexer;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_left;
  __Pyx_Buffer __pyx_pybuffer_left;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_right;
  __Pyx_Buffer __pyx_pybuffer_right;
  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;
  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;
  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;
  __Pyx_RefNannySetupContext("left_join_indexer_unique_float32", 0);
  __pyx_pybuffer_indexer.pybuffer.buf = NULL;
  __pyx_pybuffer_indexer.refcount = 0;
  __pyx_pybuffernd_indexer.data = NULL;
  __pyx_pybuffernd_indexer.rcbuffer = &__pyx_pybuffer_indexer;
  __pyx_pybuffer_left.pybuffer.buf = NULL;
  __pyx_pybuffer_left.refcount = 0;
  __pyx_pybuffernd_left.data = NULL;
  __pyx_pybuffernd_left.rcbuffer = &__pyx_pybuffer_left;
  __pyx_pybuffer_right.pybuffer.buf = NULL;
  __pyx_pybuffer_right.refcount = 0;
  __pyx_pybuffernd_right.data = NULL;
  __pyx_pybuffernd_right.rcbuffer = &__pyx_pybuffer_right;
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_left.rcbuffer->pybuffer, (PyObject*)__pyx_v_left, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6955; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_left.diminfo[0].strides = __pyx_pybuffernd_left.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_left.diminfo[0].shape = __pyx_pybuffernd_left.rcbuffer->pybuffer.shape[0];
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_right.rcbuffer->pybuffer, (PyObject*)__pyx_v_right, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6955; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_right.diminfo[0].strides = __pyx_pybuffernd_right.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_right.diminfo[0].shape = __pyx_pybuffernd_right.rcbuffer->pybuffer.shape[0];

  /* "pandas/src/generated.pyx":6962
 *         float32_t lval, rval
 * 
 *     i = 0             # <<<<<<<<<<<<<<
 *     j = 0
 *     nleft = len(left)
 */
  __pyx_v_i = 0;

  /* "pandas/src/generated.pyx":6963
 * 
 *     i = 0
 *     j = 0             # <<<<<<<<<<<<<<
 *     nleft = len(left)
 *     nright = len(right)
 */
  __pyx_v_j = 0;

  /* "pandas/src/generated.pyx":6964
 *     i = 0
 *     j = 0
 *     nleft = len(left)             # <<<<<<<<<<<<<<
 *     nright = len(right)
 * 
 */
  __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_left)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6964; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_nleft = __pyx_t_1;

  /* "pandas/src/generated.pyx":6965
 *     j = 0
 *     nleft = len(left)
 *     nright = len(right)             # <<<<<<<<<<<<<<
 * 
 *     indexer = np.empty(nleft, dtype=np.int64)
 */
  __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_right)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6965; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_nright = __pyx_t_1;

  /* "pandas/src/generated.pyx":6967
 *     nright = len(right)
 * 
 *     indexer = np.empty(nleft, dtype=np.int64)             # <<<<<<<<<<<<<<
 *     while True:
 *         if i == nleft:
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6967; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_empty); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6967; __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_nleft); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6967; __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 = 6967; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__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 = 6967; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6967; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_int64); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6967; __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, __pyx_n_s_dtype, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6967; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6967; __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_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__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 = 6967; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_7 = ((PyArrayObject *)__pyx_t_6);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer);
    __pyx_t_8 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer, (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_pybuffernd_indexer.rcbuffer->pybuffer, (PyObject*)__pyx_v_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_pybuffernd_indexer.diminfo[0].strides = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_indexer.diminfo[0].shape = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.shape[0];
    if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6967; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_7 = 0;
  __pyx_v_indexer = ((PyArrayObject *)__pyx_t_6);
  __pyx_t_6 = 0;

  /* "pandas/src/generated.pyx":6968
 * 
 *     indexer = np.empty(nleft, dtype=np.int64)
 *     while True:             # <<<<<<<<<<<<<<
 *         if i == nleft:
 *             break
 */
  while (1) {

    /* "pandas/src/generated.pyx":6969
 *     indexer = np.empty(nleft, dtype=np.int64)
 *     while True:
 *         if i == nleft:             # <<<<<<<<<<<<<<
 *             break
 * 
 */
    __pyx_t_12 = ((__pyx_v_i == __pyx_v_nleft) != 0);
    if (__pyx_t_12) {

      /* "pandas/src/generated.pyx":6970
 *     while True:
 *         if i == nleft:
 *             break             # <<<<<<<<<<<<<<
 * 
 *         if j == nright:
 */
      goto __pyx_L4_break;
    }

    /* "pandas/src/generated.pyx":6972
 *             break
 * 
 *         if j == nright:             # <<<<<<<<<<<<<<
 *             indexer[i] = -1
 *             i += 1
 */
    __pyx_t_12 = ((__pyx_v_j == __pyx_v_nright) != 0);
    if (__pyx_t_12) {

      /* "pandas/src/generated.pyx":6973
 * 
 *         if j == nright:
 *             indexer[i] = -1             # <<<<<<<<<<<<<<
 *             i += 1
 *             continue
 */
      __pyx_t_1 = __pyx_v_i;
      *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_1, __pyx_pybuffernd_indexer.diminfo[0].strides) = -1;

      /* "pandas/src/generated.pyx":6974
 *         if j == nright:
 *             indexer[i] = -1
 *             i += 1             # <<<<<<<<<<<<<<
 *             continue
 * 
 */
      __pyx_v_i = (__pyx_v_i + 1);

      /* "pandas/src/generated.pyx":6975
 *             indexer[i] = -1
 *             i += 1
 *             continue             # <<<<<<<<<<<<<<
 * 
 *         rval = right[j]
 */
      goto __pyx_L3_continue;
    }

    /* "pandas/src/generated.pyx":6977
 *             continue
 * 
 *         rval = right[j]             # <<<<<<<<<<<<<<
 * 
 *         while i < nleft - 1 and left[i] == rval:
 */
    __pyx_t_13 = __pyx_v_j;
    __pyx_v_rval = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_right.rcbuffer->pybuffer.buf, __pyx_t_13, __pyx_pybuffernd_right.diminfo[0].strides));

    /* "pandas/src/generated.pyx":6979
 *         rval = right[j]
 * 
 *         while i < nleft - 1 and left[i] == rval:             # <<<<<<<<<<<<<<
 *             indexer[i] = j
 *             i += 1
 */
    while (1) {
      __pyx_t_12 = ((__pyx_v_i < (__pyx_v_nleft - 1)) != 0);
      if (__pyx_t_12) {
        __pyx_t_14 = __pyx_v_i;
        __pyx_t_15 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_left.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_left.diminfo[0].strides)) == __pyx_v_rval) != 0);
        __pyx_t_16 = __pyx_t_15;
      } else {
        __pyx_t_16 = __pyx_t_12;
      }
      if (!__pyx_t_16) break;

      /* "pandas/src/generated.pyx":6980
 * 
 *         while i < nleft - 1 and left[i] == rval:
 *             indexer[i] = j             # <<<<<<<<<<<<<<
 *             i += 1
 * 
 */
      __pyx_t_17 = __pyx_v_i;
      *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_indexer.diminfo[0].strides) = __pyx_v_j;

      /* "pandas/src/generated.pyx":6981
 *         while i < nleft - 1 and left[i] == rval:
 *             indexer[i] = j
 *             i += 1             # <<<<<<<<<<<<<<
 * 
 *         if left[i] == right[j]:
 */
      __pyx_v_i = (__pyx_v_i + 1);
    }

    /* "pandas/src/generated.pyx":6983
 *             i += 1
 * 
 *         if left[i] == right[j]:             # <<<<<<<<<<<<<<
 *             indexer[i] = j
 *             i += 1
 */
    __pyx_t_18 = __pyx_v_i;
    __pyx_t_19 = __pyx_v_j;
    __pyx_t_16 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_left.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_left.diminfo[0].strides)) == (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_right.rcbuffer->pybuffer.buf, __pyx_t_19, __pyx_pybuffernd_right.diminfo[0].strides))) != 0);
    if (__pyx_t_16) {

      /* "pandas/src/generated.pyx":6984
 * 
 *         if left[i] == right[j]:
 *             indexer[i] = j             # <<<<<<<<<<<<<<
 *             i += 1
 *             while i < nleft - 1 and left[i] == rval:
 */
      __pyx_t_20 = __pyx_v_i;
      *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_indexer.diminfo[0].strides) = __pyx_v_j;

      /* "pandas/src/generated.pyx":6985
 *         if left[i] == right[j]:
 *             indexer[i] = j
 *             i += 1             # <<<<<<<<<<<<<<
 *             while i < nleft - 1 and left[i] == rval:
 *                 indexer[i] = j
 */
      __pyx_v_i = (__pyx_v_i + 1);

      /* "pandas/src/generated.pyx":6986
 *             indexer[i] = j
 *             i += 1
 *             while i < nleft - 1 and left[i] == rval:             # <<<<<<<<<<<<<<
 *                 indexer[i] = j
 *                 i += 1
 */
      while (1) {
        __pyx_t_16 = ((__pyx_v_i < (__pyx_v_nleft - 1)) != 0);
        if (__pyx_t_16) {
          __pyx_t_21 = __pyx_v_i;
          __pyx_t_12 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_left.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_left.diminfo[0].strides)) == __pyx_v_rval) != 0);
          __pyx_t_15 = __pyx_t_12;
        } else {
          __pyx_t_15 = __pyx_t_16;
        }
        if (!__pyx_t_15) break;

        /* "pandas/src/generated.pyx":6987
 *             i += 1
 *             while i < nleft - 1 and left[i] == rval:
 *                 indexer[i] = j             # <<<<<<<<<<<<<<
 *                 i += 1
 *             j += 1
 */
        __pyx_t_22 = __pyx_v_i;
        *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_22, __pyx_pybuffernd_indexer.diminfo[0].strides) = __pyx_v_j;

        /* "pandas/src/generated.pyx":6988
 *             while i < nleft - 1 and left[i] == rval:
 *                 indexer[i] = j
 *                 i += 1             # <<<<<<<<<<<<<<
 *             j += 1
 *         elif left[i] > rval:
 */
        __pyx_v_i = (__pyx_v_i + 1);
      }

      /* "pandas/src/generated.pyx":6989
 *                 indexer[i] = j
 *                 i += 1
 *             j += 1             # <<<<<<<<<<<<<<
 *         elif left[i] > rval:
 *             indexer[i] = -1
 */
      __pyx_v_j = (__pyx_v_j + 1);
      goto __pyx_L9;
    }

    /* "pandas/src/generated.pyx":6990
 *                 i += 1
 *             j += 1
 *         elif left[i] > rval:             # <<<<<<<<<<<<<<
 *             indexer[i] = -1
 *             j += 1
 */
    __pyx_t_23 = __pyx_v_i;
    __pyx_t_15 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_left.rcbuffer->pybuffer.buf, __pyx_t_23, __pyx_pybuffernd_left.diminfo[0].strides)) > __pyx_v_rval) != 0);
    if (__pyx_t_15) {

      /* "pandas/src/generated.pyx":6991
 *             j += 1
 *         elif left[i] > rval:
 *             indexer[i] = -1             # <<<<<<<<<<<<<<
 *             j += 1
 *         else:
 */
      __pyx_t_24 = __pyx_v_i;
      *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_24, __pyx_pybuffernd_indexer.diminfo[0].strides) = -1;

      /* "pandas/src/generated.pyx":6992
 *         elif left[i] > rval:
 *             indexer[i] = -1
 *             j += 1             # <<<<<<<<<<<<<<
 *         else:
 *             indexer[i] = -1
 */
      __pyx_v_j = (__pyx_v_j + 1);
      goto __pyx_L9;
    }
    /*else*/ {

      /* "pandas/src/generated.pyx":6994
 *             j += 1
 *         else:
 *             indexer[i] = -1             # <<<<<<<<<<<<<<
 *             i += 1
 *     return indexer
 */
      __pyx_t_25 = __pyx_v_i;
      *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_25, __pyx_pybuffernd_indexer.diminfo[0].strides) = -1;

      /* "pandas/src/generated.pyx":6995
 *         else:
 *             indexer[i] = -1
 *             i += 1             # <<<<<<<<<<<<<<
 *     return indexer
 * 
 */
      __pyx_v_i = (__pyx_v_i + 1);
    }
    __pyx_L9:;
    __pyx_L3_continue:;
  }
  __pyx_L4_break:;

  /* "pandas/src/generated.pyx":6996
 *             indexer[i] = -1
 *             i += 1
 *     return indexer             # <<<<<<<<<<<<<<
 * 
 * @cython.wraparound(False)
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_indexer));
  __pyx_r = ((PyObject *)__pyx_v_indexer);
  goto __pyx_L0;

  /* "pandas/src/generated.pyx":6955
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def left_join_indexer_unique_float32(ndarray[float32_t] left,             # <<<<<<<<<<<<<<
 *                                       ndarray[float32_t] right):
 *     cdef:
 */

  /* function exit code */
  __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_pybuffernd_indexer.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_left.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_right.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas.algos.left_join_indexer_unique_float32", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_left.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_right.rcbuffer->pybuffer);
  __pyx_L2:;
  __Pyx_XDECREF((PyObject *)__pyx_v_indexer);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/src/generated.pyx":7000
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def left_join_indexer_unique_object(ndarray[object] left,             # <<<<<<<<<<<<<<
 *                                       ndarray[object] right):
 *     cdef:
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pandas_5algos_475left_join_indexer_unique_object(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_5algos_475left_join_indexer_unique_object = {__Pyx_NAMESTR("left_join_indexer_unique_object"), (PyCFunction)__pyx_pw_6pandas_5algos_475left_join_indexer_unique_object, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pw_6pandas_5algos_475left_join_indexer_unique_object(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyArrayObject *__pyx_v_left = 0;
  PyArrayObject *__pyx_v_right = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("left_join_indexer_unique_object (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_left,&__pyx_n_s_right,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_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 (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_left)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_right)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("left_join_indexer_unique_object", 1, 2, 2, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7000; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "left_join_indexer_unique_object") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7000; __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("left_join_indexer_unique_object", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7000; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas.algos.left_join_indexer_unique_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_left), __pyx_ptype_5numpy_ndarray, 1, "left", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7000; __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[2]; __pyx_lineno = 7001; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_474left_join_indexer_unique_object(__pyx_self, __pyx_v_left, __pyx_v_right);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pandas_5algos_474left_join_indexer_unique_object(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_left, PyArrayObject *__pyx_v_right) {
  Py_ssize_t __pyx_v_i;
  Py_ssize_t __pyx_v_j;
  Py_ssize_t __pyx_v_nleft;
  Py_ssize_t __pyx_v_nright;
  PyArrayObject *__pyx_v_indexer = 0;
  PyObject *__pyx_v_rval = 0;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_indexer;
  __Pyx_Buffer __pyx_pybuffer_indexer;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_left;
  __Pyx_Buffer __pyx_pybuffer_left;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_right;
  __Pyx_Buffer __pyx_pybuffer_right;
  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;
  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;
  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;
  __Pyx_RefNannySetupContext("left_join_indexer_unique_object", 0);
  __pyx_pybuffer_indexer.pybuffer.buf = NULL;
  __pyx_pybuffer_indexer.refcount = 0;
  __pyx_pybuffernd_indexer.data = NULL;
  __pyx_pybuffernd_indexer.rcbuffer = &__pyx_pybuffer_indexer;
  __pyx_pybuffer_left.pybuffer.buf = NULL;
  __pyx_pybuffer_left.refcount = 0;
  __pyx_pybuffernd_left.data = NULL;
  __pyx_pybuffernd_left.rcbuffer = &__pyx_pybuffer_left;
  __pyx_pybuffer_right.pybuffer.buf = NULL;
  __pyx_pybuffer_right.refcount = 0;
  __pyx_pybuffernd_right.data = NULL;
  __pyx_pybuffernd_right.rcbuffer = &__pyx_pybuffer_right;
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_left.rcbuffer->pybuffer, (PyObject*)__pyx_v_left, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7000; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_left.diminfo[0].strides = __pyx_pybuffernd_left.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_left.diminfo[0].shape = __pyx_pybuffernd_left.rcbuffer->pybuffer.shape[0];
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_right.rcbuffer->pybuffer, (PyObject*)__pyx_v_right, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7000; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_right.diminfo[0].strides = __pyx_pybuffernd_right.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_right.diminfo[0].shape = __pyx_pybuffernd_right.rcbuffer->pybuffer.shape[0];

  /* "pandas/src/generated.pyx":7007
 *         object lval, rval
 * 
 *     i = 0             # <<<<<<<<<<<<<<
 *     j = 0
 *     nleft = len(left)
 */
  __pyx_v_i = 0;

  /* "pandas/src/generated.pyx":7008
 * 
 *     i = 0
 *     j = 0             # <<<<<<<<<<<<<<
 *     nleft = len(left)
 *     nright = len(right)
 */
  __pyx_v_j = 0;

  /* "pandas/src/generated.pyx":7009
 *     i = 0
 *     j = 0
 *     nleft = len(left)             # <<<<<<<<<<<<<<
 *     nright = len(right)
 * 
 */
  __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_left)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7009; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_nleft = __pyx_t_1;

  /* "pandas/src/generated.pyx":7010
 *     j = 0
 *     nleft = len(left)
 *     nright = len(right)             # <<<<<<<<<<<<<<
 * 
 *     indexer = np.empty(nleft, dtype=np.int64)
 */
  __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_right)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7010; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_nright = __pyx_t_1;

  /* "pandas/src/generated.pyx":7012
 *     nright = len(right)
 * 
 *     indexer = np.empty(nleft, dtype=np.int64)             # <<<<<<<<<<<<<<
 *     while True:
 *         if i == nleft:
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7012; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_empty); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7012; __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_nleft); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7012; __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 = 7012; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__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 = 7012; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7012; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_int64); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7012; __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, __pyx_n_s_dtype, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7012; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7012; __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_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__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 = 7012; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_7 = ((PyArrayObject *)__pyx_t_6);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer);
    __pyx_t_8 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer, (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_pybuffernd_indexer.rcbuffer->pybuffer, (PyObject*)__pyx_v_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_pybuffernd_indexer.diminfo[0].strides = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_indexer.diminfo[0].shape = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.shape[0];
    if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7012; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_7 = 0;
  __pyx_v_indexer = ((PyArrayObject *)__pyx_t_6);
  __pyx_t_6 = 0;

  /* "pandas/src/generated.pyx":7013
 * 
 *     indexer = np.empty(nleft, dtype=np.int64)
 *     while True:             # <<<<<<<<<<<<<<
 *         if i == nleft:
 *             break
 */
  while (1) {

    /* "pandas/src/generated.pyx":7014
 *     indexer = np.empty(nleft, dtype=np.int64)
 *     while True:
 *         if i == nleft:             # <<<<<<<<<<<<<<
 *             break
 * 
 */
    __pyx_t_12 = ((__pyx_v_i == __pyx_v_nleft) != 0);
    if (__pyx_t_12) {

      /* "pandas/src/generated.pyx":7015
 *     while True:
 *         if i == nleft:
 *             break             # <<<<<<<<<<<<<<
 * 
 *         if j == nright:
 */
      goto __pyx_L4_break;
    }

    /* "pandas/src/generated.pyx":7017
 *             break
 * 
 *         if j == nright:             # <<<<<<<<<<<<<<
 *             indexer[i] = -1
 *             i += 1
 */
    __pyx_t_12 = ((__pyx_v_j == __pyx_v_nright) != 0);
    if (__pyx_t_12) {

      /* "pandas/src/generated.pyx":7018
 * 
 *         if j == nright:
 *             indexer[i] = -1             # <<<<<<<<<<<<<<
 *             i += 1
 *             continue
 */
      __pyx_t_1 = __pyx_v_i;
      *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_1, __pyx_pybuffernd_indexer.diminfo[0].strides) = -1;

      /* "pandas/src/generated.pyx":7019
 *         if j == nright:
 *             indexer[i] = -1
 *             i += 1             # <<<<<<<<<<<<<<
 *             continue
 * 
 */
      __pyx_v_i = (__pyx_v_i + 1);

      /* "pandas/src/generated.pyx":7020
 *             indexer[i] = -1
 *             i += 1
 *             continue             # <<<<<<<<<<<<<<
 * 
 *         rval = right[j]
 */
      goto __pyx_L3_continue;
    }

    /* "pandas/src/generated.pyx":7022
 *             continue
 * 
 *         rval = right[j]             # <<<<<<<<<<<<<<
 * 
 *         while i < nleft - 1 and left[i] == rval:
 */
    __pyx_t_13 = __pyx_v_j;
    __pyx_t_6 = (PyObject *) *__Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_right.rcbuffer->pybuffer.buf, __pyx_t_13, __pyx_pybuffernd_right.diminfo[0].strides);
    __Pyx_INCREF((PyObject*)__pyx_t_6);
    __Pyx_XDECREF_SET(__pyx_v_rval, __pyx_t_6);
    __pyx_t_6 = 0;

    /* "pandas/src/generated.pyx":7024
 *         rval = right[j]
 * 
 *         while i < nleft - 1 and left[i] == rval:             # <<<<<<<<<<<<<<
 *             indexer[i] = j
 *             i += 1
 */
    while (1) {
      __pyx_t_12 = (__pyx_v_i < (__pyx_v_nleft - 1));
      if (__pyx_t_12) {
        __pyx_t_14 = __pyx_v_i;
        __pyx_t_6 = (PyObject *) *__Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_left.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_left.diminfo[0].strides);
        __Pyx_INCREF((PyObject*)__pyx_t_6);
        __pyx_t_2 = PyObject_RichCompare(__pyx_t_6, __pyx_v_rval, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7024; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __pyx_t_15 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_15 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7024; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __pyx_t_16 = __pyx_t_15;
      } else {
        __pyx_t_16 = __pyx_t_12;
      }
      if (!__pyx_t_16) break;

      /* "pandas/src/generated.pyx":7025
 * 
 *         while i < nleft - 1 and left[i] == rval:
 *             indexer[i] = j             # <<<<<<<<<<<<<<
 *             i += 1
 * 
 */
      __pyx_t_17 = __pyx_v_i;
      *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_indexer.diminfo[0].strides) = __pyx_v_j;

      /* "pandas/src/generated.pyx":7026
 *         while i < nleft - 1 and left[i] == rval:
 *             indexer[i] = j
 *             i += 1             # <<<<<<<<<<<<<<
 * 
 *         if left[i] == right[j]:
 */
      __pyx_v_i = (__pyx_v_i + 1);
    }

    /* "pandas/src/generated.pyx":7028
 *             i += 1
 * 
 *         if left[i] == right[j]:             # <<<<<<<<<<<<<<
 *             indexer[i] = j
 *             i += 1
 */
    __pyx_t_18 = __pyx_v_i;
    __pyx_t_2 = (PyObject *) *__Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_left.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_left.diminfo[0].strides);
    __Pyx_INCREF((PyObject*)__pyx_t_2);
    __pyx_t_19 = __pyx_v_j;
    __pyx_t_6 = (PyObject *) *__Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_right.rcbuffer->pybuffer.buf, __pyx_t_19, __pyx_pybuffernd_right.diminfo[0].strides);
    __Pyx_INCREF((PyObject*)__pyx_t_6);
    __pyx_t_4 = PyObject_RichCompare(__pyx_t_2, __pyx_t_6, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7028; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_16 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_16 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7028; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (__pyx_t_16) {

      /* "pandas/src/generated.pyx":7029
 * 
 *         if left[i] == right[j]:
 *             indexer[i] = j             # <<<<<<<<<<<<<<
 *             i += 1
 *             while i < nleft - 1 and left[i] == rval:
 */
      __pyx_t_20 = __pyx_v_i;
      *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_indexer.diminfo[0].strides) = __pyx_v_j;

      /* "pandas/src/generated.pyx":7030
 *         if left[i] == right[j]:
 *             indexer[i] = j
 *             i += 1             # <<<<<<<<<<<<<<
 *             while i < nleft - 1 and left[i] == rval:
 *                 indexer[i] = j
 */
      __pyx_v_i = (__pyx_v_i + 1);

      /* "pandas/src/generated.pyx":7031
 *             indexer[i] = j
 *             i += 1
 *             while i < nleft - 1 and left[i] == rval:             # <<<<<<<<<<<<<<
 *                 indexer[i] = j
 *                 i += 1
 */
      while (1) {
        __pyx_t_16 = (__pyx_v_i < (__pyx_v_nleft - 1));
        if (__pyx_t_16) {
          __pyx_t_21 = __pyx_v_i;
          __pyx_t_4 = (PyObject *) *__Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_left.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_left.diminfo[0].strides);
          __Pyx_INCREF((PyObject*)__pyx_t_4);
          __pyx_t_6 = PyObject_RichCompare(__pyx_t_4, __pyx_v_rval, Py_EQ); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7031; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_12 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7031; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
          __pyx_t_15 = __pyx_t_12;
        } else {
          __pyx_t_15 = __pyx_t_16;
        }
        if (!__pyx_t_15) break;

        /* "pandas/src/generated.pyx":7032
 *             i += 1
 *             while i < nleft - 1 and left[i] == rval:
 *                 indexer[i] = j             # <<<<<<<<<<<<<<
 *                 i += 1
 *             j += 1
 */
        __pyx_t_22 = __pyx_v_i;
        *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_22, __pyx_pybuffernd_indexer.diminfo[0].strides) = __pyx_v_j;

        /* "pandas/src/generated.pyx":7033
 *             while i < nleft - 1 and left[i] == rval:
 *                 indexer[i] = j
 *                 i += 1             # <<<<<<<<<<<<<<
 *             j += 1
 *         elif left[i] > rval:
 */
        __pyx_v_i = (__pyx_v_i + 1);
      }

      /* "pandas/src/generated.pyx":7034
 *                 indexer[i] = j
 *                 i += 1
 *             j += 1             # <<<<<<<<<<<<<<
 *         elif left[i] > rval:
 *             indexer[i] = -1
 */
      __pyx_v_j = (__pyx_v_j + 1);
      goto __pyx_L9;
    }

    /* "pandas/src/generated.pyx":7035
 *                 i += 1
 *             j += 1
 *         elif left[i] > rval:             # <<<<<<<<<<<<<<
 *             indexer[i] = -1
 *             j += 1
 */
    __pyx_t_23 = __pyx_v_i;
    __pyx_t_6 = (PyObject *) *__Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_left.rcbuffer->pybuffer.buf, __pyx_t_23, __pyx_pybuffernd_left.diminfo[0].strides);
    __Pyx_INCREF((PyObject*)__pyx_t_6);
    __pyx_t_4 = PyObject_RichCompare(__pyx_t_6, __pyx_v_rval, Py_GT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7035; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_15 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_15 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7035; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (__pyx_t_15) {

      /* "pandas/src/generated.pyx":7036
 *             j += 1
 *         elif left[i] > rval:
 *             indexer[i] = -1             # <<<<<<<<<<<<<<
 *             j += 1
 *         else:
 */
      __pyx_t_24 = __pyx_v_i;
      *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_24, __pyx_pybuffernd_indexer.diminfo[0].strides) = -1;

      /* "pandas/src/generated.pyx":7037
 *         elif left[i] > rval:
 *             indexer[i] = -1
 *             j += 1             # <<<<<<<<<<<<<<
 *         else:
 *             indexer[i] = -1
 */
      __pyx_v_j = (__pyx_v_j + 1);
      goto __pyx_L9;
    }
    /*else*/ {

      /* "pandas/src/generated.pyx":7039
 *             j += 1
 *         else:
 *             indexer[i] = -1             # <<<<<<<<<<<<<<
 *             i += 1
 *     return indexer
 */
      __pyx_t_25 = __pyx_v_i;
      *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_25, __pyx_pybuffernd_indexer.diminfo[0].strides) = -1;

      /* "pandas/src/generated.pyx":7040
 *         else:
 *             indexer[i] = -1
 *             i += 1             # <<<<<<<<<<<<<<
 *     return indexer
 * 
 */
      __pyx_v_i = (__pyx_v_i + 1);
    }
    __pyx_L9:;
    __pyx_L3_continue:;
  }
  __pyx_L4_break:;

  /* "pandas/src/generated.pyx":7041
 *             indexer[i] = -1
 *             i += 1
 *     return indexer             # <<<<<<<<<<<<<<
 * 
 * @cython.wraparound(False)
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_indexer));
  __pyx_r = ((PyObject *)__pyx_v_indexer);
  goto __pyx_L0;

  /* "pandas/src/generated.pyx":7000
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def left_join_indexer_unique_object(ndarray[object] left,             # <<<<<<<<<<<<<<
 *                                       ndarray[object] right):
 *     cdef:
 */

  /* function exit code */
  __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_pybuffernd_indexer.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_left.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_right.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas.algos.left_join_indexer_unique_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_left.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_right.rcbuffer->pybuffer);
  __pyx_L2:;
  __Pyx_XDECREF((PyObject *)__pyx_v_indexer);
  __Pyx_XDECREF(__pyx_v_rval);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/src/generated.pyx":7045
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def left_join_indexer_unique_int32(ndarray[int32_t] left,             # <<<<<<<<<<<<<<
 *                                       ndarray[int32_t] right):
 *     cdef:
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pandas_5algos_477left_join_indexer_unique_int32(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_5algos_477left_join_indexer_unique_int32 = {__Pyx_NAMESTR("left_join_indexer_unique_int32"), (PyCFunction)__pyx_pw_6pandas_5algos_477left_join_indexer_unique_int32, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pw_6pandas_5algos_477left_join_indexer_unique_int32(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyArrayObject *__pyx_v_left = 0;
  PyArrayObject *__pyx_v_right = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("left_join_indexer_unique_int32 (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_left,&__pyx_n_s_right,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_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 (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_left)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_right)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("left_join_indexer_unique_int32", 1, 2, 2, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7045; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "left_join_indexer_unique_int32") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7045; __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("left_join_indexer_unique_int32", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7045; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas.algos.left_join_indexer_unique_int32", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_left), __pyx_ptype_5numpy_ndarray, 1, "left", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7045; __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[2]; __pyx_lineno = 7046; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_476left_join_indexer_unique_int32(__pyx_self, __pyx_v_left, __pyx_v_right);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pandas_5algos_476left_join_indexer_unique_int32(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_left, PyArrayObject *__pyx_v_right) {
  Py_ssize_t __pyx_v_i;
  Py_ssize_t __pyx_v_j;
  Py_ssize_t __pyx_v_nleft;
  Py_ssize_t __pyx_v_nright;
  PyArrayObject *__pyx_v_indexer = 0;
  __pyx_t_5numpy_int32_t __pyx_v_rval;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_indexer;
  __Pyx_Buffer __pyx_pybuffer_indexer;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_left;
  __Pyx_Buffer __pyx_pybuffer_left;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_right;
  __Pyx_Buffer __pyx_pybuffer_right;
  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;
  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;
  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;
  __Pyx_RefNannySetupContext("left_join_indexer_unique_int32", 0);
  __pyx_pybuffer_indexer.pybuffer.buf = NULL;
  __pyx_pybuffer_indexer.refcount = 0;
  __pyx_pybuffernd_indexer.data = NULL;
  __pyx_pybuffernd_indexer.rcbuffer = &__pyx_pybuffer_indexer;
  __pyx_pybuffer_left.pybuffer.buf = NULL;
  __pyx_pybuffer_left.refcount = 0;
  __pyx_pybuffernd_left.data = NULL;
  __pyx_pybuffernd_left.rcbuffer = &__pyx_pybuffer_left;
  __pyx_pybuffer_right.pybuffer.buf = NULL;
  __pyx_pybuffer_right.refcount = 0;
  __pyx_pybuffernd_right.data = NULL;
  __pyx_pybuffernd_right.rcbuffer = &__pyx_pybuffer_right;
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_left.rcbuffer->pybuffer, (PyObject*)__pyx_v_left, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7045; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_left.diminfo[0].strides = __pyx_pybuffernd_left.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_left.diminfo[0].shape = __pyx_pybuffernd_left.rcbuffer->pybuffer.shape[0];
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_right.rcbuffer->pybuffer, (PyObject*)__pyx_v_right, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7045; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_right.diminfo[0].strides = __pyx_pybuffernd_right.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_right.diminfo[0].shape = __pyx_pybuffernd_right.rcbuffer->pybuffer.shape[0];

  /* "pandas/src/generated.pyx":7052
 *         int32_t lval, rval
 * 
 *     i = 0             # <<<<<<<<<<<<<<
 *     j = 0
 *     nleft = len(left)
 */
  __pyx_v_i = 0;

  /* "pandas/src/generated.pyx":7053
 * 
 *     i = 0
 *     j = 0             # <<<<<<<<<<<<<<
 *     nleft = len(left)
 *     nright = len(right)
 */
  __pyx_v_j = 0;

  /* "pandas/src/generated.pyx":7054
 *     i = 0
 *     j = 0
 *     nleft = len(left)             # <<<<<<<<<<<<<<
 *     nright = len(right)
 * 
 */
  __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_left)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7054; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_nleft = __pyx_t_1;

  /* "pandas/src/generated.pyx":7055
 *     j = 0
 *     nleft = len(left)
 *     nright = len(right)             # <<<<<<<<<<<<<<
 * 
 *     indexer = np.empty(nleft, dtype=np.int64)
 */
  __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_right)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7055; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_nright = __pyx_t_1;

  /* "pandas/src/generated.pyx":7057
 *     nright = len(right)
 * 
 *     indexer = np.empty(nleft, dtype=np.int64)             # <<<<<<<<<<<<<<
 *     while True:
 *         if i == nleft:
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7057; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_empty); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7057; __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_nleft); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7057; __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 = 7057; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__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 = 7057; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7057; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_int64); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7057; __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, __pyx_n_s_dtype, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7057; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7057; __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_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__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 = 7057; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_7 = ((PyArrayObject *)__pyx_t_6);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer);
    __pyx_t_8 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer, (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_pybuffernd_indexer.rcbuffer->pybuffer, (PyObject*)__pyx_v_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_pybuffernd_indexer.diminfo[0].strides = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_indexer.diminfo[0].shape = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.shape[0];
    if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7057; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_7 = 0;
  __pyx_v_indexer = ((PyArrayObject *)__pyx_t_6);
  __pyx_t_6 = 0;

  /* "pandas/src/generated.pyx":7058
 * 
 *     indexer = np.empty(nleft, dtype=np.int64)
 *     while True:             # <<<<<<<<<<<<<<
 *         if i == nleft:
 *             break
 */
  while (1) {

    /* "pandas/src/generated.pyx":7059
 *     indexer = np.empty(nleft, dtype=np.int64)
 *     while True:
 *         if i == nleft:             # <<<<<<<<<<<<<<
 *             break
 * 
 */
    __pyx_t_12 = ((__pyx_v_i == __pyx_v_nleft) != 0);
    if (__pyx_t_12) {

      /* "pandas/src/generated.pyx":7060
 *     while True:
 *         if i == nleft:
 *             break             # <<<<<<<<<<<<<<
 * 
 *         if j == nright:
 */
      goto __pyx_L4_break;
    }

    /* "pandas/src/generated.pyx":7062
 *             break
 * 
 *         if j == nright:             # <<<<<<<<<<<<<<
 *             indexer[i] = -1
 *             i += 1
 */
    __pyx_t_12 = ((__pyx_v_j == __pyx_v_nright) != 0);
    if (__pyx_t_12) {

      /* "pandas/src/generated.pyx":7063
 * 
 *         if j == nright:
 *             indexer[i] = -1             # <<<<<<<<<<<<<<
 *             i += 1
 *             continue
 */
      __pyx_t_1 = __pyx_v_i;
      *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_1, __pyx_pybuffernd_indexer.diminfo[0].strides) = -1;

      /* "pandas/src/generated.pyx":7064
 *         if j == nright:
 *             indexer[i] = -1
 *             i += 1             # <<<<<<<<<<<<<<
 *             continue
 * 
 */
      __pyx_v_i = (__pyx_v_i + 1);

      /* "pandas/src/generated.pyx":7065
 *             indexer[i] = -1
 *             i += 1
 *             continue             # <<<<<<<<<<<<<<
 * 
 *         rval = right[j]
 */
      goto __pyx_L3_continue;
    }

    /* "pandas/src/generated.pyx":7067
 *             continue
 * 
 *         rval = right[j]             # <<<<<<<<<<<<<<
 * 
 *         while i < nleft - 1 and left[i] == rval:
 */
    __pyx_t_13 = __pyx_v_j;
    __pyx_v_rval = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_right.rcbuffer->pybuffer.buf, __pyx_t_13, __pyx_pybuffernd_right.diminfo[0].strides));

    /* "pandas/src/generated.pyx":7069
 *         rval = right[j]
 * 
 *         while i < nleft - 1 and left[i] == rval:             # <<<<<<<<<<<<<<
 *             indexer[i] = j
 *             i += 1
 */
    while (1) {
      __pyx_t_12 = ((__pyx_v_i < (__pyx_v_nleft - 1)) != 0);
      if (__pyx_t_12) {
        __pyx_t_14 = __pyx_v_i;
        __pyx_t_15 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_left.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_left.diminfo[0].strides)) == __pyx_v_rval) != 0);
        __pyx_t_16 = __pyx_t_15;
      } else {
        __pyx_t_16 = __pyx_t_12;
      }
      if (!__pyx_t_16) break;

      /* "pandas/src/generated.pyx":7070
 * 
 *         while i < nleft - 1 and left[i] == rval:
 *             indexer[i] = j             # <<<<<<<<<<<<<<
 *             i += 1
 * 
 */
      __pyx_t_17 = __pyx_v_i;
      *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_indexer.diminfo[0].strides) = __pyx_v_j;

      /* "pandas/src/generated.pyx":7071
 *         while i < nleft - 1 and left[i] == rval:
 *             indexer[i] = j
 *             i += 1             # <<<<<<<<<<<<<<
 * 
 *         if left[i] == right[j]:
 */
      __pyx_v_i = (__pyx_v_i + 1);
    }

    /* "pandas/src/generated.pyx":7073
 *             i += 1
 * 
 *         if left[i] == right[j]:             # <<<<<<<<<<<<<<
 *             indexer[i] = j
 *             i += 1
 */
    __pyx_t_18 = __pyx_v_i;
    __pyx_t_19 = __pyx_v_j;
    __pyx_t_16 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_left.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_left.diminfo[0].strides)) == (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_right.rcbuffer->pybuffer.buf, __pyx_t_19, __pyx_pybuffernd_right.diminfo[0].strides))) != 0);
    if (__pyx_t_16) {

      /* "pandas/src/generated.pyx":7074
 * 
 *         if left[i] == right[j]:
 *             indexer[i] = j             # <<<<<<<<<<<<<<
 *             i += 1
 *             while i < nleft - 1 and left[i] == rval:
 */
      __pyx_t_20 = __pyx_v_i;
      *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_indexer.diminfo[0].strides) = __pyx_v_j;

      /* "pandas/src/generated.pyx":7075
 *         if left[i] == right[j]:
 *             indexer[i] = j
 *             i += 1             # <<<<<<<<<<<<<<
 *             while i < nleft - 1 and left[i] == rval:
 *                 indexer[i] = j
 */
      __pyx_v_i = (__pyx_v_i + 1);

      /* "pandas/src/generated.pyx":7076
 *             indexer[i] = j
 *             i += 1
 *             while i < nleft - 1 and left[i] == rval:             # <<<<<<<<<<<<<<
 *                 indexer[i] = j
 *                 i += 1
 */
      while (1) {
        __pyx_t_16 = ((__pyx_v_i < (__pyx_v_nleft - 1)) != 0);
        if (__pyx_t_16) {
          __pyx_t_21 = __pyx_v_i;
          __pyx_t_12 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_left.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_left.diminfo[0].strides)) == __pyx_v_rval) != 0);
          __pyx_t_15 = __pyx_t_12;
        } else {
          __pyx_t_15 = __pyx_t_16;
        }
        if (!__pyx_t_15) break;

        /* "pandas/src/generated.pyx":7077
 *             i += 1
 *             while i < nleft - 1 and left[i] == rval:
 *                 indexer[i] = j             # <<<<<<<<<<<<<<
 *                 i += 1
 *             j += 1
 */
        __pyx_t_22 = __pyx_v_i;
        *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_22, __pyx_pybuffernd_indexer.diminfo[0].strides) = __pyx_v_j;

        /* "pandas/src/generated.pyx":7078
 *             while i < nleft - 1 and left[i] == rval:
 *                 indexer[i] = j
 *                 i += 1             # <<<<<<<<<<<<<<
 *             j += 1
 *         elif left[i] > rval:
 */
        __pyx_v_i = (__pyx_v_i + 1);
      }

      /* "pandas/src/generated.pyx":7079
 *                 indexer[i] = j
 *                 i += 1
 *             j += 1             # <<<<<<<<<<<<<<
 *         elif left[i] > rval:
 *             indexer[i] = -1
 */
      __pyx_v_j = (__pyx_v_j + 1);
      goto __pyx_L9;
    }

    /* "pandas/src/generated.pyx":7080
 *                 i += 1
 *             j += 1
 *         elif left[i] > rval:             # <<<<<<<<<<<<<<
 *             indexer[i] = -1
 *             j += 1
 */
    __pyx_t_23 = __pyx_v_i;
    __pyx_t_15 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_left.rcbuffer->pybuffer.buf, __pyx_t_23, __pyx_pybuffernd_left.diminfo[0].strides)) > __pyx_v_rval) != 0);
    if (__pyx_t_15) {

      /* "pandas/src/generated.pyx":7081
 *             j += 1
 *         elif left[i] > rval:
 *             indexer[i] = -1             # <<<<<<<<<<<<<<
 *             j += 1
 *         else:
 */
      __pyx_t_24 = __pyx_v_i;
      *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_24, __pyx_pybuffernd_indexer.diminfo[0].strides) = -1;

      /* "pandas/src/generated.pyx":7082
 *         elif left[i] > rval:
 *             indexer[i] = -1
 *             j += 1             # <<<<<<<<<<<<<<
 *         else:
 *             indexer[i] = -1
 */
      __pyx_v_j = (__pyx_v_j + 1);
      goto __pyx_L9;
    }
    /*else*/ {

      /* "pandas/src/generated.pyx":7084
 *             j += 1
 *         else:
 *             indexer[i] = -1             # <<<<<<<<<<<<<<
 *             i += 1
 *     return indexer
 */
      __pyx_t_25 = __pyx_v_i;
      *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_25, __pyx_pybuffernd_indexer.diminfo[0].strides) = -1;

      /* "pandas/src/generated.pyx":7085
 *         else:
 *             indexer[i] = -1
 *             i += 1             # <<<<<<<<<<<<<<
 *     return indexer
 * 
 */
      __pyx_v_i = (__pyx_v_i + 1);
    }
    __pyx_L9:;
    __pyx_L3_continue:;
  }
  __pyx_L4_break:;

  /* "pandas/src/generated.pyx":7086
 *             indexer[i] = -1
 *             i += 1
 *     return indexer             # <<<<<<<<<<<<<<
 * 
 * @cython.wraparound(False)
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_indexer));
  __pyx_r = ((PyObject *)__pyx_v_indexer);
  goto __pyx_L0;

  /* "pandas/src/generated.pyx":7045
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def left_join_indexer_unique_int32(ndarray[int32_t] left,             # <<<<<<<<<<<<<<
 *                                       ndarray[int32_t] right):
 *     cdef:
 */

  /* function exit code */
  __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_pybuffernd_indexer.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_left.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_right.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas.algos.left_join_indexer_unique_int32", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_left.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_right.rcbuffer->pybuffer);
  __pyx_L2:;
  __Pyx_XDECREF((PyObject *)__pyx_v_indexer);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/src/generated.pyx":7090
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def left_join_indexer_unique_int64(ndarray[int64_t] left,             # <<<<<<<<<<<<<<
 *                                       ndarray[int64_t] right):
 *     cdef:
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pandas_5algos_479left_join_indexer_unique_int64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_5algos_479left_join_indexer_unique_int64 = {__Pyx_NAMESTR("left_join_indexer_unique_int64"), (PyCFunction)__pyx_pw_6pandas_5algos_479left_join_indexer_unique_int64, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pw_6pandas_5algos_479left_join_indexer_unique_int64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyArrayObject *__pyx_v_left = 0;
  PyArrayObject *__pyx_v_right = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("left_join_indexer_unique_int64 (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_left,&__pyx_n_s_right,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_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 (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_left)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_right)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("left_join_indexer_unique_int64", 1, 2, 2, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7090; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "left_join_indexer_unique_int64") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7090; __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("left_join_indexer_unique_int64", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7090; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas.algos.left_join_indexer_unique_int64", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_left), __pyx_ptype_5numpy_ndarray, 1, "left", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7090; __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[2]; __pyx_lineno = 7091; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_478left_join_indexer_unique_int64(__pyx_self, __pyx_v_left, __pyx_v_right);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pandas_5algos_478left_join_indexer_unique_int64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_left, PyArrayObject *__pyx_v_right) {
  Py_ssize_t __pyx_v_i;
  Py_ssize_t __pyx_v_j;
  Py_ssize_t __pyx_v_nleft;
  Py_ssize_t __pyx_v_nright;
  PyArrayObject *__pyx_v_indexer = 0;
  __pyx_t_5numpy_int64_t __pyx_v_rval;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_indexer;
  __Pyx_Buffer __pyx_pybuffer_indexer;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_left;
  __Pyx_Buffer __pyx_pybuffer_left;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_right;
  __Pyx_Buffer __pyx_pybuffer_right;
  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;
  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;
  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;
  __Pyx_RefNannySetupContext("left_join_indexer_unique_int64", 0);
  __pyx_pybuffer_indexer.pybuffer.buf = NULL;
  __pyx_pybuffer_indexer.refcount = 0;
  __pyx_pybuffernd_indexer.data = NULL;
  __pyx_pybuffernd_indexer.rcbuffer = &__pyx_pybuffer_indexer;
  __pyx_pybuffer_left.pybuffer.buf = NULL;
  __pyx_pybuffer_left.refcount = 0;
  __pyx_pybuffernd_left.data = NULL;
  __pyx_pybuffernd_left.rcbuffer = &__pyx_pybuffer_left;
  __pyx_pybuffer_right.pybuffer.buf = NULL;
  __pyx_pybuffer_right.refcount = 0;
  __pyx_pybuffernd_right.data = NULL;
  __pyx_pybuffernd_right.rcbuffer = &__pyx_pybuffer_right;
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_left.rcbuffer->pybuffer, (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[2]; __pyx_lineno = 7090; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_left.diminfo[0].strides = __pyx_pybuffernd_left.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_left.diminfo[0].shape = __pyx_pybuffernd_left.rcbuffer->pybuffer.shape[0];
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_right.rcbuffer->pybuffer, (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[2]; __pyx_lineno = 7090; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_right.diminfo[0].strides = __pyx_pybuffernd_right.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_right.diminfo[0].shape = __pyx_pybuffernd_right.rcbuffer->pybuffer.shape[0];

  /* "pandas/src/generated.pyx":7097
 *         int64_t lval, rval
 * 
 *     i = 0             # <<<<<<<<<<<<<<
 *     j = 0
 *     nleft = len(left)
 */
  __pyx_v_i = 0;

  /* "pandas/src/generated.pyx":7098
 * 
 *     i = 0
 *     j = 0             # <<<<<<<<<<<<<<
 *     nleft = len(left)
 *     nright = len(right)
 */
  __pyx_v_j = 0;

  /* "pandas/src/generated.pyx":7099
 *     i = 0
 *     j = 0
 *     nleft = len(left)             # <<<<<<<<<<<<<<
 *     nright = len(right)
 * 
 */
  __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_left)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7099; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_nleft = __pyx_t_1;

  /* "pandas/src/generated.pyx":7100
 *     j = 0
 *     nleft = len(left)
 *     nright = len(right)             # <<<<<<<<<<<<<<
 * 
 *     indexer = np.empty(nleft, dtype=np.int64)
 */
  __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_right)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7100; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_nright = __pyx_t_1;

  /* "pandas/src/generated.pyx":7102
 *     nright = len(right)
 * 
 *     indexer = np.empty(nleft, dtype=np.int64)             # <<<<<<<<<<<<<<
 *     while True:
 *         if i == nleft:
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7102; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_empty); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7102; __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_nleft); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7102; __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 = 7102; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__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 = 7102; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7102; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_int64); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7102; __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, __pyx_n_s_dtype, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7102; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7102; __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_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__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 = 7102; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_7 = ((PyArrayObject *)__pyx_t_6);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer);
    __pyx_t_8 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer, (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_pybuffernd_indexer.rcbuffer->pybuffer, (PyObject*)__pyx_v_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_pybuffernd_indexer.diminfo[0].strides = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_indexer.diminfo[0].shape = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.shape[0];
    if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7102; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_7 = 0;
  __pyx_v_indexer = ((PyArrayObject *)__pyx_t_6);
  __pyx_t_6 = 0;

  /* "pandas/src/generated.pyx":7103
 * 
 *     indexer = np.empty(nleft, dtype=np.int64)
 *     while True:             # <<<<<<<<<<<<<<
 *         if i == nleft:
 *             break
 */
  while (1) {

    /* "pandas/src/generated.pyx":7104
 *     indexer = np.empty(nleft, dtype=np.int64)
 *     while True:
 *         if i == nleft:             # <<<<<<<<<<<<<<
 *             break
 * 
 */
    __pyx_t_12 = ((__pyx_v_i == __pyx_v_nleft) != 0);
    if (__pyx_t_12) {

      /* "pandas/src/generated.pyx":7105
 *     while True:
 *         if i == nleft:
 *             break             # <<<<<<<<<<<<<<
 * 
 *         if j == nright:
 */
      goto __pyx_L4_break;
    }

    /* "pandas/src/generated.pyx":7107
 *             break
 * 
 *         if j == nright:             # <<<<<<<<<<<<<<
 *             indexer[i] = -1
 *             i += 1
 */
    __pyx_t_12 = ((__pyx_v_j == __pyx_v_nright) != 0);
    if (__pyx_t_12) {

      /* "pandas/src/generated.pyx":7108
 * 
 *         if j == nright:
 *             indexer[i] = -1             # <<<<<<<<<<<<<<
 *             i += 1
 *             continue
 */
      __pyx_t_1 = __pyx_v_i;
      *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_1, __pyx_pybuffernd_indexer.diminfo[0].strides) = -1;

      /* "pandas/src/generated.pyx":7109
 *         if j == nright:
 *             indexer[i] = -1
 *             i += 1             # <<<<<<<<<<<<<<
 *             continue
 * 
 */
      __pyx_v_i = (__pyx_v_i + 1);

      /* "pandas/src/generated.pyx":7110
 *             indexer[i] = -1
 *             i += 1
 *             continue             # <<<<<<<<<<<<<<
 * 
 *         rval = right[j]
 */
      goto __pyx_L3_continue;
    }

    /* "pandas/src/generated.pyx":7112
 *             continue
 * 
 *         rval = right[j]             # <<<<<<<<<<<<<<
 * 
 *         while i < nleft - 1 and left[i] == rval:
 */
    __pyx_t_13 = __pyx_v_j;
    __pyx_v_rval = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_right.rcbuffer->pybuffer.buf, __pyx_t_13, __pyx_pybuffernd_right.diminfo[0].strides));

    /* "pandas/src/generated.pyx":7114
 *         rval = right[j]
 * 
 *         while i < nleft - 1 and left[i] == rval:             # <<<<<<<<<<<<<<
 *             indexer[i] = j
 *             i += 1
 */
    while (1) {
      __pyx_t_12 = ((__pyx_v_i < (__pyx_v_nleft - 1)) != 0);
      if (__pyx_t_12) {
        __pyx_t_14 = __pyx_v_i;
        __pyx_t_15 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_left.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_left.diminfo[0].strides)) == __pyx_v_rval) != 0);
        __pyx_t_16 = __pyx_t_15;
      } else {
        __pyx_t_16 = __pyx_t_12;
      }
      if (!__pyx_t_16) break;

      /* "pandas/src/generated.pyx":7115
 * 
 *         while i < nleft - 1 and left[i] == rval:
 *             indexer[i] = j             # <<<<<<<<<<<<<<
 *             i += 1
 * 
 */
      __pyx_t_17 = __pyx_v_i;
      *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_indexer.diminfo[0].strides) = __pyx_v_j;

      /* "pandas/src/generated.pyx":7116
 *         while i < nleft - 1 and left[i] == rval:
 *             indexer[i] = j
 *             i += 1             # <<<<<<<<<<<<<<
 * 
 *         if left[i] == right[j]:
 */
      __pyx_v_i = (__pyx_v_i + 1);
    }

    /* "pandas/src/generated.pyx":7118
 *             i += 1
 * 
 *         if left[i] == right[j]:             # <<<<<<<<<<<<<<
 *             indexer[i] = j
 *             i += 1
 */
    __pyx_t_18 = __pyx_v_i;
    __pyx_t_19 = __pyx_v_j;
    __pyx_t_16 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_left.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_left.diminfo[0].strides)) == (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_right.rcbuffer->pybuffer.buf, __pyx_t_19, __pyx_pybuffernd_right.diminfo[0].strides))) != 0);
    if (__pyx_t_16) {

      /* "pandas/src/generated.pyx":7119
 * 
 *         if left[i] == right[j]:
 *             indexer[i] = j             # <<<<<<<<<<<<<<
 *             i += 1
 *             while i < nleft - 1 and left[i] == rval:
 */
      __pyx_t_20 = __pyx_v_i;
      *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_indexer.diminfo[0].strides) = __pyx_v_j;

      /* "pandas/src/generated.pyx":7120
 *         if left[i] == right[j]:
 *             indexer[i] = j
 *             i += 1             # <<<<<<<<<<<<<<
 *             while i < nleft - 1 and left[i] == rval:
 *                 indexer[i] = j
 */
      __pyx_v_i = (__pyx_v_i + 1);

      /* "pandas/src/generated.pyx":7121
 *             indexer[i] = j
 *             i += 1
 *             while i < nleft - 1 and left[i] == rval:             # <<<<<<<<<<<<<<
 *                 indexer[i] = j
 *                 i += 1
 */
      while (1) {
        __pyx_t_16 = ((__pyx_v_i < (__pyx_v_nleft - 1)) != 0);
        if (__pyx_t_16) {
          __pyx_t_21 = __pyx_v_i;
          __pyx_t_12 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_left.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_left.diminfo[0].strides)) == __pyx_v_rval) != 0);
          __pyx_t_15 = __pyx_t_12;
        } else {
          __pyx_t_15 = __pyx_t_16;
        }
        if (!__pyx_t_15) break;

        /* "pandas/src/generated.pyx":7122
 *             i += 1
 *             while i < nleft - 1 and left[i] == rval:
 *                 indexer[i] = j             # <<<<<<<<<<<<<<
 *                 i += 1
 *             j += 1
 */
        __pyx_t_22 = __pyx_v_i;
        *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_22, __pyx_pybuffernd_indexer.diminfo[0].strides) = __pyx_v_j;

        /* "pandas/src/generated.pyx":7123
 *             while i < nleft - 1 and left[i] == rval:
 *                 indexer[i] = j
 *                 i += 1             # <<<<<<<<<<<<<<
 *             j += 1
 *         elif left[i] > rval:
 */
        __pyx_v_i = (__pyx_v_i + 1);
      }

      /* "pandas/src/generated.pyx":7124
 *                 indexer[i] = j
 *                 i += 1
 *             j += 1             # <<<<<<<<<<<<<<
 *         elif left[i] > rval:
 *             indexer[i] = -1
 */
      __pyx_v_j = (__pyx_v_j + 1);
      goto __pyx_L9;
    }

    /* "pandas/src/generated.pyx":7125
 *                 i += 1
 *             j += 1
 *         elif left[i] > rval:             # <<<<<<<<<<<<<<
 *             indexer[i] = -1
 *             j += 1
 */
    __pyx_t_23 = __pyx_v_i;
    __pyx_t_15 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_left.rcbuffer->pybuffer.buf, __pyx_t_23, __pyx_pybuffernd_left.diminfo[0].strides)) > __pyx_v_rval) != 0);
    if (__pyx_t_15) {

      /* "pandas/src/generated.pyx":7126
 *             j += 1
 *         elif left[i] > rval:
 *             indexer[i] = -1             # <<<<<<<<<<<<<<
 *             j += 1
 *         else:
 */
      __pyx_t_24 = __pyx_v_i;
      *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_24, __pyx_pybuffernd_indexer.diminfo[0].strides) = -1;

      /* "pandas/src/generated.pyx":7127
 *         elif left[i] > rval:
 *             indexer[i] = -1
 *             j += 1             # <<<<<<<<<<<<<<
 *         else:
 *             indexer[i] = -1
 */
      __pyx_v_j = (__pyx_v_j + 1);
      goto __pyx_L9;
    }
    /*else*/ {

      /* "pandas/src/generated.pyx":7129
 *             j += 1
 *         else:
 *             indexer[i] = -1             # <<<<<<<<<<<<<<
 *             i += 1
 *     return indexer
 */
      __pyx_t_25 = __pyx_v_i;
      *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_25, __pyx_pybuffernd_indexer.diminfo[0].strides) = -1;

      /* "pandas/src/generated.pyx":7130
 *         else:
 *             indexer[i] = -1
 *             i += 1             # <<<<<<<<<<<<<<
 *     return indexer
 * 
 */
      __pyx_v_i = (__pyx_v_i + 1);
    }
    __pyx_L9:;
    __pyx_L3_continue:;
  }
  __pyx_L4_break:;

  /* "pandas/src/generated.pyx":7131
 *             indexer[i] = -1
 *             i += 1
 *     return indexer             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_indexer));
  __pyx_r = ((PyObject *)__pyx_v_indexer);
  goto __pyx_L0;

  /* "pandas/src/generated.pyx":7090
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def left_join_indexer_unique_int64(ndarray[int64_t] left,             # <<<<<<<<<<<<<<
 *                                       ndarray[int64_t] right):
 *     cdef:
 */

  /* function exit code */
  __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_pybuffernd_indexer.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_left.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_right.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas.algos.left_join_indexer_unique_int64", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_left.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_right.rcbuffer->pybuffer);
  __pyx_L2:;
  __Pyx_XDECREF((PyObject *)__pyx_v_indexer);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/src/generated.pyx":7135
 * 
 * 
 * def left_join_indexer_float64(ndarray[float64_t] left,             # <<<<<<<<<<<<<<
 *                               ndarray[float64_t] right):
 *     '''
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pandas_5algos_481left_join_indexer_float64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6pandas_5algos_480left_join_indexer_float64[] = "\n    Two-pass algorithm for monotonic indexes. Handles many-to-one merges\n    ";
static PyMethodDef __pyx_mdef_6pandas_5algos_481left_join_indexer_float64 = {__Pyx_NAMESTR("left_join_indexer_float64"), (PyCFunction)__pyx_pw_6pandas_5algos_481left_join_indexer_float64, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6pandas_5algos_480left_join_indexer_float64)};
static PyObject *__pyx_pw_6pandas_5algos_481left_join_indexer_float64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyArrayObject *__pyx_v_left = 0;
  PyArrayObject *__pyx_v_right = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("left_join_indexer_float64 (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_left,&__pyx_n_s_right,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_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 (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_left)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_right)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("left_join_indexer_float64", 1, 2, 2, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7135; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "left_join_indexer_float64") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7135; __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("left_join_indexer_float64", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7135; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas.algos.left_join_indexer_float64", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_left), __pyx_ptype_5numpy_ndarray, 1, "left", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7135; __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[2]; __pyx_lineno = 7136; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_480left_join_indexer_float64(__pyx_self, __pyx_v_left, __pyx_v_right);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pandas_5algos_480left_join_indexer_float64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_left, PyArrayObject *__pyx_v_right) {
  Py_ssize_t __pyx_v_i;
  Py_ssize_t __pyx_v_j;
  Py_ssize_t __pyx_v_nright;
  Py_ssize_t __pyx_v_nleft;
  Py_ssize_t __pyx_v_count;
  __pyx_t_5numpy_float64_t __pyx_v_lval;
  __pyx_t_5numpy_float64_t __pyx_v_rval;
  PyArrayObject *__pyx_v_lindexer = 0;
  PyArrayObject *__pyx_v_rindexer = 0;
  PyArrayObject *__pyx_v_result = 0;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_left;
  __Pyx_Buffer __pyx_pybuffer_left;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_lindexer;
  __Pyx_Buffer __pyx_pybuffer_lindexer;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_result;
  __Pyx_Buffer __pyx_pybuffer_result;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_right;
  __Pyx_Buffer __pyx_pybuffer_right;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_rindexer;
  __Pyx_Buffer __pyx_pybuffer_rindexer;
  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;
  int __pyx_t_6;
  int __pyx_t_7;
  Py_ssize_t __pyx_t_8;
  Py_ssize_t __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;
  PyObject *__pyx_t_16 = NULL;
  PyObject *__pyx_t_17 = NULL;
  PyObject *__pyx_t_18 = NULL;
  PyArrayObject *__pyx_t_19 = NULL;
  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;
  __Pyx_RefNannySetupContext("left_join_indexer_float64", 0);
  __pyx_pybuffer_lindexer.pybuffer.buf = NULL;
  __pyx_pybuffer_lindexer.refcount = 0;
  __pyx_pybuffernd_lindexer.data = NULL;
  __pyx_pybuffernd_lindexer.rcbuffer = &__pyx_pybuffer_lindexer;
  __pyx_pybuffer_rindexer.pybuffer.buf = NULL;
  __pyx_pybuffer_rindexer.refcount = 0;
  __pyx_pybuffernd_rindexer.data = NULL;
  __pyx_pybuffernd_rindexer.rcbuffer = &__pyx_pybuffer_rindexer;
  __pyx_pybuffer_result.pybuffer.buf = NULL;
  __pyx_pybuffer_result.refcount = 0;
  __pyx_pybuffernd_result.data = NULL;
  __pyx_pybuffernd_result.rcbuffer = &__pyx_pybuffer_result;
  __pyx_pybuffer_left.pybuffer.buf = NULL;
  __pyx_pybuffer_left.refcount = 0;
  __pyx_pybuffernd_left.data = NULL;
  __pyx_pybuffernd_left.rcbuffer = &__pyx_pybuffer_left;
  __pyx_pybuffer_right.pybuffer.buf = NULL;
  __pyx_pybuffer_right.refcount = 0;
  __pyx_pybuffernd_right.data = NULL;
  __pyx_pybuffernd_right.rcbuffer = &__pyx_pybuffer_right;
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_left.rcbuffer->pybuffer, (PyObject*)__pyx_v_left, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7135; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_left.diminfo[0].strides = __pyx_pybuffernd_left.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_left.diminfo[0].shape = __pyx_pybuffernd_left.rcbuffer->pybuffer.shape[0];
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_right.rcbuffer->pybuffer, (PyObject*)__pyx_v_right, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7135; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_right.diminfo[0].strides = __pyx_pybuffernd_right.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_right.diminfo[0].shape = __pyx_pybuffernd_right.rcbuffer->pybuffer.shape[0];

  /* "pandas/src/generated.pyx":7146
 *         ndarray[float64_t] result
 * 
 *     nleft = len(left)             # <<<<<<<<<<<<<<
 *     nright = len(right)
 * 
 */
  __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_left)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7146; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_nleft = __pyx_t_1;

  /* "pandas/src/generated.pyx":7147
 * 
 *     nleft = len(left)
 *     nright = len(right)             # <<<<<<<<<<<<<<
 * 
 *     i = 0
 */
  __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_right)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7147; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_nright = __pyx_t_1;

  /* "pandas/src/generated.pyx":7149
 *     nright = len(right)
 * 
 *     i = 0             # <<<<<<<<<<<<<<
 *     j = 0
 *     count = 0
 */
  __pyx_v_i = 0;

  /* "pandas/src/generated.pyx":7150
 * 
 *     i = 0
 *     j = 0             # <<<<<<<<<<<<<<
 *     count = 0
 *     if nleft > 0:
 */
  __pyx_v_j = 0;

  /* "pandas/src/generated.pyx":7151
 *     i = 0
 *     j = 0
 *     count = 0             # <<<<<<<<<<<<<<
 *     if nleft > 0:
 *         while i < nleft:
 */
  __pyx_v_count = 0;

  /* "pandas/src/generated.pyx":7152
 *     j = 0
 *     count = 0
 *     if nleft > 0:             # <<<<<<<<<<<<<<
 *         while i < nleft:
 *             if j == nright:
 */
  __pyx_t_2 = ((__pyx_v_nleft > 0) != 0);
  if (__pyx_t_2) {

    /* "pandas/src/generated.pyx":7153
 *     count = 0
 *     if nleft > 0:
 *         while i < nleft:             # <<<<<<<<<<<<<<
 *             if j == nright:
 *                 count += nleft - i
 */
    while (1) {
      __pyx_t_2 = ((__pyx_v_i < __pyx_v_nleft) != 0);
      if (!__pyx_t_2) break;

      /* "pandas/src/generated.pyx":7154
 *     if nleft > 0:
 *         while i < nleft:
 *             if j == nright:             # <<<<<<<<<<<<<<
 *                 count += nleft - i
 *                 break
 */
      __pyx_t_2 = ((__pyx_v_j == __pyx_v_nright) != 0);
      if (__pyx_t_2) {

        /* "pandas/src/generated.pyx":7155
 *         while i < nleft:
 *             if j == nright:
 *                 count += nleft - i             # <<<<<<<<<<<<<<
 *                 break
 * 
 */
        __pyx_v_count = (__pyx_v_count + (__pyx_v_nleft - __pyx_v_i));

        /* "pandas/src/generated.pyx":7156
 *             if j == nright:
 *                 count += nleft - i
 *                 break             # <<<<<<<<<<<<<<
 * 
 *             lval = left[i]
 */
        goto __pyx_L5_break;
      }

      /* "pandas/src/generated.pyx":7158
 *                 break
 * 
 *             lval = left[i]             # <<<<<<<<<<<<<<
 *             rval = right[j]
 * 
 */
      __pyx_t_1 = __pyx_v_i;
      __pyx_t_3 = -1;
      if (__pyx_t_1 < 0) {
        __pyx_t_1 += __pyx_pybuffernd_left.diminfo[0].shape;
        if (unlikely(__pyx_t_1 < 0)) __pyx_t_3 = 0;
      } else if (unlikely(__pyx_t_1 >= __pyx_pybuffernd_left.diminfo[0].shape)) __pyx_t_3 = 0;
      if (unlikely(__pyx_t_3 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_3);
        {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7158; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_v_lval = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_left.rcbuffer->pybuffer.buf, __pyx_t_1, __pyx_pybuffernd_left.diminfo[0].strides));

      /* "pandas/src/generated.pyx":7159
 * 
 *             lval = left[i]
 *             rval = right[j]             # <<<<<<<<<<<<<<
 * 
 *             if lval == rval:
 */
      __pyx_t_4 = __pyx_v_j;
      __pyx_t_3 = -1;
      if (__pyx_t_4 < 0) {
        __pyx_t_4 += __pyx_pybuffernd_right.diminfo[0].shape;
        if (unlikely(__pyx_t_4 < 0)) __pyx_t_3 = 0;
      } else if (unlikely(__pyx_t_4 >= __pyx_pybuffernd_right.diminfo[0].shape)) __pyx_t_3 = 0;
      if (unlikely(__pyx_t_3 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_3);
        {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7159; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_v_rval = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_right.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_right.diminfo[0].strides));

      /* "pandas/src/generated.pyx":7161
 *             rval = right[j]
 * 
 *             if lval == rval:             # <<<<<<<<<<<<<<
 *                 count += 1
 *                 if i < nleft - 1:
 */
      __pyx_t_2 = ((__pyx_v_lval == __pyx_v_rval) != 0);
      if (__pyx_t_2) {

        /* "pandas/src/generated.pyx":7162
 * 
 *             if lval == rval:
 *                 count += 1             # <<<<<<<<<<<<<<
 *                 if i < nleft - 1:
 *                     if j < nright - 1 and right[j + 1] == rval:
 */
        __pyx_v_count = (__pyx_v_count + 1);

        /* "pandas/src/generated.pyx":7163
 *             if lval == rval:
 *                 count += 1
 *                 if i < nleft - 1:             # <<<<<<<<<<<<<<
 *                     if j < nright - 1 and right[j + 1] == rval:
 *                         j += 1
 */
        __pyx_t_2 = ((__pyx_v_i < (__pyx_v_nleft - 1)) != 0);
        if (__pyx_t_2) {

          /* "pandas/src/generated.pyx":7164
 *                 count += 1
 *                 if i < nleft - 1:
 *                     if j < nright - 1 and right[j + 1] == rval:             # <<<<<<<<<<<<<<
 *                         j += 1
 *                     else:
 */
          __pyx_t_2 = ((__pyx_v_j < (__pyx_v_nright - 1)) != 0);
          if (__pyx_t_2) {
            __pyx_t_5 = (__pyx_v_j + 1);
            __pyx_t_3 = -1;
            if (__pyx_t_5 < 0) {
              __pyx_t_5 += __pyx_pybuffernd_right.diminfo[0].shape;
              if (unlikely(__pyx_t_5 < 0)) __pyx_t_3 = 0;
            } else if (unlikely(__pyx_t_5 >= __pyx_pybuffernd_right.diminfo[0].shape)) __pyx_t_3 = 0;
            if (unlikely(__pyx_t_3 != -1)) {
              __Pyx_RaiseBufferIndexError(__pyx_t_3);
              {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7164; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            }
            __pyx_t_6 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_right.rcbuffer->pybuffer.buf, __pyx_t_5, __pyx_pybuffernd_right.diminfo[0].strides)) == __pyx_v_rval) != 0);
            __pyx_t_7 = __pyx_t_6;
          } else {
            __pyx_t_7 = __pyx_t_2;
          }
          if (__pyx_t_7) {

            /* "pandas/src/generated.pyx":7165
 *                 if i < nleft - 1:
 *                     if j < nright - 1 and right[j + 1] == rval:
 *                         j += 1             # <<<<<<<<<<<<<<
 *                     else:
 *                         i += 1
 */
            __pyx_v_j = (__pyx_v_j + 1);
            goto __pyx_L9;
          }
          /*else*/ {

            /* "pandas/src/generated.pyx":7167
 *                         j += 1
 *                     else:
 *                         i += 1             # <<<<<<<<<<<<<<
 *                         if left[i] != rval:
 *                             j += 1
 */
            __pyx_v_i = (__pyx_v_i + 1);

            /* "pandas/src/generated.pyx":7168
 *                     else:
 *                         i += 1
 *                         if left[i] != rval:             # <<<<<<<<<<<<<<
 *                             j += 1
 *                 elif j < nright - 1:
 */
            __pyx_t_8 = __pyx_v_i;
            __pyx_t_3 = -1;
            if (__pyx_t_8 < 0) {
              __pyx_t_8 += __pyx_pybuffernd_left.diminfo[0].shape;
              if (unlikely(__pyx_t_8 < 0)) __pyx_t_3 = 0;
            } else if (unlikely(__pyx_t_8 >= __pyx_pybuffernd_left.diminfo[0].shape)) __pyx_t_3 = 0;
            if (unlikely(__pyx_t_3 != -1)) {
              __Pyx_RaiseBufferIndexError(__pyx_t_3);
              {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7168; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            }
            __pyx_t_7 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_left.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_left.diminfo[0].strides)) != __pyx_v_rval) != 0);
            if (__pyx_t_7) {

              /* "pandas/src/generated.pyx":7169
 *                         i += 1
 *                         if left[i] != rval:
 *                             j += 1             # <<<<<<<<<<<<<<
 *                 elif j < nright - 1:
 *                     j += 1
 */
              __pyx_v_j = (__pyx_v_j + 1);
              goto __pyx_L10;
            }
            __pyx_L10:;
          }
          __pyx_L9:;
          goto __pyx_L8;
        }

        /* "pandas/src/generated.pyx":7170
 *                         if left[i] != rval:
 *                             j += 1
 *                 elif j < nright - 1:             # <<<<<<<<<<<<<<
 *                     j += 1
 *                     if lval != right[j]:
 */
        __pyx_t_7 = ((__pyx_v_j < (__pyx_v_nright - 1)) != 0);
        if (__pyx_t_7) {

          /* "pandas/src/generated.pyx":7171
 *                             j += 1
 *                 elif j < nright - 1:
 *                     j += 1             # <<<<<<<<<<<<<<
 *                     if lval != right[j]:
 *                         i += 1
 */
          __pyx_v_j = (__pyx_v_j + 1);

          /* "pandas/src/generated.pyx":7172
 *                 elif j < nright - 1:
 *                     j += 1
 *                     if lval != right[j]:             # <<<<<<<<<<<<<<
 *                         i += 1
 *                 else:
 */
          __pyx_t_9 = __pyx_v_j;
          __pyx_t_3 = -1;
          if (__pyx_t_9 < 0) {
            __pyx_t_9 += __pyx_pybuffernd_right.diminfo[0].shape;
            if (unlikely(__pyx_t_9 < 0)) __pyx_t_3 = 0;
          } else if (unlikely(__pyx_t_9 >= __pyx_pybuffernd_right.diminfo[0].shape)) __pyx_t_3 = 0;
          if (unlikely(__pyx_t_3 != -1)) {
            __Pyx_RaiseBufferIndexError(__pyx_t_3);
            {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7172; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          }
          __pyx_t_7 = ((__pyx_v_lval != (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_right.rcbuffer->pybuffer.buf, __pyx_t_9, __pyx_pybuffernd_right.diminfo[0].strides))) != 0);
          if (__pyx_t_7) {

            /* "pandas/src/generated.pyx":7173
 *                     j += 1
 *                     if lval != right[j]:
 *                         i += 1             # <<<<<<<<<<<<<<
 *                 else:
 *                     # end of the road
 */
            __pyx_v_i = (__pyx_v_i + 1);
            goto __pyx_L11;
          }
          __pyx_L11:;
          goto __pyx_L8;
        }
        /*else*/ {

          /* "pandas/src/generated.pyx":7176
 *                 else:
 *                     # end of the road
 *                     break             # <<<<<<<<<<<<<<
 *             elif lval < rval:
 *                 count += 1
 */
          goto __pyx_L5_break;
        }
        __pyx_L8:;
        goto __pyx_L7;
      }

      /* "pandas/src/generated.pyx":7177
 *                     # end of the road
 *                     break
 *             elif lval < rval:             # <<<<<<<<<<<<<<
 *                 count += 1
 *                 i += 1
 */
      __pyx_t_7 = ((__pyx_v_lval < __pyx_v_rval) != 0);
      if (__pyx_t_7) {

        /* "pandas/src/generated.pyx":7178
 *                     break
 *             elif lval < rval:
 *                 count += 1             # <<<<<<<<<<<<<<
 *                 i += 1
 *             else:
 */
        __pyx_v_count = (__pyx_v_count + 1);

        /* "pandas/src/generated.pyx":7179
 *             elif lval < rval:
 *                 count += 1
 *                 i += 1             # <<<<<<<<<<<<<<
 *             else:
 *                 j += 1
 */
        __pyx_v_i = (__pyx_v_i + 1);
        goto __pyx_L7;
      }
      /*else*/ {

        /* "pandas/src/generated.pyx":7181
 *                 i += 1
 *             else:
 *                 j += 1             # <<<<<<<<<<<<<<
 * 
 *     # do it again now that result size is known
 */
        __pyx_v_j = (__pyx_v_j + 1);
      }
      __pyx_L7:;
    }
    __pyx_L5_break:;
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "pandas/src/generated.pyx":7185
 *     # do it again now that result size is known
 * 
 *     lindexer = np.empty(count, dtype=np.int64)             # <<<<<<<<<<<<<<
 *     rindexer = np.empty(count, dtype=np.int64)
 *     result = np.empty(count, dtype=np.float64)
 */
  __pyx_t_10 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7185; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_10);
  __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_empty); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7185; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_11);
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  __pyx_t_10 = PyInt_FromSsize_t(__pyx_v_count); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7185; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_10);
  __pyx_t_12 = PyTuple_New(1); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7185; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_12);
  PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_10);
  __Pyx_GIVEREF(__pyx_t_10);
  __pyx_t_10 = 0;
  __pyx_t_10 = PyDict_New(); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7185; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_10);
  __pyx_t_13 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7185; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_13);
  __pyx_t_14 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_n_s_int64); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7185; __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_10, __pyx_n_s_dtype, __pyx_t_14) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7185; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  __pyx_t_14 = __Pyx_PyObject_Call(__pyx_t_11, __pyx_t_12, __pyx_t_10); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7185; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_14);
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  if (!(likely(((__pyx_t_14) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_14, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7185; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_15 = ((PyArrayObject *)__pyx_t_14);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_lindexer.rcbuffer->pybuffer);
    __pyx_t_3 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_lindexer.rcbuffer->pybuffer, (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_3 < 0)) {
      PyErr_Fetch(&__pyx_t_16, &__pyx_t_17, &__pyx_t_18);
      if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_lindexer.rcbuffer->pybuffer, (PyObject*)__pyx_v_lindexer, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {
        Py_XDECREF(__pyx_t_16); Py_XDECREF(__pyx_t_17); Py_XDECREF(__pyx_t_18);
        __Pyx_RaiseBufferFallbackError();
      } else {
        PyErr_Restore(__pyx_t_16, __pyx_t_17, __pyx_t_18);
      }
    }
    __pyx_pybuffernd_lindexer.diminfo[0].strides = __pyx_pybuffernd_lindexer.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_lindexer.diminfo[0].shape = __pyx_pybuffernd_lindexer.rcbuffer->pybuffer.shape[0];
    if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7185; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_15 = 0;
  __pyx_v_lindexer = ((PyArrayObject *)__pyx_t_14);
  __pyx_t_14 = 0;

  /* "pandas/src/generated.pyx":7186
 * 
 *     lindexer = np.empty(count, dtype=np.int64)
 *     rindexer = np.empty(count, dtype=np.int64)             # <<<<<<<<<<<<<<
 *     result = np.empty(count, dtype=np.float64)
 * 
 */
  __pyx_t_14 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7186; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_14);
  __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_14, __pyx_n_s_empty); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7186; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_10);
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  __pyx_t_14 = PyInt_FromSsize_t(__pyx_v_count); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7186; __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[2]; __pyx_lineno = 7186; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__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 = PyDict_New(); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7186; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_14);
  __pyx_t_11 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7186; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_11);
  __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_int64); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7186; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_13);
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  if (PyDict_SetItem(__pyx_t_14, __pyx_n_s_dtype, __pyx_t_13) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7186; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  __pyx_t_13 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_t_12, __pyx_t_14); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7186; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_13);
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
  __Pyx_DECREF(__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[2]; __pyx_lineno = 7186; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_15 = ((PyArrayObject *)__pyx_t_13);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_rindexer.rcbuffer->pybuffer);
    __pyx_t_3 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_rindexer.rcbuffer->pybuffer, (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_3 < 0)) {
      PyErr_Fetch(&__pyx_t_18, &__pyx_t_17, &__pyx_t_16);
      if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_rindexer.rcbuffer->pybuffer, (PyObject*)__pyx_v_rindexer, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {
        Py_XDECREF(__pyx_t_18); Py_XDECREF(__pyx_t_17); Py_XDECREF(__pyx_t_16);
        __Pyx_RaiseBufferFallbackError();
      } else {
        PyErr_Restore(__pyx_t_18, __pyx_t_17, __pyx_t_16);
      }
    }
    __pyx_pybuffernd_rindexer.diminfo[0].strides = __pyx_pybuffernd_rindexer.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_rindexer.diminfo[0].shape = __pyx_pybuffernd_rindexer.rcbuffer->pybuffer.shape[0];
    if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7186; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_15 = 0;
  __pyx_v_rindexer = ((PyArrayObject *)__pyx_t_13);
  __pyx_t_13 = 0;

  /* "pandas/src/generated.pyx":7187
 *     lindexer = np.empty(count, dtype=np.int64)
 *     rindexer = np.empty(count, dtype=np.int64)
 *     result = np.empty(count, dtype=np.float64)             # <<<<<<<<<<<<<<
 * 
 *     i = 0
 */
  __pyx_t_13 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7187; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_13);
  __pyx_t_14 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_n_s_empty); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7187; __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_count); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7187; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_13);
  __pyx_t_12 = PyTuple_New(1); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7187; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_12);
  PyTuple_SET_ITEM(__pyx_t_12, 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 = 7187; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_13);
  __pyx_t_10 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7187; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_10);
  __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_float64); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7187; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_11);
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  if (PyDict_SetItem(__pyx_t_13, __pyx_n_s_dtype, __pyx_t_11) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7187; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  __pyx_t_11 = __Pyx_PyObject_Call(__pyx_t_14, __pyx_t_12, __pyx_t_13); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7187; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_11);
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 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 = 7187; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_19 = ((PyArrayObject *)__pyx_t_11);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer);
    __pyx_t_3 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_result.rcbuffer->pybuffer, (PyObject*)__pyx_t_19, &__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_16, &__pyx_t_17, &__pyx_t_18);
      if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_result.rcbuffer->pybuffer, (PyObject*)__pyx_v_result, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {
        Py_XDECREF(__pyx_t_16); Py_XDECREF(__pyx_t_17); Py_XDECREF(__pyx_t_18);
        __Pyx_RaiseBufferFallbackError();
      } else {
        PyErr_Restore(__pyx_t_16, __pyx_t_17, __pyx_t_18);
      }
    }
    __pyx_pybuffernd_result.diminfo[0].strides = __pyx_pybuffernd_result.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_result.diminfo[0].shape = __pyx_pybuffernd_result.rcbuffer->pybuffer.shape[0];
    if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7187; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_19 = 0;
  __pyx_v_result = ((PyArrayObject *)__pyx_t_11);
  __pyx_t_11 = 0;

  /* "pandas/src/generated.pyx":7189
 *     result = np.empty(count, dtype=np.float64)
 * 
 *     i = 0             # <<<<<<<<<<<<<<
 *     j = 0
 *     count = 0
 */
  __pyx_v_i = 0;

  /* "pandas/src/generated.pyx":7190
 * 
 *     i = 0
 *     j = 0             # <<<<<<<<<<<<<<
 *     count = 0
 *     if nleft > 0:
 */
  __pyx_v_j = 0;

  /* "pandas/src/generated.pyx":7191
 *     i = 0
 *     j = 0
 *     count = 0             # <<<<<<<<<<<<<<
 *     if nleft > 0:
 *         while i < nleft:
 */
  __pyx_v_count = 0;

  /* "pandas/src/generated.pyx":7192
 *     j = 0
 *     count = 0
 *     if nleft > 0:             # <<<<<<<<<<<<<<
 *         while i < nleft:
 *             if j == nright:
 */
  __pyx_t_7 = ((__pyx_v_nleft > 0) != 0);
  if (__pyx_t_7) {

    /* "pandas/src/generated.pyx":7193
 *     count = 0
 *     if nleft > 0:
 *         while i < nleft:             # <<<<<<<<<<<<<<
 *             if j == nright:
 *                 while i < nleft:
 */
    while (1) {
      __pyx_t_7 = ((__pyx_v_i < __pyx_v_nleft) != 0);
      if (!__pyx_t_7) break;

      /* "pandas/src/generated.pyx":7194
 *     if nleft > 0:
 *         while i < nleft:
 *             if j == nright:             # <<<<<<<<<<<<<<
 *                 while i < nleft:
 *                     lindexer[count] = i
 */
      __pyx_t_7 = ((__pyx_v_j == __pyx_v_nright) != 0);
      if (__pyx_t_7) {

        /* "pandas/src/generated.pyx":7195
 *         while i < nleft:
 *             if j == nright:
 *                 while i < nleft:             # <<<<<<<<<<<<<<
 *                     lindexer[count] = i
 *                     rindexer[count] = -1
 */
        while (1) {
          __pyx_t_7 = ((__pyx_v_i < __pyx_v_nleft) != 0);
          if (!__pyx_t_7) break;

          /* "pandas/src/generated.pyx":7196
 *             if j == nright:
 *                 while i < nleft:
 *                     lindexer[count] = i             # <<<<<<<<<<<<<<
 *                     rindexer[count] = -1
 *                     result[count] = left[i]
 */
          __pyx_t_20 = __pyx_v_count;
          __pyx_t_3 = -1;
          if (__pyx_t_20 < 0) {
            __pyx_t_20 += __pyx_pybuffernd_lindexer.diminfo[0].shape;
            if (unlikely(__pyx_t_20 < 0)) __pyx_t_3 = 0;
          } else if (unlikely(__pyx_t_20 >= __pyx_pybuffernd_lindexer.diminfo[0].shape)) __pyx_t_3 = 0;
          if (unlikely(__pyx_t_3 != -1)) {
            __Pyx_RaiseBufferIndexError(__pyx_t_3);
            {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7196; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          }
          *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_lindexer.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_lindexer.diminfo[0].strides) = __pyx_v_i;

          /* "pandas/src/generated.pyx":7197
 *                 while i < nleft:
 *                     lindexer[count] = i
 *                     rindexer[count] = -1             # <<<<<<<<<<<<<<
 *                     result[count] = left[i]
 *                     i += 1
 */
          __pyx_t_21 = __pyx_v_count;
          __pyx_t_3 = -1;
          if (__pyx_t_21 < 0) {
            __pyx_t_21 += __pyx_pybuffernd_rindexer.diminfo[0].shape;
            if (unlikely(__pyx_t_21 < 0)) __pyx_t_3 = 0;
          } else if (unlikely(__pyx_t_21 >= __pyx_pybuffernd_rindexer.diminfo[0].shape)) __pyx_t_3 = 0;
          if (unlikely(__pyx_t_3 != -1)) {
            __Pyx_RaiseBufferIndexError(__pyx_t_3);
            {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7197; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          }
          *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_rindexer.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_rindexer.diminfo[0].strides) = -1;

          /* "pandas/src/generated.pyx":7198
 *                     lindexer[count] = i
 *                     rindexer[count] = -1
 *                     result[count] = left[i]             # <<<<<<<<<<<<<<
 *                     i += 1
 *                     count += 1
 */
          __pyx_t_22 = __pyx_v_i;
          __pyx_t_3 = -1;
          if (__pyx_t_22 < 0) {
            __pyx_t_22 += __pyx_pybuffernd_left.diminfo[0].shape;
            if (unlikely(__pyx_t_22 < 0)) __pyx_t_3 = 0;
          } else if (unlikely(__pyx_t_22 >= __pyx_pybuffernd_left.diminfo[0].shape)) __pyx_t_3 = 0;
          if (unlikely(__pyx_t_3 != -1)) {
            __Pyx_RaiseBufferIndexError(__pyx_t_3);
            {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7198; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          }
          __pyx_t_23 = __pyx_v_count;
          __pyx_t_3 = -1;
          if (__pyx_t_23 < 0) {
            __pyx_t_23 += __pyx_pybuffernd_result.diminfo[0].shape;
            if (unlikely(__pyx_t_23 < 0)) __pyx_t_3 = 0;
          } else if (unlikely(__pyx_t_23 >= __pyx_pybuffernd_result.diminfo[0].shape)) __pyx_t_3 = 0;
          if (unlikely(__pyx_t_3 != -1)) {
            __Pyx_RaiseBufferIndexError(__pyx_t_3);
            {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7198; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          }
          *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_23, __pyx_pybuffernd_result.diminfo[0].strides) = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_left.rcbuffer->pybuffer.buf, __pyx_t_22, __pyx_pybuffernd_left.diminfo[0].strides));

          /* "pandas/src/generated.pyx":7199
 *                     rindexer[count] = -1
 *                     result[count] = left[i]
 *                     i += 1             # <<<<<<<<<<<<<<
 *                     count += 1
 *                 break
 */
          __pyx_v_i = (__pyx_v_i + 1);

          /* "pandas/src/generated.pyx":7200
 *                     result[count] = left[i]
 *                     i += 1
 *                     count += 1             # <<<<<<<<<<<<<<
 *                 break
 * 
 */
          __pyx_v_count = (__pyx_v_count + 1);
        }

        /* "pandas/src/generated.pyx":7201
 *                     i += 1
 *                     count += 1
 *                 break             # <<<<<<<<<<<<<<
 * 
 *             lval = left[i]
 */
        goto __pyx_L14_break;
      }

      /* "pandas/src/generated.pyx":7203
 *                 break
 * 
 *             lval = left[i]             # <<<<<<<<<<<<<<
 *             rval = right[j]
 * 
 */
      __pyx_t_24 = __pyx_v_i;
      __pyx_t_3 = -1;
      if (__pyx_t_24 < 0) {
        __pyx_t_24 += __pyx_pybuffernd_left.diminfo[0].shape;
        if (unlikely(__pyx_t_24 < 0)) __pyx_t_3 = 0;
      } else if (unlikely(__pyx_t_24 >= __pyx_pybuffernd_left.diminfo[0].shape)) __pyx_t_3 = 0;
      if (unlikely(__pyx_t_3 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_3);
        {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7203; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_v_lval = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_left.rcbuffer->pybuffer.buf, __pyx_t_24, __pyx_pybuffernd_left.diminfo[0].strides));

      /* "pandas/src/generated.pyx":7204
 * 
 *             lval = left[i]
 *             rval = right[j]             # <<<<<<<<<<<<<<
 * 
 *             if lval == rval:
 */
      __pyx_t_25 = __pyx_v_j;
      __pyx_t_3 = -1;
      if (__pyx_t_25 < 0) {
        __pyx_t_25 += __pyx_pybuffernd_right.diminfo[0].shape;
        if (unlikely(__pyx_t_25 < 0)) __pyx_t_3 = 0;
      } else if (unlikely(__pyx_t_25 >= __pyx_pybuffernd_right.diminfo[0].shape)) __pyx_t_3 = 0;
      if (unlikely(__pyx_t_3 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_3);
        {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7204; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_v_rval = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_right.rcbuffer->pybuffer.buf, __pyx_t_25, __pyx_pybuffernd_right.diminfo[0].strides));

      /* "pandas/src/generated.pyx":7206
 *             rval = right[j]
 * 
 *             if lval == rval:             # <<<<<<<<<<<<<<
 *                 lindexer[count] = i
 *                 rindexer[count] = j
 */
      __pyx_t_7 = ((__pyx_v_lval == __pyx_v_rval) != 0);
      if (__pyx_t_7) {

        /* "pandas/src/generated.pyx":7207
 * 
 *             if lval == rval:
 *                 lindexer[count] = i             # <<<<<<<<<<<<<<
 *                 rindexer[count] = j
 *                 result[count] = lval
 */
        __pyx_t_26 = __pyx_v_count;
        __pyx_t_3 = -1;
        if (__pyx_t_26 < 0) {
          __pyx_t_26 += __pyx_pybuffernd_lindexer.diminfo[0].shape;
          if (unlikely(__pyx_t_26 < 0)) __pyx_t_3 = 0;
        } else if (unlikely(__pyx_t_26 >= __pyx_pybuffernd_lindexer.diminfo[0].shape)) __pyx_t_3 = 0;
        if (unlikely(__pyx_t_3 != -1)) {
          __Pyx_RaiseBufferIndexError(__pyx_t_3);
          {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7207; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_lindexer.rcbuffer->pybuffer.buf, __pyx_t_26, __pyx_pybuffernd_lindexer.diminfo[0].strides) = __pyx_v_i;

        /* "pandas/src/generated.pyx":7208
 *             if lval == rval:
 *                 lindexer[count] = i
 *                 rindexer[count] = j             # <<<<<<<<<<<<<<
 *                 result[count] = lval
 *                 count += 1
 */
        __pyx_t_27 = __pyx_v_count;
        __pyx_t_3 = -1;
        if (__pyx_t_27 < 0) {
          __pyx_t_27 += __pyx_pybuffernd_rindexer.diminfo[0].shape;
          if (unlikely(__pyx_t_27 < 0)) __pyx_t_3 = 0;
        } else if (unlikely(__pyx_t_27 >= __pyx_pybuffernd_rindexer.diminfo[0].shape)) __pyx_t_3 = 0;
        if (unlikely(__pyx_t_3 != -1)) {
          __Pyx_RaiseBufferIndexError(__pyx_t_3);
          {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7208; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_rindexer.rcbuffer->pybuffer.buf, __pyx_t_27, __pyx_pybuffernd_rindexer.diminfo[0].strides) = __pyx_v_j;

        /* "pandas/src/generated.pyx":7209
 *                 lindexer[count] = i
 *                 rindexer[count] = j
 *                 result[count] = lval             # <<<<<<<<<<<<<<
 *                 count += 1
 *                 if i < nleft - 1:
 */
        __pyx_t_28 = __pyx_v_count;
        __pyx_t_3 = -1;
        if (__pyx_t_28 < 0) {
          __pyx_t_28 += __pyx_pybuffernd_result.diminfo[0].shape;
          if (unlikely(__pyx_t_28 < 0)) __pyx_t_3 = 0;
        } else if (unlikely(__pyx_t_28 >= __pyx_pybuffernd_result.diminfo[0].shape)) __pyx_t_3 = 0;
        if (unlikely(__pyx_t_3 != -1)) {
          __Pyx_RaiseBufferIndexError(__pyx_t_3);
          {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7209; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_28, __pyx_pybuffernd_result.diminfo[0].strides) = __pyx_v_lval;

        /* "pandas/src/generated.pyx":7210
 *                 rindexer[count] = j
 *                 result[count] = lval
 *                 count += 1             # <<<<<<<<<<<<<<
 *                 if i < nleft - 1:
 *                     if j < nright - 1 and right[j + 1] == rval:
 */
        __pyx_v_count = (__pyx_v_count + 1);

        /* "pandas/src/generated.pyx":7211
 *                 result[count] = lval
 *                 count += 1
 *                 if i < nleft - 1:             # <<<<<<<<<<<<<<
 *                     if j < nright - 1 and right[j + 1] == rval:
 *                         j += 1
 */
        __pyx_t_7 = ((__pyx_v_i < (__pyx_v_nleft - 1)) != 0);
        if (__pyx_t_7) {

          /* "pandas/src/generated.pyx":7212
 *                 count += 1
 *                 if i < nleft - 1:
 *                     if j < nright - 1 and right[j + 1] == rval:             # <<<<<<<<<<<<<<
 *                         j += 1
 *                     else:
 */
          __pyx_t_7 = ((__pyx_v_j < (__pyx_v_nright - 1)) != 0);
          if (__pyx_t_7) {
            __pyx_t_29 = (__pyx_v_j + 1);
            __pyx_t_3 = -1;
            if (__pyx_t_29 < 0) {
              __pyx_t_29 += __pyx_pybuffernd_right.diminfo[0].shape;
              if (unlikely(__pyx_t_29 < 0)) __pyx_t_3 = 0;
            } else if (unlikely(__pyx_t_29 >= __pyx_pybuffernd_right.diminfo[0].shape)) __pyx_t_3 = 0;
            if (unlikely(__pyx_t_3 != -1)) {
              __Pyx_RaiseBufferIndexError(__pyx_t_3);
              {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7212; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            }
            __pyx_t_2 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_right.rcbuffer->pybuffer.buf, __pyx_t_29, __pyx_pybuffernd_right.diminfo[0].strides)) == __pyx_v_rval) != 0);
            __pyx_t_6 = __pyx_t_2;
          } else {
            __pyx_t_6 = __pyx_t_7;
          }
          if (__pyx_t_6) {

            /* "pandas/src/generated.pyx":7213
 *                 if i < nleft - 1:
 *                     if j < nright - 1 and right[j + 1] == rval:
 *                         j += 1             # <<<<<<<<<<<<<<
 *                     else:
 *                         i += 1
 */
            __pyx_v_j = (__pyx_v_j + 1);
            goto __pyx_L20;
          }
          /*else*/ {

            /* "pandas/src/generated.pyx":7215
 *                         j += 1
 *                     else:
 *                         i += 1             # <<<<<<<<<<<<<<
 *                         if left[i] != rval:
 *                             j += 1
 */
            __pyx_v_i = (__pyx_v_i + 1);

            /* "pandas/src/generated.pyx":7216
 *                     else:
 *                         i += 1
 *                         if left[i] != rval:             # <<<<<<<<<<<<<<
 *                             j += 1
 *                 elif j < nright - 1:
 */
            __pyx_t_30 = __pyx_v_i;
            __pyx_t_3 = -1;
            if (__pyx_t_30 < 0) {
              __pyx_t_30 += __pyx_pybuffernd_left.diminfo[0].shape;
              if (unlikely(__pyx_t_30 < 0)) __pyx_t_3 = 0;
            } else if (unlikely(__pyx_t_30 >= __pyx_pybuffernd_left.diminfo[0].shape)) __pyx_t_3 = 0;
            if (unlikely(__pyx_t_3 != -1)) {
              __Pyx_RaiseBufferIndexError(__pyx_t_3);
              {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7216; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            }
            __pyx_t_6 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_left.rcbuffer->pybuffer.buf, __pyx_t_30, __pyx_pybuffernd_left.diminfo[0].strides)) != __pyx_v_rval) != 0);
            if (__pyx_t_6) {

              /* "pandas/src/generated.pyx":7217
 *                         i += 1
 *                         if left[i] != rval:
 *                             j += 1             # <<<<<<<<<<<<<<
 *                 elif j < nright - 1:
 *                     j += 1
 */
              __pyx_v_j = (__pyx_v_j + 1);
              goto __pyx_L21;
            }
            __pyx_L21:;
          }
          __pyx_L20:;
          goto __pyx_L19;
        }

        /* "pandas/src/generated.pyx":7218
 *                         if left[i] != rval:
 *                             j += 1
 *                 elif j < nright - 1:             # <<<<<<<<<<<<<<
 *                     j += 1
 *                     if lval != right[j]:
 */
        __pyx_t_6 = ((__pyx_v_j < (__pyx_v_nright - 1)) != 0);
        if (__pyx_t_6) {

          /* "pandas/src/generated.pyx":7219
 *                             j += 1
 *                 elif j < nright - 1:
 *                     j += 1             # <<<<<<<<<<<<<<
 *                     if lval != right[j]:
 *                         i += 1
 */
          __pyx_v_j = (__pyx_v_j + 1);

          /* "pandas/src/generated.pyx":7220
 *                 elif j < nright - 1:
 *                     j += 1
 *                     if lval != right[j]:             # <<<<<<<<<<<<<<
 *                         i += 1
 *                 else:
 */
          __pyx_t_31 = __pyx_v_j;
          __pyx_t_3 = -1;
          if (__pyx_t_31 < 0) {
            __pyx_t_31 += __pyx_pybuffernd_right.diminfo[0].shape;
            if (unlikely(__pyx_t_31 < 0)) __pyx_t_3 = 0;
          } else if (unlikely(__pyx_t_31 >= __pyx_pybuffernd_right.diminfo[0].shape)) __pyx_t_3 = 0;
          if (unlikely(__pyx_t_3 != -1)) {
            __Pyx_RaiseBufferIndexError(__pyx_t_3);
            {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7220; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          }
          __pyx_t_6 = ((__pyx_v_lval != (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_right.rcbuffer->pybuffer.buf, __pyx_t_31, __pyx_pybuffernd_right.diminfo[0].strides))) != 0);
          if (__pyx_t_6) {

            /* "pandas/src/generated.pyx":7221
 *                     j += 1
 *                     if lval != right[j]:
 *                         i += 1             # <<<<<<<<<<<<<<
 *                 else:
 *                     # end of the road
 */
            __pyx_v_i = (__pyx_v_i + 1);
            goto __pyx_L22;
          }
          __pyx_L22:;
          goto __pyx_L19;
        }
        /*else*/ {

          /* "pandas/src/generated.pyx":7224
 *                 else:
 *                     # end of the road
 *                     break             # <<<<<<<<<<<<<<
 *             elif lval < rval:
 *                 lindexer[count] = i
 */
          goto __pyx_L14_break;
        }
        __pyx_L19:;
        goto __pyx_L18;
      }

      /* "pandas/src/generated.pyx":7225
 *                     # end of the road
 *                     break
 *             elif lval < rval:             # <<<<<<<<<<<<<<
 *                 lindexer[count] = i
 *                 rindexer[count] = -1
 */
      __pyx_t_6 = ((__pyx_v_lval < __pyx_v_rval) != 0);
      if (__pyx_t_6) {

        /* "pandas/src/generated.pyx":7226
 *                     break
 *             elif lval < rval:
 *                 lindexer[count] = i             # <<<<<<<<<<<<<<
 *                 rindexer[count] = -1
 *                 result[count] = left[i]
 */
        __pyx_t_32 = __pyx_v_count;
        __pyx_t_3 = -1;
        if (__pyx_t_32 < 0) {
          __pyx_t_32 += __pyx_pybuffernd_lindexer.diminfo[0].shape;
          if (unlikely(__pyx_t_32 < 0)) __pyx_t_3 = 0;
        } else if (unlikely(__pyx_t_32 >= __pyx_pybuffernd_lindexer.diminfo[0].shape)) __pyx_t_3 = 0;
        if (unlikely(__pyx_t_3 != -1)) {
          __Pyx_RaiseBufferIndexError(__pyx_t_3);
          {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7226; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_lindexer.rcbuffer->pybuffer.buf, __pyx_t_32, __pyx_pybuffernd_lindexer.diminfo[0].strides) = __pyx_v_i;

        /* "pandas/src/generated.pyx":7227
 *             elif lval < rval:
 *                 lindexer[count] = i
 *                 rindexer[count] = -1             # <<<<<<<<<<<<<<
 *                 result[count] = left[i]
 *                 count += 1
 */
        __pyx_t_33 = __pyx_v_count;
        __pyx_t_3 = -1;
        if (__pyx_t_33 < 0) {
          __pyx_t_33 += __pyx_pybuffernd_rindexer.diminfo[0].shape;
          if (unlikely(__pyx_t_33 < 0)) __pyx_t_3 = 0;
        } else if (unlikely(__pyx_t_33 >= __pyx_pybuffernd_rindexer.diminfo[0].shape)) __pyx_t_3 = 0;
        if (unlikely(__pyx_t_3 != -1)) {
          __Pyx_RaiseBufferIndexError(__pyx_t_3);
          {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7227; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_rindexer.rcbuffer->pybuffer.buf, __pyx_t_33, __pyx_pybuffernd_rindexer.diminfo[0].strides) = -1;

        /* "pandas/src/generated.pyx":7228
 *                 lindexer[count] = i
 *                 rindexer[count] = -1
 *                 result[count] = left[i]             # <<<<<<<<<<<<<<
 *                 count += 1
 *                 i += 1
 */
        __pyx_t_34 = __pyx_v_i;
        __pyx_t_3 = -1;
        if (__pyx_t_34 < 0) {
          __pyx_t_34 += __pyx_pybuffernd_left.diminfo[0].shape;
          if (unlikely(__pyx_t_34 < 0)) __pyx_t_3 = 0;
        } else if (unlikely(__pyx_t_34 >= __pyx_pybuffernd_left.diminfo[0].shape)) __pyx_t_3 = 0;
        if (unlikely(__pyx_t_3 != -1)) {
          __Pyx_RaiseBufferIndexError(__pyx_t_3);
          {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7228; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        __pyx_t_35 = __pyx_v_count;
        __pyx_t_3 = -1;
        if (__pyx_t_35 < 0) {
          __pyx_t_35 += __pyx_pybuffernd_result.diminfo[0].shape;
          if (unlikely(__pyx_t_35 < 0)) __pyx_t_3 = 0;
        } else if (unlikely(__pyx_t_35 >= __pyx_pybuffernd_result.diminfo[0].shape)) __pyx_t_3 = 0;
        if (unlikely(__pyx_t_3 != -1)) {
          __Pyx_RaiseBufferIndexError(__pyx_t_3);
          {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7228; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_35, __pyx_pybuffernd_result.diminfo[0].strides) = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_left.rcbuffer->pybuffer.buf, __pyx_t_34, __pyx_pybuffernd_left.diminfo[0].strides));

        /* "pandas/src/generated.pyx":7229
 *                 rindexer[count] = -1
 *                 result[count] = left[i]
 *                 count += 1             # <<<<<<<<<<<<<<
 *                 i += 1
 *             else:
 */
        __pyx_v_count = (__pyx_v_count + 1);

        /* "pandas/src/generated.pyx":7230
 *                 result[count] = left[i]
 *                 count += 1
 *                 i += 1             # <<<<<<<<<<<<<<
 *             else:
 *                 j += 1
 */
        __pyx_v_i = (__pyx_v_i + 1);
        goto __pyx_L18;
      }
      /*else*/ {

        /* "pandas/src/generated.pyx":7232
 *                 i += 1
 *             else:
 *                 j += 1             # <<<<<<<<<<<<<<
 * 
 *     return result, lindexer, rindexer
 */
        __pyx_v_j = (__pyx_v_j + 1);
      }
      __pyx_L18:;
    }
    __pyx_L14_break:;
    goto __pyx_L12;
  }
  __pyx_L12:;

  /* "pandas/src/generated.pyx":7234
 *                 j += 1
 * 
 *     return result, lindexer, rindexer             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_11 = PyTuple_New(3); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7234; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_11);
  __Pyx_INCREF(((PyObject *)__pyx_v_result));
  PyTuple_SET_ITEM(__pyx_t_11, 0, ((PyObject *)__pyx_v_result));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_result));
  __Pyx_INCREF(((PyObject *)__pyx_v_lindexer));
  PyTuple_SET_ITEM(__pyx_t_11, 1, ((PyObject *)__pyx_v_lindexer));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_lindexer));
  __Pyx_INCREF(((PyObject *)__pyx_v_rindexer));
  PyTuple_SET_ITEM(__pyx_t_11, 2, ((PyObject *)__pyx_v_rindexer));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_rindexer));
  __pyx_r = __pyx_t_11;
  __pyx_t_11 = 0;
  goto __pyx_L0;

  /* "pandas/src/generated.pyx":7135
 * 
 * 
 * def left_join_indexer_float64(ndarray[float64_t] left,             # <<<<<<<<<<<<<<
 *                               ndarray[float64_t] right):
 *     '''
 */

  /* function exit code */
  __pyx_L1_error:;
  __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);
  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
    __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_left.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_lindexer.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_right.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_rindexer.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas.algos.left_join_indexer_float64", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_left.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_lindexer.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_right.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_rindexer.rcbuffer->pybuffer);
  __pyx_L2:;
  __Pyx_XDECREF((PyObject *)__pyx_v_lindexer);
  __Pyx_XDECREF((PyObject *)__pyx_v_rindexer);
  __Pyx_XDECREF((PyObject *)__pyx_v_result);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/src/generated.pyx":7237
 * 
 * 
 * def left_join_indexer_float32(ndarray[float32_t] left,             # <<<<<<<<<<<<<<
 *                               ndarray[float32_t] right):
 *     '''
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pandas_5algos_483left_join_indexer_float32(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6pandas_5algos_482left_join_indexer_float32[] = "\n    Two-pass algorithm for monotonic indexes. Handles many-to-one merges\n    ";
static PyMethodDef __pyx_mdef_6pandas_5algos_483left_join_indexer_float32 = {__Pyx_NAMESTR("left_join_indexer_float32"), (PyCFunction)__pyx_pw_6pandas_5algos_483left_join_indexer_float32, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6pandas_5algos_482left_join_indexer_float32)};
static PyObject *__pyx_pw_6pandas_5algos_483left_join_indexer_float32(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyArrayObject *__pyx_v_left = 0;
  PyArrayObject *__pyx_v_right = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("left_join_indexer_float32 (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_left,&__pyx_n_s_right,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_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 (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_left)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_right)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("left_join_indexer_float32", 1, 2, 2, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7237; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "left_join_indexer_float32") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7237; __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("left_join_indexer_float32", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7237; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas.algos.left_join_indexer_float32", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_left), __pyx_ptype_5numpy_ndarray, 1, "left", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7237; __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[2]; __pyx_lineno = 7238; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_482left_join_indexer_float32(__pyx_self, __pyx_v_left, __pyx_v_right);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pandas_5algos_482left_join_indexer_float32(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_left, PyArrayObject *__pyx_v_right) {
  Py_ssize_t __pyx_v_i;
  Py_ssize_t __pyx_v_j;
  Py_ssize_t __pyx_v_nright;
  Py_ssize_t __pyx_v_nleft;
  Py_ssize_t __pyx_v_count;
  __pyx_t_5numpy_float32_t __pyx_v_lval;
  __pyx_t_5numpy_float32_t __pyx_v_rval;
  PyArrayObject *__pyx_v_lindexer = 0;
  PyArrayObject *__pyx_v_rindexer = 0;
  PyArrayObject *__pyx_v_result = 0;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_left;
  __Pyx_Buffer __pyx_pybuffer_left;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_lindexer;
  __Pyx_Buffer __pyx_pybuffer_lindexer;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_result;
  __Pyx_Buffer __pyx_pybuffer_result;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_right;
  __Pyx_Buffer __pyx_pybuffer_right;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_rindexer;
  __Pyx_Buffer __pyx_pybuffer_rindexer;
  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;
  int __pyx_t_6;
  int __pyx_t_7;
  Py_ssize_t __pyx_t_8;
  Py_ssize_t __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;
  PyObject *__pyx_t_16 = NULL;
  PyObject *__pyx_t_17 = NULL;
  PyObject *__pyx_t_18 = NULL;
  PyArrayObject *__pyx_t_19 = NULL;
  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;
  __Pyx_RefNannySetupContext("left_join_indexer_float32", 0);
  __pyx_pybuffer_lindexer.pybuffer.buf = NULL;
  __pyx_pybuffer_lindexer.refcount = 0;
  __pyx_pybuffernd_lindexer.data = NULL;
  __pyx_pybuffernd_lindexer.rcbuffer = &__pyx_pybuffer_lindexer;
  __pyx_pybuffer_rindexer.pybuffer.buf = NULL;
  __pyx_pybuffer_rindexer.refcount = 0;
  __pyx_pybuffernd_rindexer.data = NULL;
  __pyx_pybuffernd_rindexer.rcbuffer = &__pyx_pybuffer_rindexer;
  __pyx_pybuffer_result.pybuffer.buf = NULL;
  __pyx_pybuffer_result.refcount = 0;
  __pyx_pybuffernd_result.data = NULL;
  __pyx_pybuffernd_result.rcbuffer = &__pyx_pybuffer_result;
  __pyx_pybuffer_left.pybuffer.buf = NULL;
  __pyx_pybuffer_left.refcount = 0;
  __pyx_pybuffernd_left.data = NULL;
  __pyx_pybuffernd_left.rcbuffer = &__pyx_pybuffer_left;
  __pyx_pybuffer_right.pybuffer.buf = NULL;
  __pyx_pybuffer_right.refcount = 0;
  __pyx_pybuffernd_right.data = NULL;
  __pyx_pybuffernd_right.rcbuffer = &__pyx_pybuffer_right;
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_left.rcbuffer->pybuffer, (PyObject*)__pyx_v_left, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7237; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_left.diminfo[0].strides = __pyx_pybuffernd_left.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_left.diminfo[0].shape = __pyx_pybuffernd_left.rcbuffer->pybuffer.shape[0];
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_right.rcbuffer->pybuffer, (PyObject*)__pyx_v_right, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7237; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_right.diminfo[0].strides = __pyx_pybuffernd_right.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_right.diminfo[0].shape = __pyx_pybuffernd_right.rcbuffer->pybuffer.shape[0];

  /* "pandas/src/generated.pyx":7248
 *         ndarray[float32_t] result
 * 
 *     nleft = len(left)             # <<<<<<<<<<<<<<
 *     nright = len(right)
 * 
 */
  __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_left)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7248; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_nleft = __pyx_t_1;

  /* "pandas/src/generated.pyx":7249
 * 
 *     nleft = len(left)
 *     nright = len(right)             # <<<<<<<<<<<<<<
 * 
 *     i = 0
 */
  __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_right)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7249; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_nright = __pyx_t_1;

  /* "pandas/src/generated.pyx":7251
 *     nright = len(right)
 * 
 *     i = 0             # <<<<<<<<<<<<<<
 *     j = 0
 *     count = 0
 */
  __pyx_v_i = 0;

  /* "pandas/src/generated.pyx":7252
 * 
 *     i = 0
 *     j = 0             # <<<<<<<<<<<<<<
 *     count = 0
 *     if nleft > 0:
 */
  __pyx_v_j = 0;

  /* "pandas/src/generated.pyx":7253
 *     i = 0
 *     j = 0
 *     count = 0             # <<<<<<<<<<<<<<
 *     if nleft > 0:
 *         while i < nleft:
 */
  __pyx_v_count = 0;

  /* "pandas/src/generated.pyx":7254
 *     j = 0
 *     count = 0
 *     if nleft > 0:             # <<<<<<<<<<<<<<
 *         while i < nleft:
 *             if j == nright:
 */
  __pyx_t_2 = ((__pyx_v_nleft > 0) != 0);
  if (__pyx_t_2) {

    /* "pandas/src/generated.pyx":7255
 *     count = 0
 *     if nleft > 0:
 *         while i < nleft:             # <<<<<<<<<<<<<<
 *             if j == nright:
 *                 count += nleft - i
 */
    while (1) {
      __pyx_t_2 = ((__pyx_v_i < __pyx_v_nleft) != 0);
      if (!__pyx_t_2) break;

      /* "pandas/src/generated.pyx":7256
 *     if nleft > 0:
 *         while i < nleft:
 *             if j == nright:             # <<<<<<<<<<<<<<
 *                 count += nleft - i
 *                 break
 */
      __pyx_t_2 = ((__pyx_v_j == __pyx_v_nright) != 0);
      if (__pyx_t_2) {

        /* "pandas/src/generated.pyx":7257
 *         while i < nleft:
 *             if j == nright:
 *                 count += nleft - i             # <<<<<<<<<<<<<<
 *                 break
 * 
 */
        __pyx_v_count = (__pyx_v_count + (__pyx_v_nleft - __pyx_v_i));

        /* "pandas/src/generated.pyx":7258
 *             if j == nright:
 *                 count += nleft - i
 *                 break             # <<<<<<<<<<<<<<
 * 
 *             lval = left[i]
 */
        goto __pyx_L5_break;
      }

      /* "pandas/src/generated.pyx":7260
 *                 break
 * 
 *             lval = left[i]             # <<<<<<<<<<<<<<
 *             rval = right[j]
 * 
 */
      __pyx_t_1 = __pyx_v_i;
      __pyx_t_3 = -1;
      if (__pyx_t_1 < 0) {
        __pyx_t_1 += __pyx_pybuffernd_left.diminfo[0].shape;
        if (unlikely(__pyx_t_1 < 0)) __pyx_t_3 = 0;
      } else if (unlikely(__pyx_t_1 >= __pyx_pybuffernd_left.diminfo[0].shape)) __pyx_t_3 = 0;
      if (unlikely(__pyx_t_3 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_3);
        {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7260; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_v_lval = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_left.rcbuffer->pybuffer.buf, __pyx_t_1, __pyx_pybuffernd_left.diminfo[0].strides));

      /* "pandas/src/generated.pyx":7261
 * 
 *             lval = left[i]
 *             rval = right[j]             # <<<<<<<<<<<<<<
 * 
 *             if lval == rval:
 */
      __pyx_t_4 = __pyx_v_j;
      __pyx_t_3 = -1;
      if (__pyx_t_4 < 0) {
        __pyx_t_4 += __pyx_pybuffernd_right.diminfo[0].shape;
        if (unlikely(__pyx_t_4 < 0)) __pyx_t_3 = 0;
      } else if (unlikely(__pyx_t_4 >= __pyx_pybuffernd_right.diminfo[0].shape)) __pyx_t_3 = 0;
      if (unlikely(__pyx_t_3 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_3);
        {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7261; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_v_rval = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_right.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_right.diminfo[0].strides));

      /* "pandas/src/generated.pyx":7263
 *             rval = right[j]
 * 
 *             if lval == rval:             # <<<<<<<<<<<<<<
 *                 count += 1
 *                 if i < nleft - 1:
 */
      __pyx_t_2 = ((__pyx_v_lval == __pyx_v_rval) != 0);
      if (__pyx_t_2) {

        /* "pandas/src/generated.pyx":7264
 * 
 *             if lval == rval:
 *                 count += 1             # <<<<<<<<<<<<<<
 *                 if i < nleft - 1:
 *                     if j < nright - 1 and right[j + 1] == rval:
 */
        __pyx_v_count = (__pyx_v_count + 1);

        /* "pandas/src/generated.pyx":7265
 *             if lval == rval:
 *                 count += 1
 *                 if i < nleft - 1:             # <<<<<<<<<<<<<<
 *                     if j < nright - 1 and right[j + 1] == rval:
 *                         j += 1
 */
        __pyx_t_2 = ((__pyx_v_i < (__pyx_v_nleft - 1)) != 0);
        if (__pyx_t_2) {

          /* "pandas/src/generated.pyx":7266
 *                 count += 1
 *                 if i < nleft - 1:
 *                     if j < nright - 1 and right[j + 1] == rval:             # <<<<<<<<<<<<<<
 *                         j += 1
 *                     else:
 */
          __pyx_t_2 = ((__pyx_v_j < (__pyx_v_nright - 1)) != 0);
          if (__pyx_t_2) {
            __pyx_t_5 = (__pyx_v_j + 1);
            __pyx_t_3 = -1;
            if (__pyx_t_5 < 0) {
              __pyx_t_5 += __pyx_pybuffernd_right.diminfo[0].shape;
              if (unlikely(__pyx_t_5 < 0)) __pyx_t_3 = 0;
            } else if (unlikely(__pyx_t_5 >= __pyx_pybuffernd_right.diminfo[0].shape)) __pyx_t_3 = 0;
            if (unlikely(__pyx_t_3 != -1)) {
              __Pyx_RaiseBufferIndexError(__pyx_t_3);
              {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7266; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            }
            __pyx_t_6 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_right.rcbuffer->pybuffer.buf, __pyx_t_5, __pyx_pybuffernd_right.diminfo[0].strides)) == __pyx_v_rval) != 0);
            __pyx_t_7 = __pyx_t_6;
          } else {
            __pyx_t_7 = __pyx_t_2;
          }
          if (__pyx_t_7) {

            /* "pandas/src/generated.pyx":7267
 *                 if i < nleft - 1:
 *                     if j < nright - 1 and right[j + 1] == rval:
 *                         j += 1             # <<<<<<<<<<<<<<
 *                     else:
 *                         i += 1
 */
            __pyx_v_j = (__pyx_v_j + 1);
            goto __pyx_L9;
          }
          /*else*/ {

            /* "pandas/src/generated.pyx":7269
 *                         j += 1
 *                     else:
 *                         i += 1             # <<<<<<<<<<<<<<
 *                         if left[i] != rval:
 *                             j += 1
 */
            __pyx_v_i = (__pyx_v_i + 1);

            /* "pandas/src/generated.pyx":7270
 *                     else:
 *                         i += 1
 *                         if left[i] != rval:             # <<<<<<<<<<<<<<
 *                             j += 1
 *                 elif j < nright - 1:
 */
            __pyx_t_8 = __pyx_v_i;
            __pyx_t_3 = -1;
            if (__pyx_t_8 < 0) {
              __pyx_t_8 += __pyx_pybuffernd_left.diminfo[0].shape;
              if (unlikely(__pyx_t_8 < 0)) __pyx_t_3 = 0;
            } else if (unlikely(__pyx_t_8 >= __pyx_pybuffernd_left.diminfo[0].shape)) __pyx_t_3 = 0;
            if (unlikely(__pyx_t_3 != -1)) {
              __Pyx_RaiseBufferIndexError(__pyx_t_3);
              {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7270; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            }
            __pyx_t_7 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_left.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_left.diminfo[0].strides)) != __pyx_v_rval) != 0);
            if (__pyx_t_7) {

              /* "pandas/src/generated.pyx":7271
 *                         i += 1
 *                         if left[i] != rval:
 *                             j += 1             # <<<<<<<<<<<<<<
 *                 elif j < nright - 1:
 *                     j += 1
 */
              __pyx_v_j = (__pyx_v_j + 1);
              goto __pyx_L10;
            }
            __pyx_L10:;
          }
          __pyx_L9:;
          goto __pyx_L8;
        }

        /* "pandas/src/generated.pyx":7272
 *                         if left[i] != rval:
 *                             j += 1
 *                 elif j < nright - 1:             # <<<<<<<<<<<<<<
 *                     j += 1
 *                     if lval != right[j]:
 */
        __pyx_t_7 = ((__pyx_v_j < (__pyx_v_nright - 1)) != 0);
        if (__pyx_t_7) {

          /* "pandas/src/generated.pyx":7273
 *                             j += 1
 *                 elif j < nright - 1:
 *                     j += 1             # <<<<<<<<<<<<<<
 *                     if lval != right[j]:
 *                         i += 1
 */
          __pyx_v_j = (__pyx_v_j + 1);

          /* "pandas/src/generated.pyx":7274
 *                 elif j < nright - 1:
 *                     j += 1
 *                     if lval != right[j]:             # <<<<<<<<<<<<<<
 *                         i += 1
 *                 else:
 */
          __pyx_t_9 = __pyx_v_j;
          __pyx_t_3 = -1;
          if (__pyx_t_9 < 0) {
            __pyx_t_9 += __pyx_pybuffernd_right.diminfo[0].shape;
            if (unlikely(__pyx_t_9 < 0)) __pyx_t_3 = 0;
          } else if (unlikely(__pyx_t_9 >= __pyx_pybuffernd_right.diminfo[0].shape)) __pyx_t_3 = 0;
          if (unlikely(__pyx_t_3 != -1)) {
            __Pyx_RaiseBufferIndexError(__pyx_t_3);
            {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7274; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          }
          __pyx_t_7 = ((__pyx_v_lval != (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_right.rcbuffer->pybuffer.buf, __pyx_t_9, __pyx_pybuffernd_right.diminfo[0].strides))) != 0);
          if (__pyx_t_7) {

            /* "pandas/src/generated.pyx":7275
 *                     j += 1
 *                     if lval != right[j]:
 *                         i += 1             # <<<<<<<<<<<<<<
 *                 else:
 *                     # end of the road
 */
            __pyx_v_i = (__pyx_v_i + 1);
            goto __pyx_L11;
          }
          __pyx_L11:;
          goto __pyx_L8;
        }
        /*else*/ {

          /* "pandas/src/generated.pyx":7278
 *                 else:
 *                     # end of the road
 *                     break             # <<<<<<<<<<<<<<
 *             elif lval < rval:
 *                 count += 1
 */
          goto __pyx_L5_break;
        }
        __pyx_L8:;
        goto __pyx_L7;
      }

      /* "pandas/src/generated.pyx":7279
 *                     # end of the road
 *                     break
 *             elif lval < rval:             # <<<<<<<<<<<<<<
 *                 count += 1
 *                 i += 1
 */
      __pyx_t_7 = ((__pyx_v_lval < __pyx_v_rval) != 0);
      if (__pyx_t_7) {

        /* "pandas/src/generated.pyx":7280
 *                     break
 *             elif lval < rval:
 *                 count += 1             # <<<<<<<<<<<<<<
 *                 i += 1
 *             else:
 */
        __pyx_v_count = (__pyx_v_count + 1);

        /* "pandas/src/generated.pyx":7281
 *             elif lval < rval:
 *                 count += 1
 *                 i += 1             # <<<<<<<<<<<<<<
 *             else:
 *                 j += 1
 */
        __pyx_v_i = (__pyx_v_i + 1);
        goto __pyx_L7;
      }
      /*else*/ {

        /* "pandas/src/generated.pyx":7283
 *                 i += 1
 *             else:
 *                 j += 1             # <<<<<<<<<<<<<<
 * 
 *     # do it again now that result size is known
 */
        __pyx_v_j = (__pyx_v_j + 1);
      }
      __pyx_L7:;
    }
    __pyx_L5_break:;
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "pandas/src/generated.pyx":7287
 *     # do it again now that result size is known
 * 
 *     lindexer = np.empty(count, dtype=np.int64)             # <<<<<<<<<<<<<<
 *     rindexer = np.empty(count, dtype=np.int64)
 *     result = np.empty(count, dtype=np.float32)
 */
  __pyx_t_10 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7287; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_10);
  __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_empty); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7287; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_11);
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  __pyx_t_10 = PyInt_FromSsize_t(__pyx_v_count); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7287; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_10);
  __pyx_t_12 = PyTuple_New(1); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7287; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_12);
  PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_10);
  __Pyx_GIVEREF(__pyx_t_10);
  __pyx_t_10 = 0;
  __pyx_t_10 = PyDict_New(); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7287; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_10);
  __pyx_t_13 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7287; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_13);
  __pyx_t_14 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_n_s_int64); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7287; __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_10, __pyx_n_s_dtype, __pyx_t_14) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7287; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  __pyx_t_14 = __Pyx_PyObject_Call(__pyx_t_11, __pyx_t_12, __pyx_t_10); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7287; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_14);
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  if (!(likely(((__pyx_t_14) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_14, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7287; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_15 = ((PyArrayObject *)__pyx_t_14);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_lindexer.rcbuffer->pybuffer);
    __pyx_t_3 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_lindexer.rcbuffer->pybuffer, (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_3 < 0)) {
      PyErr_Fetch(&__pyx_t_16, &__pyx_t_17, &__pyx_t_18);
      if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_lindexer.rcbuffer->pybuffer, (PyObject*)__pyx_v_lindexer, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {
        Py_XDECREF(__pyx_t_16); Py_XDECREF(__pyx_t_17); Py_XDECREF(__pyx_t_18);
        __Pyx_RaiseBufferFallbackError();
      } else {
        PyErr_Restore(__pyx_t_16, __pyx_t_17, __pyx_t_18);
      }
    }
    __pyx_pybuffernd_lindexer.diminfo[0].strides = __pyx_pybuffernd_lindexer.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_lindexer.diminfo[0].shape = __pyx_pybuffernd_lindexer.rcbuffer->pybuffer.shape[0];
    if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7287; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_15 = 0;
  __pyx_v_lindexer = ((PyArrayObject *)__pyx_t_14);
  __pyx_t_14 = 0;

  /* "pandas/src/generated.pyx":7288
 * 
 *     lindexer = np.empty(count, dtype=np.int64)
 *     rindexer = np.empty(count, dtype=np.int64)             # <<<<<<<<<<<<<<
 *     result = np.empty(count, dtype=np.float32)
 * 
 */
  __pyx_t_14 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7288; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_14);
  __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_14, __pyx_n_s_empty); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7288; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_10);
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  __pyx_t_14 = PyInt_FromSsize_t(__pyx_v_count); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7288; __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[2]; __pyx_lineno = 7288; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__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 = PyDict_New(); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7288; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_14);
  __pyx_t_11 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7288; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_11);
  __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_int64); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7288; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_13);
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  if (PyDict_SetItem(__pyx_t_14, __pyx_n_s_dtype, __pyx_t_13) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7288; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  __pyx_t_13 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_t_12, __pyx_t_14); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7288; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_13);
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
  __Pyx_DECREF(__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[2]; __pyx_lineno = 7288; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_15 = ((PyArrayObject *)__pyx_t_13);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_rindexer.rcbuffer->pybuffer);
    __pyx_t_3 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_rindexer.rcbuffer->pybuffer, (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_3 < 0)) {
      PyErr_Fetch(&__pyx_t_18, &__pyx_t_17, &__pyx_t_16);
      if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_rindexer.rcbuffer->pybuffer, (PyObject*)__pyx_v_rindexer, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {
        Py_XDECREF(__pyx_t_18); Py_XDECREF(__pyx_t_17); Py_XDECREF(__pyx_t_16);
        __Pyx_RaiseBufferFallbackError();
      } else {
        PyErr_Restore(__pyx_t_18, __pyx_t_17, __pyx_t_16);
      }
    }
    __pyx_pybuffernd_rindexer.diminfo[0].strides = __pyx_pybuffernd_rindexer.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_rindexer.diminfo[0].shape = __pyx_pybuffernd_rindexer.rcbuffer->pybuffer.shape[0];
    if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7288; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_15 = 0;
  __pyx_v_rindexer = ((PyArrayObject *)__pyx_t_13);
  __pyx_t_13 = 0;

  /* "pandas/src/generated.pyx":7289
 *     lindexer = np.empty(count, dtype=np.int64)
 *     rindexer = np.empty(count, dtype=np.int64)
 *     result = np.empty(count, dtype=np.float32)             # <<<<<<<<<<<<<<
 * 
 *     i = 0
 */
  __pyx_t_13 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7289; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_13);
  __pyx_t_14 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_n_s_empty); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7289; __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_count); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7289; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_13);
  __pyx_t_12 = PyTuple_New(1); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7289; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_12);
  PyTuple_SET_ITEM(__pyx_t_12, 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 = 7289; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_13);
  __pyx_t_10 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7289; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_10);
  __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_float32); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7289; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_11);
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  if (PyDict_SetItem(__pyx_t_13, __pyx_n_s_dtype, __pyx_t_11) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7289; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  __pyx_t_11 = __Pyx_PyObject_Call(__pyx_t_14, __pyx_t_12, __pyx_t_13); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7289; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_11);
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 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 = 7289; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_19 = ((PyArrayObject *)__pyx_t_11);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer);
    __pyx_t_3 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_result.rcbuffer->pybuffer, (PyObject*)__pyx_t_19, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack);
    if (unlikely(__pyx_t_3 < 0)) {
      PyErr_Fetch(&__pyx_t_16, &__pyx_t_17, &__pyx_t_18);
      if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_result.rcbuffer->pybuffer, (PyObject*)__pyx_v_result, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {
        Py_XDECREF(__pyx_t_16); Py_XDECREF(__pyx_t_17); Py_XDECREF(__pyx_t_18);
        __Pyx_RaiseBufferFallbackError();
      } else {
        PyErr_Restore(__pyx_t_16, __pyx_t_17, __pyx_t_18);
      }
    }
    __pyx_pybuffernd_result.diminfo[0].strides = __pyx_pybuffernd_result.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_result.diminfo[0].shape = __pyx_pybuffernd_result.rcbuffer->pybuffer.shape[0];
    if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7289; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_19 = 0;
  __pyx_v_result = ((PyArrayObject *)__pyx_t_11);
  __pyx_t_11 = 0;

  /* "pandas/src/generated.pyx":7291
 *     result = np.empty(count, dtype=np.float32)
 * 
 *     i = 0             # <<<<<<<<<<<<<<
 *     j = 0
 *     count = 0
 */
  __pyx_v_i = 0;

  /* "pandas/src/generated.pyx":7292
 * 
 *     i = 0
 *     j = 0             # <<<<<<<<<<<<<<
 *     count = 0
 *     if nleft > 0:
 */
  __pyx_v_j = 0;

  /* "pandas/src/generated.pyx":7293
 *     i = 0
 *     j = 0
 *     count = 0             # <<<<<<<<<<<<<<
 *     if nleft > 0:
 *         while i < nleft:
 */
  __pyx_v_count = 0;

  /* "pandas/src/generated.pyx":7294
 *     j = 0
 *     count = 0
 *     if nleft > 0:             # <<<<<<<<<<<<<<
 *         while i < nleft:
 *             if j == nright:
 */
  __pyx_t_7 = ((__pyx_v_nleft > 0) != 0);
  if (__pyx_t_7) {

    /* "pandas/src/generated.pyx":7295
 *     count = 0
 *     if nleft > 0:
 *         while i < nleft:             # <<<<<<<<<<<<<<
 *             if j == nright:
 *                 while i < nleft:
 */
    while (1) {
      __pyx_t_7 = ((__pyx_v_i < __pyx_v_nleft) != 0);
      if (!__pyx_t_7) break;

      /* "pandas/src/generated.pyx":7296
 *     if nleft > 0:
 *         while i < nleft:
 *             if j == nright:             # <<<<<<<<<<<<<<
 *                 while i < nleft:
 *                     lindexer[count] = i
 */
      __pyx_t_7 = ((__pyx_v_j == __pyx_v_nright) != 0);
      if (__pyx_t_7) {

        /* "pandas/src/generated.pyx":7297
 *         while i < nleft:
 *             if j == nright:
 *                 while i < nleft:             # <<<<<<<<<<<<<<
 *                     lindexer[count] = i
 *                     rindexer[count] = -1
 */
        while (1) {
          __pyx_t_7 = ((__pyx_v_i < __pyx_v_nleft) != 0);
          if (!__pyx_t_7) break;

          /* "pandas/src/generated.pyx":7298
 *             if j == nright:
 *                 while i < nleft:
 *                     lindexer[count] = i             # <<<<<<<<<<<<<<
 *                     rindexer[count] = -1
 *                     result[count] = left[i]
 */
          __pyx_t_20 = __pyx_v_count;
          __pyx_t_3 = -1;
          if (__pyx_t_20 < 0) {
            __pyx_t_20 += __pyx_pybuffernd_lindexer.diminfo[0].shape;
            if (unlikely(__pyx_t_20 < 0)) __pyx_t_3 = 0;
          } else if (unlikely(__pyx_t_20 >= __pyx_pybuffernd_lindexer.diminfo[0].shape)) __pyx_t_3 = 0;
          if (unlikely(__pyx_t_3 != -1)) {
            __Pyx_RaiseBufferIndexError(__pyx_t_3);
            {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7298; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          }
          *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_lindexer.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_lindexer.diminfo[0].strides) = __pyx_v_i;

          /* "pandas/src/generated.pyx":7299
 *                 while i < nleft:
 *                     lindexer[count] = i
 *                     rindexer[count] = -1             # <<<<<<<<<<<<<<
 *                     result[count] = left[i]
 *                     i += 1
 */
          __pyx_t_21 = __pyx_v_count;
          __pyx_t_3 = -1;
          if (__pyx_t_21 < 0) {
            __pyx_t_21 += __pyx_pybuffernd_rindexer.diminfo[0].shape;
            if (unlikely(__pyx_t_21 < 0)) __pyx_t_3 = 0;
          } else if (unlikely(__pyx_t_21 >= __pyx_pybuffernd_rindexer.diminfo[0].shape)) __pyx_t_3 = 0;
          if (unlikely(__pyx_t_3 != -1)) {
            __Pyx_RaiseBufferIndexError(__pyx_t_3);
            {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7299; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          }
          *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_rindexer.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_rindexer.diminfo[0].strides) = -1;

          /* "pandas/src/generated.pyx":7300
 *                     lindexer[count] = i
 *                     rindexer[count] = -1
 *                     result[count] = left[i]             # <<<<<<<<<<<<<<
 *                     i += 1
 *                     count += 1
 */
          __pyx_t_22 = __pyx_v_i;
          __pyx_t_3 = -1;
          if (__pyx_t_22 < 0) {
            __pyx_t_22 += __pyx_pybuffernd_left.diminfo[0].shape;
            if (unlikely(__pyx_t_22 < 0)) __pyx_t_3 = 0;
          } else if (unlikely(__pyx_t_22 >= __pyx_pybuffernd_left.diminfo[0].shape)) __pyx_t_3 = 0;
          if (unlikely(__pyx_t_3 != -1)) {
            __Pyx_RaiseBufferIndexError(__pyx_t_3);
            {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7300; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          }
          __pyx_t_23 = __pyx_v_count;
          __pyx_t_3 = -1;
          if (__pyx_t_23 < 0) {
            __pyx_t_23 += __pyx_pybuffernd_result.diminfo[0].shape;
            if (unlikely(__pyx_t_23 < 0)) __pyx_t_3 = 0;
          } else if (unlikely(__pyx_t_23 >= __pyx_pybuffernd_result.diminfo[0].shape)) __pyx_t_3 = 0;
          if (unlikely(__pyx_t_3 != -1)) {
            __Pyx_RaiseBufferIndexError(__pyx_t_3);
            {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7300; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          }
          *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_23, __pyx_pybuffernd_result.diminfo[0].strides) = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_left.rcbuffer->pybuffer.buf, __pyx_t_22, __pyx_pybuffernd_left.diminfo[0].strides));

          /* "pandas/src/generated.pyx":7301
 *                     rindexer[count] = -1
 *                     result[count] = left[i]
 *                     i += 1             # <<<<<<<<<<<<<<
 *                     count += 1
 *                 break
 */
          __pyx_v_i = (__pyx_v_i + 1);

          /* "pandas/src/generated.pyx":7302
 *                     result[count] = left[i]
 *                     i += 1
 *                     count += 1             # <<<<<<<<<<<<<<
 *                 break
 * 
 */
          __pyx_v_count = (__pyx_v_count + 1);
        }

        /* "pandas/src/generated.pyx":7303
 *                     i += 1
 *                     count += 1
 *                 break             # <<<<<<<<<<<<<<
 * 
 *             lval = left[i]
 */
        goto __pyx_L14_break;
      }

      /* "pandas/src/generated.pyx":7305
 *                 break
 * 
 *             lval = left[i]             # <<<<<<<<<<<<<<
 *             rval = right[j]
 * 
 */
      __pyx_t_24 = __pyx_v_i;
      __pyx_t_3 = -1;
      if (__pyx_t_24 < 0) {
        __pyx_t_24 += __pyx_pybuffernd_left.diminfo[0].shape;
        if (unlikely(__pyx_t_24 < 0)) __pyx_t_3 = 0;
      } else if (unlikely(__pyx_t_24 >= __pyx_pybuffernd_left.diminfo[0].shape)) __pyx_t_3 = 0;
      if (unlikely(__pyx_t_3 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_3);
        {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7305; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_v_lval = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_left.rcbuffer->pybuffer.buf, __pyx_t_24, __pyx_pybuffernd_left.diminfo[0].strides));

      /* "pandas/src/generated.pyx":7306
 * 
 *             lval = left[i]
 *             rval = right[j]             # <<<<<<<<<<<<<<
 * 
 *             if lval == rval:
 */
      __pyx_t_25 = __pyx_v_j;
      __pyx_t_3 = -1;
      if (__pyx_t_25 < 0) {
        __pyx_t_25 += __pyx_pybuffernd_right.diminfo[0].shape;
        if (unlikely(__pyx_t_25 < 0)) __pyx_t_3 = 0;
      } else if (unlikely(__pyx_t_25 >= __pyx_pybuffernd_right.diminfo[0].shape)) __pyx_t_3 = 0;
      if (unlikely(__pyx_t_3 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_3);
        {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7306; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_v_rval = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_right.rcbuffer->pybuffer.buf, __pyx_t_25, __pyx_pybuffernd_right.diminfo[0].strides));

      /* "pandas/src/generated.pyx":7308
 *             rval = right[j]
 * 
 *             if lval == rval:             # <<<<<<<<<<<<<<
 *                 lindexer[count] = i
 *                 rindexer[count] = j
 */
      __pyx_t_7 = ((__pyx_v_lval == __pyx_v_rval) != 0);
      if (__pyx_t_7) {

        /* "pandas/src/generated.pyx":7309
 * 
 *             if lval == rval:
 *                 lindexer[count] = i             # <<<<<<<<<<<<<<
 *                 rindexer[count] = j
 *                 result[count] = lval
 */
        __pyx_t_26 = __pyx_v_count;
        __pyx_t_3 = -1;
        if (__pyx_t_26 < 0) {
          __pyx_t_26 += __pyx_pybuffernd_lindexer.diminfo[0].shape;
          if (unlikely(__pyx_t_26 < 0)) __pyx_t_3 = 0;
        } else if (unlikely(__pyx_t_26 >= __pyx_pybuffernd_lindexer.diminfo[0].shape)) __pyx_t_3 = 0;
        if (unlikely(__pyx_t_3 != -1)) {
          __Pyx_RaiseBufferIndexError(__pyx_t_3);
          {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7309; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_lindexer.rcbuffer->pybuffer.buf, __pyx_t_26, __pyx_pybuffernd_lindexer.diminfo[0].strides) = __pyx_v_i;

        /* "pandas/src/generated.pyx":7310
 *             if lval == rval:
 *                 lindexer[count] = i
 *                 rindexer[count] = j             # <<<<<<<<<<<<<<
 *                 result[count] = lval
 *                 count += 1
 */
        __pyx_t_27 = __pyx_v_count;
        __pyx_t_3 = -1;
        if (__pyx_t_27 < 0) {
          __pyx_t_27 += __pyx_pybuffernd_rindexer.diminfo[0].shape;
          if (unlikely(__pyx_t_27 < 0)) __pyx_t_3 = 0;
        } else if (unlikely(__pyx_t_27 >= __pyx_pybuffernd_rindexer.diminfo[0].shape)) __pyx_t_3 = 0;
        if (unlikely(__pyx_t_3 != -1)) {
          __Pyx_RaiseBufferIndexError(__pyx_t_3);
          {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7310; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_rindexer.rcbuffer->pybuffer.buf, __pyx_t_27, __pyx_pybuffernd_rindexer.diminfo[0].strides) = __pyx_v_j;

        /* "pandas/src/generated.pyx":7311
 *                 lindexer[count] = i
 *                 rindexer[count] = j
 *                 result[count] = lval             # <<<<<<<<<<<<<<
 *                 count += 1
 *                 if i < nleft - 1:
 */
        __pyx_t_28 = __pyx_v_count;
        __pyx_t_3 = -1;
        if (__pyx_t_28 < 0) {
          __pyx_t_28 += __pyx_pybuffernd_result.diminfo[0].shape;
          if (unlikely(__pyx_t_28 < 0)) __pyx_t_3 = 0;
        } else if (unlikely(__pyx_t_28 >= __pyx_pybuffernd_result.diminfo[0].shape)) __pyx_t_3 = 0;
        if (unlikely(__pyx_t_3 != -1)) {
          __Pyx_RaiseBufferIndexError(__pyx_t_3);
          {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7311; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_28, __pyx_pybuffernd_result.diminfo[0].strides) = __pyx_v_lval;

        /* "pandas/src/generated.pyx":7312
 *                 rindexer[count] = j
 *                 result[count] = lval
 *                 count += 1             # <<<<<<<<<<<<<<
 *                 if i < nleft - 1:
 *                     if j < nright - 1 and right[j + 1] == rval:
 */
        __pyx_v_count = (__pyx_v_count + 1);

        /* "pandas/src/generated.pyx":7313
 *                 result[count] = lval
 *                 count += 1
 *                 if i < nleft - 1:             # <<<<<<<<<<<<<<
 *                     if j < nright - 1 and right[j + 1] == rval:
 *                         j += 1
 */
        __pyx_t_7 = ((__pyx_v_i < (__pyx_v_nleft - 1)) != 0);
        if (__pyx_t_7) {

          /* "pandas/src/generated.pyx":7314
 *                 count += 1
 *                 if i < nleft - 1:
 *                     if j < nright - 1 and right[j + 1] == rval:             # <<<<<<<<<<<<<<
 *                         j += 1
 *                     else:
 */
          __pyx_t_7 = ((__pyx_v_j < (__pyx_v_nright - 1)) != 0);
          if (__pyx_t_7) {
            __pyx_t_29 = (__pyx_v_j + 1);
            __pyx_t_3 = -1;
            if (__pyx_t_29 < 0) {
              __pyx_t_29 += __pyx_pybuffernd_right.diminfo[0].shape;
              if (unlikely(__pyx_t_29 < 0)) __pyx_t_3 = 0;
            } else if (unlikely(__pyx_t_29 >= __pyx_pybuffernd_right.diminfo[0].shape)) __pyx_t_3 = 0;
            if (unlikely(__pyx_t_3 != -1)) {
              __Pyx_RaiseBufferIndexError(__pyx_t_3);
              {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7314; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            }
            __pyx_t_2 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_right.rcbuffer->pybuffer.buf, __pyx_t_29, __pyx_pybuffernd_right.diminfo[0].strides)) == __pyx_v_rval) != 0);
            __pyx_t_6 = __pyx_t_2;
          } else {
            __pyx_t_6 = __pyx_t_7;
          }
          if (__pyx_t_6) {

            /* "pandas/src/generated.pyx":7315
 *                 if i < nleft - 1:
 *                     if j < nright - 1 and right[j + 1] == rval:
 *                         j += 1             # <<<<<<<<<<<<<<
 *                     else:
 *                         i += 1
 */
            __pyx_v_j = (__pyx_v_j + 1);
            goto __pyx_L20;
          }
          /*else*/ {

            /* "pandas/src/generated.pyx":7317
 *                         j += 1
 *                     else:
 *                         i += 1             # <<<<<<<<<<<<<<
 *                         if left[i] != rval:
 *                             j += 1
 */
            __pyx_v_i = (__pyx_v_i + 1);

            /* "pandas/src/generated.pyx":7318
 *                     else:
 *                         i += 1
 *                         if left[i] != rval:             # <<<<<<<<<<<<<<
 *                             j += 1
 *                 elif j < nright - 1:
 */
            __pyx_t_30 = __pyx_v_i;
            __pyx_t_3 = -1;
            if (__pyx_t_30 < 0) {
              __pyx_t_30 += __pyx_pybuffernd_left.diminfo[0].shape;
              if (unlikely(__pyx_t_30 < 0)) __pyx_t_3 = 0;
            } else if (unlikely(__pyx_t_30 >= __pyx_pybuffernd_left.diminfo[0].shape)) __pyx_t_3 = 0;
            if (unlikely(__pyx_t_3 != -1)) {
              __Pyx_RaiseBufferIndexError(__pyx_t_3);
              {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7318; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            }
            __pyx_t_6 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_left.rcbuffer->pybuffer.buf, __pyx_t_30, __pyx_pybuffernd_left.diminfo[0].strides)) != __pyx_v_rval) != 0);
            if (__pyx_t_6) {

              /* "pandas/src/generated.pyx":7319
 *                         i += 1
 *                         if left[i] != rval:
 *                             j += 1             # <<<<<<<<<<<<<<
 *                 elif j < nright - 1:
 *                     j += 1
 */
              __pyx_v_j = (__pyx_v_j + 1);
              goto __pyx_L21;
            }
            __pyx_L21:;
          }
          __pyx_L20:;
          goto __pyx_L19;
        }

        /* "pandas/src/generated.pyx":7320
 *                         if left[i] != rval:
 *                             j += 1
 *                 elif j < nright - 1:             # <<<<<<<<<<<<<<
 *                     j += 1
 *                     if lval != right[j]:
 */
        __pyx_t_6 = ((__pyx_v_j < (__pyx_v_nright - 1)) != 0);
        if (__pyx_t_6) {

          /* "pandas/src/generated.pyx":7321
 *                             j += 1
 *                 elif j < nright - 1:
 *                     j += 1             # <<<<<<<<<<<<<<
 *                     if lval != right[j]:
 *                         i += 1
 */
          __pyx_v_j = (__pyx_v_j + 1);

          /* "pandas/src/generated.pyx":7322
 *                 elif j < nright - 1:
 *                     j += 1
 *                     if lval != right[j]:             # <<<<<<<<<<<<<<
 *                         i += 1
 *                 else:
 */
          __pyx_t_31 = __pyx_v_j;
          __pyx_t_3 = -1;
          if (__pyx_t_31 < 0) {
            __pyx_t_31 += __pyx_pybuffernd_right.diminfo[0].shape;
            if (unlikely(__pyx_t_31 < 0)) __pyx_t_3 = 0;
          } else if (unlikely(__pyx_t_31 >= __pyx_pybuffernd_right.diminfo[0].shape)) __pyx_t_3 = 0;
          if (unlikely(__pyx_t_3 != -1)) {
            __Pyx_RaiseBufferIndexError(__pyx_t_3);
            {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7322; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          }
          __pyx_t_6 = ((__pyx_v_lval != (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_right.rcbuffer->pybuffer.buf, __pyx_t_31, __pyx_pybuffernd_right.diminfo[0].strides))) != 0);
          if (__pyx_t_6) {

            /* "pandas/src/generated.pyx":7323
 *                     j += 1
 *                     if lval != right[j]:
 *                         i += 1             # <<<<<<<<<<<<<<
 *                 else:
 *                     # end of the road
 */
            __pyx_v_i = (__pyx_v_i + 1);
            goto __pyx_L22;
          }
          __pyx_L22:;
          goto __pyx_L19;
        }
        /*else*/ {

          /* "pandas/src/generated.pyx":7326
 *                 else:
 *                     # end of the road
 *                     break             # <<<<<<<<<<<<<<
 *             elif lval < rval:
 *                 lindexer[count] = i
 */
          goto __pyx_L14_break;
        }
        __pyx_L19:;
        goto __pyx_L18;
      }

      /* "pandas/src/generated.pyx":7327
 *                     # end of the road
 *                     break
 *             elif lval < rval:             # <<<<<<<<<<<<<<
 *                 lindexer[count] = i
 *                 rindexer[count] = -1
 */
      __pyx_t_6 = ((__pyx_v_lval < __pyx_v_rval) != 0);
      if (__pyx_t_6) {

        /* "pandas/src/generated.pyx":7328
 *                     break
 *             elif lval < rval:
 *                 lindexer[count] = i             # <<<<<<<<<<<<<<
 *                 rindexer[count] = -1
 *                 result[count] = left[i]
 */
        __pyx_t_32 = __pyx_v_count;
        __pyx_t_3 = -1;
        if (__pyx_t_32 < 0) {
          __pyx_t_32 += __pyx_pybuffernd_lindexer.diminfo[0].shape;
          if (unlikely(__pyx_t_32 < 0)) __pyx_t_3 = 0;
        } else if (unlikely(__pyx_t_32 >= __pyx_pybuffernd_lindexer.diminfo[0].shape)) __pyx_t_3 = 0;
        if (unlikely(__pyx_t_3 != -1)) {
          __Pyx_RaiseBufferIndexError(__pyx_t_3);
          {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7328; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_lindexer.rcbuffer->pybuffer.buf, __pyx_t_32, __pyx_pybuffernd_lindexer.diminfo[0].strides) = __pyx_v_i;

        /* "pandas/src/generated.pyx":7329
 *             elif lval < rval:
 *                 lindexer[count] = i
 *                 rindexer[count] = -1             # <<<<<<<<<<<<<<
 *                 result[count] = left[i]
 *                 count += 1
 */
        __pyx_t_33 = __pyx_v_count;
        __pyx_t_3 = -1;
        if (__pyx_t_33 < 0) {
          __pyx_t_33 += __pyx_pybuffernd_rindexer.diminfo[0].shape;
          if (unlikely(__pyx_t_33 < 0)) __pyx_t_3 = 0;
        } else if (unlikely(__pyx_t_33 >= __pyx_pybuffernd_rindexer.diminfo[0].shape)) __pyx_t_3 = 0;
        if (unlikely(__pyx_t_3 != -1)) {
          __Pyx_RaiseBufferIndexError(__pyx_t_3);
          {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7329; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_rindexer.rcbuffer->pybuffer.buf, __pyx_t_33, __pyx_pybuffernd_rindexer.diminfo[0].strides) = -1;

        /* "pandas/src/generated.pyx":7330
 *                 lindexer[count] = i
 *                 rindexer[count] = -1
 *                 result[count] = left[i]             # <<<<<<<<<<<<<<
 *                 count += 1
 *                 i += 1
 */
        __pyx_t_34 = __pyx_v_i;
        __pyx_t_3 = -1;
        if (__pyx_t_34 < 0) {
          __pyx_t_34 += __pyx_pybuffernd_left.diminfo[0].shape;
          if (unlikely(__pyx_t_34 < 0)) __pyx_t_3 = 0;
        } else if (unlikely(__pyx_t_34 >= __pyx_pybuffernd_left.diminfo[0].shape)) __pyx_t_3 = 0;
        if (unlikely(__pyx_t_3 != -1)) {
          __Pyx_RaiseBufferIndexError(__pyx_t_3);
          {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7330; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        __pyx_t_35 = __pyx_v_count;
        __pyx_t_3 = -1;
        if (__pyx_t_35 < 0) {
          __pyx_t_35 += __pyx_pybuffernd_result.diminfo[0].shape;
          if (unlikely(__pyx_t_35 < 0)) __pyx_t_3 = 0;
        } else if (unlikely(__pyx_t_35 >= __pyx_pybuffernd_result.diminfo[0].shape)) __pyx_t_3 = 0;
        if (unlikely(__pyx_t_3 != -1)) {
          __Pyx_RaiseBufferIndexError(__pyx_t_3);
          {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7330; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_35, __pyx_pybuffernd_result.diminfo[0].strides) = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_left.rcbuffer->pybuffer.buf, __pyx_t_34, __pyx_pybuffernd_left.diminfo[0].strides));

        /* "pandas/src/generated.pyx":7331
 *                 rindexer[count] = -1
 *                 result[count] = left[i]
 *                 count += 1             # <<<<<<<<<<<<<<
 *                 i += 1
 *             else:
 */
        __pyx_v_count = (__pyx_v_count + 1);

        /* "pandas/src/generated.pyx":7332
 *                 result[count] = left[i]
 *                 count += 1
 *                 i += 1             # <<<<<<<<<<<<<<
 *             else:
 *                 j += 1
 */
        __pyx_v_i = (__pyx_v_i + 1);
        goto __pyx_L18;
      }
      /*else*/ {

        /* "pandas/src/generated.pyx":7334
 *                 i += 1
 *             else:
 *                 j += 1             # <<<<<<<<<<<<<<
 * 
 *     return result, lindexer, rindexer
 */
        __pyx_v_j = (__pyx_v_j + 1);
      }
      __pyx_L18:;
    }
    __pyx_L14_break:;
    goto __pyx_L12;
  }
  __pyx_L12:;

  /* "pandas/src/generated.pyx":7336
 *                 j += 1
 * 
 *     return result, lindexer, rindexer             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_11 = PyTuple_New(3); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7336; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_11);
  __Pyx_INCREF(((PyObject *)__pyx_v_result));
  PyTuple_SET_ITEM(__pyx_t_11, 0, ((PyObject *)__pyx_v_result));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_result));
  __Pyx_INCREF(((PyObject *)__pyx_v_lindexer));
  PyTuple_SET_ITEM(__pyx_t_11, 1, ((PyObject *)__pyx_v_lindexer));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_lindexer));
  __Pyx_INCREF(((PyObject *)__pyx_v_rindexer));
  PyTuple_SET_ITEM(__pyx_t_11, 2, ((PyObject *)__pyx_v_rindexer));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_rindexer));
  __pyx_r = __pyx_t_11;
  __pyx_t_11 = 0;
  goto __pyx_L0;

  /* "pandas/src/generated.pyx":7237
 * 
 * 
 * def left_join_indexer_float32(ndarray[float32_t] left,             # <<<<<<<<<<<<<<
 *                               ndarray[float32_t] right):
 *     '''
 */

  /* function exit code */
  __pyx_L1_error:;
  __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);
  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
    __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_left.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_lindexer.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_right.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_rindexer.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas.algos.left_join_indexer_float32", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_left.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_lindexer.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_right.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_rindexer.rcbuffer->pybuffer);
  __pyx_L2:;
  __Pyx_XDECREF((PyObject *)__pyx_v_lindexer);
  __Pyx_XDECREF((PyObject *)__pyx_v_rindexer);
  __Pyx_XDECREF((PyObject *)__pyx_v_result);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/src/generated.pyx":7339
 * 
 * 
 * def left_join_indexer_object(ndarray[object] left,             # <<<<<<<<<<<<<<
 *                               ndarray[object] right):
 *     '''
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pandas_5algos_485left_join_indexer_object(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6pandas_5algos_484left_join_indexer_object[] = "\n    Two-pass algorithm for monotonic indexes. Handles many-to-one merges\n    ";
static PyMethodDef __pyx_mdef_6pandas_5algos_485left_join_indexer_object = {__Pyx_NAMESTR("left_join_indexer_object"), (PyCFunction)__pyx_pw_6pandas_5algos_485left_join_indexer_object, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6pandas_5algos_484left_join_indexer_object)};
static PyObject *__pyx_pw_6pandas_5algos_485left_join_indexer_object(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyArrayObject *__pyx_v_left = 0;
  PyArrayObject *__pyx_v_right = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("left_join_indexer_object (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_left,&__pyx_n_s_right,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_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 (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_left)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_right)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("left_join_indexer_object", 1, 2, 2, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7339; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "left_join_indexer_object") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7339; __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("left_join_indexer_object", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7339; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas.algos.left_join_indexer_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_left), __pyx_ptype_5numpy_ndarray, 1, "left", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7339; __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[2]; __pyx_lineno = 7340; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_484left_join_indexer_object(__pyx_self, __pyx_v_left, __pyx_v_right);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pandas_5algos_484left_join_indexer_object(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_left, PyArrayObject *__pyx_v_right) {
  Py_ssize_t __pyx_v_i;
  Py_ssize_t __pyx_v_j;
  Py_ssize_t __pyx_v_nright;
  Py_ssize_t __pyx_v_nleft;
  Py_ssize_t __pyx_v_count;
  PyObject *__pyx_v_lval = 0;
  PyObject *__pyx_v_rval = 0;
  PyArrayObject *__pyx_v_lindexer = 0;
  PyArrayObject *__pyx_v_rindexer = 0;
  PyArrayObject *__pyx_v_result = 0;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_left;
  __Pyx_Buffer __pyx_pybuffer_left;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_lindexer;
  __Pyx_Buffer __pyx_pybuffer_lindexer;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_result;
  __Pyx_Buffer __pyx_pybuffer_result;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_right;
  __Pyx_Buffer __pyx_pybuffer_right;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_rindexer;
  __Pyx_Buffer __pyx_pybuffer_rindexer;
  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;
  Py_ssize_t __pyx_t_5;
  Py_ssize_t __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  int __pyx_t_8;
  int __pyx_t_9;
  Py_ssize_t __pyx_t_10;
  Py_ssize_t __pyx_t_11;
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  PyObject *__pyx_t_14 = NULL;
  PyArrayObject *__pyx_t_15 = NULL;
  PyObject *__pyx_t_16 = NULL;
  PyObject *__pyx_t_17 = NULL;
  PyObject *__pyx_t_18 = NULL;
  PyArrayObject *__pyx_t_19 = NULL;
  Py_ssize_t __pyx_t_20;
  Py_ssize_t __pyx_t_21;
  Py_ssize_t __pyx_t_22;
  Py_ssize_t __pyx_t_23;
  PyObject **__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;
  __Pyx_RefNannySetupContext("left_join_indexer_object", 0);
  __pyx_pybuffer_lindexer.pybuffer.buf = NULL;
  __pyx_pybuffer_lindexer.refcount = 0;
  __pyx_pybuffernd_lindexer.data = NULL;
  __pyx_pybuffernd_lindexer.rcbuffer = &__pyx_pybuffer_lindexer;
  __pyx_pybuffer_rindexer.pybuffer.buf = NULL;
  __pyx_pybuffer_rindexer.refcount = 0;
  __pyx_pybuffernd_rindexer.data = NULL;
  __pyx_pybuffernd_rindexer.rcbuffer = &__pyx_pybuffer_rindexer;
  __pyx_pybuffer_result.pybuffer.buf = NULL;
  __pyx_pybuffer_result.refcount = 0;
  __pyx_pybuffernd_result.data = NULL;
  __pyx_pybuffernd_result.rcbuffer = &__pyx_pybuffer_result;
  __pyx_pybuffer_left.pybuffer.buf = NULL;
  __pyx_pybuffer_left.refcount = 0;
  __pyx_pybuffernd_left.data = NULL;
  __pyx_pybuffernd_left.rcbuffer = &__pyx_pybuffer_left;
  __pyx_pybuffer_right.pybuffer.buf = NULL;
  __pyx_pybuffer_right.refcount = 0;
  __pyx_pybuffernd_right.data = NULL;
  __pyx_pybuffernd_right.rcbuffer = &__pyx_pybuffer_right;
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_left.rcbuffer->pybuffer, (PyObject*)__pyx_v_left, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7339; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_left.diminfo[0].strides = __pyx_pybuffernd_left.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_left.diminfo[0].shape = __pyx_pybuffernd_left.rcbuffer->pybuffer.shape[0];
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_right.rcbuffer->pybuffer, (PyObject*)__pyx_v_right, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7339; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_right.diminfo[0].strides = __pyx_pybuffernd_right.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_right.diminfo[0].shape = __pyx_pybuffernd_right.rcbuffer->pybuffer.shape[0];

  /* "pandas/src/generated.pyx":7350
 *         ndarray[object] result
 * 
 *     nleft = len(left)             # <<<<<<<<<<<<<<
 *     nright = len(right)
 * 
 */
  __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_left)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7350; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_nleft = __pyx_t_1;

  /* "pandas/src/generated.pyx":7351
 * 
 *     nleft = len(left)
 *     nright = len(right)             # <<<<<<<<<<<<<<
 * 
 *     i = 0
 */
  __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_right)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7351; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_nright = __pyx_t_1;

  /* "pandas/src/generated.pyx":7353
 *     nright = len(right)
 * 
 *     i = 0             # <<<<<<<<<<<<<<
 *     j = 0
 *     count = 0
 */
  __pyx_v_i = 0;

  /* "pandas/src/generated.pyx":7354
 * 
 *     i = 0
 *     j = 0             # <<<<<<<<<<<<<<
 *     count = 0
 *     if nleft > 0:
 */
  __pyx_v_j = 0;

  /* "pandas/src/generated.pyx":7355
 *     i = 0
 *     j = 0
 *     count = 0             # <<<<<<<<<<<<<<
 *     if nleft > 0:
 *         while i < nleft:
 */
  __pyx_v_count = 0;

  /* "pandas/src/generated.pyx":7356
 *     j = 0
 *     count = 0
 *     if nleft > 0:             # <<<<<<<<<<<<<<
 *         while i < nleft:
 *             if j == nright:
 */
  __pyx_t_2 = ((__pyx_v_nleft > 0) != 0);
  if (__pyx_t_2) {

    /* "pandas/src/generated.pyx":7357
 *     count = 0
 *     if nleft > 0:
 *         while i < nleft:             # <<<<<<<<<<<<<<
 *             if j == nright:
 *                 count += nleft - i
 */
    while (1) {
      __pyx_t_2 = ((__pyx_v_i < __pyx_v_nleft) != 0);
      if (!__pyx_t_2) break;

      /* "pandas/src/generated.pyx":7358
 *     if nleft > 0:
 *         while i < nleft:
 *             if j == nright:             # <<<<<<<<<<<<<<
 *                 count += nleft - i
 *                 break
 */
      __pyx_t_2 = ((__pyx_v_j == __pyx_v_nright) != 0);
      if (__pyx_t_2) {

        /* "pandas/src/generated.pyx":7359
 *         while i < nleft:
 *             if j == nright:
 *                 count += nleft - i             # <<<<<<<<<<<<<<
 *                 break
 * 
 */
        __pyx_v_count = (__pyx_v_count + (__pyx_v_nleft - __pyx_v_i));

        /* "pandas/src/generated.pyx":7360
 *             if j == nright:
 *                 count += nleft - i
 *                 break             # <<<<<<<<<<<<<<
 * 
 *             lval = left[i]
 */
        goto __pyx_L5_break;
      }

      /* "pandas/src/generated.pyx":7362
 *                 break
 * 
 *             lval = left[i]             # <<<<<<<<<<<<<<
 *             rval = right[j]
 * 
 */
      __pyx_t_1 = __pyx_v_i;
      __pyx_t_4 = -1;
      if (__pyx_t_1 < 0) {
        __pyx_t_1 += __pyx_pybuffernd_left.diminfo[0].shape;
        if (unlikely(__pyx_t_1 < 0)) __pyx_t_4 = 0;
      } else if (unlikely(__pyx_t_1 >= __pyx_pybuffernd_left.diminfo[0].shape)) __pyx_t_4 = 0;
      if (unlikely(__pyx_t_4 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_4);
        {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7362; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_t_3 = (PyObject *) *__Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_left.rcbuffer->pybuffer.buf, __pyx_t_1, __pyx_pybuffernd_left.diminfo[0].strides);
      __Pyx_INCREF((PyObject*)__pyx_t_3);
      __Pyx_XDECREF_SET(__pyx_v_lval, __pyx_t_3);
      __pyx_t_3 = 0;

      /* "pandas/src/generated.pyx":7363
 * 
 *             lval = left[i]
 *             rval = right[j]             # <<<<<<<<<<<<<<
 * 
 *             if lval == rval:
 */
      __pyx_t_5 = __pyx_v_j;
      __pyx_t_4 = -1;
      if (__pyx_t_5 < 0) {
        __pyx_t_5 += __pyx_pybuffernd_right.diminfo[0].shape;
        if (unlikely(__pyx_t_5 < 0)) __pyx_t_4 = 0;
      } else if (unlikely(__pyx_t_5 >= __pyx_pybuffernd_right.diminfo[0].shape)) __pyx_t_4 = 0;
      if (unlikely(__pyx_t_4 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_4);
        {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7363; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_t_3 = (PyObject *) *__Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_right.rcbuffer->pybuffer.buf, __pyx_t_5, __pyx_pybuffernd_right.diminfo[0].strides);
      __Pyx_INCREF((PyObject*)__pyx_t_3);
      __Pyx_XDECREF_SET(__pyx_v_rval, __pyx_t_3);
      __pyx_t_3 = 0;

      /* "pandas/src/generated.pyx":7365
 *             rval = right[j]
 * 
 *             if lval == rval:             # <<<<<<<<<<<<<<
 *                 count += 1
 *                 if i < nleft - 1:
 */
      __pyx_t_3 = PyObject_RichCompare(__pyx_v_lval, __pyx_v_rval, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7365; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7365; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (__pyx_t_2) {

        /* "pandas/src/generated.pyx":7366
 * 
 *             if lval == rval:
 *                 count += 1             # <<<<<<<<<<<<<<
 *                 if i < nleft - 1:
 *                     if j < nright - 1 and right[j + 1] == rval:
 */
        __pyx_v_count = (__pyx_v_count + 1);

        /* "pandas/src/generated.pyx":7367
 *             if lval == rval:
 *                 count += 1
 *                 if i < nleft - 1:             # <<<<<<<<<<<<<<
 *                     if j < nright - 1 and right[j + 1] == rval:
 *                         j += 1
 */
        __pyx_t_2 = ((__pyx_v_i < (__pyx_v_nleft - 1)) != 0);
        if (__pyx_t_2) {

          /* "pandas/src/generated.pyx":7368
 *                 count += 1
 *                 if i < nleft - 1:
 *                     if j < nright - 1 and right[j + 1] == rval:             # <<<<<<<<<<<<<<
 *                         j += 1
 *                     else:
 */
          __pyx_t_2 = (__pyx_v_j < (__pyx_v_nright - 1));
          if (__pyx_t_2) {
            __pyx_t_6 = (__pyx_v_j + 1);
            __pyx_t_4 = -1;
            if (__pyx_t_6 < 0) {
              __pyx_t_6 += __pyx_pybuffernd_right.diminfo[0].shape;
              if (unlikely(__pyx_t_6 < 0)) __pyx_t_4 = 0;
            } else if (unlikely(__pyx_t_6 >= __pyx_pybuffernd_right.diminfo[0].shape)) __pyx_t_4 = 0;
            if (unlikely(__pyx_t_4 != -1)) {
              __Pyx_RaiseBufferIndexError(__pyx_t_4);
              {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7368; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            }
            __pyx_t_3 = (PyObject *) *__Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_right.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_right.diminfo[0].strides);
            __Pyx_INCREF((PyObject*)__pyx_t_3);
            __pyx_t_7 = PyObject_RichCompare(__pyx_t_3, __pyx_v_rval, Py_EQ); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7368; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
            __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7368; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
            __pyx_t_9 = __pyx_t_8;
          } else {
            __pyx_t_9 = __pyx_t_2;
          }
          if (__pyx_t_9) {

            /* "pandas/src/generated.pyx":7369
 *                 if i < nleft - 1:
 *                     if j < nright - 1 and right[j + 1] == rval:
 *                         j += 1             # <<<<<<<<<<<<<<
 *                     else:
 *                         i += 1
 */
            __pyx_v_j = (__pyx_v_j + 1);
            goto __pyx_L9;
          }
          /*else*/ {

            /* "pandas/src/generated.pyx":7371
 *                         j += 1
 *                     else:
 *                         i += 1             # <<<<<<<<<<<<<<
 *                         if left[i] != rval:
 *                             j += 1
 */
            __pyx_v_i = (__pyx_v_i + 1);

            /* "pandas/src/generated.pyx":7372
 *                     else:
 *                         i += 1
 *                         if left[i] != rval:             # <<<<<<<<<<<<<<
 *                             j += 1
 *                 elif j < nright - 1:
 */
            __pyx_t_10 = __pyx_v_i;
            __pyx_t_4 = -1;
            if (__pyx_t_10 < 0) {
              __pyx_t_10 += __pyx_pybuffernd_left.diminfo[0].shape;
              if (unlikely(__pyx_t_10 < 0)) __pyx_t_4 = 0;
            } else if (unlikely(__pyx_t_10 >= __pyx_pybuffernd_left.diminfo[0].shape)) __pyx_t_4 = 0;
            if (unlikely(__pyx_t_4 != -1)) {
              __Pyx_RaiseBufferIndexError(__pyx_t_4);
              {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7372; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            }
            __pyx_t_7 = (PyObject *) *__Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_left.rcbuffer->pybuffer.buf, __pyx_t_10, __pyx_pybuffernd_left.diminfo[0].strides);
            __Pyx_INCREF((PyObject*)__pyx_t_7);
            __pyx_t_3 = PyObject_RichCompare(__pyx_t_7, __pyx_v_rval, Py_NE); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7372; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
            __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7372; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
            if (__pyx_t_9) {

              /* "pandas/src/generated.pyx":7373
 *                         i += 1
 *                         if left[i] != rval:
 *                             j += 1             # <<<<<<<<<<<<<<
 *                 elif j < nright - 1:
 *                     j += 1
 */
              __pyx_v_j = (__pyx_v_j + 1);
              goto __pyx_L10;
            }
            __pyx_L10:;
          }
          __pyx_L9:;
          goto __pyx_L8;
        }

        /* "pandas/src/generated.pyx":7374
 *                         if left[i] != rval:
 *                             j += 1
 *                 elif j < nright - 1:             # <<<<<<<<<<<<<<
 *                     j += 1
 *                     if lval != right[j]:
 */
        __pyx_t_9 = ((__pyx_v_j < (__pyx_v_nright - 1)) != 0);
        if (__pyx_t_9) {

          /* "pandas/src/generated.pyx":7375
 *                             j += 1
 *                 elif j < nright - 1:
 *                     j += 1             # <<<<<<<<<<<<<<
 *                     if lval != right[j]:
 *                         i += 1
 */
          __pyx_v_j = (__pyx_v_j + 1);

          /* "pandas/src/generated.pyx":7376
 *                 elif j < nright - 1:
 *                     j += 1
 *                     if lval != right[j]:             # <<<<<<<<<<<<<<
 *                         i += 1
 *                 else:
 */
          __pyx_t_11 = __pyx_v_j;
          __pyx_t_4 = -1;
          if (__pyx_t_11 < 0) {
            __pyx_t_11 += __pyx_pybuffernd_right.diminfo[0].shape;
            if (unlikely(__pyx_t_11 < 0)) __pyx_t_4 = 0;
          } else if (unlikely(__pyx_t_11 >= __pyx_pybuffernd_right.diminfo[0].shape)) __pyx_t_4 = 0;
          if (unlikely(__pyx_t_4 != -1)) {
            __Pyx_RaiseBufferIndexError(__pyx_t_4);
            {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7376; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          }
          __pyx_t_3 = (PyObject *) *__Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_right.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_right.diminfo[0].strides);
          __Pyx_INCREF((PyObject*)__pyx_t_3);
          __pyx_t_7 = PyObject_RichCompare(__pyx_v_lval, __pyx_t_3, Py_NE); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7376; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
          __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7376; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          if (__pyx_t_9) {

            /* "pandas/src/generated.pyx":7377
 *                     j += 1
 *                     if lval != right[j]:
 *                         i += 1             # <<<<<<<<<<<<<<
 *                 else:
 *                     # end of the road
 */
            __pyx_v_i = (__pyx_v_i + 1);
            goto __pyx_L11;
          }
          __pyx_L11:;
          goto __pyx_L8;
        }
        /*else*/ {

          /* "pandas/src/generated.pyx":7380
 *                 else:
 *                     # end of the road
 *                     break             # <<<<<<<<<<<<<<
 *             elif lval < rval:
 *                 count += 1
 */
          goto __pyx_L5_break;
        }
        __pyx_L8:;
        goto __pyx_L7;
      }

      /* "pandas/src/generated.pyx":7381
 *                     # end of the road
 *                     break
 *             elif lval < rval:             # <<<<<<<<<<<<<<
 *                 count += 1
 *                 i += 1
 */
      __pyx_t_7 = PyObject_RichCompare(__pyx_v_lval, __pyx_v_rval, Py_LT); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7381; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7381; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      if (__pyx_t_9) {

        /* "pandas/src/generated.pyx":7382
 *                     break
 *             elif lval < rval:
 *                 count += 1             # <<<<<<<<<<<<<<
 *                 i += 1
 *             else:
 */
        __pyx_v_count = (__pyx_v_count + 1);

        /* "pandas/src/generated.pyx":7383
 *             elif lval < rval:
 *                 count += 1
 *                 i += 1             # <<<<<<<<<<<<<<
 *             else:
 *                 j += 1
 */
        __pyx_v_i = (__pyx_v_i + 1);
        goto __pyx_L7;
      }
      /*else*/ {

        /* "pandas/src/generated.pyx":7385
 *                 i += 1
 *             else:
 *                 j += 1             # <<<<<<<<<<<<<<
 * 
 *     # do it again now that result size is known
 */
        __pyx_v_j = (__pyx_v_j + 1);
      }
      __pyx_L7:;
    }
    __pyx_L5_break:;
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "pandas/src/generated.pyx":7389
 *     # do it again now that result size is known
 * 
 *     lindexer = np.empty(count, dtype=np.int64)             # <<<<<<<<<<<<<<
 *     rindexer = np.empty(count, dtype=np.int64)
 *     result = np.empty(count, dtype=object)
 */
  __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7389; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_empty); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7389; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __pyx_t_7 = PyInt_FromSsize_t(__pyx_v_count); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7389; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_12 = PyTuple_New(1); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7389; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_12);
  PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_7);
  __Pyx_GIVEREF(__pyx_t_7);
  __pyx_t_7 = 0;
  __pyx_t_7 = PyDict_New(); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7389; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_13 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7389; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_13);
  __pyx_t_14 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_n_s_int64); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7389; __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_7, __pyx_n_s_dtype, __pyx_t_14) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7389; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  __pyx_t_14 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_12, __pyx_t_7); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7389; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_14);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  if (!(likely(((__pyx_t_14) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_14, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7389; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_15 = ((PyArrayObject *)__pyx_t_14);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_lindexer.rcbuffer->pybuffer);
    __pyx_t_4 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_lindexer.rcbuffer->pybuffer, (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_4 < 0)) {
      PyErr_Fetch(&__pyx_t_16, &__pyx_t_17, &__pyx_t_18);
      if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_lindexer.rcbuffer->pybuffer, (PyObject*)__pyx_v_lindexer, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {
        Py_XDECREF(__pyx_t_16); Py_XDECREF(__pyx_t_17); Py_XDECREF(__pyx_t_18);
        __Pyx_RaiseBufferFallbackError();
      } else {
        PyErr_Restore(__pyx_t_16, __pyx_t_17, __pyx_t_18);
      }
    }
    __pyx_pybuffernd_lindexer.diminfo[0].strides = __pyx_pybuffernd_lindexer.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_lindexer.diminfo[0].shape = __pyx_pybuffernd_lindexer.rcbuffer->pybuffer.shape[0];
    if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7389; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_15 = 0;
  __pyx_v_lindexer = ((PyArrayObject *)__pyx_t_14);
  __pyx_t_14 = 0;

  /* "pandas/src/generated.pyx":7390
 * 
 *     lindexer = np.empty(count, dtype=np.int64)
 *     rindexer = np.empty(count, dtype=np.int64)             # <<<<<<<<<<<<<<
 *     result = np.empty(count, dtype=object)
 * 
 */
  __pyx_t_14 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7390; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_14);
  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_14, __pyx_n_s_empty); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7390; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  __pyx_t_14 = PyInt_FromSsize_t(__pyx_v_count); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7390; __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[2]; __pyx_lineno = 7390; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__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 = PyDict_New(); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7390; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_14);
  __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7390; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_int64); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7390; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_13);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (PyDict_SetItem(__pyx_t_14, __pyx_n_s_dtype, __pyx_t_13) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7390; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  __pyx_t_13 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_12, __pyx_t_14); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7390; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_13);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
  __Pyx_DECREF(__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[2]; __pyx_lineno = 7390; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_15 = ((PyArrayObject *)__pyx_t_13);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_rindexer.rcbuffer->pybuffer);
    __pyx_t_4 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_rindexer.rcbuffer->pybuffer, (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_4 < 0)) {
      PyErr_Fetch(&__pyx_t_18, &__pyx_t_17, &__pyx_t_16);
      if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_rindexer.rcbuffer->pybuffer, (PyObject*)__pyx_v_rindexer, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {
        Py_XDECREF(__pyx_t_18); Py_XDECREF(__pyx_t_17); Py_XDECREF(__pyx_t_16);
        __Pyx_RaiseBufferFallbackError();
      } else {
        PyErr_Restore(__pyx_t_18, __pyx_t_17, __pyx_t_16);
      }
    }
    __pyx_pybuffernd_rindexer.diminfo[0].strides = __pyx_pybuffernd_rindexer.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_rindexer.diminfo[0].shape = __pyx_pybuffernd_rindexer.rcbuffer->pybuffer.shape[0];
    if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7390; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_15 = 0;
  __pyx_v_rindexer = ((PyArrayObject *)__pyx_t_13);
  __pyx_t_13 = 0;

  /* "pandas/src/generated.pyx":7391
 *     lindexer = np.empty(count, dtype=np.int64)
 *     rindexer = np.empty(count, dtype=np.int64)
 *     result = np.empty(count, dtype=object)             # <<<<<<<<<<<<<<
 * 
 *     i = 0
 */
  __pyx_t_13 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7391; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_13);
  __pyx_t_14 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_n_s_empty); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7391; __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_count); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7391; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_13);
  __pyx_t_12 = PyTuple_New(1); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7391; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_12);
  PyTuple_SET_ITEM(__pyx_t_12, 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 = 7391; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_13);
  if (PyDict_SetItem(__pyx_t_13, __pyx_n_s_dtype, __pyx_builtin_object) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7391; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_14, __pyx_t_12, __pyx_t_13); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7391; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
  __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[2]; __pyx_lineno = 7391; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_19 = ((PyArrayObject *)__pyx_t_7);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer);
    __pyx_t_4 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_result.rcbuffer->pybuffer, (PyObject*)__pyx_t_19, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack);
    if (unlikely(__pyx_t_4 < 0)) {
      PyErr_Fetch(&__pyx_t_16, &__pyx_t_17, &__pyx_t_18);
      if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_result.rcbuffer->pybuffer, (PyObject*)__pyx_v_result, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {
        Py_XDECREF(__pyx_t_16); Py_XDECREF(__pyx_t_17); Py_XDECREF(__pyx_t_18);
        __Pyx_RaiseBufferFallbackError();
      } else {
        PyErr_Restore(__pyx_t_16, __pyx_t_17, __pyx_t_18);
      }
    }
    __pyx_pybuffernd_result.diminfo[0].strides = __pyx_pybuffernd_result.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_result.diminfo[0].shape = __pyx_pybuffernd_result.rcbuffer->pybuffer.shape[0];
    if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7391; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_19 = 0;
  __pyx_v_result = ((PyArrayObject *)__pyx_t_7);
  __pyx_t_7 = 0;

  /* "pandas/src/generated.pyx":7393
 *     result = np.empty(count, dtype=object)
 * 
 *     i = 0             # <<<<<<<<<<<<<<
 *     j = 0
 *     count = 0
 */
  __pyx_v_i = 0;

  /* "pandas/src/generated.pyx":7394
 * 
 *     i = 0
 *     j = 0             # <<<<<<<<<<<<<<
 *     count = 0
 *     if nleft > 0:
 */
  __pyx_v_j = 0;

  /* "pandas/src/generated.pyx":7395
 *     i = 0
 *     j = 0
 *     count = 0             # <<<<<<<<<<<<<<
 *     if nleft > 0:
 *         while i < nleft:
 */
  __pyx_v_count = 0;

  /* "pandas/src/generated.pyx":7396
 *     j = 0
 *     count = 0
 *     if nleft > 0:             # <<<<<<<<<<<<<<
 *         while i < nleft:
 *             if j == nright:
 */
  __pyx_t_9 = ((__pyx_v_nleft > 0) != 0);
  if (__pyx_t_9) {

    /* "pandas/src/generated.pyx":7397
 *     count = 0
 *     if nleft > 0:
 *         while i < nleft:             # <<<<<<<<<<<<<<
 *             if j == nright:
 *                 while i < nleft:
 */
    while (1) {
      __pyx_t_9 = ((__pyx_v_i < __pyx_v_nleft) != 0);
      if (!__pyx_t_9) break;

      /* "pandas/src/generated.pyx":7398
 *     if nleft > 0:
 *         while i < nleft:
 *             if j == nright:             # <<<<<<<<<<<<<<
 *                 while i < nleft:
 *                     lindexer[count] = i
 */
      __pyx_t_9 = ((__pyx_v_j == __pyx_v_nright) != 0);
      if (__pyx_t_9) {

        /* "pandas/src/generated.pyx":7399
 *         while i < nleft:
 *             if j == nright:
 *                 while i < nleft:             # <<<<<<<<<<<<<<
 *                     lindexer[count] = i
 *                     rindexer[count] = -1
 */
        while (1) {
          __pyx_t_9 = ((__pyx_v_i < __pyx_v_nleft) != 0);
          if (!__pyx_t_9) break;

          /* "pandas/src/generated.pyx":7400
 *             if j == nright:
 *                 while i < nleft:
 *                     lindexer[count] = i             # <<<<<<<<<<<<<<
 *                     rindexer[count] = -1
 *                     result[count] = left[i]
 */
          __pyx_t_20 = __pyx_v_count;
          __pyx_t_4 = -1;
          if (__pyx_t_20 < 0) {
            __pyx_t_20 += __pyx_pybuffernd_lindexer.diminfo[0].shape;
            if (unlikely(__pyx_t_20 < 0)) __pyx_t_4 = 0;
          } else if (unlikely(__pyx_t_20 >= __pyx_pybuffernd_lindexer.diminfo[0].shape)) __pyx_t_4 = 0;
          if (unlikely(__pyx_t_4 != -1)) {
            __Pyx_RaiseBufferIndexError(__pyx_t_4);
            {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7400; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          }
          *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_lindexer.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_lindexer.diminfo[0].strides) = __pyx_v_i;

          /* "pandas/src/generated.pyx":7401
 *                 while i < nleft:
 *                     lindexer[count] = i
 *                     rindexer[count] = -1             # <<<<<<<<<<<<<<
 *                     result[count] = left[i]
 *                     i += 1
 */
          __pyx_t_21 = __pyx_v_count;
          __pyx_t_4 = -1;
          if (__pyx_t_21 < 0) {
            __pyx_t_21 += __pyx_pybuffernd_rindexer.diminfo[0].shape;
            if (unlikely(__pyx_t_21 < 0)) __pyx_t_4 = 0;
          } else if (unlikely(__pyx_t_21 >= __pyx_pybuffernd_rindexer.diminfo[0].shape)) __pyx_t_4 = 0;
          if (unlikely(__pyx_t_4 != -1)) {
            __Pyx_RaiseBufferIndexError(__pyx_t_4);
            {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7401; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          }
          *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_rindexer.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_rindexer.diminfo[0].strides) = -1;

          /* "pandas/src/generated.pyx":7402
 *                     lindexer[count] = i
 *                     rindexer[count] = -1
 *                     result[count] = left[i]             # <<<<<<<<<<<<<<
 *                     i += 1
 *                     count += 1
 */
          __pyx_t_22 = __pyx_v_i;
          __pyx_t_4 = -1;
          if (__pyx_t_22 < 0) {
            __pyx_t_22 += __pyx_pybuffernd_left.diminfo[0].shape;
            if (unlikely(__pyx_t_22 < 0)) __pyx_t_4 = 0;
          } else if (unlikely(__pyx_t_22 >= __pyx_pybuffernd_left.diminfo[0].shape)) __pyx_t_4 = 0;
          if (unlikely(__pyx_t_4 != -1)) {
            __Pyx_RaiseBufferIndexError(__pyx_t_4);
            {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7402; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          }
          __pyx_t_7 = (PyObject *) *__Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_left.rcbuffer->pybuffer.buf, __pyx_t_22, __pyx_pybuffernd_left.diminfo[0].strides);
          __Pyx_INCREF((PyObject*)__pyx_t_7);
          __pyx_t_23 = __pyx_v_count;
          __pyx_t_4 = -1;
          if (__pyx_t_23 < 0) {
            __pyx_t_23 += __pyx_pybuffernd_result.diminfo[0].shape;
            if (unlikely(__pyx_t_23 < 0)) __pyx_t_4 = 0;
          } else if (unlikely(__pyx_t_23 >= __pyx_pybuffernd_result.diminfo[0].shape)) __pyx_t_4 = 0;
          if (unlikely(__pyx_t_4 != -1)) {
            __Pyx_RaiseBufferIndexError(__pyx_t_4);
            {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7402; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          }
          __pyx_t_24 = __Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_23, __pyx_pybuffernd_result.diminfo[0].strides);
          __Pyx_GOTREF(*__pyx_t_24);
          __Pyx_INCREF(__pyx_t_7); __Pyx_DECREF(*__pyx_t_24);
          *__pyx_t_24 = __pyx_t_7;
          __Pyx_GIVEREF(*__pyx_t_24);
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

          /* "pandas/src/generated.pyx":7403
 *                     rindexer[count] = -1
 *                     result[count] = left[i]
 *                     i += 1             # <<<<<<<<<<<<<<
 *                     count += 1
 *                 break
 */
          __pyx_v_i = (__pyx_v_i + 1);

          /* "pandas/src/generated.pyx":7404
 *                     result[count] = left[i]
 *                     i += 1
 *                     count += 1             # <<<<<<<<<<<<<<
 *                 break
 * 
 */
          __pyx_v_count = (__pyx_v_count + 1);
        }

        /* "pandas/src/generated.pyx":7405
 *                     i += 1
 *                     count += 1
 *                 break             # <<<<<<<<<<<<<<
 * 
 *             lval = left[i]
 */
        goto __pyx_L14_break;
      }

      /* "pandas/src/generated.pyx":7407
 *                 break
 * 
 *             lval = left[i]             # <<<<<<<<<<<<<<
 *             rval = right[j]
 * 
 */
      __pyx_t_25 = __pyx_v_i;
      __pyx_t_4 = -1;
      if (__pyx_t_25 < 0) {
        __pyx_t_25 += __pyx_pybuffernd_left.diminfo[0].shape;
        if (unlikely(__pyx_t_25 < 0)) __pyx_t_4 = 0;
      } else if (unlikely(__pyx_t_25 >= __pyx_pybuffernd_left.diminfo[0].shape)) __pyx_t_4 = 0;
      if (unlikely(__pyx_t_4 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_4);
        {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7407; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_t_7 = (PyObject *) *__Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_left.rcbuffer->pybuffer.buf, __pyx_t_25, __pyx_pybuffernd_left.diminfo[0].strides);
      __Pyx_INCREF((PyObject*)__pyx_t_7);
      __Pyx_XDECREF_SET(__pyx_v_lval, __pyx_t_7);
      __pyx_t_7 = 0;

      /* "pandas/src/generated.pyx":7408
 * 
 *             lval = left[i]
 *             rval = right[j]             # <<<<<<<<<<<<<<
 * 
 *             if lval == rval:
 */
      __pyx_t_26 = __pyx_v_j;
      __pyx_t_4 = -1;
      if (__pyx_t_26 < 0) {
        __pyx_t_26 += __pyx_pybuffernd_right.diminfo[0].shape;
        if (unlikely(__pyx_t_26 < 0)) __pyx_t_4 = 0;
      } else if (unlikely(__pyx_t_26 >= __pyx_pybuffernd_right.diminfo[0].shape)) __pyx_t_4 = 0;
      if (unlikely(__pyx_t_4 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_4);
        {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7408; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_t_7 = (PyObject *) *__Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_right.rcbuffer->pybuffer.buf, __pyx_t_26, __pyx_pybuffernd_right.diminfo[0].strides);
      __Pyx_INCREF((PyObject*)__pyx_t_7);
      __Pyx_XDECREF_SET(__pyx_v_rval, __pyx_t_7);
      __pyx_t_7 = 0;

      /* "pandas/src/generated.pyx":7410
 *             rval = right[j]
 * 
 *             if lval == rval:             # <<<<<<<<<<<<<<
 *                 lindexer[count] = i
 *                 rindexer[count] = j
 */
      __pyx_t_7 = PyObject_RichCompare(__pyx_v_lval, __pyx_v_rval, Py_EQ); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7410; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7410; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      if (__pyx_t_9) {

        /* "pandas/src/generated.pyx":7411
 * 
 *             if lval == rval:
 *                 lindexer[count] = i             # <<<<<<<<<<<<<<
 *                 rindexer[count] = j
 *                 result[count] = lval
 */
        __pyx_t_27 = __pyx_v_count;
        __pyx_t_4 = -1;
        if (__pyx_t_27 < 0) {
          __pyx_t_27 += __pyx_pybuffernd_lindexer.diminfo[0].shape;
          if (unlikely(__pyx_t_27 < 0)) __pyx_t_4 = 0;
        } else if (unlikely(__pyx_t_27 >= __pyx_pybuffernd_lindexer.diminfo[0].shape)) __pyx_t_4 = 0;
        if (unlikely(__pyx_t_4 != -1)) {
          __Pyx_RaiseBufferIndexError(__pyx_t_4);
          {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7411; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_lindexer.rcbuffer->pybuffer.buf, __pyx_t_27, __pyx_pybuffernd_lindexer.diminfo[0].strides) = __pyx_v_i;

        /* "pandas/src/generated.pyx":7412
 *             if lval == rval:
 *                 lindexer[count] = i
 *                 rindexer[count] = j             # <<<<<<<<<<<<<<
 *                 result[count] = lval
 *                 count += 1
 */
        __pyx_t_28 = __pyx_v_count;
        __pyx_t_4 = -1;
        if (__pyx_t_28 < 0) {
          __pyx_t_28 += __pyx_pybuffernd_rindexer.diminfo[0].shape;
          if (unlikely(__pyx_t_28 < 0)) __pyx_t_4 = 0;
        } else if (unlikely(__pyx_t_28 >= __pyx_pybuffernd_rindexer.diminfo[0].shape)) __pyx_t_4 = 0;
        if (unlikely(__pyx_t_4 != -1)) {
          __Pyx_RaiseBufferIndexError(__pyx_t_4);
          {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7412; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_rindexer.rcbuffer->pybuffer.buf, __pyx_t_28, __pyx_pybuffernd_rindexer.diminfo[0].strides) = __pyx_v_j;

        /* "pandas/src/generated.pyx":7413
 *                 lindexer[count] = i
 *                 rindexer[count] = j
 *                 result[count] = lval             # <<<<<<<<<<<<<<
 *                 count += 1
 *                 if i < nleft - 1:
 */
        __pyx_t_29 = __pyx_v_count;
        __pyx_t_4 = -1;
        if (__pyx_t_29 < 0) {
          __pyx_t_29 += __pyx_pybuffernd_result.diminfo[0].shape;
          if (unlikely(__pyx_t_29 < 0)) __pyx_t_4 = 0;
        } else if (unlikely(__pyx_t_29 >= __pyx_pybuffernd_result.diminfo[0].shape)) __pyx_t_4 = 0;
        if (unlikely(__pyx_t_4 != -1)) {
          __Pyx_RaiseBufferIndexError(__pyx_t_4);
          {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7413; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        __pyx_t_24 = __Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_29, __pyx_pybuffernd_result.diminfo[0].strides);
        __Pyx_GOTREF(*__pyx_t_24);
        __Pyx_INCREF(__pyx_v_lval); __Pyx_DECREF(*__pyx_t_24);
        *__pyx_t_24 = __pyx_v_lval;
        __Pyx_GIVEREF(*__pyx_t_24);

        /* "pandas/src/generated.pyx":7414
 *                 rindexer[count] = j
 *                 result[count] = lval
 *                 count += 1             # <<<<<<<<<<<<<<
 *                 if i < nleft - 1:
 *                     if j < nright - 1 and right[j + 1] == rval:
 */
        __pyx_v_count = (__pyx_v_count + 1);

        /* "pandas/src/generated.pyx":7415
 *                 result[count] = lval
 *                 count += 1
 *                 if i < nleft - 1:             # <<<<<<<<<<<<<<
 *                     if j < nright - 1 and right[j + 1] == rval:
 *                         j += 1
 */
        __pyx_t_9 = ((__pyx_v_i < (__pyx_v_nleft - 1)) != 0);
        if (__pyx_t_9) {

          /* "pandas/src/generated.pyx":7416
 *                 count += 1
 *                 if i < nleft - 1:
 *                     if j < nright - 1 and right[j + 1] == rval:             # <<<<<<<<<<<<<<
 *                         j += 1
 *                     else:
 */
          __pyx_t_9 = (__pyx_v_j < (__pyx_v_nright - 1));
          if (__pyx_t_9) {
            __pyx_t_30 = (__pyx_v_j + 1);
            __pyx_t_4 = -1;
            if (__pyx_t_30 < 0) {
              __pyx_t_30 += __pyx_pybuffernd_right.diminfo[0].shape;
              if (unlikely(__pyx_t_30 < 0)) __pyx_t_4 = 0;
            } else if (unlikely(__pyx_t_30 >= __pyx_pybuffernd_right.diminfo[0].shape)) __pyx_t_4 = 0;
            if (unlikely(__pyx_t_4 != -1)) {
              __Pyx_RaiseBufferIndexError(__pyx_t_4);
              {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7416; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            }
            __pyx_t_7 = (PyObject *) *__Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_right.rcbuffer->pybuffer.buf, __pyx_t_30, __pyx_pybuffernd_right.diminfo[0].strides);
            __Pyx_INCREF((PyObject*)__pyx_t_7);
            __pyx_t_13 = PyObject_RichCompare(__pyx_t_7, __pyx_v_rval, Py_EQ); __Pyx_XGOTREF(__pyx_t_13); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7416; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
            __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_13); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7416; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
            __pyx_t_8 = __pyx_t_2;
          } else {
            __pyx_t_8 = __pyx_t_9;
          }
          if (__pyx_t_8) {

            /* "pandas/src/generated.pyx":7417
 *                 if i < nleft - 1:
 *                     if j < nright - 1 and right[j + 1] == rval:
 *                         j += 1             # <<<<<<<<<<<<<<
 *                     else:
 *                         i += 1
 */
            __pyx_v_j = (__pyx_v_j + 1);
            goto __pyx_L20;
          }
          /*else*/ {

            /* "pandas/src/generated.pyx":7419
 *                         j += 1
 *                     else:
 *                         i += 1             # <<<<<<<<<<<<<<
 *                         if left[i] != rval:
 *                             j += 1
 */
            __pyx_v_i = (__pyx_v_i + 1);

            /* "pandas/src/generated.pyx":7420
 *                     else:
 *                         i += 1
 *                         if left[i] != rval:             # <<<<<<<<<<<<<<
 *                             j += 1
 *                 elif j < nright - 1:
 */
            __pyx_t_31 = __pyx_v_i;
            __pyx_t_4 = -1;
            if (__pyx_t_31 < 0) {
              __pyx_t_31 += __pyx_pybuffernd_left.diminfo[0].shape;
              if (unlikely(__pyx_t_31 < 0)) __pyx_t_4 = 0;
            } else if (unlikely(__pyx_t_31 >= __pyx_pybuffernd_left.diminfo[0].shape)) __pyx_t_4 = 0;
            if (unlikely(__pyx_t_4 != -1)) {
              __Pyx_RaiseBufferIndexError(__pyx_t_4);
              {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7420; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            }
            __pyx_t_13 = (PyObject *) *__Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_left.rcbuffer->pybuffer.buf, __pyx_t_31, __pyx_pybuffernd_left.diminfo[0].strides);
            __Pyx_INCREF((PyObject*)__pyx_t_13);
            __pyx_t_7 = PyObject_RichCompare(__pyx_t_13, __pyx_v_rval, Py_NE); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7420; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
            __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7420; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
            if (__pyx_t_8) {

              /* "pandas/src/generated.pyx":7421
 *                         i += 1
 *                         if left[i] != rval:
 *                             j += 1             # <<<<<<<<<<<<<<
 *                 elif j < nright - 1:
 *                     j += 1
 */
              __pyx_v_j = (__pyx_v_j + 1);
              goto __pyx_L21;
            }
            __pyx_L21:;
          }
          __pyx_L20:;
          goto __pyx_L19;
        }

        /* "pandas/src/generated.pyx":7422
 *                         if left[i] != rval:
 *                             j += 1
 *                 elif j < nright - 1:             # <<<<<<<<<<<<<<
 *                     j += 1
 *                     if lval != right[j]:
 */
        __pyx_t_8 = ((__pyx_v_j < (__pyx_v_nright - 1)) != 0);
        if (__pyx_t_8) {

          /* "pandas/src/generated.pyx":7423
 *                             j += 1
 *                 elif j < nright - 1:
 *                     j += 1             # <<<<<<<<<<<<<<
 *                     if lval != right[j]:
 *                         i += 1
 */
          __pyx_v_j = (__pyx_v_j + 1);

          /* "pandas/src/generated.pyx":7424
 *                 elif j < nright - 1:
 *                     j += 1
 *                     if lval != right[j]:             # <<<<<<<<<<<<<<
 *                         i += 1
 *                 else:
 */
          __pyx_t_32 = __pyx_v_j;
          __pyx_t_4 = -1;
          if (__pyx_t_32 < 0) {
            __pyx_t_32 += __pyx_pybuffernd_right.diminfo[0].shape;
            if (unlikely(__pyx_t_32 < 0)) __pyx_t_4 = 0;
          } else if (unlikely(__pyx_t_32 >= __pyx_pybuffernd_right.diminfo[0].shape)) __pyx_t_4 = 0;
          if (unlikely(__pyx_t_4 != -1)) {
            __Pyx_RaiseBufferIndexError(__pyx_t_4);
            {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7424; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          }
          __pyx_t_7 = (PyObject *) *__Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_right.rcbuffer->pybuffer.buf, __pyx_t_32, __pyx_pybuffernd_right.diminfo[0].strides);
          __Pyx_INCREF((PyObject*)__pyx_t_7);
          __pyx_t_13 = PyObject_RichCompare(__pyx_v_lval, __pyx_t_7, Py_NE); __Pyx_XGOTREF(__pyx_t_13); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7424; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_13); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7424; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
          if (__pyx_t_8) {

            /* "pandas/src/generated.pyx":7425
 *                     j += 1
 *                     if lval != right[j]:
 *                         i += 1             # <<<<<<<<<<<<<<
 *                 else:
 *                     # end of the road
 */
            __pyx_v_i = (__pyx_v_i + 1);
            goto __pyx_L22;
          }
          __pyx_L22:;
          goto __pyx_L19;
        }
        /*else*/ {

          /* "pandas/src/generated.pyx":7428
 *                 else:
 *                     # end of the road
 *                     break             # <<<<<<<<<<<<<<
 *             elif lval < rval:
 *                 lindexer[count] = i
 */
          goto __pyx_L14_break;
        }
        __pyx_L19:;
        goto __pyx_L18;
      }

      /* "pandas/src/generated.pyx":7429
 *                     # end of the road
 *                     break
 *             elif lval < rval:             # <<<<<<<<<<<<<<
 *                 lindexer[count] = i
 *                 rindexer[count] = -1
 */
      __pyx_t_13 = PyObject_RichCompare(__pyx_v_lval, __pyx_v_rval, Py_LT); __Pyx_XGOTREF(__pyx_t_13); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7429; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_13); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7429; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
      if (__pyx_t_8) {

        /* "pandas/src/generated.pyx":7430
 *                     break
 *             elif lval < rval:
 *                 lindexer[count] = i             # <<<<<<<<<<<<<<
 *                 rindexer[count] = -1
 *                 result[count] = left[i]
 */
        __pyx_t_33 = __pyx_v_count;
        __pyx_t_4 = -1;
        if (__pyx_t_33 < 0) {
          __pyx_t_33 += __pyx_pybuffernd_lindexer.diminfo[0].shape;
          if (unlikely(__pyx_t_33 < 0)) __pyx_t_4 = 0;
        } else if (unlikely(__pyx_t_33 >= __pyx_pybuffernd_lindexer.diminfo[0].shape)) __pyx_t_4 = 0;
        if (unlikely(__pyx_t_4 != -1)) {
          __Pyx_RaiseBufferIndexError(__pyx_t_4);
          {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7430; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_lindexer.rcbuffer->pybuffer.buf, __pyx_t_33, __pyx_pybuffernd_lindexer.diminfo[0].strides) = __pyx_v_i;

        /* "pandas/src/generated.pyx":7431
 *             elif lval < rval:
 *                 lindexer[count] = i
 *                 rindexer[count] = -1             # <<<<<<<<<<<<<<
 *                 result[count] = left[i]
 *                 count += 1
 */
        __pyx_t_34 = __pyx_v_count;
        __pyx_t_4 = -1;
        if (__pyx_t_34 < 0) {
          __pyx_t_34 += __pyx_pybuffernd_rindexer.diminfo[0].shape;
          if (unlikely(__pyx_t_34 < 0)) __pyx_t_4 = 0;
        } else if (unlikely(__pyx_t_34 >= __pyx_pybuffernd_rindexer.diminfo[0].shape)) __pyx_t_4 = 0;
        if (unlikely(__pyx_t_4 != -1)) {
          __Pyx_RaiseBufferIndexError(__pyx_t_4);
          {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7431; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_rindexer.rcbuffer->pybuffer.buf, __pyx_t_34, __pyx_pybuffernd_rindexer.diminfo[0].strides) = -1;

        /* "pandas/src/generated.pyx":7432
 *                 lindexer[count] = i
 *                 rindexer[count] = -1
 *                 result[count] = left[i]             # <<<<<<<<<<<<<<
 *                 count += 1
 *                 i += 1
 */
        __pyx_t_35 = __pyx_v_i;
        __pyx_t_4 = -1;
        if (__pyx_t_35 < 0) {
          __pyx_t_35 += __pyx_pybuffernd_left.diminfo[0].shape;
          if (unlikely(__pyx_t_35 < 0)) __pyx_t_4 = 0;
        } else if (unlikely(__pyx_t_35 >= __pyx_pybuffernd_left.diminfo[0].shape)) __pyx_t_4 = 0;
        if (unlikely(__pyx_t_4 != -1)) {
          __Pyx_RaiseBufferIndexError(__pyx_t_4);
          {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7432; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        __pyx_t_13 = (PyObject *) *__Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_left.rcbuffer->pybuffer.buf, __pyx_t_35, __pyx_pybuffernd_left.diminfo[0].strides);
        __Pyx_INCREF((PyObject*)__pyx_t_13);
        __pyx_t_36 = __pyx_v_count;
        __pyx_t_4 = -1;
        if (__pyx_t_36 < 0) {
          __pyx_t_36 += __pyx_pybuffernd_result.diminfo[0].shape;
          if (unlikely(__pyx_t_36 < 0)) __pyx_t_4 = 0;
        } else if (unlikely(__pyx_t_36 >= __pyx_pybuffernd_result.diminfo[0].shape)) __pyx_t_4 = 0;
        if (unlikely(__pyx_t_4 != -1)) {
          __Pyx_RaiseBufferIndexError(__pyx_t_4);
          {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7432; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        __pyx_t_24 = __Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_36, __pyx_pybuffernd_result.diminfo[0].strides);
        __Pyx_GOTREF(*__pyx_t_24);
        __Pyx_INCREF(__pyx_t_13); __Pyx_DECREF(*__pyx_t_24);
        *__pyx_t_24 = __pyx_t_13;
        __Pyx_GIVEREF(*__pyx_t_24);
        __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

        /* "pandas/src/generated.pyx":7433
 *                 rindexer[count] = -1
 *                 result[count] = left[i]
 *                 count += 1             # <<<<<<<<<<<<<<
 *                 i += 1
 *             else:
 */
        __pyx_v_count = (__pyx_v_count + 1);

        /* "pandas/src/generated.pyx":7434
 *                 result[count] = left[i]
 *                 count += 1
 *                 i += 1             # <<<<<<<<<<<<<<
 *             else:
 *                 j += 1
 */
        __pyx_v_i = (__pyx_v_i + 1);
        goto __pyx_L18;
      }
      /*else*/ {

        /* "pandas/src/generated.pyx":7436
 *                 i += 1
 *             else:
 *                 j += 1             # <<<<<<<<<<<<<<
 * 
 *     return result, lindexer, rindexer
 */
        __pyx_v_j = (__pyx_v_j + 1);
      }
      __pyx_L18:;
    }
    __pyx_L14_break:;
    goto __pyx_L12;
  }
  __pyx_L12:;

  /* "pandas/src/generated.pyx":7438
 *                 j += 1
 * 
 *     return result, lindexer, rindexer             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_13 = PyTuple_New(3); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7438; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_13);
  __Pyx_INCREF(((PyObject *)__pyx_v_result));
  PyTuple_SET_ITEM(__pyx_t_13, 0, ((PyObject *)__pyx_v_result));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_result));
  __Pyx_INCREF(((PyObject *)__pyx_v_lindexer));
  PyTuple_SET_ITEM(__pyx_t_13, 1, ((PyObject *)__pyx_v_lindexer));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_lindexer));
  __Pyx_INCREF(((PyObject *)__pyx_v_rindexer));
  PyTuple_SET_ITEM(__pyx_t_13, 2, ((PyObject *)__pyx_v_rindexer));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_rindexer));
  __pyx_r = __pyx_t_13;
  __pyx_t_13 = 0;
  goto __pyx_L0;

  /* "pandas/src/generated.pyx":7339
 * 
 * 
 * def left_join_indexer_object(ndarray[object] left,             # <<<<<<<<<<<<<<
 *                               ndarray[object] right):
 *     '''
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_12);
  __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_pybuffernd_left.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_lindexer.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_right.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_rindexer.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas.algos.left_join_indexer_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_left.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_lindexer.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_right.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_rindexer.rcbuffer->pybuffer);
  __pyx_L2:;
  __Pyx_XDECREF(__pyx_v_lval);
  __Pyx_XDECREF(__pyx_v_rval);
  __Pyx_XDECREF((PyObject *)__pyx_v_lindexer);
  __Pyx_XDECREF((PyObject *)__pyx_v_rindexer);
  __Pyx_XDECREF((PyObject *)__pyx_v_result);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/src/generated.pyx":7441
 * 
 * 
 * def left_join_indexer_int32(ndarray[int32_t] left,             # <<<<<<<<<<<<<<
 *                               ndarray[int32_t] right):
 *     '''
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pandas_5algos_487left_join_indexer_int32(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6pandas_5algos_486left_join_indexer_int32[] = "\n    Two-pass algorithm for monotonic indexes. Handles many-to-one merges\n    ";
static PyMethodDef __pyx_mdef_6pandas_5algos_487left_join_indexer_int32 = {__Pyx_NAMESTR("left_join_indexer_int32"), (PyCFunction)__pyx_pw_6pandas_5algos_487left_join_indexer_int32, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6pandas_5algos_486left_join_indexer_int32)};
static PyObject *__pyx_pw_6pandas_5algos_487left_join_indexer_int32(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyArrayObject *__pyx_v_left = 0;
  PyArrayObject *__pyx_v_right = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("left_join_indexer_int32 (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_left,&__pyx_n_s_right,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_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 (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_left)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_right)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("left_join_indexer_int32", 1, 2, 2, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7441; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "left_join_indexer_int32") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7441; __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("left_join_indexer_int32", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7441; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas.algos.left_join_indexer_int32", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_left), __pyx_ptype_5numpy_ndarray, 1, "left", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7441; __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[2]; __pyx_lineno = 7442; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_486left_join_indexer_int32(__pyx_self, __pyx_v_left, __pyx_v_right);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pandas_5algos_486left_join_indexer_int32(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_left, PyArrayObject *__pyx_v_right) {
  Py_ssize_t __pyx_v_i;
  Py_ssize_t __pyx_v_j;
  Py_ssize_t __pyx_v_nright;
  Py_ssize_t __pyx_v_nleft;
  Py_ssize_t __pyx_v_count;
  __pyx_t_5numpy_int32_t __pyx_v_lval;
  __pyx_t_5numpy_int32_t __pyx_v_rval;
  PyArrayObject *__pyx_v_lindexer = 0;
  PyArrayObject *__pyx_v_rindexer = 0;
  PyArrayObject *__pyx_v_result = 0;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_left;
  __Pyx_Buffer __pyx_pybuffer_left;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_lindexer;
  __Pyx_Buffer __pyx_pybuffer_lindexer;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_result;
  __Pyx_Buffer __pyx_pybuffer_result;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_right;
  __Pyx_Buffer __pyx_pybuffer_right;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_rindexer;
  __Pyx_Buffer __pyx_pybuffer_rindexer;
  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;
  int __pyx_t_6;
  int __pyx_t_7;
  Py_ssize_t __pyx_t_8;
  Py_ssize_t __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;
  PyObject *__pyx_t_16 = NULL;
  PyObject *__pyx_t_17 = NULL;
  PyObject *__pyx_t_18 = NULL;
  PyArrayObject *__pyx_t_19 = NULL;
  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;
  __Pyx_RefNannySetupContext("left_join_indexer_int32", 0);
  __pyx_pybuffer_lindexer.pybuffer.buf = NULL;
  __pyx_pybuffer_lindexer.refcount = 0;
  __pyx_pybuffernd_lindexer.data = NULL;
  __pyx_pybuffernd_lindexer.rcbuffer = &__pyx_pybuffer_lindexer;
  __pyx_pybuffer_rindexer.pybuffer.buf = NULL;
  __pyx_pybuffer_rindexer.refcount = 0;
  __pyx_pybuffernd_rindexer.data = NULL;
  __pyx_pybuffernd_rindexer.rcbuffer = &__pyx_pybuffer_rindexer;
  __pyx_pybuffer_result.pybuffer.buf = NULL;
  __pyx_pybuffer_result.refcount = 0;
  __pyx_pybuffernd_result.data = NULL;
  __pyx_pybuffernd_result.rcbuffer = &__pyx_pybuffer_result;
  __pyx_pybuffer_left.pybuffer.buf = NULL;
  __pyx_pybuffer_left.refcount = 0;
  __pyx_pybuffernd_left.data = NULL;
  __pyx_pybuffernd_left.rcbuffer = &__pyx_pybuffer_left;
  __pyx_pybuffer_right.pybuffer.buf = NULL;
  __pyx_pybuffer_right.refcount = 0;
  __pyx_pybuffernd_right.data = NULL;
  __pyx_pybuffernd_right.rcbuffer = &__pyx_pybuffer_right;
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_left.rcbuffer->pybuffer, (PyObject*)__pyx_v_left, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7441; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_left.diminfo[0].strides = __pyx_pybuffernd_left.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_left.diminfo[0].shape = __pyx_pybuffernd_left.rcbuffer->pybuffer.shape[0];
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_right.rcbuffer->pybuffer, (PyObject*)__pyx_v_right, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7441; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_right.diminfo[0].strides = __pyx_pybuffernd_right.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_right.diminfo[0].shape = __pyx_pybuffernd_right.rcbuffer->pybuffer.shape[0];

  /* "pandas/src/generated.pyx":7452
 *         ndarray[int32_t] result
 * 
 *     nleft = len(left)             # <<<<<<<<<<<<<<
 *     nright = len(right)
 * 
 */
  __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_left)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7452; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_nleft = __pyx_t_1;

  /* "pandas/src/generated.pyx":7453
 * 
 *     nleft = len(left)
 *     nright = len(right)             # <<<<<<<<<<<<<<
 * 
 *     i = 0
 */
  __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_right)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7453; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_nright = __pyx_t_1;

  /* "pandas/src/generated.pyx":7455
 *     nright = len(right)
 * 
 *     i = 0             # <<<<<<<<<<<<<<
 *     j = 0
 *     count = 0
 */
  __pyx_v_i = 0;

  /* "pandas/src/generated.pyx":7456
 * 
 *     i = 0
 *     j = 0             # <<<<<<<<<<<<<<
 *     count = 0
 *     if nleft > 0:
 */
  __pyx_v_j = 0;

  /* "pandas/src/generated.pyx":7457
 *     i = 0
 *     j = 0
 *     count = 0             # <<<<<<<<<<<<<<
 *     if nleft > 0:
 *         while i < nleft:
 */
  __pyx_v_count = 0;

  /* "pandas/src/generated.pyx":7458
 *     j = 0
 *     count = 0
 *     if nleft > 0:             # <<<<<<<<<<<<<<
 *         while i < nleft:
 *             if j == nright:
 */
  __pyx_t_2 = ((__pyx_v_nleft > 0) != 0);
  if (__pyx_t_2) {

    /* "pandas/src/generated.pyx":7459
 *     count = 0
 *     if nleft > 0:
 *         while i < nleft:             # <<<<<<<<<<<<<<
 *             if j == nright:
 *                 count += nleft - i
 */
    while (1) {
      __pyx_t_2 = ((__pyx_v_i < __pyx_v_nleft) != 0);
      if (!__pyx_t_2) break;

      /* "pandas/src/generated.pyx":7460
 *     if nleft > 0:
 *         while i < nleft:
 *             if j == nright:             # <<<<<<<<<<<<<<
 *                 count += nleft - i
 *                 break
 */
      __pyx_t_2 = ((__pyx_v_j == __pyx_v_nright) != 0);
      if (__pyx_t_2) {

        /* "pandas/src/generated.pyx":7461
 *         while i < nleft:
 *             if j == nright:
 *                 count += nleft - i             # <<<<<<<<<<<<<<
 *                 break
 * 
 */
        __pyx_v_count = (__pyx_v_count + (__pyx_v_nleft - __pyx_v_i));

        /* "pandas/src/generated.pyx":7462
 *             if j == nright:
 *                 count += nleft - i
 *                 break             # <<<<<<<<<<<<<<
 * 
 *             lval = left[i]
 */
        goto __pyx_L5_break;
      }

      /* "pandas/src/generated.pyx":7464
 *                 break
 * 
 *             lval = left[i]             # <<<<<<<<<<<<<<
 *             rval = right[j]
 * 
 */
      __pyx_t_1 = __pyx_v_i;
      __pyx_t_3 = -1;
      if (__pyx_t_1 < 0) {
        __pyx_t_1 += __pyx_pybuffernd_left.diminfo[0].shape;
        if (unlikely(__pyx_t_1 < 0)) __pyx_t_3 = 0;
      } else if (unlikely(__pyx_t_1 >= __pyx_pybuffernd_left.diminfo[0].shape)) __pyx_t_3 = 0;
      if (unlikely(__pyx_t_3 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_3);
        {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7464; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_v_lval = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_left.rcbuffer->pybuffer.buf, __pyx_t_1, __pyx_pybuffernd_left.diminfo[0].strides));

      /* "pandas/src/generated.pyx":7465
 * 
 *             lval = left[i]
 *             rval = right[j]             # <<<<<<<<<<<<<<
 * 
 *             if lval == rval:
 */
      __pyx_t_4 = __pyx_v_j;
      __pyx_t_3 = -1;
      if (__pyx_t_4 < 0) {
        __pyx_t_4 += __pyx_pybuffernd_right.diminfo[0].shape;
        if (unlikely(__pyx_t_4 < 0)) __pyx_t_3 = 0;
      } else if (unlikely(__pyx_t_4 >= __pyx_pybuffernd_right.diminfo[0].shape)) __pyx_t_3 = 0;
      if (unlikely(__pyx_t_3 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_3);
        {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7465; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_v_rval = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_right.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_right.diminfo[0].strides));

      /* "pandas/src/generated.pyx":7467
 *             rval = right[j]
 * 
 *             if lval == rval:             # <<<<<<<<<<<<<<
 *                 count += 1
 *                 if i < nleft - 1:
 */
      __pyx_t_2 = ((__pyx_v_lval == __pyx_v_rval) != 0);
      if (__pyx_t_2) {

        /* "pandas/src/generated.pyx":7468
 * 
 *             if lval == rval:
 *                 count += 1             # <<<<<<<<<<<<<<
 *                 if i < nleft - 1:
 *                     if j < nright - 1 and right[j + 1] == rval:
 */
        __pyx_v_count = (__pyx_v_count + 1);

        /* "pandas/src/generated.pyx":7469
 *             if lval == rval:
 *                 count += 1
 *                 if i < nleft - 1:             # <<<<<<<<<<<<<<
 *                     if j < nright - 1 and right[j + 1] == rval:
 *                         j += 1
 */
        __pyx_t_2 = ((__pyx_v_i < (__pyx_v_nleft - 1)) != 0);
        if (__pyx_t_2) {

          /* "pandas/src/generated.pyx":7470
 *                 count += 1
 *                 if i < nleft - 1:
 *                     if j < nright - 1 and right[j + 1] == rval:             # <<<<<<<<<<<<<<
 *                         j += 1
 *                     else:
 */
          __pyx_t_2 = ((__pyx_v_j < (__pyx_v_nright - 1)) != 0);
          if (__pyx_t_2) {
            __pyx_t_5 = (__pyx_v_j + 1);
            __pyx_t_3 = -1;
            if (__pyx_t_5 < 0) {
              __pyx_t_5 += __pyx_pybuffernd_right.diminfo[0].shape;
              if (unlikely(__pyx_t_5 < 0)) __pyx_t_3 = 0;
            } else if (unlikely(__pyx_t_5 >= __pyx_pybuffernd_right.diminfo[0].shape)) __pyx_t_3 = 0;
            if (unlikely(__pyx_t_3 != -1)) {
              __Pyx_RaiseBufferIndexError(__pyx_t_3);
              {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7470; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            }
            __pyx_t_6 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_right.rcbuffer->pybuffer.buf, __pyx_t_5, __pyx_pybuffernd_right.diminfo[0].strides)) == __pyx_v_rval) != 0);
            __pyx_t_7 = __pyx_t_6;
          } else {
            __pyx_t_7 = __pyx_t_2;
          }
          if (__pyx_t_7) {

            /* "pandas/src/generated.pyx":7471
 *                 if i < nleft - 1:
 *                     if j < nright - 1 and right[j + 1] == rval:
 *                         j += 1             # <<<<<<<<<<<<<<
 *                     else:
 *                         i += 1
 */
            __pyx_v_j = (__pyx_v_j + 1);
            goto __pyx_L9;
          }
          /*else*/ {

            /* "pandas/src/generated.pyx":7473
 *                         j += 1
 *                     else:
 *                         i += 1             # <<<<<<<<<<<<<<
 *                         if left[i] != rval:
 *                             j += 1
 */
            __pyx_v_i = (__pyx_v_i + 1);

            /* "pandas/src/generated.pyx":7474
 *                     else:
 *                         i += 1
 *                         if left[i] != rval:             # <<<<<<<<<<<<<<
 *                             j += 1
 *                 elif j < nright - 1:
 */
            __pyx_t_8 = __pyx_v_i;
            __pyx_t_3 = -1;
            if (__pyx_t_8 < 0) {
              __pyx_t_8 += __pyx_pybuffernd_left.diminfo[0].shape;
              if (unlikely(__pyx_t_8 < 0)) __pyx_t_3 = 0;
            } else if (unlikely(__pyx_t_8 >= __pyx_pybuffernd_left.diminfo[0].shape)) __pyx_t_3 = 0;
            if (unlikely(__pyx_t_3 != -1)) {
              __Pyx_RaiseBufferIndexError(__pyx_t_3);
              {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7474; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            }
            __pyx_t_7 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_left.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_left.diminfo[0].strides)) != __pyx_v_rval) != 0);
            if (__pyx_t_7) {

              /* "pandas/src/generated.pyx":7475
 *                         i += 1
 *                         if left[i] != rval:
 *                             j += 1             # <<<<<<<<<<<<<<
 *                 elif j < nright - 1:
 *                     j += 1
 */
              __pyx_v_j = (__pyx_v_j + 1);
              goto __pyx_L10;
            }
            __pyx_L10:;
          }
          __pyx_L9:;
          goto __pyx_L8;
        }

        /* "pandas/src/generated.pyx":7476
 *                         if left[i] != rval:
 *                             j += 1
 *                 elif j < nright - 1:             # <<<<<<<<<<<<<<
 *                     j += 1
 *                     if lval != right[j]:
 */
        __pyx_t_7 = ((__pyx_v_j < (__pyx_v_nright - 1)) != 0);
        if (__pyx_t_7) {

          /* "pandas/src/generated.pyx":7477
 *                             j += 1
 *                 elif j < nright - 1:
 *                     j += 1             # <<<<<<<<<<<<<<
 *                     if lval != right[j]:
 *                         i += 1
 */
          __pyx_v_j = (__pyx_v_j + 1);

          /* "pandas/src/generated.pyx":7478
 *                 elif j < nright - 1:
 *                     j += 1
 *                     if lval != right[j]:             # <<<<<<<<<<<<<<
 *                         i += 1
 *                 else:
 */
          __pyx_t_9 = __pyx_v_j;
          __pyx_t_3 = -1;
          if (__pyx_t_9 < 0) {
            __pyx_t_9 += __pyx_pybuffernd_right.diminfo[0].shape;
            if (unlikely(__pyx_t_9 < 0)) __pyx_t_3 = 0;
          } else if (unlikely(__pyx_t_9 >= __pyx_pybuffernd_right.diminfo[0].shape)) __pyx_t_3 = 0;
          if (unlikely(__pyx_t_3 != -1)) {
            __Pyx_RaiseBufferIndexError(__pyx_t_3);
            {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7478; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          }
          __pyx_t_7 = ((__pyx_v_lval != (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_right.rcbuffer->pybuffer.buf, __pyx_t_9, __pyx_pybuffernd_right.diminfo[0].strides))) != 0);
          if (__pyx_t_7) {

            /* "pandas/src/generated.pyx":7479
 *                     j += 1
 *                     if lval != right[j]:
 *                         i += 1             # <<<<<<<<<<<<<<
 *                 else:
 *                     # end of the road
 */
            __pyx_v_i = (__pyx_v_i + 1);
            goto __pyx_L11;
          }
          __pyx_L11:;
          goto __pyx_L8;
        }
        /*else*/ {

          /* "pandas/src/generated.pyx":7482
 *                 else:
 *                     # end of the road
 *                     break             # <<<<<<<<<<<<<<
 *             elif lval < rval:
 *                 count += 1
 */
          goto __pyx_L5_break;
        }
        __pyx_L8:;
        goto __pyx_L7;
      }

      /* "pandas/src/generated.pyx":7483
 *                     # end of the road
 *                     break
 *             elif lval < rval:             # <<<<<<<<<<<<<<
 *                 count += 1
 *                 i += 1
 */
      __pyx_t_7 = ((__pyx_v_lval < __pyx_v_rval) != 0);
      if (__pyx_t_7) {

        /* "pandas/src/generated.pyx":7484
 *                     break
 *             elif lval < rval:
 *                 count += 1             # <<<<<<<<<<<<<<
 *                 i += 1
 *             else:
 */
        __pyx_v_count = (__pyx_v_count + 1);

        /* "pandas/src/generated.pyx":7485
 *             elif lval < rval:
 *                 count += 1
 *                 i += 1             # <<<<<<<<<<<<<<
 *             else:
 *                 j += 1
 */
        __pyx_v_i = (__pyx_v_i + 1);
        goto __pyx_L7;
      }
      /*else*/ {

        /* "pandas/src/generated.pyx":7487
 *                 i += 1
 *             else:
 *                 j += 1             # <<<<<<<<<<<<<<
 * 
 *     # do it again now that result size is known
 */
        __pyx_v_j = (__pyx_v_j + 1);
      }
      __pyx_L7:;
    }
    __pyx_L5_break:;
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "pandas/src/generated.pyx":7491
 *     # do it again now that result size is known
 * 
 *     lindexer = np.empty(count, dtype=np.int64)             # <<<<<<<<<<<<<<
 *     rindexer = np.empty(count, dtype=np.int64)
 *     result = np.empty(count, dtype=np.int32)
 */
  __pyx_t_10 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7491; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_10);
  __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_empty); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7491; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_11);
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  __pyx_t_10 = PyInt_FromSsize_t(__pyx_v_count); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7491; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_10);
  __pyx_t_12 = PyTuple_New(1); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7491; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_12);
  PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_10);
  __Pyx_GIVEREF(__pyx_t_10);
  __pyx_t_10 = 0;
  __pyx_t_10 = PyDict_New(); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7491; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_10);
  __pyx_t_13 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7491; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_13);
  __pyx_t_14 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_n_s_int64); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7491; __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_10, __pyx_n_s_dtype, __pyx_t_14) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7491; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  __pyx_t_14 = __Pyx_PyObject_Call(__pyx_t_11, __pyx_t_12, __pyx_t_10); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7491; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_14);
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  if (!(likely(((__pyx_t_14) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_14, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7491; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_15 = ((PyArrayObject *)__pyx_t_14);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_lindexer.rcbuffer->pybuffer);
    __pyx_t_3 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_lindexer.rcbuffer->pybuffer, (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_3 < 0)) {
      PyErr_Fetch(&__pyx_t_16, &__pyx_t_17, &__pyx_t_18);
      if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_lindexer.rcbuffer->pybuffer, (PyObject*)__pyx_v_lindexer, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {
        Py_XDECREF(__pyx_t_16); Py_XDECREF(__pyx_t_17); Py_XDECREF(__pyx_t_18);
        __Pyx_RaiseBufferFallbackError();
      } else {
        PyErr_Restore(__pyx_t_16, __pyx_t_17, __pyx_t_18);
      }
    }
    __pyx_pybuffernd_lindexer.diminfo[0].strides = __pyx_pybuffernd_lindexer.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_lindexer.diminfo[0].shape = __pyx_pybuffernd_lindexer.rcbuffer->pybuffer.shape[0];
    if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7491; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_15 = 0;
  __pyx_v_lindexer = ((PyArrayObject *)__pyx_t_14);
  __pyx_t_14 = 0;

  /* "pandas/src/generated.pyx":7492
 * 
 *     lindexer = np.empty(count, dtype=np.int64)
 *     rindexer = np.empty(count, dtype=np.int64)             # <<<<<<<<<<<<<<
 *     result = np.empty(count, dtype=np.int32)
 * 
 */
  __pyx_t_14 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7492; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_14);
  __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_14, __pyx_n_s_empty); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7492; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_10);
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  __pyx_t_14 = PyInt_FromSsize_t(__pyx_v_count); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7492; __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[2]; __pyx_lineno = 7492; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__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 = PyDict_New(); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7492; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_14);
  __pyx_t_11 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7492; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_11);
  __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_int64); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7492; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_13);
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  if (PyDict_SetItem(__pyx_t_14, __pyx_n_s_dtype, __pyx_t_13) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7492; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  __pyx_t_13 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_t_12, __pyx_t_14); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7492; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_13);
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
  __Pyx_DECREF(__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[2]; __pyx_lineno = 7492; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_15 = ((PyArrayObject *)__pyx_t_13);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_rindexer.rcbuffer->pybuffer);
    __pyx_t_3 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_rindexer.rcbuffer->pybuffer, (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_3 < 0)) {
      PyErr_Fetch(&__pyx_t_18, &__pyx_t_17, &__pyx_t_16);
      if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_rindexer.rcbuffer->pybuffer, (PyObject*)__pyx_v_rindexer, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {
        Py_XDECREF(__pyx_t_18); Py_XDECREF(__pyx_t_17); Py_XDECREF(__pyx_t_16);
        __Pyx_RaiseBufferFallbackError();
      } else {
        PyErr_Restore(__pyx_t_18, __pyx_t_17, __pyx_t_16);
      }
    }
    __pyx_pybuffernd_rindexer.diminfo[0].strides = __pyx_pybuffernd_rindexer.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_rindexer.diminfo[0].shape = __pyx_pybuffernd_rindexer.rcbuffer->pybuffer.shape[0];
    if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7492; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_15 = 0;
  __pyx_v_rindexer = ((PyArrayObject *)__pyx_t_13);
  __pyx_t_13 = 0;

  /* "pandas/src/generated.pyx":7493
 *     lindexer = np.empty(count, dtype=np.int64)
 *     rindexer = np.empty(count, dtype=np.int64)
 *     result = np.empty(count, dtype=np.int32)             # <<<<<<<<<<<<<<
 * 
 *     i = 0
 */
  __pyx_t_13 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7493; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_13);
  __pyx_t_14 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_n_s_empty); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7493; __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_count); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7493; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_13);
  __pyx_t_12 = PyTuple_New(1); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7493; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_12);
  PyTuple_SET_ITEM(__pyx_t_12, 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 = 7493; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_13);
  __pyx_t_10 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7493; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_10);
  __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_int32); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7493; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_11);
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  if (PyDict_SetItem(__pyx_t_13, __pyx_n_s_dtype, __pyx_t_11) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7493; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  __pyx_t_11 = __Pyx_PyObject_Call(__pyx_t_14, __pyx_t_12, __pyx_t_13); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7493; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_11);
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 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 = 7493; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_19 = ((PyArrayObject *)__pyx_t_11);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer);
    __pyx_t_3 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_result.rcbuffer->pybuffer, (PyObject*)__pyx_t_19, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack);
    if (unlikely(__pyx_t_3 < 0)) {
      PyErr_Fetch(&__pyx_t_16, &__pyx_t_17, &__pyx_t_18);
      if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_result.rcbuffer->pybuffer, (PyObject*)__pyx_v_result, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {
        Py_XDECREF(__pyx_t_16); Py_XDECREF(__pyx_t_17); Py_XDECREF(__pyx_t_18);
        __Pyx_RaiseBufferFallbackError();
      } else {
        PyErr_Restore(__pyx_t_16, __pyx_t_17, __pyx_t_18);
      }
    }
    __pyx_pybuffernd_result.diminfo[0].strides = __pyx_pybuffernd_result.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_result.diminfo[0].shape = __pyx_pybuffernd_result.rcbuffer->pybuffer.shape[0];
    if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7493; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_19 = 0;
  __pyx_v_result = ((PyArrayObject *)__pyx_t_11);
  __pyx_t_11 = 0;

  /* "pandas/src/generated.pyx":7495
 *     result = np.empty(count, dtype=np.int32)
 * 
 *     i = 0             # <<<<<<<<<<<<<<
 *     j = 0
 *     count = 0
 */
  __pyx_v_i = 0;

  /* "pandas/src/generated.pyx":7496
 * 
 *     i = 0
 *     j = 0             # <<<<<<<<<<<<<<
 *     count = 0
 *     if nleft > 0:
 */
  __pyx_v_j = 0;

  /* "pandas/src/generated.pyx":7497
 *     i = 0
 *     j = 0
 *     count = 0             # <<<<<<<<<<<<<<
 *     if nleft > 0:
 *         while i < nleft:
 */
  __pyx_v_count = 0;

  /* "pandas/src/generated.pyx":7498
 *     j = 0
 *     count = 0
 *     if nleft > 0:             # <<<<<<<<<<<<<<
 *         while i < nleft:
 *             if j == nright:
 */
  __pyx_t_7 = ((__pyx_v_nleft > 0) != 0);
  if (__pyx_t_7) {

    /* "pandas/src/generated.pyx":7499
 *     count = 0
 *     if nleft > 0:
 *         while i < nleft:             # <<<<<<<<<<<<<<
 *             if j == nright:
 *                 while i < nleft:
 */
    while (1) {
      __pyx_t_7 = ((__pyx_v_i < __pyx_v_nleft) != 0);
      if (!__pyx_t_7) break;

      /* "pandas/src/generated.pyx":7500
 *     if nleft > 0:
 *         while i < nleft:
 *             if j == nright:             # <<<<<<<<<<<<<<
 *                 while i < nleft:
 *                     lindexer[count] = i
 */
      __pyx_t_7 = ((__pyx_v_j == __pyx_v_nright) != 0);
      if (__pyx_t_7) {

        /* "pandas/src/generated.pyx":7501
 *         while i < nleft:
 *             if j == nright:
 *                 while i < nleft:             # <<<<<<<<<<<<<<
 *                     lindexer[count] = i
 *                     rindexer[count] = -1
 */
        while (1) {
          __pyx_t_7 = ((__pyx_v_i < __pyx_v_nleft) != 0);
          if (!__pyx_t_7) break;

          /* "pandas/src/generated.pyx":7502
 *             if j == nright:
 *                 while i < nleft:
 *                     lindexer[count] = i             # <<<<<<<<<<<<<<
 *                     rindexer[count] = -1
 *                     result[count] = left[i]
 */
          __pyx_t_20 = __pyx_v_count;
          __pyx_t_3 = -1;
          if (__pyx_t_20 < 0) {
            __pyx_t_20 += __pyx_pybuffernd_lindexer.diminfo[0].shape;
            if (unlikely(__pyx_t_20 < 0)) __pyx_t_3 = 0;
          } else if (unlikely(__pyx_t_20 >= __pyx_pybuffernd_lindexer.diminfo[0].shape)) __pyx_t_3 = 0;
          if (unlikely(__pyx_t_3 != -1)) {
            __Pyx_RaiseBufferIndexError(__pyx_t_3);
            {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7502; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          }
          *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_lindexer.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_lindexer.diminfo[0].strides) = __pyx_v_i;

          /* "pandas/src/generated.pyx":7503
 *                 while i < nleft:
 *                     lindexer[count] = i
 *                     rindexer[count] = -1             # <<<<<<<<<<<<<<
 *                     result[count] = left[i]
 *                     i += 1
 */
          __pyx_t_21 = __pyx_v_count;
          __pyx_t_3 = -1;
          if (__pyx_t_21 < 0) {
            __pyx_t_21 += __pyx_pybuffernd_rindexer.diminfo[0].shape;
            if (unlikely(__pyx_t_21 < 0)) __pyx_t_3 = 0;
          } else if (unlikely(__pyx_t_21 >= __pyx_pybuffernd_rindexer.diminfo[0].shape)) __pyx_t_3 = 0;
          if (unlikely(__pyx_t_3 != -1)) {
            __Pyx_RaiseBufferIndexError(__pyx_t_3);
            {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7503; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          }
          *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_rindexer.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_rindexer.diminfo[0].strides) = -1;

          /* "pandas/src/generated.pyx":7504
 *                     lindexer[count] = i
 *                     rindexer[count] = -1
 *                     result[count] = left[i]             # <<<<<<<<<<<<<<
 *                     i += 1
 *                     count += 1
 */
          __pyx_t_22 = __pyx_v_i;
          __pyx_t_3 = -1;
          if (__pyx_t_22 < 0) {
            __pyx_t_22 += __pyx_pybuffernd_left.diminfo[0].shape;
            if (unlikely(__pyx_t_22 < 0)) __pyx_t_3 = 0;
          } else if (unlikely(__pyx_t_22 >= __pyx_pybuffernd_left.diminfo[0].shape)) __pyx_t_3 = 0;
          if (unlikely(__pyx_t_3 != -1)) {
            __Pyx_RaiseBufferIndexError(__pyx_t_3);
            {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7504; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          }
          __pyx_t_23 = __pyx_v_count;
          __pyx_t_3 = -1;
          if (__pyx_t_23 < 0) {
            __pyx_t_23 += __pyx_pybuffernd_result.diminfo[0].shape;
            if (unlikely(__pyx_t_23 < 0)) __pyx_t_3 = 0;
          } else if (unlikely(__pyx_t_23 >= __pyx_pybuffernd_result.diminfo[0].shape)) __pyx_t_3 = 0;
          if (unlikely(__pyx_t_3 != -1)) {
            __Pyx_RaiseBufferIndexError(__pyx_t_3);
            {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7504; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          }
          *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_23, __pyx_pybuffernd_result.diminfo[0].strides) = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_left.rcbuffer->pybuffer.buf, __pyx_t_22, __pyx_pybuffernd_left.diminfo[0].strides));

          /* "pandas/src/generated.pyx":7505
 *                     rindexer[count] = -1
 *                     result[count] = left[i]
 *                     i += 1             # <<<<<<<<<<<<<<
 *                     count += 1
 *                 break
 */
          __pyx_v_i = (__pyx_v_i + 1);

          /* "pandas/src/generated.pyx":7506
 *                     result[count] = left[i]
 *                     i += 1
 *                     count += 1             # <<<<<<<<<<<<<<
 *                 break
 * 
 */
          __pyx_v_count = (__pyx_v_count + 1);
        }

        /* "pandas/src/generated.pyx":7507
 *                     i += 1
 *                     count += 1
 *                 break             # <<<<<<<<<<<<<<
 * 
 *             lval = left[i]
 */
        goto __pyx_L14_break;
      }

      /* "pandas/src/generated.pyx":7509
 *                 break
 * 
 *             lval = left[i]             # <<<<<<<<<<<<<<
 *             rval = right[j]
 * 
 */
      __pyx_t_24 = __pyx_v_i;
      __pyx_t_3 = -1;
      if (__pyx_t_24 < 0) {
        __pyx_t_24 += __pyx_pybuffernd_left.diminfo[0].shape;
        if (unlikely(__pyx_t_24 < 0)) __pyx_t_3 = 0;
      } else if (unlikely(__pyx_t_24 >= __pyx_pybuffernd_left.diminfo[0].shape)) __pyx_t_3 = 0;
      if (unlikely(__pyx_t_3 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_3);
        {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7509; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_v_lval = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_left.rcbuffer->pybuffer.buf, __pyx_t_24, __pyx_pybuffernd_left.diminfo[0].strides));

      /* "pandas/src/generated.pyx":7510
 * 
 *             lval = left[i]
 *             rval = right[j]             # <<<<<<<<<<<<<<
 * 
 *             if lval == rval:
 */
      __pyx_t_25 = __pyx_v_j;
      __pyx_t_3 = -1;
      if (__pyx_t_25 < 0) {
        __pyx_t_25 += __pyx_pybuffernd_right.diminfo[0].shape;
        if (unlikely(__pyx_t_25 < 0)) __pyx_t_3 = 0;
      } else if (unlikely(__pyx_t_25 >= __pyx_pybuffernd_right.diminfo[0].shape)) __pyx_t_3 = 0;
      if (unlikely(__pyx_t_3 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_3);
        {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7510; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_v_rval = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_right.rcbuffer->pybuffer.buf, __pyx_t_25, __pyx_pybuffernd_right.diminfo[0].strides));

      /* "pandas/src/generated.pyx":7512
 *             rval = right[j]
 * 
 *             if lval == rval:             # <<<<<<<<<<<<<<
 *                 lindexer[count] = i
 *                 rindexer[count] = j
 */
      __pyx_t_7 = ((__pyx_v_lval == __pyx_v_rval) != 0);
      if (__pyx_t_7) {

        /* "pandas/src/generated.pyx":7513
 * 
 *             if lval == rval:
 *                 lindexer[count] = i             # <<<<<<<<<<<<<<
 *                 rindexer[count] = j
 *                 result[count] = lval
 */
        __pyx_t_26 = __pyx_v_count;
        __pyx_t_3 = -1;
        if (__pyx_t_26 < 0) {
          __pyx_t_26 += __pyx_pybuffernd_lindexer.diminfo[0].shape;
          if (unlikely(__pyx_t_26 < 0)) __pyx_t_3 = 0;
        } else if (unlikely(__pyx_t_26 >= __pyx_pybuffernd_lindexer.diminfo[0].shape)) __pyx_t_3 = 0;
        if (unlikely(__pyx_t_3 != -1)) {
          __Pyx_RaiseBufferIndexError(__pyx_t_3);
          {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7513; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_lindexer.rcbuffer->pybuffer.buf, __pyx_t_26, __pyx_pybuffernd_lindexer.diminfo[0].strides) = __pyx_v_i;

        /* "pandas/src/generated.pyx":7514
 *             if lval == rval:
 *                 lindexer[count] = i
 *                 rindexer[count] = j             # <<<<<<<<<<<<<<
 *                 result[count] = lval
 *                 count += 1
 */
        __pyx_t_27 = __pyx_v_count;
        __pyx_t_3 = -1;
        if (__pyx_t_27 < 0) {
          __pyx_t_27 += __pyx_pybuffernd_rindexer.diminfo[0].shape;
          if (unlikely(__pyx_t_27 < 0)) __pyx_t_3 = 0;
        } else if (unlikely(__pyx_t_27 >= __pyx_pybuffernd_rindexer.diminfo[0].shape)) __pyx_t_3 = 0;
        if (unlikely(__pyx_t_3 != -1)) {
          __Pyx_RaiseBufferIndexError(__pyx_t_3);
          {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7514; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_rindexer.rcbuffer->pybuffer.buf, __pyx_t_27, __pyx_pybuffernd_rindexer.diminfo[0].strides) = __pyx_v_j;

        /* "pandas/src/generated.pyx":7515
 *                 lindexer[count] = i
 *                 rindexer[count] = j
 *                 result[count] = lval             # <<<<<<<<<<<<<<
 *                 count += 1
 *                 if i < nleft - 1:
 */
        __pyx_t_28 = __pyx_v_count;
        __pyx_t_3 = -1;
        if (__pyx_t_28 < 0) {
          __pyx_t_28 += __pyx_pybuffernd_result.diminfo[0].shape;
          if (unlikely(__pyx_t_28 < 0)) __pyx_t_3 = 0;
        } else if (unlikely(__pyx_t_28 >= __pyx_pybuffernd_result.diminfo[0].shape)) __pyx_t_3 = 0;
        if (unlikely(__pyx_t_3 != -1)) {
          __Pyx_RaiseBufferIndexError(__pyx_t_3);
          {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7515; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_28, __pyx_pybuffernd_result.diminfo[0].strides) = __pyx_v_lval;

        /* "pandas/src/generated.pyx":7516
 *                 rindexer[count] = j
 *                 result[count] = lval
 *                 count += 1             # <<<<<<<<<<<<<<
 *                 if i < nleft - 1:
 *                     if j < nright - 1 and right[j + 1] == rval:
 */
        __pyx_v_count = (__pyx_v_count + 1);

        /* "pandas/src/generated.pyx":7517
 *                 result[count] = lval
 *                 count += 1
 *                 if i < nleft - 1:             # <<<<<<<<<<<<<<
 *                     if j < nright - 1 and right[j + 1] == rval:
 *                         j += 1
 */
        __pyx_t_7 = ((__pyx_v_i < (__pyx_v_nleft - 1)) != 0);
        if (__pyx_t_7) {

          /* "pandas/src/generated.pyx":7518
 *                 count += 1
 *                 if i < nleft - 1:
 *                     if j < nright - 1 and right[j + 1] == rval:             # <<<<<<<<<<<<<<
 *                         j += 1
 *                     else:
 */
          __pyx_t_7 = ((__pyx_v_j < (__pyx_v_nright - 1)) != 0);
          if (__pyx_t_7) {
            __pyx_t_29 = (__pyx_v_j + 1);
            __pyx_t_3 = -1;
            if (__pyx_t_29 < 0) {
              __pyx_t_29 += __pyx_pybuffernd_right.diminfo[0].shape;
              if (unlikely(__pyx_t_29 < 0)) __pyx_t_3 = 0;
            } else if (unlikely(__pyx_t_29 >= __pyx_pybuffernd_right.diminfo[0].shape)) __pyx_t_3 = 0;
            if (unlikely(__pyx_t_3 != -1)) {
              __Pyx_RaiseBufferIndexError(__pyx_t_3);
              {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7518; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            }
            __pyx_t_2 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_right.rcbuffer->pybuffer.buf, __pyx_t_29, __pyx_pybuffernd_right.diminfo[0].strides)) == __pyx_v_rval) != 0);
            __pyx_t_6 = __pyx_t_2;
          } else {
            __pyx_t_6 = __pyx_t_7;
          }
          if (__pyx_t_6) {

            /* "pandas/src/generated.pyx":7519
 *                 if i < nleft - 1:
 *                     if j < nright - 1 and right[j + 1] == rval:
 *                         j += 1             # <<<<<<<<<<<<<<
 *                     else:
 *                         i += 1
 */
            __pyx_v_j = (__pyx_v_j + 1);
            goto __pyx_L20;
          }
          /*else*/ {

            /* "pandas/src/generated.pyx":7521
 *                         j += 1
 *                     else:
 *                         i += 1             # <<<<<<<<<<<<<<
 *                         if left[i] != rval:
 *                             j += 1
 */
            __pyx_v_i = (__pyx_v_i + 1);

            /* "pandas/src/generated.pyx":7522
 *                     else:
 *                         i += 1
 *                         if left[i] != rval:             # <<<<<<<<<<<<<<
 *                             j += 1
 *                 elif j < nright - 1:
 */
            __pyx_t_30 = __pyx_v_i;
            __pyx_t_3 = -1;
            if (__pyx_t_30 < 0) {
              __pyx_t_30 += __pyx_pybuffernd_left.diminfo[0].shape;
              if (unlikely(__pyx_t_30 < 0)) __pyx_t_3 = 0;
            } else if (unlikely(__pyx_t_30 >= __pyx_pybuffernd_left.diminfo[0].shape)) __pyx_t_3 = 0;
            if (unlikely(__pyx_t_3 != -1)) {
              __Pyx_RaiseBufferIndexError(__pyx_t_3);
              {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7522; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            }
            __pyx_t_6 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_left.rcbuffer->pybuffer.buf, __pyx_t_30, __pyx_pybuffernd_left.diminfo[0].strides)) != __pyx_v_rval) != 0);
            if (__pyx_t_6) {

              /* "pandas/src/generated.pyx":7523
 *                         i += 1
 *                         if left[i] != rval:
 *                             j += 1             # <<<<<<<<<<<<<<
 *                 elif j < nright - 1:
 *                     j += 1
 */
              __pyx_v_j = (__pyx_v_j + 1);
              goto __pyx_L21;
            }
            __pyx_L21:;
          }
          __pyx_L20:;
          goto __pyx_L19;
        }

        /* "pandas/src/generated.pyx":7524
 *                         if left[i] != rval:
 *                             j += 1
 *                 elif j < nright - 1:             # <<<<<<<<<<<<<<
 *                     j += 1
 *                     if lval != right[j]:
 */
        __pyx_t_6 = ((__pyx_v_j < (__pyx_v_nright - 1)) != 0);
        if (__pyx_t_6) {

          /* "pandas/src/generated.pyx":7525
 *                             j += 1
 *                 elif j < nright - 1:
 *                     j += 1             # <<<<<<<<<<<<<<
 *                     if lval != right[j]:
 *                         i += 1
 */
          __pyx_v_j = (__pyx_v_j + 1);

          /* "pandas/src/generated.pyx":7526
 *                 elif j < nright - 1:
 *                     j += 1
 *                     if lval != right[j]:             # <<<<<<<<<<<<<<
 *                         i += 1
 *                 else:
 */
          __pyx_t_31 = __pyx_v_j;
          __pyx_t_3 = -1;
          if (__pyx_t_31 < 0) {
            __pyx_t_31 += __pyx_pybuffernd_right.diminfo[0].shape;
            if (unlikely(__pyx_t_31 < 0)) __pyx_t_3 = 0;
          } else if (unlikely(__pyx_t_31 >= __pyx_pybuffernd_right.diminfo[0].shape)) __pyx_t_3 = 0;
          if (unlikely(__pyx_t_3 != -1)) {
            __Pyx_RaiseBufferIndexError(__pyx_t_3);
            {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7526; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          }
          __pyx_t_6 = ((__pyx_v_lval != (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_right.rcbuffer->pybuffer.buf, __pyx_t_31, __pyx_pybuffernd_right.diminfo[0].strides))) != 0);
          if (__pyx_t_6) {

            /* "pandas/src/generated.pyx":7527
 *                     j += 1
 *                     if lval != right[j]:
 *                         i += 1             # <<<<<<<<<<<<<<
 *                 else:
 *                     # end of the road
 */
            __pyx_v_i = (__pyx_v_i + 1);
            goto __pyx_L22;
          }
          __pyx_L22:;
          goto __pyx_L19;
        }
        /*else*/ {

          /* "pandas/src/generated.pyx":7530
 *                 else:
 *                     # end of the road
 *                     break             # <<<<<<<<<<<<<<
 *             elif lval < rval:
 *                 lindexer[count] = i
 */
          goto __pyx_L14_break;
        }
        __pyx_L19:;
        goto __pyx_L18;
      }

      /* "pandas/src/generated.pyx":7531
 *                     # end of the road
 *                     break
 *             elif lval < rval:             # <<<<<<<<<<<<<<
 *                 lindexer[count] = i
 *                 rindexer[count] = -1
 */
      __pyx_t_6 = ((__pyx_v_lval < __pyx_v_rval) != 0);
      if (__pyx_t_6) {

        /* "pandas/src/generated.pyx":7532
 *                     break
 *             elif lval < rval:
 *                 lindexer[count] = i             # <<<<<<<<<<<<<<
 *                 rindexer[count] = -1
 *                 result[count] = left[i]
 */
        __pyx_t_32 = __pyx_v_count;
        __pyx_t_3 = -1;
        if (__pyx_t_32 < 0) {
          __pyx_t_32 += __pyx_pybuffernd_lindexer.diminfo[0].shape;
          if (unlikely(__pyx_t_32 < 0)) __pyx_t_3 = 0;
        } else if (unlikely(__pyx_t_32 >= __pyx_pybuffernd_lindexer.diminfo[0].shape)) __pyx_t_3 = 0;
        if (unlikely(__pyx_t_3 != -1)) {
          __Pyx_RaiseBufferIndexError(__pyx_t_3);
          {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7532; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_lindexer.rcbuffer->pybuffer.buf, __pyx_t_32, __pyx_pybuffernd_lindexer.diminfo[0].strides) = __pyx_v_i;

        /* "pandas/src/generated.pyx":7533
 *             elif lval < rval:
 *                 lindexer[count] = i
 *                 rindexer[count] = -1             # <<<<<<<<<<<<<<
 *                 result[count] = left[i]
 *                 count += 1
 */
        __pyx_t_33 = __pyx_v_count;
        __pyx_t_3 = -1;
        if (__pyx_t_33 < 0) {
          __pyx_t_33 += __pyx_pybuffernd_rindexer.diminfo[0].shape;
          if (unlikely(__pyx_t_33 < 0)) __pyx_t_3 = 0;
        } else if (unlikely(__pyx_t_33 >= __pyx_pybuffernd_rindexer.diminfo[0].shape)) __pyx_t_3 = 0;
        if (unlikely(__pyx_t_3 != -1)) {
          __Pyx_RaiseBufferIndexError(__pyx_t_3);
          {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7533; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_rindexer.rcbuffer->pybuffer.buf, __pyx_t_33, __pyx_pybuffernd_rindexer.diminfo[0].strides) = -1;

        /* "pandas/src/generated.pyx":7534
 *                 lindexer[count] = i
 *                 rindexer[count] = -1
 *                 result[count] = left[i]             # <<<<<<<<<<<<<<
 *                 count += 1
 *                 i += 1
 */
        __pyx_t_34 = __pyx_v_i;
        __pyx_t_3 = -1;
        if (__pyx_t_34 < 0) {
          __pyx_t_34 += __pyx_pybuffernd_left.diminfo[0].shape;
          if (unlikely(__pyx_t_34 < 0)) __pyx_t_3 = 0;
        } else if (unlikely(__pyx_t_34 >= __pyx_pybuffernd_left.diminfo[0].shape)) __pyx_t_3 = 0;
        if (unlikely(__pyx_t_3 != -1)) {
          __Pyx_RaiseBufferIndexError(__pyx_t_3);
          {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7534; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        __pyx_t_35 = __pyx_v_count;
        __pyx_t_3 = -1;
        if (__pyx_t_35 < 0) {
          __pyx_t_35 += __pyx_pybuffernd_result.diminfo[0].shape;
          if (unlikely(__pyx_t_35 < 0)) __pyx_t_3 = 0;
        } else if (unlikely(__pyx_t_35 >= __pyx_pybuffernd_result.diminfo[0].shape)) __pyx_t_3 = 0;
        if (unlikely(__pyx_t_3 != -1)) {
          __Pyx_RaiseBufferIndexError(__pyx_t_3);
          {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7534; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_35, __pyx_pybuffernd_result.diminfo[0].strides) = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_left.rcbuffer->pybuffer.buf, __pyx_t_34, __pyx_pybuffernd_left.diminfo[0].strides));

        /* "pandas/src/generated.pyx":7535
 *                 rindexer[count] = -1
 *                 result[count] = left[i]
 *                 count += 1             # <<<<<<<<<<<<<<
 *                 i += 1
 *             else:
 */
        __pyx_v_count = (__pyx_v_count + 1);

        /* "pandas/src/generated.pyx":7536
 *                 result[count] = left[i]
 *                 count += 1
 *                 i += 1             # <<<<<<<<<<<<<<
 *             else:
 *                 j += 1
 */
        __pyx_v_i = (__pyx_v_i + 1);
        goto __pyx_L18;
      }
      /*else*/ {

        /* "pandas/src/generated.pyx":7538
 *                 i += 1
 *             else:
 *                 j += 1             # <<<<<<<<<<<<<<
 * 
 *     return result, lindexer, rindexer
 */
        __pyx_v_j = (__pyx_v_j + 1);
      }
      __pyx_L18:;
    }
    __pyx_L14_break:;
    goto __pyx_L12;
  }
  __pyx_L12:;

  /* "pandas/src/generated.pyx":7540
 *                 j += 1
 * 
 *     return result, lindexer, rindexer             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_11 = PyTuple_New(3); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7540; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_11);
  __Pyx_INCREF(((PyObject *)__pyx_v_result));
  PyTuple_SET_ITEM(__pyx_t_11, 0, ((PyObject *)__pyx_v_result));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_result));
  __Pyx_INCREF(((PyObject *)__pyx_v_lindexer));
  PyTuple_SET_ITEM(__pyx_t_11, 1, ((PyObject *)__pyx_v_lindexer));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_lindexer));
  __Pyx_INCREF(((PyObject *)__pyx_v_rindexer));
  PyTuple_SET_ITEM(__pyx_t_11, 2, ((PyObject *)__pyx_v_rindexer));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_rindexer));
  __pyx_r = __pyx_t_11;
  __pyx_t_11 = 0;
  goto __pyx_L0;

  /* "pandas/src/generated.pyx":7441
 * 
 * 
 * def left_join_indexer_int32(ndarray[int32_t] left,             # <<<<<<<<<<<<<<
 *                               ndarray[int32_t] right):
 *     '''
 */

  /* function exit code */
  __pyx_L1_error:;
  __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);
  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
    __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_left.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_lindexer.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_right.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_rindexer.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas.algos.left_join_indexer_int32", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_left.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_lindexer.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_right.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_rindexer.rcbuffer->pybuffer);
  __pyx_L2:;
  __Pyx_XDECREF((PyObject *)__pyx_v_lindexer);
  __Pyx_XDECREF((PyObject *)__pyx_v_rindexer);
  __Pyx_XDECREF((PyObject *)__pyx_v_result);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/src/generated.pyx":7543
 * 
 * 
 * def left_join_indexer_int64(ndarray[int64_t] left,             # <<<<<<<<<<<<<<
 *                               ndarray[int64_t] right):
 *     '''
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pandas_5algos_489left_join_indexer_int64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6pandas_5algos_488left_join_indexer_int64[] = "\n    Two-pass algorithm for monotonic indexes. Handles many-to-one merges\n    ";
static PyMethodDef __pyx_mdef_6pandas_5algos_489left_join_indexer_int64 = {__Pyx_NAMESTR("left_join_indexer_int64"), (PyCFunction)__pyx_pw_6pandas_5algos_489left_join_indexer_int64, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6pandas_5algos_488left_join_indexer_int64)};
static PyObject *__pyx_pw_6pandas_5algos_489left_join_indexer_int64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyArrayObject *__pyx_v_left = 0;
  PyArrayObject *__pyx_v_right = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("left_join_indexer_int64 (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_left,&__pyx_n_s_right,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_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 (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_left)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_right)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("left_join_indexer_int64", 1, 2, 2, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7543; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "left_join_indexer_int64") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7543; __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("left_join_indexer_int64", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7543; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas.algos.left_join_indexer_int64", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_left), __pyx_ptype_5numpy_ndarray, 1, "left", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7543; __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[2]; __pyx_lineno = 7544; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_488left_join_indexer_int64(__pyx_self, __pyx_v_left, __pyx_v_right);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pandas_5algos_488left_join_indexer_int64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_left, PyArrayObject *__pyx_v_right) {
  Py_ssize_t __pyx_v_i;
  Py_ssize_t __pyx_v_j;
  Py_ssize_t __pyx_v_nright;
  Py_ssize_t __pyx_v_nleft;
  Py_ssize_t __pyx_v_count;
  __pyx_t_5numpy_int64_t __pyx_v_lval;
  __pyx_t_5numpy_int64_t __pyx_v_rval;
  PyArrayObject *__pyx_v_lindexer = 0;
  PyArrayObject *__pyx_v_rindexer = 0;
  PyArrayObject *__pyx_v_result = 0;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_left;
  __Pyx_Buffer __pyx_pybuffer_left;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_lindexer;
  __Pyx_Buffer __pyx_pybuffer_lindexer;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_result;
  __Pyx_Buffer __pyx_pybuffer_result;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_right;
  __Pyx_Buffer __pyx_pybuffer_right;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_rindexer;
  __Pyx_Buffer __pyx_pybuffer_rindexer;
  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;
  int __pyx_t_6;
  int __pyx_t_7;
  Py_ssize_t __pyx_t_8;
  Py_ssize_t __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;
  PyObject *__pyx_t_16 = NULL;
  PyObject *__pyx_t_17 = NULL;
  PyObject *__pyx_t_18 = NULL;
  PyArrayObject *__pyx_t_19 = NULL;
  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;
  __Pyx_RefNannySetupContext("left_join_indexer_int64", 0);
  __pyx_pybuffer_lindexer.pybuffer.buf = NULL;
  __pyx_pybuffer_lindexer.refcount = 0;
  __pyx_pybuffernd_lindexer.data = NULL;
  __pyx_pybuffernd_lindexer.rcbuffer = &__pyx_pybuffer_lindexer;
  __pyx_pybuffer_rindexer.pybuffer.buf = NULL;
  __pyx_pybuffer_rindexer.refcount = 0;
  __pyx_pybuffernd_rindexer.data = NULL;
  __pyx_pybuffernd_rindexer.rcbuffer = &__pyx_pybuffer_rindexer;
  __pyx_pybuffer_result.pybuffer.buf = NULL;
  __pyx_pybuffer_result.refcount = 0;
  __pyx_pybuffernd_result.data = NULL;
  __pyx_pybuffernd_result.rcbuffer = &__pyx_pybuffer_result;
  __pyx_pybuffer_left.pybuffer.buf = NULL;
  __pyx_pybuffer_left.refcount = 0;
  __pyx_pybuffernd_left.data = NULL;
  __pyx_pybuffernd_left.rcbuffer = &__pyx_pybuffer_left;
  __pyx_pybuffer_right.pybuffer.buf = NULL;
  __pyx_pybuffer_right.refcount = 0;
  __pyx_pybuffernd_right.data = NULL;
  __pyx_pybuffernd_right.rcbuffer = &__pyx_pybuffer_right;
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_left.rcbuffer->pybuffer, (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[2]; __pyx_lineno = 7543; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_left.diminfo[0].strides = __pyx_pybuffernd_left.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_left.diminfo[0].shape = __pyx_pybuffernd_left.rcbuffer->pybuffer.shape[0];
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_right.rcbuffer->pybuffer, (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[2]; __pyx_lineno = 7543; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_right.diminfo[0].strides = __pyx_pybuffernd_right.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_right.diminfo[0].shape = __pyx_pybuffernd_right.rcbuffer->pybuffer.shape[0];

  /* "pandas/src/generated.pyx":7554
 *         ndarray[int64_t] result
 * 
 *     nleft = len(left)             # <<<<<<<<<<<<<<
 *     nright = len(right)
 * 
 */
  __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_left)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7554; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_nleft = __pyx_t_1;

  /* "pandas/src/generated.pyx":7555
 * 
 *     nleft = len(left)
 *     nright = len(right)             # <<<<<<<<<<<<<<
 * 
 *     i = 0
 */
  __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_right)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7555; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_nright = __pyx_t_1;

  /* "pandas/src/generated.pyx":7557
 *     nright = len(right)
 * 
 *     i = 0             # <<<<<<<<<<<<<<
 *     j = 0
 *     count = 0
 */
  __pyx_v_i = 0;

  /* "pandas/src/generated.pyx":7558
 * 
 *     i = 0
 *     j = 0             # <<<<<<<<<<<<<<
 *     count = 0
 *     if nleft > 0:
 */
  __pyx_v_j = 0;

  /* "pandas/src/generated.pyx":7559
 *     i = 0
 *     j = 0
 *     count = 0             # <<<<<<<<<<<<<<
 *     if nleft > 0:
 *         while i < nleft:
 */
  __pyx_v_count = 0;

  /* "pandas/src/generated.pyx":7560
 *     j = 0
 *     count = 0
 *     if nleft > 0:             # <<<<<<<<<<<<<<
 *         while i < nleft:
 *             if j == nright:
 */
  __pyx_t_2 = ((__pyx_v_nleft > 0) != 0);
  if (__pyx_t_2) {

    /* "pandas/src/generated.pyx":7561
 *     count = 0
 *     if nleft > 0:
 *         while i < nleft:             # <<<<<<<<<<<<<<
 *             if j == nright:
 *                 count += nleft - i
 */
    while (1) {
      __pyx_t_2 = ((__pyx_v_i < __pyx_v_nleft) != 0);
      if (!__pyx_t_2) break;

      /* "pandas/src/generated.pyx":7562
 *     if nleft > 0:
 *         while i < nleft:
 *             if j == nright:             # <<<<<<<<<<<<<<
 *                 count += nleft - i
 *                 break
 */
      __pyx_t_2 = ((__pyx_v_j == __pyx_v_nright) != 0);
      if (__pyx_t_2) {

        /* "pandas/src/generated.pyx":7563
 *         while i < nleft:
 *             if j == nright:
 *                 count += nleft - i             # <<<<<<<<<<<<<<
 *                 break
 * 
 */
        __pyx_v_count = (__pyx_v_count + (__pyx_v_nleft - __pyx_v_i));

        /* "pandas/src/generated.pyx":7564
 *             if j == nright:
 *                 count += nleft - i
 *                 break             # <<<<<<<<<<<<<<
 * 
 *             lval = left[i]
 */
        goto __pyx_L5_break;
      }

      /* "pandas/src/generated.pyx":7566
 *                 break
 * 
 *             lval = left[i]             # <<<<<<<<<<<<<<
 *             rval = right[j]
 * 
 */
      __pyx_t_1 = __pyx_v_i;
      __pyx_t_3 = -1;
      if (__pyx_t_1 < 0) {
        __pyx_t_1 += __pyx_pybuffernd_left.diminfo[0].shape;
        if (unlikely(__pyx_t_1 < 0)) __pyx_t_3 = 0;
      } else if (unlikely(__pyx_t_1 >= __pyx_pybuffernd_left.diminfo[0].shape)) __pyx_t_3 = 0;
      if (unlikely(__pyx_t_3 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_3);
        {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7566; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_v_lval = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_left.rcbuffer->pybuffer.buf, __pyx_t_1, __pyx_pybuffernd_left.diminfo[0].strides));

      /* "pandas/src/generated.pyx":7567
 * 
 *             lval = left[i]
 *             rval = right[j]             # <<<<<<<<<<<<<<
 * 
 *             if lval == rval:
 */
      __pyx_t_4 = __pyx_v_j;
      __pyx_t_3 = -1;
      if (__pyx_t_4 < 0) {
        __pyx_t_4 += __pyx_pybuffernd_right.diminfo[0].shape;
        if (unlikely(__pyx_t_4 < 0)) __pyx_t_3 = 0;
      } else if (unlikely(__pyx_t_4 >= __pyx_pybuffernd_right.diminfo[0].shape)) __pyx_t_3 = 0;
      if (unlikely(__pyx_t_3 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_3);
        {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7567; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_v_rval = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_right.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_right.diminfo[0].strides));

      /* "pandas/src/generated.pyx":7569
 *             rval = right[j]
 * 
 *             if lval == rval:             # <<<<<<<<<<<<<<
 *                 count += 1
 *                 if i < nleft - 1:
 */
      __pyx_t_2 = ((__pyx_v_lval == __pyx_v_rval) != 0);
      if (__pyx_t_2) {

        /* "pandas/src/generated.pyx":7570
 * 
 *             if lval == rval:
 *                 count += 1             # <<<<<<<<<<<<<<
 *                 if i < nleft - 1:
 *                     if j < nright - 1 and right[j + 1] == rval:
 */
        __pyx_v_count = (__pyx_v_count + 1);

        /* "pandas/src/generated.pyx":7571
 *             if lval == rval:
 *                 count += 1
 *                 if i < nleft - 1:             # <<<<<<<<<<<<<<
 *                     if j < nright - 1 and right[j + 1] == rval:
 *                         j += 1
 */
        __pyx_t_2 = ((__pyx_v_i < (__pyx_v_nleft - 1)) != 0);
        if (__pyx_t_2) {

          /* "pandas/src/generated.pyx":7572
 *                 count += 1
 *                 if i < nleft - 1:
 *                     if j < nright - 1 and right[j + 1] == rval:             # <<<<<<<<<<<<<<
 *                         j += 1
 *                     else:
 */
          __pyx_t_2 = ((__pyx_v_j < (__pyx_v_nright - 1)) != 0);
          if (__pyx_t_2) {
            __pyx_t_5 = (__pyx_v_j + 1);
            __pyx_t_3 = -1;
            if (__pyx_t_5 < 0) {
              __pyx_t_5 += __pyx_pybuffernd_right.diminfo[0].shape;
              if (unlikely(__pyx_t_5 < 0)) __pyx_t_3 = 0;
            } else if (unlikely(__pyx_t_5 >= __pyx_pybuffernd_right.diminfo[0].shape)) __pyx_t_3 = 0;
            if (unlikely(__pyx_t_3 != -1)) {
              __Pyx_RaiseBufferIndexError(__pyx_t_3);
              {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7572; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            }
            __pyx_t_6 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_right.rcbuffer->pybuffer.buf, __pyx_t_5, __pyx_pybuffernd_right.diminfo[0].strides)) == __pyx_v_rval) != 0);
            __pyx_t_7 = __pyx_t_6;
          } else {
            __pyx_t_7 = __pyx_t_2;
          }
          if (__pyx_t_7) {

            /* "pandas/src/generated.pyx":7573
 *                 if i < nleft - 1:
 *                     if j < nright - 1 and right[j + 1] == rval:
 *                         j += 1             # <<<<<<<<<<<<<<
 *                     else:
 *                         i += 1
 */
            __pyx_v_j = (__pyx_v_j + 1);
            goto __pyx_L9;
          }
          /*else*/ {

            /* "pandas/src/generated.pyx":7575
 *                         j += 1
 *                     else:
 *                         i += 1             # <<<<<<<<<<<<<<
 *                         if left[i] != rval:
 *                             j += 1
 */
            __pyx_v_i = (__pyx_v_i + 1);

            /* "pandas/src/generated.pyx":7576
 *                     else:
 *                         i += 1
 *                         if left[i] != rval:             # <<<<<<<<<<<<<<
 *                             j += 1
 *                 elif j < nright - 1:
 */
            __pyx_t_8 = __pyx_v_i;
            __pyx_t_3 = -1;
            if (__pyx_t_8 < 0) {
              __pyx_t_8 += __pyx_pybuffernd_left.diminfo[0].shape;
              if (unlikely(__pyx_t_8 < 0)) __pyx_t_3 = 0;
            } else if (unlikely(__pyx_t_8 >= __pyx_pybuffernd_left.diminfo[0].shape)) __pyx_t_3 = 0;
            if (unlikely(__pyx_t_3 != -1)) {
              __Pyx_RaiseBufferIndexError(__pyx_t_3);
              {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7576; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            }
            __pyx_t_7 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_left.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_left.diminfo[0].strides)) != __pyx_v_rval) != 0);
            if (__pyx_t_7) {

              /* "pandas/src/generated.pyx":7577
 *                         i += 1
 *                         if left[i] != rval:
 *                             j += 1             # <<<<<<<<<<<<<<
 *                 elif j < nright - 1:
 *                     j += 1
 */
              __pyx_v_j = (__pyx_v_j + 1);
              goto __pyx_L10;
            }
            __pyx_L10:;
          }
          __pyx_L9:;
          goto __pyx_L8;
        }

        /* "pandas/src/generated.pyx":7578
 *                         if left[i] != rval:
 *                             j += 1
 *                 elif j < nright - 1:             # <<<<<<<<<<<<<<
 *                     j += 1
 *                     if lval != right[j]:
 */
        __pyx_t_7 = ((__pyx_v_j < (__pyx_v_nright - 1)) != 0);
        if (__pyx_t_7) {

          /* "pandas/src/generated.pyx":7579
 *                             j += 1
 *                 elif j < nright - 1:
 *                     j += 1             # <<<<<<<<<<<<<<
 *                     if lval != right[j]:
 *                         i += 1
 */
          __pyx_v_j = (__pyx_v_j + 1);

          /* "pandas/src/generated.pyx":7580
 *                 elif j < nright - 1:
 *                     j += 1
 *                     if lval != right[j]:             # <<<<<<<<<<<<<<
 *                         i += 1
 *                 else:
 */
          __pyx_t_9 = __pyx_v_j;
          __pyx_t_3 = -1;
          if (__pyx_t_9 < 0) {
            __pyx_t_9 += __pyx_pybuffernd_right.diminfo[0].shape;
            if (unlikely(__pyx_t_9 < 0)) __pyx_t_3 = 0;
          } else if (unlikely(__pyx_t_9 >= __pyx_pybuffernd_right.diminfo[0].shape)) __pyx_t_3 = 0;
          if (unlikely(__pyx_t_3 != -1)) {
            __Pyx_RaiseBufferIndexError(__pyx_t_3);
            {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7580; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          }
          __pyx_t_7 = ((__pyx_v_lval != (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_right.rcbuffer->pybuffer.buf, __pyx_t_9, __pyx_pybuffernd_right.diminfo[0].strides))) != 0);
          if (__pyx_t_7) {

            /* "pandas/src/generated.pyx":7581
 *                     j += 1
 *                     if lval != right[j]:
 *                         i += 1             # <<<<<<<<<<<<<<
 *                 else:
 *                     # end of the road
 */
            __pyx_v_i = (__pyx_v_i + 1);
            goto __pyx_L11;
          }
          __pyx_L11:;
          goto __pyx_L8;
        }
        /*else*/ {

          /* "pandas/src/generated.pyx":7584
 *                 else:
 *                     # end of the road
 *                     break             # <<<<<<<<<<<<<<
 *             elif lval < rval:
 *                 count += 1
 */
          goto __pyx_L5_break;
        }
        __pyx_L8:;
        goto __pyx_L7;
      }

      /* "pandas/src/generated.pyx":7585
 *                     # end of the road
 *                     break
 *             elif lval < rval:             # <<<<<<<<<<<<<<
 *                 count += 1
 *                 i += 1
 */
      __pyx_t_7 = ((__pyx_v_lval < __pyx_v_rval) != 0);
      if (__pyx_t_7) {

        /* "pandas/src/generated.pyx":7586
 *                     break
 *             elif lval < rval:
 *                 count += 1             # <<<<<<<<<<<<<<
 *                 i += 1
 *             else:
 */
        __pyx_v_count = (__pyx_v_count + 1);

        /* "pandas/src/generated.pyx":7587
 *             elif lval < rval:
 *                 count += 1
 *                 i += 1             # <<<<<<<<<<<<<<
 *             else:
 *                 j += 1
 */
        __pyx_v_i = (__pyx_v_i + 1);
        goto __pyx_L7;
      }
      /*else*/ {

        /* "pandas/src/generated.pyx":7589
 *                 i += 1
 *             else:
 *                 j += 1             # <<<<<<<<<<<<<<
 * 
 *     # do it again now that result size is known
 */
        __pyx_v_j = (__pyx_v_j + 1);
      }
      __pyx_L7:;
    }
    __pyx_L5_break:;
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "pandas/src/generated.pyx":7593
 *     # do it again now that result size is known
 * 
 *     lindexer = np.empty(count, dtype=np.int64)             # <<<<<<<<<<<<<<
 *     rindexer = np.empty(count, dtype=np.int64)
 *     result = np.empty(count, dtype=np.int64)
 */
  __pyx_t_10 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7593; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_10);
  __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_empty); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7593; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_11);
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  __pyx_t_10 = PyInt_FromSsize_t(__pyx_v_count); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7593; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_10);
  __pyx_t_12 = PyTuple_New(1); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7593; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_12);
  PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_10);
  __Pyx_GIVEREF(__pyx_t_10);
  __pyx_t_10 = 0;
  __pyx_t_10 = PyDict_New(); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7593; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_10);
  __pyx_t_13 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7593; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_13);
  __pyx_t_14 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_n_s_int64); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7593; __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_10, __pyx_n_s_dtype, __pyx_t_14) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7593; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  __pyx_t_14 = __Pyx_PyObject_Call(__pyx_t_11, __pyx_t_12, __pyx_t_10); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7593; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_14);
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  if (!(likely(((__pyx_t_14) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_14, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7593; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_15 = ((PyArrayObject *)__pyx_t_14);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_lindexer.rcbuffer->pybuffer);
    __pyx_t_3 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_lindexer.rcbuffer->pybuffer, (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_3 < 0)) {
      PyErr_Fetch(&__pyx_t_16, &__pyx_t_17, &__pyx_t_18);
      if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_lindexer.rcbuffer->pybuffer, (PyObject*)__pyx_v_lindexer, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {
        Py_XDECREF(__pyx_t_16); Py_XDECREF(__pyx_t_17); Py_XDECREF(__pyx_t_18);
        __Pyx_RaiseBufferFallbackError();
      } else {
        PyErr_Restore(__pyx_t_16, __pyx_t_17, __pyx_t_18);
      }
    }
    __pyx_pybuffernd_lindexer.diminfo[0].strides = __pyx_pybuffernd_lindexer.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_lindexer.diminfo[0].shape = __pyx_pybuffernd_lindexer.rcbuffer->pybuffer.shape[0];
    if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7593; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_15 = 0;
  __pyx_v_lindexer = ((PyArrayObject *)__pyx_t_14);
  __pyx_t_14 = 0;

  /* "pandas/src/generated.pyx":7594
 * 
 *     lindexer = np.empty(count, dtype=np.int64)
 *     rindexer = np.empty(count, dtype=np.int64)             # <<<<<<<<<<<<<<
 *     result = np.empty(count, dtype=np.int64)
 * 
 */
  __pyx_t_14 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7594; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_14);
  __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_14, __pyx_n_s_empty); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7594; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_10);
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  __pyx_t_14 = PyInt_FromSsize_t(__pyx_v_count); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7594; __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[2]; __pyx_lineno = 7594; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__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 = PyDict_New(); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7594; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_14);
  __pyx_t_11 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7594; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_11);
  __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_int64); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7594; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_13);
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  if (PyDict_SetItem(__pyx_t_14, __pyx_n_s_dtype, __pyx_t_13) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7594; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  __pyx_t_13 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_t_12, __pyx_t_14); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7594; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_13);
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
  __Pyx_DECREF(__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[2]; __pyx_lineno = 7594; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_15 = ((PyArrayObject *)__pyx_t_13);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_rindexer.rcbuffer->pybuffer);
    __pyx_t_3 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_rindexer.rcbuffer->pybuffer, (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_3 < 0)) {
      PyErr_Fetch(&__pyx_t_18, &__pyx_t_17, &__pyx_t_16);
      if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_rindexer.rcbuffer->pybuffer, (PyObject*)__pyx_v_rindexer, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {
        Py_XDECREF(__pyx_t_18); Py_XDECREF(__pyx_t_17); Py_XDECREF(__pyx_t_16);
        __Pyx_RaiseBufferFallbackError();
      } else {
        PyErr_Restore(__pyx_t_18, __pyx_t_17, __pyx_t_16);
      }
    }
    __pyx_pybuffernd_rindexer.diminfo[0].strides = __pyx_pybuffernd_rindexer.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_rindexer.diminfo[0].shape = __pyx_pybuffernd_rindexer.rcbuffer->pybuffer.shape[0];
    if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7594; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_15 = 0;
  __pyx_v_rindexer = ((PyArrayObject *)__pyx_t_13);
  __pyx_t_13 = 0;

  /* "pandas/src/generated.pyx":7595
 *     lindexer = np.empty(count, dtype=np.int64)
 *     rindexer = np.empty(count, dtype=np.int64)
 *     result = np.empty(count, dtype=np.int64)             # <<<<<<<<<<<<<<
 * 
 *     i = 0
 */
  __pyx_t_13 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7595; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_13);
  __pyx_t_14 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_n_s_empty); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7595; __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_count); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7595; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_13);
  __pyx_t_12 = PyTuple_New(1); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7595; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_12);
  PyTuple_SET_ITEM(__pyx_t_12, 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 = 7595; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_13);
  __pyx_t_10 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7595; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_10);
  __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_int64); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7595; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_11);
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  if (PyDict_SetItem(__pyx_t_13, __pyx_n_s_dtype, __pyx_t_11) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7595; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  __pyx_t_11 = __Pyx_PyObject_Call(__pyx_t_14, __pyx_t_12, __pyx_t_13); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7595; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_11);
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 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 = 7595; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_19 = ((PyArrayObject *)__pyx_t_11);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer);
    __pyx_t_3 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_result.rcbuffer->pybuffer, (PyObject*)__pyx_t_19, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack);
    if (unlikely(__pyx_t_3 < 0)) {
      PyErr_Fetch(&__pyx_t_16, &__pyx_t_17, &__pyx_t_18);
      if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_result.rcbuffer->pybuffer, (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_16); Py_XDECREF(__pyx_t_17); Py_XDECREF(__pyx_t_18);
        __Pyx_RaiseBufferFallbackError();
      } else {
        PyErr_Restore(__pyx_t_16, __pyx_t_17, __pyx_t_18);
      }
    }
    __pyx_pybuffernd_result.diminfo[0].strides = __pyx_pybuffernd_result.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_result.diminfo[0].shape = __pyx_pybuffernd_result.rcbuffer->pybuffer.shape[0];
    if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7595; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_19 = 0;
  __pyx_v_result = ((PyArrayObject *)__pyx_t_11);
  __pyx_t_11 = 0;

  /* "pandas/src/generated.pyx":7597
 *     result = np.empty(count, dtype=np.int64)
 * 
 *     i = 0             # <<<<<<<<<<<<<<
 *     j = 0
 *     count = 0
 */
  __pyx_v_i = 0;

  /* "pandas/src/generated.pyx":7598
 * 
 *     i = 0
 *     j = 0             # <<<<<<<<<<<<<<
 *     count = 0
 *     if nleft > 0:
 */
  __pyx_v_j = 0;

  /* "pandas/src/generated.pyx":7599
 *     i = 0
 *     j = 0
 *     count = 0             # <<<<<<<<<<<<<<
 *     if nleft > 0:
 *         while i < nleft:
 */
  __pyx_v_count = 0;

  /* "pandas/src/generated.pyx":7600
 *     j = 0
 *     count = 0
 *     if nleft > 0:             # <<<<<<<<<<<<<<
 *         while i < nleft:
 *             if j == nright:
 */
  __pyx_t_7 = ((__pyx_v_nleft > 0) != 0);
  if (__pyx_t_7) {

    /* "pandas/src/generated.pyx":7601
 *     count = 0
 *     if nleft > 0:
 *         while i < nleft:             # <<<<<<<<<<<<<<
 *             if j == nright:
 *                 while i < nleft:
 */
    while (1) {
      __pyx_t_7 = ((__pyx_v_i < __pyx_v_nleft) != 0);
      if (!__pyx_t_7) break;

      /* "pandas/src/generated.pyx":7602
 *     if nleft > 0:
 *         while i < nleft:
 *             if j == nright:             # <<<<<<<<<<<<<<
 *                 while i < nleft:
 *                     lindexer[count] = i
 */
      __pyx_t_7 = ((__pyx_v_j == __pyx_v_nright) != 0);
      if (__pyx_t_7) {

        /* "pandas/src/generated.pyx":7603
 *         while i < nleft:
 *             if j == nright:
 *                 while i < nleft:             # <<<<<<<<<<<<<<
 *                     lindexer[count] = i
 *                     rindexer[count] = -1
 */
        while (1) {
          __pyx_t_7 = ((__pyx_v_i < __pyx_v_nleft) != 0);
          if (!__pyx_t_7) break;

          /* "pandas/src/generated.pyx":7604
 *             if j == nright:
 *                 while i < nleft:
 *                     lindexer[count] = i             # <<<<<<<<<<<<<<
 *                     rindexer[count] = -1
 *                     result[count] = left[i]
 */
          __pyx_t_20 = __pyx_v_count;
          __pyx_t_3 = -1;
          if (__pyx_t_20 < 0) {
            __pyx_t_20 += __pyx_pybuffernd_lindexer.diminfo[0].shape;
            if (unlikely(__pyx_t_20 < 0)) __pyx_t_3 = 0;
          } else if (unlikely(__pyx_t_20 >= __pyx_pybuffernd_lindexer.diminfo[0].shape)) __pyx_t_3 = 0;
          if (unlikely(__pyx_t_3 != -1)) {
            __Pyx_RaiseBufferIndexError(__pyx_t_3);
            {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7604; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          }
          *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_lindexer.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_lindexer.diminfo[0].strides) = __pyx_v_i;

          /* "pandas/src/generated.pyx":7605
 *                 while i < nleft:
 *                     lindexer[count] = i
 *                     rindexer[count] = -1             # <<<<<<<<<<<<<<
 *                     result[count] = left[i]
 *                     i += 1
 */
          __pyx_t_21 = __pyx_v_count;
          __pyx_t_3 = -1;
          if (__pyx_t_21 < 0) {
            __pyx_t_21 += __pyx_pybuffernd_rindexer.diminfo[0].shape;
            if (unlikely(__pyx_t_21 < 0)) __pyx_t_3 = 0;
          } else if (unlikely(__pyx_t_21 >= __pyx_pybuffernd_rindexer.diminfo[0].shape)) __pyx_t_3 = 0;
          if (unlikely(__pyx_t_3 != -1)) {
            __Pyx_RaiseBufferIndexError(__pyx_t_3);
            {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7605; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          }
          *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_rindexer.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_rindexer.diminfo[0].strides) = -1;

          /* "pandas/src/generated.pyx":7606
 *                     lindexer[count] = i
 *                     rindexer[count] = -1
 *                     result[count] = left[i]             # <<<<<<<<<<<<<<
 *                     i += 1
 *                     count += 1
 */
          __pyx_t_22 = __pyx_v_i;
          __pyx_t_3 = -1;
          if (__pyx_t_22 < 0) {
            __pyx_t_22 += __pyx_pybuffernd_left.diminfo[0].shape;
            if (unlikely(__pyx_t_22 < 0)) __pyx_t_3 = 0;
          } else if (unlikely(__pyx_t_22 >= __pyx_pybuffernd_left.diminfo[0].shape)) __pyx_t_3 = 0;
          if (unlikely(__pyx_t_3 != -1)) {
            __Pyx_RaiseBufferIndexError(__pyx_t_3);
            {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7606; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          }
          __pyx_t_23 = __pyx_v_count;
          __pyx_t_3 = -1;
          if (__pyx_t_23 < 0) {
            __pyx_t_23 += __pyx_pybuffernd_result.diminfo[0].shape;
            if (unlikely(__pyx_t_23 < 0)) __pyx_t_3 = 0;
          } else if (unlikely(__pyx_t_23 >= __pyx_pybuffernd_result.diminfo[0].shape)) __pyx_t_3 = 0;
          if (unlikely(__pyx_t_3 != -1)) {
            __Pyx_RaiseBufferIndexError(__pyx_t_3);
            {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7606; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          }
          *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_23, __pyx_pybuffernd_result.diminfo[0].strides) = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_left.rcbuffer->pybuffer.buf, __pyx_t_22, __pyx_pybuffernd_left.diminfo[0].strides));

          /* "pandas/src/generated.pyx":7607
 *                     rindexer[count] = -1
 *                     result[count] = left[i]
 *                     i += 1             # <<<<<<<<<<<<<<
 *                     count += 1
 *                 break
 */
          __pyx_v_i = (__pyx_v_i + 1);

          /* "pandas/src/generated.pyx":7608
 *                     result[count] = left[i]
 *                     i += 1
 *                     count += 1             # <<<<<<<<<<<<<<
 *                 break
 * 
 */
          __pyx_v_count = (__pyx_v_count + 1);
        }

        /* "pandas/src/generated.pyx":7609
 *                     i += 1
 *                     count += 1
 *                 break             # <<<<<<<<<<<<<<
 * 
 *             lval = left[i]
 */
        goto __pyx_L14_break;
      }

      /* "pandas/src/generated.pyx":7611
 *                 break
 * 
 *             lval = left[i]             # <<<<<<<<<<<<<<
 *             rval = right[j]
 * 
 */
      __pyx_t_24 = __pyx_v_i;
      __pyx_t_3 = -1;
      if (__pyx_t_24 < 0) {
        __pyx_t_24 += __pyx_pybuffernd_left.diminfo[0].shape;
        if (unlikely(__pyx_t_24 < 0)) __pyx_t_3 = 0;
      } else if (unlikely(__pyx_t_24 >= __pyx_pybuffernd_left.diminfo[0].shape)) __pyx_t_3 = 0;
      if (unlikely(__pyx_t_3 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_3);
        {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7611; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_v_lval = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_left.rcbuffer->pybuffer.buf, __pyx_t_24, __pyx_pybuffernd_left.diminfo[0].strides));

      /* "pandas/src/generated.pyx":7612
 * 
 *             lval = left[i]
 *             rval = right[j]             # <<<<<<<<<<<<<<
 * 
 *             if lval == rval:
 */
      __pyx_t_25 = __pyx_v_j;
      __pyx_t_3 = -1;
      if (__pyx_t_25 < 0) {
        __pyx_t_25 += __pyx_pybuffernd_right.diminfo[0].shape;
        if (unlikely(__pyx_t_25 < 0)) __pyx_t_3 = 0;
      } else if (unlikely(__pyx_t_25 >= __pyx_pybuffernd_right.diminfo[0].shape)) __pyx_t_3 = 0;
      if (unlikely(__pyx_t_3 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_3);
        {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7612; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_v_rval = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_right.rcbuffer->pybuffer.buf, __pyx_t_25, __pyx_pybuffernd_right.diminfo[0].strides));

      /* "pandas/src/generated.pyx":7614
 *             rval = right[j]
 * 
 *             if lval == rval:             # <<<<<<<<<<<<<<
 *                 lindexer[count] = i
 *                 rindexer[count] = j
 */
      __pyx_t_7 = ((__pyx_v_lval == __pyx_v_rval) != 0);
      if (__pyx_t_7) {

        /* "pandas/src/generated.pyx":7615
 * 
 *             if lval == rval:
 *                 lindexer[count] = i             # <<<<<<<<<<<<<<
 *                 rindexer[count] = j
 *                 result[count] = lval
 */
        __pyx_t_26 = __pyx_v_count;
        __pyx_t_3 = -1;
        if (__pyx_t_26 < 0) {
          __pyx_t_26 += __pyx_pybuffernd_lindexer.diminfo[0].shape;
          if (unlikely(__pyx_t_26 < 0)) __pyx_t_3 = 0;
        } else if (unlikely(__pyx_t_26 >= __pyx_pybuffernd_lindexer.diminfo[0].shape)) __pyx_t_3 = 0;
        if (unlikely(__pyx_t_3 != -1)) {
          __Pyx_RaiseBufferIndexError(__pyx_t_3);
          {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7615; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_lindexer.rcbuffer->pybuffer.buf, __pyx_t_26, __pyx_pybuffernd_lindexer.diminfo[0].strides) = __pyx_v_i;

        /* "pandas/src/generated.pyx":7616
 *             if lval == rval:
 *                 lindexer[count] = i
 *                 rindexer[count] = j             # <<<<<<<<<<<<<<
 *                 result[count] = lval
 *                 count += 1
 */
        __pyx_t_27 = __pyx_v_count;
        __pyx_t_3 = -1;
        if (__pyx_t_27 < 0) {
          __pyx_t_27 += __pyx_pybuffernd_rindexer.diminfo[0].shape;
          if (unlikely(__pyx_t_27 < 0)) __pyx_t_3 = 0;
        } else if (unlikely(__pyx_t_27 >= __pyx_pybuffernd_rindexer.diminfo[0].shape)) __pyx_t_3 = 0;
        if (unlikely(__pyx_t_3 != -1)) {
          __Pyx_RaiseBufferIndexError(__pyx_t_3);
          {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7616; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_rindexer.rcbuffer->pybuffer.buf, __pyx_t_27, __pyx_pybuffernd_rindexer.diminfo[0].strides) = __pyx_v_j;

        /* "pandas/src/generated.pyx":7617
 *                 lindexer[count] = i
 *                 rindexer[count] = j
 *                 result[count] = lval             # <<<<<<<<<<<<<<
 *                 count += 1
 *                 if i < nleft - 1:
 */
        __pyx_t_28 = __pyx_v_count;
        __pyx_t_3 = -1;
        if (__pyx_t_28 < 0) {
          __pyx_t_28 += __pyx_pybuffernd_result.diminfo[0].shape;
          if (unlikely(__pyx_t_28 < 0)) __pyx_t_3 = 0;
        } else if (unlikely(__pyx_t_28 >= __pyx_pybuffernd_result.diminfo[0].shape)) __pyx_t_3 = 0;
        if (unlikely(__pyx_t_3 != -1)) {
          __Pyx_RaiseBufferIndexError(__pyx_t_3);
          {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7617; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_28, __pyx_pybuffernd_result.diminfo[0].strides) = __pyx_v_lval;

        /* "pandas/src/generated.pyx":7618
 *                 rindexer[count] = j
 *                 result[count] = lval
 *                 count += 1             # <<<<<<<<<<<<<<
 *                 if i < nleft - 1:
 *                     if j < nright - 1 and right[j + 1] == rval:
 */
        __pyx_v_count = (__pyx_v_count + 1);

        /* "pandas/src/generated.pyx":7619
 *                 result[count] = lval
 *                 count += 1
 *                 if i < nleft - 1:             # <<<<<<<<<<<<<<
 *                     if j < nright - 1 and right[j + 1] == rval:
 *                         j += 1
 */
        __pyx_t_7 = ((__pyx_v_i < (__pyx_v_nleft - 1)) != 0);
        if (__pyx_t_7) {

          /* "pandas/src/generated.pyx":7620
 *                 count += 1
 *                 if i < nleft - 1:
 *                     if j < nright - 1 and right[j + 1] == rval:             # <<<<<<<<<<<<<<
 *                         j += 1
 *                     else:
 */
          __pyx_t_7 = ((__pyx_v_j < (__pyx_v_nright - 1)) != 0);
          if (__pyx_t_7) {
            __pyx_t_29 = (__pyx_v_j + 1);
            __pyx_t_3 = -1;
            if (__pyx_t_29 < 0) {
              __pyx_t_29 += __pyx_pybuffernd_right.diminfo[0].shape;
              if (unlikely(__pyx_t_29 < 0)) __pyx_t_3 = 0;
            } else if (unlikely(__pyx_t_29 >= __pyx_pybuffernd_right.diminfo[0].shape)) __pyx_t_3 = 0;
            if (unlikely(__pyx_t_3 != -1)) {
              __Pyx_RaiseBufferIndexError(__pyx_t_3);
              {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7620; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            }
            __pyx_t_2 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_right.rcbuffer->pybuffer.buf, __pyx_t_29, __pyx_pybuffernd_right.diminfo[0].strides)) == __pyx_v_rval) != 0);
            __pyx_t_6 = __pyx_t_2;
          } else {
            __pyx_t_6 = __pyx_t_7;
          }
          if (__pyx_t_6) {

            /* "pandas/src/generated.pyx":7621
 *                 if i < nleft - 1:
 *                     if j < nright - 1 and right[j + 1] == rval:
 *                         j += 1             # <<<<<<<<<<<<<<
 *                     else:
 *                         i += 1
 */
            __pyx_v_j = (__pyx_v_j + 1);
            goto __pyx_L20;
          }
          /*else*/ {

            /* "pandas/src/generated.pyx":7623
 *                         j += 1
 *                     else:
 *                         i += 1             # <<<<<<<<<<<<<<
 *                         if left[i] != rval:
 *                             j += 1
 */
            __pyx_v_i = (__pyx_v_i + 1);

            /* "pandas/src/generated.pyx":7624
 *                     else:
 *                         i += 1
 *                         if left[i] != rval:             # <<<<<<<<<<<<<<
 *                             j += 1
 *                 elif j < nright - 1:
 */
            __pyx_t_30 = __pyx_v_i;
            __pyx_t_3 = -1;
            if (__pyx_t_30 < 0) {
              __pyx_t_30 += __pyx_pybuffernd_left.diminfo[0].shape;
              if (unlikely(__pyx_t_30 < 0)) __pyx_t_3 = 0;
            } else if (unlikely(__pyx_t_30 >= __pyx_pybuffernd_left.diminfo[0].shape)) __pyx_t_3 = 0;
            if (unlikely(__pyx_t_3 != -1)) {
              __Pyx_RaiseBufferIndexError(__pyx_t_3);
              {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7624; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            }
            __pyx_t_6 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_left.rcbuffer->pybuffer.buf, __pyx_t_30, __pyx_pybuffernd_left.diminfo[0].strides)) != __pyx_v_rval) != 0);
            if (__pyx_t_6) {

              /* "pandas/src/generated.pyx":7625
 *                         i += 1
 *                         if left[i] != rval:
 *                             j += 1             # <<<<<<<<<<<<<<
 *                 elif j < nright - 1:
 *                     j += 1
 */
              __pyx_v_j = (__pyx_v_j + 1);
              goto __pyx_L21;
            }
            __pyx_L21:;
          }
          __pyx_L20:;
          goto __pyx_L19;
        }

        /* "pandas/src/generated.pyx":7626
 *                         if left[i] != rval:
 *                             j += 1
 *                 elif j < nright - 1:             # <<<<<<<<<<<<<<
 *                     j += 1
 *                     if lval != right[j]:
 */
        __pyx_t_6 = ((__pyx_v_j < (__pyx_v_nright - 1)) != 0);
        if (__pyx_t_6) {

          /* "pandas/src/generated.pyx":7627
 *                             j += 1
 *                 elif j < nright - 1:
 *                     j += 1             # <<<<<<<<<<<<<<
 *                     if lval != right[j]:
 *                         i += 1
 */
          __pyx_v_j = (__pyx_v_j + 1);

          /* "pandas/src/generated.pyx":7628
 *                 elif j < nright - 1:
 *                     j += 1
 *                     if lval != right[j]:             # <<<<<<<<<<<<<<
 *                         i += 1
 *                 else:
 */
          __pyx_t_31 = __pyx_v_j;
          __pyx_t_3 = -1;
          if (__pyx_t_31 < 0) {
            __pyx_t_31 += __pyx_pybuffernd_right.diminfo[0].shape;
            if (unlikely(__pyx_t_31 < 0)) __pyx_t_3 = 0;
          } else if (unlikely(__pyx_t_31 >= __pyx_pybuffernd_right.diminfo[0].shape)) __pyx_t_3 = 0;
          if (unlikely(__pyx_t_3 != -1)) {
            __Pyx_RaiseBufferIndexError(__pyx_t_3);
            {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7628; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          }
          __pyx_t_6 = ((__pyx_v_lval != (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_right.rcbuffer->pybuffer.buf, __pyx_t_31, __pyx_pybuffernd_right.diminfo[0].strides))) != 0);
          if (__pyx_t_6) {

            /* "pandas/src/generated.pyx":7629
 *                     j += 1
 *                     if lval != right[j]:
 *                         i += 1             # <<<<<<<<<<<<<<
 *                 else:
 *                     # end of the road
 */
            __pyx_v_i = (__pyx_v_i + 1);
            goto __pyx_L22;
          }
          __pyx_L22:;
          goto __pyx_L19;
        }
        /*else*/ {

          /* "pandas/src/generated.pyx":7632
 *                 else:
 *                     # end of the road
 *                     break             # <<<<<<<<<<<<<<
 *             elif lval < rval:
 *                 lindexer[count] = i
 */
          goto __pyx_L14_break;
        }
        __pyx_L19:;
        goto __pyx_L18;
      }

      /* "pandas/src/generated.pyx":7633
 *                     # end of the road
 *                     break
 *             elif lval < rval:             # <<<<<<<<<<<<<<
 *                 lindexer[count] = i
 *                 rindexer[count] = -1
 */
      __pyx_t_6 = ((__pyx_v_lval < __pyx_v_rval) != 0);
      if (__pyx_t_6) {

        /* "pandas/src/generated.pyx":7634
 *                     break
 *             elif lval < rval:
 *                 lindexer[count] = i             # <<<<<<<<<<<<<<
 *                 rindexer[count] = -1
 *                 result[count] = left[i]
 */
        __pyx_t_32 = __pyx_v_count;
        __pyx_t_3 = -1;
        if (__pyx_t_32 < 0) {
          __pyx_t_32 += __pyx_pybuffernd_lindexer.diminfo[0].shape;
          if (unlikely(__pyx_t_32 < 0)) __pyx_t_3 = 0;
        } else if (unlikely(__pyx_t_32 >= __pyx_pybuffernd_lindexer.diminfo[0].shape)) __pyx_t_3 = 0;
        if (unlikely(__pyx_t_3 != -1)) {
          __Pyx_RaiseBufferIndexError(__pyx_t_3);
          {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7634; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_lindexer.rcbuffer->pybuffer.buf, __pyx_t_32, __pyx_pybuffernd_lindexer.diminfo[0].strides) = __pyx_v_i;

        /* "pandas/src/generated.pyx":7635
 *             elif lval < rval:
 *                 lindexer[count] = i
 *                 rindexer[count] = -1             # <<<<<<<<<<<<<<
 *                 result[count] = left[i]
 *                 count += 1
 */
        __pyx_t_33 = __pyx_v_count;
        __pyx_t_3 = -1;
        if (__pyx_t_33 < 0) {
          __pyx_t_33 += __pyx_pybuffernd_rindexer.diminfo[0].shape;
          if (unlikely(__pyx_t_33 < 0)) __pyx_t_3 = 0;
        } else if (unlikely(__pyx_t_33 >= __pyx_pybuffernd_rindexer.diminfo[0].shape)) __pyx_t_3 = 0;
        if (unlikely(__pyx_t_3 != -1)) {
          __Pyx_RaiseBufferIndexError(__pyx_t_3);
          {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7635; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_rindexer.rcbuffer->pybuffer.buf, __pyx_t_33, __pyx_pybuffernd_rindexer.diminfo[0].strides) = -1;

        /* "pandas/src/generated.pyx":7636
 *                 lindexer[count] = i
 *                 rindexer[count] = -1
 *                 result[count] = left[i]             # <<<<<<<<<<<<<<
 *                 count += 1
 *                 i += 1
 */
        __pyx_t_34 = __pyx_v_i;
        __pyx_t_3 = -1;
        if (__pyx_t_34 < 0) {
          __pyx_t_34 += __pyx_pybuffernd_left.diminfo[0].shape;
          if (unlikely(__pyx_t_34 < 0)) __pyx_t_3 = 0;
        } else if (unlikely(__pyx_t_34 >= __pyx_pybuffernd_left.diminfo[0].shape)) __pyx_t_3 = 0;
        if (unlikely(__pyx_t_3 != -1)) {
          __Pyx_RaiseBufferIndexError(__pyx_t_3);
          {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7636; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        __pyx_t_35 = __pyx_v_count;
        __pyx_t_3 = -1;
        if (__pyx_t_35 < 0) {
          __pyx_t_35 += __pyx_pybuffernd_result.diminfo[0].shape;
          if (unlikely(__pyx_t_35 < 0)) __pyx_t_3 = 0;
        } else if (unlikely(__pyx_t_35 >= __pyx_pybuffernd_result.diminfo[0].shape)) __pyx_t_3 = 0;
        if (unlikely(__pyx_t_3 != -1)) {
          __Pyx_RaiseBufferIndexError(__pyx_t_3);
          {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7636; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_35, __pyx_pybuffernd_result.diminfo[0].strides) = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_left.rcbuffer->pybuffer.buf, __pyx_t_34, __pyx_pybuffernd_left.diminfo[0].strides));

        /* "pandas/src/generated.pyx":7637
 *                 rindexer[count] = -1
 *                 result[count] = left[i]
 *                 count += 1             # <<<<<<<<<<<<<<
 *                 i += 1
 *             else:
 */
        __pyx_v_count = (__pyx_v_count + 1);

        /* "pandas/src/generated.pyx":7638
 *                 result[count] = left[i]
 *                 count += 1
 *                 i += 1             # <<<<<<<<<<<<<<
 *             else:
 *                 j += 1
 */
        __pyx_v_i = (__pyx_v_i + 1);
        goto __pyx_L18;
      }
      /*else*/ {

        /* "pandas/src/generated.pyx":7640
 *                 i += 1
 *             else:
 *                 j += 1             # <<<<<<<<<<<<<<
 * 
 *     return result, lindexer, rindexer
 */
        __pyx_v_j = (__pyx_v_j + 1);
      }
      __pyx_L18:;
    }
    __pyx_L14_break:;
    goto __pyx_L12;
  }
  __pyx_L12:;

  /* "pandas/src/generated.pyx":7642
 *                 j += 1
 * 
 *     return result, lindexer, rindexer             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_11 = PyTuple_New(3); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7642; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_11);
  __Pyx_INCREF(((PyObject *)__pyx_v_result));
  PyTuple_SET_ITEM(__pyx_t_11, 0, ((PyObject *)__pyx_v_result));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_result));
  __Pyx_INCREF(((PyObject *)__pyx_v_lindexer));
  PyTuple_SET_ITEM(__pyx_t_11, 1, ((PyObject *)__pyx_v_lindexer));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_lindexer));
  __Pyx_INCREF(((PyObject *)__pyx_v_rindexer));
  PyTuple_SET_ITEM(__pyx_t_11, 2, ((PyObject *)__pyx_v_rindexer));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_rindexer));
  __pyx_r = __pyx_t_11;
  __pyx_t_11 = 0;
  goto __pyx_L0;

  /* "pandas/src/generated.pyx":7543
 * 
 * 
 * def left_join_indexer_int64(ndarray[int64_t] left,             # <<<<<<<<<<<<<<
 *                               ndarray[int64_t] right):
 *     '''
 */

  /* function exit code */
  __pyx_L1_error:;
  __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);
  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
    __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_left.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_lindexer.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_right.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_rindexer.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas.algos.left_join_indexer_int64", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_left.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_lindexer.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_right.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_rindexer.rcbuffer->pybuffer);
  __pyx_L2:;
  __Pyx_XDECREF((PyObject *)__pyx_v_lindexer);
  __Pyx_XDECREF((PyObject *)__pyx_v_rindexer);
  __Pyx_XDECREF((PyObject *)__pyx_v_result);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/src/generated.pyx":7647
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def outer_join_indexer_float64(ndarray[float64_t] left,             # <<<<<<<<<<<<<<
 *                                 ndarray[float64_t] right):
 *     cdef:
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pandas_5algos_491outer_join_indexer_float64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_5algos_491outer_join_indexer_float64 = {__Pyx_NAMESTR("outer_join_indexer_float64"), (PyCFunction)__pyx_pw_6pandas_5algos_491outer_join_indexer_float64, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pw_6pandas_5algos_491outer_join_indexer_float64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyArrayObject *__pyx_v_left = 0;
  PyArrayObject *__pyx_v_right = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("outer_join_indexer_float64 (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_left,&__pyx_n_s_right,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_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 (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_left)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_right)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("outer_join_indexer_float64", 1, 2, 2, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7647; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "outer_join_indexer_float64") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7647; __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("outer_join_indexer_float64", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7647; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas.algos.outer_join_indexer_float64", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_left), __pyx_ptype_5numpy_ndarray, 1, "left", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7647; __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[2]; __pyx_lineno = 7648; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_490outer_join_indexer_float64(__pyx_self, __pyx_v_left, __pyx_v_right);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pandas_5algos_490outer_join_indexer_float64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_left, PyArrayObject *__pyx_v_right) {
  Py_ssize_t __pyx_v_i;
  Py_ssize_t __pyx_v_j;
  Py_ssize_t __pyx_v_nright;
  Py_ssize_t __pyx_v_nleft;
  Py_ssize_t __pyx_v_count;
  __pyx_t_5numpy_float64_t __pyx_v_lval;
  __pyx_t_5numpy_float64_t __pyx_v_rval;
  PyArrayObject *__pyx_v_lindexer = 0;
  PyArrayObject *__pyx_v_rindexer = 0;
  PyArrayObject *__pyx_v_result = 0;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_left;
  __Pyx_Buffer __pyx_pybuffer_left;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_lindexer;
  __Pyx_Buffer __pyx_pybuffer_lindexer;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_result;
  __Pyx_Buffer __pyx_pybuffer_result;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_right;
  __Pyx_Buffer __pyx_pybuffer_right;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_rindexer;
  __Pyx_Buffer __pyx_pybuffer_rindexer;
  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;
  int __pyx_t_6;
  Py_ssize_t __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;
  PyObject *__pyx_t_13 = NULL;
  PyArrayObject *__pyx_t_14 = NULL;
  int __pyx_t_15;
  PyObject *__pyx_t_16 = NULL;
  PyObject *__pyx_t_17 = NULL;
  PyObject *__pyx_t_18 = NULL;
  PyArrayObject *__pyx_t_19 = NULL;
  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;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("outer_join_indexer_float64", 0);
  __pyx_pybuffer_lindexer.pybuffer.buf = NULL;
  __pyx_pybuffer_lindexer.refcount = 0;
  __pyx_pybuffernd_lindexer.data = NULL;
  __pyx_pybuffernd_lindexer.rcbuffer = &__pyx_pybuffer_lindexer;
  __pyx_pybuffer_rindexer.pybuffer.buf = NULL;
  __pyx_pybuffer_rindexer.refcount = 0;
  __pyx_pybuffernd_rindexer.data = NULL;
  __pyx_pybuffernd_rindexer.rcbuffer = &__pyx_pybuffer_rindexer;
  __pyx_pybuffer_result.pybuffer.buf = NULL;
  __pyx_pybuffer_result.refcount = 0;
  __pyx_pybuffernd_result.data = NULL;
  __pyx_pybuffernd_result.rcbuffer = &__pyx_pybuffer_result;
  __pyx_pybuffer_left.pybuffer.buf = NULL;
  __pyx_pybuffer_left.refcount = 0;
  __pyx_pybuffernd_left.data = NULL;
  __pyx_pybuffernd_left.rcbuffer = &__pyx_pybuffer_left;
  __pyx_pybuffer_right.pybuffer.buf = NULL;
  __pyx_pybuffer_right.refcount = 0;
  __pyx_pybuffernd_right.data = NULL;
  __pyx_pybuffernd_right.rcbuffer = &__pyx_pybuffer_right;
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_left.rcbuffer->pybuffer, (PyObject*)__pyx_v_left, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7647; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_left.diminfo[0].strides = __pyx_pybuffernd_left.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_left.diminfo[0].shape = __pyx_pybuffernd_left.rcbuffer->pybuffer.shape[0];
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_right.rcbuffer->pybuffer, (PyObject*)__pyx_v_right, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7647; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_right.diminfo[0].strides = __pyx_pybuffernd_right.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_right.diminfo[0].shape = __pyx_pybuffernd_right.rcbuffer->pybuffer.shape[0];

  /* "pandas/src/generated.pyx":7655
 *         ndarray[float64_t] result
 * 
 *     nleft = len(left)             # <<<<<<<<<<<<<<
 *     nright = len(right)
 * 
 */
  __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_left)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7655; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_nleft = __pyx_t_1;

  /* "pandas/src/generated.pyx":7656
 * 
 *     nleft = len(left)
 *     nright = len(right)             # <<<<<<<<<<<<<<
 * 
 *     i = 0
 */
  __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_right)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7656; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_nright = __pyx_t_1;

  /* "pandas/src/generated.pyx":7658
 *     nright = len(right)
 * 
 *     i = 0             # <<<<<<<<<<<<<<
 *     j = 0
 *     count = 0
 */
  __pyx_v_i = 0;

  /* "pandas/src/generated.pyx":7659
 * 
 *     i = 0
 *     j = 0             # <<<<<<<<<<<<<<
 *     count = 0
 *     if nleft == 0:
 */
  __pyx_v_j = 0;

  /* "pandas/src/generated.pyx":7660
 *     i = 0
 *     j = 0
 *     count = 0             # <<<<<<<<<<<<<<
 *     if nleft == 0:
 *         count = nright
 */
  __pyx_v_count = 0;

  /* "pandas/src/generated.pyx":7661
 *     j = 0
 *     count = 0
 *     if nleft == 0:             # <<<<<<<<<<<<<<
 *         count = nright
 *     elif nright == 0:
 */
  __pyx_t_2 = ((__pyx_v_nleft == 0) != 0);
  if (__pyx_t_2) {

    /* "pandas/src/generated.pyx":7662
 *     count = 0
 *     if nleft == 0:
 *         count = nright             # <<<<<<<<<<<<<<
 *     elif nright == 0:
 *         count = nleft
 */
    __pyx_v_count = __pyx_v_nright;
    goto __pyx_L3;
  }

  /* "pandas/src/generated.pyx":7663
 *     if nleft == 0:
 *         count = nright
 *     elif nright == 0:             # <<<<<<<<<<<<<<
 *         count = nleft
 *     else:
 */
  __pyx_t_2 = ((__pyx_v_nright == 0) != 0);
  if (__pyx_t_2) {

    /* "pandas/src/generated.pyx":7664
 *         count = nright
 *     elif nright == 0:
 *         count = nleft             # <<<<<<<<<<<<<<
 *     else:
 *         while True:
 */
    __pyx_v_count = __pyx_v_nleft;
    goto __pyx_L3;
  }
  /*else*/ {

    /* "pandas/src/generated.pyx":7666
 *         count = nleft
 *     else:
 *         while True:             # <<<<<<<<<<<<<<
 *             if i == nleft:
 *                 count += nright - j
 */
    while (1) {

      /* "pandas/src/generated.pyx":7667
 *     else:
 *         while True:
 *             if i == nleft:             # <<<<<<<<<<<<<<
 *                 count += nright - j
 *                 break
 */
      __pyx_t_2 = ((__pyx_v_i == __pyx_v_nleft) != 0);
      if (__pyx_t_2) {

        /* "pandas/src/generated.pyx":7668
 *         while True:
 *             if i == nleft:
 *                 count += nright - j             # <<<<<<<<<<<<<<
 *                 break
 *             if j == nright:
 */
        __pyx_v_count = (__pyx_v_count + (__pyx_v_nright - __pyx_v_j));

        /* "pandas/src/generated.pyx":7669
 *             if i == nleft:
 *                 count += nright - j
 *                 break             # <<<<<<<<<<<<<<
 *             if j == nright:
 *                 count += nleft - i
 */
        goto __pyx_L5_break;
      }

      /* "pandas/src/generated.pyx":7670
 *                 count += nright - j
 *                 break
 *             if j == nright:             # <<<<<<<<<<<<<<
 *                 count += nleft - i
 *                 break
 */
      __pyx_t_2 = ((__pyx_v_j == __pyx_v_nright) != 0);
      if (__pyx_t_2) {

        /* "pandas/src/generated.pyx":7671
 *                 break
 *             if j == nright:
 *                 count += nleft - i             # <<<<<<<<<<<<<<
 *                 break
 * 
 */
        __pyx_v_count = (__pyx_v_count + (__pyx_v_nleft - __pyx_v_i));

        /* "pandas/src/generated.pyx":7672
 *             if j == nright:
 *                 count += nleft - i
 *                 break             # <<<<<<<<<<<<<<
 * 
 *             lval = left[i]
 */
        goto __pyx_L5_break;
      }

      /* "pandas/src/generated.pyx":7674
 *                 break
 * 
 *             lval = left[i]             # <<<<<<<<<<<<<<
 *             rval = right[j]
 *             if lval == rval:
 */
      __pyx_t_1 = __pyx_v_i;
      __pyx_v_lval = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_left.rcbuffer->pybuffer.buf, __pyx_t_1, __pyx_pybuffernd_left.diminfo[0].strides));

      /* "pandas/src/generated.pyx":7675
 * 
 *             lval = left[i]
 *             rval = right[j]             # <<<<<<<<<<<<<<
 *             if lval == rval:
 *                 count += 1
 */
      __pyx_t_3 = __pyx_v_j;
      __pyx_v_rval = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_right.rcbuffer->pybuffer.buf, __pyx_t_3, __pyx_pybuffernd_right.diminfo[0].strides));

      /* "pandas/src/generated.pyx":7676
 *             lval = left[i]
 *             rval = right[j]
 *             if lval == rval:             # <<<<<<<<<<<<<<
 *                 count += 1
 *                 if i < nleft - 1:
 */
      __pyx_t_2 = ((__pyx_v_lval == __pyx_v_rval) != 0);
      if (__pyx_t_2) {

        /* "pandas/src/generated.pyx":7677
 *             rval = right[j]
 *             if lval == rval:
 *                 count += 1             # <<<<<<<<<<<<<<
 *                 if i < nleft - 1:
 *                     if j < nright - 1 and right[j + 1] == rval:
 */
        __pyx_v_count = (__pyx_v_count + 1);

        /* "pandas/src/generated.pyx":7678
 *             if lval == rval:
 *                 count += 1
 *                 if i < nleft - 1:             # <<<<<<<<<<<<<<
 *                     if j < nright - 1 and right[j + 1] == rval:
 *                         j += 1
 */
        __pyx_t_2 = ((__pyx_v_i < (__pyx_v_nleft - 1)) != 0);
        if (__pyx_t_2) {

          /* "pandas/src/generated.pyx":7679
 *                 count += 1
 *                 if i < nleft - 1:
 *                     if j < nright - 1 and right[j + 1] == rval:             # <<<<<<<<<<<<<<
 *                         j += 1
 *                     else:
 */
          __pyx_t_2 = ((__pyx_v_j < (__pyx_v_nright - 1)) != 0);
          if (__pyx_t_2) {
            __pyx_t_4 = (__pyx_v_j + 1);
            __pyx_t_5 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_right.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_right.diminfo[0].strides)) == __pyx_v_rval) != 0);
            __pyx_t_6 = __pyx_t_5;
          } else {
            __pyx_t_6 = __pyx_t_2;
          }
          if (__pyx_t_6) {

            /* "pandas/src/generated.pyx":7680
 *                 if i < nleft - 1:
 *                     if j < nright - 1 and right[j + 1] == rval:
 *                         j += 1             # <<<<<<<<<<<<<<
 *                     else:
 *                         i += 1
 */
            __pyx_v_j = (__pyx_v_j + 1);
            goto __pyx_L10;
          }
          /*else*/ {

            /* "pandas/src/generated.pyx":7682
 *                         j += 1
 *                     else:
 *                         i += 1             # <<<<<<<<<<<<<<
 *                         if left[i] != rval:
 *                             j += 1
 */
            __pyx_v_i = (__pyx_v_i + 1);

            /* "pandas/src/generated.pyx":7683
 *                     else:
 *                         i += 1
 *                         if left[i] != rval:             # <<<<<<<<<<<<<<
 *                             j += 1
 *                 elif j < nright - 1:
 */
            __pyx_t_7 = __pyx_v_i;
            __pyx_t_6 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_left.rcbuffer->pybuffer.buf, __pyx_t_7, __pyx_pybuffernd_left.diminfo[0].strides)) != __pyx_v_rval) != 0);
            if (__pyx_t_6) {

              /* "pandas/src/generated.pyx":7684
 *                         i += 1
 *                         if left[i] != rval:
 *                             j += 1             # <<<<<<<<<<<<<<
 *                 elif j < nright - 1:
 *                     j += 1
 */
              __pyx_v_j = (__pyx_v_j + 1);
              goto __pyx_L11;
            }
            __pyx_L11:;
          }
          __pyx_L10:;
          goto __pyx_L9;
        }

        /* "pandas/src/generated.pyx":7685
 *                         if left[i] != rval:
 *                             j += 1
 *                 elif j < nright - 1:             # <<<<<<<<<<<<<<
 *                     j += 1
 *                     if lval != right[j]:
 */
        __pyx_t_6 = ((__pyx_v_j < (__pyx_v_nright - 1)) != 0);
        if (__pyx_t_6) {

          /* "pandas/src/generated.pyx":7686
 *                             j += 1
 *                 elif j < nright - 1:
 *                     j += 1             # <<<<<<<<<<<<<<
 *                     if lval != right[j]:
 *                         i += 1
 */
          __pyx_v_j = (__pyx_v_j + 1);

          /* "pandas/src/generated.pyx":7687
 *                 elif j < nright - 1:
 *                     j += 1
 *                     if lval != right[j]:             # <<<<<<<<<<<<<<
 *                         i += 1
 *                 else:
 */
          __pyx_t_8 = __pyx_v_j;
          __pyx_t_6 = ((__pyx_v_lval != (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_right.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_right.diminfo[0].strides))) != 0);
          if (__pyx_t_6) {

            /* "pandas/src/generated.pyx":7688
 *                     j += 1
 *                     if lval != right[j]:
 *                         i += 1             # <<<<<<<<<<<<<<
 *                 else:
 *                     # end of the road
 */
            __pyx_v_i = (__pyx_v_i + 1);
            goto __pyx_L12;
          }
          __pyx_L12:;
          goto __pyx_L9;
        }
        /*else*/ {

          /* "pandas/src/generated.pyx":7691
 *                 else:
 *                     # end of the road
 *                     break             # <<<<<<<<<<<<<<
 *             elif lval < rval:
 *                 count += 1
 */
          goto __pyx_L5_break;
        }
        __pyx_L9:;
        goto __pyx_L8;
      }

      /* "pandas/src/generated.pyx":7692
 *                     # end of the road
 *                     break
 *             elif lval < rval:             # <<<<<<<<<<<<<<
 *                 count += 1
 *                 i += 1
 */
      __pyx_t_6 = ((__pyx_v_lval < __pyx_v_rval) != 0);
      if (__pyx_t_6) {

        /* "pandas/src/generated.pyx":7693
 *                     break
 *             elif lval < rval:
 *                 count += 1             # <<<<<<<<<<<<<<
 *                 i += 1
 *             else:
 */
        __pyx_v_count = (__pyx_v_count + 1);

        /* "pandas/src/generated.pyx":7694
 *             elif lval < rval:
 *                 count += 1
 *                 i += 1             # <<<<<<<<<<<<<<
 *             else:
 *                 count += 1
 */
        __pyx_v_i = (__pyx_v_i + 1);
        goto __pyx_L8;
      }
      /*else*/ {

        /* "pandas/src/generated.pyx":7696
 *                 i += 1
 *             else:
 *                 count += 1             # <<<<<<<<<<<<<<
 *                 j += 1
 * 
 */
        __pyx_v_count = (__pyx_v_count + 1);

        /* "pandas/src/generated.pyx":7697
 *             else:
 *                 count += 1
 *                 j += 1             # <<<<<<<<<<<<<<
 * 
 *     lindexer = np.empty(count, dtype=np.int64)
 */
        __pyx_v_j = (__pyx_v_j + 1);
      }
      __pyx_L8:;
    }
    __pyx_L5_break:;
  }
  __pyx_L3:;

  /* "pandas/src/generated.pyx":7699
 *                 j += 1
 * 
 *     lindexer = np.empty(count, dtype=np.int64)             # <<<<<<<<<<<<<<
 *     rindexer = np.empty(count, dtype=np.int64)
 *     result = np.empty(count, dtype=np.float64)
 */
  __pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7699; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_9);
  __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_empty); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7699; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_10);
  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  __pyx_t_9 = PyInt_FromSsize_t(__pyx_v_count); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7699; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_9);
  __pyx_t_11 = PyTuple_New(1); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7699; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_11);
  PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_9);
  __Pyx_GIVEREF(__pyx_t_9);
  __pyx_t_9 = 0;
  __pyx_t_9 = PyDict_New(); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7699; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_9);
  __pyx_t_12 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7699; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_12);
  __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_int64); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7699; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_13);
  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
  if (PyDict_SetItem(__pyx_t_9, __pyx_n_s_dtype, __pyx_t_13) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7699; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  __pyx_t_13 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_t_11, __pyx_t_9); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7699; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_13);
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 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 = 7699; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_14 = ((PyArrayObject *)__pyx_t_13);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_lindexer.rcbuffer->pybuffer);
    __pyx_t_15 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_lindexer.rcbuffer->pybuffer, (PyObject*)__pyx_t_14, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack);
    if (unlikely(__pyx_t_15 < 0)) {
      PyErr_Fetch(&__pyx_t_16, &__pyx_t_17, &__pyx_t_18);
      if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_lindexer.rcbuffer->pybuffer, (PyObject*)__pyx_v_lindexer, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {
        Py_XDECREF(__pyx_t_16); Py_XDECREF(__pyx_t_17); Py_XDECREF(__pyx_t_18);
        __Pyx_RaiseBufferFallbackError();
      } else {
        PyErr_Restore(__pyx_t_16, __pyx_t_17, __pyx_t_18);
      }
    }
    __pyx_pybuffernd_lindexer.diminfo[0].strides = __pyx_pybuffernd_lindexer.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_lindexer.diminfo[0].shape = __pyx_pybuffernd_lindexer.rcbuffer->pybuffer.shape[0];
    if (unlikely(__pyx_t_15 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7699; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_14 = 0;
  __pyx_v_lindexer = ((PyArrayObject *)__pyx_t_13);
  __pyx_t_13 = 0;

  /* "pandas/src/generated.pyx":7700
 * 
 *     lindexer = np.empty(count, dtype=np.int64)
 *     rindexer = np.empty(count, dtype=np.int64)             # <<<<<<<<<<<<<<
 *     result = np.empty(count, dtype=np.float64)
 * 
 */
  __pyx_t_13 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7700; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_13);
  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_n_s_empty); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7700; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_9);
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  __pyx_t_13 = PyInt_FromSsize_t(__pyx_v_count); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7700; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_13);
  __pyx_t_11 = PyTuple_New(1); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7700; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_11);
  PyTuple_SET_ITEM(__pyx_t_11, 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 = 7700; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_13);
  __pyx_t_10 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7700; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_10);
  __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_int64); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7700; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_12);
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  if (PyDict_SetItem(__pyx_t_13, __pyx_n_s_dtype, __pyx_t_12) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7700; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
  __pyx_t_12 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_11, __pyx_t_13); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7700; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_12);
  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  if (!(likely(((__pyx_t_12) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_12, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7700; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_14 = ((PyArrayObject *)__pyx_t_12);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_rindexer.rcbuffer->pybuffer);
    __pyx_t_15 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_rindexer.rcbuffer->pybuffer, (PyObject*)__pyx_t_14, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack);
    if (unlikely(__pyx_t_15 < 0)) {
      PyErr_Fetch(&__pyx_t_18, &__pyx_t_17, &__pyx_t_16);
      if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_rindexer.rcbuffer->pybuffer, (PyObject*)__pyx_v_rindexer, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {
        Py_XDECREF(__pyx_t_18); Py_XDECREF(__pyx_t_17); Py_XDECREF(__pyx_t_16);
        __Pyx_RaiseBufferFallbackError();
      } else {
        PyErr_Restore(__pyx_t_18, __pyx_t_17, __pyx_t_16);
      }
    }
    __pyx_pybuffernd_rindexer.diminfo[0].strides = __pyx_pybuffernd_rindexer.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_rindexer.diminfo[0].shape = __pyx_pybuffernd_rindexer.rcbuffer->pybuffer.shape[0];
    if (unlikely(__pyx_t_15 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7700; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_14 = 0;
  __pyx_v_rindexer = ((PyArrayObject *)__pyx_t_12);
  __pyx_t_12 = 0;

  /* "pandas/src/generated.pyx":7701
 *     lindexer = np.empty(count, dtype=np.int64)
 *     rindexer = np.empty(count, dtype=np.int64)
 *     result = np.empty(count, dtype=np.float64)             # <<<<<<<<<<<<<<
 * 
 *     # do it again, but populate the indexers / result
 */
  __pyx_t_12 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7701; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_12);
  __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_empty); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7701; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_13);
  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
  __pyx_t_12 = PyInt_FromSsize_t(__pyx_v_count); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7701; __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[2]; __pyx_lineno = 7701; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__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 = PyDict_New(); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7701; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_12);
  __pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7701; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_9);
  __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_float64); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7701; __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_12, __pyx_n_s_dtype, __pyx_t_10) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7701; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_13, __pyx_t_11, __pyx_t_12); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7701; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_10);
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
  if (!(likely(((__pyx_t_10) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_10, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7701; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_19 = ((PyArrayObject *)__pyx_t_10);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer);
    __pyx_t_15 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_result.rcbuffer->pybuffer, (PyObject*)__pyx_t_19, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack);
    if (unlikely(__pyx_t_15 < 0)) {
      PyErr_Fetch(&__pyx_t_16, &__pyx_t_17, &__pyx_t_18);
      if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_result.rcbuffer->pybuffer, (PyObject*)__pyx_v_result, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {
        Py_XDECREF(__pyx_t_16); Py_XDECREF(__pyx_t_17); Py_XDECREF(__pyx_t_18);
        __Pyx_RaiseBufferFallbackError();
      } else {
        PyErr_Restore(__pyx_t_16, __pyx_t_17, __pyx_t_18);
      }
    }
    __pyx_pybuffernd_result.diminfo[0].strides = __pyx_pybuffernd_result.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_result.diminfo[0].shape = __pyx_pybuffernd_result.rcbuffer->pybuffer.shape[0];
    if (unlikely(__pyx_t_15 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7701; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_19 = 0;
  __pyx_v_result = ((PyArrayObject *)__pyx_t_10);
  __pyx_t_10 = 0;

  /* "pandas/src/generated.pyx":7705
 *     # do it again, but populate the indexers / result
 * 
 *     i = 0             # <<<<<<<<<<<<<<
 *     j = 0
 *     count = 0
 */
  __pyx_v_i = 0;

  /* "pandas/src/generated.pyx":7706
 * 
 *     i = 0
 *     j = 0             # <<<<<<<<<<<<<<
 *     count = 0
 *     if nleft == 0:
 */
  __pyx_v_j = 0;

  /* "pandas/src/generated.pyx":7707
 *     i = 0
 *     j = 0
 *     count = 0             # <<<<<<<<<<<<<<
 *     if nleft == 0:
 *         for j in range(nright):
 */
  __pyx_v_count = 0;

  /* "pandas/src/generated.pyx":7708
 *     j = 0
 *     count = 0
 *     if nleft == 0:             # <<<<<<<<<<<<<<
 *         for j in range(nright):
 *             lindexer[j] = -1
 */
  __pyx_t_6 = ((__pyx_v_nleft == 0) != 0);
  if (__pyx_t_6) {

    /* "pandas/src/generated.pyx":7709
 *     count = 0
 *     if nleft == 0:
 *         for j in range(nright):             # <<<<<<<<<<<<<<
 *             lindexer[j] = -1
 *             rindexer[j] = j
 */
    __pyx_t_20 = __pyx_v_nright;
    for (__pyx_t_21 = 0; __pyx_t_21 < __pyx_t_20; __pyx_t_21+=1) {
      __pyx_v_j = __pyx_t_21;

      /* "pandas/src/generated.pyx":7710
 *     if nleft == 0:
 *         for j in range(nright):
 *             lindexer[j] = -1             # <<<<<<<<<<<<<<
 *             rindexer[j] = j
 *             result[j] = right[j]
 */
      __pyx_t_22 = __pyx_v_j;
      *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_lindexer.rcbuffer->pybuffer.buf, __pyx_t_22, __pyx_pybuffernd_lindexer.diminfo[0].strides) = -1;

      /* "pandas/src/generated.pyx":7711
 *         for j in range(nright):
 *             lindexer[j] = -1
 *             rindexer[j] = j             # <<<<<<<<<<<<<<
 *             result[j] = right[j]
 *     elif nright == 0:
 */
      __pyx_t_23 = __pyx_v_j;
      *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_rindexer.rcbuffer->pybuffer.buf, __pyx_t_23, __pyx_pybuffernd_rindexer.diminfo[0].strides) = __pyx_v_j;

      /* "pandas/src/generated.pyx":7712
 *             lindexer[j] = -1
 *             rindexer[j] = j
 *             result[j] = right[j]             # <<<<<<<<<<<<<<
 *     elif nright == 0:
 *         for i in range(nright):
 */
      __pyx_t_24 = __pyx_v_j;
      __pyx_t_25 = __pyx_v_j;
      *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_25, __pyx_pybuffernd_result.diminfo[0].strides) = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_right.rcbuffer->pybuffer.buf, __pyx_t_24, __pyx_pybuffernd_right.diminfo[0].strides));
    }
    goto __pyx_L13;
  }

  /* "pandas/src/generated.pyx":7713
 *             rindexer[j] = j
 *             result[j] = right[j]
 *     elif nright == 0:             # <<<<<<<<<<<<<<
 *         for i in range(nright):
 *             lindexer[i] = i
 */
  __pyx_t_6 = ((__pyx_v_nright == 0) != 0);
  if (__pyx_t_6) {

    /* "pandas/src/generated.pyx":7714
 *             result[j] = right[j]
 *     elif nright == 0:
 *         for i in range(nright):             # <<<<<<<<<<<<<<
 *             lindexer[i] = i
 *             rindexer[i] = -1
 */
    __pyx_t_20 = __pyx_v_nright;
    for (__pyx_t_21 = 0; __pyx_t_21 < __pyx_t_20; __pyx_t_21+=1) {
      __pyx_v_i = __pyx_t_21;

      /* "pandas/src/generated.pyx":7715
 *     elif nright == 0:
 *         for i in range(nright):
 *             lindexer[i] = i             # <<<<<<<<<<<<<<
 *             rindexer[i] = -1
 *             result[i] = left[i]
 */
      __pyx_t_26 = __pyx_v_i;
      *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_lindexer.rcbuffer->pybuffer.buf, __pyx_t_26, __pyx_pybuffernd_lindexer.diminfo[0].strides) = __pyx_v_i;

      /* "pandas/src/generated.pyx":7716
 *         for i in range(nright):
 *             lindexer[i] = i
 *             rindexer[i] = -1             # <<<<<<<<<<<<<<
 *             result[i] = left[i]
 *     else:
 */
      __pyx_t_27 = __pyx_v_i;
      *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_rindexer.rcbuffer->pybuffer.buf, __pyx_t_27, __pyx_pybuffernd_rindexer.diminfo[0].strides) = -1;

      /* "pandas/src/generated.pyx":7717
 *             lindexer[i] = i
 *             rindexer[i] = -1
 *             result[i] = left[i]             # <<<<<<<<<<<<<<
 *     else:
 *         while True:
 */
      __pyx_t_28 = __pyx_v_i;
      __pyx_t_29 = __pyx_v_i;
      *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_29, __pyx_pybuffernd_result.diminfo[0].strides) = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_left.rcbuffer->pybuffer.buf, __pyx_t_28, __pyx_pybuffernd_left.diminfo[0].strides));
    }
    goto __pyx_L13;
  }
  /*else*/ {

    /* "pandas/src/generated.pyx":7719
 *             result[i] = left[i]
 *     else:
 *         while True:             # <<<<<<<<<<<<<<
 *             if i == nleft:
 *                 while j < nright:
 */
    while (1) {

      /* "pandas/src/generated.pyx":7720
 *     else:
 *         while True:
 *             if i == nleft:             # <<<<<<<<<<<<<<
 *                 while j < nright:
 *                     lindexer[count] = -1
 */
      __pyx_t_6 = ((__pyx_v_i == __pyx_v_nleft) != 0);
      if (__pyx_t_6) {

        /* "pandas/src/generated.pyx":7721
 *         while True:
 *             if i == nleft:
 *                 while j < nright:             # <<<<<<<<<<<<<<
 *                     lindexer[count] = -1
 *                     rindexer[count] = j
 */
        while (1) {
          __pyx_t_6 = ((__pyx_v_j < __pyx_v_nright) != 0);
          if (!__pyx_t_6) break;

          /* "pandas/src/generated.pyx":7722
 *             if i == nleft:
 *                 while j < nright:
 *                     lindexer[count] = -1             # <<<<<<<<<<<<<<
 *                     rindexer[count] = j
 *                     result[count] = right[j]
 */
          __pyx_t_20 = __pyx_v_count;
          *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_lindexer.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_lindexer.diminfo[0].strides) = -1;

          /* "pandas/src/generated.pyx":7723
 *                 while j < nright:
 *                     lindexer[count] = -1
 *                     rindexer[count] = j             # <<<<<<<<<<<<<<
 *                     result[count] = right[j]
 *                     count += 1
 */
          __pyx_t_21 = __pyx_v_count;
          *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_rindexer.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_rindexer.diminfo[0].strides) = __pyx_v_j;

          /* "pandas/src/generated.pyx":7724
 *                     lindexer[count] = -1
 *                     rindexer[count] = j
 *                     result[count] = right[j]             # <<<<<<<<<<<<<<
 *                     count += 1
 *                     j += 1
 */
          __pyx_t_30 = __pyx_v_j;
          __pyx_t_31 = __pyx_v_count;
          *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_31, __pyx_pybuffernd_result.diminfo[0].strides) = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_right.rcbuffer->pybuffer.buf, __pyx_t_30, __pyx_pybuffernd_right.diminfo[0].strides));

          /* "pandas/src/generated.pyx":7725
 *                     rindexer[count] = j
 *                     result[count] = right[j]
 *                     count += 1             # <<<<<<<<<<<<<<
 *                     j += 1
 *                 break
 */
          __pyx_v_count = (__pyx_v_count + 1);

          /* "pandas/src/generated.pyx":7726
 *                     result[count] = right[j]
 *                     count += 1
 *                     j += 1             # <<<<<<<<<<<<<<
 *                 break
 *             if j == nright:
 */
          __pyx_v_j = (__pyx_v_j + 1);
        }

        /* "pandas/src/generated.pyx":7727
 *                     count += 1
 *                     j += 1
 *                 break             # <<<<<<<<<<<<<<
 *             if j == nright:
 *                 while i < nleft:
 */
        goto __pyx_L19_break;
      }

      /* "pandas/src/generated.pyx":7728
 *                     j += 1
 *                 break
 *             if j == nright:             # <<<<<<<<<<<<<<
 *                 while i < nleft:
 *                     lindexer[count] = i
 */
      __pyx_t_6 = ((__pyx_v_j == __pyx_v_nright) != 0);
      if (__pyx_t_6) {

        /* "pandas/src/generated.pyx":7729
 *                 break
 *             if j == nright:
 *                 while i < nleft:             # <<<<<<<<<<<<<<
 *                     lindexer[count] = i
 *                     rindexer[count] = -1
 */
        while (1) {
          __pyx_t_6 = ((__pyx_v_i < __pyx_v_nleft) != 0);
          if (!__pyx_t_6) break;

          /* "pandas/src/generated.pyx":7730
 *             if j == nright:
 *                 while i < nleft:
 *                     lindexer[count] = i             # <<<<<<<<<<<<<<
 *                     rindexer[count] = -1
 *                     result[count] = left[i]
 */
          __pyx_t_32 = __pyx_v_count;
          *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_lindexer.rcbuffer->pybuffer.buf, __pyx_t_32, __pyx_pybuffernd_lindexer.diminfo[0].strides) = __pyx_v_i;

          /* "pandas/src/generated.pyx":7731
 *                 while i < nleft:
 *                     lindexer[count] = i
 *                     rindexer[count] = -1             # <<<<<<<<<<<<<<
 *                     result[count] = left[i]
 *                     count += 1
 */
          __pyx_t_33 = __pyx_v_count;
          *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_rindexer.rcbuffer->pybuffer.buf, __pyx_t_33, __pyx_pybuffernd_rindexer.diminfo[0].strides) = -1;

          /* "pandas/src/generated.pyx":7732
 *                     lindexer[count] = i
 *                     rindexer[count] = -1
 *                     result[count] = left[i]             # <<<<<<<<<<<<<<
 *                     count += 1
 *                     i += 1
 */
          __pyx_t_34 = __pyx_v_i;
          __pyx_t_35 = __pyx_v_count;
          *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_35, __pyx_pybuffernd_result.diminfo[0].strides) = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_left.rcbuffer->pybuffer.buf, __pyx_t_34, __pyx_pybuffernd_left.diminfo[0].strides));

          /* "pandas/src/generated.pyx":7733
 *                     rindexer[count] = -1
 *                     result[count] = left[i]
 *                     count += 1             # <<<<<<<<<<<<<<
 *                     i += 1
 *                 break
 */
          __pyx_v_count = (__pyx_v_count + 1);

          /* "pandas/src/generated.pyx":7734
 *                     result[count] = left[i]
 *                     count += 1
 *                     i += 1             # <<<<<<<<<<<<<<
 *                 break
 * 
 */
          __pyx_v_i = (__pyx_v_i + 1);
        }

        /* "pandas/src/generated.pyx":7735
 *                     count += 1
 *                     i += 1
 *                 break             # <<<<<<<<<<<<<<
 * 
 *             lval = left[i]
 */
        goto __pyx_L19_break;
      }

      /* "pandas/src/generated.pyx":7737
 *                 break
 * 
 *             lval = left[i]             # <<<<<<<<<<<<<<
 *             rval = right[j]
 * 
 */
      __pyx_t_36 = __pyx_v_i;
      __pyx_v_lval = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_left.rcbuffer->pybuffer.buf, __pyx_t_36, __pyx_pybuffernd_left.diminfo[0].strides));

      /* "pandas/src/generated.pyx":7738
 * 
 *             lval = left[i]
 *             rval = right[j]             # <<<<<<<<<<<<<<
 * 
 *             if lval == rval:
 */
      __pyx_t_37 = __pyx_v_j;
      __pyx_v_rval = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_right.rcbuffer->pybuffer.buf, __pyx_t_37, __pyx_pybuffernd_right.diminfo[0].strides));

      /* "pandas/src/generated.pyx":7740
 *             rval = right[j]
 * 
 *             if lval == rval:             # <<<<<<<<<<<<<<
 *                 lindexer[count] = i
 *                 rindexer[count] = j
 */
      __pyx_t_6 = ((__pyx_v_lval == __pyx_v_rval) != 0);
      if (__pyx_t_6) {

        /* "pandas/src/generated.pyx":7741
 * 
 *             if lval == rval:
 *                 lindexer[count] = i             # <<<<<<<<<<<<<<
 *                 rindexer[count] = j
 *                 result[count] = lval
 */
        __pyx_t_38 = __pyx_v_count;
        *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_lindexer.rcbuffer->pybuffer.buf, __pyx_t_38, __pyx_pybuffernd_lindexer.diminfo[0].strides) = __pyx_v_i;

        /* "pandas/src/generated.pyx":7742
 *             if lval == rval:
 *                 lindexer[count] = i
 *                 rindexer[count] = j             # <<<<<<<<<<<<<<
 *                 result[count] = lval
 *                 count += 1
 */
        __pyx_t_39 = __pyx_v_count;
        *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_rindexer.rcbuffer->pybuffer.buf, __pyx_t_39, __pyx_pybuffernd_rindexer.diminfo[0].strides) = __pyx_v_j;

        /* "pandas/src/generated.pyx":7743
 *                 lindexer[count] = i
 *                 rindexer[count] = j
 *                 result[count] = lval             # <<<<<<<<<<<<<<
 *                 count += 1
 *                 if i < nleft - 1:
 */
        __pyx_t_40 = __pyx_v_count;
        *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_40, __pyx_pybuffernd_result.diminfo[0].strides) = __pyx_v_lval;

        /* "pandas/src/generated.pyx":7744
 *                 rindexer[count] = j
 *                 result[count] = lval
 *                 count += 1             # <<<<<<<<<<<<<<
 *                 if i < nleft - 1:
 *                     if j < nright - 1 and right[j + 1] == rval:
 */
        __pyx_v_count = (__pyx_v_count + 1);

        /* "pandas/src/generated.pyx":7745
 *                 result[count] = lval
 *                 count += 1
 *                 if i < nleft - 1:             # <<<<<<<<<<<<<<
 *                     if j < nright - 1 and right[j + 1] == rval:
 *                         j += 1
 */
        __pyx_t_6 = ((__pyx_v_i < (__pyx_v_nleft - 1)) != 0);
        if (__pyx_t_6) {

          /* "pandas/src/generated.pyx":7746
 *                 count += 1
 *                 if i < nleft - 1:
 *                     if j < nright - 1 and right[j + 1] == rval:             # <<<<<<<<<<<<<<
 *                         j += 1
 *                     else:
 */
          __pyx_t_6 = ((__pyx_v_j < (__pyx_v_nright - 1)) != 0);
          if (__pyx_t_6) {
            __pyx_t_41 = (__pyx_v_j + 1);
            __pyx_t_2 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_right.rcbuffer->pybuffer.buf, __pyx_t_41, __pyx_pybuffernd_right.diminfo[0].strides)) == __pyx_v_rval) != 0);
            __pyx_t_5 = __pyx_t_2;
          } else {
            __pyx_t_5 = __pyx_t_6;
          }
          if (__pyx_t_5) {

            /* "pandas/src/generated.pyx":7747
 *                 if i < nleft - 1:
 *                     if j < nright - 1 and right[j + 1] == rval:
 *                         j += 1             # <<<<<<<<<<<<<<
 *                     else:
 *                         i += 1
 */
            __pyx_v_j = (__pyx_v_j + 1);
            goto __pyx_L28;
          }
          /*else*/ {

            /* "pandas/src/generated.pyx":7749
 *                         j += 1
 *                     else:
 *                         i += 1             # <<<<<<<<<<<<<<
 *                         if left[i] != rval:
 *                             j += 1
 */
            __pyx_v_i = (__pyx_v_i + 1);

            /* "pandas/src/generated.pyx":7750
 *                     else:
 *                         i += 1
 *                         if left[i] != rval:             # <<<<<<<<<<<<<<
 *                             j += 1
 *                 elif j < nright - 1:
 */
            __pyx_t_42 = __pyx_v_i;
            __pyx_t_5 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_left.rcbuffer->pybuffer.buf, __pyx_t_42, __pyx_pybuffernd_left.diminfo[0].strides)) != __pyx_v_rval) != 0);
            if (__pyx_t_5) {

              /* "pandas/src/generated.pyx":7751
 *                         i += 1
 *                         if left[i] != rval:
 *                             j += 1             # <<<<<<<<<<<<<<
 *                 elif j < nright - 1:
 *                     j += 1
 */
              __pyx_v_j = (__pyx_v_j + 1);
              goto __pyx_L29;
            }
            __pyx_L29:;
          }
          __pyx_L28:;
          goto __pyx_L27;
        }

        /* "pandas/src/generated.pyx":7752
 *                         if left[i] != rval:
 *                             j += 1
 *                 elif j < nright - 1:             # <<<<<<<<<<<<<<
 *                     j += 1
 *                     if lval != right[j]:
 */
        __pyx_t_5 = ((__pyx_v_j < (__pyx_v_nright - 1)) != 0);
        if (__pyx_t_5) {

          /* "pandas/src/generated.pyx":7753
 *                             j += 1
 *                 elif j < nright - 1:
 *                     j += 1             # <<<<<<<<<<<<<<
 *                     if lval != right[j]:
 *                         i += 1
 */
          __pyx_v_j = (__pyx_v_j + 1);

          /* "pandas/src/generated.pyx":7754
 *                 elif j < nright - 1:
 *                     j += 1
 *                     if lval != right[j]:             # <<<<<<<<<<<<<<
 *                         i += 1
 *                 else:
 */
          __pyx_t_43 = __pyx_v_j;
          __pyx_t_5 = ((__pyx_v_lval != (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_right.rcbuffer->pybuffer.buf, __pyx_t_43, __pyx_pybuffernd_right.diminfo[0].strides))) != 0);
          if (__pyx_t_5) {

            /* "pandas/src/generated.pyx":7755
 *                     j += 1
 *                     if lval != right[j]:
 *                         i += 1             # <<<<<<<<<<<<<<
 *                 else:
 *                     # end of the road
 */
            __pyx_v_i = (__pyx_v_i + 1);
            goto __pyx_L30;
          }
          __pyx_L30:;
          goto __pyx_L27;
        }
        /*else*/ {

          /* "pandas/src/generated.pyx":7758
 *                 else:
 *                     # end of the road
 *                     break             # <<<<<<<<<<<<<<
 *             elif lval < rval:
 *                 lindexer[count] = i
 */
          goto __pyx_L19_break;
        }
        __pyx_L27:;
        goto __pyx_L26;
      }

      /* "pandas/src/generated.pyx":7759
 *                     # end of the road
 *                     break
 *             elif lval < rval:             # <<<<<<<<<<<<<<
 *                 lindexer[count] = i
 *                 rindexer[count] = -1
 */
      __pyx_t_5 = ((__pyx_v_lval < __pyx_v_rval) != 0);
      if (__pyx_t_5) {

        /* "pandas/src/generated.pyx":7760
 *                     break
 *             elif lval < rval:
 *                 lindexer[count] = i             # <<<<<<<<<<<<<<
 *                 rindexer[count] = -1
 *                 result[count] = lval
 */
        __pyx_t_44 = __pyx_v_count;
        *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_lindexer.rcbuffer->pybuffer.buf, __pyx_t_44, __pyx_pybuffernd_lindexer.diminfo[0].strides) = __pyx_v_i;

        /* "pandas/src/generated.pyx":7761
 *             elif lval < rval:
 *                 lindexer[count] = i
 *                 rindexer[count] = -1             # <<<<<<<<<<<<<<
 *                 result[count] = lval
 *                 count += 1
 */
        __pyx_t_45 = __pyx_v_count;
        *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_rindexer.rcbuffer->pybuffer.buf, __pyx_t_45, __pyx_pybuffernd_rindexer.diminfo[0].strides) = -1;

        /* "pandas/src/generated.pyx":7762
 *                 lindexer[count] = i
 *                 rindexer[count] = -1
 *                 result[count] = lval             # <<<<<<<<<<<<<<
 *                 count += 1
 *                 i += 1
 */
        __pyx_t_46 = __pyx_v_count;
        *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_46, __pyx_pybuffernd_result.diminfo[0].strides) = __pyx_v_lval;

        /* "pandas/src/generated.pyx":7763
 *                 rindexer[count] = -1
 *                 result[count] = lval
 *                 count += 1             # <<<<<<<<<<<<<<
 *                 i += 1
 *             else:
 */
        __pyx_v_count = (__pyx_v_count + 1);

        /* "pandas/src/generated.pyx":7764
 *                 result[count] = lval
 *                 count += 1
 *                 i += 1             # <<<<<<<<<<<<<<
 *             else:
 *                 lindexer[count] = -1
 */
        __pyx_v_i = (__pyx_v_i + 1);
        goto __pyx_L26;
      }
      /*else*/ {

        /* "pandas/src/generated.pyx":7766
 *                 i += 1
 *             else:
 *                 lindexer[count] = -1             # <<<<<<<<<<<<<<
 *                 rindexer[count] = j
 *                 result[count] = rval
 */
        __pyx_t_47 = __pyx_v_count;
        *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_lindexer.rcbuffer->pybuffer.buf, __pyx_t_47, __pyx_pybuffernd_lindexer.diminfo[0].strides) = -1;

        /* "pandas/src/generated.pyx":7767
 *             else:
 *                 lindexer[count] = -1
 *                 rindexer[count] = j             # <<<<<<<<<<<<<<
 *                 result[count] = rval
 *                 count += 1
 */
        __pyx_t_48 = __pyx_v_count;
        *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_rindexer.rcbuffer->pybuffer.buf, __pyx_t_48, __pyx_pybuffernd_rindexer.diminfo[0].strides) = __pyx_v_j;

        /* "pandas/src/generated.pyx":7768
 *                 lindexer[count] = -1
 *                 rindexer[count] = j
 *                 result[count] = rval             # <<<<<<<<<<<<<<
 *                 count += 1
 *                 j += 1
 */
        __pyx_t_49 = __pyx_v_count;
        *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_49, __pyx_pybuffernd_result.diminfo[0].strides) = __pyx_v_rval;

        /* "pandas/src/generated.pyx":7769
 *                 rindexer[count] = j
 *                 result[count] = rval
 *                 count += 1             # <<<<<<<<<<<<<<
 *                 j += 1
 * 
 */
        __pyx_v_count = (__pyx_v_count + 1);

        /* "pandas/src/generated.pyx":7770
 *                 result[count] = rval
 *                 count += 1
 *                 j += 1             # <<<<<<<<<<<<<<
 * 
 *     return result, lindexer, rindexer
 */
        __pyx_v_j = (__pyx_v_j + 1);
      }
      __pyx_L26:;
    }
    __pyx_L19_break:;
  }
  __pyx_L13:;

  /* "pandas/src/generated.pyx":7772
 *                 j += 1
 * 
 *     return result, lindexer, rindexer             # <<<<<<<<<<<<<<
 * 
 * @cython.wraparound(False)
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_10 = PyTuple_New(3); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7772; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__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_INCREF(((PyObject *)__pyx_v_lindexer));
  PyTuple_SET_ITEM(__pyx_t_10, 1, ((PyObject *)__pyx_v_lindexer));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_lindexer));
  __Pyx_INCREF(((PyObject *)__pyx_v_rindexer));
  PyTuple_SET_ITEM(__pyx_t_10, 2, ((PyObject *)__pyx_v_rindexer));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_rindexer));
  __pyx_r = __pyx_t_10;
  __pyx_t_10 = 0;
  goto __pyx_L0;

  /* "pandas/src/generated.pyx":7647
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def outer_join_indexer_float64(ndarray[float64_t] left,             # <<<<<<<<<<<<<<
 *                                 ndarray[float64_t] right):
 *     cdef:
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_XDECREF(__pyx_t_13);
  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
    __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_left.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_lindexer.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_right.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_rindexer.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas.algos.outer_join_indexer_float64", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_left.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_lindexer.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_right.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_rindexer.rcbuffer->pybuffer);
  __pyx_L2:;
  __Pyx_XDECREF((PyObject *)__pyx_v_lindexer);
  __Pyx_XDECREF((PyObject *)__pyx_v_rindexer);
  __Pyx_XDECREF((PyObject *)__pyx_v_result);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/src/generated.pyx":7776
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def outer_join_indexer_float32(ndarray[float32_t] left,             # <<<<<<<<<<<<<<
 *                                 ndarray[float32_t] right):
 *     cdef:
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pandas_5algos_493outer_join_indexer_float32(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_5algos_493outer_join_indexer_float32 = {__Pyx_NAMESTR("outer_join_indexer_float32"), (PyCFunction)__pyx_pw_6pandas_5algos_493outer_join_indexer_float32, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pw_6pandas_5algos_493outer_join_indexer_float32(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyArrayObject *__pyx_v_left = 0;
  PyArrayObject *__pyx_v_right = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("outer_join_indexer_float32 (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_left,&__pyx_n_s_right,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_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 (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_left)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_right)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("outer_join_indexer_float32", 1, 2, 2, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7776; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "outer_join_indexer_float32") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7776; __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("outer_join_indexer_float32", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7776; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas.algos.outer_join_indexer_float32", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_left), __pyx_ptype_5numpy_ndarray, 1, "left", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7776; __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[2]; __pyx_lineno = 7777; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_492outer_join_indexer_float32(__pyx_self, __pyx_v_left, __pyx_v_right);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pandas_5algos_492outer_join_indexer_float32(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_left, PyArrayObject *__pyx_v_right) {
  Py_ssize_t __pyx_v_i;
  Py_ssize_t __pyx_v_j;
  Py_ssize_t __pyx_v_nright;
  Py_ssize_t __pyx_v_nleft;
  Py_ssize_t __pyx_v_count;
  __pyx_t_5numpy_float32_t __pyx_v_lval;
  __pyx_t_5numpy_float32_t __pyx_v_rval;
  PyArrayObject *__pyx_v_lindexer = 0;
  PyArrayObject *__pyx_v_rindexer = 0;
  PyArrayObject *__pyx_v_result = 0;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_left;
  __Pyx_Buffer __pyx_pybuffer_left;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_lindexer;
  __Pyx_Buffer __pyx_pybuffer_lindexer;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_result;
  __Pyx_Buffer __pyx_pybuffer_result;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_right;
  __Pyx_Buffer __pyx_pybuffer_right;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_rindexer;
  __Pyx_Buffer __pyx_pybuffer_rindexer;
  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;
  int __pyx_t_6;
  Py_ssize_t __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;
  PyObject *__pyx_t_13 = NULL;
  PyArrayObject *__pyx_t_14 = NULL;
  int __pyx_t_15;
  PyObject *__pyx_t_16 = NULL;
  PyObject *__pyx_t_17 = NULL;
  PyObject *__pyx_t_18 = NULL;
  PyArrayObject *__pyx_t_19 = NULL;
  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;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("outer_join_indexer_float32", 0);
  __pyx_pybuffer_lindexer.pybuffer.buf = NULL;
  __pyx_pybuffer_lindexer.refcount = 0;
  __pyx_pybuffernd_lindexer.data = NULL;
  __pyx_pybuffernd_lindexer.rcbuffer = &__pyx_pybuffer_lindexer;
  __pyx_pybuffer_rindexer.pybuffer.buf = NULL;
  __pyx_pybuffer_rindexer.refcount = 0;
  __pyx_pybuffernd_rindexer.data = NULL;
  __pyx_pybuffernd_rindexer.rcbuffer = &__pyx_pybuffer_rindexer;
  __pyx_pybuffer_result.pybuffer.buf = NULL;
  __pyx_pybuffer_result.refcount = 0;
  __pyx_pybuffernd_result.data = NULL;
  __pyx_pybuffernd_result.rcbuffer = &__pyx_pybuffer_result;
  __pyx_pybuffer_left.pybuffer.buf = NULL;
  __pyx_pybuffer_left.refcount = 0;
  __pyx_pybuffernd_left.data = NULL;
  __pyx_pybuffernd_left.rcbuffer = &__pyx_pybuffer_left;
  __pyx_pybuffer_right.pybuffer.buf = NULL;
  __pyx_pybuffer_right.refcount = 0;
  __pyx_pybuffernd_right.data = NULL;
  __pyx_pybuffernd_right.rcbuffer = &__pyx_pybuffer_right;
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_left.rcbuffer->pybuffer, (PyObject*)__pyx_v_left, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7776; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_left.diminfo[0].strides = __pyx_pybuffernd_left.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_left.diminfo[0].shape = __pyx_pybuffernd_left.rcbuffer->pybuffer.shape[0];
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_right.rcbuffer->pybuffer, (PyObject*)__pyx_v_right, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7776; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_right.diminfo[0].strides = __pyx_pybuffernd_right.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_right.diminfo[0].shape = __pyx_pybuffernd_right.rcbuffer->pybuffer.shape[0];

  /* "pandas/src/generated.pyx":7784
 *         ndarray[float32_t] result
 * 
 *     nleft = len(left)             # <<<<<<<<<<<<<<
 *     nright = len(right)
 * 
 */
  __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_left)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7784; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_nleft = __pyx_t_1;

  /* "pandas/src/generated.pyx":7785
 * 
 *     nleft = len(left)
 *     nright = len(right)             # <<<<<<<<<<<<<<
 * 
 *     i = 0
 */
  __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_right)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7785; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_nright = __pyx_t_1;

  /* "pandas/src/generated.pyx":7787
 *     nright = len(right)
 * 
 *     i = 0             # <<<<<<<<<<<<<<
 *     j = 0
 *     count = 0
 */
  __pyx_v_i = 0;

  /* "pandas/src/generated.pyx":7788
 * 
 *     i = 0
 *     j = 0             # <<<<<<<<<<<<<<
 *     count = 0
 *     if nleft == 0:
 */
  __pyx_v_j = 0;

  /* "pandas/src/generated.pyx":7789
 *     i = 0
 *     j = 0
 *     count = 0             # <<<<<<<<<<<<<<
 *     if nleft == 0:
 *         count = nright
 */
  __pyx_v_count = 0;

  /* "pandas/src/generated.pyx":7790
 *     j = 0
 *     count = 0
 *     if nleft == 0:             # <<<<<<<<<<<<<<
 *         count = nright
 *     elif nright == 0:
 */
  __pyx_t_2 = ((__pyx_v_nleft == 0) != 0);
  if (__pyx_t_2) {

    /* "pandas/src/generated.pyx":7791
 *     count = 0
 *     if nleft == 0:
 *         count = nright             # <<<<<<<<<<<<<<
 *     elif nright == 0:
 *         count = nleft
 */
    __pyx_v_count = __pyx_v_nright;
    goto __pyx_L3;
  }

  /* "pandas/src/generated.pyx":7792
 *     if nleft == 0:
 *         count = nright
 *     elif nright == 0:             # <<<<<<<<<<<<<<
 *         count = nleft
 *     else:
 */
  __pyx_t_2 = ((__pyx_v_nright == 0) != 0);
  if (__pyx_t_2) {

    /* "pandas/src/generated.pyx":7793
 *         count = nright
 *     elif nright == 0:
 *         count = nleft             # <<<<<<<<<<<<<<
 *     else:
 *         while True:
 */
    __pyx_v_count = __pyx_v_nleft;
    goto __pyx_L3;
  }
  /*else*/ {

    /* "pandas/src/generated.pyx":7795
 *         count = nleft
 *     else:
 *         while True:             # <<<<<<<<<<<<<<
 *             if i == nleft:
 *                 count += nright - j
 */
    while (1) {

      /* "pandas/src/generated.pyx":7796
 *     else:
 *         while True:
 *             if i == nleft:             # <<<<<<<<<<<<<<
 *                 count += nright - j
 *                 break
 */
      __pyx_t_2 = ((__pyx_v_i == __pyx_v_nleft) != 0);
      if (__pyx_t_2) {

        /* "pandas/src/generated.pyx":7797
 *         while True:
 *             if i == nleft:
 *                 count += nright - j             # <<<<<<<<<<<<<<
 *                 break
 *             if j == nright:
 */
        __pyx_v_count = (__pyx_v_count + (__pyx_v_nright - __pyx_v_j));

        /* "pandas/src/generated.pyx":7798
 *             if i == nleft:
 *                 count += nright - j
 *                 break             # <<<<<<<<<<<<<<
 *             if j == nright:
 *                 count += nleft - i
 */
        goto __pyx_L5_break;
      }

      /* "pandas/src/generated.pyx":7799
 *                 count += nright - j
 *                 break
 *             if j == nright:             # <<<<<<<<<<<<<<
 *                 count += nleft - i
 *                 break
 */
      __pyx_t_2 = ((__pyx_v_j == __pyx_v_nright) != 0);
      if (__pyx_t_2) {

        /* "pandas/src/generated.pyx":7800
 *                 break
 *             if j == nright:
 *                 count += nleft - i             # <<<<<<<<<<<<<<
 *                 break
 * 
 */
        __pyx_v_count = (__pyx_v_count + (__pyx_v_nleft - __pyx_v_i));

        /* "pandas/src/generated.pyx":7801
 *             if j == nright:
 *                 count += nleft - i
 *                 break             # <<<<<<<<<<<<<<
 * 
 *             lval = left[i]
 */
        goto __pyx_L5_break;
      }

      /* "pandas/src/generated.pyx":7803
 *                 break
 * 
 *             lval = left[i]             # <<<<<<<<<<<<<<
 *             rval = right[j]
 *             if lval == rval:
 */
      __pyx_t_1 = __pyx_v_i;
      __pyx_v_lval = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_left.rcbuffer->pybuffer.buf, __pyx_t_1, __pyx_pybuffernd_left.diminfo[0].strides));

      /* "pandas/src/generated.pyx":7804
 * 
 *             lval = left[i]
 *             rval = right[j]             # <<<<<<<<<<<<<<
 *             if lval == rval:
 *                 count += 1
 */
      __pyx_t_3 = __pyx_v_j;
      __pyx_v_rval = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_right.rcbuffer->pybuffer.buf, __pyx_t_3, __pyx_pybuffernd_right.diminfo[0].strides));

      /* "pandas/src/generated.pyx":7805
 *             lval = left[i]
 *             rval = right[j]
 *             if lval == rval:             # <<<<<<<<<<<<<<
 *                 count += 1
 *                 if i < nleft - 1:
 */
      __pyx_t_2 = ((__pyx_v_lval == __pyx_v_rval) != 0);
      if (__pyx_t_2) {

        /* "pandas/src/generated.pyx":7806
 *             rval = right[j]
 *             if lval == rval:
 *                 count += 1             # <<<<<<<<<<<<<<
 *                 if i < nleft - 1:
 *                     if j < nright - 1 and right[j + 1] == rval:
 */
        __pyx_v_count = (__pyx_v_count + 1);

        /* "pandas/src/generated.pyx":7807
 *             if lval == rval:
 *                 count += 1
 *                 if i < nleft - 1:             # <<<<<<<<<<<<<<
 *                     if j < nright - 1 and right[j + 1] == rval:
 *                         j += 1
 */
        __pyx_t_2 = ((__pyx_v_i < (__pyx_v_nleft - 1)) != 0);
        if (__pyx_t_2) {

          /* "pandas/src/generated.pyx":7808
 *                 count += 1
 *                 if i < nleft - 1:
 *                     if j < nright - 1 and right[j + 1] == rval:             # <<<<<<<<<<<<<<
 *                         j += 1
 *                     else:
 */
          __pyx_t_2 = ((__pyx_v_j < (__pyx_v_nright - 1)) != 0);
          if (__pyx_t_2) {
            __pyx_t_4 = (__pyx_v_j + 1);
            __pyx_t_5 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_right.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_right.diminfo[0].strides)) == __pyx_v_rval) != 0);
            __pyx_t_6 = __pyx_t_5;
          } else {
            __pyx_t_6 = __pyx_t_2;
          }
          if (__pyx_t_6) {

            /* "pandas/src/generated.pyx":7809
 *                 if i < nleft - 1:
 *                     if j < nright - 1 and right[j + 1] == rval:
 *                         j += 1             # <<<<<<<<<<<<<<
 *                     else:
 *                         i += 1
 */
            __pyx_v_j = (__pyx_v_j + 1);
            goto __pyx_L10;
          }
          /*else*/ {

            /* "pandas/src/generated.pyx":7811
 *                         j += 1
 *                     else:
 *                         i += 1             # <<<<<<<<<<<<<<
 *                         if left[i] != rval:
 *                             j += 1
 */
            __pyx_v_i = (__pyx_v_i + 1);

            /* "pandas/src/generated.pyx":7812
 *                     else:
 *                         i += 1
 *                         if left[i] != rval:             # <<<<<<<<<<<<<<
 *                             j += 1
 *                 elif j < nright - 1:
 */
            __pyx_t_7 = __pyx_v_i;
            __pyx_t_6 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_left.rcbuffer->pybuffer.buf, __pyx_t_7, __pyx_pybuffernd_left.diminfo[0].strides)) != __pyx_v_rval) != 0);
            if (__pyx_t_6) {

              /* "pandas/src/generated.pyx":7813
 *                         i += 1
 *                         if left[i] != rval:
 *                             j += 1             # <<<<<<<<<<<<<<
 *                 elif j < nright - 1:
 *                     j += 1
 */
              __pyx_v_j = (__pyx_v_j + 1);
              goto __pyx_L11;
            }
            __pyx_L11:;
          }
          __pyx_L10:;
          goto __pyx_L9;
        }

        /* "pandas/src/generated.pyx":7814
 *                         if left[i] != rval:
 *                             j += 1
 *                 elif j < nright - 1:             # <<<<<<<<<<<<<<
 *                     j += 1
 *                     if lval != right[j]:
 */
        __pyx_t_6 = ((__pyx_v_j < (__pyx_v_nright - 1)) != 0);
        if (__pyx_t_6) {

          /* "pandas/src/generated.pyx":7815
 *                             j += 1
 *                 elif j < nright - 1:
 *                     j += 1             # <<<<<<<<<<<<<<
 *                     if lval != right[j]:
 *                         i += 1
 */
          __pyx_v_j = (__pyx_v_j + 1);

          /* "pandas/src/generated.pyx":7816
 *                 elif j < nright - 1:
 *                     j += 1
 *                     if lval != right[j]:             # <<<<<<<<<<<<<<
 *                         i += 1
 *                 else:
 */
          __pyx_t_8 = __pyx_v_j;
          __pyx_t_6 = ((__pyx_v_lval != (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_right.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_right.diminfo[0].strides))) != 0);
          if (__pyx_t_6) {

            /* "pandas/src/generated.pyx":7817
 *                     j += 1
 *                     if lval != right[j]:
 *                         i += 1             # <<<<<<<<<<<<<<
 *                 else:
 *                     # end of the road
 */
            __pyx_v_i = (__pyx_v_i + 1);
            goto __pyx_L12;
          }
          __pyx_L12:;
          goto __pyx_L9;
        }
        /*else*/ {

          /* "pandas/src/generated.pyx":7820
 *                 else:
 *                     # end of the road
 *                     break             # <<<<<<<<<<<<<<
 *             elif lval < rval:
 *                 count += 1
 */
          goto __pyx_L5_break;
        }
        __pyx_L9:;
        goto __pyx_L8;
      }

      /* "pandas/src/generated.pyx":7821
 *                     # end of the road
 *                     break
 *             elif lval < rval:             # <<<<<<<<<<<<<<
 *                 count += 1
 *                 i += 1
 */
      __pyx_t_6 = ((__pyx_v_lval < __pyx_v_rval) != 0);
      if (__pyx_t_6) {

        /* "pandas/src/generated.pyx":7822
 *                     break
 *             elif lval < rval:
 *                 count += 1             # <<<<<<<<<<<<<<
 *                 i += 1
 *             else:
 */
        __pyx_v_count = (__pyx_v_count + 1);

        /* "pandas/src/generated.pyx":7823
 *             elif lval < rval:
 *                 count += 1
 *                 i += 1             # <<<<<<<<<<<<<<
 *             else:
 *                 count += 1
 */
        __pyx_v_i = (__pyx_v_i + 1);
        goto __pyx_L8;
      }
      /*else*/ {

        /* "pandas/src/generated.pyx":7825
 *                 i += 1
 *             else:
 *                 count += 1             # <<<<<<<<<<<<<<
 *                 j += 1
 * 
 */
        __pyx_v_count = (__pyx_v_count + 1);

        /* "pandas/src/generated.pyx":7826
 *             else:
 *                 count += 1
 *                 j += 1             # <<<<<<<<<<<<<<
 * 
 *     lindexer = np.empty(count, dtype=np.int64)
 */
        __pyx_v_j = (__pyx_v_j + 1);
      }
      __pyx_L8:;
    }
    __pyx_L5_break:;
  }
  __pyx_L3:;

  /* "pandas/src/generated.pyx":7828
 *                 j += 1
 * 
 *     lindexer = np.empty(count, dtype=np.int64)             # <<<<<<<<<<<<<<
 *     rindexer = np.empty(count, dtype=np.int64)
 *     result = np.empty(count, dtype=np.float32)
 */
  __pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7828; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_9);
  __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_empty); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7828; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_10);
  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  __pyx_t_9 = PyInt_FromSsize_t(__pyx_v_count); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7828; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_9);
  __pyx_t_11 = PyTuple_New(1); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7828; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_11);
  PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_9);
  __Pyx_GIVEREF(__pyx_t_9);
  __pyx_t_9 = 0;
  __pyx_t_9 = PyDict_New(); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7828; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_9);
  __pyx_t_12 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7828; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_12);
  __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_int64); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7828; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_13);
  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
  if (PyDict_SetItem(__pyx_t_9, __pyx_n_s_dtype, __pyx_t_13) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7828; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  __pyx_t_13 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_t_11, __pyx_t_9); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7828; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_13);
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 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 = 7828; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_14 = ((PyArrayObject *)__pyx_t_13);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_lindexer.rcbuffer->pybuffer);
    __pyx_t_15 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_lindexer.rcbuffer->pybuffer, (PyObject*)__pyx_t_14, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack);
    if (unlikely(__pyx_t_15 < 0)) {
      PyErr_Fetch(&__pyx_t_16, &__pyx_t_17, &__pyx_t_18);
      if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_lindexer.rcbuffer->pybuffer, (PyObject*)__pyx_v_lindexer, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {
        Py_XDECREF(__pyx_t_16); Py_XDECREF(__pyx_t_17); Py_XDECREF(__pyx_t_18);
        __Pyx_RaiseBufferFallbackError();
      } else {
        PyErr_Restore(__pyx_t_16, __pyx_t_17, __pyx_t_18);
      }
    }
    __pyx_pybuffernd_lindexer.diminfo[0].strides = __pyx_pybuffernd_lindexer.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_lindexer.diminfo[0].shape = __pyx_pybuffernd_lindexer.rcbuffer->pybuffer.shape[0];
    if (unlikely(__pyx_t_15 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7828; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_14 = 0;
  __pyx_v_lindexer = ((PyArrayObject *)__pyx_t_13);
  __pyx_t_13 = 0;

  /* "pandas/src/generated.pyx":7829
 * 
 *     lindexer = np.empty(count, dtype=np.int64)
 *     rindexer = np.empty(count, dtype=np.int64)             # <<<<<<<<<<<<<<
 *     result = np.empty(count, dtype=np.float32)
 * 
 */
  __pyx_t_13 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7829; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_13);
  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_n_s_empty); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7829; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_9);
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  __pyx_t_13 = PyInt_FromSsize_t(__pyx_v_count); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7829; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_13);
  __pyx_t_11 = PyTuple_New(1); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7829; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_11);
  PyTuple_SET_ITEM(__pyx_t_11, 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 = 7829; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_13);
  __pyx_t_10 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7829; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_10);
  __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_int64); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7829; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_12);
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  if (PyDict_SetItem(__pyx_t_13, __pyx_n_s_dtype, __pyx_t_12) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7829; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
  __pyx_t_12 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_11, __pyx_t_13); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7829; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_12);
  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  if (!(likely(((__pyx_t_12) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_12, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7829; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_14 = ((PyArrayObject *)__pyx_t_12);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_rindexer.rcbuffer->pybuffer);
    __pyx_t_15 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_rindexer.rcbuffer->pybuffer, (PyObject*)__pyx_t_14, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack);
    if (unlikely(__pyx_t_15 < 0)) {
      PyErr_Fetch(&__pyx_t_18, &__pyx_t_17, &__pyx_t_16);
      if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_rindexer.rcbuffer->pybuffer, (PyObject*)__pyx_v_rindexer, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {
        Py_XDECREF(__pyx_t_18); Py_XDECREF(__pyx_t_17); Py_XDECREF(__pyx_t_16);
        __Pyx_RaiseBufferFallbackError();
      } else {
        PyErr_Restore(__pyx_t_18, __pyx_t_17, __pyx_t_16);
      }
    }
    __pyx_pybuffernd_rindexer.diminfo[0].strides = __pyx_pybuffernd_rindexer.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_rindexer.diminfo[0].shape = __pyx_pybuffernd_rindexer.rcbuffer->pybuffer.shape[0];
    if (unlikely(__pyx_t_15 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7829; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_14 = 0;
  __pyx_v_rindexer = ((PyArrayObject *)__pyx_t_12);
  __pyx_t_12 = 0;

  /* "pandas/src/generated.pyx":7830
 *     lindexer = np.empty(count, dtype=np.int64)
 *     rindexer = np.empty(count, dtype=np.int64)
 *     result = np.empty(count, dtype=np.float32)             # <<<<<<<<<<<<<<
 * 
 *     # do it again, but populate the indexers / result
 */
  __pyx_t_12 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7830; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_12);
  __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_empty); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7830; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_13);
  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
  __pyx_t_12 = PyInt_FromSsize_t(__pyx_v_count); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7830; __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[2]; __pyx_lineno = 7830; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__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 = PyDict_New(); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7830; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_12);
  __pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7830; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_9);
  __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_float32); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7830; __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_12, __pyx_n_s_dtype, __pyx_t_10) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7830; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_13, __pyx_t_11, __pyx_t_12); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7830; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_10);
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
  if (!(likely(((__pyx_t_10) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_10, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7830; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_19 = ((PyArrayObject *)__pyx_t_10);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer);
    __pyx_t_15 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_result.rcbuffer->pybuffer, (PyObject*)__pyx_t_19, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack);
    if (unlikely(__pyx_t_15 < 0)) {
      PyErr_Fetch(&__pyx_t_16, &__pyx_t_17, &__pyx_t_18);
      if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_result.rcbuffer->pybuffer, (PyObject*)__pyx_v_result, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {
        Py_XDECREF(__pyx_t_16); Py_XDECREF(__pyx_t_17); Py_XDECREF(__pyx_t_18);
        __Pyx_RaiseBufferFallbackError();
      } else {
        PyErr_Restore(__pyx_t_16, __pyx_t_17, __pyx_t_18);
      }
    }
    __pyx_pybuffernd_result.diminfo[0].strides = __pyx_pybuffernd_result.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_result.diminfo[0].shape = __pyx_pybuffernd_result.rcbuffer->pybuffer.shape[0];
    if (unlikely(__pyx_t_15 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7830; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_19 = 0;
  __pyx_v_result = ((PyArrayObject *)__pyx_t_10);
  __pyx_t_10 = 0;

  /* "pandas/src/generated.pyx":7834
 *     # do it again, but populate the indexers / result
 * 
 *     i = 0             # <<<<<<<<<<<<<<
 *     j = 0
 *     count = 0
 */
  __pyx_v_i = 0;

  /* "pandas/src/generated.pyx":7835
 * 
 *     i = 0
 *     j = 0             # <<<<<<<<<<<<<<
 *     count = 0
 *     if nleft == 0:
 */
  __pyx_v_j = 0;

  /* "pandas/src/generated.pyx":7836
 *     i = 0
 *     j = 0
 *     count = 0             # <<<<<<<<<<<<<<
 *     if nleft == 0:
 *         for j in range(nright):
 */
  __pyx_v_count = 0;

  /* "pandas/src/generated.pyx":7837
 *     j = 0
 *     count = 0
 *     if nleft == 0:             # <<<<<<<<<<<<<<
 *         for j in range(nright):
 *             lindexer[j] = -1
 */
  __pyx_t_6 = ((__pyx_v_nleft == 0) != 0);
  if (__pyx_t_6) {

    /* "pandas/src/generated.pyx":7838
 *     count = 0
 *     if nleft == 0:
 *         for j in range(nright):             # <<<<<<<<<<<<<<
 *             lindexer[j] = -1
 *             rindexer[j] = j
 */
    __pyx_t_20 = __pyx_v_nright;
    for (__pyx_t_21 = 0; __pyx_t_21 < __pyx_t_20; __pyx_t_21+=1) {
      __pyx_v_j = __pyx_t_21;

      /* "pandas/src/generated.pyx":7839
 *     if nleft == 0:
 *         for j in range(nright):
 *             lindexer[j] = -1             # <<<<<<<<<<<<<<
 *             rindexer[j] = j
 *             result[j] = right[j]
 */
      __pyx_t_22 = __pyx_v_j;
      *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_lindexer.rcbuffer->pybuffer.buf, __pyx_t_22, __pyx_pybuffernd_lindexer.diminfo[0].strides) = -1;

      /* "pandas/src/generated.pyx":7840
 *         for j in range(nright):
 *             lindexer[j] = -1
 *             rindexer[j] = j             # <<<<<<<<<<<<<<
 *             result[j] = right[j]
 *     elif nright == 0:
 */
      __pyx_t_23 = __pyx_v_j;
      *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_rindexer.rcbuffer->pybuffer.buf, __pyx_t_23, __pyx_pybuffernd_rindexer.diminfo[0].strides) = __pyx_v_j;

      /* "pandas/src/generated.pyx":7841
 *             lindexer[j] = -1
 *             rindexer[j] = j
 *             result[j] = right[j]             # <<<<<<<<<<<<<<
 *     elif nright == 0:
 *         for i in range(nright):
 */
      __pyx_t_24 = __pyx_v_j;
      __pyx_t_25 = __pyx_v_j;
      *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_25, __pyx_pybuffernd_result.diminfo[0].strides) = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_right.rcbuffer->pybuffer.buf, __pyx_t_24, __pyx_pybuffernd_right.diminfo[0].strides));
    }
    goto __pyx_L13;
  }

  /* "pandas/src/generated.pyx":7842
 *             rindexer[j] = j
 *             result[j] = right[j]
 *     elif nright == 0:             # <<<<<<<<<<<<<<
 *         for i in range(nright):
 *             lindexer[i] = i
 */
  __pyx_t_6 = ((__pyx_v_nright == 0) != 0);
  if (__pyx_t_6) {

    /* "pandas/src/generated.pyx":7843
 *             result[j] = right[j]
 *     elif nright == 0:
 *         for i in range(nright):             # <<<<<<<<<<<<<<
 *             lindexer[i] = i
 *             rindexer[i] = -1
 */
    __pyx_t_20 = __pyx_v_nright;
    for (__pyx_t_21 = 0; __pyx_t_21 < __pyx_t_20; __pyx_t_21+=1) {
      __pyx_v_i = __pyx_t_21;

      /* "pandas/src/generated.pyx":7844
 *     elif nright == 0:
 *         for i in range(nright):
 *             lindexer[i] = i             # <<<<<<<<<<<<<<
 *             rindexer[i] = -1
 *             result[i] = left[i]
 */
      __pyx_t_26 = __pyx_v_i;
      *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_lindexer.rcbuffer->pybuffer.buf, __pyx_t_26, __pyx_pybuffernd_lindexer.diminfo[0].strides) = __pyx_v_i;

      /* "pandas/src/generated.pyx":7845
 *         for i in range(nright):
 *             lindexer[i] = i
 *             rindexer[i] = -1             # <<<<<<<<<<<<<<
 *             result[i] = left[i]
 *     else:
 */
      __pyx_t_27 = __pyx_v_i;
      *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_rindexer.rcbuffer->pybuffer.buf, __pyx_t_27, __pyx_pybuffernd_rindexer.diminfo[0].strides) = -1;

      /* "pandas/src/generated.pyx":7846
 *             lindexer[i] = i
 *             rindexer[i] = -1
 *             result[i] = left[i]             # <<<<<<<<<<<<<<
 *     else:
 *         while True:
 */
      __pyx_t_28 = __pyx_v_i;
      __pyx_t_29 = __pyx_v_i;
      *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_29, __pyx_pybuffernd_result.diminfo[0].strides) = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_left.rcbuffer->pybuffer.buf, __pyx_t_28, __pyx_pybuffernd_left.diminfo[0].strides));
    }
    goto __pyx_L13;
  }
  /*else*/ {

    /* "pandas/src/generated.pyx":7848
 *             result[i] = left[i]
 *     else:
 *         while True:             # <<<<<<<<<<<<<<
 *             if i == nleft:
 *                 while j < nright:
 */
    while (1) {

      /* "pandas/src/generated.pyx":7849
 *     else:
 *         while True:
 *             if i == nleft:             # <<<<<<<<<<<<<<
 *                 while j < nright:
 *                     lindexer[count] = -1
 */
      __pyx_t_6 = ((__pyx_v_i == __pyx_v_nleft) != 0);
      if (__pyx_t_6) {

        /* "pandas/src/generated.pyx":7850
 *         while True:
 *             if i == nleft:
 *                 while j < nright:             # <<<<<<<<<<<<<<
 *                     lindexer[count] = -1
 *                     rindexer[count] = j
 */
        while (1) {
          __pyx_t_6 = ((__pyx_v_j < __pyx_v_nright) != 0);
          if (!__pyx_t_6) break;

          /* "pandas/src/generated.pyx":7851
 *             if i == nleft:
 *                 while j < nright:
 *                     lindexer[count] = -1             # <<<<<<<<<<<<<<
 *                     rindexer[count] = j
 *                     result[count] = right[j]
 */
          __pyx_t_20 = __pyx_v_count;
          *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_lindexer.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_lindexer.diminfo[0].strides) = -1;

          /* "pandas/src/generated.pyx":7852
 *                 while j < nright:
 *                     lindexer[count] = -1
 *                     rindexer[count] = j             # <<<<<<<<<<<<<<
 *                     result[count] = right[j]
 *                     count += 1
 */
          __pyx_t_21 = __pyx_v_count;
          *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_rindexer.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_rindexer.diminfo[0].strides) = __pyx_v_j;

          /* "pandas/src/generated.pyx":7853
 *                     lindexer[count] = -1
 *                     rindexer[count] = j
 *                     result[count] = right[j]             # <<<<<<<<<<<<<<
 *                     count += 1
 *                     j += 1
 */
          __pyx_t_30 = __pyx_v_j;
          __pyx_t_31 = __pyx_v_count;
          *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_31, __pyx_pybuffernd_result.diminfo[0].strides) = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_right.rcbuffer->pybuffer.buf, __pyx_t_30, __pyx_pybuffernd_right.diminfo[0].strides));

          /* "pandas/src/generated.pyx":7854
 *                     rindexer[count] = j
 *                     result[count] = right[j]
 *                     count += 1             # <<<<<<<<<<<<<<
 *                     j += 1
 *                 break
 */
          __pyx_v_count = (__pyx_v_count + 1);

          /* "pandas/src/generated.pyx":7855
 *                     result[count] = right[j]
 *                     count += 1
 *                     j += 1             # <<<<<<<<<<<<<<
 *                 break
 *             if j == nright:
 */
          __pyx_v_j = (__pyx_v_j + 1);
        }

        /* "pandas/src/generated.pyx":7856
 *                     count += 1
 *                     j += 1
 *                 break             # <<<<<<<<<<<<<<
 *             if j == nright:
 *                 while i < nleft:
 */
        goto __pyx_L19_break;
      }

      /* "pandas/src/generated.pyx":7857
 *                     j += 1
 *                 break
 *             if j == nright:             # <<<<<<<<<<<<<<
 *                 while i < nleft:
 *                     lindexer[count] = i
 */
      __pyx_t_6 = ((__pyx_v_j == __pyx_v_nright) != 0);
      if (__pyx_t_6) {

        /* "pandas/src/generated.pyx":7858
 *                 break
 *             if j == nright:
 *                 while i < nleft:             # <<<<<<<<<<<<<<
 *                     lindexer[count] = i
 *                     rindexer[count] = -1
 */
        while (1) {
          __pyx_t_6 = ((__pyx_v_i < __pyx_v_nleft) != 0);
          if (!__pyx_t_6) break;

          /* "pandas/src/generated.pyx":7859
 *             if j == nright:
 *                 while i < nleft:
 *                     lindexer[count] = i             # <<<<<<<<<<<<<<
 *                     rindexer[count] = -1
 *                     result[count] = left[i]
 */
          __pyx_t_32 = __pyx_v_count;
          *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_lindexer.rcbuffer->pybuffer.buf, __pyx_t_32, __pyx_pybuffernd_lindexer.diminfo[0].strides) = __pyx_v_i;

          /* "pandas/src/generated.pyx":7860
 *                 while i < nleft:
 *                     lindexer[count] = i
 *                     rindexer[count] = -1             # <<<<<<<<<<<<<<
 *                     result[count] = left[i]
 *                     count += 1
 */
          __pyx_t_33 = __pyx_v_count;
          *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_rindexer.rcbuffer->pybuffer.buf, __pyx_t_33, __pyx_pybuffernd_rindexer.diminfo[0].strides) = -1;

          /* "pandas/src/generated.pyx":7861
 *                     lindexer[count] = i
 *                     rindexer[count] = -1
 *                     result[count] = left[i]             # <<<<<<<<<<<<<<
 *                     count += 1
 *                     i += 1
 */
          __pyx_t_34 = __pyx_v_i;
          __pyx_t_35 = __pyx_v_count;
          *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_35, __pyx_pybuffernd_result.diminfo[0].strides) = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_left.rcbuffer->pybuffer.buf, __pyx_t_34, __pyx_pybuffernd_left.diminfo[0].strides));

          /* "pandas/src/generated.pyx":7862
 *                     rindexer[count] = -1
 *                     result[count] = left[i]
 *                     count += 1             # <<<<<<<<<<<<<<
 *                     i += 1
 *                 break
 */
          __pyx_v_count = (__pyx_v_count + 1);

          /* "pandas/src/generated.pyx":7863
 *                     result[count] = left[i]
 *                     count += 1
 *                     i += 1             # <<<<<<<<<<<<<<
 *                 break
 * 
 */
          __pyx_v_i = (__pyx_v_i + 1);
        }

        /* "pandas/src/generated.pyx":7864
 *                     count += 1
 *                     i += 1
 *                 break             # <<<<<<<<<<<<<<
 * 
 *             lval = left[i]
 */
        goto __pyx_L19_break;
      }

      /* "pandas/src/generated.pyx":7866
 *                 break
 * 
 *             lval = left[i]             # <<<<<<<<<<<<<<
 *             rval = right[j]
 * 
 */
      __pyx_t_36 = __pyx_v_i;
      __pyx_v_lval = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_left.rcbuffer->pybuffer.buf, __pyx_t_36, __pyx_pybuffernd_left.diminfo[0].strides));

      /* "pandas/src/generated.pyx":7867
 * 
 *             lval = left[i]
 *             rval = right[j]             # <<<<<<<<<<<<<<
 * 
 *             if lval == rval:
 */
      __pyx_t_37 = __pyx_v_j;
      __pyx_v_rval = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_right.rcbuffer->pybuffer.buf, __pyx_t_37, __pyx_pybuffernd_right.diminfo[0].strides));

      /* "pandas/src/generated.pyx":7869
 *             rval = right[j]
 * 
 *             if lval == rval:             # <<<<<<<<<<<<<<
 *                 lindexer[count] = i
 *                 rindexer[count] = j
 */
      __pyx_t_6 = ((__pyx_v_lval == __pyx_v_rval) != 0);
      if (__pyx_t_6) {

        /* "pandas/src/generated.pyx":7870
 * 
 *             if lval == rval:
 *                 lindexer[count] = i             # <<<<<<<<<<<<<<
 *                 rindexer[count] = j
 *                 result[count] = lval
 */
        __pyx_t_38 = __pyx_v_count;
        *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_lindexer.rcbuffer->pybuffer.buf, __pyx_t_38, __pyx_pybuffernd_lindexer.diminfo[0].strides) = __pyx_v_i;

        /* "pandas/src/generated.pyx":7871
 *             if lval == rval:
 *                 lindexer[count] = i
 *                 rindexer[count] = j             # <<<<<<<<<<<<<<
 *                 result[count] = lval
 *                 count += 1
 */
        __pyx_t_39 = __pyx_v_count;
        *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_rindexer.rcbuffer->pybuffer.buf, __pyx_t_39, __pyx_pybuffernd_rindexer.diminfo[0].strides) = __pyx_v_j;

        /* "pandas/src/generated.pyx":7872
 *                 lindexer[count] = i
 *                 rindexer[count] = j
 *                 result[count] = lval             # <<<<<<<<<<<<<<
 *                 count += 1
 *                 if i < nleft - 1:
 */
        __pyx_t_40 = __pyx_v_count;
        *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_40, __pyx_pybuffernd_result.diminfo[0].strides) = __pyx_v_lval;

        /* "pandas/src/generated.pyx":7873
 *                 rindexer[count] = j
 *                 result[count] = lval
 *                 count += 1             # <<<<<<<<<<<<<<
 *                 if i < nleft - 1:
 *                     if j < nright - 1 and right[j + 1] == rval:
 */
        __pyx_v_count = (__pyx_v_count + 1);

        /* "pandas/src/generated.pyx":7874
 *                 result[count] = lval
 *                 count += 1
 *                 if i < nleft - 1:             # <<<<<<<<<<<<<<
 *                     if j < nright - 1 and right[j + 1] == rval:
 *                         j += 1
 */
        __pyx_t_6 = ((__pyx_v_i < (__pyx_v_nleft - 1)) != 0);
        if (__pyx_t_6) {

          /* "pandas/src/generated.pyx":7875
 *                 count += 1
 *                 if i < nleft - 1:
 *                     if j < nright - 1 and right[j + 1] == rval:             # <<<<<<<<<<<<<<
 *                         j += 1
 *                     else:
 */
          __pyx_t_6 = ((__pyx_v_j < (__pyx_v_nright - 1)) != 0);
          if (__pyx_t_6) {
            __pyx_t_41 = (__pyx_v_j + 1);
            __pyx_t_2 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_right.rcbuffer->pybuffer.buf, __pyx_t_41, __pyx_pybuffernd_right.diminfo[0].strides)) == __pyx_v_rval) != 0);
            __pyx_t_5 = __pyx_t_2;
          } else {
            __pyx_t_5 = __pyx_t_6;
          }
          if (__pyx_t_5) {

            /* "pandas/src/generated.pyx":7876
 *                 if i < nleft - 1:
 *                     if j < nright - 1 and right[j + 1] == rval:
 *                         j += 1             # <<<<<<<<<<<<<<
 *                     else:
 *                         i += 1
 */
            __pyx_v_j = (__pyx_v_j + 1);
            goto __pyx_L28;
          }
          /*else*/ {

            /* "pandas/src/generated.pyx":7878
 *                         j += 1
 *                     else:
 *                         i += 1             # <<<<<<<<<<<<<<
 *                         if left[i] != rval:
 *                             j += 1
 */
            __pyx_v_i = (__pyx_v_i + 1);

            /* "pandas/src/generated.pyx":7879
 *                     else:
 *                         i += 1
 *                         if left[i] != rval:             # <<<<<<<<<<<<<<
 *                             j += 1
 *                 elif j < nright - 1:
 */
            __pyx_t_42 = __pyx_v_i;
            __pyx_t_5 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_left.rcbuffer->pybuffer.buf, __pyx_t_42, __pyx_pybuffernd_left.diminfo[0].strides)) != __pyx_v_rval) != 0);
            if (__pyx_t_5) {

              /* "pandas/src/generated.pyx":7880
 *                         i += 1
 *                         if left[i] != rval:
 *                             j += 1             # <<<<<<<<<<<<<<
 *                 elif j < nright - 1:
 *                     j += 1
 */
              __pyx_v_j = (__pyx_v_j + 1);
              goto __pyx_L29;
            }
            __pyx_L29:;
          }
          __pyx_L28:;
          goto __pyx_L27;
        }

        /* "pandas/src/generated.pyx":7881
 *                         if left[i] != rval:
 *                             j += 1
 *                 elif j < nright - 1:             # <<<<<<<<<<<<<<
 *                     j += 1
 *                     if lval != right[j]:
 */
        __pyx_t_5 = ((__pyx_v_j < (__pyx_v_nright - 1)) != 0);
        if (__pyx_t_5) {

          /* "pandas/src/generated.pyx":7882
 *                             j += 1
 *                 elif j < nright - 1:
 *                     j += 1             # <<<<<<<<<<<<<<
 *                     if lval != right[j]:
 *                         i += 1
 */
          __pyx_v_j = (__pyx_v_j + 1);

          /* "pandas/src/generated.pyx":7883
 *                 elif j < nright - 1:
 *                     j += 1
 *                     if lval != right[j]:             # <<<<<<<<<<<<<<
 *                         i += 1
 *                 else:
 */
          __pyx_t_43 = __pyx_v_j;
          __pyx_t_5 = ((__pyx_v_lval != (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_right.rcbuffer->pybuffer.buf, __pyx_t_43, __pyx_pybuffernd_right.diminfo[0].strides))) != 0);
          if (__pyx_t_5) {

            /* "pandas/src/generated.pyx":7884
 *                     j += 1
 *                     if lval != right[j]:
 *                         i += 1             # <<<<<<<<<<<<<<
 *                 else:
 *                     # end of the road
 */
            __pyx_v_i = (__pyx_v_i + 1);
            goto __pyx_L30;
          }
          __pyx_L30:;
          goto __pyx_L27;
        }
        /*else*/ {

          /* "pandas/src/generated.pyx":7887
 *                 else:
 *                     # end of the road
 *                     break             # <<<<<<<<<<<<<<
 *             elif lval < rval:
 *                 lindexer[count] = i
 */
          goto __pyx_L19_break;
        }
        __pyx_L27:;
        goto __pyx_L26;
      }

      /* "pandas/src/generated.pyx":7888
 *                     # end of the road
 *                     break
 *             elif lval < rval:             # <<<<<<<<<<<<<<
 *                 lindexer[count] = i
 *                 rindexer[count] = -1
 */
      __pyx_t_5 = ((__pyx_v_lval < __pyx_v_rval) != 0);
      if (__pyx_t_5) {

        /* "pandas/src/generated.pyx":7889
 *                     break
 *             elif lval < rval:
 *                 lindexer[count] = i             # <<<<<<<<<<<<<<
 *                 rindexer[count] = -1
 *                 result[count] = lval
 */
        __pyx_t_44 = __pyx_v_count;
        *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_lindexer.rcbuffer->pybuffer.buf, __pyx_t_44, __pyx_pybuffernd_lindexer.diminfo[0].strides) = __pyx_v_i;

        /* "pandas/src/generated.pyx":7890
 *             elif lval < rval:
 *                 lindexer[count] = i
 *                 rindexer[count] = -1             # <<<<<<<<<<<<<<
 *                 result[count] = lval
 *                 count += 1
 */
        __pyx_t_45 = __pyx_v_count;
        *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_rindexer.rcbuffer->pybuffer.buf, __pyx_t_45, __pyx_pybuffernd_rindexer.diminfo[0].strides) = -1;

        /* "pandas/src/generated.pyx":7891
 *                 lindexer[count] = i
 *                 rindexer[count] = -1
 *                 result[count] = lval             # <<<<<<<<<<<<<<
 *                 count += 1
 *                 i += 1
 */
        __pyx_t_46 = __pyx_v_count;
        *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_46, __pyx_pybuffernd_result.diminfo[0].strides) = __pyx_v_lval;

        /* "pandas/src/generated.pyx":7892
 *                 rindexer[count] = -1
 *                 result[count] = lval
 *                 count += 1             # <<<<<<<<<<<<<<
 *                 i += 1
 *             else:
 */
        __pyx_v_count = (__pyx_v_count + 1);

        /* "pandas/src/generated.pyx":7893
 *                 result[count] = lval
 *                 count += 1
 *                 i += 1             # <<<<<<<<<<<<<<
 *             else:
 *                 lindexer[count] = -1
 */
        __pyx_v_i = (__pyx_v_i + 1);
        goto __pyx_L26;
      }
      /*else*/ {

        /* "pandas/src/generated.pyx":7895
 *                 i += 1
 *             else:
 *                 lindexer[count] = -1             # <<<<<<<<<<<<<<
 *                 rindexer[count] = j
 *                 result[count] = rval
 */
        __pyx_t_47 = __pyx_v_count;
        *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_lindexer.rcbuffer->pybuffer.buf, __pyx_t_47, __pyx_pybuffernd_lindexer.diminfo[0].strides) = -1;

        /* "pandas/src/generated.pyx":7896
 *             else:
 *                 lindexer[count] = -1
 *                 rindexer[count] = j             # <<<<<<<<<<<<<<
 *                 result[count] = rval
 *                 count += 1
 */
        __pyx_t_48 = __pyx_v_count;
        *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_rindexer.rcbuffer->pybuffer.buf, __pyx_t_48, __pyx_pybuffernd_rindexer.diminfo[0].strides) = __pyx_v_j;

        /* "pandas/src/generated.pyx":7897
 *                 lindexer[count] = -1
 *                 rindexer[count] = j
 *                 result[count] = rval             # <<<<<<<<<<<<<<
 *                 count += 1
 *                 j += 1
 */
        __pyx_t_49 = __pyx_v_count;
        *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_49, __pyx_pybuffernd_result.diminfo[0].strides) = __pyx_v_rval;

        /* "pandas/src/generated.pyx":7898
 *                 rindexer[count] = j
 *                 result[count] = rval
 *                 count += 1             # <<<<<<<<<<<<<<
 *                 j += 1
 * 
 */
        __pyx_v_count = (__pyx_v_count + 1);

        /* "pandas/src/generated.pyx":7899
 *                 result[count] = rval
 *                 count += 1
 *                 j += 1             # <<<<<<<<<<<<<<
 * 
 *     return result, lindexer, rindexer
 */
        __pyx_v_j = (__pyx_v_j + 1);
      }
      __pyx_L26:;
    }
    __pyx_L19_break:;
  }
  __pyx_L13:;

  /* "pandas/src/generated.pyx":7901
 *                 j += 1
 * 
 *     return result, lindexer, rindexer             # <<<<<<<<<<<<<<
 * 
 * @cython.wraparound(False)
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_10 = PyTuple_New(3); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7901; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__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_INCREF(((PyObject *)__pyx_v_lindexer));
  PyTuple_SET_ITEM(__pyx_t_10, 1, ((PyObject *)__pyx_v_lindexer));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_lindexer));
  __Pyx_INCREF(((PyObject *)__pyx_v_rindexer));
  PyTuple_SET_ITEM(__pyx_t_10, 2, ((PyObject *)__pyx_v_rindexer));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_rindexer));
  __pyx_r = __pyx_t_10;
  __pyx_t_10 = 0;
  goto __pyx_L0;

  /* "pandas/src/generated.pyx":7776
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def outer_join_indexer_float32(ndarray[float32_t] left,             # <<<<<<<<<<<<<<
 *                                 ndarray[float32_t] right):
 *     cdef:
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_XDECREF(__pyx_t_13);
  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
    __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_left.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_lindexer.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_right.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_rindexer.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas.algos.outer_join_indexer_float32", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_left.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_lindexer.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_right.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_rindexer.rcbuffer->pybuffer);
  __pyx_L2:;
  __Pyx_XDECREF((PyObject *)__pyx_v_lindexer);
  __Pyx_XDECREF((PyObject *)__pyx_v_rindexer);
  __Pyx_XDECREF((PyObject *)__pyx_v_result);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/src/generated.pyx":7905
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def outer_join_indexer_object(ndarray[object] left,             # <<<<<<<<<<<<<<
 *                                 ndarray[object] right):
 *     cdef:
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pandas_5algos_495outer_join_indexer_object(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_5algos_495outer_join_indexer_object = {__Pyx_NAMESTR("outer_join_indexer_object"), (PyCFunction)__pyx_pw_6pandas_5algos_495outer_join_indexer_object, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pw_6pandas_5algos_495outer_join_indexer_object(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyArrayObject *__pyx_v_left = 0;
  PyArrayObject *__pyx_v_right = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("outer_join_indexer_object (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_left,&__pyx_n_s_right,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_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 (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_left)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_right)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("outer_join_indexer_object", 1, 2, 2, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7905; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "outer_join_indexer_object") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7905; __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("outer_join_indexer_object", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7905; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas.algos.outer_join_indexer_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_left), __pyx_ptype_5numpy_ndarray, 1, "left", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7905; __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[2]; __pyx_lineno = 7906; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_494outer_join_indexer_object(__pyx_self, __pyx_v_left, __pyx_v_right);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pandas_5algos_494outer_join_indexer_object(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_left, PyArrayObject *__pyx_v_right) {
  Py_ssize_t __pyx_v_i;
  Py_ssize_t __pyx_v_j;
  Py_ssize_t __pyx_v_nright;
  Py_ssize_t __pyx_v_nleft;
  Py_ssize_t __pyx_v_count;
  PyObject *__pyx_v_lval = 0;
  PyObject *__pyx_v_rval = 0;
  PyArrayObject *__pyx_v_lindexer = 0;
  PyArrayObject *__pyx_v_rindexer = 0;
  PyArrayObject *__pyx_v_result = 0;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_left;
  __Pyx_Buffer __pyx_pybuffer_left;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_lindexer;
  __Pyx_Buffer __pyx_pybuffer_lindexer;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_result;
  __Pyx_Buffer __pyx_pybuffer_result;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_right;
  __Pyx_Buffer __pyx_pybuffer_right;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_rindexer;
  __Pyx_Buffer __pyx_pybuffer_rindexer;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  Py_ssize_t __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  Py_ssize_t __pyx_t_4;
  Py_ssize_t __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_t_7;
  int __pyx_t_8;
  Py_ssize_t __pyx_t_9;
  Py_ssize_t __pyx_t_10;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  PyArrayObject *__pyx_t_14 = NULL;
  int __pyx_t_15;
  PyObject *__pyx_t_16 = NULL;
  PyObject *__pyx_t_17 = NULL;
  PyObject *__pyx_t_18 = NULL;
  PyArrayObject *__pyx_t_19 = NULL;
  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;
  PyObject **__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;
  Py_ssize_t __pyx_t_50;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("outer_join_indexer_object", 0);
  __pyx_pybuffer_lindexer.pybuffer.buf = NULL;
  __pyx_pybuffer_lindexer.refcount = 0;
  __pyx_pybuffernd_lindexer.data = NULL;
  __pyx_pybuffernd_lindexer.rcbuffer = &__pyx_pybuffer_lindexer;
  __pyx_pybuffer_rindexer.pybuffer.buf = NULL;
  __pyx_pybuffer_rindexer.refcount = 0;
  __pyx_pybuffernd_rindexer.data = NULL;
  __pyx_pybuffernd_rindexer.rcbuffer = &__pyx_pybuffer_rindexer;
  __pyx_pybuffer_result.pybuffer.buf = NULL;
  __pyx_pybuffer_result.refcount = 0;
  __pyx_pybuffernd_result.data = NULL;
  __pyx_pybuffernd_result.rcbuffer = &__pyx_pybuffer_result;
  __pyx_pybuffer_left.pybuffer.buf = NULL;
  __pyx_pybuffer_left.refcount = 0;
  __pyx_pybuffernd_left.data = NULL;
  __pyx_pybuffernd_left.rcbuffer = &__pyx_pybuffer_left;
  __pyx_pybuffer_right.pybuffer.buf = NULL;
  __pyx_pybuffer_right.refcount = 0;
  __pyx_pybuffernd_right.data = NULL;
  __pyx_pybuffernd_right.rcbuffer = &__pyx_pybuffer_right;
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_left.rcbuffer->pybuffer, (PyObject*)__pyx_v_left, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7905; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_left.diminfo[0].strides = __pyx_pybuffernd_left.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_left.diminfo[0].shape = __pyx_pybuffernd_left.rcbuffer->pybuffer.shape[0];
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_right.rcbuffer->pybuffer, (PyObject*)__pyx_v_right, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7905; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_right.diminfo[0].strides = __pyx_pybuffernd_right.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_right.diminfo[0].shape = __pyx_pybuffernd_right.rcbuffer->pybuffer.shape[0];

  /* "pandas/src/generated.pyx":7913
 *         ndarray[object] result
 * 
 *     nleft = len(left)             # <<<<<<<<<<<<<<
 *     nright = len(right)
 * 
 */
  __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_left)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7913; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_nleft = __pyx_t_1;

  /* "pandas/src/generated.pyx":7914
 * 
 *     nleft = len(left)
 *     nright = len(right)             # <<<<<<<<<<<<<<
 * 
 *     i = 0
 */
  __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_right)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7914; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_nright = __pyx_t_1;

  /* "pandas/src/generated.pyx":7916
 *     nright = len(right)
 * 
 *     i = 0             # <<<<<<<<<<<<<<
 *     j = 0
 *     count = 0
 */
  __pyx_v_i = 0;

  /* "pandas/src/generated.pyx":7917
 * 
 *     i = 0
 *     j = 0             # <<<<<<<<<<<<<<
 *     count = 0
 *     if nleft == 0:
 */
  __pyx_v_j = 0;

  /* "pandas/src/generated.pyx":7918
 *     i = 0
 *     j = 0
 *     count = 0             # <<<<<<<<<<<<<<
 *     if nleft == 0:
 *         count = nright
 */
  __pyx_v_count = 0;

  /* "pandas/src/generated.pyx":7919
 *     j = 0
 *     count = 0
 *     if nleft == 0:             # <<<<<<<<<<<<<<
 *         count = nright
 *     elif nright == 0:
 */
  __pyx_t_2 = ((__pyx_v_nleft == 0) != 0);
  if (__pyx_t_2) {

    /* "pandas/src/generated.pyx":7920
 *     count = 0
 *     if nleft == 0:
 *         count = nright             # <<<<<<<<<<<<<<
 *     elif nright == 0:
 *         count = nleft
 */
    __pyx_v_count = __pyx_v_nright;
    goto __pyx_L3;
  }

  /* "pandas/src/generated.pyx":7921
 *     if nleft == 0:
 *         count = nright
 *     elif nright == 0:             # <<<<<<<<<<<<<<
 *         count = nleft
 *     else:
 */
  __pyx_t_2 = ((__pyx_v_nright == 0) != 0);
  if (__pyx_t_2) {

    /* "pandas/src/generated.pyx":7922
 *         count = nright
 *     elif nright == 0:
 *         count = nleft             # <<<<<<<<<<<<<<
 *     else:
 *         while True:
 */
    __pyx_v_count = __pyx_v_nleft;
    goto __pyx_L3;
  }
  /*else*/ {

    /* "pandas/src/generated.pyx":7924
 *         count = nleft
 *     else:
 *         while True:             # <<<<<<<<<<<<<<
 *             if i == nleft:
 *                 count += nright - j
 */
    while (1) {

      /* "pandas/src/generated.pyx":7925
 *     else:
 *         while True:
 *             if i == nleft:             # <<<<<<<<<<<<<<
 *                 count += nright - j
 *                 break
 */
      __pyx_t_2 = ((__pyx_v_i == __pyx_v_nleft) != 0);
      if (__pyx_t_2) {

        /* "pandas/src/generated.pyx":7926
 *         while True:
 *             if i == nleft:
 *                 count += nright - j             # <<<<<<<<<<<<<<
 *                 break
 *             if j == nright:
 */
        __pyx_v_count = (__pyx_v_count + (__pyx_v_nright - __pyx_v_j));

        /* "pandas/src/generated.pyx":7927
 *             if i == nleft:
 *                 count += nright - j
 *                 break             # <<<<<<<<<<<<<<
 *             if j == nright:
 *                 count += nleft - i
 */
        goto __pyx_L5_break;
      }

      /* "pandas/src/generated.pyx":7928
 *                 count += nright - j
 *                 break
 *             if j == nright:             # <<<<<<<<<<<<<<
 *                 count += nleft - i
 *                 break
 */
      __pyx_t_2 = ((__pyx_v_j == __pyx_v_nright) != 0);
      if (__pyx_t_2) {

        /* "pandas/src/generated.pyx":7929
 *                 break
 *             if j == nright:
 *                 count += nleft - i             # <<<<<<<<<<<<<<
 *                 break
 * 
 */
        __pyx_v_count = (__pyx_v_count + (__pyx_v_nleft - __pyx_v_i));

        /* "pandas/src/generated.pyx":7930
 *             if j == nright:
 *                 count += nleft - i
 *                 break             # <<<<<<<<<<<<<<
 * 
 *             lval = left[i]
 */
        goto __pyx_L5_break;
      }

      /* "pandas/src/generated.pyx":7932
 *                 break
 * 
 *             lval = left[i]             # <<<<<<<<<<<<<<
 *             rval = right[j]
 *             if lval == rval:
 */
      __pyx_t_1 = __pyx_v_i;
      __pyx_t_3 = (PyObject *) *__Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_left.rcbuffer->pybuffer.buf, __pyx_t_1, __pyx_pybuffernd_left.diminfo[0].strides);
      __Pyx_INCREF((PyObject*)__pyx_t_3);
      __Pyx_XDECREF_SET(__pyx_v_lval, __pyx_t_3);
      __pyx_t_3 = 0;

      /* "pandas/src/generated.pyx":7933
 * 
 *             lval = left[i]
 *             rval = right[j]             # <<<<<<<<<<<<<<
 *             if lval == rval:
 *                 count += 1
 */
      __pyx_t_4 = __pyx_v_j;
      __pyx_t_3 = (PyObject *) *__Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_right.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_right.diminfo[0].strides);
      __Pyx_INCREF((PyObject*)__pyx_t_3);
      __Pyx_XDECREF_SET(__pyx_v_rval, __pyx_t_3);
      __pyx_t_3 = 0;

      /* "pandas/src/generated.pyx":7934
 *             lval = left[i]
 *             rval = right[j]
 *             if lval == rval:             # <<<<<<<<<<<<<<
 *                 count += 1
 *                 if i < nleft - 1:
 */
      __pyx_t_3 = PyObject_RichCompare(__pyx_v_lval, __pyx_v_rval, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7934; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7934; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (__pyx_t_2) {

        /* "pandas/src/generated.pyx":7935
 *             rval = right[j]
 *             if lval == rval:
 *                 count += 1             # <<<<<<<<<<<<<<
 *                 if i < nleft - 1:
 *                     if j < nright - 1 and right[j + 1] == rval:
 */
        __pyx_v_count = (__pyx_v_count + 1);

        /* "pandas/src/generated.pyx":7936
 *             if lval == rval:
 *                 count += 1
 *                 if i < nleft - 1:             # <<<<<<<<<<<<<<
 *                     if j < nright - 1 and right[j + 1] == rval:
 *                         j += 1
 */
        __pyx_t_2 = ((__pyx_v_i < (__pyx_v_nleft - 1)) != 0);
        if (__pyx_t_2) {

          /* "pandas/src/generated.pyx":7937
 *                 count += 1
 *                 if i < nleft - 1:
 *                     if j < nright - 1 and right[j + 1] == rval:             # <<<<<<<<<<<<<<
 *                         j += 1
 *                     else:
 */
          __pyx_t_2 = (__pyx_v_j < (__pyx_v_nright - 1));
          if (__pyx_t_2) {
            __pyx_t_5 = (__pyx_v_j + 1);
            __pyx_t_3 = (PyObject *) *__Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_right.rcbuffer->pybuffer.buf, __pyx_t_5, __pyx_pybuffernd_right.diminfo[0].strides);
            __Pyx_INCREF((PyObject*)__pyx_t_3);
            __pyx_t_6 = PyObject_RichCompare(__pyx_t_3, __pyx_v_rval, Py_EQ); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7937; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
            __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7937; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
            __pyx_t_8 = __pyx_t_7;
          } else {
            __pyx_t_8 = __pyx_t_2;
          }
          if (__pyx_t_8) {

            /* "pandas/src/generated.pyx":7938
 *                 if i < nleft - 1:
 *                     if j < nright - 1 and right[j + 1] == rval:
 *                         j += 1             # <<<<<<<<<<<<<<
 *                     else:
 *                         i += 1
 */
            __pyx_v_j = (__pyx_v_j + 1);
            goto __pyx_L10;
          }
          /*else*/ {

            /* "pandas/src/generated.pyx":7940
 *                         j += 1
 *                     else:
 *                         i += 1             # <<<<<<<<<<<<<<
 *                         if left[i] != rval:
 *                             j += 1
 */
            __pyx_v_i = (__pyx_v_i + 1);

            /* "pandas/src/generated.pyx":7941
 *                     else:
 *                         i += 1
 *                         if left[i] != rval:             # <<<<<<<<<<<<<<
 *                             j += 1
 *                 elif j < nright - 1:
 */
            __pyx_t_9 = __pyx_v_i;
            __pyx_t_6 = (PyObject *) *__Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_left.rcbuffer->pybuffer.buf, __pyx_t_9, __pyx_pybuffernd_left.diminfo[0].strides);
            __Pyx_INCREF((PyObject*)__pyx_t_6);
            __pyx_t_3 = PyObject_RichCompare(__pyx_t_6, __pyx_v_rval, Py_NE); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7941; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
            __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7941; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
            if (__pyx_t_8) {

              /* "pandas/src/generated.pyx":7942
 *                         i += 1
 *                         if left[i] != rval:
 *                             j += 1             # <<<<<<<<<<<<<<
 *                 elif j < nright - 1:
 *                     j += 1
 */
              __pyx_v_j = (__pyx_v_j + 1);
              goto __pyx_L11;
            }
            __pyx_L11:;
          }
          __pyx_L10:;
          goto __pyx_L9;
        }

        /* "pandas/src/generated.pyx":7943
 *                         if left[i] != rval:
 *                             j += 1
 *                 elif j < nright - 1:             # <<<<<<<<<<<<<<
 *                     j += 1
 *                     if lval != right[j]:
 */
        __pyx_t_8 = ((__pyx_v_j < (__pyx_v_nright - 1)) != 0);
        if (__pyx_t_8) {

          /* "pandas/src/generated.pyx":7944
 *                             j += 1
 *                 elif j < nright - 1:
 *                     j += 1             # <<<<<<<<<<<<<<
 *                     if lval != right[j]:
 *                         i += 1
 */
          __pyx_v_j = (__pyx_v_j + 1);

          /* "pandas/src/generated.pyx":7945
 *                 elif j < nright - 1:
 *                     j += 1
 *                     if lval != right[j]:             # <<<<<<<<<<<<<<
 *                         i += 1
 *                 else:
 */
          __pyx_t_10 = __pyx_v_j;
          __pyx_t_3 = (PyObject *) *__Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_right.rcbuffer->pybuffer.buf, __pyx_t_10, __pyx_pybuffernd_right.diminfo[0].strides);
          __Pyx_INCREF((PyObject*)__pyx_t_3);
          __pyx_t_6 = PyObject_RichCompare(__pyx_v_lval, __pyx_t_3, Py_NE); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7945; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
          __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7945; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
          if (__pyx_t_8) {

            /* "pandas/src/generated.pyx":7946
 *                     j += 1
 *                     if lval != right[j]:
 *                         i += 1             # <<<<<<<<<<<<<<
 *                 else:
 *                     # end of the road
 */
            __pyx_v_i = (__pyx_v_i + 1);
            goto __pyx_L12;
          }
          __pyx_L12:;
          goto __pyx_L9;
        }
        /*else*/ {

          /* "pandas/src/generated.pyx":7949
 *                 else:
 *                     # end of the road
 *                     break             # <<<<<<<<<<<<<<
 *             elif lval < rval:
 *                 count += 1
 */
          goto __pyx_L5_break;
        }
        __pyx_L9:;
        goto __pyx_L8;
      }

      /* "pandas/src/generated.pyx":7950
 *                     # end of the road
 *                     break
 *             elif lval < rval:             # <<<<<<<<<<<<<<
 *                 count += 1
 *                 i += 1
 */
      __pyx_t_6 = PyObject_RichCompare(__pyx_v_lval, __pyx_v_rval, Py_LT); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7950; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7950; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (__pyx_t_8) {

        /* "pandas/src/generated.pyx":7951
 *                     break
 *             elif lval < rval:
 *                 count += 1             # <<<<<<<<<<<<<<
 *                 i += 1
 *             else:
 */
        __pyx_v_count = (__pyx_v_count + 1);

        /* "pandas/src/generated.pyx":7952
 *             elif lval < rval:
 *                 count += 1
 *                 i += 1             # <<<<<<<<<<<<<<
 *             else:
 *                 count += 1
 */
        __pyx_v_i = (__pyx_v_i + 1);
        goto __pyx_L8;
      }
      /*else*/ {

        /* "pandas/src/generated.pyx":7954
 *                 i += 1
 *             else:
 *                 count += 1             # <<<<<<<<<<<<<<
 *                 j += 1
 * 
 */
        __pyx_v_count = (__pyx_v_count + 1);

        /* "pandas/src/generated.pyx":7955
 *             else:
 *                 count += 1
 *                 j += 1             # <<<<<<<<<<<<<<
 * 
 *     lindexer = np.empty(count, dtype=np.int64)
 */
        __pyx_v_j = (__pyx_v_j + 1);
      }
      __pyx_L8:;
    }
    __pyx_L5_break:;
  }
  __pyx_L3:;

  /* "pandas/src/generated.pyx":7957
 *                 j += 1
 * 
 *     lindexer = np.empty(count, dtype=np.int64)             # <<<<<<<<<<<<<<
 *     rindexer = np.empty(count, dtype=np.int64)
 *     result = np.empty(count, dtype=object)
 */
  __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7957; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_empty); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7957; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_6 = PyInt_FromSsize_t(__pyx_v_count); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7957; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_11 = PyTuple_New(1); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7957; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_11);
  PyTuple_SET_ITEM(__pyx_t_11, 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[2]; __pyx_lineno = 7957; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_12 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7957; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_12);
  __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_int64); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7957; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_13);
  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
  if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_dtype, __pyx_t_13) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7957; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  __pyx_t_13 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_11, __pyx_t_6); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7957; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_13);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 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 = 7957; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_14 = ((PyArrayObject *)__pyx_t_13);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_lindexer.rcbuffer->pybuffer);
    __pyx_t_15 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_lindexer.rcbuffer->pybuffer, (PyObject*)__pyx_t_14, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack);
    if (unlikely(__pyx_t_15 < 0)) {
      PyErr_Fetch(&__pyx_t_16, &__pyx_t_17, &__pyx_t_18);
      if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_lindexer.rcbuffer->pybuffer, (PyObject*)__pyx_v_lindexer, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {
        Py_XDECREF(__pyx_t_16); Py_XDECREF(__pyx_t_17); Py_XDECREF(__pyx_t_18);
        __Pyx_RaiseBufferFallbackError();
      } else {
        PyErr_Restore(__pyx_t_16, __pyx_t_17, __pyx_t_18);
      }
    }
    __pyx_pybuffernd_lindexer.diminfo[0].strides = __pyx_pybuffernd_lindexer.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_lindexer.diminfo[0].shape = __pyx_pybuffernd_lindexer.rcbuffer->pybuffer.shape[0];
    if (unlikely(__pyx_t_15 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7957; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_14 = 0;
  __pyx_v_lindexer = ((PyArrayObject *)__pyx_t_13);
  __pyx_t_13 = 0;

  /* "pandas/src/generated.pyx":7958
 * 
 *     lindexer = np.empty(count, dtype=np.int64)
 *     rindexer = np.empty(count, dtype=np.int64)             # <<<<<<<<<<<<<<
 *     result = np.empty(count, dtype=object)
 * 
 */
  __pyx_t_13 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7958; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_13);
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_n_s_empty); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7958; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  __pyx_t_13 = PyInt_FromSsize_t(__pyx_v_count); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7958; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_13);
  __pyx_t_11 = PyTuple_New(1); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7958; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_11);
  PyTuple_SET_ITEM(__pyx_t_11, 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 = 7958; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_13);
  __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7958; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_int64); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7958; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_12);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (PyDict_SetItem(__pyx_t_13, __pyx_n_s_dtype, __pyx_t_12) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7958; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
  __pyx_t_12 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_11, __pyx_t_13); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7958; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_12);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  if (!(likely(((__pyx_t_12) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_12, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7958; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_14 = ((PyArrayObject *)__pyx_t_12);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_rindexer.rcbuffer->pybuffer);
    __pyx_t_15 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_rindexer.rcbuffer->pybuffer, (PyObject*)__pyx_t_14, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack);
    if (unlikely(__pyx_t_15 < 0)) {
      PyErr_Fetch(&__pyx_t_18, &__pyx_t_17, &__pyx_t_16);
      if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_rindexer.rcbuffer->pybuffer, (PyObject*)__pyx_v_rindexer, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {
        Py_XDECREF(__pyx_t_18); Py_XDECREF(__pyx_t_17); Py_XDECREF(__pyx_t_16);
        __Pyx_RaiseBufferFallbackError();
      } else {
        PyErr_Restore(__pyx_t_18, __pyx_t_17, __pyx_t_16);
      }
    }
    __pyx_pybuffernd_rindexer.diminfo[0].strides = __pyx_pybuffernd_rindexer.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_rindexer.diminfo[0].shape = __pyx_pybuffernd_rindexer.rcbuffer->pybuffer.shape[0];
    if (unlikely(__pyx_t_15 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7958; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_14 = 0;
  __pyx_v_rindexer = ((PyArrayObject *)__pyx_t_12);
  __pyx_t_12 = 0;

  /* "pandas/src/generated.pyx":7959
 *     lindexer = np.empty(count, dtype=np.int64)
 *     rindexer = np.empty(count, dtype=np.int64)
 *     result = np.empty(count, dtype=object)             # <<<<<<<<<<<<<<
 * 
 *     # do it again, but populate the indexers / result
 */
  __pyx_t_12 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7959; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_12);
  __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_empty); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7959; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_13);
  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
  __pyx_t_12 = PyInt_FromSsize_t(__pyx_v_count); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7959; __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[2]; __pyx_lineno = 7959; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__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 = PyDict_New(); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7959; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_12);
  if (PyDict_SetItem(__pyx_t_12, __pyx_n_s_dtype, __pyx_builtin_object) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7959; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_13, __pyx_t_11, __pyx_t_12); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7959; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 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 = 7959; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_19 = ((PyArrayObject *)__pyx_t_6);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer);
    __pyx_t_15 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_result.rcbuffer->pybuffer, (PyObject*)__pyx_t_19, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack);
    if (unlikely(__pyx_t_15 < 0)) {
      PyErr_Fetch(&__pyx_t_16, &__pyx_t_17, &__pyx_t_18);
      if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_result.rcbuffer->pybuffer, (PyObject*)__pyx_v_result, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {
        Py_XDECREF(__pyx_t_16); Py_XDECREF(__pyx_t_17); Py_XDECREF(__pyx_t_18);
        __Pyx_RaiseBufferFallbackError();
      } else {
        PyErr_Restore(__pyx_t_16, __pyx_t_17, __pyx_t_18);
      }
    }
    __pyx_pybuffernd_result.diminfo[0].strides = __pyx_pybuffernd_result.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_result.diminfo[0].shape = __pyx_pybuffernd_result.rcbuffer->pybuffer.shape[0];
    if (unlikely(__pyx_t_15 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7959; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_19 = 0;
  __pyx_v_result = ((PyArrayObject *)__pyx_t_6);
  __pyx_t_6 = 0;

  /* "pandas/src/generated.pyx":7963
 *     # do it again, but populate the indexers / result
 * 
 *     i = 0             # <<<<<<<<<<<<<<
 *     j = 0
 *     count = 0
 */
  __pyx_v_i = 0;

  /* "pandas/src/generated.pyx":7964
 * 
 *     i = 0
 *     j = 0             # <<<<<<<<<<<<<<
 *     count = 0
 *     if nleft == 0:
 */
  __pyx_v_j = 0;

  /* "pandas/src/generated.pyx":7965
 *     i = 0
 *     j = 0
 *     count = 0             # <<<<<<<<<<<<<<
 *     if nleft == 0:
 *         for j in range(nright):
 */
  __pyx_v_count = 0;

  /* "pandas/src/generated.pyx":7966
 *     j = 0
 *     count = 0
 *     if nleft == 0:             # <<<<<<<<<<<<<<
 *         for j in range(nright):
 *             lindexer[j] = -1
 */
  __pyx_t_8 = ((__pyx_v_nleft == 0) != 0);
  if (__pyx_t_8) {

    /* "pandas/src/generated.pyx":7967
 *     count = 0
 *     if nleft == 0:
 *         for j in range(nright):             # <<<<<<<<<<<<<<
 *             lindexer[j] = -1
 *             rindexer[j] = j
 */
    __pyx_t_20 = __pyx_v_nright;
    for (__pyx_t_21 = 0; __pyx_t_21 < __pyx_t_20; __pyx_t_21+=1) {
      __pyx_v_j = __pyx_t_21;

      /* "pandas/src/generated.pyx":7968
 *     if nleft == 0:
 *         for j in range(nright):
 *             lindexer[j] = -1             # <<<<<<<<<<<<<<
 *             rindexer[j] = j
 *             result[j] = right[j]
 */
      __pyx_t_22 = __pyx_v_j;
      *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_lindexer.rcbuffer->pybuffer.buf, __pyx_t_22, __pyx_pybuffernd_lindexer.diminfo[0].strides) = -1;

      /* "pandas/src/generated.pyx":7969
 *         for j in range(nright):
 *             lindexer[j] = -1
 *             rindexer[j] = j             # <<<<<<<<<<<<<<
 *             result[j] = right[j]
 *     elif nright == 0:
 */
      __pyx_t_23 = __pyx_v_j;
      *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_rindexer.rcbuffer->pybuffer.buf, __pyx_t_23, __pyx_pybuffernd_rindexer.diminfo[0].strides) = __pyx_v_j;

      /* "pandas/src/generated.pyx":7970
 *             lindexer[j] = -1
 *             rindexer[j] = j
 *             result[j] = right[j]             # <<<<<<<<<<<<<<
 *     elif nright == 0:
 *         for i in range(nright):
 */
      __pyx_t_24 = __pyx_v_j;
      __pyx_t_6 = (PyObject *) *__Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_right.rcbuffer->pybuffer.buf, __pyx_t_24, __pyx_pybuffernd_right.diminfo[0].strides);
      __Pyx_INCREF((PyObject*)__pyx_t_6);
      __pyx_t_25 = __pyx_v_j;
      __pyx_t_26 = __Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_25, __pyx_pybuffernd_result.diminfo[0].strides);
      __Pyx_GOTREF(*__pyx_t_26);
      __Pyx_INCREF(__pyx_t_6); __Pyx_DECREF(*__pyx_t_26);
      *__pyx_t_26 = __pyx_t_6;
      __Pyx_GIVEREF(*__pyx_t_26);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    }
    goto __pyx_L13;
  }

  /* "pandas/src/generated.pyx":7971
 *             rindexer[j] = j
 *             result[j] = right[j]
 *     elif nright == 0:             # <<<<<<<<<<<<<<
 *         for i in range(nright):
 *             lindexer[i] = i
 */
  __pyx_t_8 = ((__pyx_v_nright == 0) != 0);
  if (__pyx_t_8) {

    /* "pandas/src/generated.pyx":7972
 *             result[j] = right[j]
 *     elif nright == 0:
 *         for i in range(nright):             # <<<<<<<<<<<<<<
 *             lindexer[i] = i
 *             rindexer[i] = -1
 */
    __pyx_t_20 = __pyx_v_nright;
    for (__pyx_t_21 = 0; __pyx_t_21 < __pyx_t_20; __pyx_t_21+=1) {
      __pyx_v_i = __pyx_t_21;

      /* "pandas/src/generated.pyx":7973
 *     elif nright == 0:
 *         for i in range(nright):
 *             lindexer[i] = i             # <<<<<<<<<<<<<<
 *             rindexer[i] = -1
 *             result[i] = left[i]
 */
      __pyx_t_27 = __pyx_v_i;
      *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_lindexer.rcbuffer->pybuffer.buf, __pyx_t_27, __pyx_pybuffernd_lindexer.diminfo[0].strides) = __pyx_v_i;

      /* "pandas/src/generated.pyx":7974
 *         for i in range(nright):
 *             lindexer[i] = i
 *             rindexer[i] = -1             # <<<<<<<<<<<<<<
 *             result[i] = left[i]
 *     else:
 */
      __pyx_t_28 = __pyx_v_i;
      *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_rindexer.rcbuffer->pybuffer.buf, __pyx_t_28, __pyx_pybuffernd_rindexer.diminfo[0].strides) = -1;

      /* "pandas/src/generated.pyx":7975
 *             lindexer[i] = i
 *             rindexer[i] = -1
 *             result[i] = left[i]             # <<<<<<<<<<<<<<
 *     else:
 *         while True:
 */
      __pyx_t_29 = __pyx_v_i;
      __pyx_t_6 = (PyObject *) *__Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_left.rcbuffer->pybuffer.buf, __pyx_t_29, __pyx_pybuffernd_left.diminfo[0].strides);
      __Pyx_INCREF((PyObject*)__pyx_t_6);
      __pyx_t_30 = __pyx_v_i;
      __pyx_t_26 = __Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_30, __pyx_pybuffernd_result.diminfo[0].strides);
      __Pyx_GOTREF(*__pyx_t_26);
      __Pyx_INCREF(__pyx_t_6); __Pyx_DECREF(*__pyx_t_26);
      *__pyx_t_26 = __pyx_t_6;
      __Pyx_GIVEREF(*__pyx_t_26);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    }
    goto __pyx_L13;
  }
  /*else*/ {

    /* "pandas/src/generated.pyx":7977
 *             result[i] = left[i]
 *     else:
 *         while True:             # <<<<<<<<<<<<<<
 *             if i == nleft:
 *                 while j < nright:
 */
    while (1) {

      /* "pandas/src/generated.pyx":7978
 *     else:
 *         while True:
 *             if i == nleft:             # <<<<<<<<<<<<<<
 *                 while j < nright:
 *                     lindexer[count] = -1
 */
      __pyx_t_8 = ((__pyx_v_i == __pyx_v_nleft) != 0);
      if (__pyx_t_8) {

        /* "pandas/src/generated.pyx":7979
 *         while True:
 *             if i == nleft:
 *                 while j < nright:             # <<<<<<<<<<<<<<
 *                     lindexer[count] = -1
 *                     rindexer[count] = j
 */
        while (1) {
          __pyx_t_8 = ((__pyx_v_j < __pyx_v_nright) != 0);
          if (!__pyx_t_8) break;

          /* "pandas/src/generated.pyx":7980
 *             if i == nleft:
 *                 while j < nright:
 *                     lindexer[count] = -1             # <<<<<<<<<<<<<<
 *                     rindexer[count] = j
 *                     result[count] = right[j]
 */
          __pyx_t_20 = __pyx_v_count;
          *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_lindexer.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_lindexer.diminfo[0].strides) = -1;

          /* "pandas/src/generated.pyx":7981
 *                 while j < nright:
 *                     lindexer[count] = -1
 *                     rindexer[count] = j             # <<<<<<<<<<<<<<
 *                     result[count] = right[j]
 *                     count += 1
 */
          __pyx_t_21 = __pyx_v_count;
          *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_rindexer.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_rindexer.diminfo[0].strides) = __pyx_v_j;

          /* "pandas/src/generated.pyx":7982
 *                     lindexer[count] = -1
 *                     rindexer[count] = j
 *                     result[count] = right[j]             # <<<<<<<<<<<<<<
 *                     count += 1
 *                     j += 1
 */
          __pyx_t_31 = __pyx_v_j;
          __pyx_t_6 = (PyObject *) *__Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_right.rcbuffer->pybuffer.buf, __pyx_t_31, __pyx_pybuffernd_right.diminfo[0].strides);
          __Pyx_INCREF((PyObject*)__pyx_t_6);
          __pyx_t_32 = __pyx_v_count;
          __pyx_t_26 = __Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_32, __pyx_pybuffernd_result.diminfo[0].strides);
          __Pyx_GOTREF(*__pyx_t_26);
          __Pyx_INCREF(__pyx_t_6); __Pyx_DECREF(*__pyx_t_26);
          *__pyx_t_26 = __pyx_t_6;
          __Pyx_GIVEREF(*__pyx_t_26);
          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

          /* "pandas/src/generated.pyx":7983
 *                     rindexer[count] = j
 *                     result[count] = right[j]
 *                     count += 1             # <<<<<<<<<<<<<<
 *                     j += 1
 *                 break
 */
          __pyx_v_count = (__pyx_v_count + 1);

          /* "pandas/src/generated.pyx":7984
 *                     result[count] = right[j]
 *                     count += 1
 *                     j += 1             # <<<<<<<<<<<<<<
 *                 break
 *             if j == nright:
 */
          __pyx_v_j = (__pyx_v_j + 1);
        }

        /* "pandas/src/generated.pyx":7985
 *                     count += 1
 *                     j += 1
 *                 break             # <<<<<<<<<<<<<<
 *             if j == nright:
 *                 while i < nleft:
 */
        goto __pyx_L19_break;
      }

      /* "pandas/src/generated.pyx":7986
 *                     j += 1
 *                 break
 *             if j == nright:             # <<<<<<<<<<<<<<
 *                 while i < nleft:
 *                     lindexer[count] = i
 */
      __pyx_t_8 = ((__pyx_v_j == __pyx_v_nright) != 0);
      if (__pyx_t_8) {

        /* "pandas/src/generated.pyx":7987
 *                 break
 *             if j == nright:
 *                 while i < nleft:             # <<<<<<<<<<<<<<
 *                     lindexer[count] = i
 *                     rindexer[count] = -1
 */
        while (1) {
          __pyx_t_8 = ((__pyx_v_i < __pyx_v_nleft) != 0);
          if (!__pyx_t_8) break;

          /* "pandas/src/generated.pyx":7988
 *             if j == nright:
 *                 while i < nleft:
 *                     lindexer[count] = i             # <<<<<<<<<<<<<<
 *                     rindexer[count] = -1
 *                     result[count] = left[i]
 */
          __pyx_t_33 = __pyx_v_count;
          *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_lindexer.rcbuffer->pybuffer.buf, __pyx_t_33, __pyx_pybuffernd_lindexer.diminfo[0].strides) = __pyx_v_i;

          /* "pandas/src/generated.pyx":7989
 *                 while i < nleft:
 *                     lindexer[count] = i
 *                     rindexer[count] = -1             # <<<<<<<<<<<<<<
 *                     result[count] = left[i]
 *                     count += 1
 */
          __pyx_t_34 = __pyx_v_count;
          *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_rindexer.rcbuffer->pybuffer.buf, __pyx_t_34, __pyx_pybuffernd_rindexer.diminfo[0].strides) = -1;

          /* "pandas/src/generated.pyx":7990
 *                     lindexer[count] = i
 *                     rindexer[count] = -1
 *                     result[count] = left[i]             # <<<<<<<<<<<<<<
 *                     count += 1
 *                     i += 1
 */
          __pyx_t_35 = __pyx_v_i;
          __pyx_t_6 = (PyObject *) *__Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_left.rcbuffer->pybuffer.buf, __pyx_t_35, __pyx_pybuffernd_left.diminfo[0].strides);
          __Pyx_INCREF((PyObject*)__pyx_t_6);
          __pyx_t_36 = __pyx_v_count;
          __pyx_t_26 = __Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_36, __pyx_pybuffernd_result.diminfo[0].strides);
          __Pyx_GOTREF(*__pyx_t_26);
          __Pyx_INCREF(__pyx_t_6); __Pyx_DECREF(*__pyx_t_26);
          *__pyx_t_26 = __pyx_t_6;
          __Pyx_GIVEREF(*__pyx_t_26);
          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

          /* "pandas/src/generated.pyx":7991
 *                     rindexer[count] = -1
 *                     result[count] = left[i]
 *                     count += 1             # <<<<<<<<<<<<<<
 *                     i += 1
 *                 break
 */
          __pyx_v_count = (__pyx_v_count + 1);

          /* "pandas/src/generated.pyx":7992
 *                     result[count] = left[i]
 *                     count += 1
 *                     i += 1             # <<<<<<<<<<<<<<
 *                 break
 * 
 */
          __pyx_v_i = (__pyx_v_i + 1);
        }

        /* "pandas/src/generated.pyx":7993
 *                     count += 1
 *                     i += 1
 *                 break             # <<<<<<<<<<<<<<
 * 
 *             lval = left[i]
 */
        goto __pyx_L19_break;
      }

      /* "pandas/src/generated.pyx":7995
 *                 break
 * 
 *             lval = left[i]             # <<<<<<<<<<<<<<
 *             rval = right[j]
 * 
 */
      __pyx_t_37 = __pyx_v_i;
      __pyx_t_6 = (PyObject *) *__Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_left.rcbuffer->pybuffer.buf, __pyx_t_37, __pyx_pybuffernd_left.diminfo[0].strides);
      __Pyx_INCREF((PyObject*)__pyx_t_6);
      __Pyx_XDECREF_SET(__pyx_v_lval, __pyx_t_6);
      __pyx_t_6 = 0;

      /* "pandas/src/generated.pyx":7996
 * 
 *             lval = left[i]
 *             rval = right[j]             # <<<<<<<<<<<<<<
 * 
 *             if lval == rval:
 */
      __pyx_t_38 = __pyx_v_j;
      __pyx_t_6 = (PyObject *) *__Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_right.rcbuffer->pybuffer.buf, __pyx_t_38, __pyx_pybuffernd_right.diminfo[0].strides);
      __Pyx_INCREF((PyObject*)__pyx_t_6);
      __Pyx_XDECREF_SET(__pyx_v_rval, __pyx_t_6);
      __pyx_t_6 = 0;

      /* "pandas/src/generated.pyx":7998
 *             rval = right[j]
 * 
 *             if lval == rval:             # <<<<<<<<<<<<<<
 *                 lindexer[count] = i
 *                 rindexer[count] = j
 */
      __pyx_t_6 = PyObject_RichCompare(__pyx_v_lval, __pyx_v_rval, Py_EQ); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7998; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7998; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (__pyx_t_8) {

        /* "pandas/src/generated.pyx":7999
 * 
 *             if lval == rval:
 *                 lindexer[count] = i             # <<<<<<<<<<<<<<
 *                 rindexer[count] = j
 *                 result[count] = lval
 */
        __pyx_t_39 = __pyx_v_count;
        *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_lindexer.rcbuffer->pybuffer.buf, __pyx_t_39, __pyx_pybuffernd_lindexer.diminfo[0].strides) = __pyx_v_i;

        /* "pandas/src/generated.pyx":8000
 *             if lval == rval:
 *                 lindexer[count] = i
 *                 rindexer[count] = j             # <<<<<<<<<<<<<<
 *                 result[count] = lval
 *                 count += 1
 */
        __pyx_t_40 = __pyx_v_count;
        *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_rindexer.rcbuffer->pybuffer.buf, __pyx_t_40, __pyx_pybuffernd_rindexer.diminfo[0].strides) = __pyx_v_j;

        /* "pandas/src/generated.pyx":8001
 *                 lindexer[count] = i
 *                 rindexer[count] = j
 *                 result[count] = lval             # <<<<<<<<<<<<<<
 *                 count += 1
 *                 if i < nleft - 1:
 */
        __pyx_t_41 = __pyx_v_count;
        __pyx_t_26 = __Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_41, __pyx_pybuffernd_result.diminfo[0].strides);
        __Pyx_GOTREF(*__pyx_t_26);
        __Pyx_INCREF(__pyx_v_lval); __Pyx_DECREF(*__pyx_t_26);
        *__pyx_t_26 = __pyx_v_lval;
        __Pyx_GIVEREF(*__pyx_t_26);

        /* "pandas/src/generated.pyx":8002
 *                 rindexer[count] = j
 *                 result[count] = lval
 *                 count += 1             # <<<<<<<<<<<<<<
 *                 if i < nleft - 1:
 *                     if j < nright - 1 and right[j + 1] == rval:
 */
        __pyx_v_count = (__pyx_v_count + 1);

        /* "pandas/src/generated.pyx":8003
 *                 result[count] = lval
 *                 count += 1
 *                 if i < nleft - 1:             # <<<<<<<<<<<<<<
 *                     if j < nright - 1 and right[j + 1] == rval:
 *                         j += 1
 */
        __pyx_t_8 = ((__pyx_v_i < (__pyx_v_nleft - 1)) != 0);
        if (__pyx_t_8) {

          /* "pandas/src/generated.pyx":8004
 *                 count += 1
 *                 if i < nleft - 1:
 *                     if j < nright - 1 and right[j + 1] == rval:             # <<<<<<<<<<<<<<
 *                         j += 1
 *                     else:
 */
          __pyx_t_8 = (__pyx_v_j < (__pyx_v_nright - 1));
          if (__pyx_t_8) {
            __pyx_t_42 = (__pyx_v_j + 1);
            __pyx_t_6 = (PyObject *) *__Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_right.rcbuffer->pybuffer.buf, __pyx_t_42, __pyx_pybuffernd_right.diminfo[0].strides);
            __Pyx_INCREF((PyObject*)__pyx_t_6);
            __pyx_t_12 = PyObject_RichCompare(__pyx_t_6, __pyx_v_rval, Py_EQ); __Pyx_XGOTREF(__pyx_t_12); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8004; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
            __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_12); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8004; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
            __pyx_t_7 = __pyx_t_2;
          } else {
            __pyx_t_7 = __pyx_t_8;
          }
          if (__pyx_t_7) {

            /* "pandas/src/generated.pyx":8005
 *                 if i < nleft - 1:
 *                     if j < nright - 1 and right[j + 1] == rval:
 *                         j += 1             # <<<<<<<<<<<<<<
 *                     else:
 *                         i += 1
 */
            __pyx_v_j = (__pyx_v_j + 1);
            goto __pyx_L28;
          }
          /*else*/ {

            /* "pandas/src/generated.pyx":8007
 *                         j += 1
 *                     else:
 *                         i += 1             # <<<<<<<<<<<<<<
 *                         if left[i] != rval:
 *                             j += 1
 */
            __pyx_v_i = (__pyx_v_i + 1);

            /* "pandas/src/generated.pyx":8008
 *                     else:
 *                         i += 1
 *                         if left[i] != rval:             # <<<<<<<<<<<<<<
 *                             j += 1
 *                 elif j < nright - 1:
 */
            __pyx_t_43 = __pyx_v_i;
            __pyx_t_12 = (PyObject *) *__Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_left.rcbuffer->pybuffer.buf, __pyx_t_43, __pyx_pybuffernd_left.diminfo[0].strides);
            __Pyx_INCREF((PyObject*)__pyx_t_12);
            __pyx_t_6 = PyObject_RichCompare(__pyx_t_12, __pyx_v_rval, Py_NE); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8008; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
            __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8008; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
            if (__pyx_t_7) {

              /* "pandas/src/generated.pyx":8009
 *                         i += 1
 *                         if left[i] != rval:
 *                             j += 1             # <<<<<<<<<<<<<<
 *                 elif j < nright - 1:
 *                     j += 1
 */
              __pyx_v_j = (__pyx_v_j + 1);
              goto __pyx_L29;
            }
            __pyx_L29:;
          }
          __pyx_L28:;
          goto __pyx_L27;
        }

        /* "pandas/src/generated.pyx":8010
 *                         if left[i] != rval:
 *                             j += 1
 *                 elif j < nright - 1:             # <<<<<<<<<<<<<<
 *                     j += 1
 *                     if lval != right[j]:
 */
        __pyx_t_7 = ((__pyx_v_j < (__pyx_v_nright - 1)) != 0);
        if (__pyx_t_7) {

          /* "pandas/src/generated.pyx":8011
 *                             j += 1
 *                 elif j < nright - 1:
 *                     j += 1             # <<<<<<<<<<<<<<
 *                     if lval != right[j]:
 *                         i += 1
 */
          __pyx_v_j = (__pyx_v_j + 1);

          /* "pandas/src/generated.pyx":8012
 *                 elif j < nright - 1:
 *                     j += 1
 *                     if lval != right[j]:             # <<<<<<<<<<<<<<
 *                         i += 1
 *                 else:
 */
          __pyx_t_44 = __pyx_v_j;
          __pyx_t_6 = (PyObject *) *__Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_right.rcbuffer->pybuffer.buf, __pyx_t_44, __pyx_pybuffernd_right.diminfo[0].strides);
          __Pyx_INCREF((PyObject*)__pyx_t_6);
          __pyx_t_12 = PyObject_RichCompare(__pyx_v_lval, __pyx_t_6, Py_NE); __Pyx_XGOTREF(__pyx_t_12); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8012; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
          __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_12); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8012; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
          if (__pyx_t_7) {

            /* "pandas/src/generated.pyx":8013
 *                     j += 1
 *                     if lval != right[j]:
 *                         i += 1             # <<<<<<<<<<<<<<
 *                 else:
 *                     # end of the road
 */
            __pyx_v_i = (__pyx_v_i + 1);
            goto __pyx_L30;
          }
          __pyx_L30:;
          goto __pyx_L27;
        }
        /*else*/ {

          /* "pandas/src/generated.pyx":8016
 *                 else:
 *                     # end of the road
 *                     break             # <<<<<<<<<<<<<<
 *             elif lval < rval:
 *                 lindexer[count] = i
 */
          goto __pyx_L19_break;
        }
        __pyx_L27:;
        goto __pyx_L26;
      }

      /* "pandas/src/generated.pyx":8017
 *                     # end of the road
 *                     break
 *             elif lval < rval:             # <<<<<<<<<<<<<<
 *                 lindexer[count] = i
 *                 rindexer[count] = -1
 */
      __pyx_t_12 = PyObject_RichCompare(__pyx_v_lval, __pyx_v_rval, Py_LT); __Pyx_XGOTREF(__pyx_t_12); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8017; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_12); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8017; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      if (__pyx_t_7) {

        /* "pandas/src/generated.pyx":8018
 *                     break
 *             elif lval < rval:
 *                 lindexer[count] = i             # <<<<<<<<<<<<<<
 *                 rindexer[count] = -1
 *                 result[count] = lval
 */
        __pyx_t_45 = __pyx_v_count;
        *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_lindexer.rcbuffer->pybuffer.buf, __pyx_t_45, __pyx_pybuffernd_lindexer.diminfo[0].strides) = __pyx_v_i;

        /* "pandas/src/generated.pyx":8019
 *             elif lval < rval:
 *                 lindexer[count] = i
 *                 rindexer[count] = -1             # <<<<<<<<<<<<<<
 *                 result[count] = lval
 *                 count += 1
 */
        __pyx_t_46 = __pyx_v_count;
        *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_rindexer.rcbuffer->pybuffer.buf, __pyx_t_46, __pyx_pybuffernd_rindexer.diminfo[0].strides) = -1;

        /* "pandas/src/generated.pyx":8020
 *                 lindexer[count] = i
 *                 rindexer[count] = -1
 *                 result[count] = lval             # <<<<<<<<<<<<<<
 *                 count += 1
 *                 i += 1
 */
        __pyx_t_47 = __pyx_v_count;
        __pyx_t_26 = __Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_47, __pyx_pybuffernd_result.diminfo[0].strides);
        __Pyx_GOTREF(*__pyx_t_26);
        __Pyx_INCREF(__pyx_v_lval); __Pyx_DECREF(*__pyx_t_26);
        *__pyx_t_26 = __pyx_v_lval;
        __Pyx_GIVEREF(*__pyx_t_26);

        /* "pandas/src/generated.pyx":8021
 *                 rindexer[count] = -1
 *                 result[count] = lval
 *                 count += 1             # <<<<<<<<<<<<<<
 *                 i += 1
 *             else:
 */
        __pyx_v_count = (__pyx_v_count + 1);

        /* "pandas/src/generated.pyx":8022
 *                 result[count] = lval
 *                 count += 1
 *                 i += 1             # <<<<<<<<<<<<<<
 *             else:
 *                 lindexer[count] = -1
 */
        __pyx_v_i = (__pyx_v_i + 1);
        goto __pyx_L26;
      }
      /*else*/ {

        /* "pandas/src/generated.pyx":8024
 *                 i += 1
 *             else:
 *                 lindexer[count] = -1             # <<<<<<<<<<<<<<
 *                 rindexer[count] = j
 *                 result[count] = rval
 */
        __pyx_t_48 = __pyx_v_count;
        *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_lindexer.rcbuffer->pybuffer.buf, __pyx_t_48, __pyx_pybuffernd_lindexer.diminfo[0].strides) = -1;

        /* "pandas/src/generated.pyx":8025
 *             else:
 *                 lindexer[count] = -1
 *                 rindexer[count] = j             # <<<<<<<<<<<<<<
 *                 result[count] = rval
 *                 count += 1
 */
        __pyx_t_49 = __pyx_v_count;
        *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_rindexer.rcbuffer->pybuffer.buf, __pyx_t_49, __pyx_pybuffernd_rindexer.diminfo[0].strides) = __pyx_v_j;

        /* "pandas/src/generated.pyx":8026
 *                 lindexer[count] = -1
 *                 rindexer[count] = j
 *                 result[count] = rval             # <<<<<<<<<<<<<<
 *                 count += 1
 *                 j += 1
 */
        __pyx_t_50 = __pyx_v_count;
        __pyx_t_26 = __Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_50, __pyx_pybuffernd_result.diminfo[0].strides);
        __Pyx_GOTREF(*__pyx_t_26);
        __Pyx_INCREF(__pyx_v_rval); __Pyx_DECREF(*__pyx_t_26);
        *__pyx_t_26 = __pyx_v_rval;
        __Pyx_GIVEREF(*__pyx_t_26);

        /* "pandas/src/generated.pyx":8027
 *                 rindexer[count] = j
 *                 result[count] = rval
 *                 count += 1             # <<<<<<<<<<<<<<
 *                 j += 1
 * 
 */
        __pyx_v_count = (__pyx_v_count + 1);

        /* "pandas/src/generated.pyx":8028
 *                 result[count] = rval
 *                 count += 1
 *                 j += 1             # <<<<<<<<<<<<<<
 * 
 *     return result, lindexer, rindexer
 */
        __pyx_v_j = (__pyx_v_j + 1);
      }
      __pyx_L26:;
    }
    __pyx_L19_break:;
  }
  __pyx_L13:;

  /* "pandas/src/generated.pyx":8030
 *                 j += 1
 * 
 *     return result, lindexer, rindexer             # <<<<<<<<<<<<<<
 * 
 * @cython.wraparound(False)
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_12 = PyTuple_New(3); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8030; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_12);
  __Pyx_INCREF(((PyObject *)__pyx_v_result));
  PyTuple_SET_ITEM(__pyx_t_12, 0, ((PyObject *)__pyx_v_result));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_result));
  __Pyx_INCREF(((PyObject *)__pyx_v_lindexer));
  PyTuple_SET_ITEM(__pyx_t_12, 1, ((PyObject *)__pyx_v_lindexer));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_lindexer));
  __Pyx_INCREF(((PyObject *)__pyx_v_rindexer));
  PyTuple_SET_ITEM(__pyx_t_12, 2, ((PyObject *)__pyx_v_rindexer));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_rindexer));
  __pyx_r = __pyx_t_12;
  __pyx_t_12 = 0;
  goto __pyx_L0;

  /* "pandas/src/generated.pyx":7905
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def outer_join_indexer_object(ndarray[object] left,             # <<<<<<<<<<<<<<
 *                                 ndarray[object] right):
 *     cdef:
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_XDECREF(__pyx_t_13);
  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
    __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_left.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_lindexer.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_right.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_rindexer.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas.algos.outer_join_indexer_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_left.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_lindexer.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_right.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_rindexer.rcbuffer->pybuffer);
  __pyx_L2:;
  __Pyx_XDECREF(__pyx_v_lval);
  __Pyx_XDECREF(__pyx_v_rval);
  __Pyx_XDECREF((PyObject *)__pyx_v_lindexer);
  __Pyx_XDECREF((PyObject *)__pyx_v_rindexer);
  __Pyx_XDECREF((PyObject *)__pyx_v_result);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/src/generated.pyx":8034
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def outer_join_indexer_int32(ndarray[int32_t] left,             # <<<<<<<<<<<<<<
 *                                 ndarray[int32_t] right):
 *     cdef:
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pandas_5algos_497outer_join_indexer_int32(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_5algos_497outer_join_indexer_int32 = {__Pyx_NAMESTR("outer_join_indexer_int32"), (PyCFunction)__pyx_pw_6pandas_5algos_497outer_join_indexer_int32, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pw_6pandas_5algos_497outer_join_indexer_int32(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyArrayObject *__pyx_v_left = 0;
  PyArrayObject *__pyx_v_right = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("outer_join_indexer_int32 (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_left,&__pyx_n_s_right,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_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 (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_left)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_right)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("outer_join_indexer_int32", 1, 2, 2, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8034; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "outer_join_indexer_int32") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8034; __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("outer_join_indexer_int32", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8034; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas.algos.outer_join_indexer_int32", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_left), __pyx_ptype_5numpy_ndarray, 1, "left", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8034; __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[2]; __pyx_lineno = 8035; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_496outer_join_indexer_int32(__pyx_self, __pyx_v_left, __pyx_v_right);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pandas_5algos_496outer_join_indexer_int32(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_left, PyArrayObject *__pyx_v_right) {
  Py_ssize_t __pyx_v_i;
  Py_ssize_t __pyx_v_j;
  Py_ssize_t __pyx_v_nright;
  Py_ssize_t __pyx_v_nleft;
  Py_ssize_t __pyx_v_count;
  __pyx_t_5numpy_int32_t __pyx_v_lval;
  __pyx_t_5numpy_int32_t __pyx_v_rval;
  PyArrayObject *__pyx_v_lindexer = 0;
  PyArrayObject *__pyx_v_rindexer = 0;
  PyArrayObject *__pyx_v_result = 0;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_left;
  __Pyx_Buffer __pyx_pybuffer_left;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_lindexer;
  __Pyx_Buffer __pyx_pybuffer_lindexer;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_result;
  __Pyx_Buffer __pyx_pybuffer_result;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_right;
  __Pyx_Buffer __pyx_pybuffer_right;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_rindexer;
  __Pyx_Buffer __pyx_pybuffer_rindexer;
  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;
  int __pyx_t_6;
  Py_ssize_t __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;
  PyObject *__pyx_t_13 = NULL;
  PyArrayObject *__pyx_t_14 = NULL;
  int __pyx_t_15;
  PyObject *__pyx_t_16 = NULL;
  PyObject *__pyx_t_17 = NULL;
  PyObject *__pyx_t_18 = NULL;
  PyArrayObject *__pyx_t_19 = NULL;
  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;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("outer_join_indexer_int32", 0);
  __pyx_pybuffer_lindexer.pybuffer.buf = NULL;
  __pyx_pybuffer_lindexer.refcount = 0;
  __pyx_pybuffernd_lindexer.data = NULL;
  __pyx_pybuffernd_lindexer.rcbuffer = &__pyx_pybuffer_lindexer;
  __pyx_pybuffer_rindexer.pybuffer.buf = NULL;
  __pyx_pybuffer_rindexer.refcount = 0;
  __pyx_pybuffernd_rindexer.data = NULL;
  __pyx_pybuffernd_rindexer.rcbuffer = &__pyx_pybuffer_rindexer;
  __pyx_pybuffer_result.pybuffer.buf = NULL;
  __pyx_pybuffer_result.refcount = 0;
  __pyx_pybuffernd_result.data = NULL;
  __pyx_pybuffernd_result.rcbuffer = &__pyx_pybuffer_result;
  __pyx_pybuffer_left.pybuffer.buf = NULL;
  __pyx_pybuffer_left.refcount = 0;
  __pyx_pybuffernd_left.data = NULL;
  __pyx_pybuffernd_left.rcbuffer = &__pyx_pybuffer_left;
  __pyx_pybuffer_right.pybuffer.buf = NULL;
  __pyx_pybuffer_right.refcount = 0;
  __pyx_pybuffernd_right.data = NULL;
  __pyx_pybuffernd_right.rcbuffer = &__pyx_pybuffer_right;
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_left.rcbuffer->pybuffer, (PyObject*)__pyx_v_left, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8034; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_left.diminfo[0].strides = __pyx_pybuffernd_left.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_left.diminfo[0].shape = __pyx_pybuffernd_left.rcbuffer->pybuffer.shape[0];
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_right.rcbuffer->pybuffer, (PyObject*)__pyx_v_right, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8034; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_right.diminfo[0].strides = __pyx_pybuffernd_right.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_right.diminfo[0].shape = __pyx_pybuffernd_right.rcbuffer->pybuffer.shape[0];

  /* "pandas/src/generated.pyx":8042
 *         ndarray[int32_t] result
 * 
 *     nleft = len(left)             # <<<<<<<<<<<<<<
 *     nright = len(right)
 * 
 */
  __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_left)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8042; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_nleft = __pyx_t_1;

  /* "pandas/src/generated.pyx":8043
 * 
 *     nleft = len(left)
 *     nright = len(right)             # <<<<<<<<<<<<<<
 * 
 *     i = 0
 */
  __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_right)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8043; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_nright = __pyx_t_1;

  /* "pandas/src/generated.pyx":8045
 *     nright = len(right)
 * 
 *     i = 0             # <<<<<<<<<<<<<<
 *     j = 0
 *     count = 0
 */
  __pyx_v_i = 0;

  /* "pandas/src/generated.pyx":8046
 * 
 *     i = 0
 *     j = 0             # <<<<<<<<<<<<<<
 *     count = 0
 *     if nleft == 0:
 */
  __pyx_v_j = 0;

  /* "pandas/src/generated.pyx":8047
 *     i = 0
 *     j = 0
 *     count = 0             # <<<<<<<<<<<<<<
 *     if nleft == 0:
 *         count = nright
 */
  __pyx_v_count = 0;

  /* "pandas/src/generated.pyx":8048
 *     j = 0
 *     count = 0
 *     if nleft == 0:             # <<<<<<<<<<<<<<
 *         count = nright
 *     elif nright == 0:
 */
  __pyx_t_2 = ((__pyx_v_nleft == 0) != 0);
  if (__pyx_t_2) {

    /* "pandas/src/generated.pyx":8049
 *     count = 0
 *     if nleft == 0:
 *         count = nright             # <<<<<<<<<<<<<<
 *     elif nright == 0:
 *         count = nleft
 */
    __pyx_v_count = __pyx_v_nright;
    goto __pyx_L3;
  }

  /* "pandas/src/generated.pyx":8050
 *     if nleft == 0:
 *         count = nright
 *     elif nright == 0:             # <<<<<<<<<<<<<<
 *         count = nleft
 *     else:
 */
  __pyx_t_2 = ((__pyx_v_nright == 0) != 0);
  if (__pyx_t_2) {

    /* "pandas/src/generated.pyx":8051
 *         count = nright
 *     elif nright == 0:
 *         count = nleft             # <<<<<<<<<<<<<<
 *     else:
 *         while True:
 */
    __pyx_v_count = __pyx_v_nleft;
    goto __pyx_L3;
  }
  /*else*/ {

    /* "pandas/src/generated.pyx":8053
 *         count = nleft
 *     else:
 *         while True:             # <<<<<<<<<<<<<<
 *             if i == nleft:
 *                 count += nright - j
 */
    while (1) {

      /* "pandas/src/generated.pyx":8054
 *     else:
 *         while True:
 *             if i == nleft:             # <<<<<<<<<<<<<<
 *                 count += nright - j
 *                 break
 */
      __pyx_t_2 = ((__pyx_v_i == __pyx_v_nleft) != 0);
      if (__pyx_t_2) {

        /* "pandas/src/generated.pyx":8055
 *         while True:
 *             if i == nleft:
 *                 count += nright - j             # <<<<<<<<<<<<<<
 *                 break
 *             if j == nright:
 */
        __pyx_v_count = (__pyx_v_count + (__pyx_v_nright - __pyx_v_j));

        /* "pandas/src/generated.pyx":8056
 *             if i == nleft:
 *                 count += nright - j
 *                 break             # <<<<<<<<<<<<<<
 *             if j == nright:
 *                 count += nleft - i
 */
        goto __pyx_L5_break;
      }

      /* "pandas/src/generated.pyx":8057
 *                 count += nright - j
 *                 break
 *             if j == nright:             # <<<<<<<<<<<<<<
 *                 count += nleft - i
 *                 break
 */
      __pyx_t_2 = ((__pyx_v_j == __pyx_v_nright) != 0);
      if (__pyx_t_2) {

        /* "pandas/src/generated.pyx":8058
 *                 break
 *             if j == nright:
 *                 count += nleft - i             # <<<<<<<<<<<<<<
 *                 break
 * 
 */
        __pyx_v_count = (__pyx_v_count + (__pyx_v_nleft - __pyx_v_i));

        /* "pandas/src/generated.pyx":8059
 *             if j == nright:
 *                 count += nleft - i
 *                 break             # <<<<<<<<<<<<<<
 * 
 *             lval = left[i]
 */
        goto __pyx_L5_break;
      }

      /* "pandas/src/generated.pyx":8061
 *                 break
 * 
 *             lval = left[i]             # <<<<<<<<<<<<<<
 *             rval = right[j]
 *             if lval == rval:
 */
      __pyx_t_1 = __pyx_v_i;
      __pyx_v_lval = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_left.rcbuffer->pybuffer.buf, __pyx_t_1, __pyx_pybuffernd_left.diminfo[0].strides));

      /* "pandas/src/generated.pyx":8062
 * 
 *             lval = left[i]
 *             rval = right[j]             # <<<<<<<<<<<<<<
 *             if lval == rval:
 *                 count += 1
 */
      __pyx_t_3 = __pyx_v_j;
      __pyx_v_rval = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_right.rcbuffer->pybuffer.buf, __pyx_t_3, __pyx_pybuffernd_right.diminfo[0].strides));

      /* "pandas/src/generated.pyx":8063
 *             lval = left[i]
 *             rval = right[j]
 *             if lval == rval:             # <<<<<<<<<<<<<<
 *                 count += 1
 *                 if i < nleft - 1:
 */
      __pyx_t_2 = ((__pyx_v_lval == __pyx_v_rval) != 0);
      if (__pyx_t_2) {

        /* "pandas/src/generated.pyx":8064
 *             rval = right[j]
 *             if lval == rval:
 *                 count += 1             # <<<<<<<<<<<<<<
 *                 if i < nleft - 1:
 *                     if j < nright - 1 and right[j + 1] == rval:
 */
        __pyx_v_count = (__pyx_v_count + 1);

        /* "pandas/src/generated.pyx":8065
 *             if lval == rval:
 *                 count += 1
 *                 if i < nleft - 1:             # <<<<<<<<<<<<<<
 *                     if j < nright - 1 and right[j + 1] == rval:
 *                         j += 1
 */
        __pyx_t_2 = ((__pyx_v_i < (__pyx_v_nleft - 1)) != 0);
        if (__pyx_t_2) {

          /* "pandas/src/generated.pyx":8066
 *                 count += 1
 *                 if i < nleft - 1:
 *                     if j < nright - 1 and right[j + 1] == rval:             # <<<<<<<<<<<<<<
 *                         j += 1
 *                     else:
 */
          __pyx_t_2 = ((__pyx_v_j < (__pyx_v_nright - 1)) != 0);
          if (__pyx_t_2) {
            __pyx_t_4 = (__pyx_v_j + 1);
            __pyx_t_5 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_right.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_right.diminfo[0].strides)) == __pyx_v_rval) != 0);
            __pyx_t_6 = __pyx_t_5;
          } else {
            __pyx_t_6 = __pyx_t_2;
          }
          if (__pyx_t_6) {

            /* "pandas/src/generated.pyx":8067
 *                 if i < nleft - 1:
 *                     if j < nright - 1 and right[j + 1] == rval:
 *                         j += 1             # <<<<<<<<<<<<<<
 *                     else:
 *                         i += 1
 */
            __pyx_v_j = (__pyx_v_j + 1);
            goto __pyx_L10;
          }
          /*else*/ {

            /* "pandas/src/generated.pyx":8069
 *                         j += 1
 *                     else:
 *                         i += 1             # <<<<<<<<<<<<<<
 *                         if left[i] != rval:
 *                             j += 1
 */
            __pyx_v_i = (__pyx_v_i + 1);

            /* "pandas/src/generated.pyx":8070
 *                     else:
 *                         i += 1
 *                         if left[i] != rval:             # <<<<<<<<<<<<<<
 *                             j += 1
 *                 elif j < nright - 1:
 */
            __pyx_t_7 = __pyx_v_i;
            __pyx_t_6 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_left.rcbuffer->pybuffer.buf, __pyx_t_7, __pyx_pybuffernd_left.diminfo[0].strides)) != __pyx_v_rval) != 0);
            if (__pyx_t_6) {

              /* "pandas/src/generated.pyx":8071
 *                         i += 1
 *                         if left[i] != rval:
 *                             j += 1             # <<<<<<<<<<<<<<
 *                 elif j < nright - 1:
 *                     j += 1
 */
              __pyx_v_j = (__pyx_v_j + 1);
              goto __pyx_L11;
            }
            __pyx_L11:;
          }
          __pyx_L10:;
          goto __pyx_L9;
        }

        /* "pandas/src/generated.pyx":8072
 *                         if left[i] != rval:
 *                             j += 1
 *                 elif j < nright - 1:             # <<<<<<<<<<<<<<
 *                     j += 1
 *                     if lval != right[j]:
 */
        __pyx_t_6 = ((__pyx_v_j < (__pyx_v_nright - 1)) != 0);
        if (__pyx_t_6) {

          /* "pandas/src/generated.pyx":8073
 *                             j += 1
 *                 elif j < nright - 1:
 *                     j += 1             # <<<<<<<<<<<<<<
 *                     if lval != right[j]:
 *                         i += 1
 */
          __pyx_v_j = (__pyx_v_j + 1);

          /* "pandas/src/generated.pyx":8074
 *                 elif j < nright - 1:
 *                     j += 1
 *                     if lval != right[j]:             # <<<<<<<<<<<<<<
 *                         i += 1
 *                 else:
 */
          __pyx_t_8 = __pyx_v_j;
          __pyx_t_6 = ((__pyx_v_lval != (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_right.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_right.diminfo[0].strides))) != 0);
          if (__pyx_t_6) {

            /* "pandas/src/generated.pyx":8075
 *                     j += 1
 *                     if lval != right[j]:
 *                         i += 1             # <<<<<<<<<<<<<<
 *                 else:
 *                     # end of the road
 */
            __pyx_v_i = (__pyx_v_i + 1);
            goto __pyx_L12;
          }
          __pyx_L12:;
          goto __pyx_L9;
        }
        /*else*/ {

          /* "pandas/src/generated.pyx":8078
 *                 else:
 *                     # end of the road
 *                     break             # <<<<<<<<<<<<<<
 *             elif lval < rval:
 *                 count += 1
 */
          goto __pyx_L5_break;
        }
        __pyx_L9:;
        goto __pyx_L8;
      }

      /* "pandas/src/generated.pyx":8079
 *                     # end of the road
 *                     break
 *             elif lval < rval:             # <<<<<<<<<<<<<<
 *                 count += 1
 *                 i += 1
 */
      __pyx_t_6 = ((__pyx_v_lval < __pyx_v_rval) != 0);
      if (__pyx_t_6) {

        /* "pandas/src/generated.pyx":8080
 *                     break
 *             elif lval < rval:
 *                 count += 1             # <<<<<<<<<<<<<<
 *                 i += 1
 *             else:
 */
        __pyx_v_count = (__pyx_v_count + 1);

        /* "pandas/src/generated.pyx":8081
 *             elif lval < rval:
 *                 count += 1
 *                 i += 1             # <<<<<<<<<<<<<<
 *             else:
 *                 count += 1
 */
        __pyx_v_i = (__pyx_v_i + 1);
        goto __pyx_L8;
      }
      /*else*/ {

        /* "pandas/src/generated.pyx":8083
 *                 i += 1
 *             else:
 *                 count += 1             # <<<<<<<<<<<<<<
 *                 j += 1
 * 
 */
        __pyx_v_count = (__pyx_v_count + 1);

        /* "pandas/src/generated.pyx":8084
 *             else:
 *                 count += 1
 *                 j += 1             # <<<<<<<<<<<<<<
 * 
 *     lindexer = np.empty(count, dtype=np.int64)
 */
        __pyx_v_j = (__pyx_v_j + 1);
      }
      __pyx_L8:;
    }
    __pyx_L5_break:;
  }
  __pyx_L3:;

  /* "pandas/src/generated.pyx":8086
 *                 j += 1
 * 
 *     lindexer = np.empty(count, dtype=np.int64)             # <<<<<<<<<<<<<<
 *     rindexer = np.empty(count, dtype=np.int64)
 *     result = np.empty(count, dtype=np.int32)
 */
  __pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8086; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_9);
  __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_empty); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8086; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_10);
  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  __pyx_t_9 = PyInt_FromSsize_t(__pyx_v_count); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8086; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_9);
  __pyx_t_11 = PyTuple_New(1); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8086; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_11);
  PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_9);
  __Pyx_GIVEREF(__pyx_t_9);
  __pyx_t_9 = 0;
  __pyx_t_9 = PyDict_New(); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8086; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_9);
  __pyx_t_12 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8086; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_12);
  __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_int64); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8086; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_13);
  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
  if (PyDict_SetItem(__pyx_t_9, __pyx_n_s_dtype, __pyx_t_13) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8086; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  __pyx_t_13 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_t_11, __pyx_t_9); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8086; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_13);
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 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 = 8086; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_14 = ((PyArrayObject *)__pyx_t_13);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_lindexer.rcbuffer->pybuffer);
    __pyx_t_15 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_lindexer.rcbuffer->pybuffer, (PyObject*)__pyx_t_14, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack);
    if (unlikely(__pyx_t_15 < 0)) {
      PyErr_Fetch(&__pyx_t_16, &__pyx_t_17, &__pyx_t_18);
      if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_lindexer.rcbuffer->pybuffer, (PyObject*)__pyx_v_lindexer, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {
        Py_XDECREF(__pyx_t_16); Py_XDECREF(__pyx_t_17); Py_XDECREF(__pyx_t_18);
        __Pyx_RaiseBufferFallbackError();
      } else {
        PyErr_Restore(__pyx_t_16, __pyx_t_17, __pyx_t_18);
      }
    }
    __pyx_pybuffernd_lindexer.diminfo[0].strides = __pyx_pybuffernd_lindexer.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_lindexer.diminfo[0].shape = __pyx_pybuffernd_lindexer.rcbuffer->pybuffer.shape[0];
    if (unlikely(__pyx_t_15 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8086; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_14 = 0;
  __pyx_v_lindexer = ((PyArrayObject *)__pyx_t_13);
  __pyx_t_13 = 0;

  /* "pandas/src/generated.pyx":8087
 * 
 *     lindexer = np.empty(count, dtype=np.int64)
 *     rindexer = np.empty(count, dtype=np.int64)             # <<<<<<<<<<<<<<
 *     result = np.empty(count, dtype=np.int32)
 * 
 */
  __pyx_t_13 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8087; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_13);
  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_n_s_empty); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8087; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_9);
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  __pyx_t_13 = PyInt_FromSsize_t(__pyx_v_count); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8087; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_13);
  __pyx_t_11 = PyTuple_New(1); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8087; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_11);
  PyTuple_SET_ITEM(__pyx_t_11, 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 = 8087; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_13);
  __pyx_t_10 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8087; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_10);
  __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_int64); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8087; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_12);
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  if (PyDict_SetItem(__pyx_t_13, __pyx_n_s_dtype, __pyx_t_12) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8087; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
  __pyx_t_12 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_11, __pyx_t_13); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8087; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_12);
  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  if (!(likely(((__pyx_t_12) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_12, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8087; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_14 = ((PyArrayObject *)__pyx_t_12);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_rindexer.rcbuffer->pybuffer);
    __pyx_t_15 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_rindexer.rcbuffer->pybuffer, (PyObject*)__pyx_t_14, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack);
    if (unlikely(__pyx_t_15 < 0)) {
      PyErr_Fetch(&__pyx_t_18, &__pyx_t_17, &__pyx_t_16);
      if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_rindexer.rcbuffer->pybuffer, (PyObject*)__pyx_v_rindexer, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {
        Py_XDECREF(__pyx_t_18); Py_XDECREF(__pyx_t_17); Py_XDECREF(__pyx_t_16);
        __Pyx_RaiseBufferFallbackError();
      } else {
        PyErr_Restore(__pyx_t_18, __pyx_t_17, __pyx_t_16);
      }
    }
    __pyx_pybuffernd_rindexer.diminfo[0].strides = __pyx_pybuffernd_rindexer.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_rindexer.diminfo[0].shape = __pyx_pybuffernd_rindexer.rcbuffer->pybuffer.shape[0];
    if (unlikely(__pyx_t_15 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8087; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_14 = 0;
  __pyx_v_rindexer = ((PyArrayObject *)__pyx_t_12);
  __pyx_t_12 = 0;

  /* "pandas/src/generated.pyx":8088
 *     lindexer = np.empty(count, dtype=np.int64)
 *     rindexer = np.empty(count, dtype=np.int64)
 *     result = np.empty(count, dtype=np.int32)             # <<<<<<<<<<<<<<
 * 
 *     # do it again, but populate the indexers / result
 */
  __pyx_t_12 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8088; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_12);
  __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_empty); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8088; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_13);
  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
  __pyx_t_12 = PyInt_FromSsize_t(__pyx_v_count); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8088; __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[2]; __pyx_lineno = 8088; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__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 = PyDict_New(); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8088; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_12);
  __pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8088; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_9);
  __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_int32); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8088; __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_12, __pyx_n_s_dtype, __pyx_t_10) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8088; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_13, __pyx_t_11, __pyx_t_12); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8088; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_10);
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
  if (!(likely(((__pyx_t_10) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_10, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8088; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_19 = ((PyArrayObject *)__pyx_t_10);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer);
    __pyx_t_15 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_result.rcbuffer->pybuffer, (PyObject*)__pyx_t_19, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack);
    if (unlikely(__pyx_t_15 < 0)) {
      PyErr_Fetch(&__pyx_t_16, &__pyx_t_17, &__pyx_t_18);
      if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_result.rcbuffer->pybuffer, (PyObject*)__pyx_v_result, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {
        Py_XDECREF(__pyx_t_16); Py_XDECREF(__pyx_t_17); Py_XDECREF(__pyx_t_18);
        __Pyx_RaiseBufferFallbackError();
      } else {
        PyErr_Restore(__pyx_t_16, __pyx_t_17, __pyx_t_18);
      }
    }
    __pyx_pybuffernd_result.diminfo[0].strides = __pyx_pybuffernd_result.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_result.diminfo[0].shape = __pyx_pybuffernd_result.rcbuffer->pybuffer.shape[0];
    if (unlikely(__pyx_t_15 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8088; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_19 = 0;
  __pyx_v_result = ((PyArrayObject *)__pyx_t_10);
  __pyx_t_10 = 0;

  /* "pandas/src/generated.pyx":8092
 *     # do it again, but populate the indexers / result
 * 
 *     i = 0             # <<<<<<<<<<<<<<
 *     j = 0
 *     count = 0
 */
  __pyx_v_i = 0;

  /* "pandas/src/generated.pyx":8093
 * 
 *     i = 0
 *     j = 0             # <<<<<<<<<<<<<<
 *     count = 0
 *     if nleft == 0:
 */
  __pyx_v_j = 0;

  /* "pandas/src/generated.pyx":8094
 *     i = 0
 *     j = 0
 *     count = 0             # <<<<<<<<<<<<<<
 *     if nleft == 0:
 *         for j in range(nright):
 */
  __pyx_v_count = 0;

  /* "pandas/src/generated.pyx":8095
 *     j = 0
 *     count = 0
 *     if nleft == 0:             # <<<<<<<<<<<<<<
 *         for j in range(nright):
 *             lindexer[j] = -1
 */
  __pyx_t_6 = ((__pyx_v_nleft == 0) != 0);
  if (__pyx_t_6) {

    /* "pandas/src/generated.pyx":8096
 *     count = 0
 *     if nleft == 0:
 *         for j in range(nright):             # <<<<<<<<<<<<<<
 *             lindexer[j] = -1
 *             rindexer[j] = j
 */
    __pyx_t_20 = __pyx_v_nright;
    for (__pyx_t_21 = 0; __pyx_t_21 < __pyx_t_20; __pyx_t_21+=1) {
      __pyx_v_j = __pyx_t_21;

      /* "pandas/src/generated.pyx":8097
 *     if nleft == 0:
 *         for j in range(nright):
 *             lindexer[j] = -1             # <<<<<<<<<<<<<<
 *             rindexer[j] = j
 *             result[j] = right[j]
 */
      __pyx_t_22 = __pyx_v_j;
      *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_lindexer.rcbuffer->pybuffer.buf, __pyx_t_22, __pyx_pybuffernd_lindexer.diminfo[0].strides) = -1;

      /* "pandas/src/generated.pyx":8098
 *         for j in range(nright):
 *             lindexer[j] = -1
 *             rindexer[j] = j             # <<<<<<<<<<<<<<
 *             result[j] = right[j]
 *     elif nright == 0:
 */
      __pyx_t_23 = __pyx_v_j;
      *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_rindexer.rcbuffer->pybuffer.buf, __pyx_t_23, __pyx_pybuffernd_rindexer.diminfo[0].strides) = __pyx_v_j;

      /* "pandas/src/generated.pyx":8099
 *             lindexer[j] = -1
 *             rindexer[j] = j
 *             result[j] = right[j]             # <<<<<<<<<<<<<<
 *     elif nright == 0:
 *         for i in range(nright):
 */
      __pyx_t_24 = __pyx_v_j;
      __pyx_t_25 = __pyx_v_j;
      *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_25, __pyx_pybuffernd_result.diminfo[0].strides) = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_right.rcbuffer->pybuffer.buf, __pyx_t_24, __pyx_pybuffernd_right.diminfo[0].strides));
    }
    goto __pyx_L13;
  }

  /* "pandas/src/generated.pyx":8100
 *             rindexer[j] = j
 *             result[j] = right[j]
 *     elif nright == 0:             # <<<<<<<<<<<<<<
 *         for i in range(nright):
 *             lindexer[i] = i
 */
  __pyx_t_6 = ((__pyx_v_nright == 0) != 0);
  if (__pyx_t_6) {

    /* "pandas/src/generated.pyx":8101
 *             result[j] = right[j]
 *     elif nright == 0:
 *         for i in range(nright):             # <<<<<<<<<<<<<<
 *             lindexer[i] = i
 *             rindexer[i] = -1
 */
    __pyx_t_20 = __pyx_v_nright;
    for (__pyx_t_21 = 0; __pyx_t_21 < __pyx_t_20; __pyx_t_21+=1) {
      __pyx_v_i = __pyx_t_21;

      /* "pandas/src/generated.pyx":8102
 *     elif nright == 0:
 *         for i in range(nright):
 *             lindexer[i] = i             # <<<<<<<<<<<<<<
 *             rindexer[i] = -1
 *             result[i] = left[i]
 */
      __pyx_t_26 = __pyx_v_i;
      *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_lindexer.rcbuffer->pybuffer.buf, __pyx_t_26, __pyx_pybuffernd_lindexer.diminfo[0].strides) = __pyx_v_i;

      /* "pandas/src/generated.pyx":8103
 *         for i in range(nright):
 *             lindexer[i] = i
 *             rindexer[i] = -1             # <<<<<<<<<<<<<<
 *             result[i] = left[i]
 *     else:
 */
      __pyx_t_27 = __pyx_v_i;
      *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_rindexer.rcbuffer->pybuffer.buf, __pyx_t_27, __pyx_pybuffernd_rindexer.diminfo[0].strides) = -1;

      /* "pandas/src/generated.pyx":8104
 *             lindexer[i] = i
 *             rindexer[i] = -1
 *             result[i] = left[i]             # <<<<<<<<<<<<<<
 *     else:
 *         while True:
 */
      __pyx_t_28 = __pyx_v_i;
      __pyx_t_29 = __pyx_v_i;
      *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_29, __pyx_pybuffernd_result.diminfo[0].strides) = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_left.rcbuffer->pybuffer.buf, __pyx_t_28, __pyx_pybuffernd_left.diminfo[0].strides));
    }
    goto __pyx_L13;
  }
  /*else*/ {

    /* "pandas/src/generated.pyx":8106
 *             result[i] = left[i]
 *     else:
 *         while True:             # <<<<<<<<<<<<<<
 *             if i == nleft:
 *                 while j < nright:
 */
    while (1) {

      /* "pandas/src/generated.pyx":8107
 *     else:
 *         while True:
 *             if i == nleft:             # <<<<<<<<<<<<<<
 *                 while j < nright:
 *                     lindexer[count] = -1
 */
      __pyx_t_6 = ((__pyx_v_i == __pyx_v_nleft) != 0);
      if (__pyx_t_6) {

        /* "pandas/src/generated.pyx":8108
 *         while True:
 *             if i == nleft:
 *                 while j < nright:             # <<<<<<<<<<<<<<
 *                     lindexer[count] = -1
 *                     rindexer[count] = j
 */
        while (1) {
          __pyx_t_6 = ((__pyx_v_j < __pyx_v_nright) != 0);
          if (!__pyx_t_6) break;

          /* "pandas/src/generated.pyx":8109
 *             if i == nleft:
 *                 while j < nright:
 *                     lindexer[count] = -1             # <<<<<<<<<<<<<<
 *                     rindexer[count] = j
 *                     result[count] = right[j]
 */
          __pyx_t_20 = __pyx_v_count;
          *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_lindexer.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_lindexer.diminfo[0].strides) = -1;

          /* "pandas/src/generated.pyx":8110
 *                 while j < nright:
 *                     lindexer[count] = -1
 *                     rindexer[count] = j             # <<<<<<<<<<<<<<
 *                     result[count] = right[j]
 *                     count += 1
 */
          __pyx_t_21 = __pyx_v_count;
          *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_rindexer.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_rindexer.diminfo[0].strides) = __pyx_v_j;

          /* "pandas/src/generated.pyx":8111
 *                     lindexer[count] = -1
 *                     rindexer[count] = j
 *                     result[count] = right[j]             # <<<<<<<<<<<<<<
 *                     count += 1
 *                     j += 1
 */
          __pyx_t_30 = __pyx_v_j;
          __pyx_t_31 = __pyx_v_count;
          *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_31, __pyx_pybuffernd_result.diminfo[0].strides) = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_right.rcbuffer->pybuffer.buf, __pyx_t_30, __pyx_pybuffernd_right.diminfo[0].strides));

          /* "pandas/src/generated.pyx":8112
 *                     rindexer[count] = j
 *                     result[count] = right[j]
 *                     count += 1             # <<<<<<<<<<<<<<
 *                     j += 1
 *                 break
 */
          __pyx_v_count = (__pyx_v_count + 1);

          /* "pandas/src/generated.pyx":8113
 *                     result[count] = right[j]
 *                     count += 1
 *                     j += 1             # <<<<<<<<<<<<<<
 *                 break
 *             if j == nright:
 */
          __pyx_v_j = (__pyx_v_j + 1);
        }

        /* "pandas/src/generated.pyx":8114
 *                     count += 1
 *                     j += 1
 *                 break             # <<<<<<<<<<<<<<
 *             if j == nright:
 *                 while i < nleft:
 */
        goto __pyx_L19_break;
      }

      /* "pandas/src/generated.pyx":8115
 *                     j += 1
 *                 break
 *             if j == nright:             # <<<<<<<<<<<<<<
 *                 while i < nleft:
 *                     lindexer[count] = i
 */
      __pyx_t_6 = ((__pyx_v_j == __pyx_v_nright) != 0);
      if (__pyx_t_6) {

        /* "pandas/src/generated.pyx":8116
 *                 break
 *             if j == nright:
 *                 while i < nleft:             # <<<<<<<<<<<<<<
 *                     lindexer[count] = i
 *                     rindexer[count] = -1
 */
        while (1) {
          __pyx_t_6 = ((__pyx_v_i < __pyx_v_nleft) != 0);
          if (!__pyx_t_6) break;

          /* "pandas/src/generated.pyx":8117
 *             if j == nright:
 *                 while i < nleft:
 *                     lindexer[count] = i             # <<<<<<<<<<<<<<
 *                     rindexer[count] = -1
 *                     result[count] = left[i]
 */
          __pyx_t_32 = __pyx_v_count;
          *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_lindexer.rcbuffer->pybuffer.buf, __pyx_t_32, __pyx_pybuffernd_lindexer.diminfo[0].strides) = __pyx_v_i;

          /* "pandas/src/generated.pyx":8118
 *                 while i < nleft:
 *                     lindexer[count] = i
 *                     rindexer[count] = -1             # <<<<<<<<<<<<<<
 *                     result[count] = left[i]
 *                     count += 1
 */
          __pyx_t_33 = __pyx_v_count;
          *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_rindexer.rcbuffer->pybuffer.buf, __pyx_t_33, __pyx_pybuffernd_rindexer.diminfo[0].strides) = -1;

          /* "pandas/src/generated.pyx":8119
 *                     lindexer[count] = i
 *                     rindexer[count] = -1
 *                     result[count] = left[i]             # <<<<<<<<<<<<<<
 *                     count += 1
 *                     i += 1
 */
          __pyx_t_34 = __pyx_v_i;
          __pyx_t_35 = __pyx_v_count;
          *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_35, __pyx_pybuffernd_result.diminfo[0].strides) = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_left.rcbuffer->pybuffer.buf, __pyx_t_34, __pyx_pybuffernd_left.diminfo[0].strides));

          /* "pandas/src/generated.pyx":8120
 *                     rindexer[count] = -1
 *                     result[count] = left[i]
 *                     count += 1             # <<<<<<<<<<<<<<
 *                     i += 1
 *                 break
 */
          __pyx_v_count = (__pyx_v_count + 1);

          /* "pandas/src/generated.pyx":8121
 *                     result[count] = left[i]
 *                     count += 1
 *                     i += 1             # <<<<<<<<<<<<<<
 *                 break
 * 
 */
          __pyx_v_i = (__pyx_v_i + 1);
        }

        /* "pandas/src/generated.pyx":8122
 *                     count += 1
 *                     i += 1
 *                 break             # <<<<<<<<<<<<<<
 * 
 *             lval = left[i]
 */
        goto __pyx_L19_break;
      }

      /* "pandas/src/generated.pyx":8124
 *                 break
 * 
 *             lval = left[i]             # <<<<<<<<<<<<<<
 *             rval = right[j]
 * 
 */
      __pyx_t_36 = __pyx_v_i;
      __pyx_v_lval = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_left.rcbuffer->pybuffer.buf, __pyx_t_36, __pyx_pybuffernd_left.diminfo[0].strides));

      /* "pandas/src/generated.pyx":8125
 * 
 *             lval = left[i]
 *             rval = right[j]             # <<<<<<<<<<<<<<
 * 
 *             if lval == rval:
 */
      __pyx_t_37 = __pyx_v_j;
      __pyx_v_rval = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_right.rcbuffer->pybuffer.buf, __pyx_t_37, __pyx_pybuffernd_right.diminfo[0].strides));

      /* "pandas/src/generated.pyx":8127
 *             rval = right[j]
 * 
 *             if lval == rval:             # <<<<<<<<<<<<<<
 *                 lindexer[count] = i
 *                 rindexer[count] = j
 */
      __pyx_t_6 = ((__pyx_v_lval == __pyx_v_rval) != 0);
      if (__pyx_t_6) {

        /* "pandas/src/generated.pyx":8128
 * 
 *             if lval == rval:
 *                 lindexer[count] = i             # <<<<<<<<<<<<<<
 *                 rindexer[count] = j
 *                 result[count] = lval
 */
        __pyx_t_38 = __pyx_v_count;
        *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_lindexer.rcbuffer->pybuffer.buf, __pyx_t_38, __pyx_pybuffernd_lindexer.diminfo[0].strides) = __pyx_v_i;

        /* "pandas/src/generated.pyx":8129
 *             if lval == rval:
 *                 lindexer[count] = i
 *                 rindexer[count] = j             # <<<<<<<<<<<<<<
 *                 result[count] = lval
 *                 count += 1
 */
        __pyx_t_39 = __pyx_v_count;
        *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_rindexer.rcbuffer->pybuffer.buf, __pyx_t_39, __pyx_pybuffernd_rindexer.diminfo[0].strides) = __pyx_v_j;

        /* "pandas/src/generated.pyx":8130
 *                 lindexer[count] = i
 *                 rindexer[count] = j
 *                 result[count] = lval             # <<<<<<<<<<<<<<
 *                 count += 1
 *                 if i < nleft - 1:
 */
        __pyx_t_40 = __pyx_v_count;
        *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_40, __pyx_pybuffernd_result.diminfo[0].strides) = __pyx_v_lval;

        /* "pandas/src/generated.pyx":8131
 *                 rindexer[count] = j
 *                 result[count] = lval
 *                 count += 1             # <<<<<<<<<<<<<<
 *                 if i < nleft - 1:
 *                     if j < nright - 1 and right[j + 1] == rval:
 */
        __pyx_v_count = (__pyx_v_count + 1);

        /* "pandas/src/generated.pyx":8132
 *                 result[count] = lval
 *                 count += 1
 *                 if i < nleft - 1:             # <<<<<<<<<<<<<<
 *                     if j < nright - 1 and right[j + 1] == rval:
 *                         j += 1
 */
        __pyx_t_6 = ((__pyx_v_i < (__pyx_v_nleft - 1)) != 0);
        if (__pyx_t_6) {

          /* "pandas/src/generated.pyx":8133
 *                 count += 1
 *                 if i < nleft - 1:
 *                     if j < nright - 1 and right[j + 1] == rval:             # <<<<<<<<<<<<<<
 *                         j += 1
 *                     else:
 */
          __pyx_t_6 = ((__pyx_v_j < (__pyx_v_nright - 1)) != 0);
          if (__pyx_t_6) {
            __pyx_t_41 = (__pyx_v_j + 1);
            __pyx_t_2 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_right.rcbuffer->pybuffer.buf, __pyx_t_41, __pyx_pybuffernd_right.diminfo[0].strides)) == __pyx_v_rval) != 0);
            __pyx_t_5 = __pyx_t_2;
          } else {
            __pyx_t_5 = __pyx_t_6;
          }
          if (__pyx_t_5) {

            /* "pandas/src/generated.pyx":8134
 *                 if i < nleft - 1:
 *                     if j < nright - 1 and right[j + 1] == rval:
 *                         j += 1             # <<<<<<<<<<<<<<
 *                     else:
 *                         i += 1
 */
            __pyx_v_j = (__pyx_v_j + 1);
            goto __pyx_L28;
          }
          /*else*/ {

            /* "pandas/src/generated.pyx":8136
 *                         j += 1
 *                     else:
 *                         i += 1             # <<<<<<<<<<<<<<
 *                         if left[i] != rval:
 *                             j += 1
 */
            __pyx_v_i = (__pyx_v_i + 1);

            /* "pandas/src/generated.pyx":8137
 *                     else:
 *                         i += 1
 *                         if left[i] != rval:             # <<<<<<<<<<<<<<
 *                             j += 1
 *                 elif j < nright - 1:
 */
            __pyx_t_42 = __pyx_v_i;
            __pyx_t_5 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_left.rcbuffer->pybuffer.buf, __pyx_t_42, __pyx_pybuffernd_left.diminfo[0].strides)) != __pyx_v_rval) != 0);
            if (__pyx_t_5) {

              /* "pandas/src/generated.pyx":8138
 *                         i += 1
 *                         if left[i] != rval:
 *                             j += 1             # <<<<<<<<<<<<<<
 *                 elif j < nright - 1:
 *                     j += 1
 */
              __pyx_v_j = (__pyx_v_j + 1);
              goto __pyx_L29;
            }
            __pyx_L29:;
          }
          __pyx_L28:;
          goto __pyx_L27;
        }

        /* "pandas/src/generated.pyx":8139
 *                         if left[i] != rval:
 *                             j += 1
 *                 elif j < nright - 1:             # <<<<<<<<<<<<<<
 *                     j += 1
 *                     if lval != right[j]:
 */
        __pyx_t_5 = ((__pyx_v_j < (__pyx_v_nright - 1)) != 0);
        if (__pyx_t_5) {

          /* "pandas/src/generated.pyx":8140
 *                             j += 1
 *                 elif j < nright - 1:
 *                     j += 1             # <<<<<<<<<<<<<<
 *                     if lval != right[j]:
 *                         i += 1
 */
          __pyx_v_j = (__pyx_v_j + 1);

          /* "pandas/src/generated.pyx":8141
 *                 elif j < nright - 1:
 *                     j += 1
 *                     if lval != right[j]:             # <<<<<<<<<<<<<<
 *                         i += 1
 *                 else:
 */
          __pyx_t_43 = __pyx_v_j;
          __pyx_t_5 = ((__pyx_v_lval != (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_right.rcbuffer->pybuffer.buf, __pyx_t_43, __pyx_pybuffernd_right.diminfo[0].strides))) != 0);
          if (__pyx_t_5) {

            /* "pandas/src/generated.pyx":8142
 *                     j += 1
 *                     if lval != right[j]:
 *                         i += 1             # <<<<<<<<<<<<<<
 *                 else:
 *                     # end of the road
 */
            __pyx_v_i = (__pyx_v_i + 1);
            goto __pyx_L30;
          }
          __pyx_L30:;
          goto __pyx_L27;
        }
        /*else*/ {

          /* "pandas/src/generated.pyx":8145
 *                 else:
 *                     # end of the road
 *                     break             # <<<<<<<<<<<<<<
 *             elif lval < rval:
 *                 lindexer[count] = i
 */
          goto __pyx_L19_break;
        }
        __pyx_L27:;
        goto __pyx_L26;
      }

      /* "pandas/src/generated.pyx":8146
 *                     # end of the road
 *                     break
 *             elif lval < rval:             # <<<<<<<<<<<<<<
 *                 lindexer[count] = i
 *                 rindexer[count] = -1
 */
      __pyx_t_5 = ((__pyx_v_lval < __pyx_v_rval) != 0);
      if (__pyx_t_5) {

        /* "pandas/src/generated.pyx":8147
 *                     break
 *             elif lval < rval:
 *                 lindexer[count] = i             # <<<<<<<<<<<<<<
 *                 rindexer[count] = -1
 *                 result[count] = lval
 */
        __pyx_t_44 = __pyx_v_count;
        *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_lindexer.rcbuffer->pybuffer.buf, __pyx_t_44, __pyx_pybuffernd_lindexer.diminfo[0].strides) = __pyx_v_i;

        /* "pandas/src/generated.pyx":8148
 *             elif lval < rval:
 *                 lindexer[count] = i
 *                 rindexer[count] = -1             # <<<<<<<<<<<<<<
 *                 result[count] = lval
 *                 count += 1
 */
        __pyx_t_45 = __pyx_v_count;
        *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_rindexer.rcbuffer->pybuffer.buf, __pyx_t_45, __pyx_pybuffernd_rindexer.diminfo[0].strides) = -1;

        /* "pandas/src/generated.pyx":8149
 *                 lindexer[count] = i
 *                 rindexer[count] = -1
 *                 result[count] = lval             # <<<<<<<<<<<<<<
 *                 count += 1
 *                 i += 1
 */
        __pyx_t_46 = __pyx_v_count;
        *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_46, __pyx_pybuffernd_result.diminfo[0].strides) = __pyx_v_lval;

        /* "pandas/src/generated.pyx":8150
 *                 rindexer[count] = -1
 *                 result[count] = lval
 *                 count += 1             # <<<<<<<<<<<<<<
 *                 i += 1
 *             else:
 */
        __pyx_v_count = (__pyx_v_count + 1);

        /* "pandas/src/generated.pyx":8151
 *                 result[count] = lval
 *                 count += 1
 *                 i += 1             # <<<<<<<<<<<<<<
 *             else:
 *                 lindexer[count] = -1
 */
        __pyx_v_i = (__pyx_v_i + 1);
        goto __pyx_L26;
      }
      /*else*/ {

        /* "pandas/src/generated.pyx":8153
 *                 i += 1
 *             else:
 *                 lindexer[count] = -1             # <<<<<<<<<<<<<<
 *                 rindexer[count] = j
 *                 result[count] = rval
 */
        __pyx_t_47 = __pyx_v_count;
        *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_lindexer.rcbuffer->pybuffer.buf, __pyx_t_47, __pyx_pybuffernd_lindexer.diminfo[0].strides) = -1;

        /* "pandas/src/generated.pyx":8154
 *             else:
 *                 lindexer[count] = -1
 *                 rindexer[count] = j             # <<<<<<<<<<<<<<
 *                 result[count] = rval
 *                 count += 1
 */
        __pyx_t_48 = __pyx_v_count;
        *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_rindexer.rcbuffer->pybuffer.buf, __pyx_t_48, __pyx_pybuffernd_rindexer.diminfo[0].strides) = __pyx_v_j;

        /* "pandas/src/generated.pyx":8155
 *                 lindexer[count] = -1
 *                 rindexer[count] = j
 *                 result[count] = rval             # <<<<<<<<<<<<<<
 *                 count += 1
 *                 j += 1
 */
        __pyx_t_49 = __pyx_v_count;
        *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_49, __pyx_pybuffernd_result.diminfo[0].strides) = __pyx_v_rval;

        /* "pandas/src/generated.pyx":8156
 *                 rindexer[count] = j
 *                 result[count] = rval
 *                 count += 1             # <<<<<<<<<<<<<<
 *                 j += 1
 * 
 */
        __pyx_v_count = (__pyx_v_count + 1);

        /* "pandas/src/generated.pyx":8157
 *                 result[count] = rval
 *                 count += 1
 *                 j += 1             # <<<<<<<<<<<<<<
 * 
 *     return result, lindexer, rindexer
 */
        __pyx_v_j = (__pyx_v_j + 1);
      }
      __pyx_L26:;
    }
    __pyx_L19_break:;
  }
  __pyx_L13:;

  /* "pandas/src/generated.pyx":8159
 *                 j += 1
 * 
 *     return result, lindexer, rindexer             # <<<<<<<<<<<<<<
 * 
 * @cython.wraparound(False)
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_10 = PyTuple_New(3); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8159; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__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_INCREF(((PyObject *)__pyx_v_lindexer));
  PyTuple_SET_ITEM(__pyx_t_10, 1, ((PyObject *)__pyx_v_lindexer));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_lindexer));
  __Pyx_INCREF(((PyObject *)__pyx_v_rindexer));
  PyTuple_SET_ITEM(__pyx_t_10, 2, ((PyObject *)__pyx_v_rindexer));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_rindexer));
  __pyx_r = __pyx_t_10;
  __pyx_t_10 = 0;
  goto __pyx_L0;

  /* "pandas/src/generated.pyx":8034
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def outer_join_indexer_int32(ndarray[int32_t] left,             # <<<<<<<<<<<<<<
 *                                 ndarray[int32_t] right):
 *     cdef:
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_XDECREF(__pyx_t_13);
  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
    __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_left.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_lindexer.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_right.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_rindexer.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas.algos.outer_join_indexer_int32", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_left.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_lindexer.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_right.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_rindexer.rcbuffer->pybuffer);
  __pyx_L2:;
  __Pyx_XDECREF((PyObject *)__pyx_v_lindexer);
  __Pyx_XDECREF((PyObject *)__pyx_v_rindexer);
  __Pyx_XDECREF((PyObject *)__pyx_v_result);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/src/generated.pyx":8163
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def outer_join_indexer_int64(ndarray[int64_t] left,             # <<<<<<<<<<<<<<
 *                                 ndarray[int64_t] right):
 *     cdef:
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pandas_5algos_499outer_join_indexer_int64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_5algos_499outer_join_indexer_int64 = {__Pyx_NAMESTR("outer_join_indexer_int64"), (PyCFunction)__pyx_pw_6pandas_5algos_499outer_join_indexer_int64, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pw_6pandas_5algos_499outer_join_indexer_int64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyArrayObject *__pyx_v_left = 0;
  PyArrayObject *__pyx_v_right = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("outer_join_indexer_int64 (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_left,&__pyx_n_s_right,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_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 (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_left)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_right)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("outer_join_indexer_int64", 1, 2, 2, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8163; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "outer_join_indexer_int64") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8163; __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("outer_join_indexer_int64", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8163; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas.algos.outer_join_indexer_int64", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_left), __pyx_ptype_5numpy_ndarray, 1, "left", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8163; __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[2]; __pyx_lineno = 8164; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_498outer_join_indexer_int64(__pyx_self, __pyx_v_left, __pyx_v_right);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pandas_5algos_498outer_join_indexer_int64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_left, PyArrayObject *__pyx_v_right) {
  Py_ssize_t __pyx_v_i;
  Py_ssize_t __pyx_v_j;
  Py_ssize_t __pyx_v_nright;
  Py_ssize_t __pyx_v_nleft;
  Py_ssize_t __pyx_v_count;
  __pyx_t_5numpy_int64_t __pyx_v_lval;
  __pyx_t_5numpy_int64_t __pyx_v_rval;
  PyArrayObject *__pyx_v_lindexer = 0;
  PyArrayObject *__pyx_v_rindexer = 0;
  PyArrayObject *__pyx_v_result = 0;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_left;
  __Pyx_Buffer __pyx_pybuffer_left;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_lindexer;
  __Pyx_Buffer __pyx_pybuffer_lindexer;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_result;
  __Pyx_Buffer __pyx_pybuffer_result;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_right;
  __Pyx_Buffer __pyx_pybuffer_right;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_rindexer;
  __Pyx_Buffer __pyx_pybuffer_rindexer;
  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;
  int __pyx_t_6;
  Py_ssize_t __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;
  PyObject *__pyx_t_13 = NULL;
  PyArrayObject *__pyx_t_14 = NULL;
  int __pyx_t_15;
  PyObject *__pyx_t_16 = NULL;
  PyObject *__pyx_t_17 = NULL;
  PyObject *__pyx_t_18 = NULL;
  PyArrayObject *__pyx_t_19 = NULL;
  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;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("outer_join_indexer_int64", 0);
  __pyx_pybuffer_lindexer.pybuffer.buf = NULL;
  __pyx_pybuffer_lindexer.refcount = 0;
  __pyx_pybuffernd_lindexer.data = NULL;
  __pyx_pybuffernd_lindexer.rcbuffer = &__pyx_pybuffer_lindexer;
  __pyx_pybuffer_rindexer.pybuffer.buf = NULL;
  __pyx_pybuffer_rindexer.refcount = 0;
  __pyx_pybuffernd_rindexer.data = NULL;
  __pyx_pybuffernd_rindexer.rcbuffer = &__pyx_pybuffer_rindexer;
  __pyx_pybuffer_result.pybuffer.buf = NULL;
  __pyx_pybuffer_result.refcount = 0;
  __pyx_pybuffernd_result.data = NULL;
  __pyx_pybuffernd_result.rcbuffer = &__pyx_pybuffer_result;
  __pyx_pybuffer_left.pybuffer.buf = NULL;
  __pyx_pybuffer_left.refcount = 0;
  __pyx_pybuffernd_left.data = NULL;
  __pyx_pybuffernd_left.rcbuffer = &__pyx_pybuffer_left;
  __pyx_pybuffer_right.pybuffer.buf = NULL;
  __pyx_pybuffer_right.refcount = 0;
  __pyx_pybuffernd_right.data = NULL;
  __pyx_pybuffernd_right.rcbuffer = &__pyx_pybuffer_right;
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_left.rcbuffer->pybuffer, (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[2]; __pyx_lineno = 8163; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_left.diminfo[0].strides = __pyx_pybuffernd_left.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_left.diminfo[0].shape = __pyx_pybuffernd_left.rcbuffer->pybuffer.shape[0];
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_right.rcbuffer->pybuffer, (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[2]; __pyx_lineno = 8163; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_right.diminfo[0].strides = __pyx_pybuffernd_right.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_right.diminfo[0].shape = __pyx_pybuffernd_right.rcbuffer->pybuffer.shape[0];

  /* "pandas/src/generated.pyx":8171
 *         ndarray[int64_t] result
 * 
 *     nleft = len(left)             # <<<<<<<<<<<<<<
 *     nright = len(right)
 * 
 */
  __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_left)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8171; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_nleft = __pyx_t_1;

  /* "pandas/src/generated.pyx":8172
 * 
 *     nleft = len(left)
 *     nright = len(right)             # <<<<<<<<<<<<<<
 * 
 *     i = 0
 */
  __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_right)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8172; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_nright = __pyx_t_1;

  /* "pandas/src/generated.pyx":8174
 *     nright = len(right)
 * 
 *     i = 0             # <<<<<<<<<<<<<<
 *     j = 0
 *     count = 0
 */
  __pyx_v_i = 0;

  /* "pandas/src/generated.pyx":8175
 * 
 *     i = 0
 *     j = 0             # <<<<<<<<<<<<<<
 *     count = 0
 *     if nleft == 0:
 */
  __pyx_v_j = 0;

  /* "pandas/src/generated.pyx":8176
 *     i = 0
 *     j = 0
 *     count = 0             # <<<<<<<<<<<<<<
 *     if nleft == 0:
 *         count = nright
 */
  __pyx_v_count = 0;

  /* "pandas/src/generated.pyx":8177
 *     j = 0
 *     count = 0
 *     if nleft == 0:             # <<<<<<<<<<<<<<
 *         count = nright
 *     elif nright == 0:
 */
  __pyx_t_2 = ((__pyx_v_nleft == 0) != 0);
  if (__pyx_t_2) {

    /* "pandas/src/generated.pyx":8178
 *     count = 0
 *     if nleft == 0:
 *         count = nright             # <<<<<<<<<<<<<<
 *     elif nright == 0:
 *         count = nleft
 */
    __pyx_v_count = __pyx_v_nright;
    goto __pyx_L3;
  }

  /* "pandas/src/generated.pyx":8179
 *     if nleft == 0:
 *         count = nright
 *     elif nright == 0:             # <<<<<<<<<<<<<<
 *         count = nleft
 *     else:
 */
  __pyx_t_2 = ((__pyx_v_nright == 0) != 0);
  if (__pyx_t_2) {

    /* "pandas/src/generated.pyx":8180
 *         count = nright
 *     elif nright == 0:
 *         count = nleft             # <<<<<<<<<<<<<<
 *     else:
 *         while True:
 */
    __pyx_v_count = __pyx_v_nleft;
    goto __pyx_L3;
  }
  /*else*/ {

    /* "pandas/src/generated.pyx":8182
 *         count = nleft
 *     else:
 *         while True:             # <<<<<<<<<<<<<<
 *             if i == nleft:
 *                 count += nright - j
 */
    while (1) {

      /* "pandas/src/generated.pyx":8183
 *     else:
 *         while True:
 *             if i == nleft:             # <<<<<<<<<<<<<<
 *                 count += nright - j
 *                 break
 */
      __pyx_t_2 = ((__pyx_v_i == __pyx_v_nleft) != 0);
      if (__pyx_t_2) {

        /* "pandas/src/generated.pyx":8184
 *         while True:
 *             if i == nleft:
 *                 count += nright - j             # <<<<<<<<<<<<<<
 *                 break
 *             if j == nright:
 */
        __pyx_v_count = (__pyx_v_count + (__pyx_v_nright - __pyx_v_j));

        /* "pandas/src/generated.pyx":8185
 *             if i == nleft:
 *                 count += nright - j
 *                 break             # <<<<<<<<<<<<<<
 *             if j == nright:
 *                 count += nleft - i
 */
        goto __pyx_L5_break;
      }

      /* "pandas/src/generated.pyx":8186
 *                 count += nright - j
 *                 break
 *             if j == nright:             # <<<<<<<<<<<<<<
 *                 count += nleft - i
 *                 break
 */
      __pyx_t_2 = ((__pyx_v_j == __pyx_v_nright) != 0);
      if (__pyx_t_2) {

        /* "pandas/src/generated.pyx":8187
 *                 break
 *             if j == nright:
 *                 count += nleft - i             # <<<<<<<<<<<<<<
 *                 break
 * 
 */
        __pyx_v_count = (__pyx_v_count + (__pyx_v_nleft - __pyx_v_i));

        /* "pandas/src/generated.pyx":8188
 *             if j == nright:
 *                 count += nleft - i
 *                 break             # <<<<<<<<<<<<<<
 * 
 *             lval = left[i]
 */
        goto __pyx_L5_break;
      }

      /* "pandas/src/generated.pyx":8190
 *                 break
 * 
 *             lval = left[i]             # <<<<<<<<<<<<<<
 *             rval = right[j]
 *             if lval == rval:
 */
      __pyx_t_1 = __pyx_v_i;
      __pyx_v_lval = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_left.rcbuffer->pybuffer.buf, __pyx_t_1, __pyx_pybuffernd_left.diminfo[0].strides));

      /* "pandas/src/generated.pyx":8191
 * 
 *             lval = left[i]
 *             rval = right[j]             # <<<<<<<<<<<<<<
 *             if lval == rval:
 *                 count += 1
 */
      __pyx_t_3 = __pyx_v_j;
      __pyx_v_rval = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_right.rcbuffer->pybuffer.buf, __pyx_t_3, __pyx_pybuffernd_right.diminfo[0].strides));

      /* "pandas/src/generated.pyx":8192
 *             lval = left[i]
 *             rval = right[j]
 *             if lval == rval:             # <<<<<<<<<<<<<<
 *                 count += 1
 *                 if i < nleft - 1:
 */
      __pyx_t_2 = ((__pyx_v_lval == __pyx_v_rval) != 0);
      if (__pyx_t_2) {

        /* "pandas/src/generated.pyx":8193
 *             rval = right[j]
 *             if lval == rval:
 *                 count += 1             # <<<<<<<<<<<<<<
 *                 if i < nleft - 1:
 *                     if j < nright - 1 and right[j + 1] == rval:
 */
        __pyx_v_count = (__pyx_v_count + 1);

        /* "pandas/src/generated.pyx":8194
 *             if lval == rval:
 *                 count += 1
 *                 if i < nleft - 1:             # <<<<<<<<<<<<<<
 *                     if j < nright - 1 and right[j + 1] == rval:
 *                         j += 1
 */
        __pyx_t_2 = ((__pyx_v_i < (__pyx_v_nleft - 1)) != 0);
        if (__pyx_t_2) {

          /* "pandas/src/generated.pyx":8195
 *                 count += 1
 *                 if i < nleft - 1:
 *                     if j < nright - 1 and right[j + 1] == rval:             # <<<<<<<<<<<<<<
 *                         j += 1
 *                     else:
 */
          __pyx_t_2 = ((__pyx_v_j < (__pyx_v_nright - 1)) != 0);
          if (__pyx_t_2) {
            __pyx_t_4 = (__pyx_v_j + 1);
            __pyx_t_5 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_right.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_right.diminfo[0].strides)) == __pyx_v_rval) != 0);
            __pyx_t_6 = __pyx_t_5;
          } else {
            __pyx_t_6 = __pyx_t_2;
          }
          if (__pyx_t_6) {

            /* "pandas/src/generated.pyx":8196
 *                 if i < nleft - 1:
 *                     if j < nright - 1 and right[j + 1] == rval:
 *                         j += 1             # <<<<<<<<<<<<<<
 *                     else:
 *                         i += 1
 */
            __pyx_v_j = (__pyx_v_j + 1);
            goto __pyx_L10;
          }
          /*else*/ {

            /* "pandas/src/generated.pyx":8198
 *                         j += 1
 *                     else:
 *                         i += 1             # <<<<<<<<<<<<<<
 *                         if left[i] != rval:
 *                             j += 1
 */
            __pyx_v_i = (__pyx_v_i + 1);

            /* "pandas/src/generated.pyx":8199
 *                     else:
 *                         i += 1
 *                         if left[i] != rval:             # <<<<<<<<<<<<<<
 *                             j += 1
 *                 elif j < nright - 1:
 */
            __pyx_t_7 = __pyx_v_i;
            __pyx_t_6 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_left.rcbuffer->pybuffer.buf, __pyx_t_7, __pyx_pybuffernd_left.diminfo[0].strides)) != __pyx_v_rval) != 0);
            if (__pyx_t_6) {

              /* "pandas/src/generated.pyx":8200
 *                         i += 1
 *                         if left[i] != rval:
 *                             j += 1             # <<<<<<<<<<<<<<
 *                 elif j < nright - 1:
 *                     j += 1
 */
              __pyx_v_j = (__pyx_v_j + 1);
              goto __pyx_L11;
            }
            __pyx_L11:;
          }
          __pyx_L10:;
          goto __pyx_L9;
        }

        /* "pandas/src/generated.pyx":8201
 *                         if left[i] != rval:
 *                             j += 1
 *                 elif j < nright - 1:             # <<<<<<<<<<<<<<
 *                     j += 1
 *                     if lval != right[j]:
 */
        __pyx_t_6 = ((__pyx_v_j < (__pyx_v_nright - 1)) != 0);
        if (__pyx_t_6) {

          /* "pandas/src/generated.pyx":8202
 *                             j += 1
 *                 elif j < nright - 1:
 *                     j += 1             # <<<<<<<<<<<<<<
 *                     if lval != right[j]:
 *                         i += 1
 */
          __pyx_v_j = (__pyx_v_j + 1);

          /* "pandas/src/generated.pyx":8203
 *                 elif j < nright - 1:
 *                     j += 1
 *                     if lval != right[j]:             # <<<<<<<<<<<<<<
 *                         i += 1
 *                 else:
 */
          __pyx_t_8 = __pyx_v_j;
          __pyx_t_6 = ((__pyx_v_lval != (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_right.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_right.diminfo[0].strides))) != 0);
          if (__pyx_t_6) {

            /* "pandas/src/generated.pyx":8204
 *                     j += 1
 *                     if lval != right[j]:
 *                         i += 1             # <<<<<<<<<<<<<<
 *                 else:
 *                     # end of the road
 */
            __pyx_v_i = (__pyx_v_i + 1);
            goto __pyx_L12;
          }
          __pyx_L12:;
          goto __pyx_L9;
        }
        /*else*/ {

          /* "pandas/src/generated.pyx":8207
 *                 else:
 *                     # end of the road
 *                     break             # <<<<<<<<<<<<<<
 *             elif lval < rval:
 *                 count += 1
 */
          goto __pyx_L5_break;
        }
        __pyx_L9:;
        goto __pyx_L8;
      }

      /* "pandas/src/generated.pyx":8208
 *                     # end of the road
 *                     break
 *             elif lval < rval:             # <<<<<<<<<<<<<<
 *                 count += 1
 *                 i += 1
 */
      __pyx_t_6 = ((__pyx_v_lval < __pyx_v_rval) != 0);
      if (__pyx_t_6) {

        /* "pandas/src/generated.pyx":8209
 *                     break
 *             elif lval < rval:
 *                 count += 1             # <<<<<<<<<<<<<<
 *                 i += 1
 *             else:
 */
        __pyx_v_count = (__pyx_v_count + 1);

        /* "pandas/src/generated.pyx":8210
 *             elif lval < rval:
 *                 count += 1
 *                 i += 1             # <<<<<<<<<<<<<<
 *             else:
 *                 count += 1
 */
        __pyx_v_i = (__pyx_v_i + 1);
        goto __pyx_L8;
      }
      /*else*/ {

        /* "pandas/src/generated.pyx":8212
 *                 i += 1
 *             else:
 *                 count += 1             # <<<<<<<<<<<<<<
 *                 j += 1
 * 
 */
        __pyx_v_count = (__pyx_v_count + 1);

        /* "pandas/src/generated.pyx":8213
 *             else:
 *                 count += 1
 *                 j += 1             # <<<<<<<<<<<<<<
 * 
 *     lindexer = np.empty(count, dtype=np.int64)
 */
        __pyx_v_j = (__pyx_v_j + 1);
      }
      __pyx_L8:;
    }
    __pyx_L5_break:;
  }
  __pyx_L3:;

  /* "pandas/src/generated.pyx":8215
 *                 j += 1
 * 
 *     lindexer = np.empty(count, dtype=np.int64)             # <<<<<<<<<<<<<<
 *     rindexer = np.empty(count, dtype=np.int64)
 *     result = np.empty(count, dtype=np.int64)
 */
  __pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8215; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_9);
  __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_empty); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8215; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_10);
  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  __pyx_t_9 = PyInt_FromSsize_t(__pyx_v_count); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8215; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_9);
  __pyx_t_11 = PyTuple_New(1); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8215; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_11);
  PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_9);
  __Pyx_GIVEREF(__pyx_t_9);
  __pyx_t_9 = 0;
  __pyx_t_9 = PyDict_New(); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8215; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_9);
  __pyx_t_12 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8215; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_12);
  __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_int64); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8215; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_13);
  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
  if (PyDict_SetItem(__pyx_t_9, __pyx_n_s_dtype, __pyx_t_13) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8215; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  __pyx_t_13 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_t_11, __pyx_t_9); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8215; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_13);
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 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 = 8215; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_14 = ((PyArrayObject *)__pyx_t_13);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_lindexer.rcbuffer->pybuffer);
    __pyx_t_15 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_lindexer.rcbuffer->pybuffer, (PyObject*)__pyx_t_14, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack);
    if (unlikely(__pyx_t_15 < 0)) {
      PyErr_Fetch(&__pyx_t_16, &__pyx_t_17, &__pyx_t_18);
      if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_lindexer.rcbuffer->pybuffer, (PyObject*)__pyx_v_lindexer, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {
        Py_XDECREF(__pyx_t_16); Py_XDECREF(__pyx_t_17); Py_XDECREF(__pyx_t_18);
        __Pyx_RaiseBufferFallbackError();
      } else {
        PyErr_Restore(__pyx_t_16, __pyx_t_17, __pyx_t_18);
      }
    }
    __pyx_pybuffernd_lindexer.diminfo[0].strides = __pyx_pybuffernd_lindexer.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_lindexer.diminfo[0].shape = __pyx_pybuffernd_lindexer.rcbuffer->pybuffer.shape[0];
    if (unlikely(__pyx_t_15 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8215; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_14 = 0;
  __pyx_v_lindexer = ((PyArrayObject *)__pyx_t_13);
  __pyx_t_13 = 0;

  /* "pandas/src/generated.pyx":8216
 * 
 *     lindexer = np.empty(count, dtype=np.int64)
 *     rindexer = np.empty(count, dtype=np.int64)             # <<<<<<<<<<<<<<
 *     result = np.empty(count, dtype=np.int64)
 * 
 */
  __pyx_t_13 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8216; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_13);
  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_n_s_empty); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8216; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_9);
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  __pyx_t_13 = PyInt_FromSsize_t(__pyx_v_count); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8216; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_13);
  __pyx_t_11 = PyTuple_New(1); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8216; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_11);
  PyTuple_SET_ITEM(__pyx_t_11, 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 = 8216; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_13);
  __pyx_t_10 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8216; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_10);
  __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_int64); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8216; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_12);
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  if (PyDict_SetItem(__pyx_t_13, __pyx_n_s_dtype, __pyx_t_12) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8216; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
  __pyx_t_12 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_11, __pyx_t_13); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8216; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_12);
  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  if (!(likely(((__pyx_t_12) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_12, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8216; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_14 = ((PyArrayObject *)__pyx_t_12);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_rindexer.rcbuffer->pybuffer);
    __pyx_t_15 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_rindexer.rcbuffer->pybuffer, (PyObject*)__pyx_t_14, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack);
    if (unlikely(__pyx_t_15 < 0)) {
      PyErr_Fetch(&__pyx_t_18, &__pyx_t_17, &__pyx_t_16);
      if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_rindexer.rcbuffer->pybuffer, (PyObject*)__pyx_v_rindexer, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {
        Py_XDECREF(__pyx_t_18); Py_XDECREF(__pyx_t_17); Py_XDECREF(__pyx_t_16);
        __Pyx_RaiseBufferFallbackError();
      } else {
        PyErr_Restore(__pyx_t_18, __pyx_t_17, __pyx_t_16);
      }
    }
    __pyx_pybuffernd_rindexer.diminfo[0].strides = __pyx_pybuffernd_rindexer.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_rindexer.diminfo[0].shape = __pyx_pybuffernd_rindexer.rcbuffer->pybuffer.shape[0];
    if (unlikely(__pyx_t_15 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8216; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_14 = 0;
  __pyx_v_rindexer = ((PyArrayObject *)__pyx_t_12);
  __pyx_t_12 = 0;

  /* "pandas/src/generated.pyx":8217
 *     lindexer = np.empty(count, dtype=np.int64)
 *     rindexer = np.empty(count, dtype=np.int64)
 *     result = np.empty(count, dtype=np.int64)             # <<<<<<<<<<<<<<
 * 
 *     # do it again, but populate the indexers / result
 */
  __pyx_t_12 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8217; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_12);
  __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_empty); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8217; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_13);
  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
  __pyx_t_12 = PyInt_FromSsize_t(__pyx_v_count); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8217; __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[2]; __pyx_lineno = 8217; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__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 = PyDict_New(); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8217; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_12);
  __pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8217; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_9);
  __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_int64); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8217; __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_12, __pyx_n_s_dtype, __pyx_t_10) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8217; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_13, __pyx_t_11, __pyx_t_12); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8217; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_10);
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
  if (!(likely(((__pyx_t_10) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_10, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8217; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_19 = ((PyArrayObject *)__pyx_t_10);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer);
    __pyx_t_15 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_result.rcbuffer->pybuffer, (PyObject*)__pyx_t_19, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack);
    if (unlikely(__pyx_t_15 < 0)) {
      PyErr_Fetch(&__pyx_t_16, &__pyx_t_17, &__pyx_t_18);
      if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_result.rcbuffer->pybuffer, (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_16); Py_XDECREF(__pyx_t_17); Py_XDECREF(__pyx_t_18);
        __Pyx_RaiseBufferFallbackError();
      } else {
        PyErr_Restore(__pyx_t_16, __pyx_t_17, __pyx_t_18);
      }
    }
    __pyx_pybuffernd_result.diminfo[0].strides = __pyx_pybuffernd_result.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_result.diminfo[0].shape = __pyx_pybuffernd_result.rcbuffer->pybuffer.shape[0];
    if (unlikely(__pyx_t_15 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8217; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_19 = 0;
  __pyx_v_result = ((PyArrayObject *)__pyx_t_10);
  __pyx_t_10 = 0;

  /* "pandas/src/generated.pyx":8221
 *     # do it again, but populate the indexers / result
 * 
 *     i = 0             # <<<<<<<<<<<<<<
 *     j = 0
 *     count = 0
 */
  __pyx_v_i = 0;

  /* "pandas/src/generated.pyx":8222
 * 
 *     i = 0
 *     j = 0             # <<<<<<<<<<<<<<
 *     count = 0
 *     if nleft == 0:
 */
  __pyx_v_j = 0;

  /* "pandas/src/generated.pyx":8223
 *     i = 0
 *     j = 0
 *     count = 0             # <<<<<<<<<<<<<<
 *     if nleft == 0:
 *         for j in range(nright):
 */
  __pyx_v_count = 0;

  /* "pandas/src/generated.pyx":8224
 *     j = 0
 *     count = 0
 *     if nleft == 0:             # <<<<<<<<<<<<<<
 *         for j in range(nright):
 *             lindexer[j] = -1
 */
  __pyx_t_6 = ((__pyx_v_nleft == 0) != 0);
  if (__pyx_t_6) {

    /* "pandas/src/generated.pyx":8225
 *     count = 0
 *     if nleft == 0:
 *         for j in range(nright):             # <<<<<<<<<<<<<<
 *             lindexer[j] = -1
 *             rindexer[j] = j
 */
    __pyx_t_20 = __pyx_v_nright;
    for (__pyx_t_21 = 0; __pyx_t_21 < __pyx_t_20; __pyx_t_21+=1) {
      __pyx_v_j = __pyx_t_21;

      /* "pandas/src/generated.pyx":8226
 *     if nleft == 0:
 *         for j in range(nright):
 *             lindexer[j] = -1             # <<<<<<<<<<<<<<
 *             rindexer[j] = j
 *             result[j] = right[j]
 */
      __pyx_t_22 = __pyx_v_j;
      *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_lindexer.rcbuffer->pybuffer.buf, __pyx_t_22, __pyx_pybuffernd_lindexer.diminfo[0].strides) = -1;

      /* "pandas/src/generated.pyx":8227
 *         for j in range(nright):
 *             lindexer[j] = -1
 *             rindexer[j] = j             # <<<<<<<<<<<<<<
 *             result[j] = right[j]
 *     elif nright == 0:
 */
      __pyx_t_23 = __pyx_v_j;
      *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_rindexer.rcbuffer->pybuffer.buf, __pyx_t_23, __pyx_pybuffernd_rindexer.diminfo[0].strides) = __pyx_v_j;

      /* "pandas/src/generated.pyx":8228
 *             lindexer[j] = -1
 *             rindexer[j] = j
 *             result[j] = right[j]             # <<<<<<<<<<<<<<
 *     elif nright == 0:
 *         for i in range(nright):
 */
      __pyx_t_24 = __pyx_v_j;
      __pyx_t_25 = __pyx_v_j;
      *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_25, __pyx_pybuffernd_result.diminfo[0].strides) = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_right.rcbuffer->pybuffer.buf, __pyx_t_24, __pyx_pybuffernd_right.diminfo[0].strides));
    }
    goto __pyx_L13;
  }

  /* "pandas/src/generated.pyx":8229
 *             rindexer[j] = j
 *             result[j] = right[j]
 *     elif nright == 0:             # <<<<<<<<<<<<<<
 *         for i in range(nright):
 *             lindexer[i] = i
 */
  __pyx_t_6 = ((__pyx_v_nright == 0) != 0);
  if (__pyx_t_6) {

    /* "pandas/src/generated.pyx":8230
 *             result[j] = right[j]
 *     elif nright == 0:
 *         for i in range(nright):             # <<<<<<<<<<<<<<
 *             lindexer[i] = i
 *             rindexer[i] = -1
 */
    __pyx_t_20 = __pyx_v_nright;
    for (__pyx_t_21 = 0; __pyx_t_21 < __pyx_t_20; __pyx_t_21+=1) {
      __pyx_v_i = __pyx_t_21;

      /* "pandas/src/generated.pyx":8231
 *     elif nright == 0:
 *         for i in range(nright):
 *             lindexer[i] = i             # <<<<<<<<<<<<<<
 *             rindexer[i] = -1
 *             result[i] = left[i]
 */
      __pyx_t_26 = __pyx_v_i;
      *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_lindexer.rcbuffer->pybuffer.buf, __pyx_t_26, __pyx_pybuffernd_lindexer.diminfo[0].strides) = __pyx_v_i;

      /* "pandas/src/generated.pyx":8232
 *         for i in range(nright):
 *             lindexer[i] = i
 *             rindexer[i] = -1             # <<<<<<<<<<<<<<
 *             result[i] = left[i]
 *     else:
 */
      __pyx_t_27 = __pyx_v_i;
      *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_rindexer.rcbuffer->pybuffer.buf, __pyx_t_27, __pyx_pybuffernd_rindexer.diminfo[0].strides) = -1;

      /* "pandas/src/generated.pyx":8233
 *             lindexer[i] = i
 *             rindexer[i] = -1
 *             result[i] = left[i]             # <<<<<<<<<<<<<<
 *     else:
 *         while True:
 */
      __pyx_t_28 = __pyx_v_i;
      __pyx_t_29 = __pyx_v_i;
      *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_29, __pyx_pybuffernd_result.diminfo[0].strides) = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_left.rcbuffer->pybuffer.buf, __pyx_t_28, __pyx_pybuffernd_left.diminfo[0].strides));
    }
    goto __pyx_L13;
  }
  /*else*/ {

    /* "pandas/src/generated.pyx":8235
 *             result[i] = left[i]
 *     else:
 *         while True:             # <<<<<<<<<<<<<<
 *             if i == nleft:
 *                 while j < nright:
 */
    while (1) {

      /* "pandas/src/generated.pyx":8236
 *     else:
 *         while True:
 *             if i == nleft:             # <<<<<<<<<<<<<<
 *                 while j < nright:
 *                     lindexer[count] = -1
 */
      __pyx_t_6 = ((__pyx_v_i == __pyx_v_nleft) != 0);
      if (__pyx_t_6) {

        /* "pandas/src/generated.pyx":8237
 *         while True:
 *             if i == nleft:
 *                 while j < nright:             # <<<<<<<<<<<<<<
 *                     lindexer[count] = -1
 *                     rindexer[count] = j
 */
        while (1) {
          __pyx_t_6 = ((__pyx_v_j < __pyx_v_nright) != 0);
          if (!__pyx_t_6) break;

          /* "pandas/src/generated.pyx":8238
 *             if i == nleft:
 *                 while j < nright:
 *                     lindexer[count] = -1             # <<<<<<<<<<<<<<
 *                     rindexer[count] = j
 *                     result[count] = right[j]
 */
          __pyx_t_20 = __pyx_v_count;
          *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_lindexer.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_lindexer.diminfo[0].strides) = -1;

          /* "pandas/src/generated.pyx":8239
 *                 while j < nright:
 *                     lindexer[count] = -1
 *                     rindexer[count] = j             # <<<<<<<<<<<<<<
 *                     result[count] = right[j]
 *                     count += 1
 */
          __pyx_t_21 = __pyx_v_count;
          *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_rindexer.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_rindexer.diminfo[0].strides) = __pyx_v_j;

          /* "pandas/src/generated.pyx":8240
 *                     lindexer[count] = -1
 *                     rindexer[count] = j
 *                     result[count] = right[j]             # <<<<<<<<<<<<<<
 *                     count += 1
 *                     j += 1
 */
          __pyx_t_30 = __pyx_v_j;
          __pyx_t_31 = __pyx_v_count;
          *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_31, __pyx_pybuffernd_result.diminfo[0].strides) = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_right.rcbuffer->pybuffer.buf, __pyx_t_30, __pyx_pybuffernd_right.diminfo[0].strides));

          /* "pandas/src/generated.pyx":8241
 *                     rindexer[count] = j
 *                     result[count] = right[j]
 *                     count += 1             # <<<<<<<<<<<<<<
 *                     j += 1
 *                 break
 */
          __pyx_v_count = (__pyx_v_count + 1);

          /* "pandas/src/generated.pyx":8242
 *                     result[count] = right[j]
 *                     count += 1
 *                     j += 1             # <<<<<<<<<<<<<<
 *                 break
 *             if j == nright:
 */
          __pyx_v_j = (__pyx_v_j + 1);
        }

        /* "pandas/src/generated.pyx":8243
 *                     count += 1
 *                     j += 1
 *                 break             # <<<<<<<<<<<<<<
 *             if j == nright:
 *                 while i < nleft:
 */
        goto __pyx_L19_break;
      }

      /* "pandas/src/generated.pyx":8244
 *                     j += 1
 *                 break
 *             if j == nright:             # <<<<<<<<<<<<<<
 *                 while i < nleft:
 *                     lindexer[count] = i
 */
      __pyx_t_6 = ((__pyx_v_j == __pyx_v_nright) != 0);
      if (__pyx_t_6) {

        /* "pandas/src/generated.pyx":8245
 *                 break
 *             if j == nright:
 *                 while i < nleft:             # <<<<<<<<<<<<<<
 *                     lindexer[count] = i
 *                     rindexer[count] = -1
 */
        while (1) {
          __pyx_t_6 = ((__pyx_v_i < __pyx_v_nleft) != 0);
          if (!__pyx_t_6) break;

          /* "pandas/src/generated.pyx":8246
 *             if j == nright:
 *                 while i < nleft:
 *                     lindexer[count] = i             # <<<<<<<<<<<<<<
 *                     rindexer[count] = -1
 *                     result[count] = left[i]
 */
          __pyx_t_32 = __pyx_v_count;
          *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_lindexer.rcbuffer->pybuffer.buf, __pyx_t_32, __pyx_pybuffernd_lindexer.diminfo[0].strides) = __pyx_v_i;

          /* "pandas/src/generated.pyx":8247
 *                 while i < nleft:
 *                     lindexer[count] = i
 *                     rindexer[count] = -1             # <<<<<<<<<<<<<<
 *                     result[count] = left[i]
 *                     count += 1
 */
          __pyx_t_33 = __pyx_v_count;
          *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_rindexer.rcbuffer->pybuffer.buf, __pyx_t_33, __pyx_pybuffernd_rindexer.diminfo[0].strides) = -1;

          /* "pandas/src/generated.pyx":8248
 *                     lindexer[count] = i
 *                     rindexer[count] = -1
 *                     result[count] = left[i]             # <<<<<<<<<<<<<<
 *                     count += 1
 *                     i += 1
 */
          __pyx_t_34 = __pyx_v_i;
          __pyx_t_35 = __pyx_v_count;
          *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_35, __pyx_pybuffernd_result.diminfo[0].strides) = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_left.rcbuffer->pybuffer.buf, __pyx_t_34, __pyx_pybuffernd_left.diminfo[0].strides));

          /* "pandas/src/generated.pyx":8249
 *                     rindexer[count] = -1
 *                     result[count] = left[i]
 *                     count += 1             # <<<<<<<<<<<<<<
 *                     i += 1
 *                 break
 */
          __pyx_v_count = (__pyx_v_count + 1);

          /* "pandas/src/generated.pyx":8250
 *                     result[count] = left[i]
 *                     count += 1
 *                     i += 1             # <<<<<<<<<<<<<<
 *                 break
 * 
 */
          __pyx_v_i = (__pyx_v_i + 1);
        }

        /* "pandas/src/generated.pyx":8251
 *                     count += 1
 *                     i += 1
 *                 break             # <<<<<<<<<<<<<<
 * 
 *             lval = left[i]
 */
        goto __pyx_L19_break;
      }

      /* "pandas/src/generated.pyx":8253
 *                 break
 * 
 *             lval = left[i]             # <<<<<<<<<<<<<<
 *             rval = right[j]
 * 
 */
      __pyx_t_36 = __pyx_v_i;
      __pyx_v_lval = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_left.rcbuffer->pybuffer.buf, __pyx_t_36, __pyx_pybuffernd_left.diminfo[0].strides));

      /* "pandas/src/generated.pyx":8254
 * 
 *             lval = left[i]
 *             rval = right[j]             # <<<<<<<<<<<<<<
 * 
 *             if lval == rval:
 */
      __pyx_t_37 = __pyx_v_j;
      __pyx_v_rval = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_right.rcbuffer->pybuffer.buf, __pyx_t_37, __pyx_pybuffernd_right.diminfo[0].strides));

      /* "pandas/src/generated.pyx":8256
 *             rval = right[j]
 * 
 *             if lval == rval:             # <<<<<<<<<<<<<<
 *                 lindexer[count] = i
 *                 rindexer[count] = j
 */
      __pyx_t_6 = ((__pyx_v_lval == __pyx_v_rval) != 0);
      if (__pyx_t_6) {

        /* "pandas/src/generated.pyx":8257
 * 
 *             if lval == rval:
 *                 lindexer[count] = i             # <<<<<<<<<<<<<<
 *                 rindexer[count] = j
 *                 result[count] = lval
 */
        __pyx_t_38 = __pyx_v_count;
        *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_lindexer.rcbuffer->pybuffer.buf, __pyx_t_38, __pyx_pybuffernd_lindexer.diminfo[0].strides) = __pyx_v_i;

        /* "pandas/src/generated.pyx":8258
 *             if lval == rval:
 *                 lindexer[count] = i
 *                 rindexer[count] = j             # <<<<<<<<<<<<<<
 *                 result[count] = lval
 *                 count += 1
 */
        __pyx_t_39 = __pyx_v_count;
        *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_rindexer.rcbuffer->pybuffer.buf, __pyx_t_39, __pyx_pybuffernd_rindexer.diminfo[0].strides) = __pyx_v_j;

        /* "pandas/src/generated.pyx":8259
 *                 lindexer[count] = i
 *                 rindexer[count] = j
 *                 result[count] = lval             # <<<<<<<<<<<<<<
 *                 count += 1
 *                 if i < nleft - 1:
 */
        __pyx_t_40 = __pyx_v_count;
        *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_40, __pyx_pybuffernd_result.diminfo[0].strides) = __pyx_v_lval;

        /* "pandas/src/generated.pyx":8260
 *                 rindexer[count] = j
 *                 result[count] = lval
 *                 count += 1             # <<<<<<<<<<<<<<
 *                 if i < nleft - 1:
 *                     if j < nright - 1 and right[j + 1] == rval:
 */
        __pyx_v_count = (__pyx_v_count + 1);

        /* "pandas/src/generated.pyx":8261
 *                 result[count] = lval
 *                 count += 1
 *                 if i < nleft - 1:             # <<<<<<<<<<<<<<
 *                     if j < nright - 1 and right[j + 1] == rval:
 *                         j += 1
 */
        __pyx_t_6 = ((__pyx_v_i < (__pyx_v_nleft - 1)) != 0);
        if (__pyx_t_6) {

          /* "pandas/src/generated.pyx":8262
 *                 count += 1
 *                 if i < nleft - 1:
 *                     if j < nright - 1 and right[j + 1] == rval:             # <<<<<<<<<<<<<<
 *                         j += 1
 *                     else:
 */
          __pyx_t_6 = ((__pyx_v_j < (__pyx_v_nright - 1)) != 0);
          if (__pyx_t_6) {
            __pyx_t_41 = (__pyx_v_j + 1);
            __pyx_t_2 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_right.rcbuffer->pybuffer.buf, __pyx_t_41, __pyx_pybuffernd_right.diminfo[0].strides)) == __pyx_v_rval) != 0);
            __pyx_t_5 = __pyx_t_2;
          } else {
            __pyx_t_5 = __pyx_t_6;
          }
          if (__pyx_t_5) {

            /* "pandas/src/generated.pyx":8263
 *                 if i < nleft - 1:
 *                     if j < nright - 1 and right[j + 1] == rval:
 *                         j += 1             # <<<<<<<<<<<<<<
 *                     else:
 *                         i += 1
 */
            __pyx_v_j = (__pyx_v_j + 1);
            goto __pyx_L28;
          }
          /*else*/ {

            /* "pandas/src/generated.pyx":8265
 *                         j += 1
 *                     else:
 *                         i += 1             # <<<<<<<<<<<<<<
 *                         if left[i] != rval:
 *                             j += 1
 */
            __pyx_v_i = (__pyx_v_i + 1);

            /* "pandas/src/generated.pyx":8266
 *                     else:
 *                         i += 1
 *                         if left[i] != rval:             # <<<<<<<<<<<<<<
 *                             j += 1
 *                 elif j < nright - 1:
 */
            __pyx_t_42 = __pyx_v_i;
            __pyx_t_5 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_left.rcbuffer->pybuffer.buf, __pyx_t_42, __pyx_pybuffernd_left.diminfo[0].strides)) != __pyx_v_rval) != 0);
            if (__pyx_t_5) {

              /* "pandas/src/generated.pyx":8267
 *                         i += 1
 *                         if left[i] != rval:
 *                             j += 1             # <<<<<<<<<<<<<<
 *                 elif j < nright - 1:
 *                     j += 1
 */
              __pyx_v_j = (__pyx_v_j + 1);
              goto __pyx_L29;
            }
            __pyx_L29:;
          }
          __pyx_L28:;
          goto __pyx_L27;
        }

        /* "pandas/src/generated.pyx":8268
 *                         if left[i] != rval:
 *                             j += 1
 *                 elif j < nright - 1:             # <<<<<<<<<<<<<<
 *                     j += 1
 *                     if lval != right[j]:
 */
        __pyx_t_5 = ((__pyx_v_j < (__pyx_v_nright - 1)) != 0);
        if (__pyx_t_5) {

          /* "pandas/src/generated.pyx":8269
 *                             j += 1
 *                 elif j < nright - 1:
 *                     j += 1             # <<<<<<<<<<<<<<
 *                     if lval != right[j]:
 *                         i += 1
 */
          __pyx_v_j = (__pyx_v_j + 1);

          /* "pandas/src/generated.pyx":8270
 *                 elif j < nright - 1:
 *                     j += 1
 *                     if lval != right[j]:             # <<<<<<<<<<<<<<
 *                         i += 1
 *                 else:
 */
          __pyx_t_43 = __pyx_v_j;
          __pyx_t_5 = ((__pyx_v_lval != (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_right.rcbuffer->pybuffer.buf, __pyx_t_43, __pyx_pybuffernd_right.diminfo[0].strides))) != 0);
          if (__pyx_t_5) {

            /* "pandas/src/generated.pyx":8271
 *                     j += 1
 *                     if lval != right[j]:
 *                         i += 1             # <<<<<<<<<<<<<<
 *                 else:
 *                     # end of the road
 */
            __pyx_v_i = (__pyx_v_i + 1);
            goto __pyx_L30;
          }
          __pyx_L30:;
          goto __pyx_L27;
        }
        /*else*/ {

          /* "pandas/src/generated.pyx":8274
 *                 else:
 *                     # end of the road
 *                     break             # <<<<<<<<<<<<<<
 *             elif lval < rval:
 *                 lindexer[count] = i
 */
          goto __pyx_L19_break;
        }
        __pyx_L27:;
        goto __pyx_L26;
      }

      /* "pandas/src/generated.pyx":8275
 *                     # end of the road
 *                     break
 *             elif lval < rval:             # <<<<<<<<<<<<<<
 *                 lindexer[count] = i
 *                 rindexer[count] = -1
 */
      __pyx_t_5 = ((__pyx_v_lval < __pyx_v_rval) != 0);
      if (__pyx_t_5) {

        /* "pandas/src/generated.pyx":8276
 *                     break
 *             elif lval < rval:
 *                 lindexer[count] = i             # <<<<<<<<<<<<<<
 *                 rindexer[count] = -1
 *                 result[count] = lval
 */
        __pyx_t_44 = __pyx_v_count;
        *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_lindexer.rcbuffer->pybuffer.buf, __pyx_t_44, __pyx_pybuffernd_lindexer.diminfo[0].strides) = __pyx_v_i;

        /* "pandas/src/generated.pyx":8277
 *             elif lval < rval:
 *                 lindexer[count] = i
 *                 rindexer[count] = -1             # <<<<<<<<<<<<<<
 *                 result[count] = lval
 *                 count += 1
 */
        __pyx_t_45 = __pyx_v_count;
        *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_rindexer.rcbuffer->pybuffer.buf, __pyx_t_45, __pyx_pybuffernd_rindexer.diminfo[0].strides) = -1;

        /* "pandas/src/generated.pyx":8278
 *                 lindexer[count] = i
 *                 rindexer[count] = -1
 *                 result[count] = lval             # <<<<<<<<<<<<<<
 *                 count += 1
 *                 i += 1
 */
        __pyx_t_46 = __pyx_v_count;
        *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_46, __pyx_pybuffernd_result.diminfo[0].strides) = __pyx_v_lval;

        /* "pandas/src/generated.pyx":8279
 *                 rindexer[count] = -1
 *                 result[count] = lval
 *                 count += 1             # <<<<<<<<<<<<<<
 *                 i += 1
 *             else:
 */
        __pyx_v_count = (__pyx_v_count + 1);

        /* "pandas/src/generated.pyx":8280
 *                 result[count] = lval
 *                 count += 1
 *                 i += 1             # <<<<<<<<<<<<<<
 *             else:
 *                 lindexer[count] = -1
 */
        __pyx_v_i = (__pyx_v_i + 1);
        goto __pyx_L26;
      }
      /*else*/ {

        /* "pandas/src/generated.pyx":8282
 *                 i += 1
 *             else:
 *                 lindexer[count] = -1             # <<<<<<<<<<<<<<
 *                 rindexer[count] = j
 *                 result[count] = rval
 */
        __pyx_t_47 = __pyx_v_count;
        *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_lindexer.rcbuffer->pybuffer.buf, __pyx_t_47, __pyx_pybuffernd_lindexer.diminfo[0].strides) = -1;

        /* "pandas/src/generated.pyx":8283
 *             else:
 *                 lindexer[count] = -1
 *                 rindexer[count] = j             # <<<<<<<<<<<<<<
 *                 result[count] = rval
 *                 count += 1
 */
        __pyx_t_48 = __pyx_v_count;
        *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_rindexer.rcbuffer->pybuffer.buf, __pyx_t_48, __pyx_pybuffernd_rindexer.diminfo[0].strides) = __pyx_v_j;

        /* "pandas/src/generated.pyx":8284
 *                 lindexer[count] = -1
 *                 rindexer[count] = j
 *                 result[count] = rval             # <<<<<<<<<<<<<<
 *                 count += 1
 *                 j += 1
 */
        __pyx_t_49 = __pyx_v_count;
        *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_49, __pyx_pybuffernd_result.diminfo[0].strides) = __pyx_v_rval;

        /* "pandas/src/generated.pyx":8285
 *                 rindexer[count] = j
 *                 result[count] = rval
 *                 count += 1             # <<<<<<<<<<<<<<
 *                 j += 1
 * 
 */
        __pyx_v_count = (__pyx_v_count + 1);

        /* "pandas/src/generated.pyx":8286
 *                 result[count] = rval
 *                 count += 1
 *                 j += 1             # <<<<<<<<<<<<<<
 * 
 *     return result, lindexer, rindexer
 */
        __pyx_v_j = (__pyx_v_j + 1);
      }
      __pyx_L26:;
    }
    __pyx_L19_break:;
  }
  __pyx_L13:;

  /* "pandas/src/generated.pyx":8288
 *                 j += 1
 * 
 *     return result, lindexer, rindexer             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_10 = PyTuple_New(3); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8288; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__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_INCREF(((PyObject *)__pyx_v_lindexer));
  PyTuple_SET_ITEM(__pyx_t_10, 1, ((PyObject *)__pyx_v_lindexer));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_lindexer));
  __Pyx_INCREF(((PyObject *)__pyx_v_rindexer));
  PyTuple_SET_ITEM(__pyx_t_10, 2, ((PyObject *)__pyx_v_rindexer));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_rindexer));
  __pyx_r = __pyx_t_10;
  __pyx_t_10 = 0;
  goto __pyx_L0;

  /* "pandas/src/generated.pyx":8163
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def outer_join_indexer_int64(ndarray[int64_t] left,             # <<<<<<<<<<<<<<
 *                                 ndarray[int64_t] right):
 *     cdef:
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_XDECREF(__pyx_t_13);
  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
    __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_left.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_lindexer.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_right.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_rindexer.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas.algos.outer_join_indexer_int64", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_left.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_lindexer.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_right.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_rindexer.rcbuffer->pybuffer);
  __pyx_L2:;
  __Pyx_XDECREF((PyObject *)__pyx_v_lindexer);
  __Pyx_XDECREF((PyObject *)__pyx_v_rindexer);
  __Pyx_XDECREF((PyObject *)__pyx_v_result);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/src/generated.pyx":8293
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def inner_join_indexer_float64(ndarray[float64_t] left,             # <<<<<<<<<<<<<<
 *                               ndarray[float64_t] right):
 *     '''
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pandas_5algos_501inner_join_indexer_float64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6pandas_5algos_500inner_join_indexer_float64[] = "\n    Two-pass algorithm for monotonic indexes. Handles many-to-one merges\n    ";
static PyMethodDef __pyx_mdef_6pandas_5algos_501inner_join_indexer_float64 = {__Pyx_NAMESTR("inner_join_indexer_float64"), (PyCFunction)__pyx_pw_6pandas_5algos_501inner_join_indexer_float64, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6pandas_5algos_500inner_join_indexer_float64)};
static PyObject *__pyx_pw_6pandas_5algos_501inner_join_indexer_float64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyArrayObject *__pyx_v_left = 0;
  PyArrayObject *__pyx_v_right = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("inner_join_indexer_float64 (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_left,&__pyx_n_s_right,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_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 (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_left)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_right)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("inner_join_indexer_float64", 1, 2, 2, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8293; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "inner_join_indexer_float64") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8293; __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("inner_join_indexer_float64", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8293; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas.algos.inner_join_indexer_float64", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_left), __pyx_ptype_5numpy_ndarray, 1, "left", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8293; __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[2]; __pyx_lineno = 8294; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_500inner_join_indexer_float64(__pyx_self, __pyx_v_left, __pyx_v_right);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pandas_5algos_500inner_join_indexer_float64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_left, PyArrayObject *__pyx_v_right) {
  Py_ssize_t __pyx_v_i;
  Py_ssize_t __pyx_v_j;
  Py_ssize_t __pyx_v_nright;
  Py_ssize_t __pyx_v_nleft;
  Py_ssize_t __pyx_v_count;
  __pyx_t_5numpy_float64_t __pyx_v_lval;
  __pyx_t_5numpy_float64_t __pyx_v_rval;
  PyArrayObject *__pyx_v_lindexer = 0;
  PyArrayObject *__pyx_v_rindexer = 0;
  PyArrayObject *__pyx_v_result = 0;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_left;
  __Pyx_Buffer __pyx_pybuffer_left;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_lindexer;
  __Pyx_Buffer __pyx_pybuffer_lindexer;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_result;
  __Pyx_Buffer __pyx_pybuffer_result;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_right;
  __Pyx_Buffer __pyx_pybuffer_right;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_rindexer;
  __Pyx_Buffer __pyx_pybuffer_rindexer;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  Py_ssize_t __pyx_t_1;
  int __pyx_t_2;
  int __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;
  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;
  PyObject *__pyx_t_13 = NULL;
  PyArrayObject *__pyx_t_14 = NULL;
  int __pyx_t_15;
  PyObject *__pyx_t_16 = NULL;
  PyObject *__pyx_t_17 = NULL;
  PyObject *__pyx_t_18 = NULL;
  PyArrayObject *__pyx_t_19 = NULL;
  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;
  __Pyx_RefNannySetupContext("inner_join_indexer_float64", 0);
  __pyx_pybuffer_lindexer.pybuffer.buf = NULL;
  __pyx_pybuffer_lindexer.refcount = 0;
  __pyx_pybuffernd_lindexer.data = NULL;
  __pyx_pybuffernd_lindexer.rcbuffer = &__pyx_pybuffer_lindexer;
  __pyx_pybuffer_rindexer.pybuffer.buf = NULL;
  __pyx_pybuffer_rindexer.refcount = 0;
  __pyx_pybuffernd_rindexer.data = NULL;
  __pyx_pybuffernd_rindexer.rcbuffer = &__pyx_pybuffer_rindexer;
  __pyx_pybuffer_result.pybuffer.buf = NULL;
  __pyx_pybuffer_result.refcount = 0;
  __pyx_pybuffernd_result.data = NULL;
  __pyx_pybuffernd_result.rcbuffer = &__pyx_pybuffer_result;
  __pyx_pybuffer_left.pybuffer.buf = NULL;
  __pyx_pybuffer_left.refcount = 0;
  __pyx_pybuffernd_left.data = NULL;
  __pyx_pybuffernd_left.rcbuffer = &__pyx_pybuffer_left;
  __pyx_pybuffer_right.pybuffer.buf = NULL;
  __pyx_pybuffer_right.refcount = 0;
  __pyx_pybuffernd_right.data = NULL;
  __pyx_pybuffernd_right.rcbuffer = &__pyx_pybuffer_right;
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_left.rcbuffer->pybuffer, (PyObject*)__pyx_v_left, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8293; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_left.diminfo[0].strides = __pyx_pybuffernd_left.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_left.diminfo[0].shape = __pyx_pybuffernd_left.rcbuffer->pybuffer.shape[0];
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_right.rcbuffer->pybuffer, (PyObject*)__pyx_v_right, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8293; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_right.diminfo[0].strides = __pyx_pybuffernd_right.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_right.diminfo[0].shape = __pyx_pybuffernd_right.rcbuffer->pybuffer.shape[0];

  /* "pandas/src/generated.pyx":8304
 *         ndarray[float64_t] result
 * 
 *     nleft = len(left)             # <<<<<<<<<<<<<<
 *     nright = len(right)
 * 
 */
  __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_left)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8304; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_nleft = __pyx_t_1;

  /* "pandas/src/generated.pyx":8305
 * 
 *     nleft = len(left)
 *     nright = len(right)             # <<<<<<<<<<<<<<
 * 
 *     i = 0
 */
  __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_right)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8305; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_nright = __pyx_t_1;

  /* "pandas/src/generated.pyx":8307
 *     nright = len(right)
 * 
 *     i = 0             # <<<<<<<<<<<<<<
 *     j = 0
 *     count = 0
 */
  __pyx_v_i = 0;

  /* "pandas/src/generated.pyx":8308
 * 
 *     i = 0
 *     j = 0             # <<<<<<<<<<<<<<
 *     count = 0
 *     if nleft > 0 and nright > 0:
 */
  __pyx_v_j = 0;

  /* "pandas/src/generated.pyx":8309
 *     i = 0
 *     j = 0
 *     count = 0             # <<<<<<<<<<<<<<
 *     if nleft > 0 and nright > 0:
 *         while True:
 */
  __pyx_v_count = 0;

  /* "pandas/src/generated.pyx":8310
 *     j = 0
 *     count = 0
 *     if nleft > 0 and nright > 0:             # <<<<<<<<<<<<<<
 *         while True:
 *             if i == nleft:
 */
  __pyx_t_2 = ((__pyx_v_nleft > 0) != 0);
  if (__pyx_t_2) {
    __pyx_t_3 = ((__pyx_v_nright > 0) != 0);
    __pyx_t_4 = __pyx_t_3;
  } else {
    __pyx_t_4 = __pyx_t_2;
  }
  if (__pyx_t_4) {

    /* "pandas/src/generated.pyx":8311
 *     count = 0
 *     if nleft > 0 and nright > 0:
 *         while True:             # <<<<<<<<<<<<<<
 *             if i == nleft:
 *                 break
 */
    while (1) {

      /* "pandas/src/generated.pyx":8312
 *     if nleft > 0 and nright > 0:
 *         while True:
 *             if i == nleft:             # <<<<<<<<<<<<<<
 *                 break
 *             if j == nright:
 */
      __pyx_t_4 = ((__pyx_v_i == __pyx_v_nleft) != 0);
      if (__pyx_t_4) {

        /* "pandas/src/generated.pyx":8313
 *         while True:
 *             if i == nleft:
 *                 break             # <<<<<<<<<<<<<<
 *             if j == nright:
 *                 break
 */
        goto __pyx_L5_break;
      }

      /* "pandas/src/generated.pyx":8314
 *             if i == nleft:
 *                 break
 *             if j == nright:             # <<<<<<<<<<<<<<
 *                 break
 * 
 */
      __pyx_t_4 = ((__pyx_v_j == __pyx_v_nright) != 0);
      if (__pyx_t_4) {

        /* "pandas/src/generated.pyx":8315
 *                 break
 *             if j == nright:
 *                 break             # <<<<<<<<<<<<<<
 * 
 *             lval = left[i]
 */
        goto __pyx_L5_break;
      }

      /* "pandas/src/generated.pyx":8317
 *                 break
 * 
 *             lval = left[i]             # <<<<<<<<<<<<<<
 *             rval = right[j]
 *             if lval == rval:
 */
      __pyx_t_1 = __pyx_v_i;
      __pyx_v_lval = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_left.rcbuffer->pybuffer.buf, __pyx_t_1, __pyx_pybuffernd_left.diminfo[0].strides));

      /* "pandas/src/generated.pyx":8318
 * 
 *             lval = left[i]
 *             rval = right[j]             # <<<<<<<<<<<<<<
 *             if lval == rval:
 *                 count += 1
 */
      __pyx_t_5 = __pyx_v_j;
      __pyx_v_rval = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_right.rcbuffer->pybuffer.buf, __pyx_t_5, __pyx_pybuffernd_right.diminfo[0].strides));

      /* "pandas/src/generated.pyx":8319
 *             lval = left[i]
 *             rval = right[j]
 *             if lval == rval:             # <<<<<<<<<<<<<<
 *                 count += 1
 *                 if i < nleft - 1:
 */
      __pyx_t_4 = ((__pyx_v_lval == __pyx_v_rval) != 0);
      if (__pyx_t_4) {

        /* "pandas/src/generated.pyx":8320
 *             rval = right[j]
 *             if lval == rval:
 *                 count += 1             # <<<<<<<<<<<<<<
 *                 if i < nleft - 1:
 *                     if j < nright - 1 and right[j + 1] == rval:
 */
        __pyx_v_count = (__pyx_v_count + 1);

        /* "pandas/src/generated.pyx":8321
 *             if lval == rval:
 *                 count += 1
 *                 if i < nleft - 1:             # <<<<<<<<<<<<<<
 *                     if j < nright - 1 and right[j + 1] == rval:
 *                         j += 1
 */
        __pyx_t_4 = ((__pyx_v_i < (__pyx_v_nleft - 1)) != 0);
        if (__pyx_t_4) {

          /* "pandas/src/generated.pyx":8322
 *                 count += 1
 *                 if i < nleft - 1:
 *                     if j < nright - 1 and right[j + 1] == rval:             # <<<<<<<<<<<<<<
 *                         j += 1
 *                     else:
 */
          __pyx_t_4 = ((__pyx_v_j < (__pyx_v_nright - 1)) != 0);
          if (__pyx_t_4) {
            __pyx_t_6 = (__pyx_v_j + 1);
            __pyx_t_2 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_right.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_right.diminfo[0].strides)) == __pyx_v_rval) != 0);
            __pyx_t_3 = __pyx_t_2;
          } else {
            __pyx_t_3 = __pyx_t_4;
          }
          if (__pyx_t_3) {

            /* "pandas/src/generated.pyx":8323
 *                 if i < nleft - 1:
 *                     if j < nright - 1 and right[j + 1] == rval:
 *                         j += 1             # <<<<<<<<<<<<<<
 *                     else:
 *                         i += 1
 */
            __pyx_v_j = (__pyx_v_j + 1);
            goto __pyx_L10;
          }
          /*else*/ {

            /* "pandas/src/generated.pyx":8325
 *                         j += 1
 *                     else:
 *                         i += 1             # <<<<<<<<<<<<<<
 *                         if left[i] != rval:
 *                             j += 1
 */
            __pyx_v_i = (__pyx_v_i + 1);

            /* "pandas/src/generated.pyx":8326
 *                     else:
 *                         i += 1
 *                         if left[i] != rval:             # <<<<<<<<<<<<<<
 *                             j += 1
 *                 elif j < nright - 1:
 */
            __pyx_t_7 = __pyx_v_i;
            __pyx_t_3 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_left.rcbuffer->pybuffer.buf, __pyx_t_7, __pyx_pybuffernd_left.diminfo[0].strides)) != __pyx_v_rval) != 0);
            if (__pyx_t_3) {

              /* "pandas/src/generated.pyx":8327
 *                         i += 1
 *                         if left[i] != rval:
 *                             j += 1             # <<<<<<<<<<<<<<
 *                 elif j < nright - 1:
 *                     j += 1
 */
              __pyx_v_j = (__pyx_v_j + 1);
              goto __pyx_L11;
            }
            __pyx_L11:;
          }
          __pyx_L10:;
          goto __pyx_L9;
        }

        /* "pandas/src/generated.pyx":8328
 *                         if left[i] != rval:
 *                             j += 1
 *                 elif j < nright - 1:             # <<<<<<<<<<<<<<
 *                     j += 1
 *                     if lval != right[j]:
 */
        __pyx_t_3 = ((__pyx_v_j < (__pyx_v_nright - 1)) != 0);
        if (__pyx_t_3) {

          /* "pandas/src/generated.pyx":8329
 *                             j += 1
 *                 elif j < nright - 1:
 *                     j += 1             # <<<<<<<<<<<<<<
 *                     if lval != right[j]:
 *                         i += 1
 */
          __pyx_v_j = (__pyx_v_j + 1);

          /* "pandas/src/generated.pyx":8330
 *                 elif j < nright - 1:
 *                     j += 1
 *                     if lval != right[j]:             # <<<<<<<<<<<<<<
 *                         i += 1
 *                 else:
 */
          __pyx_t_8 = __pyx_v_j;
          __pyx_t_3 = ((__pyx_v_lval != (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_right.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_right.diminfo[0].strides))) != 0);
          if (__pyx_t_3) {

            /* "pandas/src/generated.pyx":8331
 *                     j += 1
 *                     if lval != right[j]:
 *                         i += 1             # <<<<<<<<<<<<<<
 *                 else:
 *                     # end of the road
 */
            __pyx_v_i = (__pyx_v_i + 1);
            goto __pyx_L12;
          }
          __pyx_L12:;
          goto __pyx_L9;
        }
        /*else*/ {

          /* "pandas/src/generated.pyx":8334
 *                 else:
 *                     # end of the road
 *                     break             # <<<<<<<<<<<<<<
 *             elif lval < rval:
 *                 i += 1
 */
          goto __pyx_L5_break;
        }
        __pyx_L9:;
        goto __pyx_L8;
      }

      /* "pandas/src/generated.pyx":8335
 *                     # end of the road
 *                     break
 *             elif lval < rval:             # <<<<<<<<<<<<<<
 *                 i += 1
 *             else:
 */
      __pyx_t_3 = ((__pyx_v_lval < __pyx_v_rval) != 0);
      if (__pyx_t_3) {

        /* "pandas/src/generated.pyx":8336
 *                     break
 *             elif lval < rval:
 *                 i += 1             # <<<<<<<<<<<<<<
 *             else:
 *                 j += 1
 */
        __pyx_v_i = (__pyx_v_i + 1);
        goto __pyx_L8;
      }
      /*else*/ {

        /* "pandas/src/generated.pyx":8338
 *                 i += 1
 *             else:
 *                 j += 1             # <<<<<<<<<<<<<<
 * 
 *     # do it again now that result size is known
 */
        __pyx_v_j = (__pyx_v_j + 1);
      }
      __pyx_L8:;
    }
    __pyx_L5_break:;
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "pandas/src/generated.pyx":8342
 *     # do it again now that result size is known
 * 
 *     lindexer = np.empty(count, dtype=np.int64)             # <<<<<<<<<<<<<<
 *     rindexer = np.empty(count, dtype=np.int64)
 *     result = np.empty(count, dtype=np.float64)
 */
  __pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8342; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_9);
  __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_empty); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8342; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_10);
  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  __pyx_t_9 = PyInt_FromSsize_t(__pyx_v_count); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8342; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_9);
  __pyx_t_11 = PyTuple_New(1); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8342; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_11);
  PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_9);
  __Pyx_GIVEREF(__pyx_t_9);
  __pyx_t_9 = 0;
  __pyx_t_9 = PyDict_New(); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8342; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_9);
  __pyx_t_12 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8342; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_12);
  __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_int64); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8342; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_13);
  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
  if (PyDict_SetItem(__pyx_t_9, __pyx_n_s_dtype, __pyx_t_13) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8342; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  __pyx_t_13 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_t_11, __pyx_t_9); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8342; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_13);
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 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 = 8342; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_14 = ((PyArrayObject *)__pyx_t_13);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_lindexer.rcbuffer->pybuffer);
    __pyx_t_15 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_lindexer.rcbuffer->pybuffer, (PyObject*)__pyx_t_14, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack);
    if (unlikely(__pyx_t_15 < 0)) {
      PyErr_Fetch(&__pyx_t_16, &__pyx_t_17, &__pyx_t_18);
      if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_lindexer.rcbuffer->pybuffer, (PyObject*)__pyx_v_lindexer, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {
        Py_XDECREF(__pyx_t_16); Py_XDECREF(__pyx_t_17); Py_XDECREF(__pyx_t_18);
        __Pyx_RaiseBufferFallbackError();
      } else {
        PyErr_Restore(__pyx_t_16, __pyx_t_17, __pyx_t_18);
      }
    }
    __pyx_pybuffernd_lindexer.diminfo[0].strides = __pyx_pybuffernd_lindexer.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_lindexer.diminfo[0].shape = __pyx_pybuffernd_lindexer.rcbuffer->pybuffer.shape[0];
    if (unlikely(__pyx_t_15 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8342; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_14 = 0;
  __pyx_v_lindexer = ((PyArrayObject *)__pyx_t_13);
  __pyx_t_13 = 0;

  /* "pandas/src/generated.pyx":8343
 * 
 *     lindexer = np.empty(count, dtype=np.int64)
 *     rindexer = np.empty(count, dtype=np.int64)             # <<<<<<<<<<<<<<
 *     result = np.empty(count, dtype=np.float64)
 * 
 */
  __pyx_t_13 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8343; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_13);
  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_n_s_empty); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8343; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_9);
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  __pyx_t_13 = PyInt_FromSsize_t(__pyx_v_count); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8343; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_13);
  __pyx_t_11 = PyTuple_New(1); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8343; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_11);
  PyTuple_SET_ITEM(__pyx_t_11, 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 = 8343; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_13);
  __pyx_t_10 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8343; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_10);
  __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_int64); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8343; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_12);
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  if (PyDict_SetItem(__pyx_t_13, __pyx_n_s_dtype, __pyx_t_12) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8343; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
  __pyx_t_12 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_11, __pyx_t_13); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8343; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_12);
  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  if (!(likely(((__pyx_t_12) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_12, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8343; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_14 = ((PyArrayObject *)__pyx_t_12);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_rindexer.rcbuffer->pybuffer);
    __pyx_t_15 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_rindexer.rcbuffer->pybuffer, (PyObject*)__pyx_t_14, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack);
    if (unlikely(__pyx_t_15 < 0)) {
      PyErr_Fetch(&__pyx_t_18, &__pyx_t_17, &__pyx_t_16);
      if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_rindexer.rcbuffer->pybuffer, (PyObject*)__pyx_v_rindexer, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {
        Py_XDECREF(__pyx_t_18); Py_XDECREF(__pyx_t_17); Py_XDECREF(__pyx_t_16);
        __Pyx_RaiseBufferFallbackError();
      } else {
        PyErr_Restore(__pyx_t_18, __pyx_t_17, __pyx_t_16);
      }
    }
    __pyx_pybuffernd_rindexer.diminfo[0].strides = __pyx_pybuffernd_rindexer.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_rindexer.diminfo[0].shape = __pyx_pybuffernd_rindexer.rcbuffer->pybuffer.shape[0];
    if (unlikely(__pyx_t_15 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8343; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_14 = 0;
  __pyx_v_rindexer = ((PyArrayObject *)__pyx_t_12);
  __pyx_t_12 = 0;

  /* "pandas/src/generated.pyx":8344
 *     lindexer = np.empty(count, dtype=np.int64)
 *     rindexer = np.empty(count, dtype=np.int64)
 *     result = np.empty(count, dtype=np.float64)             # <<<<<<<<<<<<<<
 * 
 *     i = 0
 */
  __pyx_t_12 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8344; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_12);
  __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_empty); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8344; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_13);
  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
  __pyx_t_12 = PyInt_FromSsize_t(__pyx_v_count); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8344; __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[2]; __pyx_lineno = 8344; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__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 = PyDict_New(); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8344; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_12);
  __pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8344; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_9);
  __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_float64); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8344; __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_12, __pyx_n_s_dtype, __pyx_t_10) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8344; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_13, __pyx_t_11, __pyx_t_12); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8344; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_10);
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
  if (!(likely(((__pyx_t_10) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_10, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8344; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_19 = ((PyArrayObject *)__pyx_t_10);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer);
    __pyx_t_15 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_result.rcbuffer->pybuffer, (PyObject*)__pyx_t_19, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack);
    if (unlikely(__pyx_t_15 < 0)) {
      PyErr_Fetch(&__pyx_t_16, &__pyx_t_17, &__pyx_t_18);
      if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_result.rcbuffer->pybuffer, (PyObject*)__pyx_v_result, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {
        Py_XDECREF(__pyx_t_16); Py_XDECREF(__pyx_t_17); Py_XDECREF(__pyx_t_18);
        __Pyx_RaiseBufferFallbackError();
      } else {
        PyErr_Restore(__pyx_t_16, __pyx_t_17, __pyx_t_18);
      }
    }
    __pyx_pybuffernd_result.diminfo[0].strides = __pyx_pybuffernd_result.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_result.diminfo[0].shape = __pyx_pybuffernd_result.rcbuffer->pybuffer.shape[0];
    if (unlikely(__pyx_t_15 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8344; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_19 = 0;
  __pyx_v_result = ((PyArrayObject *)__pyx_t_10);
  __pyx_t_10 = 0;

  /* "pandas/src/generated.pyx":8346
 *     result = np.empty(count, dtype=np.float64)
 * 
 *     i = 0             # <<<<<<<<<<<<<<
 *     j = 0
 *     count = 0
 */
  __pyx_v_i = 0;

  /* "pandas/src/generated.pyx":8347
 * 
 *     i = 0
 *     j = 0             # <<<<<<<<<<<<<<
 *     count = 0
 *     if nleft > 0 and nright > 0:
 */
  __pyx_v_j = 0;

  /* "pandas/src/generated.pyx":8348
 *     i = 0
 *     j = 0
 *     count = 0             # <<<<<<<<<<<<<<
 *     if nleft > 0 and nright > 0:
 *         while True:
 */
  __pyx_v_count = 0;

  /* "pandas/src/generated.pyx":8349
 *     j = 0
 *     count = 0
 *     if nleft > 0 and nright > 0:             # <<<<<<<<<<<<<<
 *         while True:
 *             if i == nleft:
 */
  __pyx_t_3 = ((__pyx_v_nleft > 0) != 0);
  if (__pyx_t_3) {
    __pyx_t_4 = ((__pyx_v_nright > 0) != 0);
    __pyx_t_2 = __pyx_t_4;
  } else {
    __pyx_t_2 = __pyx_t_3;
  }
  if (__pyx_t_2) {

    /* "pandas/src/generated.pyx":8350
 *     count = 0
 *     if nleft > 0 and nright > 0:
 *         while True:             # <<<<<<<<<<<<<<
 *             if i == nleft:
 *                 break
 */
    while (1) {

      /* "pandas/src/generated.pyx":8351
 *     if nleft > 0 and nright > 0:
 *         while True:
 *             if i == nleft:             # <<<<<<<<<<<<<<
 *                 break
 *             if j == nright:
 */
      __pyx_t_2 = ((__pyx_v_i == __pyx_v_nleft) != 0);
      if (__pyx_t_2) {

        /* "pandas/src/generated.pyx":8352
 *         while True:
 *             if i == nleft:
 *                 break             # <<<<<<<<<<<<<<
 *             if j == nright:
 *                 break
 */
        goto __pyx_L15_break;
      }

      /* "pandas/src/generated.pyx":8353
 *             if i == nleft:
 *                 break
 *             if j == nright:             # <<<<<<<<<<<<<<
 *                 break
 * 
 */
      __pyx_t_2 = ((__pyx_v_j == __pyx_v_nright) != 0);
      if (__pyx_t_2) {

        /* "pandas/src/generated.pyx":8354
 *                 break
 *             if j == nright:
 *                 break             # <<<<<<<<<<<<<<
 * 
 *             lval = left[i]
 */
        goto __pyx_L15_break;
      }

      /* "pandas/src/generated.pyx":8356
 *                 break
 * 
 *             lval = left[i]             # <<<<<<<<<<<<<<
 *             rval = right[j]
 *             if lval == rval:
 */
      __pyx_t_20 = __pyx_v_i;
      __pyx_v_lval = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_left.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_left.diminfo[0].strides));

      /* "pandas/src/generated.pyx":8357
 * 
 *             lval = left[i]
 *             rval = right[j]             # <<<<<<<<<<<<<<
 *             if lval == rval:
 *                 lindexer[count] = i
 */
      __pyx_t_21 = __pyx_v_j;
      __pyx_v_rval = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_right.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_right.diminfo[0].strides));

      /* "pandas/src/generated.pyx":8358
 *             lval = left[i]
 *             rval = right[j]
 *             if lval == rval:             # <<<<<<<<<<<<<<
 *                 lindexer[count] = i
 *                 rindexer[count] = j
 */
      __pyx_t_2 = ((__pyx_v_lval == __pyx_v_rval) != 0);
      if (__pyx_t_2) {

        /* "pandas/src/generated.pyx":8359
 *             rval = right[j]
 *             if lval == rval:
 *                 lindexer[count] = i             # <<<<<<<<<<<<<<
 *                 rindexer[count] = j
 *                 result[count] = rval
 */
        __pyx_t_22 = __pyx_v_count;
        *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_lindexer.rcbuffer->pybuffer.buf, __pyx_t_22, __pyx_pybuffernd_lindexer.diminfo[0].strides) = __pyx_v_i;

        /* "pandas/src/generated.pyx":8360
 *             if lval == rval:
 *                 lindexer[count] = i
 *                 rindexer[count] = j             # <<<<<<<<<<<<<<
 *                 result[count] = rval
 *                 count += 1
 */
        __pyx_t_23 = __pyx_v_count;
        *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_rindexer.rcbuffer->pybuffer.buf, __pyx_t_23, __pyx_pybuffernd_rindexer.diminfo[0].strides) = __pyx_v_j;

        /* "pandas/src/generated.pyx":8361
 *                 lindexer[count] = i
 *                 rindexer[count] = j
 *                 result[count] = rval             # <<<<<<<<<<<<<<
 *                 count += 1
 *                 if i < nleft - 1:
 */
        __pyx_t_24 = __pyx_v_count;
        *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_24, __pyx_pybuffernd_result.diminfo[0].strides) = __pyx_v_rval;

        /* "pandas/src/generated.pyx":8362
 *                 rindexer[count] = j
 *                 result[count] = rval
 *                 count += 1             # <<<<<<<<<<<<<<
 *                 if i < nleft - 1:
 *                     if j < nright - 1 and right[j + 1] == rval:
 */
        __pyx_v_count = (__pyx_v_count + 1);

        /* "pandas/src/generated.pyx":8363
 *                 result[count] = rval
 *                 count += 1
 *                 if i < nleft - 1:             # <<<<<<<<<<<<<<
 *                     if j < nright - 1 and right[j + 1] == rval:
 *                         j += 1
 */
        __pyx_t_2 = ((__pyx_v_i < (__pyx_v_nleft - 1)) != 0);
        if (__pyx_t_2) {

          /* "pandas/src/generated.pyx":8364
 *                 count += 1
 *                 if i < nleft - 1:
 *                     if j < nright - 1 and right[j + 1] == rval:             # <<<<<<<<<<<<<<
 *                         j += 1
 *                     else:
 */
          __pyx_t_2 = ((__pyx_v_j < (__pyx_v_nright - 1)) != 0);
          if (__pyx_t_2) {
            __pyx_t_25 = (__pyx_v_j + 1);
            __pyx_t_3 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_right.rcbuffer->pybuffer.buf, __pyx_t_25, __pyx_pybuffernd_right.diminfo[0].strides)) == __pyx_v_rval) != 0);
            __pyx_t_4 = __pyx_t_3;
          } else {
            __pyx_t_4 = __pyx_t_2;
          }
          if (__pyx_t_4) {

            /* "pandas/src/generated.pyx":8365
 *                 if i < nleft - 1:
 *                     if j < nright - 1 and right[j + 1] == rval:
 *                         j += 1             # <<<<<<<<<<<<<<
 *                     else:
 *                         i += 1
 */
            __pyx_v_j = (__pyx_v_j + 1);
            goto __pyx_L20;
          }
          /*else*/ {

            /* "pandas/src/generated.pyx":8367
 *                         j += 1
 *                     else:
 *                         i += 1             # <<<<<<<<<<<<<<
 *                         if left[i] != rval:
 *                             j += 1
 */
            __pyx_v_i = (__pyx_v_i + 1);

            /* "pandas/src/generated.pyx":8368
 *                     else:
 *                         i += 1
 *                         if left[i] != rval:             # <<<<<<<<<<<<<<
 *                             j += 1
 *                 elif j < nright - 1:
 */
            __pyx_t_26 = __pyx_v_i;
            __pyx_t_4 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_left.rcbuffer->pybuffer.buf, __pyx_t_26, __pyx_pybuffernd_left.diminfo[0].strides)) != __pyx_v_rval) != 0);
            if (__pyx_t_4) {

              /* "pandas/src/generated.pyx":8369
 *                         i += 1
 *                         if left[i] != rval:
 *                             j += 1             # <<<<<<<<<<<<<<
 *                 elif j < nright - 1:
 *                     j += 1
 */
              __pyx_v_j = (__pyx_v_j + 1);
              goto __pyx_L21;
            }
            __pyx_L21:;
          }
          __pyx_L20:;
          goto __pyx_L19;
        }

        /* "pandas/src/generated.pyx":8370
 *                         if left[i] != rval:
 *                             j += 1
 *                 elif j < nright - 1:             # <<<<<<<<<<<<<<
 *                     j += 1
 *                     if lval != right[j]:
 */
        __pyx_t_4 = ((__pyx_v_j < (__pyx_v_nright - 1)) != 0);
        if (__pyx_t_4) {

          /* "pandas/src/generated.pyx":8371
 *                             j += 1
 *                 elif j < nright - 1:
 *                     j += 1             # <<<<<<<<<<<<<<
 *                     if lval != right[j]:
 *                         i += 1
 */
          __pyx_v_j = (__pyx_v_j + 1);

          /* "pandas/src/generated.pyx":8372
 *                 elif j < nright - 1:
 *                     j += 1
 *                     if lval != right[j]:             # <<<<<<<<<<<<<<
 *                         i += 1
 *                 else:
 */
          __pyx_t_27 = __pyx_v_j;
          __pyx_t_4 = ((__pyx_v_lval != (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_right.rcbuffer->pybuffer.buf, __pyx_t_27, __pyx_pybuffernd_right.diminfo[0].strides))) != 0);
          if (__pyx_t_4) {

            /* "pandas/src/generated.pyx":8373
 *                     j += 1
 *                     if lval != right[j]:
 *                         i += 1             # <<<<<<<<<<<<<<
 *                 else:
 *                     # end of the road
 */
            __pyx_v_i = (__pyx_v_i + 1);
            goto __pyx_L22;
          }
          __pyx_L22:;
          goto __pyx_L19;
        }
        /*else*/ {

          /* "pandas/src/generated.pyx":8376
 *                 else:
 *                     # end of the road
 *                     break             # <<<<<<<<<<<<<<
 *             elif lval < rval:
 *                 i += 1
 */
          goto __pyx_L15_break;
        }
        __pyx_L19:;
        goto __pyx_L18;
      }

      /* "pandas/src/generated.pyx":8377
 *                     # end of the road
 *                     break
 *             elif lval < rval:             # <<<<<<<<<<<<<<
 *                 i += 1
 *             else:
 */
      __pyx_t_4 = ((__pyx_v_lval < __pyx_v_rval) != 0);
      if (__pyx_t_4) {

        /* "pandas/src/generated.pyx":8378
 *                     break
 *             elif lval < rval:
 *                 i += 1             # <<<<<<<<<<<<<<
 *             else:
 *                 j += 1
 */
        __pyx_v_i = (__pyx_v_i + 1);
        goto __pyx_L18;
      }
      /*else*/ {

        /* "pandas/src/generated.pyx":8380
 *                 i += 1
 *             else:
 *                 j += 1             # <<<<<<<<<<<<<<
 * 
 *     return result, lindexer, rindexer
 */
        __pyx_v_j = (__pyx_v_j + 1);
      }
      __pyx_L18:;
    }
    __pyx_L15_break:;
    goto __pyx_L13;
  }
  __pyx_L13:;

  /* "pandas/src/generated.pyx":8382
 *                 j += 1
 * 
 *     return result, lindexer, rindexer             # <<<<<<<<<<<<<<
 * 
 * @cython.wraparound(False)
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_10 = PyTuple_New(3); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8382; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__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_INCREF(((PyObject *)__pyx_v_lindexer));
  PyTuple_SET_ITEM(__pyx_t_10, 1, ((PyObject *)__pyx_v_lindexer));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_lindexer));
  __Pyx_INCREF(((PyObject *)__pyx_v_rindexer));
  PyTuple_SET_ITEM(__pyx_t_10, 2, ((PyObject *)__pyx_v_rindexer));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_rindexer));
  __pyx_r = __pyx_t_10;
  __pyx_t_10 = 0;
  goto __pyx_L0;

  /* "pandas/src/generated.pyx":8293
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def inner_join_indexer_float64(ndarray[float64_t] left,             # <<<<<<<<<<<<<<
 *                               ndarray[float64_t] right):
 *     '''
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_XDECREF(__pyx_t_13);
  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
    __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_left.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_lindexer.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_right.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_rindexer.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas.algos.inner_join_indexer_float64", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_left.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_lindexer.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_right.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_rindexer.rcbuffer->pybuffer);
  __pyx_L2:;
  __Pyx_XDECREF((PyObject *)__pyx_v_lindexer);
  __Pyx_XDECREF((PyObject *)__pyx_v_rindexer);
  __Pyx_XDECREF((PyObject *)__pyx_v_result);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/src/generated.pyx":8386
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def inner_join_indexer_float32(ndarray[float32_t] left,             # <<<<<<<<<<<<<<
 *                               ndarray[float32_t] right):
 *     '''
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pandas_5algos_503inner_join_indexer_float32(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6pandas_5algos_502inner_join_indexer_float32[] = "\n    Two-pass algorithm for monotonic indexes. Handles many-to-one merges\n    ";
static PyMethodDef __pyx_mdef_6pandas_5algos_503inner_join_indexer_float32 = {__Pyx_NAMESTR("inner_join_indexer_float32"), (PyCFunction)__pyx_pw_6pandas_5algos_503inner_join_indexer_float32, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6pandas_5algos_502inner_join_indexer_float32)};
static PyObject *__pyx_pw_6pandas_5algos_503inner_join_indexer_float32(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyArrayObject *__pyx_v_left = 0;
  PyArrayObject *__pyx_v_right = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("inner_join_indexer_float32 (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_left,&__pyx_n_s_right,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_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 (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_left)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_right)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("inner_join_indexer_float32", 1, 2, 2, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8386; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "inner_join_indexer_float32") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8386; __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("inner_join_indexer_float32", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8386; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas.algos.inner_join_indexer_float32", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_left), __pyx_ptype_5numpy_ndarray, 1, "left", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8386; __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[2]; __pyx_lineno = 8387; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_502inner_join_indexer_float32(__pyx_self, __pyx_v_left, __pyx_v_right);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pandas_5algos_502inner_join_indexer_float32(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_left, PyArrayObject *__pyx_v_right) {
  Py_ssize_t __pyx_v_i;
  Py_ssize_t __pyx_v_j;
  Py_ssize_t __pyx_v_nright;
  Py_ssize_t __pyx_v_nleft;
  Py_ssize_t __pyx_v_count;
  __pyx_t_5numpy_float32_t __pyx_v_lval;
  __pyx_t_5numpy_float32_t __pyx_v_rval;
  PyArrayObject *__pyx_v_lindexer = 0;
  PyArrayObject *__pyx_v_rindexer = 0;
  PyArrayObject *__pyx_v_result = 0;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_left;
  __Pyx_Buffer __pyx_pybuffer_left;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_lindexer;
  __Pyx_Buffer __pyx_pybuffer_lindexer;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_result;
  __Pyx_Buffer __pyx_pybuffer_result;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_right;
  __Pyx_Buffer __pyx_pybuffer_right;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_rindexer;
  __Pyx_Buffer __pyx_pybuffer_rindexer;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  Py_ssize_t __pyx_t_1;
  int __pyx_t_2;
  int __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;
  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;
  PyObject *__pyx_t_13 = NULL;
  PyArrayObject *__pyx_t_14 = NULL;
  int __pyx_t_15;
  PyObject *__pyx_t_16 = NULL;
  PyObject *__pyx_t_17 = NULL;
  PyObject *__pyx_t_18 = NULL;
  PyArrayObject *__pyx_t_19 = NULL;
  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;
  __Pyx_RefNannySetupContext("inner_join_indexer_float32", 0);
  __pyx_pybuffer_lindexer.pybuffer.buf = NULL;
  __pyx_pybuffer_lindexer.refcount = 0;
  __pyx_pybuffernd_lindexer.data = NULL;
  __pyx_pybuffernd_lindexer.rcbuffer = &__pyx_pybuffer_lindexer;
  __pyx_pybuffer_rindexer.pybuffer.buf = NULL;
  __pyx_pybuffer_rindexer.refcount = 0;
  __pyx_pybuffernd_rindexer.data = NULL;
  __pyx_pybuffernd_rindexer.rcbuffer = &__pyx_pybuffer_rindexer;
  __pyx_pybuffer_result.pybuffer.buf = NULL;
  __pyx_pybuffer_result.refcount = 0;
  __pyx_pybuffernd_result.data = NULL;
  __pyx_pybuffernd_result.rcbuffer = &__pyx_pybuffer_result;
  __pyx_pybuffer_left.pybuffer.buf = NULL;
  __pyx_pybuffer_left.refcount = 0;
  __pyx_pybuffernd_left.data = NULL;
  __pyx_pybuffernd_left.rcbuffer = &__pyx_pybuffer_left;
  __pyx_pybuffer_right.pybuffer.buf = NULL;
  __pyx_pybuffer_right.refcount = 0;
  __pyx_pybuffernd_right.data = NULL;
  __pyx_pybuffernd_right.rcbuffer = &__pyx_pybuffer_right;
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_left.rcbuffer->pybuffer, (PyObject*)__pyx_v_left, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8386; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_left.diminfo[0].strides = __pyx_pybuffernd_left.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_left.diminfo[0].shape = __pyx_pybuffernd_left.rcbuffer->pybuffer.shape[0];
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_right.rcbuffer->pybuffer, (PyObject*)__pyx_v_right, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8386; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_right.diminfo[0].strides = __pyx_pybuffernd_right.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_right.diminfo[0].shape = __pyx_pybuffernd_right.rcbuffer->pybuffer.shape[0];

  /* "pandas/src/generated.pyx":8397
 *         ndarray[float32_t] result
 * 
 *     nleft = len(left)             # <<<<<<<<<<<<<<
 *     nright = len(right)
 * 
 */
  __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_left)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8397; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_nleft = __pyx_t_1;

  /* "pandas/src/generated.pyx":8398
 * 
 *     nleft = len(left)
 *     nright = len(right)             # <<<<<<<<<<<<<<
 * 
 *     i = 0
 */
  __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_right)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8398; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_nright = __pyx_t_1;

  /* "pandas/src/generated.pyx":8400
 *     nright = len(right)
 * 
 *     i = 0             # <<<<<<<<<<<<<<
 *     j = 0
 *     count = 0
 */
  __pyx_v_i = 0;

  /* "pandas/src/generated.pyx":8401
 * 
 *     i = 0
 *     j = 0             # <<<<<<<<<<<<<<
 *     count = 0
 *     if nleft > 0 and nright > 0:
 */
  __pyx_v_j = 0;

  /* "pandas/src/generated.pyx":8402
 *     i = 0
 *     j = 0
 *     count = 0             # <<<<<<<<<<<<<<
 *     if nleft > 0 and nright > 0:
 *         while True:
 */
  __pyx_v_count = 0;

  /* "pandas/src/generated.pyx":8403
 *     j = 0
 *     count = 0
 *     if nleft > 0 and nright > 0:             # <<<<<<<<<<<<<<
 *         while True:
 *             if i == nleft:
 */
  __pyx_t_2 = ((__pyx_v_nleft > 0) != 0);
  if (__pyx_t_2) {
    __pyx_t_3 = ((__pyx_v_nright > 0) != 0);
    __pyx_t_4 = __pyx_t_3;
  } else {
    __pyx_t_4 = __pyx_t_2;
  }
  if (__pyx_t_4) {

    /* "pandas/src/generated.pyx":8404
 *     count = 0
 *     if nleft > 0 and nright > 0:
 *         while True:             # <<<<<<<<<<<<<<
 *             if i == nleft:
 *                 break
 */
    while (1) {

      /* "pandas/src/generated.pyx":8405
 *     if nleft > 0 and nright > 0:
 *         while True:
 *             if i == nleft:             # <<<<<<<<<<<<<<
 *                 break
 *             if j == nright:
 */
      __pyx_t_4 = ((__pyx_v_i == __pyx_v_nleft) != 0);
      if (__pyx_t_4) {

        /* "pandas/src/generated.pyx":8406
 *         while True:
 *             if i == nleft:
 *                 break             # <<<<<<<<<<<<<<
 *             if j == nright:
 *                 break
 */
        goto __pyx_L5_break;
      }

      /* "pandas/src/generated.pyx":8407
 *             if i == nleft:
 *                 break
 *             if j == nright:             # <<<<<<<<<<<<<<
 *                 break
 * 
 */
      __pyx_t_4 = ((__pyx_v_j == __pyx_v_nright) != 0);
      if (__pyx_t_4) {

        /* "pandas/src/generated.pyx":8408
 *                 break
 *             if j == nright:
 *                 break             # <<<<<<<<<<<<<<
 * 
 *             lval = left[i]
 */
        goto __pyx_L5_break;
      }

      /* "pandas/src/generated.pyx":8410
 *                 break
 * 
 *             lval = left[i]             # <<<<<<<<<<<<<<
 *             rval = right[j]
 *             if lval == rval:
 */
      __pyx_t_1 = __pyx_v_i;
      __pyx_v_lval = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_left.rcbuffer->pybuffer.buf, __pyx_t_1, __pyx_pybuffernd_left.diminfo[0].strides));

      /* "pandas/src/generated.pyx":8411
 * 
 *             lval = left[i]
 *             rval = right[j]             # <<<<<<<<<<<<<<
 *             if lval == rval:
 *                 count += 1
 */
      __pyx_t_5 = __pyx_v_j;
      __pyx_v_rval = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_right.rcbuffer->pybuffer.buf, __pyx_t_5, __pyx_pybuffernd_right.diminfo[0].strides));

      /* "pandas/src/generated.pyx":8412
 *             lval = left[i]
 *             rval = right[j]
 *             if lval == rval:             # <<<<<<<<<<<<<<
 *                 count += 1
 *                 if i < nleft - 1:
 */
      __pyx_t_4 = ((__pyx_v_lval == __pyx_v_rval) != 0);
      if (__pyx_t_4) {

        /* "pandas/src/generated.pyx":8413
 *             rval = right[j]
 *             if lval == rval:
 *                 count += 1             # <<<<<<<<<<<<<<
 *                 if i < nleft - 1:
 *                     if j < nright - 1 and right[j + 1] == rval:
 */
        __pyx_v_count = (__pyx_v_count + 1);

        /* "pandas/src/generated.pyx":8414
 *             if lval == rval:
 *                 count += 1
 *                 if i < nleft - 1:             # <<<<<<<<<<<<<<
 *                     if j < nright - 1 and right[j + 1] == rval:
 *                         j += 1
 */
        __pyx_t_4 = ((__pyx_v_i < (__pyx_v_nleft - 1)) != 0);
        if (__pyx_t_4) {

          /* "pandas/src/generated.pyx":8415
 *                 count += 1
 *                 if i < nleft - 1:
 *                     if j < nright - 1 and right[j + 1] == rval:             # <<<<<<<<<<<<<<
 *                         j += 1
 *                     else:
 */
          __pyx_t_4 = ((__pyx_v_j < (__pyx_v_nright - 1)) != 0);
          if (__pyx_t_4) {
            __pyx_t_6 = (__pyx_v_j + 1);
            __pyx_t_2 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_right.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_right.diminfo[0].strides)) == __pyx_v_rval) != 0);
            __pyx_t_3 = __pyx_t_2;
          } else {
            __pyx_t_3 = __pyx_t_4;
          }
          if (__pyx_t_3) {

            /* "pandas/src/generated.pyx":8416
 *                 if i < nleft - 1:
 *                     if j < nright - 1 and right[j + 1] == rval:
 *                         j += 1             # <<<<<<<<<<<<<<
 *                     else:
 *                         i += 1
 */
            __pyx_v_j = (__pyx_v_j + 1);
            goto __pyx_L10;
          }
          /*else*/ {

            /* "pandas/src/generated.pyx":8418
 *                         j += 1
 *                     else:
 *                         i += 1             # <<<<<<<<<<<<<<
 *                         if left[i] != rval:
 *                             j += 1
 */
            __pyx_v_i = (__pyx_v_i + 1);

            /* "pandas/src/generated.pyx":8419
 *                     else:
 *                         i += 1
 *                         if left[i] != rval:             # <<<<<<<<<<<<<<
 *                             j += 1
 *                 elif j < nright - 1:
 */
            __pyx_t_7 = __pyx_v_i;
            __pyx_t_3 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_left.rcbuffer->pybuffer.buf, __pyx_t_7, __pyx_pybuffernd_left.diminfo[0].strides)) != __pyx_v_rval) != 0);
            if (__pyx_t_3) {

              /* "pandas/src/generated.pyx":8420
 *                         i += 1
 *                         if left[i] != rval:
 *                             j += 1             # <<<<<<<<<<<<<<
 *                 elif j < nright - 1:
 *                     j += 1
 */
              __pyx_v_j = (__pyx_v_j + 1);
              goto __pyx_L11;
            }
            __pyx_L11:;
          }
          __pyx_L10:;
          goto __pyx_L9;
        }

        /* "pandas/src/generated.pyx":8421
 *                         if left[i] != rval:
 *                             j += 1
 *                 elif j < nright - 1:             # <<<<<<<<<<<<<<
 *                     j += 1
 *                     if lval != right[j]:
 */
        __pyx_t_3 = ((__pyx_v_j < (__pyx_v_nright - 1)) != 0);
        if (__pyx_t_3) {

          /* "pandas/src/generated.pyx":8422
 *                             j += 1
 *                 elif j < nright - 1:
 *                     j += 1             # <<<<<<<<<<<<<<
 *                     if lval != right[j]:
 *                         i += 1
 */
          __pyx_v_j = (__pyx_v_j + 1);

          /* "pandas/src/generated.pyx":8423
 *                 elif j < nright - 1:
 *                     j += 1
 *                     if lval != right[j]:             # <<<<<<<<<<<<<<
 *                         i += 1
 *                 else:
 */
          __pyx_t_8 = __pyx_v_j;
          __pyx_t_3 = ((__pyx_v_lval != (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_right.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_right.diminfo[0].strides))) != 0);
          if (__pyx_t_3) {

            /* "pandas/src/generated.pyx":8424
 *                     j += 1
 *                     if lval != right[j]:
 *                         i += 1             # <<<<<<<<<<<<<<
 *                 else:
 *                     # end of the road
 */
            __pyx_v_i = (__pyx_v_i + 1);
            goto __pyx_L12;
          }
          __pyx_L12:;
          goto __pyx_L9;
        }
        /*else*/ {

          /* "pandas/src/generated.pyx":8427
 *                 else:
 *                     # end of the road
 *                     break             # <<<<<<<<<<<<<<
 *             elif lval < rval:
 *                 i += 1
 */
          goto __pyx_L5_break;
        }
        __pyx_L9:;
        goto __pyx_L8;
      }

      /* "pandas/src/generated.pyx":8428
 *                     # end of the road
 *                     break
 *             elif lval < rval:             # <<<<<<<<<<<<<<
 *                 i += 1
 *             else:
 */
      __pyx_t_3 = ((__pyx_v_lval < __pyx_v_rval) != 0);
      if (__pyx_t_3) {

        /* "pandas/src/generated.pyx":8429
 *                     break
 *             elif lval < rval:
 *                 i += 1             # <<<<<<<<<<<<<<
 *             else:
 *                 j += 1
 */
        __pyx_v_i = (__pyx_v_i + 1);
        goto __pyx_L8;
      }
      /*else*/ {

        /* "pandas/src/generated.pyx":8431
 *                 i += 1
 *             else:
 *                 j += 1             # <<<<<<<<<<<<<<
 * 
 *     # do it again now that result size is known
 */
        __pyx_v_j = (__pyx_v_j + 1);
      }
      __pyx_L8:;
    }
    __pyx_L5_break:;
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "pandas/src/generated.pyx":8435
 *     # do it again now that result size is known
 * 
 *     lindexer = np.empty(count, dtype=np.int64)             # <<<<<<<<<<<<<<
 *     rindexer = np.empty(count, dtype=np.int64)
 *     result = np.empty(count, dtype=np.float32)
 */
  __pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8435; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_9);
  __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_empty); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8435; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_10);
  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  __pyx_t_9 = PyInt_FromSsize_t(__pyx_v_count); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8435; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_9);
  __pyx_t_11 = PyTuple_New(1); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8435; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_11);
  PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_9);
  __Pyx_GIVEREF(__pyx_t_9);
  __pyx_t_9 = 0;
  __pyx_t_9 = PyDict_New(); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8435; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_9);
  __pyx_t_12 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8435; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_12);
  __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_int64); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8435; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_13);
  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
  if (PyDict_SetItem(__pyx_t_9, __pyx_n_s_dtype, __pyx_t_13) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8435; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  __pyx_t_13 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_t_11, __pyx_t_9); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8435; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_13);
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 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 = 8435; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_14 = ((PyArrayObject *)__pyx_t_13);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_lindexer.rcbuffer->pybuffer);
    __pyx_t_15 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_lindexer.rcbuffer->pybuffer, (PyObject*)__pyx_t_14, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack);
    if (unlikely(__pyx_t_15 < 0)) {
      PyErr_Fetch(&__pyx_t_16, &__pyx_t_17, &__pyx_t_18);
      if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_lindexer.rcbuffer->pybuffer, (PyObject*)__pyx_v_lindexer, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {
        Py_XDECREF(__pyx_t_16); Py_XDECREF(__pyx_t_17); Py_XDECREF(__pyx_t_18);
        __Pyx_RaiseBufferFallbackError();
      } else {
        PyErr_Restore(__pyx_t_16, __pyx_t_17, __pyx_t_18);
      }
    }
    __pyx_pybuffernd_lindexer.diminfo[0].strides = __pyx_pybuffernd_lindexer.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_lindexer.diminfo[0].shape = __pyx_pybuffernd_lindexer.rcbuffer->pybuffer.shape[0];
    if (unlikely(__pyx_t_15 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8435; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_14 = 0;
  __pyx_v_lindexer = ((PyArrayObject *)__pyx_t_13);
  __pyx_t_13 = 0;

  /* "pandas/src/generated.pyx":8436
 * 
 *     lindexer = np.empty(count, dtype=np.int64)
 *     rindexer = np.empty(count, dtype=np.int64)             # <<<<<<<<<<<<<<
 *     result = np.empty(count, dtype=np.float32)
 * 
 */
  __pyx_t_13 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8436; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_13);
  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_n_s_empty); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8436; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_9);
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  __pyx_t_13 = PyInt_FromSsize_t(__pyx_v_count); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8436; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_13);
  __pyx_t_11 = PyTuple_New(1); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8436; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_11);
  PyTuple_SET_ITEM(__pyx_t_11, 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 = 8436; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_13);
  __pyx_t_10 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8436; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_10);
  __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_int64); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8436; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_12);
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  if (PyDict_SetItem(__pyx_t_13, __pyx_n_s_dtype, __pyx_t_12) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8436; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
  __pyx_t_12 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_11, __pyx_t_13); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8436; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_12);
  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  if (!(likely(((__pyx_t_12) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_12, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8436; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_14 = ((PyArrayObject *)__pyx_t_12);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_rindexer.rcbuffer->pybuffer);
    __pyx_t_15 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_rindexer.rcbuffer->pybuffer, (PyObject*)__pyx_t_14, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack);
    if (unlikely(__pyx_t_15 < 0)) {
      PyErr_Fetch(&__pyx_t_18, &__pyx_t_17, &__pyx_t_16);
      if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_rindexer.rcbuffer->pybuffer, (PyObject*)__pyx_v_rindexer, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {
        Py_XDECREF(__pyx_t_18); Py_XDECREF(__pyx_t_17); Py_XDECREF(__pyx_t_16);
        __Pyx_RaiseBufferFallbackError();
      } else {
        PyErr_Restore(__pyx_t_18, __pyx_t_17, __pyx_t_16);
      }
    }
    __pyx_pybuffernd_rindexer.diminfo[0].strides = __pyx_pybuffernd_rindexer.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_rindexer.diminfo[0].shape = __pyx_pybuffernd_rindexer.rcbuffer->pybuffer.shape[0];
    if (unlikely(__pyx_t_15 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8436; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_14 = 0;
  __pyx_v_rindexer = ((PyArrayObject *)__pyx_t_12);
  __pyx_t_12 = 0;

  /* "pandas/src/generated.pyx":8437
 *     lindexer = np.empty(count, dtype=np.int64)
 *     rindexer = np.empty(count, dtype=np.int64)
 *     result = np.empty(count, dtype=np.float32)             # <<<<<<<<<<<<<<
 * 
 *     i = 0
 */
  __pyx_t_12 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8437; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_12);
  __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_empty); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8437; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_13);
  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
  __pyx_t_12 = PyInt_FromSsize_t(__pyx_v_count); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8437; __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[2]; __pyx_lineno = 8437; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__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 = PyDict_New(); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8437; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_12);
  __pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8437; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_9);
  __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_float32); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8437; __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_12, __pyx_n_s_dtype, __pyx_t_10) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8437; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_13, __pyx_t_11, __pyx_t_12); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8437; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_10);
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
  if (!(likely(((__pyx_t_10) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_10, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8437; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_19 = ((PyArrayObject *)__pyx_t_10);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer);
    __pyx_t_15 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_result.rcbuffer->pybuffer, (PyObject*)__pyx_t_19, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack);
    if (unlikely(__pyx_t_15 < 0)) {
      PyErr_Fetch(&__pyx_t_16, &__pyx_t_17, &__pyx_t_18);
      if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_result.rcbuffer->pybuffer, (PyObject*)__pyx_v_result, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {
        Py_XDECREF(__pyx_t_16); Py_XDECREF(__pyx_t_17); Py_XDECREF(__pyx_t_18);
        __Pyx_RaiseBufferFallbackError();
      } else {
        PyErr_Restore(__pyx_t_16, __pyx_t_17, __pyx_t_18);
      }
    }
    __pyx_pybuffernd_result.diminfo[0].strides = __pyx_pybuffernd_result.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_result.diminfo[0].shape = __pyx_pybuffernd_result.rcbuffer->pybuffer.shape[0];
    if (unlikely(__pyx_t_15 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8437; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_19 = 0;
  __pyx_v_result = ((PyArrayObject *)__pyx_t_10);
  __pyx_t_10 = 0;

  /* "pandas/src/generated.pyx":8439
 *     result = np.empty(count, dtype=np.float32)
 * 
 *     i = 0             # <<<<<<<<<<<<<<
 *     j = 0
 *     count = 0
 */
  __pyx_v_i = 0;

  /* "pandas/src/generated.pyx":8440
 * 
 *     i = 0
 *     j = 0             # <<<<<<<<<<<<<<
 *     count = 0
 *     if nleft > 0 and nright > 0:
 */
  __pyx_v_j = 0;

  /* "pandas/src/generated.pyx":8441
 *     i = 0
 *     j = 0
 *     count = 0             # <<<<<<<<<<<<<<
 *     if nleft > 0 and nright > 0:
 *         while True:
 */
  __pyx_v_count = 0;

  /* "pandas/src/generated.pyx":8442
 *     j = 0
 *     count = 0
 *     if nleft > 0 and nright > 0:             # <<<<<<<<<<<<<<
 *         while True:
 *             if i == nleft:
 */
  __pyx_t_3 = ((__pyx_v_nleft > 0) != 0);
  if (__pyx_t_3) {
    __pyx_t_4 = ((__pyx_v_nright > 0) != 0);
    __pyx_t_2 = __pyx_t_4;
  } else {
    __pyx_t_2 = __pyx_t_3;
  }
  if (__pyx_t_2) {

    /* "pandas/src/generated.pyx":8443
 *     count = 0
 *     if nleft > 0 and nright > 0:
 *         while True:             # <<<<<<<<<<<<<<
 *             if i == nleft:
 *                 break
 */
    while (1) {

      /* "pandas/src/generated.pyx":8444
 *     if nleft > 0 and nright > 0:
 *         while True:
 *             if i == nleft:             # <<<<<<<<<<<<<<
 *                 break
 *             if j == nright:
 */
      __pyx_t_2 = ((__pyx_v_i == __pyx_v_nleft) != 0);
      if (__pyx_t_2) {

        /* "pandas/src/generated.pyx":8445
 *         while True:
 *             if i == nleft:
 *                 break             # <<<<<<<<<<<<<<
 *             if j == nright:
 *                 break
 */
        goto __pyx_L15_break;
      }

      /* "pandas/src/generated.pyx":8446
 *             if i == nleft:
 *                 break
 *             if j == nright:             # <<<<<<<<<<<<<<
 *                 break
 * 
 */
      __pyx_t_2 = ((__pyx_v_j == __pyx_v_nright) != 0);
      if (__pyx_t_2) {

        /* "pandas/src/generated.pyx":8447
 *                 break
 *             if j == nright:
 *                 break             # <<<<<<<<<<<<<<
 * 
 *             lval = left[i]
 */
        goto __pyx_L15_break;
      }

      /* "pandas/src/generated.pyx":8449
 *                 break
 * 
 *             lval = left[i]             # <<<<<<<<<<<<<<
 *             rval = right[j]
 *             if lval == rval:
 */
      __pyx_t_20 = __pyx_v_i;
      __pyx_v_lval = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_left.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_left.diminfo[0].strides));

      /* "pandas/src/generated.pyx":8450
 * 
 *             lval = left[i]
 *             rval = right[j]             # <<<<<<<<<<<<<<
 *             if lval == rval:
 *                 lindexer[count] = i
 */
      __pyx_t_21 = __pyx_v_j;
      __pyx_v_rval = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_right.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_right.diminfo[0].strides));

      /* "pandas/src/generated.pyx":8451
 *             lval = left[i]
 *             rval = right[j]
 *             if lval == rval:             # <<<<<<<<<<<<<<
 *                 lindexer[count] = i
 *                 rindexer[count] = j
 */
      __pyx_t_2 = ((__pyx_v_lval == __pyx_v_rval) != 0);
      if (__pyx_t_2) {

        /* "pandas/src/generated.pyx":8452
 *             rval = right[j]
 *             if lval == rval:
 *                 lindexer[count] = i             # <<<<<<<<<<<<<<
 *                 rindexer[count] = j
 *                 result[count] = rval
 */
        __pyx_t_22 = __pyx_v_count;
        *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_lindexer.rcbuffer->pybuffer.buf, __pyx_t_22, __pyx_pybuffernd_lindexer.diminfo[0].strides) = __pyx_v_i;

        /* "pandas/src/generated.pyx":8453
 *             if lval == rval:
 *                 lindexer[count] = i
 *                 rindexer[count] = j             # <<<<<<<<<<<<<<
 *                 result[count] = rval
 *                 count += 1
 */
        __pyx_t_23 = __pyx_v_count;
        *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_rindexer.rcbuffer->pybuffer.buf, __pyx_t_23, __pyx_pybuffernd_rindexer.diminfo[0].strides) = __pyx_v_j;

        /* "pandas/src/generated.pyx":8454
 *                 lindexer[count] = i
 *                 rindexer[count] = j
 *                 result[count] = rval             # <<<<<<<<<<<<<<
 *                 count += 1
 *                 if i < nleft - 1:
 */
        __pyx_t_24 = __pyx_v_count;
        *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_24, __pyx_pybuffernd_result.diminfo[0].strides) = __pyx_v_rval;

        /* "pandas/src/generated.pyx":8455
 *                 rindexer[count] = j
 *                 result[count] = rval
 *                 count += 1             # <<<<<<<<<<<<<<
 *                 if i < nleft - 1:
 *                     if j < nright - 1 and right[j + 1] == rval:
 */
        __pyx_v_count = (__pyx_v_count + 1);

        /* "pandas/src/generated.pyx":8456
 *                 result[count] = rval
 *                 count += 1
 *                 if i < nleft - 1:             # <<<<<<<<<<<<<<
 *                     if j < nright - 1 and right[j + 1] == rval:
 *                         j += 1
 */
        __pyx_t_2 = ((__pyx_v_i < (__pyx_v_nleft - 1)) != 0);
        if (__pyx_t_2) {

          /* "pandas/src/generated.pyx":8457
 *                 count += 1
 *                 if i < nleft - 1:
 *                     if j < nright - 1 and right[j + 1] == rval:             # <<<<<<<<<<<<<<
 *                         j += 1
 *                     else:
 */
          __pyx_t_2 = ((__pyx_v_j < (__pyx_v_nright - 1)) != 0);
          if (__pyx_t_2) {
            __pyx_t_25 = (__pyx_v_j + 1);
            __pyx_t_3 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_right.rcbuffer->pybuffer.buf, __pyx_t_25, __pyx_pybuffernd_right.diminfo[0].strides)) == __pyx_v_rval) != 0);
            __pyx_t_4 = __pyx_t_3;
          } else {
            __pyx_t_4 = __pyx_t_2;
          }
          if (__pyx_t_4) {

            /* "pandas/src/generated.pyx":8458
 *                 if i < nleft - 1:
 *                     if j < nright - 1 and right[j + 1] == rval:
 *                         j += 1             # <<<<<<<<<<<<<<
 *                     else:
 *                         i += 1
 */
            __pyx_v_j = (__pyx_v_j + 1);
            goto __pyx_L20;
          }
          /*else*/ {

            /* "pandas/src/generated.pyx":8460
 *                         j += 1
 *                     else:
 *                         i += 1             # <<<<<<<<<<<<<<
 *                         if left[i] != rval:
 *                             j += 1
 */
            __pyx_v_i = (__pyx_v_i + 1);

            /* "pandas/src/generated.pyx":8461
 *                     else:
 *                         i += 1
 *                         if left[i] != rval:             # <<<<<<<<<<<<<<
 *                             j += 1
 *                 elif j < nright - 1:
 */
            __pyx_t_26 = __pyx_v_i;
            __pyx_t_4 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_left.rcbuffer->pybuffer.buf, __pyx_t_26, __pyx_pybuffernd_left.diminfo[0].strides)) != __pyx_v_rval) != 0);
            if (__pyx_t_4) {

              /* "pandas/src/generated.pyx":8462
 *                         i += 1
 *                         if left[i] != rval:
 *                             j += 1             # <<<<<<<<<<<<<<
 *                 elif j < nright - 1:
 *                     j += 1
 */
              __pyx_v_j = (__pyx_v_j + 1);
              goto __pyx_L21;
            }
            __pyx_L21:;
          }
          __pyx_L20:;
          goto __pyx_L19;
        }

        /* "pandas/src/generated.pyx":8463
 *                         if left[i] != rval:
 *                             j += 1
 *                 elif j < nright - 1:             # <<<<<<<<<<<<<<
 *                     j += 1
 *                     if lval != right[j]:
 */
        __pyx_t_4 = ((__pyx_v_j < (__pyx_v_nright - 1)) != 0);
        if (__pyx_t_4) {

          /* "pandas/src/generated.pyx":8464
 *                             j += 1
 *                 elif j < nright - 1:
 *                     j += 1             # <<<<<<<<<<<<<<
 *                     if lval != right[j]:
 *                         i += 1
 */
          __pyx_v_j = (__pyx_v_j + 1);

          /* "pandas/src/generated.pyx":8465
 *                 elif j < nright - 1:
 *                     j += 1
 *                     if lval != right[j]:             # <<<<<<<<<<<<<<
 *                         i += 1
 *                 else:
 */
          __pyx_t_27 = __pyx_v_j;
          __pyx_t_4 = ((__pyx_v_lval != (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_right.rcbuffer->pybuffer.buf, __pyx_t_27, __pyx_pybuffernd_right.diminfo[0].strides))) != 0);
          if (__pyx_t_4) {

            /* "pandas/src/generated.pyx":8466
 *                     j += 1
 *                     if lval != right[j]:
 *                         i += 1             # <<<<<<<<<<<<<<
 *                 else:
 *                     # end of the road
 */
            __pyx_v_i = (__pyx_v_i + 1);
            goto __pyx_L22;
          }
          __pyx_L22:;
          goto __pyx_L19;
        }
        /*else*/ {

          /* "pandas/src/generated.pyx":8469
 *                 else:
 *                     # end of the road
 *                     break             # <<<<<<<<<<<<<<
 *             elif lval < rval:
 *                 i += 1
 */
          goto __pyx_L15_break;
        }
        __pyx_L19:;
        goto __pyx_L18;
      }

      /* "pandas/src/generated.pyx":8470
 *                     # end of the road
 *                     break
 *             elif lval < rval:             # <<<<<<<<<<<<<<
 *                 i += 1
 *             else:
 */
      __pyx_t_4 = ((__pyx_v_lval < __pyx_v_rval) != 0);
      if (__pyx_t_4) {

        /* "pandas/src/generated.pyx":8471
 *                     break
 *             elif lval < rval:
 *                 i += 1             # <<<<<<<<<<<<<<
 *             else:
 *                 j += 1
 */
        __pyx_v_i = (__pyx_v_i + 1);
        goto __pyx_L18;
      }
      /*else*/ {

        /* "pandas/src/generated.pyx":8473
 *                 i += 1
 *             else:
 *                 j += 1             # <<<<<<<<<<<<<<
 * 
 *     return result, lindexer, rindexer
 */
        __pyx_v_j = (__pyx_v_j + 1);
      }
      __pyx_L18:;
    }
    __pyx_L15_break:;
    goto __pyx_L13;
  }
  __pyx_L13:;

  /* "pandas/src/generated.pyx":8475
 *                 j += 1
 * 
 *     return result, lindexer, rindexer             # <<<<<<<<<<<<<<
 * 
 * @cython.wraparound(False)
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_10 = PyTuple_New(3); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8475; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__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_INCREF(((PyObject *)__pyx_v_lindexer));
  PyTuple_SET_ITEM(__pyx_t_10, 1, ((PyObject *)__pyx_v_lindexer));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_lindexer));
  __Pyx_INCREF(((PyObject *)__pyx_v_rindexer));
  PyTuple_SET_ITEM(__pyx_t_10, 2, ((PyObject *)__pyx_v_rindexer));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_rindexer));
  __pyx_r = __pyx_t_10;
  __pyx_t_10 = 0;
  goto __pyx_L0;

  /* "pandas/src/generated.pyx":8386
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def inner_join_indexer_float32(ndarray[float32_t] left,             # <<<<<<<<<<<<<<
 *                               ndarray[float32_t] right):
 *     '''
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_XDECREF(__pyx_t_13);
  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
    __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_left.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_lindexer.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_right.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_rindexer.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas.algos.inner_join_indexer_float32", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_left.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_lindexer.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_right.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_rindexer.rcbuffer->pybuffer);
  __pyx_L2:;
  __Pyx_XDECREF((PyObject *)__pyx_v_lindexer);
  __Pyx_XDECREF((PyObject *)__pyx_v_rindexer);
  __Pyx_XDECREF((PyObject *)__pyx_v_result);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/src/generated.pyx":8479
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def inner_join_indexer_object(ndarray[object] left,             # <<<<<<<<<<<<<<
 *                               ndarray[object] right):
 *     '''
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pandas_5algos_505inner_join_indexer_object(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6pandas_5algos_504inner_join_indexer_object[] = "\n    Two-pass algorithm for monotonic indexes. Handles many-to-one merges\n    ";
static PyMethodDef __pyx_mdef_6pandas_5algos_505inner_join_indexer_object = {__Pyx_NAMESTR("inner_join_indexer_object"), (PyCFunction)__pyx_pw_6pandas_5algos_505inner_join_indexer_object, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6pandas_5algos_504inner_join_indexer_object)};
static PyObject *__pyx_pw_6pandas_5algos_505inner_join_indexer_object(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyArrayObject *__pyx_v_left = 0;
  PyArrayObject *__pyx_v_right = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("inner_join_indexer_object (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_left,&__pyx_n_s_right,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_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 (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_left)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_right)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("inner_join_indexer_object", 1, 2, 2, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8479; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "inner_join_indexer_object") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8479; __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("inner_join_indexer_object", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8479; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas.algos.inner_join_indexer_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_left), __pyx_ptype_5numpy_ndarray, 1, "left", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8479; __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[2]; __pyx_lineno = 8480; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_504inner_join_indexer_object(__pyx_self, __pyx_v_left, __pyx_v_right);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pandas_5algos_504inner_join_indexer_object(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_left, PyArrayObject *__pyx_v_right) {
  Py_ssize_t __pyx_v_i;
  Py_ssize_t __pyx_v_j;
  Py_ssize_t __pyx_v_nright;
  Py_ssize_t __pyx_v_nleft;
  Py_ssize_t __pyx_v_count;
  PyObject *__pyx_v_lval = 0;
  PyObject *__pyx_v_rval = 0;
  PyArrayObject *__pyx_v_lindexer = 0;
  PyArrayObject *__pyx_v_rindexer = 0;
  PyArrayObject *__pyx_v_result = 0;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_left;
  __Pyx_Buffer __pyx_pybuffer_left;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_lindexer;
  __Pyx_Buffer __pyx_pybuffer_lindexer;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_result;
  __Pyx_Buffer __pyx_pybuffer_result;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_right;
  __Pyx_Buffer __pyx_pybuffer_right;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_rindexer;
  __Pyx_Buffer __pyx_pybuffer_rindexer;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  Py_ssize_t __pyx_t_1;
  int __pyx_t_2;
  int __pyx_t_3;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  Py_ssize_t __pyx_t_6;
  Py_ssize_t __pyx_t_7;
  PyObject *__pyx_t_8 = NULL;
  Py_ssize_t __pyx_t_9;
  Py_ssize_t __pyx_t_10;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  PyArrayObject *__pyx_t_14 = NULL;
  int __pyx_t_15;
  PyObject *__pyx_t_16 = NULL;
  PyObject *__pyx_t_17 = NULL;
  PyObject *__pyx_t_18 = NULL;
  PyArrayObject *__pyx_t_19 = NULL;
  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;
  PyObject **__pyx_t_25;
  Py_ssize_t __pyx_t_26;
  Py_ssize_t __pyx_t_27;
  Py_ssize_t __pyx_t_28;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("inner_join_indexer_object", 0);
  __pyx_pybuffer_lindexer.pybuffer.buf = NULL;
  __pyx_pybuffer_lindexer.refcount = 0;
  __pyx_pybuffernd_lindexer.data = NULL;
  __pyx_pybuffernd_lindexer.rcbuffer = &__pyx_pybuffer_lindexer;
  __pyx_pybuffer_rindexer.pybuffer.buf = NULL;
  __pyx_pybuffer_rindexer.refcount = 0;
  __pyx_pybuffernd_rindexer.data = NULL;
  __pyx_pybuffernd_rindexer.rcbuffer = &__pyx_pybuffer_rindexer;
  __pyx_pybuffer_result.pybuffer.buf = NULL;
  __pyx_pybuffer_result.refcount = 0;
  __pyx_pybuffernd_result.data = NULL;
  __pyx_pybuffernd_result.rcbuffer = &__pyx_pybuffer_result;
  __pyx_pybuffer_left.pybuffer.buf = NULL;
  __pyx_pybuffer_left.refcount = 0;
  __pyx_pybuffernd_left.data = NULL;
  __pyx_pybuffernd_left.rcbuffer = &__pyx_pybuffer_left;
  __pyx_pybuffer_right.pybuffer.buf = NULL;
  __pyx_pybuffer_right.refcount = 0;
  __pyx_pybuffernd_right.data = NULL;
  __pyx_pybuffernd_right.rcbuffer = &__pyx_pybuffer_right;
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_left.rcbuffer->pybuffer, (PyObject*)__pyx_v_left, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8479; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_left.diminfo[0].strides = __pyx_pybuffernd_left.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_left.diminfo[0].shape = __pyx_pybuffernd_left.rcbuffer->pybuffer.shape[0];
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_right.rcbuffer->pybuffer, (PyObject*)__pyx_v_right, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8479; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_right.diminfo[0].strides = __pyx_pybuffernd_right.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_right.diminfo[0].shape = __pyx_pybuffernd_right.rcbuffer->pybuffer.shape[0];

  /* "pandas/src/generated.pyx":8490
 *         ndarray[object] result
 * 
 *     nleft = len(left)             # <<<<<<<<<<<<<<
 *     nright = len(right)
 * 
 */
  __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_left)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8490; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_nleft = __pyx_t_1;

  /* "pandas/src/generated.pyx":8491
 * 
 *     nleft = len(left)
 *     nright = len(right)             # <<<<<<<<<<<<<<
 * 
 *     i = 0
 */
  __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_right)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8491; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_nright = __pyx_t_1;

  /* "pandas/src/generated.pyx":8493
 *     nright = len(right)
 * 
 *     i = 0             # <<<<<<<<<<<<<<
 *     j = 0
 *     count = 0
 */
  __pyx_v_i = 0;

  /* "pandas/src/generated.pyx":8494
 * 
 *     i = 0
 *     j = 0             # <<<<<<<<<<<<<<
 *     count = 0
 *     if nleft > 0 and nright > 0:
 */
  __pyx_v_j = 0;

  /* "pandas/src/generated.pyx":8495
 *     i = 0
 *     j = 0
 *     count = 0             # <<<<<<<<<<<<<<
 *     if nleft > 0 and nright > 0:
 *         while True:
 */
  __pyx_v_count = 0;

  /* "pandas/src/generated.pyx":8496
 *     j = 0
 *     count = 0
 *     if nleft > 0 and nright > 0:             # <<<<<<<<<<<<<<
 *         while True:
 *             if i == nleft:
 */
  __pyx_t_2 = ((__pyx_v_nleft > 0) != 0);
  if (__pyx_t_2) {
    __pyx_t_3 = ((__pyx_v_nright > 0) != 0);
    __pyx_t_4 = __pyx_t_3;
  } else {
    __pyx_t_4 = __pyx_t_2;
  }
  if (__pyx_t_4) {

    /* "pandas/src/generated.pyx":8497
 *     count = 0
 *     if nleft > 0 and nright > 0:
 *         while True:             # <<<<<<<<<<<<<<
 *             if i == nleft:
 *                 break
 */
    while (1) {

      /* "pandas/src/generated.pyx":8498
 *     if nleft > 0 and nright > 0:
 *         while True:
 *             if i == nleft:             # <<<<<<<<<<<<<<
 *                 break
 *             if j == nright:
 */
      __pyx_t_4 = ((__pyx_v_i == __pyx_v_nleft) != 0);
      if (__pyx_t_4) {

        /* "pandas/src/generated.pyx":8499
 *         while True:
 *             if i == nleft:
 *                 break             # <<<<<<<<<<<<<<
 *             if j == nright:
 *                 break
 */
        goto __pyx_L5_break;
      }

      /* "pandas/src/generated.pyx":8500
 *             if i == nleft:
 *                 break
 *             if j == nright:             # <<<<<<<<<<<<<<
 *                 break
 * 
 */
      __pyx_t_4 = ((__pyx_v_j == __pyx_v_nright) != 0);
      if (__pyx_t_4) {

        /* "pandas/src/generated.pyx":8501
 *                 break
 *             if j == nright:
 *                 break             # <<<<<<<<<<<<<<
 * 
 *             lval = left[i]
 */
        goto __pyx_L5_break;
      }

      /* "pandas/src/generated.pyx":8503
 *                 break
 * 
 *             lval = left[i]             # <<<<<<<<<<<<<<
 *             rval = right[j]
 *             if lval == rval:
 */
      __pyx_t_1 = __pyx_v_i;
      __pyx_t_5 = (PyObject *) *__Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_left.rcbuffer->pybuffer.buf, __pyx_t_1, __pyx_pybuffernd_left.diminfo[0].strides);
      __Pyx_INCREF((PyObject*)__pyx_t_5);
      __Pyx_XDECREF_SET(__pyx_v_lval, __pyx_t_5);
      __pyx_t_5 = 0;

      /* "pandas/src/generated.pyx":8504
 * 
 *             lval = left[i]
 *             rval = right[j]             # <<<<<<<<<<<<<<
 *             if lval == rval:
 *                 count += 1
 */
      __pyx_t_6 = __pyx_v_j;
      __pyx_t_5 = (PyObject *) *__Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_right.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_right.diminfo[0].strides);
      __Pyx_INCREF((PyObject*)__pyx_t_5);
      __Pyx_XDECREF_SET(__pyx_v_rval, __pyx_t_5);
      __pyx_t_5 = 0;

      /* "pandas/src/generated.pyx":8505
 *             lval = left[i]
 *             rval = right[j]
 *             if lval == rval:             # <<<<<<<<<<<<<<
 *                 count += 1
 *                 if i < nleft - 1:
 */
      __pyx_t_5 = PyObject_RichCompare(__pyx_v_lval, __pyx_v_rval, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8505; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8505; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (__pyx_t_4) {

        /* "pandas/src/generated.pyx":8506
 *             rval = right[j]
 *             if lval == rval:
 *                 count += 1             # <<<<<<<<<<<<<<
 *                 if i < nleft - 1:
 *                     if j < nright - 1 and right[j + 1] == rval:
 */
        __pyx_v_count = (__pyx_v_count + 1);

        /* "pandas/src/generated.pyx":8507
 *             if lval == rval:
 *                 count += 1
 *                 if i < nleft - 1:             # <<<<<<<<<<<<<<
 *                     if j < nright - 1 and right[j + 1] == rval:
 *                         j += 1
 */
        __pyx_t_4 = ((__pyx_v_i < (__pyx_v_nleft - 1)) != 0);
        if (__pyx_t_4) {

          /* "pandas/src/generated.pyx":8508
 *                 count += 1
 *                 if i < nleft - 1:
 *                     if j < nright - 1 and right[j + 1] == rval:             # <<<<<<<<<<<<<<
 *                         j += 1
 *                     else:
 */
          __pyx_t_4 = (__pyx_v_j < (__pyx_v_nright - 1));
          if (__pyx_t_4) {
            __pyx_t_7 = (__pyx_v_j + 1);
            __pyx_t_5 = (PyObject *) *__Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_right.rcbuffer->pybuffer.buf, __pyx_t_7, __pyx_pybuffernd_right.diminfo[0].strides);
            __Pyx_INCREF((PyObject*)__pyx_t_5);
            __pyx_t_8 = PyObject_RichCompare(__pyx_t_5, __pyx_v_rval, Py_EQ); __Pyx_XGOTREF(__pyx_t_8); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8508; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
            __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8508; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
            __pyx_t_3 = __pyx_t_2;
          } else {
            __pyx_t_3 = __pyx_t_4;
          }
          if (__pyx_t_3) {

            /* "pandas/src/generated.pyx":8509
 *                 if i < nleft - 1:
 *                     if j < nright - 1 and right[j + 1] == rval:
 *                         j += 1             # <<<<<<<<<<<<<<
 *                     else:
 *                         i += 1
 */
            __pyx_v_j = (__pyx_v_j + 1);
            goto __pyx_L10;
          }
          /*else*/ {

            /* "pandas/src/generated.pyx":8511
 *                         j += 1
 *                     else:
 *                         i += 1             # <<<<<<<<<<<<<<
 *                         if left[i] != rval:
 *                             j += 1
 */
            __pyx_v_i = (__pyx_v_i + 1);

            /* "pandas/src/generated.pyx":8512
 *                     else:
 *                         i += 1
 *                         if left[i] != rval:             # <<<<<<<<<<<<<<
 *                             j += 1
 *                 elif j < nright - 1:
 */
            __pyx_t_9 = __pyx_v_i;
            __pyx_t_8 = (PyObject *) *__Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_left.rcbuffer->pybuffer.buf, __pyx_t_9, __pyx_pybuffernd_left.diminfo[0].strides);
            __Pyx_INCREF((PyObject*)__pyx_t_8);
            __pyx_t_5 = PyObject_RichCompare(__pyx_t_8, __pyx_v_rval, Py_NE); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8512; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
            __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8512; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
            if (__pyx_t_3) {

              /* "pandas/src/generated.pyx":8513
 *                         i += 1
 *                         if left[i] != rval:
 *                             j += 1             # <<<<<<<<<<<<<<
 *                 elif j < nright - 1:
 *                     j += 1
 */
              __pyx_v_j = (__pyx_v_j + 1);
              goto __pyx_L11;
            }
            __pyx_L11:;
          }
          __pyx_L10:;
          goto __pyx_L9;
        }

        /* "pandas/src/generated.pyx":8514
 *                         if left[i] != rval:
 *                             j += 1
 *                 elif j < nright - 1:             # <<<<<<<<<<<<<<
 *                     j += 1
 *                     if lval != right[j]:
 */
        __pyx_t_3 = ((__pyx_v_j < (__pyx_v_nright - 1)) != 0);
        if (__pyx_t_3) {

          /* "pandas/src/generated.pyx":8515
 *                             j += 1
 *                 elif j < nright - 1:
 *                     j += 1             # <<<<<<<<<<<<<<
 *                     if lval != right[j]:
 *                         i += 1
 */
          __pyx_v_j = (__pyx_v_j + 1);

          /* "pandas/src/generated.pyx":8516
 *                 elif j < nright - 1:
 *                     j += 1
 *                     if lval != right[j]:             # <<<<<<<<<<<<<<
 *                         i += 1
 *                 else:
 */
          __pyx_t_10 = __pyx_v_j;
          __pyx_t_5 = (PyObject *) *__Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_right.rcbuffer->pybuffer.buf, __pyx_t_10, __pyx_pybuffernd_right.diminfo[0].strides);
          __Pyx_INCREF((PyObject*)__pyx_t_5);
          __pyx_t_8 = PyObject_RichCompare(__pyx_v_lval, __pyx_t_5, Py_NE); __Pyx_XGOTREF(__pyx_t_8); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8516; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
          __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8516; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
          if (__pyx_t_3) {

            /* "pandas/src/generated.pyx":8517
 *                     j += 1
 *                     if lval != right[j]:
 *                         i += 1             # <<<<<<<<<<<<<<
 *                 else:
 *                     # end of the road
 */
            __pyx_v_i = (__pyx_v_i + 1);
            goto __pyx_L12;
          }
          __pyx_L12:;
          goto __pyx_L9;
        }
        /*else*/ {

          /* "pandas/src/generated.pyx":8520
 *                 else:
 *                     # end of the road
 *                     break             # <<<<<<<<<<<<<<
 *             elif lval < rval:
 *                 i += 1
 */
          goto __pyx_L5_break;
        }
        __pyx_L9:;
        goto __pyx_L8;
      }

      /* "pandas/src/generated.pyx":8521
 *                     # end of the road
 *                     break
 *             elif lval < rval:             # <<<<<<<<<<<<<<
 *                 i += 1
 *             else:
 */
      __pyx_t_8 = PyObject_RichCompare(__pyx_v_lval, __pyx_v_rval, Py_LT); __Pyx_XGOTREF(__pyx_t_8); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8521; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8521; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      if (__pyx_t_3) {

        /* "pandas/src/generated.pyx":8522
 *                     break
 *             elif lval < rval:
 *                 i += 1             # <<<<<<<<<<<<<<
 *             else:
 *                 j += 1
 */
        __pyx_v_i = (__pyx_v_i + 1);
        goto __pyx_L8;
      }
      /*else*/ {

        /* "pandas/src/generated.pyx":8524
 *                 i += 1
 *             else:
 *                 j += 1             # <<<<<<<<<<<<<<
 * 
 *     # do it again now that result size is known
 */
        __pyx_v_j = (__pyx_v_j + 1);
      }
      __pyx_L8:;
    }
    __pyx_L5_break:;
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "pandas/src/generated.pyx":8528
 *     # do it again now that result size is known
 * 
 *     lindexer = np.empty(count, dtype=np.int64)             # <<<<<<<<<<<<<<
 *     rindexer = np.empty(count, dtype=np.int64)
 *     result = np.empty(count, dtype=object)
 */
  __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8528; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_8);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_empty); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8528; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  __pyx_t_8 = PyInt_FromSsize_t(__pyx_v_count); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8528; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_8);
  __pyx_t_11 = PyTuple_New(1); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8528; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_11);
  PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_8);
  __Pyx_GIVEREF(__pyx_t_8);
  __pyx_t_8 = 0;
  __pyx_t_8 = PyDict_New(); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8528; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_8);
  __pyx_t_12 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8528; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_12);
  __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_int64); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8528; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_13);
  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
  if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_dtype, __pyx_t_13) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8528; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  __pyx_t_13 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_11, __pyx_t_8); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8528; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_13);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 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 = 8528; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_14 = ((PyArrayObject *)__pyx_t_13);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_lindexer.rcbuffer->pybuffer);
    __pyx_t_15 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_lindexer.rcbuffer->pybuffer, (PyObject*)__pyx_t_14, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack);
    if (unlikely(__pyx_t_15 < 0)) {
      PyErr_Fetch(&__pyx_t_16, &__pyx_t_17, &__pyx_t_18);
      if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_lindexer.rcbuffer->pybuffer, (PyObject*)__pyx_v_lindexer, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {
        Py_XDECREF(__pyx_t_16); Py_XDECREF(__pyx_t_17); Py_XDECREF(__pyx_t_18);
        __Pyx_RaiseBufferFallbackError();
      } else {
        PyErr_Restore(__pyx_t_16, __pyx_t_17, __pyx_t_18);
      }
    }
    __pyx_pybuffernd_lindexer.diminfo[0].strides = __pyx_pybuffernd_lindexer.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_lindexer.diminfo[0].shape = __pyx_pybuffernd_lindexer.rcbuffer->pybuffer.shape[0];
    if (unlikely(__pyx_t_15 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8528; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_14 = 0;
  __pyx_v_lindexer = ((PyArrayObject *)__pyx_t_13);
  __pyx_t_13 = 0;

  /* "pandas/src/generated.pyx":8529
 * 
 *     lindexer = np.empty(count, dtype=np.int64)
 *     rindexer = np.empty(count, dtype=np.int64)             # <<<<<<<<<<<<<<
 *     result = np.empty(count, dtype=object)
 * 
 */
  __pyx_t_13 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8529; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_13);
  __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_n_s_empty); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8529; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  __pyx_t_13 = PyInt_FromSsize_t(__pyx_v_count); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8529; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_13);
  __pyx_t_11 = PyTuple_New(1); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8529; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_11);
  PyTuple_SET_ITEM(__pyx_t_11, 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 = 8529; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_13);
  __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8529; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_int64); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8529; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_12);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (PyDict_SetItem(__pyx_t_13, __pyx_n_s_dtype, __pyx_t_12) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8529; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
  __pyx_t_12 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_11, __pyx_t_13); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8529; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_12);
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  if (!(likely(((__pyx_t_12) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_12, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8529; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_14 = ((PyArrayObject *)__pyx_t_12);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_rindexer.rcbuffer->pybuffer);
    __pyx_t_15 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_rindexer.rcbuffer->pybuffer, (PyObject*)__pyx_t_14, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack);
    if (unlikely(__pyx_t_15 < 0)) {
      PyErr_Fetch(&__pyx_t_18, &__pyx_t_17, &__pyx_t_16);
      if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_rindexer.rcbuffer->pybuffer, (PyObject*)__pyx_v_rindexer, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {
        Py_XDECREF(__pyx_t_18); Py_XDECREF(__pyx_t_17); Py_XDECREF(__pyx_t_16);
        __Pyx_RaiseBufferFallbackError();
      } else {
        PyErr_Restore(__pyx_t_18, __pyx_t_17, __pyx_t_16);
      }
    }
    __pyx_pybuffernd_rindexer.diminfo[0].strides = __pyx_pybuffernd_rindexer.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_rindexer.diminfo[0].shape = __pyx_pybuffernd_rindexer.rcbuffer->pybuffer.shape[0];
    if (unlikely(__pyx_t_15 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8529; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_14 = 0;
  __pyx_v_rindexer = ((PyArrayObject *)__pyx_t_12);
  __pyx_t_12 = 0;

  /* "pandas/src/generated.pyx":8530
 *     lindexer = np.empty(count, dtype=np.int64)
 *     rindexer = np.empty(count, dtype=np.int64)
 *     result = np.empty(count, dtype=object)             # <<<<<<<<<<<<<<
 * 
 *     i = 0
 */
  __pyx_t_12 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8530; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_12);
  __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_empty); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8530; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_13);
  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
  __pyx_t_12 = PyInt_FromSsize_t(__pyx_v_count); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8530; __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[2]; __pyx_lineno = 8530; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__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 = PyDict_New(); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8530; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_12);
  if (PyDict_SetItem(__pyx_t_12, __pyx_n_s_dtype, __pyx_builtin_object) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8530; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_13, __pyx_t_11, __pyx_t_12); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8530; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 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 = 8530; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_19 = ((PyArrayObject *)__pyx_t_8);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer);
    __pyx_t_15 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_result.rcbuffer->pybuffer, (PyObject*)__pyx_t_19, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack);
    if (unlikely(__pyx_t_15 < 0)) {
      PyErr_Fetch(&__pyx_t_16, &__pyx_t_17, &__pyx_t_18);
      if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_result.rcbuffer->pybuffer, (PyObject*)__pyx_v_result, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {
        Py_XDECREF(__pyx_t_16); Py_XDECREF(__pyx_t_17); Py_XDECREF(__pyx_t_18);
        __Pyx_RaiseBufferFallbackError();
      } else {
        PyErr_Restore(__pyx_t_16, __pyx_t_17, __pyx_t_18);
      }
    }
    __pyx_pybuffernd_result.diminfo[0].strides = __pyx_pybuffernd_result.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_result.diminfo[0].shape = __pyx_pybuffernd_result.rcbuffer->pybuffer.shape[0];
    if (unlikely(__pyx_t_15 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8530; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_19 = 0;
  __pyx_v_result = ((PyArrayObject *)__pyx_t_8);
  __pyx_t_8 = 0;

  /* "pandas/src/generated.pyx":8532
 *     result = np.empty(count, dtype=object)
 * 
 *     i = 0             # <<<<<<<<<<<<<<
 *     j = 0
 *     count = 0
 */
  __pyx_v_i = 0;

  /* "pandas/src/generated.pyx":8533
 * 
 *     i = 0
 *     j = 0             # <<<<<<<<<<<<<<
 *     count = 0
 *     if nleft > 0 and nright > 0:
 */
  __pyx_v_j = 0;

  /* "pandas/src/generated.pyx":8534
 *     i = 0
 *     j = 0
 *     count = 0             # <<<<<<<<<<<<<<
 *     if nleft > 0 and nright > 0:
 *         while True:
 */
  __pyx_v_count = 0;

  /* "pandas/src/generated.pyx":8535
 *     j = 0
 *     count = 0
 *     if nleft > 0 and nright > 0:             # <<<<<<<<<<<<<<
 *         while True:
 *             if i == nleft:
 */
  __pyx_t_3 = ((__pyx_v_nleft > 0) != 0);
  if (__pyx_t_3) {
    __pyx_t_4 = ((__pyx_v_nright > 0) != 0);
    __pyx_t_2 = __pyx_t_4;
  } else {
    __pyx_t_2 = __pyx_t_3;
  }
  if (__pyx_t_2) {

    /* "pandas/src/generated.pyx":8536
 *     count = 0
 *     if nleft > 0 and nright > 0:
 *         while True:             # <<<<<<<<<<<<<<
 *             if i == nleft:
 *                 break
 */
    while (1) {

      /* "pandas/src/generated.pyx":8537
 *     if nleft > 0 and nright > 0:
 *         while True:
 *             if i == nleft:             # <<<<<<<<<<<<<<
 *                 break
 *             if j == nright:
 */
      __pyx_t_2 = ((__pyx_v_i == __pyx_v_nleft) != 0);
      if (__pyx_t_2) {

        /* "pandas/src/generated.pyx":8538
 *         while True:
 *             if i == nleft:
 *                 break             # <<<<<<<<<<<<<<
 *             if j == nright:
 *                 break
 */
        goto __pyx_L15_break;
      }

      /* "pandas/src/generated.pyx":8539
 *             if i == nleft:
 *                 break
 *             if j == nright:             # <<<<<<<<<<<<<<
 *                 break
 * 
 */
      __pyx_t_2 = ((__pyx_v_j == __pyx_v_nright) != 0);
      if (__pyx_t_2) {

        /* "pandas/src/generated.pyx":8540
 *                 break
 *             if j == nright:
 *                 break             # <<<<<<<<<<<<<<
 * 
 *             lval = left[i]
 */
        goto __pyx_L15_break;
      }

      /* "pandas/src/generated.pyx":8542
 *                 break
 * 
 *             lval = left[i]             # <<<<<<<<<<<<<<
 *             rval = right[j]
 *             if lval == rval:
 */
      __pyx_t_20 = __pyx_v_i;
      __pyx_t_8 = (PyObject *) *__Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_left.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_left.diminfo[0].strides);
      __Pyx_INCREF((PyObject*)__pyx_t_8);
      __Pyx_XDECREF_SET(__pyx_v_lval, __pyx_t_8);
      __pyx_t_8 = 0;

      /* "pandas/src/generated.pyx":8543
 * 
 *             lval = left[i]
 *             rval = right[j]             # <<<<<<<<<<<<<<
 *             if lval == rval:
 *                 lindexer[count] = i
 */
      __pyx_t_21 = __pyx_v_j;
      __pyx_t_8 = (PyObject *) *__Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_right.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_right.diminfo[0].strides);
      __Pyx_INCREF((PyObject*)__pyx_t_8);
      __Pyx_XDECREF_SET(__pyx_v_rval, __pyx_t_8);
      __pyx_t_8 = 0;

      /* "pandas/src/generated.pyx":8544
 *             lval = left[i]
 *             rval = right[j]
 *             if lval == rval:             # <<<<<<<<<<<<<<
 *                 lindexer[count] = i
 *                 rindexer[count] = j
 */
      __pyx_t_8 = PyObject_RichCompare(__pyx_v_lval, __pyx_v_rval, Py_EQ); __Pyx_XGOTREF(__pyx_t_8); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8544; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8544; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      if (__pyx_t_2) {

        /* "pandas/src/generated.pyx":8545
 *             rval = right[j]
 *             if lval == rval:
 *                 lindexer[count] = i             # <<<<<<<<<<<<<<
 *                 rindexer[count] = j
 *                 result[count] = rval
 */
        __pyx_t_22 = __pyx_v_count;
        *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_lindexer.rcbuffer->pybuffer.buf, __pyx_t_22, __pyx_pybuffernd_lindexer.diminfo[0].strides) = __pyx_v_i;

        /* "pandas/src/generated.pyx":8546
 *             if lval == rval:
 *                 lindexer[count] = i
 *                 rindexer[count] = j             # <<<<<<<<<<<<<<
 *                 result[count] = rval
 *                 count += 1
 */
        __pyx_t_23 = __pyx_v_count;
        *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_rindexer.rcbuffer->pybuffer.buf, __pyx_t_23, __pyx_pybuffernd_rindexer.diminfo[0].strides) = __pyx_v_j;

        /* "pandas/src/generated.pyx":8547
 *                 lindexer[count] = i
 *                 rindexer[count] = j
 *                 result[count] = rval             # <<<<<<<<<<<<<<
 *                 count += 1
 *                 if i < nleft - 1:
 */
        __pyx_t_24 = __pyx_v_count;
        __pyx_t_25 = __Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_24, __pyx_pybuffernd_result.diminfo[0].strides);
        __Pyx_GOTREF(*__pyx_t_25);
        __Pyx_INCREF(__pyx_v_rval); __Pyx_DECREF(*__pyx_t_25);
        *__pyx_t_25 = __pyx_v_rval;
        __Pyx_GIVEREF(*__pyx_t_25);

        /* "pandas/src/generated.pyx":8548
 *                 rindexer[count] = j
 *                 result[count] = rval
 *                 count += 1             # <<<<<<<<<<<<<<
 *                 if i < nleft - 1:
 *                     if j < nright - 1 and right[j + 1] == rval:
 */
        __pyx_v_count = (__pyx_v_count + 1);

        /* "pandas/src/generated.pyx":8549
 *                 result[count] = rval
 *                 count += 1
 *                 if i < nleft - 1:             # <<<<<<<<<<<<<<
 *                     if j < nright - 1 and right[j + 1] == rval:
 *                         j += 1
 */
        __pyx_t_2 = ((__pyx_v_i < (__pyx_v_nleft - 1)) != 0);
        if (__pyx_t_2) {

          /* "pandas/src/generated.pyx":8550
 *                 count += 1
 *                 if i < nleft - 1:
 *                     if j < nright - 1 and right[j + 1] == rval:             # <<<<<<<<<<<<<<
 *                         j += 1
 *                     else:
 */
          __pyx_t_2 = (__pyx_v_j < (__pyx_v_nright - 1));
          if (__pyx_t_2) {
            __pyx_t_26 = (__pyx_v_j + 1);
            __pyx_t_8 = (PyObject *) *__Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_right.rcbuffer->pybuffer.buf, __pyx_t_26, __pyx_pybuffernd_right.diminfo[0].strides);
            __Pyx_INCREF((PyObject*)__pyx_t_8);
            __pyx_t_12 = PyObject_RichCompare(__pyx_t_8, __pyx_v_rval, Py_EQ); __Pyx_XGOTREF(__pyx_t_12); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8550; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
            __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_12); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8550; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
            __pyx_t_4 = __pyx_t_3;
          } else {
            __pyx_t_4 = __pyx_t_2;
          }
          if (__pyx_t_4) {

            /* "pandas/src/generated.pyx":8551
 *                 if i < nleft - 1:
 *                     if j < nright - 1 and right[j + 1] == rval:
 *                         j += 1             # <<<<<<<<<<<<<<
 *                     else:
 *                         i += 1
 */
            __pyx_v_j = (__pyx_v_j + 1);
            goto __pyx_L20;
          }
          /*else*/ {

            /* "pandas/src/generated.pyx":8553
 *                         j += 1
 *                     else:
 *                         i += 1             # <<<<<<<<<<<<<<
 *                         if left[i] != rval:
 *                             j += 1
 */
            __pyx_v_i = (__pyx_v_i + 1);

            /* "pandas/src/generated.pyx":8554
 *                     else:
 *                         i += 1
 *                         if left[i] != rval:             # <<<<<<<<<<<<<<
 *                             j += 1
 *                 elif j < nright - 1:
 */
            __pyx_t_27 = __pyx_v_i;
            __pyx_t_12 = (PyObject *) *__Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_left.rcbuffer->pybuffer.buf, __pyx_t_27, __pyx_pybuffernd_left.diminfo[0].strides);
            __Pyx_INCREF((PyObject*)__pyx_t_12);
            __pyx_t_8 = PyObject_RichCompare(__pyx_t_12, __pyx_v_rval, Py_NE); __Pyx_XGOTREF(__pyx_t_8); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8554; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
            __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8554; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
            if (__pyx_t_4) {

              /* "pandas/src/generated.pyx":8555
 *                         i += 1
 *                         if left[i] != rval:
 *                             j += 1             # <<<<<<<<<<<<<<
 *                 elif j < nright - 1:
 *                     j += 1
 */
              __pyx_v_j = (__pyx_v_j + 1);
              goto __pyx_L21;
            }
            __pyx_L21:;
          }
          __pyx_L20:;
          goto __pyx_L19;
        }

        /* "pandas/src/generated.pyx":8556
 *                         if left[i] != rval:
 *                             j += 1
 *                 elif j < nright - 1:             # <<<<<<<<<<<<<<
 *                     j += 1
 *                     if lval != right[j]:
 */
        __pyx_t_4 = ((__pyx_v_j < (__pyx_v_nright - 1)) != 0);
        if (__pyx_t_4) {

          /* "pandas/src/generated.pyx":8557
 *                             j += 1
 *                 elif j < nright - 1:
 *                     j += 1             # <<<<<<<<<<<<<<
 *                     if lval != right[j]:
 *                         i += 1
 */
          __pyx_v_j = (__pyx_v_j + 1);

          /* "pandas/src/generated.pyx":8558
 *                 elif j < nright - 1:
 *                     j += 1
 *                     if lval != right[j]:             # <<<<<<<<<<<<<<
 *                         i += 1
 *                 else:
 */
          __pyx_t_28 = __pyx_v_j;
          __pyx_t_8 = (PyObject *) *__Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_right.rcbuffer->pybuffer.buf, __pyx_t_28, __pyx_pybuffernd_right.diminfo[0].strides);
          __Pyx_INCREF((PyObject*)__pyx_t_8);
          __pyx_t_12 = PyObject_RichCompare(__pyx_v_lval, __pyx_t_8, Py_NE); __Pyx_XGOTREF(__pyx_t_12); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8558; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
          __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_12); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8558; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
          if (__pyx_t_4) {

            /* "pandas/src/generated.pyx":8559
 *                     j += 1
 *                     if lval != right[j]:
 *                         i += 1             # <<<<<<<<<<<<<<
 *                 else:
 *                     # end of the road
 */
            __pyx_v_i = (__pyx_v_i + 1);
            goto __pyx_L22;
          }
          __pyx_L22:;
          goto __pyx_L19;
        }
        /*else*/ {

          /* "pandas/src/generated.pyx":8562
 *                 else:
 *                     # end of the road
 *                     break             # <<<<<<<<<<<<<<
 *             elif lval < rval:
 *                 i += 1
 */
          goto __pyx_L15_break;
        }
        __pyx_L19:;
        goto __pyx_L18;
      }

      /* "pandas/src/generated.pyx":8563
 *                     # end of the road
 *                     break
 *             elif lval < rval:             # <<<<<<<<<<<<<<
 *                 i += 1
 *             else:
 */
      __pyx_t_12 = PyObject_RichCompare(__pyx_v_lval, __pyx_v_rval, Py_LT); __Pyx_XGOTREF(__pyx_t_12); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8563; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_12); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8563; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      if (__pyx_t_4) {

        /* "pandas/src/generated.pyx":8564
 *                     break
 *             elif lval < rval:
 *                 i += 1             # <<<<<<<<<<<<<<
 *             else:
 *                 j += 1
 */
        __pyx_v_i = (__pyx_v_i + 1);
        goto __pyx_L18;
      }
      /*else*/ {

        /* "pandas/src/generated.pyx":8566
 *                 i += 1
 *             else:
 *                 j += 1             # <<<<<<<<<<<<<<
 * 
 *     return result, lindexer, rindexer
 */
        __pyx_v_j = (__pyx_v_j + 1);
      }
      __pyx_L18:;
    }
    __pyx_L15_break:;
    goto __pyx_L13;
  }
  __pyx_L13:;

  /* "pandas/src/generated.pyx":8568
 *                 j += 1
 * 
 *     return result, lindexer, rindexer             # <<<<<<<<<<<<<<
 * 
 * @cython.wraparound(False)
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_12 = PyTuple_New(3); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8568; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_12);
  __Pyx_INCREF(((PyObject *)__pyx_v_result));
  PyTuple_SET_ITEM(__pyx_t_12, 0, ((PyObject *)__pyx_v_result));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_result));
  __Pyx_INCREF(((PyObject *)__pyx_v_lindexer));
  PyTuple_SET_ITEM(__pyx_t_12, 1, ((PyObject *)__pyx_v_lindexer));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_lindexer));
  __Pyx_INCREF(((PyObject *)__pyx_v_rindexer));
  PyTuple_SET_ITEM(__pyx_t_12, 2, ((PyObject *)__pyx_v_rindexer));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_rindexer));
  __pyx_r = __pyx_t_12;
  __pyx_t_12 = 0;
  goto __pyx_L0;

  /* "pandas/src/generated.pyx":8479
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def inner_join_indexer_object(ndarray[object] left,             # <<<<<<<<<<<<<<
 *                               ndarray[object] right):
 *     '''
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_XDECREF(__pyx_t_13);
  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
    __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_left.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_lindexer.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_right.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_rindexer.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas.algos.inner_join_indexer_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_left.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_lindexer.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_right.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_rindexer.rcbuffer->pybuffer);
  __pyx_L2:;
  __Pyx_XDECREF(__pyx_v_lval);
  __Pyx_XDECREF(__pyx_v_rval);
  __Pyx_XDECREF((PyObject *)__pyx_v_lindexer);
  __Pyx_XDECREF((PyObject *)__pyx_v_rindexer);
  __Pyx_XDECREF((PyObject *)__pyx_v_result);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/src/generated.pyx":8572
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def inner_join_indexer_int32(ndarray[int32_t] left,             # <<<<<<<<<<<<<<
 *                               ndarray[int32_t] right):
 *     '''
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pandas_5algos_507inner_join_indexer_int32(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6pandas_5algos_506inner_join_indexer_int32[] = "\n    Two-pass algorithm for monotonic indexes. Handles many-to-one merges\n    ";
static PyMethodDef __pyx_mdef_6pandas_5algos_507inner_join_indexer_int32 = {__Pyx_NAMESTR("inner_join_indexer_int32"), (PyCFunction)__pyx_pw_6pandas_5algos_507inner_join_indexer_int32, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6pandas_5algos_506inner_join_indexer_int32)};
static PyObject *__pyx_pw_6pandas_5algos_507inner_join_indexer_int32(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyArrayObject *__pyx_v_left = 0;
  PyArrayObject *__pyx_v_right = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("inner_join_indexer_int32 (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_left,&__pyx_n_s_right,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_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 (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_left)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_right)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("inner_join_indexer_int32", 1, 2, 2, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8572; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "inner_join_indexer_int32") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8572; __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("inner_join_indexer_int32", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8572; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas.algos.inner_join_indexer_int32", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_left), __pyx_ptype_5numpy_ndarray, 1, "left", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8572; __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[2]; __pyx_lineno = 8573; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_506inner_join_indexer_int32(__pyx_self, __pyx_v_left, __pyx_v_right);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pandas_5algos_506inner_join_indexer_int32(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_left, PyArrayObject *__pyx_v_right) {
  Py_ssize_t __pyx_v_i;
  Py_ssize_t __pyx_v_j;
  Py_ssize_t __pyx_v_nright;
  Py_ssize_t __pyx_v_nleft;
  Py_ssize_t __pyx_v_count;
  __pyx_t_5numpy_int32_t __pyx_v_lval;
  __pyx_t_5numpy_int32_t __pyx_v_rval;
  PyArrayObject *__pyx_v_lindexer = 0;
  PyArrayObject *__pyx_v_rindexer = 0;
  PyArrayObject *__pyx_v_result = 0;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_left;
  __Pyx_Buffer __pyx_pybuffer_left;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_lindexer;
  __Pyx_Buffer __pyx_pybuffer_lindexer;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_result;
  __Pyx_Buffer __pyx_pybuffer_result;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_right;
  __Pyx_Buffer __pyx_pybuffer_right;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_rindexer;
  __Pyx_Buffer __pyx_pybuffer_rindexer;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  Py_ssize_t __pyx_t_1;
  int __pyx_t_2;
  int __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;
  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;
  PyObject *__pyx_t_13 = NULL;
  PyArrayObject *__pyx_t_14 = NULL;
  int __pyx_t_15;
  PyObject *__pyx_t_16 = NULL;
  PyObject *__pyx_t_17 = NULL;
  PyObject *__pyx_t_18 = NULL;
  PyArrayObject *__pyx_t_19 = NULL;
  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;
  __Pyx_RefNannySetupContext("inner_join_indexer_int32", 0);
  __pyx_pybuffer_lindexer.pybuffer.buf = NULL;
  __pyx_pybuffer_lindexer.refcount = 0;
  __pyx_pybuffernd_lindexer.data = NULL;
  __pyx_pybuffernd_lindexer.rcbuffer = &__pyx_pybuffer_lindexer;
  __pyx_pybuffer_rindexer.pybuffer.buf = NULL;
  __pyx_pybuffer_rindexer.refcount = 0;
  __pyx_pybuffernd_rindexer.data = NULL;
  __pyx_pybuffernd_rindexer.rcbuffer = &__pyx_pybuffer_rindexer;
  __pyx_pybuffer_result.pybuffer.buf = NULL;
  __pyx_pybuffer_result.refcount = 0;
  __pyx_pybuffernd_result.data = NULL;
  __pyx_pybuffernd_result.rcbuffer = &__pyx_pybuffer_result;
  __pyx_pybuffer_left.pybuffer.buf = NULL;
  __pyx_pybuffer_left.refcount = 0;
  __pyx_pybuffernd_left.data = NULL;
  __pyx_pybuffernd_left.rcbuffer = &__pyx_pybuffer_left;
  __pyx_pybuffer_right.pybuffer.buf = NULL;
  __pyx_pybuffer_right.refcount = 0;
  __pyx_pybuffernd_right.data = NULL;
  __pyx_pybuffernd_right.rcbuffer = &__pyx_pybuffer_right;
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_left.rcbuffer->pybuffer, (PyObject*)__pyx_v_left, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8572; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_left.diminfo[0].strides = __pyx_pybuffernd_left.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_left.diminfo[0].shape = __pyx_pybuffernd_left.rcbuffer->pybuffer.shape[0];
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_right.rcbuffer->pybuffer, (PyObject*)__pyx_v_right, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8572; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_right.diminfo[0].strides = __pyx_pybuffernd_right.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_right.diminfo[0].shape = __pyx_pybuffernd_right.rcbuffer->pybuffer.shape[0];

  /* "pandas/src/generated.pyx":8583
 *         ndarray[int32_t] result
 * 
 *     nleft = len(left)             # <<<<<<<<<<<<<<
 *     nright = len(right)
 * 
 */
  __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_left)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8583; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_nleft = __pyx_t_1;

  /* "pandas/src/generated.pyx":8584
 * 
 *     nleft = len(left)
 *     nright = len(right)             # <<<<<<<<<<<<<<
 * 
 *     i = 0
 */
  __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_right)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8584; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_nright = __pyx_t_1;

  /* "pandas/src/generated.pyx":8586
 *     nright = len(right)
 * 
 *     i = 0             # <<<<<<<<<<<<<<
 *     j = 0
 *     count = 0
 */
  __pyx_v_i = 0;

  /* "pandas/src/generated.pyx":8587
 * 
 *     i = 0
 *     j = 0             # <<<<<<<<<<<<<<
 *     count = 0
 *     if nleft > 0 and nright > 0:
 */
  __pyx_v_j = 0;

  /* "pandas/src/generated.pyx":8588
 *     i = 0
 *     j = 0
 *     count = 0             # <<<<<<<<<<<<<<
 *     if nleft > 0 and nright > 0:
 *         while True:
 */
  __pyx_v_count = 0;

  /* "pandas/src/generated.pyx":8589
 *     j = 0
 *     count = 0
 *     if nleft > 0 and nright > 0:             # <<<<<<<<<<<<<<
 *         while True:
 *             if i == nleft:
 */
  __pyx_t_2 = ((__pyx_v_nleft > 0) != 0);
  if (__pyx_t_2) {
    __pyx_t_3 = ((__pyx_v_nright > 0) != 0);
    __pyx_t_4 = __pyx_t_3;
  } else {
    __pyx_t_4 = __pyx_t_2;
  }
  if (__pyx_t_4) {

    /* "pandas/src/generated.pyx":8590
 *     count = 0
 *     if nleft > 0 and nright > 0:
 *         while True:             # <<<<<<<<<<<<<<
 *             if i == nleft:
 *                 break
 */
    while (1) {

      /* "pandas/src/generated.pyx":8591
 *     if nleft > 0 and nright > 0:
 *         while True:
 *             if i == nleft:             # <<<<<<<<<<<<<<
 *                 break
 *             if j == nright:
 */
      __pyx_t_4 = ((__pyx_v_i == __pyx_v_nleft) != 0);
      if (__pyx_t_4) {

        /* "pandas/src/generated.pyx":8592
 *         while True:
 *             if i == nleft:
 *                 break             # <<<<<<<<<<<<<<
 *             if j == nright:
 *                 break
 */
        goto __pyx_L5_break;
      }

      /* "pandas/src/generated.pyx":8593
 *             if i == nleft:
 *                 break
 *             if j == nright:             # <<<<<<<<<<<<<<
 *                 break
 * 
 */
      __pyx_t_4 = ((__pyx_v_j == __pyx_v_nright) != 0);
      if (__pyx_t_4) {

        /* "pandas/src/generated.pyx":8594
 *                 break
 *             if j == nright:
 *                 break             # <<<<<<<<<<<<<<
 * 
 *             lval = left[i]
 */
        goto __pyx_L5_break;
      }

      /* "pandas/src/generated.pyx":8596
 *                 break
 * 
 *             lval = left[i]             # <<<<<<<<<<<<<<
 *             rval = right[j]
 *             if lval == rval:
 */
      __pyx_t_1 = __pyx_v_i;
      __pyx_v_lval = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_left.rcbuffer->pybuffer.buf, __pyx_t_1, __pyx_pybuffernd_left.diminfo[0].strides));

      /* "pandas/src/generated.pyx":8597
 * 
 *             lval = left[i]
 *             rval = right[j]             # <<<<<<<<<<<<<<
 *             if lval == rval:
 *                 count += 1
 */
      __pyx_t_5 = __pyx_v_j;
      __pyx_v_rval = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_right.rcbuffer->pybuffer.buf, __pyx_t_5, __pyx_pybuffernd_right.diminfo[0].strides));

      /* "pandas/src/generated.pyx":8598
 *             lval = left[i]
 *             rval = right[j]
 *             if lval == rval:             # <<<<<<<<<<<<<<
 *                 count += 1
 *                 if i < nleft - 1:
 */
      __pyx_t_4 = ((__pyx_v_lval == __pyx_v_rval) != 0);
      if (__pyx_t_4) {

        /* "pandas/src/generated.pyx":8599
 *             rval = right[j]
 *             if lval == rval:
 *                 count += 1             # <<<<<<<<<<<<<<
 *                 if i < nleft - 1:
 *                     if j < nright - 1 and right[j + 1] == rval:
 */
        __pyx_v_count = (__pyx_v_count + 1);

        /* "pandas/src/generated.pyx":8600
 *             if lval == rval:
 *                 count += 1
 *                 if i < nleft - 1:             # <<<<<<<<<<<<<<
 *                     if j < nright - 1 and right[j + 1] == rval:
 *                         j += 1
 */
        __pyx_t_4 = ((__pyx_v_i < (__pyx_v_nleft - 1)) != 0);
        if (__pyx_t_4) {

          /* "pandas/src/generated.pyx":8601
 *                 count += 1
 *                 if i < nleft - 1:
 *                     if j < nright - 1 and right[j + 1] == rval:             # <<<<<<<<<<<<<<
 *                         j += 1
 *                     else:
 */
          __pyx_t_4 = ((__pyx_v_j < (__pyx_v_nright - 1)) != 0);
          if (__pyx_t_4) {
            __pyx_t_6 = (__pyx_v_j + 1);
            __pyx_t_2 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_right.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_right.diminfo[0].strides)) == __pyx_v_rval) != 0);
            __pyx_t_3 = __pyx_t_2;
          } else {
            __pyx_t_3 = __pyx_t_4;
          }
          if (__pyx_t_3) {

            /* "pandas/src/generated.pyx":8602
 *                 if i < nleft - 1:
 *                     if j < nright - 1 and right[j + 1] == rval:
 *                         j += 1             # <<<<<<<<<<<<<<
 *                     else:
 *                         i += 1
 */
            __pyx_v_j = (__pyx_v_j + 1);
            goto __pyx_L10;
          }
          /*else*/ {

            /* "pandas/src/generated.pyx":8604
 *                         j += 1
 *                     else:
 *                         i += 1             # <<<<<<<<<<<<<<
 *                         if left[i] != rval:
 *                             j += 1
 */
            __pyx_v_i = (__pyx_v_i + 1);

            /* "pandas/src/generated.pyx":8605
 *                     else:
 *                         i += 1
 *                         if left[i] != rval:             # <<<<<<<<<<<<<<
 *                             j += 1
 *                 elif j < nright - 1:
 */
            __pyx_t_7 = __pyx_v_i;
            __pyx_t_3 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_left.rcbuffer->pybuffer.buf, __pyx_t_7, __pyx_pybuffernd_left.diminfo[0].strides)) != __pyx_v_rval) != 0);
            if (__pyx_t_3) {

              /* "pandas/src/generated.pyx":8606
 *                         i += 1
 *                         if left[i] != rval:
 *                             j += 1             # <<<<<<<<<<<<<<
 *                 elif j < nright - 1:
 *                     j += 1
 */
              __pyx_v_j = (__pyx_v_j + 1);
              goto __pyx_L11;
            }
            __pyx_L11:;
          }
          __pyx_L10:;
          goto __pyx_L9;
        }

        /* "pandas/src/generated.pyx":8607
 *                         if left[i] != rval:
 *                             j += 1
 *                 elif j < nright - 1:             # <<<<<<<<<<<<<<
 *                     j += 1
 *                     if lval != right[j]:
 */
        __pyx_t_3 = ((__pyx_v_j < (__pyx_v_nright - 1)) != 0);
        if (__pyx_t_3) {

          /* "pandas/src/generated.pyx":8608
 *                             j += 1
 *                 elif j < nright - 1:
 *                     j += 1             # <<<<<<<<<<<<<<
 *                     if lval != right[j]:
 *                         i += 1
 */
          __pyx_v_j = (__pyx_v_j + 1);

          /* "pandas/src/generated.pyx":8609
 *                 elif j < nright - 1:
 *                     j += 1
 *                     if lval != right[j]:             # <<<<<<<<<<<<<<
 *                         i += 1
 *                 else:
 */
          __pyx_t_8 = __pyx_v_j;
          __pyx_t_3 = ((__pyx_v_lval != (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_right.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_right.diminfo[0].strides))) != 0);
          if (__pyx_t_3) {

            /* "pandas/src/generated.pyx":8610
 *                     j += 1
 *                     if lval != right[j]:
 *                         i += 1             # <<<<<<<<<<<<<<
 *                 else:
 *                     # end of the road
 */
            __pyx_v_i = (__pyx_v_i + 1);
            goto __pyx_L12;
          }
          __pyx_L12:;
          goto __pyx_L9;
        }
        /*else*/ {

          /* "pandas/src/generated.pyx":8613
 *                 else:
 *                     # end of the road
 *                     break             # <<<<<<<<<<<<<<
 *             elif lval < rval:
 *                 i += 1
 */
          goto __pyx_L5_break;
        }
        __pyx_L9:;
        goto __pyx_L8;
      }

      /* "pandas/src/generated.pyx":8614
 *                     # end of the road
 *                     break
 *             elif lval < rval:             # <<<<<<<<<<<<<<
 *                 i += 1
 *             else:
 */
      __pyx_t_3 = ((__pyx_v_lval < __pyx_v_rval) != 0);
      if (__pyx_t_3) {

        /* "pandas/src/generated.pyx":8615
 *                     break
 *             elif lval < rval:
 *                 i += 1             # <<<<<<<<<<<<<<
 *             else:
 *                 j += 1
 */
        __pyx_v_i = (__pyx_v_i + 1);
        goto __pyx_L8;
      }
      /*else*/ {

        /* "pandas/src/generated.pyx":8617
 *                 i += 1
 *             else:
 *                 j += 1             # <<<<<<<<<<<<<<
 * 
 *     # do it again now that result size is known
 */
        __pyx_v_j = (__pyx_v_j + 1);
      }
      __pyx_L8:;
    }
    __pyx_L5_break:;
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "pandas/src/generated.pyx":8621
 *     # do it again now that result size is known
 * 
 *     lindexer = np.empty(count, dtype=np.int64)             # <<<<<<<<<<<<<<
 *     rindexer = np.empty(count, dtype=np.int64)
 *     result = np.empty(count, dtype=np.int32)
 */
  __pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8621; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_9);
  __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_empty); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8621; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_10);
  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  __pyx_t_9 = PyInt_FromSsize_t(__pyx_v_count); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8621; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_9);
  __pyx_t_11 = PyTuple_New(1); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8621; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_11);
  PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_9);
  __Pyx_GIVEREF(__pyx_t_9);
  __pyx_t_9 = 0;
  __pyx_t_9 = PyDict_New(); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8621; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_9);
  __pyx_t_12 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8621; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_12);
  __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_int64); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8621; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_13);
  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
  if (PyDict_SetItem(__pyx_t_9, __pyx_n_s_dtype, __pyx_t_13) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8621; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  __pyx_t_13 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_t_11, __pyx_t_9); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8621; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_13);
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 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 = 8621; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_14 = ((PyArrayObject *)__pyx_t_13);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_lindexer.rcbuffer->pybuffer);
    __pyx_t_15 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_lindexer.rcbuffer->pybuffer, (PyObject*)__pyx_t_14, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack);
    if (unlikely(__pyx_t_15 < 0)) {
      PyErr_Fetch(&__pyx_t_16, &__pyx_t_17, &__pyx_t_18);
      if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_lindexer.rcbuffer->pybuffer, (PyObject*)__pyx_v_lindexer, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {
        Py_XDECREF(__pyx_t_16); Py_XDECREF(__pyx_t_17); Py_XDECREF(__pyx_t_18);
        __Pyx_RaiseBufferFallbackError();
      } else {
        PyErr_Restore(__pyx_t_16, __pyx_t_17, __pyx_t_18);
      }
    }
    __pyx_pybuffernd_lindexer.diminfo[0].strides = __pyx_pybuffernd_lindexer.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_lindexer.diminfo[0].shape = __pyx_pybuffernd_lindexer.rcbuffer->pybuffer.shape[0];
    if (unlikely(__pyx_t_15 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8621; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_14 = 0;
  __pyx_v_lindexer = ((PyArrayObject *)__pyx_t_13);
  __pyx_t_13 = 0;

  /* "pandas/src/generated.pyx":8622
 * 
 *     lindexer = np.empty(count, dtype=np.int64)
 *     rindexer = np.empty(count, dtype=np.int64)             # <<<<<<<<<<<<<<
 *     result = np.empty(count, dtype=np.int32)
 * 
 */
  __pyx_t_13 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8622; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_13);
  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_n_s_empty); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8622; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_9);
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  __pyx_t_13 = PyInt_FromSsize_t(__pyx_v_count); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8622; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_13);
  __pyx_t_11 = PyTuple_New(1); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8622; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_11);
  PyTuple_SET_ITEM(__pyx_t_11, 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 = 8622; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_13);
  __pyx_t_10 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8622; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_10);
  __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_int64); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8622; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_12);
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  if (PyDict_SetItem(__pyx_t_13, __pyx_n_s_dtype, __pyx_t_12) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8622; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
  __pyx_t_12 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_11, __pyx_t_13); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8622; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_12);
  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  if (!(likely(((__pyx_t_12) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_12, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8622; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_14 = ((PyArrayObject *)__pyx_t_12);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_rindexer.rcbuffer->pybuffer);
    __pyx_t_15 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_rindexer.rcbuffer->pybuffer, (PyObject*)__pyx_t_14, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack);
    if (unlikely(__pyx_t_15 < 0)) {
      PyErr_Fetch(&__pyx_t_18, &__pyx_t_17, &__pyx_t_16);
      if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_rindexer.rcbuffer->pybuffer, (PyObject*)__pyx_v_rindexer, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {
        Py_XDECREF(__pyx_t_18); Py_XDECREF(__pyx_t_17); Py_XDECREF(__pyx_t_16);
        __Pyx_RaiseBufferFallbackError();
      } else {
        PyErr_Restore(__pyx_t_18, __pyx_t_17, __pyx_t_16);
      }
    }
    __pyx_pybuffernd_rindexer.diminfo[0].strides = __pyx_pybuffernd_rindexer.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_rindexer.diminfo[0].shape = __pyx_pybuffernd_rindexer.rcbuffer->pybuffer.shape[0];
    if (unlikely(__pyx_t_15 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8622; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_14 = 0;
  __pyx_v_rindexer = ((PyArrayObject *)__pyx_t_12);
  __pyx_t_12 = 0;

  /* "pandas/src/generated.pyx":8623
 *     lindexer = np.empty(count, dtype=np.int64)
 *     rindexer = np.empty(count, dtype=np.int64)
 *     result = np.empty(count, dtype=np.int32)             # <<<<<<<<<<<<<<
 * 
 *     i = 0
 */
  __pyx_t_12 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8623; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_12);
  __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_empty); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8623; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_13);
  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
  __pyx_t_12 = PyInt_FromSsize_t(__pyx_v_count); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8623; __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[2]; __pyx_lineno = 8623; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__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 = PyDict_New(); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8623; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_12);
  __pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8623; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_9);
  __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_int32); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8623; __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_12, __pyx_n_s_dtype, __pyx_t_10) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8623; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_13, __pyx_t_11, __pyx_t_12); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8623; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_10);
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
  if (!(likely(((__pyx_t_10) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_10, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8623; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_19 = ((PyArrayObject *)__pyx_t_10);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer);
    __pyx_t_15 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_result.rcbuffer->pybuffer, (PyObject*)__pyx_t_19, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack);
    if (unlikely(__pyx_t_15 < 0)) {
      PyErr_Fetch(&__pyx_t_16, &__pyx_t_17, &__pyx_t_18);
      if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_result.rcbuffer->pybuffer, (PyObject*)__pyx_v_result, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {
        Py_XDECREF(__pyx_t_16); Py_XDECREF(__pyx_t_17); Py_XDECREF(__pyx_t_18);
        __Pyx_RaiseBufferFallbackError();
      } else {
        PyErr_Restore(__pyx_t_16, __pyx_t_17, __pyx_t_18);
      }
    }
    __pyx_pybuffernd_result.diminfo[0].strides = __pyx_pybuffernd_result.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_result.diminfo[0].shape = __pyx_pybuffernd_result.rcbuffer->pybuffer.shape[0];
    if (unlikely(__pyx_t_15 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8623; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_19 = 0;
  __pyx_v_result = ((PyArrayObject *)__pyx_t_10);
  __pyx_t_10 = 0;

  /* "pandas/src/generated.pyx":8625
 *     result = np.empty(count, dtype=np.int32)
 * 
 *     i = 0             # <<<<<<<<<<<<<<
 *     j = 0
 *     count = 0
 */
  __pyx_v_i = 0;

  /* "pandas/src/generated.pyx":8626
 * 
 *     i = 0
 *     j = 0             # <<<<<<<<<<<<<<
 *     count = 0
 *     if nleft > 0 and nright > 0:
 */
  __pyx_v_j = 0;

  /* "pandas/src/generated.pyx":8627
 *     i = 0
 *     j = 0
 *     count = 0             # <<<<<<<<<<<<<<
 *     if nleft > 0 and nright > 0:
 *         while True:
 */
  __pyx_v_count = 0;

  /* "pandas/src/generated.pyx":8628
 *     j = 0
 *     count = 0
 *     if nleft > 0 and nright > 0:             # <<<<<<<<<<<<<<
 *         while True:
 *             if i == nleft:
 */
  __pyx_t_3 = ((__pyx_v_nleft > 0) != 0);
  if (__pyx_t_3) {
    __pyx_t_4 = ((__pyx_v_nright > 0) != 0);
    __pyx_t_2 = __pyx_t_4;
  } else {
    __pyx_t_2 = __pyx_t_3;
  }
  if (__pyx_t_2) {

    /* "pandas/src/generated.pyx":8629
 *     count = 0
 *     if nleft > 0 and nright > 0:
 *         while True:             # <<<<<<<<<<<<<<
 *             if i == nleft:
 *                 break
 */
    while (1) {

      /* "pandas/src/generated.pyx":8630
 *     if nleft > 0 and nright > 0:
 *         while True:
 *             if i == nleft:             # <<<<<<<<<<<<<<
 *                 break
 *             if j == nright:
 */
      __pyx_t_2 = ((__pyx_v_i == __pyx_v_nleft) != 0);
      if (__pyx_t_2) {

        /* "pandas/src/generated.pyx":8631
 *         while True:
 *             if i == nleft:
 *                 break             # <<<<<<<<<<<<<<
 *             if j == nright:
 *                 break
 */
        goto __pyx_L15_break;
      }

      /* "pandas/src/generated.pyx":8632
 *             if i == nleft:
 *                 break
 *             if j == nright:             # <<<<<<<<<<<<<<
 *                 break
 * 
 */
      __pyx_t_2 = ((__pyx_v_j == __pyx_v_nright) != 0);
      if (__pyx_t_2) {

        /* "pandas/src/generated.pyx":8633
 *                 break
 *             if j == nright:
 *                 break             # <<<<<<<<<<<<<<
 * 
 *             lval = left[i]
 */
        goto __pyx_L15_break;
      }

      /* "pandas/src/generated.pyx":8635
 *                 break
 * 
 *             lval = left[i]             # <<<<<<<<<<<<<<
 *             rval = right[j]
 *             if lval == rval:
 */
      __pyx_t_20 = __pyx_v_i;
      __pyx_v_lval = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_left.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_left.diminfo[0].strides));

      /* "pandas/src/generated.pyx":8636
 * 
 *             lval = left[i]
 *             rval = right[j]             # <<<<<<<<<<<<<<
 *             if lval == rval:
 *                 lindexer[count] = i
 */
      __pyx_t_21 = __pyx_v_j;
      __pyx_v_rval = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_right.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_right.diminfo[0].strides));

      /* "pandas/src/generated.pyx":8637
 *             lval = left[i]
 *             rval = right[j]
 *             if lval == rval:             # <<<<<<<<<<<<<<
 *                 lindexer[count] = i
 *                 rindexer[count] = j
 */
      __pyx_t_2 = ((__pyx_v_lval == __pyx_v_rval) != 0);
      if (__pyx_t_2) {

        /* "pandas/src/generated.pyx":8638
 *             rval = right[j]
 *             if lval == rval:
 *                 lindexer[count] = i             # <<<<<<<<<<<<<<
 *                 rindexer[count] = j
 *                 result[count] = rval
 */
        __pyx_t_22 = __pyx_v_count;
        *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_lindexer.rcbuffer->pybuffer.buf, __pyx_t_22, __pyx_pybuffernd_lindexer.diminfo[0].strides) = __pyx_v_i;

        /* "pandas/src/generated.pyx":8639
 *             if lval == rval:
 *                 lindexer[count] = i
 *                 rindexer[count] = j             # <<<<<<<<<<<<<<
 *                 result[count] = rval
 *                 count += 1
 */
        __pyx_t_23 = __pyx_v_count;
        *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_rindexer.rcbuffer->pybuffer.buf, __pyx_t_23, __pyx_pybuffernd_rindexer.diminfo[0].strides) = __pyx_v_j;

        /* "pandas/src/generated.pyx":8640
 *                 lindexer[count] = i
 *                 rindexer[count] = j
 *                 result[count] = rval             # <<<<<<<<<<<<<<
 *                 count += 1
 *                 if i < nleft - 1:
 */
        __pyx_t_24 = __pyx_v_count;
        *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_24, __pyx_pybuffernd_result.diminfo[0].strides) = __pyx_v_rval;

        /* "pandas/src/generated.pyx":8641
 *                 rindexer[count] = j
 *                 result[count] = rval
 *                 count += 1             # <<<<<<<<<<<<<<
 *                 if i < nleft - 1:
 *                     if j < nright - 1 and right[j + 1] == rval:
 */
        __pyx_v_count = (__pyx_v_count + 1);

        /* "pandas/src/generated.pyx":8642
 *                 result[count] = rval
 *                 count += 1
 *                 if i < nleft - 1:             # <<<<<<<<<<<<<<
 *                     if j < nright - 1 and right[j + 1] == rval:
 *                         j += 1
 */
        __pyx_t_2 = ((__pyx_v_i < (__pyx_v_nleft - 1)) != 0);
        if (__pyx_t_2) {

          /* "pandas/src/generated.pyx":8643
 *                 count += 1
 *                 if i < nleft - 1:
 *                     if j < nright - 1 and right[j + 1] == rval:             # <<<<<<<<<<<<<<
 *                         j += 1
 *                     else:
 */
          __pyx_t_2 = ((__pyx_v_j < (__pyx_v_nright - 1)) != 0);
          if (__pyx_t_2) {
            __pyx_t_25 = (__pyx_v_j + 1);
            __pyx_t_3 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_right.rcbuffer->pybuffer.buf, __pyx_t_25, __pyx_pybuffernd_right.diminfo[0].strides)) == __pyx_v_rval) != 0);
            __pyx_t_4 = __pyx_t_3;
          } else {
            __pyx_t_4 = __pyx_t_2;
          }
          if (__pyx_t_4) {

            /* "pandas/src/generated.pyx":8644
 *                 if i < nleft - 1:
 *                     if j < nright - 1 and right[j + 1] == rval:
 *                         j += 1             # <<<<<<<<<<<<<<
 *                     else:
 *                         i += 1
 */
            __pyx_v_j = (__pyx_v_j + 1);
            goto __pyx_L20;
          }
          /*else*/ {

            /* "pandas/src/generated.pyx":8646
 *                         j += 1
 *                     else:
 *                         i += 1             # <<<<<<<<<<<<<<
 *                         if left[i] != rval:
 *                             j += 1
 */
            __pyx_v_i = (__pyx_v_i + 1);

            /* "pandas/src/generated.pyx":8647
 *                     else:
 *                         i += 1
 *                         if left[i] != rval:             # <<<<<<<<<<<<<<
 *                             j += 1
 *                 elif j < nright - 1:
 */
            __pyx_t_26 = __pyx_v_i;
            __pyx_t_4 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_left.rcbuffer->pybuffer.buf, __pyx_t_26, __pyx_pybuffernd_left.diminfo[0].strides)) != __pyx_v_rval) != 0);
            if (__pyx_t_4) {

              /* "pandas/src/generated.pyx":8648
 *                         i += 1
 *                         if left[i] != rval:
 *                             j += 1             # <<<<<<<<<<<<<<
 *                 elif j < nright - 1:
 *                     j += 1
 */
              __pyx_v_j = (__pyx_v_j + 1);
              goto __pyx_L21;
            }
            __pyx_L21:;
          }
          __pyx_L20:;
          goto __pyx_L19;
        }

        /* "pandas/src/generated.pyx":8649
 *                         if left[i] != rval:
 *                             j += 1
 *                 elif j < nright - 1:             # <<<<<<<<<<<<<<
 *                     j += 1
 *                     if lval != right[j]:
 */
        __pyx_t_4 = ((__pyx_v_j < (__pyx_v_nright - 1)) != 0);
        if (__pyx_t_4) {

          /* "pandas/src/generated.pyx":8650
 *                             j += 1
 *                 elif j < nright - 1:
 *                     j += 1             # <<<<<<<<<<<<<<
 *                     if lval != right[j]:
 *                         i += 1
 */
          __pyx_v_j = (__pyx_v_j + 1);

          /* "pandas/src/generated.pyx":8651
 *                 elif j < nright - 1:
 *                     j += 1
 *                     if lval != right[j]:             # <<<<<<<<<<<<<<
 *                         i += 1
 *                 else:
 */
          __pyx_t_27 = __pyx_v_j;
          __pyx_t_4 = ((__pyx_v_lval != (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_right.rcbuffer->pybuffer.buf, __pyx_t_27, __pyx_pybuffernd_right.diminfo[0].strides))) != 0);
          if (__pyx_t_4) {

            /* "pandas/src/generated.pyx":8652
 *                     j += 1
 *                     if lval != right[j]:
 *                         i += 1             # <<<<<<<<<<<<<<
 *                 else:
 *                     # end of the road
 */
            __pyx_v_i = (__pyx_v_i + 1);
            goto __pyx_L22;
          }
          __pyx_L22:;
          goto __pyx_L19;
        }
        /*else*/ {

          /* "pandas/src/generated.pyx":8655
 *                 else:
 *                     # end of the road
 *                     break             # <<<<<<<<<<<<<<
 *             elif lval < rval:
 *                 i += 1
 */
          goto __pyx_L15_break;
        }
        __pyx_L19:;
        goto __pyx_L18;
      }

      /* "pandas/src/generated.pyx":8656
 *                     # end of the road
 *                     break
 *             elif lval < rval:             # <<<<<<<<<<<<<<
 *                 i += 1
 *             else:
 */
      __pyx_t_4 = ((__pyx_v_lval < __pyx_v_rval) != 0);
      if (__pyx_t_4) {

        /* "pandas/src/generated.pyx":8657
 *                     break
 *             elif lval < rval:
 *                 i += 1             # <<<<<<<<<<<<<<
 *             else:
 *                 j += 1
 */
        __pyx_v_i = (__pyx_v_i + 1);
        goto __pyx_L18;
      }
      /*else*/ {

        /* "pandas/src/generated.pyx":8659
 *                 i += 1
 *             else:
 *                 j += 1             # <<<<<<<<<<<<<<
 * 
 *     return result, lindexer, rindexer
 */
        __pyx_v_j = (__pyx_v_j + 1);
      }
      __pyx_L18:;
    }
    __pyx_L15_break:;
    goto __pyx_L13;
  }
  __pyx_L13:;

  /* "pandas/src/generated.pyx":8661
 *                 j += 1
 * 
 *     return result, lindexer, rindexer             # <<<<<<<<<<<<<<
 * 
 * @cython.wraparound(False)
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_10 = PyTuple_New(3); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8661; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__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_INCREF(((PyObject *)__pyx_v_lindexer));
  PyTuple_SET_ITEM(__pyx_t_10, 1, ((PyObject *)__pyx_v_lindexer));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_lindexer));
  __Pyx_INCREF(((PyObject *)__pyx_v_rindexer));
  PyTuple_SET_ITEM(__pyx_t_10, 2, ((PyObject *)__pyx_v_rindexer));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_rindexer));
  __pyx_r = __pyx_t_10;
  __pyx_t_10 = 0;
  goto __pyx_L0;

  /* "pandas/src/generated.pyx":8572
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def inner_join_indexer_int32(ndarray[int32_t] left,             # <<<<<<<<<<<<<<
 *                               ndarray[int32_t] right):
 *     '''
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_XDECREF(__pyx_t_13);
  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
    __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_left.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_lindexer.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_right.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_rindexer.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas.algos.inner_join_indexer_int32", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_left.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_lindexer.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_right.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_rindexer.rcbuffer->pybuffer);
  __pyx_L2:;
  __Pyx_XDECREF((PyObject *)__pyx_v_lindexer);
  __Pyx_XDECREF((PyObject *)__pyx_v_rindexer);
  __Pyx_XDECREF((PyObject *)__pyx_v_result);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/src/generated.pyx":8665
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def inner_join_indexer_int64(ndarray[int64_t] left,             # <<<<<<<<<<<<<<
 *                               ndarray[int64_t] right):
 *     '''
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pandas_5algos_509inner_join_indexer_int64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6pandas_5algos_508inner_join_indexer_int64[] = "\n    Two-pass algorithm for monotonic indexes. Handles many-to-one merges\n    ";
static PyMethodDef __pyx_mdef_6pandas_5algos_509inner_join_indexer_int64 = {__Pyx_NAMESTR("inner_join_indexer_int64"), (PyCFunction)__pyx_pw_6pandas_5algos_509inner_join_indexer_int64, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6pandas_5algos_508inner_join_indexer_int64)};
static PyObject *__pyx_pw_6pandas_5algos_509inner_join_indexer_int64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyArrayObject *__pyx_v_left = 0;
  PyArrayObject *__pyx_v_right = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("inner_join_indexer_int64 (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_left,&__pyx_n_s_right,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_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 (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_left)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_right)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("inner_join_indexer_int64", 1, 2, 2, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8665; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "inner_join_indexer_int64") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8665; __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("inner_join_indexer_int64", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8665; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas.algos.inner_join_indexer_int64", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_left), __pyx_ptype_5numpy_ndarray, 1, "left", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8665; __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[2]; __pyx_lineno = 8666; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_508inner_join_indexer_int64(__pyx_self, __pyx_v_left, __pyx_v_right);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pandas_5algos_508inner_join_indexer_int64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_left, PyArrayObject *__pyx_v_right) {
  Py_ssize_t __pyx_v_i;
  Py_ssize_t __pyx_v_j;
  Py_ssize_t __pyx_v_nright;
  Py_ssize_t __pyx_v_nleft;
  Py_ssize_t __pyx_v_count;
  __pyx_t_5numpy_int64_t __pyx_v_lval;
  __pyx_t_5numpy_int64_t __pyx_v_rval;
  PyArrayObject *__pyx_v_lindexer = 0;
  PyArrayObject *__pyx_v_rindexer = 0;
  PyArrayObject *__pyx_v_result = 0;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_left;
  __Pyx_Buffer __pyx_pybuffer_left;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_lindexer;
  __Pyx_Buffer __pyx_pybuffer_lindexer;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_result;
  __Pyx_Buffer __pyx_pybuffer_result;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_right;
  __Pyx_Buffer __pyx_pybuffer_right;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_rindexer;
  __Pyx_Buffer __pyx_pybuffer_rindexer;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  Py_ssize_t __pyx_t_1;
  int __pyx_t_2;
  int __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;
  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;
  PyObject *__pyx_t_13 = NULL;
  PyArrayObject *__pyx_t_14 = NULL;
  int __pyx_t_15;
  PyObject *__pyx_t_16 = NULL;
  PyObject *__pyx_t_17 = NULL;
  PyObject *__pyx_t_18 = NULL;
  PyArrayObject *__pyx_t_19 = NULL;
  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;
  __Pyx_RefNannySetupContext("inner_join_indexer_int64", 0);
  __pyx_pybuffer_lindexer.pybuffer.buf = NULL;
  __pyx_pybuffer_lindexer.refcount = 0;
  __pyx_pybuffernd_lindexer.data = NULL;
  __pyx_pybuffernd_lindexer.rcbuffer = &__pyx_pybuffer_lindexer;
  __pyx_pybuffer_rindexer.pybuffer.buf = NULL;
  __pyx_pybuffer_rindexer.refcount = 0;
  __pyx_pybuffernd_rindexer.data = NULL;
  __pyx_pybuffernd_rindexer.rcbuffer = &__pyx_pybuffer_rindexer;
  __pyx_pybuffer_result.pybuffer.buf = NULL;
  __pyx_pybuffer_result.refcount = 0;
  __pyx_pybuffernd_result.data = NULL;
  __pyx_pybuffernd_result.rcbuffer = &__pyx_pybuffer_result;
  __pyx_pybuffer_left.pybuffer.buf = NULL;
  __pyx_pybuffer_left.refcount = 0;
  __pyx_pybuffernd_left.data = NULL;
  __pyx_pybuffernd_left.rcbuffer = &__pyx_pybuffer_left;
  __pyx_pybuffer_right.pybuffer.buf = NULL;
  __pyx_pybuffer_right.refcount = 0;
  __pyx_pybuffernd_right.data = NULL;
  __pyx_pybuffernd_right.rcbuffer = &__pyx_pybuffer_right;
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_left.rcbuffer->pybuffer, (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[2]; __pyx_lineno = 8665; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_left.diminfo[0].strides = __pyx_pybuffernd_left.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_left.diminfo[0].shape = __pyx_pybuffernd_left.rcbuffer->pybuffer.shape[0];
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_right.rcbuffer->pybuffer, (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[2]; __pyx_lineno = 8665; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_right.diminfo[0].strides = __pyx_pybuffernd_right.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_right.diminfo[0].shape = __pyx_pybuffernd_right.rcbuffer->pybuffer.shape[0];

  /* "pandas/src/generated.pyx":8676
 *         ndarray[int64_t] result
 * 
 *     nleft = len(left)             # <<<<<<<<<<<<<<
 *     nright = len(right)
 * 
 */
  __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_left)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8676; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_nleft = __pyx_t_1;

  /* "pandas/src/generated.pyx":8677
 * 
 *     nleft = len(left)
 *     nright = len(right)             # <<<<<<<<<<<<<<
 * 
 *     i = 0
 */
  __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_right)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8677; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_nright = __pyx_t_1;

  /* "pandas/src/generated.pyx":8679
 *     nright = len(right)
 * 
 *     i = 0             # <<<<<<<<<<<<<<
 *     j = 0
 *     count = 0
 */
  __pyx_v_i = 0;

  /* "pandas/src/generated.pyx":8680
 * 
 *     i = 0
 *     j = 0             # <<<<<<<<<<<<<<
 *     count = 0
 *     if nleft > 0 and nright > 0:
 */
  __pyx_v_j = 0;

  /* "pandas/src/generated.pyx":8681
 *     i = 0
 *     j = 0
 *     count = 0             # <<<<<<<<<<<<<<
 *     if nleft > 0 and nright > 0:
 *         while True:
 */
  __pyx_v_count = 0;

  /* "pandas/src/generated.pyx":8682
 *     j = 0
 *     count = 0
 *     if nleft > 0 and nright > 0:             # <<<<<<<<<<<<<<
 *         while True:
 *             if i == nleft:
 */
  __pyx_t_2 = ((__pyx_v_nleft > 0) != 0);
  if (__pyx_t_2) {
    __pyx_t_3 = ((__pyx_v_nright > 0) != 0);
    __pyx_t_4 = __pyx_t_3;
  } else {
    __pyx_t_4 = __pyx_t_2;
  }
  if (__pyx_t_4) {

    /* "pandas/src/generated.pyx":8683
 *     count = 0
 *     if nleft > 0 and nright > 0:
 *         while True:             # <<<<<<<<<<<<<<
 *             if i == nleft:
 *                 break
 */
    while (1) {

      /* "pandas/src/generated.pyx":8684
 *     if nleft > 0 and nright > 0:
 *         while True:
 *             if i == nleft:             # <<<<<<<<<<<<<<
 *                 break
 *             if j == nright:
 */
      __pyx_t_4 = ((__pyx_v_i == __pyx_v_nleft) != 0);
      if (__pyx_t_4) {

        /* "pandas/src/generated.pyx":8685
 *         while True:
 *             if i == nleft:
 *                 break             # <<<<<<<<<<<<<<
 *             if j == nright:
 *                 break
 */
        goto __pyx_L5_break;
      }

      /* "pandas/src/generated.pyx":8686
 *             if i == nleft:
 *                 break
 *             if j == nright:             # <<<<<<<<<<<<<<
 *                 break
 * 
 */
      __pyx_t_4 = ((__pyx_v_j == __pyx_v_nright) != 0);
      if (__pyx_t_4) {

        /* "pandas/src/generated.pyx":8687
 *                 break
 *             if j == nright:
 *                 break             # <<<<<<<<<<<<<<
 * 
 *             lval = left[i]
 */
        goto __pyx_L5_break;
      }

      /* "pandas/src/generated.pyx":8689
 *                 break
 * 
 *             lval = left[i]             # <<<<<<<<<<<<<<
 *             rval = right[j]
 *             if lval == rval:
 */
      __pyx_t_1 = __pyx_v_i;
      __pyx_v_lval = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_left.rcbuffer->pybuffer.buf, __pyx_t_1, __pyx_pybuffernd_left.diminfo[0].strides));

      /* "pandas/src/generated.pyx":8690
 * 
 *             lval = left[i]
 *             rval = right[j]             # <<<<<<<<<<<<<<
 *             if lval == rval:
 *                 count += 1
 */
      __pyx_t_5 = __pyx_v_j;
      __pyx_v_rval = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_right.rcbuffer->pybuffer.buf, __pyx_t_5, __pyx_pybuffernd_right.diminfo[0].strides));

      /* "pandas/src/generated.pyx":8691
 *             lval = left[i]
 *             rval = right[j]
 *             if lval == rval:             # <<<<<<<<<<<<<<
 *                 count += 1
 *                 if i < nleft - 1:
 */
      __pyx_t_4 = ((__pyx_v_lval == __pyx_v_rval) != 0);
      if (__pyx_t_4) {

        /* "pandas/src/generated.pyx":8692
 *             rval = right[j]
 *             if lval == rval:
 *                 count += 1             # <<<<<<<<<<<<<<
 *                 if i < nleft - 1:
 *                     if j < nright - 1 and right[j + 1] == rval:
 */
        __pyx_v_count = (__pyx_v_count + 1);

        /* "pandas/src/generated.pyx":8693
 *             if lval == rval:
 *                 count += 1
 *                 if i < nleft - 1:             # <<<<<<<<<<<<<<
 *                     if j < nright - 1 and right[j + 1] == rval:
 *                         j += 1
 */
        __pyx_t_4 = ((__pyx_v_i < (__pyx_v_nleft - 1)) != 0);
        if (__pyx_t_4) {

          /* "pandas/src/generated.pyx":8694
 *                 count += 1
 *                 if i < nleft - 1:
 *                     if j < nright - 1 and right[j + 1] == rval:             # <<<<<<<<<<<<<<
 *                         j += 1
 *                     else:
 */
          __pyx_t_4 = ((__pyx_v_j < (__pyx_v_nright - 1)) != 0);
          if (__pyx_t_4) {
            __pyx_t_6 = (__pyx_v_j + 1);
            __pyx_t_2 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_right.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_right.diminfo[0].strides)) == __pyx_v_rval) != 0);
            __pyx_t_3 = __pyx_t_2;
          } else {
            __pyx_t_3 = __pyx_t_4;
          }
          if (__pyx_t_3) {

            /* "pandas/src/generated.pyx":8695
 *                 if i < nleft - 1:
 *                     if j < nright - 1 and right[j + 1] == rval:
 *                         j += 1             # <<<<<<<<<<<<<<
 *                     else:
 *                         i += 1
 */
            __pyx_v_j = (__pyx_v_j + 1);
            goto __pyx_L10;
          }
          /*else*/ {

            /* "pandas/src/generated.pyx":8697
 *                         j += 1
 *                     else:
 *                         i += 1             # <<<<<<<<<<<<<<
 *                         if left[i] != rval:
 *                             j += 1
 */
            __pyx_v_i = (__pyx_v_i + 1);

            /* "pandas/src/generated.pyx":8698
 *                     else:
 *                         i += 1
 *                         if left[i] != rval:             # <<<<<<<<<<<<<<
 *                             j += 1
 *                 elif j < nright - 1:
 */
            __pyx_t_7 = __pyx_v_i;
            __pyx_t_3 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_left.rcbuffer->pybuffer.buf, __pyx_t_7, __pyx_pybuffernd_left.diminfo[0].strides)) != __pyx_v_rval) != 0);
            if (__pyx_t_3) {

              /* "pandas/src/generated.pyx":8699
 *                         i += 1
 *                         if left[i] != rval:
 *                             j += 1             # <<<<<<<<<<<<<<
 *                 elif j < nright - 1:
 *                     j += 1
 */
              __pyx_v_j = (__pyx_v_j + 1);
              goto __pyx_L11;
            }
            __pyx_L11:;
          }
          __pyx_L10:;
          goto __pyx_L9;
        }

        /* "pandas/src/generated.pyx":8700
 *                         if left[i] != rval:
 *                             j += 1
 *                 elif j < nright - 1:             # <<<<<<<<<<<<<<
 *                     j += 1
 *                     if lval != right[j]:
 */
        __pyx_t_3 = ((__pyx_v_j < (__pyx_v_nright - 1)) != 0);
        if (__pyx_t_3) {

          /* "pandas/src/generated.pyx":8701
 *                             j += 1
 *                 elif j < nright - 1:
 *                     j += 1             # <<<<<<<<<<<<<<
 *                     if lval != right[j]:
 *                         i += 1
 */
          __pyx_v_j = (__pyx_v_j + 1);

          /* "pandas/src/generated.pyx":8702
 *                 elif j < nright - 1:
 *                     j += 1
 *                     if lval != right[j]:             # <<<<<<<<<<<<<<
 *                         i += 1
 *                 else:
 */
          __pyx_t_8 = __pyx_v_j;
          __pyx_t_3 = ((__pyx_v_lval != (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_right.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_right.diminfo[0].strides))) != 0);
          if (__pyx_t_3) {

            /* "pandas/src/generated.pyx":8703
 *                     j += 1
 *                     if lval != right[j]:
 *                         i += 1             # <<<<<<<<<<<<<<
 *                 else:
 *                     # end of the road
 */
            __pyx_v_i = (__pyx_v_i + 1);
            goto __pyx_L12;
          }
          __pyx_L12:;
          goto __pyx_L9;
        }
        /*else*/ {

          /* "pandas/src/generated.pyx":8706
 *                 else:
 *                     # end of the road
 *                     break             # <<<<<<<<<<<<<<
 *             elif lval < rval:
 *                 i += 1
 */
          goto __pyx_L5_break;
        }
        __pyx_L9:;
        goto __pyx_L8;
      }

      /* "pandas/src/generated.pyx":8707
 *                     # end of the road
 *                     break
 *             elif lval < rval:             # <<<<<<<<<<<<<<
 *                 i += 1
 *             else:
 */
      __pyx_t_3 = ((__pyx_v_lval < __pyx_v_rval) != 0);
      if (__pyx_t_3) {

        /* "pandas/src/generated.pyx":8708
 *                     break
 *             elif lval < rval:
 *                 i += 1             # <<<<<<<<<<<<<<
 *             else:
 *                 j += 1
 */
        __pyx_v_i = (__pyx_v_i + 1);
        goto __pyx_L8;
      }
      /*else*/ {

        /* "pandas/src/generated.pyx":8710
 *                 i += 1
 *             else:
 *                 j += 1             # <<<<<<<<<<<<<<
 * 
 *     # do it again now that result size is known
 */
        __pyx_v_j = (__pyx_v_j + 1);
      }
      __pyx_L8:;
    }
    __pyx_L5_break:;
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "pandas/src/generated.pyx":8714
 *     # do it again now that result size is known
 * 
 *     lindexer = np.empty(count, dtype=np.int64)             # <<<<<<<<<<<<<<
 *     rindexer = np.empty(count, dtype=np.int64)
 *     result = np.empty(count, dtype=np.int64)
 */
  __pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8714; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_9);
  __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_empty); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8714; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_10);
  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  __pyx_t_9 = PyInt_FromSsize_t(__pyx_v_count); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8714; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_9);
  __pyx_t_11 = PyTuple_New(1); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8714; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_11);
  PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_9);
  __Pyx_GIVEREF(__pyx_t_9);
  __pyx_t_9 = 0;
  __pyx_t_9 = PyDict_New(); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8714; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_9);
  __pyx_t_12 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8714; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_12);
  __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_int64); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8714; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_13);
  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
  if (PyDict_SetItem(__pyx_t_9, __pyx_n_s_dtype, __pyx_t_13) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8714; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  __pyx_t_13 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_t_11, __pyx_t_9); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8714; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_13);
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 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 = 8714; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_14 = ((PyArrayObject *)__pyx_t_13);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_lindexer.rcbuffer->pybuffer);
    __pyx_t_15 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_lindexer.rcbuffer->pybuffer, (PyObject*)__pyx_t_14, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack);
    if (unlikely(__pyx_t_15 < 0)) {
      PyErr_Fetch(&__pyx_t_16, &__pyx_t_17, &__pyx_t_18);
      if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_lindexer.rcbuffer->pybuffer, (PyObject*)__pyx_v_lindexer, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {
        Py_XDECREF(__pyx_t_16); Py_XDECREF(__pyx_t_17); Py_XDECREF(__pyx_t_18);
        __Pyx_RaiseBufferFallbackError();
      } else {
        PyErr_Restore(__pyx_t_16, __pyx_t_17, __pyx_t_18);
      }
    }
    __pyx_pybuffernd_lindexer.diminfo[0].strides = __pyx_pybuffernd_lindexer.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_lindexer.diminfo[0].shape = __pyx_pybuffernd_lindexer.rcbuffer->pybuffer.shape[0];
    if (unlikely(__pyx_t_15 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8714; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_14 = 0;
  __pyx_v_lindexer = ((PyArrayObject *)__pyx_t_13);
  __pyx_t_13 = 0;

  /* "pandas/src/generated.pyx":8715
 * 
 *     lindexer = np.empty(count, dtype=np.int64)
 *     rindexer = np.empty(count, dtype=np.int64)             # <<<<<<<<<<<<<<
 *     result = np.empty(count, dtype=np.int64)
 * 
 */
  __pyx_t_13 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8715; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_13);
  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_n_s_empty); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8715; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_9);
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  __pyx_t_13 = PyInt_FromSsize_t(__pyx_v_count); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8715; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_13);
  __pyx_t_11 = PyTuple_New(1); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8715; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_11);
  PyTuple_SET_ITEM(__pyx_t_11, 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 = 8715; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_13);
  __pyx_t_10 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8715; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_10);
  __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_int64); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8715; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_12);
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  if (PyDict_SetItem(__pyx_t_13, __pyx_n_s_dtype, __pyx_t_12) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8715; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
  __pyx_t_12 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_11, __pyx_t_13); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8715; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_12);
  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  if (!(likely(((__pyx_t_12) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_12, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8715; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_14 = ((PyArrayObject *)__pyx_t_12);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_rindexer.rcbuffer->pybuffer);
    __pyx_t_15 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_rindexer.rcbuffer->pybuffer, (PyObject*)__pyx_t_14, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack);
    if (unlikely(__pyx_t_15 < 0)) {
      PyErr_Fetch(&__pyx_t_18, &__pyx_t_17, &__pyx_t_16);
      if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_rindexer.rcbuffer->pybuffer, (PyObject*)__pyx_v_rindexer, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {
        Py_XDECREF(__pyx_t_18); Py_XDECREF(__pyx_t_17); Py_XDECREF(__pyx_t_16);
        __Pyx_RaiseBufferFallbackError();
      } else {
        PyErr_Restore(__pyx_t_18, __pyx_t_17, __pyx_t_16);
      }
    }
    __pyx_pybuffernd_rindexer.diminfo[0].strides = __pyx_pybuffernd_rindexer.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_rindexer.diminfo[0].shape = __pyx_pybuffernd_rindexer.rcbuffer->pybuffer.shape[0];
    if (unlikely(__pyx_t_15 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8715; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_14 = 0;
  __pyx_v_rindexer = ((PyArrayObject *)__pyx_t_12);
  __pyx_t_12 = 0;

  /* "pandas/src/generated.pyx":8716
 *     lindexer = np.empty(count, dtype=np.int64)
 *     rindexer = np.empty(count, dtype=np.int64)
 *     result = np.empty(count, dtype=np.int64)             # <<<<<<<<<<<<<<
 * 
 *     i = 0
 */
  __pyx_t_12 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8716; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_12);
  __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_empty); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8716; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_13);
  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
  __pyx_t_12 = PyInt_FromSsize_t(__pyx_v_count); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8716; __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[2]; __pyx_lineno = 8716; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__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 = PyDict_New(); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8716; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_12);
  __pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8716; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_9);
  __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_int64); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8716; __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_12, __pyx_n_s_dtype, __pyx_t_10) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8716; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_13, __pyx_t_11, __pyx_t_12); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8716; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_10);
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
  if (!(likely(((__pyx_t_10) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_10, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8716; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_19 = ((PyArrayObject *)__pyx_t_10);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer);
    __pyx_t_15 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_result.rcbuffer->pybuffer, (PyObject*)__pyx_t_19, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack);
    if (unlikely(__pyx_t_15 < 0)) {
      PyErr_Fetch(&__pyx_t_16, &__pyx_t_17, &__pyx_t_18);
      if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_result.rcbuffer->pybuffer, (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_16); Py_XDECREF(__pyx_t_17); Py_XDECREF(__pyx_t_18);
        __Pyx_RaiseBufferFallbackError();
      } else {
        PyErr_Restore(__pyx_t_16, __pyx_t_17, __pyx_t_18);
      }
    }
    __pyx_pybuffernd_result.diminfo[0].strides = __pyx_pybuffernd_result.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_result.diminfo[0].shape = __pyx_pybuffernd_result.rcbuffer->pybuffer.shape[0];
    if (unlikely(__pyx_t_15 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8716; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_19 = 0;
  __pyx_v_result = ((PyArrayObject *)__pyx_t_10);
  __pyx_t_10 = 0;

  /* "pandas/src/generated.pyx":8718
 *     result = np.empty(count, dtype=np.int64)
 * 
 *     i = 0             # <<<<<<<<<<<<<<
 *     j = 0
 *     count = 0
 */
  __pyx_v_i = 0;

  /* "pandas/src/generated.pyx":8719
 * 
 *     i = 0
 *     j = 0             # <<<<<<<<<<<<<<
 *     count = 0
 *     if nleft > 0 and nright > 0:
 */
  __pyx_v_j = 0;

  /* "pandas/src/generated.pyx":8720
 *     i = 0
 *     j = 0
 *     count = 0             # <<<<<<<<<<<<<<
 *     if nleft > 0 and nright > 0:
 *         while True:
 */
  __pyx_v_count = 0;

  /* "pandas/src/generated.pyx":8721
 *     j = 0
 *     count = 0
 *     if nleft > 0 and nright > 0:             # <<<<<<<<<<<<<<
 *         while True:
 *             if i == nleft:
 */
  __pyx_t_3 = ((__pyx_v_nleft > 0) != 0);
  if (__pyx_t_3) {
    __pyx_t_4 = ((__pyx_v_nright > 0) != 0);
    __pyx_t_2 = __pyx_t_4;
  } else {
    __pyx_t_2 = __pyx_t_3;
  }
  if (__pyx_t_2) {

    /* "pandas/src/generated.pyx":8722
 *     count = 0
 *     if nleft > 0 and nright > 0:
 *         while True:             # <<<<<<<<<<<<<<
 *             if i == nleft:
 *                 break
 */
    while (1) {

      /* "pandas/src/generated.pyx":8723
 *     if nleft > 0 and nright > 0:
 *         while True:
 *             if i == nleft:             # <<<<<<<<<<<<<<
 *                 break
 *             if j == nright:
 */
      __pyx_t_2 = ((__pyx_v_i == __pyx_v_nleft) != 0);
      if (__pyx_t_2) {

        /* "pandas/src/generated.pyx":8724
 *         while True:
 *             if i == nleft:
 *                 break             # <<<<<<<<<<<<<<
 *             if j == nright:
 *                 break
 */
        goto __pyx_L15_break;
      }

      /* "pandas/src/generated.pyx":8725
 *             if i == nleft:
 *                 break
 *             if j == nright:             # <<<<<<<<<<<<<<
 *                 break
 * 
 */
      __pyx_t_2 = ((__pyx_v_j == __pyx_v_nright) != 0);
      if (__pyx_t_2) {

        /* "pandas/src/generated.pyx":8726
 *                 break
 *             if j == nright:
 *                 break             # <<<<<<<<<<<<<<
 * 
 *             lval = left[i]
 */
        goto __pyx_L15_break;
      }

      /* "pandas/src/generated.pyx":8728
 *                 break
 * 
 *             lval = left[i]             # <<<<<<<<<<<<<<
 *             rval = right[j]
 *             if lval == rval:
 */
      __pyx_t_20 = __pyx_v_i;
      __pyx_v_lval = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_left.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_left.diminfo[0].strides));

      /* "pandas/src/generated.pyx":8729
 * 
 *             lval = left[i]
 *             rval = right[j]             # <<<<<<<<<<<<<<
 *             if lval == rval:
 *                 lindexer[count] = i
 */
      __pyx_t_21 = __pyx_v_j;
      __pyx_v_rval = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_right.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_right.diminfo[0].strides));

      /* "pandas/src/generated.pyx":8730
 *             lval = left[i]
 *             rval = right[j]
 *             if lval == rval:             # <<<<<<<<<<<<<<
 *                 lindexer[count] = i
 *                 rindexer[count] = j
 */
      __pyx_t_2 = ((__pyx_v_lval == __pyx_v_rval) != 0);
      if (__pyx_t_2) {

        /* "pandas/src/generated.pyx":8731
 *             rval = right[j]
 *             if lval == rval:
 *                 lindexer[count] = i             # <<<<<<<<<<<<<<
 *                 rindexer[count] = j
 *                 result[count] = rval
 */
        __pyx_t_22 = __pyx_v_count;
        *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_lindexer.rcbuffer->pybuffer.buf, __pyx_t_22, __pyx_pybuffernd_lindexer.diminfo[0].strides) = __pyx_v_i;

        /* "pandas/src/generated.pyx":8732
 *             if lval == rval:
 *                 lindexer[count] = i
 *                 rindexer[count] = j             # <<<<<<<<<<<<<<
 *                 result[count] = rval
 *                 count += 1
 */
        __pyx_t_23 = __pyx_v_count;
        *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_rindexer.rcbuffer->pybuffer.buf, __pyx_t_23, __pyx_pybuffernd_rindexer.diminfo[0].strides) = __pyx_v_j;

        /* "pandas/src/generated.pyx":8733
 *                 lindexer[count] = i
 *                 rindexer[count] = j
 *                 result[count] = rval             # <<<<<<<<<<<<<<
 *                 count += 1
 *                 if i < nleft - 1:
 */
        __pyx_t_24 = __pyx_v_count;
        *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_24, __pyx_pybuffernd_result.diminfo[0].strides) = __pyx_v_rval;

        /* "pandas/src/generated.pyx":8734
 *                 rindexer[count] = j
 *                 result[count] = rval
 *                 count += 1             # <<<<<<<<<<<<<<
 *                 if i < nleft - 1:
 *                     if j < nright - 1 and right[j + 1] == rval:
 */
        __pyx_v_count = (__pyx_v_count + 1);

        /* "pandas/src/generated.pyx":8735
 *                 result[count] = rval
 *                 count += 1
 *                 if i < nleft - 1:             # <<<<<<<<<<<<<<
 *                     if j < nright - 1 and right[j + 1] == rval:
 *                         j += 1
 */
        __pyx_t_2 = ((__pyx_v_i < (__pyx_v_nleft - 1)) != 0);
        if (__pyx_t_2) {

          /* "pandas/src/generated.pyx":8736
 *                 count += 1
 *                 if i < nleft - 1:
 *                     if j < nright - 1 and right[j + 1] == rval:             # <<<<<<<<<<<<<<
 *                         j += 1
 *                     else:
 */
          __pyx_t_2 = ((__pyx_v_j < (__pyx_v_nright - 1)) != 0);
          if (__pyx_t_2) {
            __pyx_t_25 = (__pyx_v_j + 1);
            __pyx_t_3 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_right.rcbuffer->pybuffer.buf, __pyx_t_25, __pyx_pybuffernd_right.diminfo[0].strides)) == __pyx_v_rval) != 0);
            __pyx_t_4 = __pyx_t_3;
          } else {
            __pyx_t_4 = __pyx_t_2;
          }
          if (__pyx_t_4) {

            /* "pandas/src/generated.pyx":8737
 *                 if i < nleft - 1:
 *                     if j < nright - 1 and right[j + 1] == rval:
 *                         j += 1             # <<<<<<<<<<<<<<
 *                     else:
 *                         i += 1
 */
            __pyx_v_j = (__pyx_v_j + 1);
            goto __pyx_L20;
          }
          /*else*/ {

            /* "pandas/src/generated.pyx":8739
 *                         j += 1
 *                     else:
 *                         i += 1             # <<<<<<<<<<<<<<
 *                         if left[i] != rval:
 *                             j += 1
 */
            __pyx_v_i = (__pyx_v_i + 1);

            /* "pandas/src/generated.pyx":8740
 *                     else:
 *                         i += 1
 *                         if left[i] != rval:             # <<<<<<<<<<<<<<
 *                             j += 1
 *                 elif j < nright - 1:
 */
            __pyx_t_26 = __pyx_v_i;
            __pyx_t_4 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_left.rcbuffer->pybuffer.buf, __pyx_t_26, __pyx_pybuffernd_left.diminfo[0].strides)) != __pyx_v_rval) != 0);
            if (__pyx_t_4) {

              /* "pandas/src/generated.pyx":8741
 *                         i += 1
 *                         if left[i] != rval:
 *                             j += 1             # <<<<<<<<<<<<<<
 *                 elif j < nright - 1:
 *                     j += 1
 */
              __pyx_v_j = (__pyx_v_j + 1);
              goto __pyx_L21;
            }
            __pyx_L21:;
          }
          __pyx_L20:;
          goto __pyx_L19;
        }

        /* "pandas/src/generated.pyx":8742
 *                         if left[i] != rval:
 *                             j += 1
 *                 elif j < nright - 1:             # <<<<<<<<<<<<<<
 *                     j += 1
 *                     if lval != right[j]:
 */
        __pyx_t_4 = ((__pyx_v_j < (__pyx_v_nright - 1)) != 0);
        if (__pyx_t_4) {

          /* "pandas/src/generated.pyx":8743
 *                             j += 1
 *                 elif j < nright - 1:
 *                     j += 1             # <<<<<<<<<<<<<<
 *                     if lval != right[j]:
 *                         i += 1
 */
          __pyx_v_j = (__pyx_v_j + 1);

          /* "pandas/src/generated.pyx":8744
 *                 elif j < nright - 1:
 *                     j += 1
 *                     if lval != right[j]:             # <<<<<<<<<<<<<<
 *                         i += 1
 *                 else:
 */
          __pyx_t_27 = __pyx_v_j;
          __pyx_t_4 = ((__pyx_v_lval != (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_right.rcbuffer->pybuffer.buf, __pyx_t_27, __pyx_pybuffernd_right.diminfo[0].strides))) != 0);
          if (__pyx_t_4) {

            /* "pandas/src/generated.pyx":8745
 *                     j += 1
 *                     if lval != right[j]:
 *                         i += 1             # <<<<<<<<<<<<<<
 *                 else:
 *                     # end of the road
 */
            __pyx_v_i = (__pyx_v_i + 1);
            goto __pyx_L22;
          }
          __pyx_L22:;
          goto __pyx_L19;
        }
        /*else*/ {

          /* "pandas/src/generated.pyx":8748
 *                 else:
 *                     # end of the road
 *                     break             # <<<<<<<<<<<<<<
 *             elif lval < rval:
 *                 i += 1
 */
          goto __pyx_L15_break;
        }
        __pyx_L19:;
        goto __pyx_L18;
      }

      /* "pandas/src/generated.pyx":8749
 *                     # end of the road
 *                     break
 *             elif lval < rval:             # <<<<<<<<<<<<<<
 *                 i += 1
 *             else:
 */
      __pyx_t_4 = ((__pyx_v_lval < __pyx_v_rval) != 0);
      if (__pyx_t_4) {

        /* "pandas/src/generated.pyx":8750
 *                     break
 *             elif lval < rval:
 *                 i += 1             # <<<<<<<<<<<<<<
 *             else:
 *                 j += 1
 */
        __pyx_v_i = (__pyx_v_i + 1);
        goto __pyx_L18;
      }
      /*else*/ {

        /* "pandas/src/generated.pyx":8752
 *                 i += 1
 *             else:
 *                 j += 1             # <<<<<<<<<<<<<<
 * 
 *     return result, lindexer, rindexer
 */
        __pyx_v_j = (__pyx_v_j + 1);
      }
      __pyx_L18:;
    }
    __pyx_L15_break:;
    goto __pyx_L13;
  }
  __pyx_L13:;

  /* "pandas/src/generated.pyx":8754
 *                 j += 1
 * 
 *     return result, lindexer, rindexer             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_10 = PyTuple_New(3); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8754; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__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_INCREF(((PyObject *)__pyx_v_lindexer));
  PyTuple_SET_ITEM(__pyx_t_10, 1, ((PyObject *)__pyx_v_lindexer));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_lindexer));
  __Pyx_INCREF(((PyObject *)__pyx_v_rindexer));
  PyTuple_SET_ITEM(__pyx_t_10, 2, ((PyObject *)__pyx_v_rindexer));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_rindexer));
  __pyx_r = __pyx_t_10;
  __pyx_t_10 = 0;
  goto __pyx_L0;

  /* "pandas/src/generated.pyx":8665
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def inner_join_indexer_int64(ndarray[int64_t] left,             # <<<<<<<<<<<<<<
 *                               ndarray[int64_t] right):
 *     '''
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_XDECREF(__pyx_t_13);
  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
    __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_left.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_lindexer.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_right.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_rindexer.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas.algos.inner_join_indexer_int64", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_left.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_lindexer.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_right.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_rindexer.rcbuffer->pybuffer);
  __pyx_L2:;
  __Pyx_XDECREF((PyObject *)__pyx_v_lindexer);
  __Pyx_XDECREF((PyObject *)__pyx_v_rindexer);
  __Pyx_XDECREF((PyObject *)__pyx_v_result);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "datetime.pxd":126
 * 
 * 
 * cdef inline _string_to_dts(object val, pandas_datetimestruct* dts):             # <<<<<<<<<<<<<<
 *     cdef int result
 *     cdef char *tmp
 */

static CYTHON_INLINE PyObject *__pyx_f_8datetime__string_to_dts(PyObject *__pyx_v_val, pandas_datetimestruct *__pyx_v_dts) {
  int __pyx_v_result;
  char *__pyx_v_tmp;
  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", 0);
  __Pyx_INCREF(__pyx_v_val);

  /* "datetime.pxd":130
 *     cdef char *tmp
 * 
 *     if PyUnicode_Check(val):             # <<<<<<<<<<<<<<
 *         val = PyUnicode_AsASCIIString(val);
 * 
 */
  __pyx_t_1 = (PyUnicode_Check(__pyx_v_val) != 0);
  if (__pyx_t_1) {

    /* "datetime.pxd":131
 * 
 *     if PyUnicode_Check(val):
 *         val = PyUnicode_AsASCIIString(val);             # <<<<<<<<<<<<<<
 * 
 *     tmp = val
 */
    __pyx_t_2 = PyUnicode_AsASCIIString(__pyx_v_val); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 131; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF_SET(__pyx_v_val, __pyx_t_2);
    __pyx_t_2 = 0;
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "datetime.pxd":133
 *         val = PyUnicode_AsASCIIString(val);
 * 
 *     tmp = val             # <<<<<<<<<<<<<<
 *     result = _cstring_to_dts(tmp, len(val), dts)
 * 
 */
  __pyx_t_3 = __Pyx_PyObject_AsString(__pyx_v_val); if (unlikely((!__pyx_t_3) && PyErr_Occurred())) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 133; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_tmp = __pyx_t_3;

  /* "datetime.pxd":134
 * 
 *     tmp = val
 *     result = _cstring_to_dts(tmp, len(val), dts)             # <<<<<<<<<<<<<<
 * 
 *     if result == -1:
 */
  __pyx_t_4 = PyObject_Length(__pyx_v_val); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 134; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_result = __pyx_f_8datetime__cstring_to_dts(__pyx_v_tmp, __pyx_t_4, __pyx_v_dts);

  /* "datetime.pxd":136
 *     result = _cstring_to_dts(tmp, len(val), dts)
 * 
 *     if result == -1:             # <<<<<<<<<<<<<<
 *         raise ValueError('Unable to parse %s' % str(val))
 * 
 */
  __pyx_t_1 = ((__pyx_v_result == -1) != 0);
  if (__pyx_t_1) {

    /* "datetime.pxd":137
 * 
 *     if result == -1:
 *         raise ValueError('Unable to parse %s' % str(val))             # <<<<<<<<<<<<<<
 * 
 * cdef inline int _cstring_to_dts(char *val, int length,
 */
    __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 137; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__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 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), __pyx_t_2, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 137; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = __Pyx_PyString_Format(__pyx_kp_s_Unable_to_parse_s, __pyx_t_5); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 137; __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[4]; __pyx_lineno = 137; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__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 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 137; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__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[4]; __pyx_lineno = 137; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }

  /* "datetime.pxd":126
 * 
 * 
 * cdef inline _string_to_dts(object val, pandas_datetimestruct* dts):             # <<<<<<<<<<<<<<
 *     cdef int result
 *     cdef char *tmp
 */

  /* function exit code */
  __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("datetime._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;
}

/* "datetime.pxd":139
 *         raise ValueError('Unable to parse %s' % str(val))
 * 
 * cdef inline int _cstring_to_dts(char *val, int length,             # <<<<<<<<<<<<<<
 *                                 pandas_datetimestruct* dts):
 *     cdef:
 */

static CYTHON_INLINE int __pyx_f_8datetime__cstring_to_dts(char *__pyx_v_val, int __pyx_v_length, 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;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_cstring_to_dts", 0);

  /* "datetime.pxd":146
 *         int result
 * 
 *     result = parse_iso_8601_datetime(val, length, PANDAS_FR_ns,             # <<<<<<<<<<<<<<
 *                                      NPY_UNSAFE_CASTING,
 *                                      dts, &islocal, &out_bestunit, &special)
 */
  __pyx_v_result = parse_iso_8601_datetime(__pyx_v_val, __pyx_v_length, PANDAS_FR_ns, NPY_UNSAFE_CASTING, __pyx_v_dts, (&__pyx_v_islocal), (&__pyx_v_out_bestunit), (&__pyx_v_special));

  /* "datetime.pxd":149
 *                                      NPY_UNSAFE_CASTING,
 *                                      dts, &islocal, &out_bestunit, &special)
 *     return result             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = __pyx_v_result;
  goto __pyx_L0;

  /* "datetime.pxd":139
 *         raise ValueError('Unable to parse %s' % str(val))
 * 
 * cdef inline int _cstring_to_dts(char *val, int length,             # <<<<<<<<<<<<<<
 *                                 pandas_datetimestruct* dts):
 *     cdef:
 */

  /* function exit code */
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "datetime.pxd":152
 * 
 * 
 * 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_8datetime__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", 0);

  /* "datetime.pxd":154
 * 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));

  /* "datetime.pxd":155
 *     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_8datetime__dts_to_pydatetime((&__pyx_v_dts)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 155; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "datetime.pxd":152
 * 
 * 
 * cdef inline object _datetime64_to_datetime(int64_t val):             # <<<<<<<<<<<<<<
 *     cdef pandas_datetimestruct dts
 *     pandas_datetime_to_datetimestruct(val, PANDAS_FR_ns, &dts)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("datetime._datetime64_to_datetime", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "datetime.pxd":157
 *     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_8datetime__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", 0);

  /* "datetime.pxd":158
 * 
 * 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);

  /* "datetime.pxd":160
 *     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[4]; __pyx_lineno = 158; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);

  /* "datetime.pxd":158
 * 
 * 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_INCREF(((PyObject *)__pyx_t_1));
  __pyx_r = __pyx_t_1;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "datetime.pxd":157
 *     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,
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("datetime._dts_to_pydatetime", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "datetime.pxd":162
 *                                                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_8datetime__pydatetime_to_dts(PyObject *__pyx_v_val, pandas_datetimestruct *__pyx_v_dts) {
  __pyx_t_5numpy_int64_t __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_pydatetime_to_dts", 0);

  /* "datetime.pxd":163
 * 
 * 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[4]; __pyx_lineno = 163; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_dts->year = PyDateTime_GET_YEAR(((PyDateTime_Date *)__pyx_v_val));

  /* "datetime.pxd":164
 * 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[4]; __pyx_lineno = 164; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_dts->month = PyDateTime_GET_MONTH(((PyDateTime_Date *)__pyx_v_val));

  /* "datetime.pxd":165
 *     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[4]; __pyx_lineno = 165; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_dts->day = PyDateTime_GET_DAY(((PyDateTime_Date *)__pyx_v_val));

  /* "datetime.pxd":166
 *     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);

  /* "datetime.pxd":167
 *     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);

  /* "datetime.pxd":168
 *     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);

  /* "datetime.pxd":169
 *     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);

  /* "datetime.pxd":170
 *     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;

  /* "datetime.pxd":171
 *     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;

  /* "datetime.pxd":162
 *                                                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)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_WriteUnraisable("datetime._pydatetime_to_dts", __pyx_clineno, __pyx_lineno, __pyx_filename, 0);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "datetime.pxd":173
 *     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_8datetime__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", 0);

  /* "datetime.pxd":175
 * 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 = __Pyx_PyObject_GetAttrStr(__pyx_v_val, __pyx_n_s_year); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 175; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyInt_As_npy_int64(__pyx_t_1); if (unlikely((__pyx_t_2 == (npy_int64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 175; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_dts->year = __pyx_t_2;

  /* "datetime.pxd":176
 *                                           pandas_datetimestruct *dts):
 *     dts.year = val.year
 *     dts.month = val.month             # <<<<<<<<<<<<<<
 *     dts.day = val.day
 *     dts.hour = val.hour
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_val, __pyx_n_s_month); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 176; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_PyInt_As_npy_int32(__pyx_t_1); if (unlikely((__pyx_t_3 == (npy_int32)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 176; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_dts->month = __pyx_t_3;

  /* "datetime.pxd":177
 *     dts.year = val.year
 *     dts.month = val.month
 *     dts.day = val.day             # <<<<<<<<<<<<<<
 *     dts.hour = val.hour
 *     dts.min = val.minute
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_val, __pyx_n_s_day); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 177; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_PyInt_As_npy_int32(__pyx_t_1); if (unlikely((__pyx_t_3 == (npy_int32)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 177; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_dts->day = __pyx_t_3;

  /* "datetime.pxd":178
 *     dts.month = val.month
 *     dts.day = val.day
 *     dts.hour = val.hour             # <<<<<<<<<<<<<<
 *     dts.min = val.minute
 *     dts.sec = val.second
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_val, __pyx_n_s_hour); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 178; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_PyInt_As_npy_int32(__pyx_t_1); if (unlikely((__pyx_t_3 == (npy_int32)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 178; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_dts->hour = __pyx_t_3;

  /* "datetime.pxd":179
 *     dts.day = val.day
 *     dts.hour = val.hour
 *     dts.min = val.minute             # <<<<<<<<<<<<<<
 *     dts.sec = val.second
 *     dts.us = val.microsecond
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_val, __pyx_n_s_minute); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 179; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_PyInt_As_npy_int32(__pyx_t_1); if (unlikely((__pyx_t_3 == (npy_int32)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 179; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_dts->min = __pyx_t_3;

  /* "datetime.pxd":180
 *     dts.hour = val.hour
 *     dts.min = val.minute
 *     dts.sec = val.second             # <<<<<<<<<<<<<<
 *     dts.us = val.microsecond
 *     dts.ps = dts.as = 0
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_val, __pyx_n_s_second); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 180; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_PyInt_As_npy_int32(__pyx_t_1); if (unlikely((__pyx_t_3 == (npy_int32)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 180; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_dts->sec = __pyx_t_3;

  /* "datetime.pxd":181
 *     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 = __Pyx_PyObject_GetAttrStr(__pyx_v_val, __pyx_n_s_microsecond); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 181; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_PyInt_As_npy_int32(__pyx_t_1); if (unlikely((__pyx_t_3 == (npy_int32)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 181; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_dts->us = __pyx_t_3;

  /* "datetime.pxd":182
 *     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;

  /* "datetime.pxd":183
 *     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;

  /* "datetime.pxd":173
 *     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
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_WriteUnraisable("datetime._dtlike_to_datetime64", __pyx_clineno, __pyx_lineno, __pyx_filename, 0);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "datetime.pxd":185
 *     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_8datetime__date_to_datetime64(PyObject *__pyx_v_val, pandas_datetimestruct *__pyx_v_dts) {
  __pyx_t_5numpy_int64_t __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_date_to_datetime64", 0);

  /* "datetime.pxd":187
 * 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[4]; __pyx_lineno = 187; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_dts->year = PyDateTime_GET_YEAR(((PyDateTime_Date *)__pyx_v_val));

  /* "datetime.pxd":188
 *                                         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[4]; __pyx_lineno = 188; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_dts->month = PyDateTime_GET_MONTH(((PyDateTime_Date *)__pyx_v_val));

  /* "datetime.pxd":189
 *     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[4]; __pyx_lineno = 189; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_dts->day = PyDateTime_GET_DAY(((PyDateTime_Date *)__pyx_v_val));

  /* "datetime.pxd":190
 *     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;

  /* "datetime.pxd":191
 *     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;

  /* "datetime.pxd":192
 *     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;

  /* "datetime.pxd":185
 *     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)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_WriteUnraisable("datetime._date_to_datetime64", __pyx_clineno, __pyx_lineno, __pyx_filename, 0);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "numpy.pxd":196
 *         # 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.
 */

/* Python wrapper */
static CYTHON_UNUSED int __pyx_pw_5numpy_7ndarray_1__getbuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/
static CYTHON_UNUSED int __pyx_pw_5numpy_7ndarray_1__getbuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__getbuffer__ (wrapper)", 0);
  __pyx_r = __pyx_pf_5numpy_7ndarray___getbuffer__(((PyArrayObject *)__pyx_v_self), ((Py_buffer *)__pyx_v_info), ((int)__pyx_v_flags));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__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__", 0);
  if (__pyx_v_info != NULL) {
    __pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None);
    __Pyx_GIVEREF(__pyx_v_info->obj);
  }

  /* "numpy.pxd":202
 *             # of flags
 * 
 *             if info == NULL: return             # <<<<<<<<<<<<<<
 * 
 *             cdef int copy_shape, i, ndim
 */
  __pyx_t_1 = ((__pyx_v_info == NULL) != 0);
  if (__pyx_t_1) {
    __pyx_r = 0;
    goto __pyx_L0;
  }

  /* "numpy.pxd":205
 * 
 *             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":206
 *             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":208
 *             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(__pyx_v_self);

  /* "numpy.pxd":210
 *             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))) != 0);
  if (__pyx_t_1) {

    /* "numpy.pxd":211
 * 
 *             if sizeof(npy_intp) != sizeof(Py_ssize_t):
 *                 copy_shape = 1             # <<<<<<<<<<<<<<
 *             else:
 *                 copy_shape = 0
 */
    __pyx_v_copy_shape = 1;
    goto __pyx_L4;
  }
  /*else*/ {

    /* "numpy.pxd":213
 *                 copy_shape = 1
 *             else:
 *                 copy_shape = 0             # <<<<<<<<<<<<<<
 * 
 *             if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS)
 */
    __pyx_v_copy_shape = 0;
  }
  __pyx_L4:;

  /* "numpy.pxd":215
 *                 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) != 0);
  if (__pyx_t_1) {

    /* "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")
 * 
 */
    __pyx_t_2 = ((!(PyArray_CHKFLAGS(__pyx_v_self, NPY_C_CONTIGUOUS) != 0)) != 0);
    __pyx_t_3 = __pyx_t_2;
  } else {
    __pyx_t_3 = __pyx_t_1;
  }
  if (__pyx_t_3) {

    /* "numpy.pxd":217
 *             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 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__214, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 217; __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[5]; __pyx_lineno = 217; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }

  /* "numpy.pxd":219
 *                 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) != 0);
  if (__pyx_t_3) {

    /* "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")
 * 
 */
    __pyx_t_1 = ((!(PyArray_CHKFLAGS(__pyx_v_self, NPY_F_CONTIGUOUS) != 0)) != 0);
    __pyx_t_2 = __pyx_t_1;
  } else {
    __pyx_t_2 = __pyx_t_3;
  }
  if (__pyx_t_2) {

    /* "numpy.pxd":221
 *             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 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__215, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 221; __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[5]; __pyx_lineno = 221; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }

  /* "numpy.pxd":223
 *                 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(__pyx_v_self);

  /* "numpy.pxd":224
 * 
 *             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":225
 *             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.
 */
  __pyx_t_2 = (__pyx_v_copy_shape != 0);
  if (__pyx_t_2) {

    /* "numpy.pxd":228
 *                 # 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":229
 *                 # 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":230
 *                 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":231
 *                 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(__pyx_v_self)[__pyx_v_i]);

      /* "numpy.pxd":232
 *                 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(__pyx_v_self)[__pyx_v_i]);
    }
    goto __pyx_L7;
  }
  /*else*/ {

    /* "numpy.pxd":234
 *                     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(__pyx_v_self));

    /* "numpy.pxd":235
 *             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(__pyx_v_self));
  }
  __pyx_L7:;

  /* "numpy.pxd":236
 *                 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":237
 *                 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(__pyx_v_self);

  /* "numpy.pxd":238
 *             info.suboffsets = NULL
 *             info.itemsize = PyArray_ITEMSIZE(self)
 *             info.readonly = not PyArray_ISWRITEABLE(self)             # <<<<<<<<<<<<<<
 * 
 *             cdef int t
 */
  __pyx_v_info->readonly = (!(PyArray_ISWRITEABLE(__pyx_v_self) != 0));

  /* "numpy.pxd":241
 * 
 *             cdef int t
 *             cdef char* f = NULL             # <<<<<<<<<<<<<<
 *             cdef dtype descr = self.descr
 *             cdef list stack
 */
  __pyx_v_f = NULL;

  /* "numpy.pxd":242
 *             cdef int t
 *             cdef char* f = NULL
 *             cdef dtype descr = self.descr             # <<<<<<<<<<<<<<
 *             cdef list stack
 *             cdef int offset
 */
  __pyx_t_4 = ((PyObject *)__pyx_v_self->descr);
  __Pyx_INCREF(__pyx_t_4);
  __pyx_v_descr = ((PyArray_Descr *)__pyx_t_4);
  __pyx_t_4 = 0;

  /* "numpy.pxd":246
 *             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":248
 *             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 != 0)) != 0);
  if (__pyx_t_2) {
    __pyx_t_3 = ((!(__pyx_v_copy_shape != 0)) != 0);
    __pyx_t_1 = __pyx_t_3;
  } else {
    __pyx_t_1 = __pyx_t_2;
  }
  if (__pyx_t_1) {

    /* "numpy.pxd":250
 *             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_L10;
  }
  /*else*/ {

    /* "numpy.pxd":253
 *             else:
 *                 # need to call releasebuffer
 *                 info.obj = self             # <<<<<<<<<<<<<<
 * 
 *             if not hasfields:
 */
    __Pyx_INCREF(((PyObject *)__pyx_v_self));
    __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
    __Pyx_GOTREF(__pyx_v_info->obj);
    __Pyx_DECREF(__pyx_v_info->obj);
    __pyx_v_info->obj = ((PyObject *)__pyx_v_self);
  }
  __pyx_L10:;

  /* "numpy.pxd":255
 *                 info.obj = self
 * 
 *             if not hasfields:             # <<<<<<<<<<<<<<
 *                 t = descr.type_num
 *                 if ((descr.byteorder == '>' and little_endian) or
 */
  __pyx_t_1 = ((!(__pyx_v_hasfields != 0)) != 0);
  if (__pyx_t_1) {

    /* "numpy.pxd":256
 * 
 *             if not hasfields:
 *                 t = descr.type_num             # <<<<<<<<<<<<<<
 *                 if ((descr.byteorder == '>' and little_endian) or
 *                     (descr.byteorder == '<' and not little_endian)):
 */
    __pyx_t_5 = __pyx_v_descr->type_num;
    __pyx_v_t = __pyx_t_5;

    /* "numpy.pxd":257
 *             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 == '>') != 0);
    if (__pyx_t_1) {
      __pyx_t_2 = (__pyx_v_little_endian != 0);
    } else {
      __pyx_t_2 = __pyx_t_1;
    }
    if (!__pyx_t_2) {

      /* "numpy.pxd":258
 *                 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 == '<') != 0);
      if (__pyx_t_1) {
        __pyx_t_3 = ((!(__pyx_v_little_endian != 0)) != 0);
        __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":259
 *                 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 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__216, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 259; __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[5]; __pyx_lineno = 259; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }

    /* "numpy.pxd":276
 *                 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)
 */
    switch (__pyx_v_t) {

      /* "numpy.pxd":260
 *                     (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"
 */
      case NPY_BYTE:
      __pyx_v_f = __pyx_k_b;
      break;

      /* "numpy.pxd":261
 *                     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"
 */
      case NPY_UBYTE:
      __pyx_v_f = __pyx_k_B;
      break;

      /* "numpy.pxd":262
 *                 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"
 */
      case NPY_SHORT:
      __pyx_v_f = __pyx_k_h;
      break;

      /* "numpy.pxd":263
 *                 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"
 */
      case NPY_USHORT:
      __pyx_v_f = __pyx_k_H;
      break;

      /* "numpy.pxd":264
 *                 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"
 */
      case NPY_INT:
      __pyx_v_f = __pyx_k_i;
      break;

      /* "numpy.pxd":265
 *                 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"
 */
      case NPY_UINT:
      __pyx_v_f = __pyx_k_I;
      break;

      /* "numpy.pxd":266
 *                 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"
 */
      case NPY_LONG:
      __pyx_v_f = __pyx_k_l;
      break;

      /* "numpy.pxd":267
 *                 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"
 */
      case NPY_ULONG:
      __pyx_v_f = __pyx_k_L;
      break;

      /* "numpy.pxd":268
 *                 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"
 */
      case NPY_LONGLONG:
      __pyx_v_f = __pyx_k_q;
      break;

      /* "numpy.pxd":269
 *                 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"
 */
      case NPY_ULONGLONG:
      __pyx_v_f = __pyx_k_Q;
      break;

      /* "numpy.pxd":270
 *                 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"
 */
      case NPY_FLOAT:
      __pyx_v_f = __pyx_k_f;
      break;

      /* "numpy.pxd":271
 *                 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"
 */
      case NPY_DOUBLE:
      __pyx_v_f = __pyx_k_d;
      break;

      /* "numpy.pxd":272
 *                 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"
 */
      case NPY_LONGDOUBLE:
      __pyx_v_f = __pyx_k_g;
      break;

      /* "numpy.pxd":273
 *                 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"
 */
      case NPY_CFLOAT:
      __pyx_v_f = __pyx_k_Zf;
      break;

      /* "numpy.pxd":274
 *                 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"
 */
      case NPY_CDOUBLE:
      __pyx_v_f = __pyx_k_Zd;
      break;

      /* "numpy.pxd":275
 *                 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:
 */
      case NPY_CLONGDOUBLE:
      __pyx_v_f = __pyx_k_Zg;
      break;

      /* "numpy.pxd":276
 *                 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)
 */
      case NPY_OBJECT:
      __pyx_v_f = __pyx_k_O;
      break;
      default:

      /* "numpy.pxd":278
 *                 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 = __Pyx_PyInt_From_int(__pyx_v_t); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 278; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_8 = PyUnicode_Format(__pyx_kp_u_unknown_dtype_code_in_numpy_pxd, __pyx_t_4); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 278; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__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[5]; __pyx_lineno = 278; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_8);
      __Pyx_GIVEREF(__pyx_t_8);
      __pyx_t_8 = 0;
      __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 278; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_DECREF(__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[5]; __pyx_lineno = 278; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      break;
    }

    /* "numpy.pxd":279
 *                 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":280
 *                     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;
  }
  /*else*/ {

    /* "numpy.pxd":282
 *                 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":283
 *             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":284
 *                 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":285
 *                 info.format[0] = '^' # Native data types, manual alignment
 *                 offset = 0
 *                 f = _util_dtypestring(descr, info.format + 1,             # <<<<<<<<<<<<<<
 *                                       info.format + _buffer_format_string_len,
 *                                       &offset)
 */
    __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[5]; __pyx_lineno = 285; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_v_f = __pyx_t_9;

    /* "numpy.pxd":288
 *                                       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;
  }

  /* "numpy.pxd":196
 *         # 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.
 */

  /* function exit code */
  __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":290
 *                 f[0] = 0 # Terminate format string
 * 
 *         def __releasebuffer__(ndarray self, Py_buffer* info):             # <<<<<<<<<<<<<<
 *             if PyArray_HASFIELDS(self):
 *                 stdlib.free(info.format)
 */

/* Python wrapper */
static CYTHON_UNUSED void __pyx_pw_5numpy_7ndarray_3__releasebuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info); /*proto*/
static CYTHON_UNUSED void __pyx_pw_5numpy_7ndarray_3__releasebuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__releasebuffer__ (wrapper)", 0);
  __pyx_pf_5numpy_7ndarray_2__releasebuffer__(((PyArrayObject *)__pyx_v_self), ((Py_buffer *)__pyx_v_info));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
}

static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info) {
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  __Pyx_RefNannySetupContext("__releasebuffer__", 0);

  /* "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):
 */
  __pyx_t_1 = (PyArray_HASFIELDS(__pyx_v_self) != 0);
  if (__pyx_t_1) {

    /* "numpy.pxd":292
 *         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_L3;
  }
  __pyx_L3:;

  /* "numpy.pxd":293
 *             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))) != 0);
  if (__pyx_t_1) {

    /* "numpy.pxd":294
 *                 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_L4;
  }
  __pyx_L4:;

  /* "numpy.pxd":290
 *                 f[0] = 0 # Terminate format string
 * 
 *         def __releasebuffer__(ndarray self, Py_buffer* info):             # <<<<<<<<<<<<<<
 *             if PyArray_HASFIELDS(self):
 *                 stdlib.free(info.format)
 */

  /* function exit code */
  __Pyx_RefNannyFinishContext();
}

/* "numpy.pxd":772
 * 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", 0);

  /* "numpy.pxd":773
 * 
 * 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[5]; __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;

  /* "numpy.pxd":772
 * ctypedef npy_cdouble     complex_t
 * 
 * cdef inline object PyArray_MultiIterNew1(a):             # <<<<<<<<<<<<<<
 *     return PyArray_MultiIterNew(1, <void*>a)
 * 
 */

  /* function exit code */
  __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":775
 *     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", 0);

  /* "numpy.pxd":776
 * 
 * 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[5]; __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;

  /* "numpy.pxd":775
 *     return PyArray_MultiIterNew(1, <void*>a)
 * 
 * cdef inline object PyArray_MultiIterNew2(a, b):             # <<<<<<<<<<<<<<
 *     return PyArray_MultiIterNew(2, <void*>a, <void*>b)
 * 
 */

  /* function exit code */
  __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":778
 *     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", 0);

  /* "numpy.pxd":779
 * 
 * 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[5]; __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;

  /* "numpy.pxd":778
 *     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)
 * 
 */

  /* function exit code */
  __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":781
 *     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", 0);

  /* "numpy.pxd":782
 * 
 * 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[5]; __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;

  /* "numpy.pxd":781
 *     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)
 * 
 */

  /* function exit code */
  __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":784
 *     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", 0);

  /* "numpy.pxd":785
 * 
 * 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[5]; __pyx_lineno = 785; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "numpy.pxd":784
 *     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)
 * 
 */

  /* function exit code */
  __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":787
 *     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", 0);

  /* "numpy.pxd":794
 *     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":795
 *     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":798
 *     cdef tuple fields
 * 
 *     for childname in descr.names:             # <<<<<<<<<<<<<<
 *         fields = descr.fields[childname]
 *         child, new_offset = fields
 */
  if (unlikely(__pyx_v_descr->names == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
    {__pyx_filename = __pyx_f[5]; __pyx_lineno = 798; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_1 = __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;
    #if CYTHON_COMPILING_IN_CPYTHON
    __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_3); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 798; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    #else
    __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 798; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    #endif
    __Pyx_XDECREF_SET(__pyx_v_childname, __pyx_t_3);
    __pyx_t_3 = 0;

    /* "numpy.pxd":799
 * 
 *     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 (unlikely(__pyx_t_3 == NULL)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 799; __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 %.16s, got %.200s", "tuple", Py_TYPE(__pyx_t_3)->tp_name), 0))) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 799; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_XDECREF_SET(__pyx_v_fields, ((PyObject*)__pyx_t_3));
    __pyx_t_3 = 0;

    /* "numpy.pxd":800
 *     for childname in descr.names:
 *         fields = descr.fields[childname]
 *         child, new_offset = fields             # <<<<<<<<<<<<<<
 * 
 *         if (end - f) - (new_offset - offset[0]) < 15:
 */
    if (likely(__pyx_v_fields != Py_None)) {
      PyObject* sequence = __pyx_v_fields;
      #if CYTHON_COMPILING_IN_CPYTHON
      Py_ssize_t size = Py_SIZE(sequence);
      #else
      Py_ssize_t size = PySequence_Size(sequence);
      #endif
      if (unlikely(size != 2)) {
        if (size > 2) __Pyx_RaiseTooManyValuesError(2);
        else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
        {__pyx_filename = __pyx_f[5]; __pyx_lineno = 800; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      #if CYTHON_COMPILING_IN_CPYTHON
      __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_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 800; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 800; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      #endif
    } else {
      __Pyx_RaiseNoneNotIterableError(); {__pyx_filename = __pyx_f[5]; __pyx_lineno = 800; __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[5]; __pyx_lineno = 800; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_XDECREF_SET(__pyx_v_child, ((PyArray_Descr *)__pyx_t_3));
    __pyx_t_3 = 0;
    __Pyx_XDECREF_SET(__pyx_v_new_offset, __pyx_t_4);
    __pyx_t_4 = 0;

    /* "numpy.pxd":802
 *         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 = __Pyx_PyInt_From_ptrdiff_t((__pyx_v_end - __pyx_v_f)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 802; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_3 = __Pyx_PyInt_From_int((__pyx_v_offset[0])); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 802; __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[5]; __pyx_lineno = 802; __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[5]; __pyx_lineno = 802; __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); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 802; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __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[5]; __pyx_lineno = 802; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (__pyx_t_6) {

      /* "numpy.pxd":803
 * 
 *         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 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__217, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 803; __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 = 803; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }

    /* "numpy.pxd":805
 *             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 == '>') != 0);
    if (__pyx_t_6) {
      __pyx_t_7 = (__pyx_v_little_endian != 0);
    } else {
      __pyx_t_7 = __pyx_t_6;
    }
    if (!__pyx_t_7) {

      /* "numpy.pxd":806
 * 
 *         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 == '<') != 0);
      if (__pyx_t_6) {
        __pyx_t_8 = ((!(__pyx_v_little_endian != 0)) != 0);
        __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":807
 *         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 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__218, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 807; __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 = 807; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }

    /* "numpy.pxd":817
 * 
 *         # Output padding bytes
 *         while offset[0] < new_offset:             # <<<<<<<<<<<<<<
 *             f[0] = 120 # "x"; pad byte
 *             f += 1
 */
    while (1) {
      __pyx_t_5 = __Pyx_PyInt_From_int((__pyx_v_offset[0])); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 817; __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); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 817; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __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[5]; __pyx_lineno = 817; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (!__pyx_t_6) break;

      /* "numpy.pxd":818
 *         # 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":819
 *         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":820
 *             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":822
 *             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":824
 *         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) != 0)) != 0);
    if (__pyx_t_6) {

      /* "numpy.pxd":825
 * 
 *         if not PyDataType_HASFIELDS(child):
 *             t = child.type_num             # <<<<<<<<<<<<<<
 *             if end - f < 5:
 *                 raise RuntimeError(u"Format string allocated too short.")
 */
      __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_child->type_num); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 825; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_XDECREF_SET(__pyx_v_t, __pyx_t_3);
      __pyx_t_3 = 0;

      /* "numpy.pxd":826
 *         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) != 0);
      if (__pyx_t_6) {

        /* "numpy.pxd":827
 *             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 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__219, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 827; __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[5]; __pyx_lineno = 827; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }

      /* "numpy.pxd":830
 * 
 *             # 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[5]; __pyx_lineno = 830; __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); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 830; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __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[5]; __pyx_lineno = 830; __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":831
 *             # 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[5]; __pyx_lineno = 831; __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); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 831; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __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[5]; __pyx_lineno = 831; __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":832
 *             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[5]; __pyx_lineno = 832; __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); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 832; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __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[5]; __pyx_lineno = 832; __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":833
 *             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[5]; __pyx_lineno = 833; __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); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 833; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __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[5]; __pyx_lineno = 833; __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":834
 *             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[5]; __pyx_lineno = 834; __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); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 834; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __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[5]; __pyx_lineno = 834; __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":835
 *             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[5]; __pyx_lineno = 835; __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); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 835; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __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[5]; __pyx_lineno = 835; __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":836
 *             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[5]; __pyx_lineno = 836; __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); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 836; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __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[5]; __pyx_lineno = 836; __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":837
 *             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[5]; __pyx_lineno = 837; __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); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 837; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __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[5]; __pyx_lineno = 837; __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":838
 *             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[5]; __pyx_lineno = 838; __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); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 838; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __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[5]; __pyx_lineno = 838; __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":839
 *             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[5]; __pyx_lineno = 839; __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); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 839; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __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[5]; __pyx_lineno = 839; __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":840
 *             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[5]; __pyx_lineno = 840; __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); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 840; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __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[5]; __pyx_lineno = 840; __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":841
 *             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[5]; __pyx_lineno = 841; __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); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 841; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __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[5]; __pyx_lineno = 841; __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":842
 *             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[5]; __pyx_lineno = 842; __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); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 842; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __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[5]; __pyx_lineno = 842; __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":843
 *             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[5]; __pyx_lineno = 843; __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); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 843; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __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[5]; __pyx_lineno = 843; __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":844
 *             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[5]; __pyx_lineno = 844; __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); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 844; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __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[5]; __pyx_lineno = 844; __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":845
 *             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[5]; __pyx_lineno = 845; __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); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 845; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __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[5]; __pyx_lineno = 845; __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":846
 *             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[5]; __pyx_lineno = 846; __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); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 846; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __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[5]; __pyx_lineno = 846; __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":848
 *             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 = PyUnicode_Format(__pyx_kp_u_unknown_dtype_code_in_numpy_pxd, __pyx_v_t); 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_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 848; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__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 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_3, NULL); 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_DECREF(__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[5]; __pyx_lineno = 848; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_L11:;

      /* "numpy.pxd":849
 *             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":853
 *             # 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[5]; __pyx_lineno = 853; __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":854
 *             # so don't output it
 *             f = _util_dtypestring(child, f, end, offset)
 *     return f             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = __pyx_v_f;
  goto __pyx_L0;

  /* "numpy.pxd":787
 *     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.
 */

  /* function exit code */
  __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":970
 * 
 * 
 * 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;
  int __pyx_t_2;
  __Pyx_RefNannySetupContext("set_array_base", 0);

  /* "numpy.pxd":972
 * 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);
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (__pyx_t_2) {

    /* "numpy.pxd":973
 *      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":975
 *          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":976
 *      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":977
 *          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":978
 *          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;

  /* "numpy.pxd":970
 * 
 * 
 * cdef inline void set_array_base(ndarray arr, object base):             # <<<<<<<<<<<<<<
 *      cdef PyObject* baseptr
 *      if base is None:
 */

  /* function exit code */
  __Pyx_RefNannyFinishContext();
}

/* "numpy.pxd":980
 *      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", 0);

  /* "numpy.pxd":981
 * 
 * cdef inline object get_array_base(ndarray arr):
 *     if arr.base is NULL:             # <<<<<<<<<<<<<<
 *         return None
 *     else:
 */
  __pyx_t_1 = ((__pyx_v_arr->base == NULL) != 0);
  if (__pyx_t_1) {

    /* "numpy.pxd":982
 * 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;
  }
  /*else*/ {

    /* "numpy.pxd":984
 *         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;
  }

  /* "numpy.pxd":980
 *      arr.base = baseptr
 * 
 * cdef inline object get_array_base(ndarray arr):             # <<<<<<<<<<<<<<
 *     if arr.base is NULL:
 *         return None
 */

  /* function exit code */
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "util.pxd":26
 *     object sarr_from_data(cnp.dtype, int length, void* data)
 * 
 * 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;
  Py_ssize_t __pyx_t_3;
  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_at", 0);
  __Pyx_INCREF(__pyx_v_loc);

  /* "util.pxd":30
 *         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) != 0);
  if (__pyx_t_1) {

    /* "util.pxd":31
 *         void* data_ptr
 *     if is_float_object(loc):
 *         casted = int(loc)             # <<<<<<<<<<<<<<
 *         if casted == loc:
 *             loc = casted
 */
    __pyx_t_2 = PyNumber_Int(__pyx_v_loc); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 31; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_v_casted = __pyx_t_2;
    __pyx_t_2 = 0;

    /* "util.pxd":32
 *     if is_float_object(loc):
 *         casted = int(loc)
 *         if casted == loc:             # <<<<<<<<<<<<<<
 *             loc = casted
 *     i = <Py_ssize_t> loc
 */
    __pyx_t_2 = PyObject_RichCompare(__pyx_v_casted, __pyx_v_loc, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 32; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 32; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (__pyx_t_1) {

      /* "util.pxd":33
 *         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_SET(__pyx_v_loc, __pyx_v_casted);
      goto __pyx_L4;
    }
    __pyx_L4:;
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "util.pxd":34
 *         if casted == loc:
 *             loc = casted
 *     i = <Py_ssize_t> loc             # <<<<<<<<<<<<<<
 *     sz = cnp.PyArray_SIZE(arr)
 * 
 */
  __pyx_t_3 = __Pyx_PyIndex_AsSsize_t(__pyx_v_loc); if (unlikely((__pyx_t_3 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 34; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_i = ((Py_ssize_t)__pyx_t_3);

  /* "util.pxd":35
 *             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":37
 *     sz = cnp.PyArray_SIZE(arr)
 * 
 *     if i < 0 and sz > 0:             # <<<<<<<<<<<<<<
 *         i += sz
 *     elif i >= sz or sz == 0:
 */
  __pyx_t_1 = ((__pyx_v_i < 0) != 0);
  if (__pyx_t_1) {
    __pyx_t_4 = ((__pyx_v_sz > 0) != 0);
    __pyx_t_5 = __pyx_t_4;
  } else {
    __pyx_t_5 = __pyx_t_1;
  }
  if (__pyx_t_5) {

    /* "util.pxd":38
 * 
 *     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":39
 *     if i < 0 and sz > 0:
 *         i += sz
 *     elif i >= sz or sz == 0:             # <<<<<<<<<<<<<<
 *         raise IndexError('index out of bounds')
 * 
 */
  __pyx_t_5 = ((__pyx_v_i >= __pyx_v_sz) != 0);
  if (!__pyx_t_5) {
    __pyx_t_1 = ((__pyx_v_sz == 0) != 0);
    __pyx_t_4 = __pyx_t_1;
  } else {
    __pyx_t_4 = __pyx_t_5;
  }
  if (__pyx_t_4) {

    /* "util.pxd":40
 *         i += sz
 *     elif i >= sz or sz == 0:
 *         raise IndexError('index out of bounds')             # <<<<<<<<<<<<<<
 * 
 *     return get_value_1d(arr, i)
 */
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_IndexError, __pyx_tuple__220, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 40; __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[6]; __pyx_lineno = 40; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_L5:;

  /* "util.pxd":42
 *         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_2 = get_value_1d(__pyx_v_arr, __pyx_v_i); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 42; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "util.pxd":26
 *     object sarr_from_data(cnp.dtype, int length, void* data)
 * 
 * cdef inline object get_value_at(ndarray arr, object loc):             # <<<<<<<<<<<<<<
 *     cdef:
 *         Py_ssize_t i, sz
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __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":44
 *     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;
  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("set_value_at", 0);
  __Pyx_INCREF(__pyx_v_loc);

  /* "util.pxd":47
 *     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) != 0);
  if (__pyx_t_1) {

    /* "util.pxd":48
 *         Py_ssize_t i, sz
 *     if is_float_object(loc):
 *         casted = int(loc)             # <<<<<<<<<<<<<<
 *         if casted == loc:
 *             loc = casted
 */
    __pyx_t_2 = PyNumber_Int(__pyx_v_loc); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 48; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_v_casted = __pyx_t_2;
    __pyx_t_2 = 0;

    /* "util.pxd":49
 *     if is_float_object(loc):
 *         casted = int(loc)
 *         if casted == loc:             # <<<<<<<<<<<<<<
 *             loc = casted
 *     i = <Py_ssize_t> loc
 */
    __pyx_t_2 = PyObject_RichCompare(__pyx_v_casted, __pyx_v_loc, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 49; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 49; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (__pyx_t_1) {

      /* "util.pxd":50
 *         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_SET(__pyx_v_loc, __pyx_v_casted);
      goto __pyx_L4;
    }
    __pyx_L4:;
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "util.pxd":51
 *         if casted == loc:
 *             loc = casted
 *     i = <Py_ssize_t> loc             # <<<<<<<<<<<<<<
 *     sz = cnp.PyArray_SIZE(arr)
 * 
 */
  __pyx_t_3 = __Pyx_PyIndex_AsSsize_t(__pyx_v_loc); if (unlikely((__pyx_t_3 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_i = ((Py_ssize_t)__pyx_t_3);

  /* "util.pxd":52
 *             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":54
 *     sz = cnp.PyArray_SIZE(arr)
 * 
 *     if i < 0:             # <<<<<<<<<<<<<<
 *         i += sz
 *     elif i >= sz:
 */
  __pyx_t_1 = ((__pyx_v_i < 0) != 0);
  if (__pyx_t_1) {

    /* "util.pxd":55
 * 
 *     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":56
 *     if i < 0:
 *         i += sz
 *     elif i >= sz:             # <<<<<<<<<<<<<<
 *         raise IndexError('index out of bounds')
 * 
 */
  __pyx_t_1 = ((__pyx_v_i >= __pyx_v_sz) != 0);
  if (__pyx_t_1) {

    /* "util.pxd":57
 *         i += sz
 *     elif i >= sz:
 *         raise IndexError('index out of bounds')             # <<<<<<<<<<<<<<
 * 
 *     assign_value_1d(arr, i, value)
 */
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_IndexError, __pyx_tuple__221, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 57; __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[6]; __pyx_lineno = 57; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_L5:;

  /* "util.pxd":59
 *         raise IndexError('index out of bounds')
 * 
 *     assign_value_1d(arr, i, value)             # <<<<<<<<<<<<<<
 * 
 * cdef inline int is_contiguous(ndarray arr):
 */
  __pyx_t_4 = assign_value_1d(__pyx_v_arr, __pyx_v_i, __pyx_v_value); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 59; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "util.pxd":44
 *     return get_value_1d(arr, i)
 * 
 * cdef inline set_value_at(ndarray arr, object loc, object value):             # <<<<<<<<<<<<<<
 *     cdef:
 *         Py_ssize_t i, sz
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __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":61
 *     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", 0);

  /* "util.pxd":62
 * 
 * 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;

  /* "util.pxd":61
 *     assign_value_1d(arr, i, value)
 * 
 * cdef inline int is_contiguous(ndarray arr):             # <<<<<<<<<<<<<<
 *     return cnp.PyArray_CHKFLAGS(arr, cnp.NPY_C_CONTIGUOUS)
 * 
 */

  /* function exit code */
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "util.pxd":64
 *     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", 0);

  /* "util.pxd":65
 * 
 * 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[6]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "util.pxd":64
 *     return cnp.PyArray_CHKFLAGS(arr, cnp.NPY_C_CONTIGUOUS)
 * 
 * cdef inline is_array(object o):             # <<<<<<<<<<<<<<
 *     return cnp.PyArray_Check(o)
 * 
 */

  /* function exit code */
  __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":68
 * 
 * 
 * cdef inline bint _checknull(object val):             # <<<<<<<<<<<<<<
 *     try:
 *         return val is None or (cpython.PyFloat_Check(val) and val != val)
 */

static CYTHON_INLINE int __pyx_f_4util__checknull(PyObject *__pyx_v_val) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  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;
  int __pyx_t_9;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_checknull", 0);

  /* "util.pxd":69
 * 
 * cdef inline bint _checknull(object val):
 *     try:             # <<<<<<<<<<<<<<
 *         return val is None or (cpython.PyFloat_Check(val) and val != val)
 *     except ValueError:
 */
  {
    __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:*/ {

      /* "util.pxd":70
 * cdef inline bint _checknull(object val):
 *     try:
 *         return val is None or (cpython.PyFloat_Check(val) and val != val)             # <<<<<<<<<<<<<<
 *     except ValueError:
 *         return False
 */
      __pyx_t_4 = (__pyx_v_val == Py_None);
      __pyx_t_5 = __Pyx_PyBool_FromLong(__pyx_t_4); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L3_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[6]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      if (!__pyx_t_4) {
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __pyx_t_6 = __Pyx_PyBool_FromLong(PyFloat_Check(__pyx_v_val)); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        __Pyx_GOTREF(__pyx_t_6);
        __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        if (__pyx_t_4) {
          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
          __pyx_t_7 = PyObject_RichCompare(__pyx_v_val, __pyx_v_val, Py_NE); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
          __pyx_t_8 = __pyx_t_7;
          __pyx_t_7 = 0;
        } else {
          __pyx_t_8 = __pyx_t_6;
          __pyx_t_6 = 0;
        }
        __pyx_t_6 = __pyx_t_8;
        __pyx_t_8 = 0;
      } else {
        __pyx_t_6 = __pyx_t_5;
        __pyx_t_5 = 0;
      }
      __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_r = __pyx_t_4;
      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_L3_error:;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;

    /* "util.pxd":71
 *     try:
 *         return val is None or (cpython.PyFloat_Check(val) and val != val)
 *     except ValueError:             # <<<<<<<<<<<<<<
 *         return False
 * 
 */
    __pyx_t_9 = PyErr_ExceptionMatches(__pyx_builtin_ValueError);
    if (__pyx_t_9) {
      __Pyx_AddTraceback("util._checknull", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_6, &__pyx_t_5, &__pyx_t_8) < 0) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 71; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_GOTREF(__pyx_t_8);

      /* "util.pxd":72
 *         return val is None or (cpython.PyFloat_Check(val) and val != val)
 *     except ValueError:
 *         return False             # <<<<<<<<<<<<<<
 * 
 * cdef inline bint _checknull_old(object val):
 */
      __pyx_r = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      goto __pyx_L6_except_return;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      goto __pyx_L4_exception_handled;
    }
    goto __pyx_L5_except_error;
    __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_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_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:;
  }

  /* "util.pxd":68
 * 
 * 
 * cdef inline bint _checknull(object val):             # <<<<<<<<<<<<<<
 *     try:
 *         return val is None or (cpython.PyFloat_Check(val) and val != val)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_WriteUnraisable("util._checknull", __pyx_clineno, __pyx_lineno, __pyx_filename, 0);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "util.pxd":74
 *         return False
 * 
 * cdef inline bint _checknull_old(object val):             # <<<<<<<<<<<<<<
 *     import numpy as np
 *     cdef double INF = <double> np.inf
 */

static CYTHON_INLINE int __pyx_f_4util__checknull_old(PyObject *__pyx_v_val) {
  PyObject *__pyx_v_np = NULL;
  double __pyx_v_INF;
  double __pyx_v_NEGINF;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  double __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;
  PyObject *__pyx_t_8 = NULL;
  int __pyx_t_9;
  int __pyx_t_10;
  int __pyx_t_11;
  int __pyx_t_12;
  PyObject *__pyx_t_13 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_checknull_old", 0);

  /* "util.pxd":75
 * 
 * cdef inline bint _checknull_old(object val):
 *     import numpy as np             # <<<<<<<<<<<<<<
 *     cdef double INF = <double> np.inf
 *     cdef double NEGINF = -INF
 */
  __pyx_t_1 = __Pyx_Import(__pyx_n_s_numpy, 0, -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 75; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_np = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "util.pxd":76
 * cdef inline bint _checknull_old(object val):
 *     import numpy as np
 *     cdef double INF = <double> np.inf             # <<<<<<<<<<<<<<
 *     cdef double NEGINF = -INF
 *     try:
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_np, __pyx_n_s_inf); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 76; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_2 == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 76; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_INF = ((double)__pyx_t_2);

  /* "util.pxd":77
 *     import numpy as np
 *     cdef double INF = <double> np.inf
 *     cdef double NEGINF = -INF             # <<<<<<<<<<<<<<
 *     try:
 *         return bool(val is None or val != val and val != INF
 */
  __pyx_v_NEGINF = (-__pyx_v_INF);

  /* "util.pxd":78
 *     cdef double INF = <double> np.inf
 *     cdef double NEGINF = -INF
 *     try:             # <<<<<<<<<<<<<<
 *         return bool(val is None or val != val and val != INF
 *                     and val != NEGINF)
 */
  {
    __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:*/ {

      /* "util.pxd":79
 *     cdef double NEGINF = -INF
 *     try:
 *         return bool(val is None or val != val and val != INF             # <<<<<<<<<<<<<<
 *                     and val != NEGINF)
 *     except ValueError:
 */
      __pyx_t_6 = (__pyx_v_val == Py_None);
      if (!__pyx_t_6) {
        __pyx_t_1 = PyObject_RichCompare(__pyx_v_val, __pyx_v_val, Py_NE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        if (__pyx_t_7) {

          /* "util.pxd":80
 *     try:
 *         return bool(val is None or val != val and val != INF
 *                     and val != NEGINF)             # <<<<<<<<<<<<<<
 *     except ValueError:
 *         return False
 */
          __pyx_t_1 = PyFloat_FromDouble(__pyx_v_INF); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 80; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
          __Pyx_GOTREF(__pyx_t_1);
          __pyx_t_8 = PyObject_RichCompare(__pyx_v_val, __pyx_t_1, Py_NE); __Pyx_XGOTREF(__pyx_t_8); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

          /* "util.pxd":79
 *     cdef double NEGINF = -INF
 *     try:
 *         return bool(val is None or val != val and val != INF             # <<<<<<<<<<<<<<
 *                     and val != NEGINF)
 *     except ValueError:
 */
          __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
          if (__pyx_t_9) {

            /* "util.pxd":80
 *     try:
 *         return bool(val is None or val != val and val != INF
 *                     and val != NEGINF)             # <<<<<<<<<<<<<<
 *     except ValueError:
 *         return False
 */
            __pyx_t_8 = PyFloat_FromDouble(__pyx_v_NEGINF); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 80; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
            __Pyx_GOTREF(__pyx_t_8);
            __pyx_t_1 = PyObject_RichCompare(__pyx_v_val, __pyx_t_8, Py_NE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 80; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
            __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
            __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_10 < 0)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 80; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
            __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
            __pyx_t_11 = __pyx_t_10;
          } else {
            __pyx_t_11 = __pyx_t_9;
          }
          __pyx_t_9 = __pyx_t_11;
        } else {
          __pyx_t_9 = __pyx_t_7;
        }
        __pyx_t_7 = __pyx_t_9;
      } else {
        __pyx_t_7 = __pyx_t_6;
      }

      /* "util.pxd":79
 *     cdef double NEGINF = -INF
 *     try:
 *         return bool(val is None or val != val and val != INF             # <<<<<<<<<<<<<<
 *                     and val != NEGINF)
 *     except ValueError:
 */
      __pyx_r = (!(!__pyx_t_7));
      goto __pyx_L7_try_return;
    }
    __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_L10_try_end;
    __pyx_L3_error:;
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "util.pxd":81
 *         return bool(val is None or val != val and val != INF
 *                     and val != NEGINF)
 *     except ValueError:             # <<<<<<<<<<<<<<
 *         return False
 * 
 */
    __pyx_t_12 = PyErr_ExceptionMatches(__pyx_builtin_ValueError);
    if (__pyx_t_12) {
      __Pyx_AddTraceback("util._checknull_old", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_8, &__pyx_t_13) < 0) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_GOTREF(__pyx_t_13);

      /* "util.pxd":82
 *                     and val != NEGINF)
 *     except ValueError:
 *         return False             # <<<<<<<<<<<<<<
 * 
 * cdef inline bint _checknan(object val):
 */
      __pyx_r = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
      goto __pyx_L6_except_return;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
      goto __pyx_L4_exception_handled;
    }
    goto __pyx_L5_except_error;
    __pyx_L5_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_L1_error;
    __pyx_L7_try_return:;
    __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_L0;
    __pyx_L6_except_return:;
    __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_L0;
    __pyx_L4_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_L10_try_end:;
  }

  /* "util.pxd":74
 *         return False
 * 
 * cdef inline bint _checknull_old(object val):             # <<<<<<<<<<<<<<
 *     import numpy as np
 *     cdef double INF = <double> np.inf
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_13);
  __Pyx_WriteUnraisable("util._checknull_old", __pyx_clineno, __pyx_lineno, __pyx_filename, 0);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_np);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "util.pxd":84
 *         return False
 * 
 * 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", 0);

  /* "util.pxd":85
 * 
 * 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) != 0))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 85; __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[6]; __pyx_lineno = 85; __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); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 85; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __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[6]; __pyx_lineno = 85; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_r = __pyx_t_2;
  goto __pyx_L0;

  /* "util.pxd":84
 *         return False
 * 
 * cdef inline bint _checknan(object val):             # <<<<<<<<<<<<<<
 *     return not cnp.PyArray_Check(val) and val != val
 */

  /* function exit code */
  __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, 0);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "View.MemoryView":116
 *         cdef bint dtype_is_object
 * 
 *     def __cinit__(array self, tuple shape, Py_ssize_t itemsize, format not None,             # <<<<<<<<<<<<<<
 *                   mode="c", bint allocate_buffer=True):
 * 
 */

/* Python wrapper */
static int __pyx_array___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_array___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_shape = 0;
  Py_ssize_t __pyx_v_itemsize;
  PyObject *__pyx_v_format = 0;
  PyObject *__pyx_v_mode = 0;
  int __pyx_v_allocate_buffer;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_shape,&__pyx_n_s_itemsize,&__pyx_n_s_format,&__pyx_n_s_mode,&__pyx_n_s_allocate_buffer,0};
    PyObject* values[5] = {0,0,0,0,0};
    values[3] = ((PyObject *)__pyx_n_s_c);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_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 (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_shape)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_itemsize)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, 1); {__pyx_filename = __pyx_f[7]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_format)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, 2); {__pyx_filename = __pyx_f[7]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  3:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_mode);
          if (value) { values[3] = value; kw_args--; }
        }
        case  4:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_allocate_buffer);
          if (value) { values[4] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 116; __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);
        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_shape = ((PyObject*)values[0]);
    __pyx_v_itemsize = __Pyx_PyIndex_AsSsize_t(values[1]); if (unlikely((__pyx_v_itemsize == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_v_format = values[2];
    __pyx_v_mode = values[3];
    if (values[4]) {
      __pyx_v_allocate_buffer = __Pyx_PyObject_IsTrue(values[4]); if (unlikely((__pyx_v_allocate_buffer == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 117; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    } else {

      /* "View.MemoryView":117
 * 
 *     def __cinit__(array self, tuple shape, Py_ssize_t itemsize, format not None,
 *                   mode="c", bint allocate_buffer=True):             # <<<<<<<<<<<<<<
 * 
 *         cdef int idx
 */
      __pyx_v_allocate_buffer = ((int)1);
    }
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[7]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("View.MemoryView.array.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_shape), (&PyTuple_Type), 1, "shape", 1))) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (unlikely(((PyObject *)__pyx_v_format) == Py_None)) {
    PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "format"); {__pyx_filename = __pyx_f[7]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_r = __pyx_array_MemoryView_5array___cinit__(((struct __pyx_array_obj *)__pyx_v_self), __pyx_v_shape, __pyx_v_itemsize, __pyx_v_format, __pyx_v_mode, __pyx_v_allocate_buffer);

  /* "View.MemoryView":116
 *         cdef bint dtype_is_object
 * 
 *     def __cinit__(array self, tuple shape, Py_ssize_t itemsize, format not None,             # <<<<<<<<<<<<<<
 *                   mode="c", bint allocate_buffer=True):
 * 
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_array_MemoryView_5array___cinit__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_shape, Py_ssize_t __pyx_v_itemsize, PyObject *__pyx_v_format, PyObject *__pyx_v_mode, int __pyx_v_allocate_buffer) {
  int __pyx_v_idx;
  Py_ssize_t __pyx_v_i;
  Py_ssize_t __pyx_v_dim;
  PyObject **__pyx_v_p;
  char __pyx_v_order;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  Py_ssize_t __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  char *__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;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__cinit__", 0);
  __Pyx_INCREF(__pyx_v_format);

  /* "View.MemoryView":123
 *         cdef PyObject **p
 * 
 *         self.ndim = <int> len(shape)             # <<<<<<<<<<<<<<
 *         self.itemsize = itemsize
 * 
 */
  if (unlikely(__pyx_v_shape == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
    {__pyx_filename = __pyx_f[7]; __pyx_lineno = 123; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_1 = PyTuple_GET_SIZE(__pyx_v_shape); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 123; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_self->ndim = ((int)__pyx_t_1);

  /* "View.MemoryView":124
 * 
 *         self.ndim = <int> len(shape)
 *         self.itemsize = itemsize             # <<<<<<<<<<<<<<
 * 
 *         if not self.ndim:
 */
  __pyx_v_self->itemsize = __pyx_v_itemsize;

  /* "View.MemoryView":126
 *         self.itemsize = itemsize
 * 
 *         if not self.ndim:             # <<<<<<<<<<<<<<
 *             raise ValueError("Empty shape tuple for cython.array")
 * 
 */
  __pyx_t_2 = ((!(__pyx_v_self->ndim != 0)) != 0);
  if (__pyx_t_2) {

    /* "View.MemoryView":127
 * 
 *         if not self.ndim:
 *             raise ValueError("Empty shape tuple for cython.array")             # <<<<<<<<<<<<<<
 * 
 *         if itemsize <= 0:
 */
    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__222, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 127; __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[7]; __pyx_lineno = 127; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }

  /* "View.MemoryView":129
 *             raise ValueError("Empty shape tuple for cython.array")
 * 
 *         if itemsize <= 0:             # <<<<<<<<<<<<<<
 *             raise ValueError("itemsize <= 0 for cython.array")
 * 
 */
  __pyx_t_2 = ((__pyx_v_itemsize <= 0) != 0);
  if (__pyx_t_2) {

    /* "View.MemoryView":130
 * 
 *         if itemsize <= 0:
 *             raise ValueError("itemsize <= 0 for cython.array")             # <<<<<<<<<<<<<<
 * 
 *         if isinstance(format, unicode):
 */
    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__223, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 130; __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[7]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }

  /* "View.MemoryView":132
 *             raise ValueError("itemsize <= 0 for cython.array")
 * 
 *         if isinstance(format, unicode):             # <<<<<<<<<<<<<<
 *             format = (<unicode>format).encode('ASCII')
 *         self._format = format  # keep a reference to the byte string
 */
  __pyx_t_2 = PyUnicode_Check(__pyx_v_format); 
  __pyx_t_4 = (__pyx_t_2 != 0);
  if (__pyx_t_4) {

    /* "View.MemoryView":133
 * 
 *         if isinstance(format, unicode):
 *             format = (<unicode>format).encode('ASCII')             # <<<<<<<<<<<<<<
 *         self._format = format  # keep a reference to the byte string
 *         self.format = self._format
 */
    if (unlikely(__pyx_v_format == Py_None)) {
      PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "encode");
      {__pyx_filename = __pyx_f[7]; __pyx_lineno = 133; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_3 = PyUnicode_AsASCIIString(((PyObject*)__pyx_v_format)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 133; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF_SET(__pyx_v_format, __pyx_t_3);
    __pyx_t_3 = 0;
    goto __pyx_L5;
  }
  __pyx_L5:;

  /* "View.MemoryView":134
 *         if isinstance(format, unicode):
 *             format = (<unicode>format).encode('ASCII')
 *         self._format = format  # keep a reference to the byte string             # <<<<<<<<<<<<<<
 *         self.format = self._format
 * 
 */
  if (!(likely(PyBytes_CheckExact(__pyx_v_format))||((__pyx_v_format) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_v_format)->tp_name), 0))) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 134; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_3 = __pyx_v_format;
  __Pyx_INCREF(__pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_3);
  __Pyx_GOTREF(__pyx_v_self->_format);
  __Pyx_DECREF(__pyx_v_self->_format);
  __pyx_v_self->_format = ((PyObject*)__pyx_t_3);
  __pyx_t_3 = 0;

  /* "View.MemoryView":135
 *             format = (<unicode>format).encode('ASCII')
 *         self._format = format  # keep a reference to the byte string
 *         self.format = self._format             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_5 = __Pyx_PyObject_AsString(__pyx_v_self->_format); if (unlikely((!__pyx_t_5) && PyErr_Occurred())) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 135; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_self->format = __pyx_t_5;

  /* "View.MemoryView":138
 * 
 * 
 *         self._shape = <Py_ssize_t *> PyMem_Malloc(sizeof(Py_ssize_t)*self.ndim*2)             # <<<<<<<<<<<<<<
 *         self._strides = self._shape + self.ndim
 * 
 */
  __pyx_v_self->_shape = ((Py_ssize_t *)PyMem_Malloc((((sizeof(Py_ssize_t)) * __pyx_v_self->ndim) * 2)));

  /* "View.MemoryView":139
 * 
 *         self._shape = <Py_ssize_t *> PyMem_Malloc(sizeof(Py_ssize_t)*self.ndim*2)
 *         self._strides = self._shape + self.ndim             # <<<<<<<<<<<<<<
 * 
 *         if not self._shape:
 */
  __pyx_v_self->_strides = (__pyx_v_self->_shape + __pyx_v_self->ndim);

  /* "View.MemoryView":141
 *         self._strides = self._shape + self.ndim
 * 
 *         if not self._shape:             # <<<<<<<<<<<<<<
 *             raise MemoryError("unable to allocate shape and strides.")
 * 
 */
  __pyx_t_4 = ((!(__pyx_v_self->_shape != 0)) != 0);
  if (__pyx_t_4) {

    /* "View.MemoryView":142
 * 
 *         if not self._shape:
 *             raise MemoryError("unable to allocate shape and strides.")             # <<<<<<<<<<<<<<
 * 
 * 
 */
    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_MemoryError, __pyx_tuple__224, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 142; __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[7]; __pyx_lineno = 142; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }

  /* "View.MemoryView":145
 * 
 * 
 *         for idx, dim in enumerate(shape):             # <<<<<<<<<<<<<<
 *             if dim <= 0:
 *                 raise ValueError("Invalid shape in axis %d: %d." % (idx, dim))
 */
  __pyx_t_6 = 0;
  __pyx_t_3 = __pyx_v_shape; __Pyx_INCREF(__pyx_t_3); __pyx_t_1 = 0;
  for (;;) {
    if (__pyx_t_1 >= PyTuple_GET_SIZE(__pyx_t_3)) break;
    #if CYTHON_COMPILING_IN_CPYTHON
    __pyx_t_7 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_1); __Pyx_INCREF(__pyx_t_7); __pyx_t_1++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 145; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    #else
    __pyx_t_7 = PySequence_ITEM(__pyx_t_3, __pyx_t_1); __pyx_t_1++; if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 145; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    #endif
    __pyx_t_8 = __Pyx_PyIndex_AsSsize_t(__pyx_t_7); if (unlikely((__pyx_t_8 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 145; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __pyx_v_dim = __pyx_t_8;
    __pyx_v_idx = __pyx_t_6;
    __pyx_t_6 = (__pyx_t_6 + 1);

    /* "View.MemoryView":146
 * 
 *         for idx, dim in enumerate(shape):
 *             if dim <= 0:             # <<<<<<<<<<<<<<
 *                 raise ValueError("Invalid shape in axis %d: %d." % (idx, dim))
 *             self._shape[idx] = dim
 */
    __pyx_t_4 = ((__pyx_v_dim <= 0) != 0);
    if (__pyx_t_4) {

      /* "View.MemoryView":147
 *         for idx, dim in enumerate(shape):
 *             if dim <= 0:
 *                 raise ValueError("Invalid shape in axis %d: %d." % (idx, dim))             # <<<<<<<<<<<<<<
 *             self._shape[idx] = dim
 * 
 */
      __pyx_t_7 = __Pyx_PyInt_From_int(__pyx_v_idx); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 147; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_9 = PyInt_FromSsize_t(__pyx_v_dim); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 147; __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[7]; __pyx_lineno = 147; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_10);
      PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_7);
      __Pyx_GIVEREF(__pyx_t_7);
      PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_t_9);
      __Pyx_GIVEREF(__pyx_t_9);
      __pyx_t_7 = 0;
      __pyx_t_9 = 0;
      __pyx_t_9 = __Pyx_PyString_Format(__pyx_kp_s_Invalid_shape_in_axis_d_d, __pyx_t_10); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 147; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      __pyx_t_10 = PyTuple_New(1); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 147; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_10);
      PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_9);
      __Pyx_GIVEREF(__pyx_t_9);
      __pyx_t_9 = 0;
      __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_10, NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 147; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_DECREF(__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[7]; __pyx_lineno = 147; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }

    /* "View.MemoryView":148
 *             if dim <= 0:
 *                 raise ValueError("Invalid shape in axis %d: %d." % (idx, dim))
 *             self._shape[idx] = dim             # <<<<<<<<<<<<<<
 * 
 *         cdef char order
 */
    (__pyx_v_self->_shape[__pyx_v_idx]) = __pyx_v_dim;
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "View.MemoryView":151
 * 
 *         cdef char order
 *         if mode == 'fortran':             # <<<<<<<<<<<<<<
 *             order = b'F'
 *             self.mode = u'fortran'
 */
  __pyx_t_4 = (__Pyx_PyString_Equals(__pyx_v_mode, __pyx_n_s_fortran, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 151; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__pyx_t_4) {

    /* "View.MemoryView":152
 *         cdef char order
 *         if mode == 'fortran':
 *             order = b'F'             # <<<<<<<<<<<<<<
 *             self.mode = u'fortran'
 *         elif mode == 'c':
 */
    __pyx_v_order = 'F';

    /* "View.MemoryView":153
 *         if mode == 'fortran':
 *             order = b'F'
 *             self.mode = u'fortran'             # <<<<<<<<<<<<<<
 *         elif mode == 'c':
 *             order = b'C'
 */
    __Pyx_INCREF(__pyx_n_u_fortran);
    __Pyx_GIVEREF(__pyx_n_u_fortran);
    __Pyx_GOTREF(__pyx_v_self->mode);
    __Pyx_DECREF(__pyx_v_self->mode);
    __pyx_v_self->mode = __pyx_n_u_fortran;
    goto __pyx_L10;
  }

  /* "View.MemoryView":154
 *             order = b'F'
 *             self.mode = u'fortran'
 *         elif mode == 'c':             # <<<<<<<<<<<<<<
 *             order = b'C'
 *             self.mode = u'c'
 */
  __pyx_t_4 = (__Pyx_PyString_Equals(__pyx_v_mode, __pyx_n_s_c, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 154; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__pyx_t_4) {

    /* "View.MemoryView":155
 *             self.mode = u'fortran'
 *         elif mode == 'c':
 *             order = b'C'             # <<<<<<<<<<<<<<
 *             self.mode = u'c'
 *         else:
 */
    __pyx_v_order = 'C';

    /* "View.MemoryView":156
 *         elif mode == 'c':
 *             order = b'C'
 *             self.mode = u'c'             # <<<<<<<<<<<<<<
 *         else:
 *             raise ValueError("Invalid mode, expected 'c' or 'fortran', got %s" % mode)
 */
    __Pyx_INCREF(__pyx_n_u_c);
    __Pyx_GIVEREF(__pyx_n_u_c);
    __Pyx_GOTREF(__pyx_v_self->mode);
    __Pyx_DECREF(__pyx_v_self->mode);
    __pyx_v_self->mode = __pyx_n_u_c;
    goto __pyx_L10;
  }
  /*else*/ {

    /* "View.MemoryView":158
 *             self.mode = u'c'
 *         else:
 *             raise ValueError("Invalid mode, expected 'c' or 'fortran', got %s" % mode)             # <<<<<<<<<<<<<<
 * 
 *         self.len = fill_contig_strides_array(self._shape, self._strides,
 */
    __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_Invalid_mode_expected_c_or_fortr, __pyx_v_mode); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 158; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_9 = PyTuple_New(1); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 158; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_9);
    PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_3);
    __Pyx_GIVEREF(__pyx_t_3);
    __pyx_t_3 = 0;
    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_9, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 158; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    __Pyx_Raise(__pyx_t_3, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    {__pyx_filename = __pyx_f[7]; __pyx_lineno = 158; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_L10:;

  /* "View.MemoryView":160
 *             raise ValueError("Invalid mode, expected 'c' or 'fortran', got %s" % mode)
 * 
 *         self.len = fill_contig_strides_array(self._shape, self._strides,             # <<<<<<<<<<<<<<
 *                                              itemsize, self.ndim, order)
 * 
 */
  __pyx_v_self->len = __pyx_fill_contig_strides_array(__pyx_v_self->_shape, __pyx_v_self->_strides, __pyx_v_itemsize, __pyx_v_self->ndim, __pyx_v_order);

  /* "View.MemoryView":163
 *                                              itemsize, self.ndim, order)
 * 
 *         self.free_data = allocate_buffer             # <<<<<<<<<<<<<<
 *         self.dtype_is_object = format == b'O'
 *         if allocate_buffer:
 */
  __pyx_v_self->free_data = __pyx_v_allocate_buffer;

  /* "View.MemoryView":164
 * 
 *         self.free_data = allocate_buffer
 *         self.dtype_is_object = format == b'O'             # <<<<<<<<<<<<<<
 *         if allocate_buffer:
 * 
 */
  __pyx_t_3 = PyObject_RichCompare(__pyx_v_format, __pyx_n_b_O, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 164; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 164; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_v_self->dtype_is_object = __pyx_t_4;

  /* "View.MemoryView":165
 *         self.free_data = allocate_buffer
 *         self.dtype_is_object = format == b'O'
 *         if allocate_buffer:             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_4 = (__pyx_v_allocate_buffer != 0);
  if (__pyx_t_4) {

    /* "View.MemoryView":168
 * 
 * 
 *             self.data = <char *>malloc(self.len)             # <<<<<<<<<<<<<<
 *             if not self.data:
 *                 raise MemoryError("unable to allocate array data.")
 */
    __pyx_v_self->data = ((char *)malloc(__pyx_v_self->len));

    /* "View.MemoryView":169
 * 
 *             self.data = <char *>malloc(self.len)
 *             if not self.data:             # <<<<<<<<<<<<<<
 *                 raise MemoryError("unable to allocate array data.")
 * 
 */
    __pyx_t_4 = ((!(__pyx_v_self->data != 0)) != 0);
    if (__pyx_t_4) {

      /* "View.MemoryView":170
 *             self.data = <char *>malloc(self.len)
 *             if not self.data:
 *                 raise MemoryError("unable to allocate array data.")             # <<<<<<<<<<<<<<
 * 
 *             if self.dtype_is_object:
 */
      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_MemoryError, __pyx_tuple__225, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 170; __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[7]; __pyx_lineno = 170; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }

    /* "View.MemoryView":172
 *                 raise MemoryError("unable to allocate array data.")
 * 
 *             if self.dtype_is_object:             # <<<<<<<<<<<<<<
 *                 p = <PyObject **> self.data
 *                 for i in range(self.len / itemsize):
 */
    __pyx_t_4 = (__pyx_v_self->dtype_is_object != 0);
    if (__pyx_t_4) {

      /* "View.MemoryView":173
 * 
 *             if self.dtype_is_object:
 *                 p = <PyObject **> self.data             # <<<<<<<<<<<<<<
 *                 for i in range(self.len / itemsize):
 *                     p[i] = Py_None
 */
      __pyx_v_p = ((PyObject **)__pyx_v_self->data);

      /* "View.MemoryView":174
 *             if self.dtype_is_object:
 *                 p = <PyObject **> self.data
 *                 for i in range(self.len / itemsize):             # <<<<<<<<<<<<<<
 *                     p[i] = Py_None
 *                     Py_INCREF(Py_None)
 */
      if (unlikely(__pyx_v_itemsize == 0)) {
        #ifdef WITH_THREAD
        PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
        #endif
        PyErr_SetString(PyExc_ZeroDivisionError, "integer division or modulo by zero");
        #ifdef WITH_THREAD
        PyGILState_Release(__pyx_gilstate_save);
        #endif
        {__pyx_filename = __pyx_f[7]; __pyx_lineno = 174; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      else if (sizeof(Py_ssize_t) == sizeof(long) && unlikely(__pyx_v_itemsize == -1)  && unlikely(UNARY_NEG_WOULD_OVERFLOW(__pyx_v_self->len))) {
        #ifdef WITH_THREAD
        PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
        #endif
        PyErr_SetString(PyExc_OverflowError, "value too large to perform division");
        #ifdef WITH_THREAD
        PyGILState_Release(__pyx_gilstate_save);
        #endif
        {__pyx_filename = __pyx_f[7]; __pyx_lineno = 174; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_t_1 = __Pyx_div_Py_ssize_t(__pyx_v_self->len, __pyx_v_itemsize);
      for (__pyx_t_8 = 0; __pyx_t_8 < __pyx_t_1; __pyx_t_8+=1) {
        __pyx_v_i = __pyx_t_8;

        /* "View.MemoryView":175
 *                 p = <PyObject **> self.data
 *                 for i in range(self.len / itemsize):
 *                     p[i] = Py_None             # <<<<<<<<<<<<<<
 *                     Py_INCREF(Py_None)
 * 
 */
        (__pyx_v_p[__pyx_v_i]) = Py_None;

        /* "View.MemoryView":176
 *                 for i in range(self.len / itemsize):
 *                     p[i] = Py_None
 *                     Py_INCREF(Py_None)             # <<<<<<<<<<<<<<
 * 
 *     @cname('getbuffer')
 */
        Py_INCREF(Py_None);
      }
      goto __pyx_L13;
    }
    __pyx_L13:;
    goto __pyx_L11;
  }
  __pyx_L11:;

  /* "View.MemoryView":116
 *         cdef bint dtype_is_object
 * 
 *     def __cinit__(array self, tuple shape, Py_ssize_t itemsize, format not None,             # <<<<<<<<<<<<<<
 *                   mode="c", bint allocate_buffer=True):
 * 
 */

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_AddTraceback("View.MemoryView.array.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_format);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "View.MemoryView":179
 * 
 *     @cname('getbuffer')
 *     def __getbuffer__(self, Py_buffer *info, int flags):             # <<<<<<<<<<<<<<
 *         cdef int bufmode = -1
 *         if self.mode == u"c":
 */

/* Python wrapper */
static CYTHON_UNUSED int __pyx_array_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/
static CYTHON_UNUSED int __pyx_array_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__getbuffer__ (wrapper)", 0);
  __pyx_r = __pyx_array_getbuffer_MemoryView_5array_2__getbuffer__(((struct __pyx_array_obj *)__pyx_v_self), ((Py_buffer *)__pyx_v_info), ((int)__pyx_v_flags));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_array_getbuffer_MemoryView_5array_2__getbuffer__(struct __pyx_array_obj *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) {
  int __pyx_v_bufmode;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  char *__pyx_t_4;
  Py_ssize_t __pyx_t_5;
  int __pyx_t_6;
  Py_ssize_t *__pyx_t_7;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__getbuffer__", 0);
  if (__pyx_v_info != NULL) {
    __pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None);
    __Pyx_GIVEREF(__pyx_v_info->obj);
  }

  /* "View.MemoryView":180
 *     @cname('getbuffer')
 *     def __getbuffer__(self, Py_buffer *info, int flags):
 *         cdef int bufmode = -1             # <<<<<<<<<<<<<<
 *         if self.mode == u"c":
 *             bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
 */
  __pyx_v_bufmode = -1;

  /* "View.MemoryView":181
 *     def __getbuffer__(self, Py_buffer *info, int flags):
 *         cdef int bufmode = -1
 *         if self.mode == u"c":             # <<<<<<<<<<<<<<
 *             bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
 *         elif self.mode == u"fortran":
 */
  __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_self->mode, __pyx_n_u_c, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 181; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (__pyx_t_2) {

    /* "View.MemoryView":182
 *         cdef int bufmode = -1
 *         if self.mode == u"c":
 *             bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS             # <<<<<<<<<<<<<<
 *         elif self.mode == u"fortran":
 *             bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
 */
    __pyx_v_bufmode = (PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS);
    goto __pyx_L3;
  }

  /* "View.MemoryView":183
 *         if self.mode == u"c":
 *             bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
 *         elif self.mode == u"fortran":             # <<<<<<<<<<<<<<
 *             bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
 *         if not (flags & bufmode):
 */
  __pyx_t_2 = (__Pyx_PyUnicode_Equals(__pyx_v_self->mode, __pyx_n_u_fortran, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 183; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_1 = (__pyx_t_2 != 0);
  if (__pyx_t_1) {

    /* "View.MemoryView":184
 *             bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
 *         elif self.mode == u"fortran":
 *             bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS             # <<<<<<<<<<<<<<
 *         if not (flags & bufmode):
 *             raise ValueError("Can only create a buffer that is contiguous in memory.")
 */
    __pyx_v_bufmode = (PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS);
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "View.MemoryView":185
 *         elif self.mode == u"fortran":
 *             bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
 *         if not (flags & bufmode):             # <<<<<<<<<<<<<<
 *             raise ValueError("Can only create a buffer that is contiguous in memory.")
 *         info.buf = self.data
 */
  __pyx_t_1 = ((!((__pyx_v_flags & __pyx_v_bufmode) != 0)) != 0);
  if (__pyx_t_1) {

    /* "View.MemoryView":186
 *             bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
 *         if not (flags & bufmode):
 *             raise ValueError("Can only create a buffer that is contiguous in memory.")             # <<<<<<<<<<<<<<
 *         info.buf = self.data
 *         info.len = self.len
 */
    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__226, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 186; __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[7]; __pyx_lineno = 186; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }

  /* "View.MemoryView":187
 *         if not (flags & bufmode):
 *             raise ValueError("Can only create a buffer that is contiguous in memory.")
 *         info.buf = self.data             # <<<<<<<<<<<<<<
 *         info.len = self.len
 *         info.ndim = self.ndim
 */
  __pyx_t_4 = __pyx_v_self->data;
  __pyx_v_info->buf = __pyx_t_4;

  /* "View.MemoryView":188
 *             raise ValueError("Can only create a buffer that is contiguous in memory.")
 *         info.buf = self.data
 *         info.len = self.len             # <<<<<<<<<<<<<<
 *         info.ndim = self.ndim
 *         info.shape = self._shape
 */
  __pyx_t_5 = __pyx_v_self->len;
  __pyx_v_info->len = __pyx_t_5;

  /* "View.MemoryView":189
 *         info.buf = self.data
 *         info.len = self.len
 *         info.ndim = self.ndim             # <<<<<<<<<<<<<<
 *         info.shape = self._shape
 *         info.strides = self._strides
 */
  __pyx_t_6 = __pyx_v_self->ndim;
  __pyx_v_info->ndim = __pyx_t_6;

  /* "View.MemoryView":190
 *         info.len = self.len
 *         info.ndim = self.ndim
 *         info.shape = self._shape             # <<<<<<<<<<<<<<
 *         info.strides = self._strides
 *         info.suboffsets = NULL
 */
  __pyx_t_7 = __pyx_v_self->_shape;
  __pyx_v_info->shape = __pyx_t_7;

  /* "View.MemoryView":191
 *         info.ndim = self.ndim
 *         info.shape = self._shape
 *         info.strides = self._strides             # <<<<<<<<<<<<<<
 *         info.suboffsets = NULL
 *         info.itemsize = self.itemsize
 */
  __pyx_t_7 = __pyx_v_self->_strides;
  __pyx_v_info->strides = __pyx_t_7;

  /* "View.MemoryView":192
 *         info.shape = self._shape
 *         info.strides = self._strides
 *         info.suboffsets = NULL             # <<<<<<<<<<<<<<
 *         info.itemsize = self.itemsize
 *         info.readonly = 0
 */
  __pyx_v_info->suboffsets = NULL;

  /* "View.MemoryView":193
 *         info.strides = self._strides
 *         info.suboffsets = NULL
 *         info.itemsize = self.itemsize             # <<<<<<<<<<<<<<
 *         info.readonly = 0
 * 
 */
  __pyx_t_5 = __pyx_v_self->itemsize;
  __pyx_v_info->itemsize = __pyx_t_5;

  /* "View.MemoryView":194
 *         info.suboffsets = NULL
 *         info.itemsize = self.itemsize
 *         info.readonly = 0             # <<<<<<<<<<<<<<
 * 
 *         if flags & PyBUF_FORMAT:
 */
  __pyx_v_info->readonly = 0;

  /* "View.MemoryView":196
 *         info.readonly = 0
 * 
 *         if flags & PyBUF_FORMAT:             # <<<<<<<<<<<<<<
 *             info.format = self.format
 *         else:
 */
  __pyx_t_1 = ((__pyx_v_flags & PyBUF_FORMAT) != 0);
  if (__pyx_t_1) {

    /* "View.MemoryView":197
 * 
 *         if flags & PyBUF_FORMAT:
 *             info.format = self.format             # <<<<<<<<<<<<<<
 *         else:
 *             info.format = NULL
 */
    __pyx_t_4 = __pyx_v_self->format;
    __pyx_v_info->format = __pyx_t_4;
    goto __pyx_L5;
  }
  /*else*/ {

    /* "View.MemoryView":199
 *             info.format = self.format
 *         else:
 *             info.format = NULL             # <<<<<<<<<<<<<<
 * 
 *         info.obj = self
 */
    __pyx_v_info->format = NULL;
  }
  __pyx_L5:;

  /* "View.MemoryView":201
 *             info.format = NULL
 * 
 *         info.obj = self             # <<<<<<<<<<<<<<
 * 
 *     __pyx_getbuffer = capsule(<void *> &__pyx_array_getbuffer, "getbuffer(obj, view, flags)")
 */
  __Pyx_INCREF(((PyObject *)__pyx_v_self));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
  __Pyx_GOTREF(__pyx_v_info->obj);
  __Pyx_DECREF(__pyx_v_info->obj);
  __pyx_v_info->obj = ((PyObject *)__pyx_v_self);

  /* "View.MemoryView":179
 * 
 *     @cname('getbuffer')
 *     def __getbuffer__(self, Py_buffer *info, int flags):             # <<<<<<<<<<<<<<
 *         cdef int bufmode = -1
 *         if self.mode == u"c":
 */

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("View.MemoryView.array.__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_RefNannyFinishContext();
  return __pyx_r;
}

/* "View.MemoryView":205
 *     __pyx_getbuffer = capsule(<void *> &__pyx_array_getbuffer, "getbuffer(obj, view, flags)")
 * 
 *     def __dealloc__(array self):             # <<<<<<<<<<<<<<
 *         if self.callback_free_data != NULL:
 *             self.callback_free_data(self.data)
 */

/* Python wrapper */
static void __pyx_array___dealloc__(PyObject *__pyx_v_self); /*proto*/
static void __pyx_array___dealloc__(PyObject *__pyx_v_self) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
  __pyx_array_MemoryView_5array_4__dealloc__(((struct __pyx_array_obj *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
}

static void __pyx_array_MemoryView_5array_4__dealloc__(struct __pyx_array_obj *__pyx_v_self) {
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  __Pyx_RefNannySetupContext("__dealloc__", 0);

  /* "View.MemoryView":206
 * 
 *     def __dealloc__(array self):
 *         if self.callback_free_data != NULL:             # <<<<<<<<<<<<<<
 *             self.callback_free_data(self.data)
 *         elif self.free_data:
 */
  __pyx_t_1 = ((__pyx_v_self->callback_free_data != NULL) != 0);
  if (__pyx_t_1) {

    /* "View.MemoryView":207
 *     def __dealloc__(array self):
 *         if self.callback_free_data != NULL:
 *             self.callback_free_data(self.data)             # <<<<<<<<<<<<<<
 *         elif self.free_data:
 *             if self.dtype_is_object:
 */
    __pyx_v_self->callback_free_data(__pyx_v_self->data);
    goto __pyx_L3;
  }

  /* "View.MemoryView":208
 *         if self.callback_free_data != NULL:
 *             self.callback_free_data(self.data)
 *         elif self.free_data:             # <<<<<<<<<<<<<<
 *             if self.dtype_is_object:
 *                 refcount_objects_in_slice(self.data, self._shape,
 */
  __pyx_t_1 = (__pyx_v_self->free_data != 0);
  if (__pyx_t_1) {

    /* "View.MemoryView":209
 *             self.callback_free_data(self.data)
 *         elif self.free_data:
 *             if self.dtype_is_object:             # <<<<<<<<<<<<<<
 *                 refcount_objects_in_slice(self.data, self._shape,
 *                                           self._strides, self.ndim, False)
 */
    __pyx_t_1 = (__pyx_v_self->dtype_is_object != 0);
    if (__pyx_t_1) {

      /* "View.MemoryView":210
 *         elif self.free_data:
 *             if self.dtype_is_object:
 *                 refcount_objects_in_slice(self.data, self._shape,             # <<<<<<<<<<<<<<
 *                                           self._strides, self.ndim, False)
 *             free(self.data)
 */
      __pyx_memoryview_refcount_objects_in_slice(__pyx_v_self->data, __pyx_v_self->_shape, __pyx_v_self->_strides, __pyx_v_self->ndim, 0);
      goto __pyx_L4;
    }
    __pyx_L4:;

    /* "View.MemoryView":212
 *                 refcount_objects_in_slice(self.data, self._shape,
 *                                           self._strides, self.ndim, False)
 *             free(self.data)             # <<<<<<<<<<<<<<
 *         PyMem_Free(self._shape)
 * 
 */
    free(__pyx_v_self->data);
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "View.MemoryView":213
 *                                           self._strides, self.ndim, False)
 *             free(self.data)
 *         PyMem_Free(self._shape)             # <<<<<<<<<<<<<<
 * 
 *     property memview:
 */
  PyMem_Free(__pyx_v_self->_shape);

  /* "View.MemoryView":205
 *     __pyx_getbuffer = capsule(<void *> &__pyx_array_getbuffer, "getbuffer(obj, view, flags)")
 * 
 *     def __dealloc__(array self):             # <<<<<<<<<<<<<<
 *         if self.callback_free_data != NULL:
 *             self.callback_free_data(self.data)
 */

  /* function exit code */
  __Pyx_RefNannyFinishContext();
}

/* "View.MemoryView":217
 *     property memview:
 *         @cname('get_memview')
 *         def __get__(self):             # <<<<<<<<<<<<<<
 * 
 *             flags =  PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT|PyBUF_WRITABLE
 */

/* Python wrapper */
static PyObject *get_memview(PyObject *__pyx_v_self); /*proto*/
static PyObject *get_memview(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = get_memview_MemoryView_5array_7memview___get__(((struct __pyx_array_obj *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *get_memview_MemoryView_5array_7memview___get__(struct __pyx_array_obj *__pyx_v_self) {
  int __pyx_v_flags;
  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__", 0);

  /* "View.MemoryView":219
 *         def __get__(self):
 * 
 *             flags =  PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT|PyBUF_WRITABLE             # <<<<<<<<<<<<<<
 *             return  memoryview(self, flags, self.dtype_is_object)
 * 
 */
  __pyx_v_flags = ((PyBUF_ANY_CONTIGUOUS | PyBUF_FORMAT) | PyBUF_WRITABLE);

  /* "View.MemoryView":220
 * 
 *             flags =  PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT|PyBUF_WRITABLE
 *             return  memoryview(self, flags, self.dtype_is_object)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_flags); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 220; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_self->dtype_is_object); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 220; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 220; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_INCREF(((PyObject *)__pyx_v_self));
  PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_self));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_1 = 0;
  __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)((PyObject *)__pyx_memoryview_type)), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 220; __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;

  /* "View.MemoryView":217
 *     property memview:
 *         @cname('get_memview')
 *         def __get__(self):             # <<<<<<<<<<<<<<
 * 
 *             flags =  PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT|PyBUF_WRITABLE
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("View.MemoryView.array.memview.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "View.MemoryView":223
 * 
 * 
 *     def __getattr__(self, attr):             # <<<<<<<<<<<<<<
 *         return getattr(self.memview, attr)
 * 
 */

/* Python wrapper */
static PyObject *__pyx_array___getattr__(PyObject *__pyx_v_self, PyObject *__pyx_v_attr); /*proto*/
static PyObject *__pyx_array___getattr__(PyObject *__pyx_v_self, PyObject *__pyx_v_attr) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__getattr__ (wrapper)", 0);
  __pyx_r = __pyx_array_MemoryView_5array_6__getattr__(((struct __pyx_array_obj *)__pyx_v_self), ((PyObject *)__pyx_v_attr));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_array_MemoryView_5array_6__getattr__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_attr) {
  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("__getattr__", 0);

  /* "View.MemoryView":224
 * 
 *     def __getattr__(self, attr):
 *         return getattr(self.memview, attr)             # <<<<<<<<<<<<<<
 * 
 *     def __getitem__(self, item):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_memview); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 224; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_GetAttr(__pyx_t_1, __pyx_v_attr); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 224; __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;

  /* "View.MemoryView":223
 * 
 * 
 *     def __getattr__(self, attr):             # <<<<<<<<<<<<<<
 *         return getattr(self.memview, attr)
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("View.MemoryView.array.__getattr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "View.MemoryView":226
 *         return getattr(self.memview, attr)
 * 
 *     def __getitem__(self, item):             # <<<<<<<<<<<<<<
 *         return self.memview[item]
 * 
 */

/* Python wrapper */
static PyObject *__pyx_array___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item); /*proto*/
static PyObject *__pyx_array___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__getitem__ (wrapper)", 0);
  __pyx_r = __pyx_array_MemoryView_5array_8__getitem__(((struct __pyx_array_obj *)__pyx_v_self), ((PyObject *)__pyx_v_item));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_array_MemoryView_5array_8__getitem__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item) {
  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("__getitem__", 0);

  /* "View.MemoryView":227
 * 
 *     def __getitem__(self, item):
 *         return self.memview[item]             # <<<<<<<<<<<<<<
 * 
 *     def __setitem__(self, item, value):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_memview); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 227; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_GetItem(__pyx_t_1, __pyx_v_item); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 227; __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;

  /* "View.MemoryView":226
 *         return getattr(self.memview, attr)
 * 
 *     def __getitem__(self, item):             # <<<<<<<<<<<<<<
 *         return self.memview[item]
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("View.MemoryView.array.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "View.MemoryView":229
 *         return self.memview[item]
 * 
 *     def __setitem__(self, item, value):             # <<<<<<<<<<<<<<
 *         self.memview[item] = value
 * 
 */

/* Python wrapper */
static int __pyx_array___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value); /*proto*/
static int __pyx_array___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setitem__ (wrapper)", 0);
  __pyx_r = __pyx_array_MemoryView_5array_10__setitem__(((struct __pyx_array_obj *)__pyx_v_self), ((PyObject *)__pyx_v_item), ((PyObject *)__pyx_v_value));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_array_MemoryView_5array_10__setitem__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__setitem__", 0);

  /* "View.MemoryView":230
 * 
 *     def __setitem__(self, item, value):
 *         self.memview[item] = value             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_memview); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 230; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (unlikely(PyObject_SetItem(__pyx_t_1, __pyx_v_item, __pyx_v_value) < 0)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 230; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "View.MemoryView":229
 *         return self.memview[item]
 * 
 *     def __setitem__(self, item, value):             # <<<<<<<<<<<<<<
 *         self.memview[item] = value
 * 
 */

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("View.MemoryView.array.__setitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "View.MemoryView":234
 * 
 * @cname("__pyx_array_new")
 * cdef array array_cwrapper(tuple shape, Py_ssize_t itemsize, char *format,             # <<<<<<<<<<<<<<
 *                           char *mode, char *buf):
 *     cdef array result
 */

static struct __pyx_array_obj *__pyx_array_new(PyObject *__pyx_v_shape, Py_ssize_t __pyx_v_itemsize, char *__pyx_v_format, char *__pyx_v_mode, char *__pyx_v_buf) {
  struct __pyx_array_obj *__pyx_v_result = 0;
  struct __pyx_array_obj *__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;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("array_cwrapper", 0);

  /* "View.MemoryView":238
 *     cdef array result
 * 
 *     if buf == NULL:             # <<<<<<<<<<<<<<
 *         result = array(shape, itemsize, format, mode.decode('ASCII'))
 *     else:
 */
  __pyx_t_1 = ((__pyx_v_buf == NULL) != 0);
  if (__pyx_t_1) {

    /* "View.MemoryView":239
 * 
 *     if buf == NULL:
 *         result = array(shape, itemsize, format, mode.decode('ASCII'))             # <<<<<<<<<<<<<<
 *     else:
 *         result = array(shape, itemsize, format, mode.decode('ASCII'),
 */
    __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_itemsize); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 239; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = __Pyx_PyBytes_FromString(__pyx_v_format); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 239; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = __Pyx_decode_c_string(__pyx_v_mode, 0, strlen(__pyx_v_mode), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 239; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = PyTuple_New(4); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 239; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_INCREF(__pyx_v_shape);
    PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_shape);
    __Pyx_GIVEREF(__pyx_v_shape);
    PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_2);
    __Pyx_GIVEREF(__pyx_t_2);
    PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_t_3);
    __Pyx_GIVEREF(__pyx_t_3);
    PyTuple_SET_ITEM(__pyx_t_5, 3, __pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_4);
    __pyx_t_2 = 0;
    __pyx_t_3 = 0;
    __pyx_t_4 = 0;
    __pyx_t_4 = __Pyx_PyObject_Call(((PyObject *)((PyObject *)__pyx_array_type)), __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 239; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_v_result = ((struct __pyx_array_obj *)__pyx_t_4);
    __pyx_t_4 = 0;
    goto __pyx_L3;
  }
  /*else*/ {

    /* "View.MemoryView":241
 *         result = array(shape, itemsize, format, mode.decode('ASCII'))
 *     else:
 *         result = array(shape, itemsize, format, mode.decode('ASCII'),             # <<<<<<<<<<<<<<
 *                        allocate_buffer=False)
 *         result.data = buf
 */
    __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_itemsize); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 241; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_PyBytes_FromString(__pyx_v_format); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 241; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_3 = __Pyx_decode_c_string(__pyx_v_mode, 0, strlen(__pyx_v_mode), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 241; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_2 = PyTuple_New(4); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 241; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_INCREF(__pyx_v_shape);
    PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_shape);
    __Pyx_GIVEREF(__pyx_v_shape);
    PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_4);
    PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_t_5);
    __Pyx_GIVEREF(__pyx_t_5);
    PyTuple_SET_ITEM(__pyx_t_2, 3, __pyx_t_3);
    __Pyx_GIVEREF(__pyx_t_3);
    __pyx_t_4 = 0;
    __pyx_t_5 = 0;
    __pyx_t_3 = 0;
    __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 241; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);

    /* "View.MemoryView":242
 *     else:
 *         result = array(shape, itemsize, format, mode.decode('ASCII'),
 *                        allocate_buffer=False)             # <<<<<<<<<<<<<<
 *         result.data = buf
 * 
 */
    if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_allocate_buffer, Py_False) < 0) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 241; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

    /* "View.MemoryView":241
 *         result = array(shape, itemsize, format, mode.decode('ASCII'))
 *     else:
 *         result = array(shape, itemsize, format, mode.decode('ASCII'),             # <<<<<<<<<<<<<<
 *                        allocate_buffer=False)
 *         result.data = buf
 */
    __pyx_t_5 = __Pyx_PyObject_Call(((PyObject *)((PyObject *)__pyx_array_type)), __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 241; __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_3); __pyx_t_3 = 0;
    __pyx_v_result = ((struct __pyx_array_obj *)__pyx_t_5);
    __pyx_t_5 = 0;

    /* "View.MemoryView":243
 *         result = array(shape, itemsize, format, mode.decode('ASCII'),
 *                        allocate_buffer=False)
 *         result.data = buf             # <<<<<<<<<<<<<<
 * 
 *     return result
 */
    __pyx_v_result->data = __pyx_v_buf;
  }
  __pyx_L3:;

  /* "View.MemoryView":245
 *         result.data = buf
 * 
 *     return result             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __Pyx_INCREF(((PyObject *)__pyx_v_result));
  __pyx_r = __pyx_v_result;
  goto __pyx_L0;

  /* "View.MemoryView":234
 * 
 * @cname("__pyx_array_new")
 * cdef array array_cwrapper(tuple shape, Py_ssize_t itemsize, char *format,             # <<<<<<<<<<<<<<
 *                           char *mode, char *buf):
 *     cdef array result
 */

  /* function exit code */
  __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("View.MemoryView.array_cwrapper", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_result);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "View.MemoryView":271
 * cdef class Enum(object):
 *     cdef object name
 *     def __init__(self, name):             # <<<<<<<<<<<<<<
 *         self.name = name
 *     def __repr__(self):
 */

/* Python wrapper */
static int __pyx_MemviewEnum___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_MemviewEnum___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_name = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_name,0};
    PyObject* values[1] = {0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_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 (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_name)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 271; __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_name = 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[7]; __pyx_lineno = 271; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("View.MemoryView.Enum.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_MemviewEnum_MemoryView_4Enum___init__(((struct __pyx_MemviewEnum_obj *)__pyx_v_self), __pyx_v_name);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_MemviewEnum_MemoryView_4Enum___init__(struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v_name) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__", 0);

  /* "View.MemoryView":272
 *     cdef object name
 *     def __init__(self, name):
 *         self.name = name             # <<<<<<<<<<<<<<
 *     def __repr__(self):
 *         return self.name
 */
  __Pyx_INCREF(__pyx_v_name);
  __Pyx_GIVEREF(__pyx_v_name);
  __Pyx_GOTREF(__pyx_v_self->name);
  __Pyx_DECREF(__pyx_v_self->name);
  __pyx_v_self->name = __pyx_v_name;

  /* "View.MemoryView":271
 * cdef class Enum(object):
 *     cdef object name
 *     def __init__(self, name):             # <<<<<<<<<<<<<<
 *         self.name = name
 *     def __repr__(self):
 */

  /* function exit code */
  __pyx_r = 0;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "View.MemoryView":273
 *     def __init__(self, name):
 *         self.name = name
 *     def __repr__(self):             # <<<<<<<<<<<<<<
 *         return self.name
 * 
 */

/* Python wrapper */
static PyObject *__pyx_MemviewEnum___repr__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_MemviewEnum___repr__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0);
  __pyx_r = __pyx_MemviewEnum_MemoryView_4Enum_2__repr__(((struct __pyx_MemviewEnum_obj *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_MemviewEnum_MemoryView_4Enum_2__repr__(struct __pyx_MemviewEnum_obj *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__repr__", 0);

  /* "View.MemoryView":274
 *         self.name = name
 *     def __repr__(self):
 *         return self.name             # <<<<<<<<<<<<<<
 * 
 * cdef generic = Enum("<strided and direct or indirect>")
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->name);
  __pyx_r = __pyx_v_self->name;
  goto __pyx_L0;

  /* "View.MemoryView":273
 *     def __init__(self, name):
 *         self.name = name
 *     def __repr__(self):             # <<<<<<<<<<<<<<
 *         return self.name
 * 
 */

  /* function exit code */
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "View.MemoryView":288
 * 
 * @cname('__pyx_align_pointer')
 * cdef void *align_pointer(void *memory, size_t alignment) nogil:             # <<<<<<<<<<<<<<
 *     "Align pointer memory on a given boundary"
 *     cdef Py_intptr_t aligned_p = <Py_intptr_t> memory
 */

static void *__pyx_align_pointer(void *__pyx_v_memory, size_t __pyx_v_alignment) {
  Py_intptr_t __pyx_v_aligned_p;
  size_t __pyx_v_offset;
  void *__pyx_r;
  int __pyx_t_1;

  /* "View.MemoryView":290
 * cdef void *align_pointer(void *memory, size_t alignment) nogil:
 *     "Align pointer memory on a given boundary"
 *     cdef Py_intptr_t aligned_p = <Py_intptr_t> memory             # <<<<<<<<<<<<<<
 *     cdef size_t offset
 * 
 */
  __pyx_v_aligned_p = ((Py_intptr_t)__pyx_v_memory);

  /* "View.MemoryView":294
 * 
 *     with cython.cdivision(True):
 *         offset = aligned_p % alignment             # <<<<<<<<<<<<<<
 * 
 *     if offset > 0:
 */
  __pyx_v_offset = (__pyx_v_aligned_p % __pyx_v_alignment);

  /* "View.MemoryView":296
 *         offset = aligned_p % alignment
 * 
 *     if offset > 0:             # <<<<<<<<<<<<<<
 *         aligned_p += alignment - offset
 * 
 */
  __pyx_t_1 = ((__pyx_v_offset > 0) != 0);
  if (__pyx_t_1) {

    /* "View.MemoryView":297
 * 
 *     if offset > 0:
 *         aligned_p += alignment - offset             # <<<<<<<<<<<<<<
 * 
 *     return <void *> aligned_p
 */
    __pyx_v_aligned_p = (__pyx_v_aligned_p + (__pyx_v_alignment - __pyx_v_offset));
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "View.MemoryView":299
 *         aligned_p += alignment - offset
 * 
 *     return <void *> aligned_p             # <<<<<<<<<<<<<<
 * 
 * @cname('__pyx_memoryview')
 */
  __pyx_r = ((void *)__pyx_v_aligned_p);
  goto __pyx_L0;

  /* "View.MemoryView":288
 * 
 * @cname('__pyx_align_pointer')
 * cdef void *align_pointer(void *memory, size_t alignment) nogil:             # <<<<<<<<<<<<<<
 *     "Align pointer memory on a given boundary"
 *     cdef Py_intptr_t aligned_p = <Py_intptr_t> memory
 */

  /* function exit code */
  __pyx_L0:;
  return __pyx_r;
}

/* "View.MemoryView":317
 *     cdef __Pyx_TypeInfo *typeinfo
 * 
 *     def __cinit__(memoryview self, object obj, int flags, bint dtype_is_object=False):             # <<<<<<<<<<<<<<
 *         self.obj = obj
 *         self.flags = flags
 */

/* Python wrapper */
static int __pyx_memoryview___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_memoryview___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_obj = 0;
  int __pyx_v_flags;
  int __pyx_v_dtype_is_object;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_obj,&__pyx_n_s_flags,&__pyx_n_s_dtype_is_object,0};
    PyObject* values[3] = {0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_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 (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_obj)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_flags)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 2, 3, 1); {__pyx_filename = __pyx_f[7]; __pyx_lineno = 317; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_dtype_is_object);
          if (value) { values[2] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 317; __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_obj = values[0];
    __pyx_v_flags = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_flags == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 317; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    if (values[2]) {
      __pyx_v_dtype_is_object = __Pyx_PyObject_IsTrue(values[2]); if (unlikely((__pyx_v_dtype_is_object == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 317; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    } else {
      __pyx_v_dtype_is_object = ((int)0);
    }
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[7]; __pyx_lineno = 317; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("View.MemoryView.memoryview.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_memoryview_MemoryView_10memoryview___cinit__(((struct __pyx_memoryview_obj *)__pyx_v_self), __pyx_v_obj, __pyx_v_flags, __pyx_v_dtype_is_object);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_memoryview_MemoryView_10memoryview___cinit__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_obj, int __pyx_v_flags, int __pyx_v_dtype_is_object) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  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("__cinit__", 0);

  /* "View.MemoryView":318
 * 
 *     def __cinit__(memoryview self, object obj, int flags, bint dtype_is_object=False):
 *         self.obj = obj             # <<<<<<<<<<<<<<
 *         self.flags = flags
 *         if type(self) is memoryview or obj is not None:
 */
  __Pyx_INCREF(__pyx_v_obj);
  __Pyx_GIVEREF(__pyx_v_obj);
  __Pyx_GOTREF(__pyx_v_self->obj);
  __Pyx_DECREF(__pyx_v_self->obj);
  __pyx_v_self->obj = __pyx_v_obj;

  /* "View.MemoryView":319
 *     def __cinit__(memoryview self, object obj, int flags, bint dtype_is_object=False):
 *         self.obj = obj
 *         self.flags = flags             # <<<<<<<<<<<<<<
 *         if type(self) is memoryview or obj is not None:
 *             __Pyx_GetBuffer(obj, &self.view, flags)
 */
  __pyx_v_self->flags = __pyx_v_flags;

  /* "View.MemoryView":320
 *         self.obj = obj
 *         self.flags = flags
 *         if type(self) is memoryview or obj is not None:             # <<<<<<<<<<<<<<
 *             __Pyx_GetBuffer(obj, &self.view, flags)
 *             if <PyObject *> self.view.obj == NULL:
 */
  __pyx_t_1 = (((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))) == ((PyObject *)((PyObject *)__pyx_memoryview_type)));
  if (!(__pyx_t_1 != 0)) {
    __pyx_t_2 = (__pyx_v_obj != Py_None);
    __pyx_t_3 = (__pyx_t_2 != 0);
  } else {
    __pyx_t_3 = (__pyx_t_1 != 0);
  }
  if (__pyx_t_3) {

    /* "View.MemoryView":321
 *         self.flags = flags
 *         if type(self) is memoryview or obj is not None:
 *             __Pyx_GetBuffer(obj, &self.view, flags)             # <<<<<<<<<<<<<<
 *             if <PyObject *> self.view.obj == NULL:
 *                 (<__pyx_buffer *> &self.view).obj = Py_None
 */
    __pyx_t_4 = __Pyx_GetBuffer(__pyx_v_obj, (&__pyx_v_self->view), __pyx_v_flags); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 321; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

    /* "View.MemoryView":322
 *         if type(self) is memoryview or obj is not None:
 *             __Pyx_GetBuffer(obj, &self.view, flags)
 *             if <PyObject *> self.view.obj == NULL:             # <<<<<<<<<<<<<<
 *                 (<__pyx_buffer *> &self.view).obj = Py_None
 *                 Py_INCREF(Py_None)
 */
    __pyx_t_3 = ((((PyObject *)__pyx_v_self->view.obj) == NULL) != 0);
    if (__pyx_t_3) {

      /* "View.MemoryView":323
 *             __Pyx_GetBuffer(obj, &self.view, flags)
 *             if <PyObject *> self.view.obj == NULL:
 *                 (<__pyx_buffer *> &self.view).obj = Py_None             # <<<<<<<<<<<<<<
 *                 Py_INCREF(Py_None)
 * 
 */
      ((Py_buffer *)(&__pyx_v_self->view))->obj = Py_None;

      /* "View.MemoryView":324
 *             if <PyObject *> self.view.obj == NULL:
 *                 (<__pyx_buffer *> &self.view).obj = Py_None
 *                 Py_INCREF(Py_None)             # <<<<<<<<<<<<<<
 * 
 *         self.lock = PyThread_allocate_lock()
 */
      Py_INCREF(Py_None);
      goto __pyx_L4;
    }
    __pyx_L4:;
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "View.MemoryView":326
 *                 Py_INCREF(Py_None)
 * 
 *         self.lock = PyThread_allocate_lock()             # <<<<<<<<<<<<<<
 *         if self.lock == NULL:
 *             raise MemoryError
 */
  __pyx_v_self->lock = PyThread_allocate_lock();

  /* "View.MemoryView":327
 * 
 *         self.lock = PyThread_allocate_lock()
 *         if self.lock == NULL:             # <<<<<<<<<<<<<<
 *             raise MemoryError
 * 
 */
  __pyx_t_3 = ((__pyx_v_self->lock == NULL) != 0);
  if (__pyx_t_3) {

    /* "View.MemoryView":328
 *         self.lock = PyThread_allocate_lock()
 *         if self.lock == NULL:
 *             raise MemoryError             # <<<<<<<<<<<<<<
 * 
 *         if flags & PyBUF_FORMAT:
 */
    PyErr_NoMemory(); {__pyx_filename = __pyx_f[7]; __pyx_lineno = 328; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }

  /* "View.MemoryView":330
 *             raise MemoryError
 * 
 *         if flags & PyBUF_FORMAT:             # <<<<<<<<<<<<<<
 *             self.dtype_is_object = self.view.format == b'O'
 *         else:
 */
  __pyx_t_3 = ((__pyx_v_flags & PyBUF_FORMAT) != 0);
  if (__pyx_t_3) {

    /* "View.MemoryView":331
 * 
 *         if flags & PyBUF_FORMAT:
 *             self.dtype_is_object = self.view.format == b'O'             # <<<<<<<<<<<<<<
 *         else:
 *             self.dtype_is_object = dtype_is_object
 */
    __pyx_t_5 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 331; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = PyObject_RichCompare(__pyx_t_5, __pyx_n_b_O, Py_EQ); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 331; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 331; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_v_self->dtype_is_object = __pyx_t_3;
    goto __pyx_L6;
  }
  /*else*/ {

    /* "View.MemoryView":333
 *             self.dtype_is_object = self.view.format == b'O'
 *         else:
 *             self.dtype_is_object = dtype_is_object             # <<<<<<<<<<<<<<
 * 
 *         self.acquisition_count_aligned_p = <__pyx_atomic_int *> align_pointer(
 */
    __pyx_v_self->dtype_is_object = __pyx_v_dtype_is_object;
  }
  __pyx_L6:;

  /* "View.MemoryView":335
 *             self.dtype_is_object = dtype_is_object
 * 
 *         self.acquisition_count_aligned_p = <__pyx_atomic_int *> align_pointer(             # <<<<<<<<<<<<<<
 *                   <void *> &self.acquisition_count[0], sizeof(__pyx_atomic_int))
 *         self.typeinfo = NULL
 */
  __pyx_v_self->acquisition_count_aligned_p = ((__pyx_atomic_int *)__pyx_align_pointer(((void *)(&(__pyx_v_self->acquisition_count[0]))), (sizeof(__pyx_atomic_int))));

  /* "View.MemoryView":337
 *         self.acquisition_count_aligned_p = <__pyx_atomic_int *> align_pointer(
 *                   <void *> &self.acquisition_count[0], sizeof(__pyx_atomic_int))
 *         self.typeinfo = NULL             # <<<<<<<<<<<<<<
 * 
 *     def __dealloc__(memoryview self):
 */
  __pyx_v_self->typeinfo = NULL;

  /* "View.MemoryView":317
 *     cdef __Pyx_TypeInfo *typeinfo
 * 
 *     def __cinit__(memoryview self, object obj, int flags, bint dtype_is_object=False):             # <<<<<<<<<<<<<<
 *         self.obj = obj
 *         self.flags = flags
 */

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("View.MemoryView.memoryview.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "View.MemoryView":339
 *         self.typeinfo = NULL
 * 
 *     def __dealloc__(memoryview self):             # <<<<<<<<<<<<<<
 *         if self.obj is not None:
 *             __Pyx_ReleaseBuffer(&self.view)
 */

/* Python wrapper */
static void __pyx_memoryview___dealloc__(PyObject *__pyx_v_self); /*proto*/
static void __pyx_memoryview___dealloc__(PyObject *__pyx_v_self) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
  __pyx_memoryview_MemoryView_10memoryview_2__dealloc__(((struct __pyx_memoryview_obj *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
}

static void __pyx_memoryview_MemoryView_10memoryview_2__dealloc__(struct __pyx_memoryview_obj *__pyx_v_self) {
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  __Pyx_RefNannySetupContext("__dealloc__", 0);

  /* "View.MemoryView":340
 * 
 *     def __dealloc__(memoryview self):
 *         if self.obj is not None:             # <<<<<<<<<<<<<<
 *             __Pyx_ReleaseBuffer(&self.view)
 * 
 */
  __pyx_t_1 = (__pyx_v_self->obj != Py_None);
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (__pyx_t_2) {

    /* "View.MemoryView":341
 *     def __dealloc__(memoryview self):
 *         if self.obj is not None:
 *             __Pyx_ReleaseBuffer(&self.view)             # <<<<<<<<<<<<<<
 * 
 *         if self.lock != NULL:
 */
    __Pyx_ReleaseBuffer((&__pyx_v_self->view));
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "View.MemoryView":343
 *             __Pyx_ReleaseBuffer(&self.view)
 * 
 *         if self.lock != NULL:             # <<<<<<<<<<<<<<
 *             PyThread_free_lock(self.lock)
 * 
 */
  __pyx_t_2 = ((__pyx_v_self->lock != NULL) != 0);
  if (__pyx_t_2) {

    /* "View.MemoryView":344
 * 
 *         if self.lock != NULL:
 *             PyThread_free_lock(self.lock)             # <<<<<<<<<<<<<<
 * 
 *     cdef char *get_item_pointer(memoryview self, object index) except NULL:
 */
    PyThread_free_lock(__pyx_v_self->lock);
    goto __pyx_L4;
  }
  __pyx_L4:;

  /* "View.MemoryView":339
 *         self.typeinfo = NULL
 * 
 *     def __dealloc__(memoryview self):             # <<<<<<<<<<<<<<
 *         if self.obj is not None:
 *             __Pyx_ReleaseBuffer(&self.view)
 */

  /* function exit code */
  __Pyx_RefNannyFinishContext();
}

/* "View.MemoryView":346
 *             PyThread_free_lock(self.lock)
 * 
 *     cdef char *get_item_pointer(memoryview self, object index) except NULL:             # <<<<<<<<<<<<<<
 *         cdef Py_ssize_t dim
 *         cdef char *itemp = <char *> self.view.buf
 */

static char *__pyx_memoryview_get_item_pointer(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index) {
  Py_ssize_t __pyx_v_dim;
  char *__pyx_v_itemp;
  PyObject *__pyx_v_idx = NULL;
  char *__pyx_r;
  __Pyx_RefNannyDeclarations
  Py_ssize_t __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  Py_ssize_t __pyx_t_3;
  PyObject *(*__pyx_t_4)(PyObject *);
  PyObject *__pyx_t_5 = NULL;
  Py_ssize_t __pyx_t_6;
  char *__pyx_t_7;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_item_pointer", 0);

  /* "View.MemoryView":348
 *     cdef char *get_item_pointer(memoryview self, object index) except NULL:
 *         cdef Py_ssize_t dim
 *         cdef char *itemp = <char *> self.view.buf             # <<<<<<<<<<<<<<
 * 
 *         for dim, idx in enumerate(index):
 */
  __pyx_v_itemp = ((char *)__pyx_v_self->view.buf);

  /* "View.MemoryView":350
 *         cdef char *itemp = <char *> self.view.buf
 * 
 *         for dim, idx in enumerate(index):             # <<<<<<<<<<<<<<
 *             itemp = pybuffer_index(&self.view, itemp, idx, dim)
 * 
 */
  __pyx_t_1 = 0;
  if (PyList_CheckExact(__pyx_v_index) || PyTuple_CheckExact(__pyx_v_index)) {
    __pyx_t_2 = __pyx_v_index; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0;
    __pyx_t_4 = NULL;
  } else {
    __pyx_t_3 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_index); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 350; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = Py_TYPE(__pyx_t_2)->tp_iternext;
  }
  for (;;) {
    if (!__pyx_t_4 && PyList_CheckExact(__pyx_t_2)) {
      if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_2)) break;
      #if CYTHON_COMPILING_IN_CPYTHON
      __pyx_t_5 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 350; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #else
      __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 350; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #endif
    } else if (!__pyx_t_4 && PyTuple_CheckExact(__pyx_t_2)) {
      if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
      #if CYTHON_COMPILING_IN_CPYTHON
      __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 350; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #else
      __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 350; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #endif
    } else {
      __pyx_t_5 = __pyx_t_4(__pyx_t_2);
      if (unlikely(!__pyx_t_5)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else {__pyx_filename = __pyx_f[7]; __pyx_lineno = 350; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_5);
    }
    __Pyx_XDECREF_SET(__pyx_v_idx, __pyx_t_5);
    __pyx_t_5 = 0;
    __pyx_v_dim = __pyx_t_1;
    __pyx_t_1 = (__pyx_t_1 + 1);

    /* "View.MemoryView":351
 * 
 *         for dim, idx in enumerate(index):
 *             itemp = pybuffer_index(&self.view, itemp, idx, dim)             # <<<<<<<<<<<<<<
 * 
 *         return itemp
 */
    __pyx_t_6 = __Pyx_PyIndex_AsSsize_t(__pyx_v_idx); if (unlikely((__pyx_t_6 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 351; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_7 = __pyx_pybuffer_index((&__pyx_v_self->view), __pyx_v_itemp, __pyx_t_6, __pyx_v_dim); if (unlikely(__pyx_t_7 == NULL)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 351; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_v_itemp = __pyx_t_7;
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "View.MemoryView":353
 *             itemp = pybuffer_index(&self.view, itemp, idx, dim)
 * 
 *         return itemp             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = __pyx_v_itemp;
  goto __pyx_L0;

  /* "View.MemoryView":346
 *             PyThread_free_lock(self.lock)
 * 
 *     cdef char *get_item_pointer(memoryview self, object index) except NULL:             # <<<<<<<<<<<<<<
 *         cdef Py_ssize_t dim
 *         cdef char *itemp = <char *> self.view.buf
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("View.MemoryView.memoryview.get_item_pointer", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_idx);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "View.MemoryView":356
 * 
 * 
 *     def __getitem__(memoryview self, object index):             # <<<<<<<<<<<<<<
 *         if index is Ellipsis:
 *             return self
 */

/* Python wrapper */
static PyObject *__pyx_memoryview___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index); /*proto*/
static PyObject *__pyx_memoryview___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__getitem__ (wrapper)", 0);
  __pyx_r = __pyx_memoryview_MemoryView_10memoryview_4__getitem__(((struct __pyx_memoryview_obj *)__pyx_v_self), ((PyObject *)__pyx_v_index));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_memoryview_MemoryView_10memoryview_4__getitem__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index) {
  PyObject *__pyx_v_have_slices = NULL;
  PyObject *__pyx_v_indices = NULL;
  char *__pyx_v_itemp;
  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;
  char *__pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__getitem__", 0);

  /* "View.MemoryView":357
 * 
 *     def __getitem__(memoryview self, object index):
 *         if index is Ellipsis:             # <<<<<<<<<<<<<<
 *             return self
 * 
 */
  __pyx_t_1 = (__pyx_v_index == __pyx_builtin_Ellipsis);
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (__pyx_t_2) {

    /* "View.MemoryView":358
 *     def __getitem__(memoryview self, object index):
 *         if index is Ellipsis:
 *             return self             # <<<<<<<<<<<<<<
 * 
 *         have_slices, indices = _unellipsify(index, self.view.ndim)
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(((PyObject *)__pyx_v_self));
    __pyx_r = ((PyObject *)__pyx_v_self);
    goto __pyx_L0;
  }

  /* "View.MemoryView":360
 *             return self
 * 
 *         have_slices, indices = _unellipsify(index, self.view.ndim)             # <<<<<<<<<<<<<<
 * 
 *         cdef char *itemp
 */
  __pyx_t_3 = _unellipsify(__pyx_v_index, __pyx_v_self->view.ndim); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 360; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  if (likely(__pyx_t_3 != Py_None)) {
    PyObject* sequence = __pyx_t_3;
    #if CYTHON_COMPILING_IN_CPYTHON
    Py_ssize_t size = Py_SIZE(sequence);
    #else
    Py_ssize_t size = PySequence_Size(sequence);
    #endif
    if (unlikely(size != 2)) {
      if (size > 2) __Pyx_RaiseTooManyValuesError(2);
      else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
      {__pyx_filename = __pyx_f[7]; __pyx_lineno = 360; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    #if CYTHON_COMPILING_IN_CPYTHON
    __pyx_t_4 = PyTuple_GET_ITEM(sequence, 0); 
    __pyx_t_5 = PyTuple_GET_ITEM(sequence, 1); 
    __Pyx_INCREF(__pyx_t_4);
    __Pyx_INCREF(__pyx_t_5);
    #else
    __pyx_t_4 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 360; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 360; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    #endif
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  } else {
    __Pyx_RaiseNoneNotIterableError(); {__pyx_filename = __pyx_f[7]; __pyx_lineno = 360; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_v_have_slices = __pyx_t_4;
  __pyx_t_4 = 0;
  __pyx_v_indices = __pyx_t_5;
  __pyx_t_5 = 0;

  /* "View.MemoryView":363
 * 
 *         cdef char *itemp
 *         if have_slices:             # <<<<<<<<<<<<<<
 *             return memview_slice(self, indices)
 *         else:
 */
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_have_slices); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 363; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__pyx_t_2) {

    /* "View.MemoryView":364
 *         cdef char *itemp
 *         if have_slices:
 *             return memview_slice(self, indices)             # <<<<<<<<<<<<<<
 *         else:
 *             itemp = self.get_item_pointer(indices)
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_3 = ((PyObject *)__pyx_memview_slice(__pyx_v_self, __pyx_v_indices)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 364; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_r = __pyx_t_3;
    __pyx_t_3 = 0;
    goto __pyx_L0;
  }
  /*else*/ {

    /* "View.MemoryView":366
 *             return memview_slice(self, indices)
 *         else:
 *             itemp = self.get_item_pointer(indices)             # <<<<<<<<<<<<<<
 *             return self.convert_item_to_object(itemp)
 * 
 */
    __pyx_t_6 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->get_item_pointer(__pyx_v_self, __pyx_v_indices); if (unlikely(__pyx_t_6 == NULL)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 366; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_v_itemp = __pyx_t_6;

    /* "View.MemoryView":367
 *         else:
 *             itemp = self.get_item_pointer(indices)
 *             return self.convert_item_to_object(itemp)             # <<<<<<<<<<<<<<
 * 
 *     def __setitem__(memoryview self, object index, object value):
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_3 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->convert_item_to_object(__pyx_v_self, __pyx_v_itemp); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 367; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_r = __pyx_t_3;
    __pyx_t_3 = 0;
    goto __pyx_L0;
  }

  /* "View.MemoryView":356
 * 
 * 
 *     def __getitem__(memoryview self, object index):             # <<<<<<<<<<<<<<
 *         if index is Ellipsis:
 *             return self
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("View.MemoryView.memoryview.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_have_slices);
  __Pyx_XDECREF(__pyx_v_indices);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "View.MemoryView":369
 *             return self.convert_item_to_object(itemp)
 * 
 *     def __setitem__(memoryview self, object index, object value):             # <<<<<<<<<<<<<<
 *         have_slices, index = _unellipsify(index, self.view.ndim)
 * 
 */

/* Python wrapper */
static int __pyx_memoryview___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value); /*proto*/
static int __pyx_memoryview___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setitem__ (wrapper)", 0);
  __pyx_r = __pyx_memoryview_MemoryView_10memoryview_6__setitem__(((struct __pyx_memoryview_obj *)__pyx_v_self), ((PyObject *)__pyx_v_index), ((PyObject *)__pyx_v_value));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_memoryview_MemoryView_10memoryview_6__setitem__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value) {
  PyObject *__pyx_v_have_slices = NULL;
  PyObject *__pyx_v_obj = NULL;
  int __pyx_r;
  __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("__setitem__", 0);
  __Pyx_INCREF(__pyx_v_index);

  /* "View.MemoryView":370
 * 
 *     def __setitem__(memoryview self, object index, object value):
 *         have_slices, index = _unellipsify(index, self.view.ndim)             # <<<<<<<<<<<<<<
 * 
 *         if have_slices:
 */
  __pyx_t_1 = _unellipsify(__pyx_v_index, __pyx_v_self->view.ndim); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 370; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (likely(__pyx_t_1 != Py_None)) {
    PyObject* sequence = __pyx_t_1;
    #if CYTHON_COMPILING_IN_CPYTHON
    Py_ssize_t size = Py_SIZE(sequence);
    #else
    Py_ssize_t size = PySequence_Size(sequence);
    #endif
    if (unlikely(size != 2)) {
      if (size > 2) __Pyx_RaiseTooManyValuesError(2);
      else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
      {__pyx_filename = __pyx_f[7]; __pyx_lineno = 370; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    #if CYTHON_COMPILING_IN_CPYTHON
    __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); 
    __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1); 
    __Pyx_INCREF(__pyx_t_2);
    __Pyx_INCREF(__pyx_t_3);
    #else
    __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 370; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 370; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    #endif
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  } else {
    __Pyx_RaiseNoneNotIterableError(); {__pyx_filename = __pyx_f[7]; __pyx_lineno = 370; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_v_have_slices = __pyx_t_2;
  __pyx_t_2 = 0;
  __Pyx_DECREF_SET(__pyx_v_index, __pyx_t_3);
  __pyx_t_3 = 0;

  /* "View.MemoryView":372
 *         have_slices, index = _unellipsify(index, self.view.ndim)
 * 
 *         if have_slices:             # <<<<<<<<<<<<<<
 *             obj = self.is_slice(value)
 *             if obj:
 */
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_have_slices); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 372; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__pyx_t_4) {

    /* "View.MemoryView":373
 * 
 *         if have_slices:
 *             obj = self.is_slice(value)             # <<<<<<<<<<<<<<
 *             if obj:
 *                 self.setitem_slice_assignment(self[index], obj)
 */
    __pyx_t_1 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->is_slice(__pyx_v_self, __pyx_v_value); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 373; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_v_obj = __pyx_t_1;
    __pyx_t_1 = 0;

    /* "View.MemoryView":374
 *         if have_slices:
 *             obj = self.is_slice(value)
 *             if obj:             # <<<<<<<<<<<<<<
 *                 self.setitem_slice_assignment(self[index], obj)
 *             else:
 */
    __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_obj); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 374; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    if (__pyx_t_4) {

      /* "View.MemoryView":375
 *             obj = self.is_slice(value)
 *             if obj:
 *                 self.setitem_slice_assignment(self[index], obj)             # <<<<<<<<<<<<<<
 *             else:
 *                 self.setitem_slice_assign_scalar(self[index], value)
 */
      __pyx_t_1 = PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_v_index); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 375; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_3 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->setitem_slice_assignment(__pyx_v_self, __pyx_t_1, __pyx_v_obj); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 375; __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_3); __pyx_t_3 = 0;
      goto __pyx_L4;
    }
    /*else*/ {

      /* "View.MemoryView":377
 *                 self.setitem_slice_assignment(self[index], obj)
 *             else:
 *                 self.setitem_slice_assign_scalar(self[index], value)             # <<<<<<<<<<<<<<
 *         else:
 *             self.setitem_indexed(index, value)
 */
      __pyx_t_3 = PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_v_index); if (unlikely(__pyx_t_3 == NULL)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 377; __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_memoryview_type))))) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 377; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_t_1 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->setitem_slice_assign_scalar(__pyx_v_self, ((struct __pyx_memoryview_obj *)__pyx_t_3), __pyx_v_value); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 377; __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_1); __pyx_t_1 = 0;
    }
    __pyx_L4:;
    goto __pyx_L3;
  }
  /*else*/ {

    /* "View.MemoryView":379
 *                 self.setitem_slice_assign_scalar(self[index], value)
 *         else:
 *             self.setitem_indexed(index, value)             # <<<<<<<<<<<<<<
 * 
 *     cdef is_slice(self, obj):
 */
    __pyx_t_1 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->setitem_indexed(__pyx_v_self, __pyx_v_index, __pyx_v_value); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 379; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }
  __pyx_L3:;

  /* "View.MemoryView":369
 *             return self.convert_item_to_object(itemp)
 * 
 *     def __setitem__(memoryview self, object index, object value):             # <<<<<<<<<<<<<<
 *         have_slices, index = _unellipsify(index, self.view.ndim)
 * 
 */

  /* function exit code */
  __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("View.MemoryView.memoryview.__setitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_have_slices);
  __Pyx_XDECREF(__pyx_v_obj);
  __Pyx_XDECREF(__pyx_v_index);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "View.MemoryView":381
 *             self.setitem_indexed(index, value)
 * 
 *     cdef is_slice(self, obj):             # <<<<<<<<<<<<<<
 *         if not isinstance(obj, memoryview):
 *             try:
 */

static PyObject *__pyx_memoryview_is_slice(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_obj) {
  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;
  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("is_slice", 0);
  __Pyx_INCREF(__pyx_v_obj);

  /* "View.MemoryView":382
 * 
 *     cdef is_slice(self, obj):
 *         if not isinstance(obj, memoryview):             # <<<<<<<<<<<<<<
 *             try:
 *                 obj = memoryview(obj, self.flags|PyBUF_ANY_CONTIGUOUS,
 */
  __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_obj, ((PyObject *)__pyx_memoryview_type)); 
  __pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0);
  if (__pyx_t_2) {

    /* "View.MemoryView":383
 *     cdef is_slice(self, obj):
 *         if not isinstance(obj, memoryview):
 *             try:             # <<<<<<<<<<<<<<
 *                 obj = memoryview(obj, self.flags|PyBUF_ANY_CONTIGUOUS,
 *                                  self.dtype_is_object)
 */
    {
      __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:*/ {

        /* "View.MemoryView":384
 *         if not isinstance(obj, memoryview):
 *             try:
 *                 obj = memoryview(obj, self.flags|PyBUF_ANY_CONTIGUOUS,             # <<<<<<<<<<<<<<
 *                                  self.dtype_is_object)
 *             except TypeError:
 */
        __pyx_t_6 = __Pyx_PyInt_From_int((__pyx_v_self->flags | PyBUF_ANY_CONTIGUOUS)); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 384; __pyx_clineno = __LINE__; goto __pyx_L4_error;}
        __Pyx_GOTREF(__pyx_t_6);

        /* "View.MemoryView":385
 *             try:
 *                 obj = memoryview(obj, self.flags|PyBUF_ANY_CONTIGUOUS,
 *                                  self.dtype_is_object)             # <<<<<<<<<<<<<<
 *             except TypeError:
 *                 return None
 */
        __pyx_t_7 = __Pyx_PyBool_FromLong(__pyx_v_self->dtype_is_object); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 385; __pyx_clineno = __LINE__; goto __pyx_L4_error;}
        __Pyx_GOTREF(__pyx_t_7);

        /* "View.MemoryView":384
 *         if not isinstance(obj, memoryview):
 *             try:
 *                 obj = memoryview(obj, self.flags|PyBUF_ANY_CONTIGUOUS,             # <<<<<<<<<<<<<<
 *                                  self.dtype_is_object)
 *             except TypeError:
 */
        __pyx_t_8 = PyTuple_New(3); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 384; __pyx_clineno = __LINE__; goto __pyx_L4_error;}
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_INCREF(__pyx_v_obj);
        PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_v_obj);
        __Pyx_GIVEREF(__pyx_v_obj);
        PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_6);
        __Pyx_GIVEREF(__pyx_t_6);
        PyTuple_SET_ITEM(__pyx_t_8, 2, __pyx_t_7);
        __Pyx_GIVEREF(__pyx_t_7);
        __pyx_t_6 = 0;
        __pyx_t_7 = 0;
        __pyx_t_7 = __Pyx_PyObject_Call(((PyObject *)((PyObject *)__pyx_memoryview_type)), __pyx_t_8, NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 384; __pyx_clineno = __LINE__; goto __pyx_L4_error;}
        __Pyx_GOTREF(__pyx_t_7);
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __Pyx_DECREF_SET(__pyx_v_obj, __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_L11_try_end;
      __pyx_L4_error:;
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;

      /* "View.MemoryView":386
 *                 obj = memoryview(obj, self.flags|PyBUF_ANY_CONTIGUOUS,
 *                                  self.dtype_is_object)
 *             except TypeError:             # <<<<<<<<<<<<<<
 *                 return None
 * 
 */
      __pyx_t_9 = PyErr_ExceptionMatches(__pyx_builtin_TypeError);
      if (__pyx_t_9) {
        __Pyx_AddTraceback("View.MemoryView.memoryview.is_slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
        if (__Pyx_GetException(&__pyx_t_7, &__pyx_t_8, &__pyx_t_6) < 0) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 386; __pyx_clineno = __LINE__; goto __pyx_L6_except_error;}
        __Pyx_GOTREF(__pyx_t_7);
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_GOTREF(__pyx_t_6);

        /* "View.MemoryView":387
 *                                  self.dtype_is_object)
 *             except TypeError:
 *                 return None             # <<<<<<<<<<<<<<
 * 
 *         return obj
 */
        __Pyx_XDECREF(__pyx_r);
        __Pyx_INCREF(Py_None);
        __pyx_r = Py_None;
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 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_6); __pyx_t_6 = 0;
        goto __pyx_L5_exception_handled;
      }
      goto __pyx_L6_except_error;
      __pyx_L6_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_L1_error;
      __pyx_L7_except_return:;
      __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_L0;
      __pyx_L5_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_L11_try_end:;
    }
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "View.MemoryView":389
 *                 return None
 * 
 *         return obj             # <<<<<<<<<<<<<<
 * 
 *     cdef setitem_slice_assignment(self, dst, src):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_obj);
  __pyx_r = __pyx_v_obj;
  goto __pyx_L0;

  /* "View.MemoryView":381
 *             self.setitem_indexed(index, value)
 * 
 *     cdef is_slice(self, obj):             # <<<<<<<<<<<<<<
 *         if not isinstance(obj, memoryview):
 *             try:
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_AddTraceback("View.MemoryView.memoryview.is_slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_obj);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "View.MemoryView":391
 *         return obj
 * 
 *     cdef setitem_slice_assignment(self, dst, src):             # <<<<<<<<<<<<<<
 *         cdef __Pyx_memviewslice dst_slice
 *         cdef __Pyx_memviewslice src_slice
 */

static PyObject *__pyx_memoryview_setitem_slice_assignment(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_dst, PyObject *__pyx_v_src) {
  __Pyx_memviewslice __pyx_v_dst_slice;
  __Pyx_memviewslice __pyx_v_src_slice;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  int __pyx_t_3;
  int __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("setitem_slice_assignment", 0);

  /* "View.MemoryView":395
 *         cdef __Pyx_memviewslice src_slice
 * 
 *         memoryview_copy_contents(get_slice_from_memview(src, &src_slice)[0],             # <<<<<<<<<<<<<<
 *                                  get_slice_from_memview(dst, &dst_slice)[0],
 *                                  src.ndim, dst.ndim, self.dtype_is_object)
 */
  if (!(likely(((__pyx_v_src) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_src, __pyx_memoryview_type))))) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 395; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "View.MemoryView":396
 * 
 *         memoryview_copy_contents(get_slice_from_memview(src, &src_slice)[0],
 *                                  get_slice_from_memview(dst, &dst_slice)[0],             # <<<<<<<<<<<<<<
 *                                  src.ndim, dst.ndim, self.dtype_is_object)
 * 
 */
  if (!(likely(((__pyx_v_dst) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_dst, __pyx_memoryview_type))))) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 396; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "View.MemoryView":397
 *         memoryview_copy_contents(get_slice_from_memview(src, &src_slice)[0],
 *                                  get_slice_from_memview(dst, &dst_slice)[0],
 *                                  src.ndim, dst.ndim, self.dtype_is_object)             # <<<<<<<<<<<<<<
 * 
 *     cdef setitem_slice_assign_scalar(self, memoryview dst, value):
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_src, __pyx_n_s_ndim); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 397; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 397; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_dst, __pyx_n_s_ndim); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 397; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 397; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "View.MemoryView":395
 *         cdef __Pyx_memviewslice src_slice
 * 
 *         memoryview_copy_contents(get_slice_from_memview(src, &src_slice)[0],             # <<<<<<<<<<<<<<
 *                                  get_slice_from_memview(dst, &dst_slice)[0],
 *                                  src.ndim, dst.ndim, self.dtype_is_object)
 */
  __pyx_t_4 = __pyx_memoryview_copy_contents((__pyx_memoryview_get_slice_from_memoryview(((struct __pyx_memoryview_obj *)__pyx_v_src), (&__pyx_v_src_slice))[0]), (__pyx_memoryview_get_slice_from_memoryview(((struct __pyx_memoryview_obj *)__pyx_v_dst), (&__pyx_v_dst_slice))[0]), __pyx_t_2, __pyx_t_3, __pyx_v_self->dtype_is_object); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 395; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "View.MemoryView":391
 *         return obj
 * 
 *     cdef setitem_slice_assignment(self, dst, src):             # <<<<<<<<<<<<<<
 *         cdef __Pyx_memviewslice dst_slice
 *         cdef __Pyx_memviewslice src_slice
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("View.MemoryView.memoryview.setitem_slice_assignment", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "View.MemoryView":399
 *                                  src.ndim, dst.ndim, self.dtype_is_object)
 * 
 *     cdef setitem_slice_assign_scalar(self, memoryview dst, value):             # <<<<<<<<<<<<<<
 *         cdef int array[128]
 *         cdef void *tmp = NULL
 */

static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memoryview_obj *__pyx_v_self, struct __pyx_memoryview_obj *__pyx_v_dst, PyObject *__pyx_v_value) {
  int __pyx_v_array[128];
  void *__pyx_v_tmp;
  void *__pyx_v_item;
  __Pyx_memviewslice *__pyx_v_dst_slice;
  __Pyx_memviewslice __pyx_v_tmp_slice;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  int __pyx_t_4;
  char const *__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 = NULL;
  PyObject *__pyx_t_11 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("setitem_slice_assign_scalar", 0);

  /* "View.MemoryView":401
 *     cdef setitem_slice_assign_scalar(self, memoryview dst, value):
 *         cdef int array[128]
 *         cdef void *tmp = NULL             # <<<<<<<<<<<<<<
 *         cdef void *item
 * 
 */
  __pyx_v_tmp = NULL;

  /* "View.MemoryView":406
 *         cdef __Pyx_memviewslice *dst_slice
 *         cdef __Pyx_memviewslice tmp_slice
 *         dst_slice = get_slice_from_memview(dst, &tmp_slice)             # <<<<<<<<<<<<<<
 * 
 *         if <size_t>self.view.itemsize > sizeof(array):
 */
  __pyx_v_dst_slice = __pyx_memoryview_get_slice_from_memoryview(__pyx_v_dst, (&__pyx_v_tmp_slice));

  /* "View.MemoryView":408
 *         dst_slice = get_slice_from_memview(dst, &tmp_slice)
 * 
 *         if <size_t>self.view.itemsize > sizeof(array):             # <<<<<<<<<<<<<<
 *             tmp = PyMem_Malloc(self.view.itemsize)
 *             if tmp == NULL:
 */
  __pyx_t_1 = ((((size_t)__pyx_v_self->view.itemsize) > (sizeof(__pyx_v_array))) != 0);
  if (__pyx_t_1) {

    /* "View.MemoryView":409
 * 
 *         if <size_t>self.view.itemsize > sizeof(array):
 *             tmp = PyMem_Malloc(self.view.itemsize)             # <<<<<<<<<<<<<<
 *             if tmp == NULL:
 *                 raise MemoryError
 */
    __pyx_v_tmp = PyMem_Malloc(__pyx_v_self->view.itemsize);

    /* "View.MemoryView":410
 *         if <size_t>self.view.itemsize > sizeof(array):
 *             tmp = PyMem_Malloc(self.view.itemsize)
 *             if tmp == NULL:             # <<<<<<<<<<<<<<
 *                 raise MemoryError
 *             item = tmp
 */
    __pyx_t_1 = ((__pyx_v_tmp == NULL) != 0);
    if (__pyx_t_1) {

      /* "View.MemoryView":411
 *             tmp = PyMem_Malloc(self.view.itemsize)
 *             if tmp == NULL:
 *                 raise MemoryError             # <<<<<<<<<<<<<<
 *             item = tmp
 *         else:
 */
      PyErr_NoMemory(); {__pyx_filename = __pyx_f[7]; __pyx_lineno = 411; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }

    /* "View.MemoryView":412
 *             if tmp == NULL:
 *                 raise MemoryError
 *             item = tmp             # <<<<<<<<<<<<<<
 *         else:
 *             item = <void *> array
 */
    __pyx_v_item = __pyx_v_tmp;
    goto __pyx_L3;
  }
  /*else*/ {

    /* "View.MemoryView":414
 *             item = tmp
 *         else:
 *             item = <void *> array             # <<<<<<<<<<<<<<
 * 
 *         try:
 */
    __pyx_v_item = ((void *)__pyx_v_array);
  }
  __pyx_L3:;

  /* "View.MemoryView":416
 *             item = <void *> array
 * 
 *         try:             # <<<<<<<<<<<<<<
 *             if self.dtype_is_object:
 *                 (<PyObject **> item)[0] = <PyObject *> value
 */
  /*try:*/ {

    /* "View.MemoryView":417
 * 
 *         try:
 *             if self.dtype_is_object:             # <<<<<<<<<<<<<<
 *                 (<PyObject **> item)[0] = <PyObject *> value
 *             else:
 */
    __pyx_t_1 = (__pyx_v_self->dtype_is_object != 0);
    if (__pyx_t_1) {

      /* "View.MemoryView":418
 *         try:
 *             if self.dtype_is_object:
 *                 (<PyObject **> item)[0] = <PyObject *> value             # <<<<<<<<<<<<<<
 *             else:
 *                 self.assign_item_from_object(<char *> item, value)
 */
      (((PyObject **)__pyx_v_item)[0]) = ((PyObject *)__pyx_v_value);
      goto __pyx_L8;
    }
    /*else*/ {

      /* "View.MemoryView":420
 *                 (<PyObject **> item)[0] = <PyObject *> value
 *             else:
 *                 self.assign_item_from_object(<char *> item, value)             # <<<<<<<<<<<<<<
 * 
 * 
 */
      __pyx_t_2 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->assign_item_from_object(__pyx_v_self, ((char *)__pyx_v_item), __pyx_v_value); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 420; __pyx_clineno = __LINE__; goto __pyx_L6_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    }
    __pyx_L8:;

    /* "View.MemoryView":424
 * 
 * 
 *             if self.view.suboffsets != NULL:             # <<<<<<<<<<<<<<
 *                 assert_direct_dimensions(self.view.suboffsets, self.view.ndim)
 *             slice_assign_scalar(dst_slice, dst.view.ndim, self.view.itemsize,
 */
    __pyx_t_1 = ((__pyx_v_self->view.suboffsets != NULL) != 0);
    if (__pyx_t_1) {

      /* "View.MemoryView":425
 * 
 *             if self.view.suboffsets != NULL:
 *                 assert_direct_dimensions(self.view.suboffsets, self.view.ndim)             # <<<<<<<<<<<<<<
 *             slice_assign_scalar(dst_slice, dst.view.ndim, self.view.itemsize,
 *                                 item, self.dtype_is_object)
 */
      __pyx_t_2 = assert_direct_dimensions(__pyx_v_self->view.suboffsets, __pyx_v_self->view.ndim); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 425; __pyx_clineno = __LINE__; goto __pyx_L6_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      goto __pyx_L9;
    }
    __pyx_L9:;

    /* "View.MemoryView":426
 *             if self.view.suboffsets != NULL:
 *                 assert_direct_dimensions(self.view.suboffsets, self.view.ndim)
 *             slice_assign_scalar(dst_slice, dst.view.ndim, self.view.itemsize,             # <<<<<<<<<<<<<<
 *                                 item, self.dtype_is_object)
 *         finally:
 */
    __pyx_memoryview_slice_assign_scalar(__pyx_v_dst_slice, __pyx_v_dst->view.ndim, __pyx_v_self->view.itemsize, __pyx_v_item, __pyx_v_self->dtype_is_object);
  }

  /* "View.MemoryView":429
 *                                 item, self.dtype_is_object)
 *         finally:
 *             PyMem_Free(tmp)             # <<<<<<<<<<<<<<
 * 
 *     cdef setitem_indexed(self, index, value):
 */
  /*finally:*/ {
    /*normal exit:*/{
      PyMem_Free(__pyx_v_tmp);
      goto __pyx_L7;
    }
    /*exception exit:*/{
      __pyx_L6_error:;
      __pyx_t_6 = 0; __pyx_t_7 = 0; __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0;
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_9, &__pyx_t_10, &__pyx_t_11);
      if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8) < 0)) __Pyx_ErrFetch(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8);
      __Pyx_XGOTREF(__pyx_t_6);
      __Pyx_XGOTREF(__pyx_t_7);
      __Pyx_XGOTREF(__pyx_t_8);
      __Pyx_XGOTREF(__pyx_t_9);
      __Pyx_XGOTREF(__pyx_t_10);
      __Pyx_XGOTREF(__pyx_t_11);
      __pyx_t_3 = __pyx_lineno; __pyx_t_4 = __pyx_clineno; __pyx_t_5 = __pyx_filename;
      {
        PyMem_Free(__pyx_v_tmp);
      }
      if (PY_MAJOR_VERSION >= 3) {
        __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_XGIVEREF(__pyx_t_6);
      __Pyx_XGIVEREF(__pyx_t_7);
      __Pyx_XGIVEREF(__pyx_t_8);
      __Pyx_ErrRestore(__pyx_t_6, __pyx_t_7, __pyx_t_8);
      __pyx_t_6 = 0; __pyx_t_7 = 0; __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0;
      __pyx_lineno = __pyx_t_3; __pyx_clineno = __pyx_t_4; __pyx_filename = __pyx_t_5;
      goto __pyx_L1_error;
    }
    __pyx_L7:;
  }

  /* "View.MemoryView":399
 *                                  src.ndim, dst.ndim, self.dtype_is_object)
 * 
 *     cdef setitem_slice_assign_scalar(self, memoryview dst, value):             # <<<<<<<<<<<<<<
 *         cdef int array[128]
 *         cdef void *tmp = NULL
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("View.MemoryView.memoryview.setitem_slice_assign_scalar", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "View.MemoryView":431
 *             PyMem_Free(tmp)
 * 
 *     cdef setitem_indexed(self, index, value):             # <<<<<<<<<<<<<<
 *         cdef char *itemp = self.get_item_pointer(index)
 *         self.assign_item_from_object(itemp, value)
 */

static PyObject *__pyx_memoryview_setitem_indexed(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value) {
  char *__pyx_v_itemp;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  char *__pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("setitem_indexed", 0);

  /* "View.MemoryView":432
 * 
 *     cdef setitem_indexed(self, index, value):
 *         cdef char *itemp = self.get_item_pointer(index)             # <<<<<<<<<<<<<<
 *         self.assign_item_from_object(itemp, value)
 * 
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->get_item_pointer(__pyx_v_self, __pyx_v_index); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 432; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_itemp = __pyx_t_1;

  /* "View.MemoryView":433
 *     cdef setitem_indexed(self, index, value):
 *         cdef char *itemp = self.get_item_pointer(index)
 *         self.assign_item_from_object(itemp, value)             # <<<<<<<<<<<<<<
 * 
 *     cdef convert_item_to_object(self, char *itemp):
 */
  __pyx_t_2 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->assign_item_from_object(__pyx_v_self, __pyx_v_itemp, __pyx_v_value); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 433; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "View.MemoryView":431
 *             PyMem_Free(tmp)
 * 
 *     cdef setitem_indexed(self, index, value):             # <<<<<<<<<<<<<<
 *         cdef char *itemp = self.get_item_pointer(index)
 *         self.assign_item_from_object(itemp, value)
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("View.MemoryView.memoryview.setitem_indexed", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "View.MemoryView":435
 *         self.assign_item_from_object(itemp, value)
 * 
 *     cdef convert_item_to_object(self, char *itemp):             # <<<<<<<<<<<<<<
 *         """Only used if instantiated manually by the user, or if Cython doesn't
 *         know how to convert the type"""
 */

static PyObject *__pyx_memoryview_convert_item_to_object(struct __pyx_memoryview_obj *__pyx_v_self, char *__pyx_v_itemp) {
  PyObject *__pyx_v_struct = NULL;
  PyObject *__pyx_v_bytesitem = 0;
  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;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  size_t __pyx_t_7;
  int __pyx_t_8;
  int __pyx_t_9;
  PyObject *__pyx_t_10 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("convert_item_to_object", 0);

  /* "View.MemoryView":438
 *         """Only used if instantiated manually by the user, or if Cython doesn't
 *         know how to convert the type"""
 *         import struct             # <<<<<<<<<<<<<<
 *         cdef bytes bytesitem
 * 
 */
  __pyx_t_1 = __Pyx_Import(__pyx_n_s_struct, 0, -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 438; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_struct = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "View.MemoryView":441
 *         cdef bytes bytesitem
 * 
 *         bytesitem = itemp[:self.view.itemsize]             # <<<<<<<<<<<<<<
 *         try:
 *             result = struct.unpack(self.view.format, bytesitem)
 */
  __pyx_t_1 = __Pyx_PyBytes_FromStringAndSize(__pyx_v_itemp + 0, __pyx_v_self->view.itemsize - 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 441; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_bytesitem = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "View.MemoryView":442
 * 
 *         bytesitem = itemp[:self.view.itemsize]
 *         try:             # <<<<<<<<<<<<<<
 *             result = struct.unpack(self.view.format, bytesitem)
 *         except struct.error:
 */
  {
    __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:*/ {

      /* "View.MemoryView":443
 *         bytesitem = itemp[:self.view.itemsize]
 *         try:
 *             result = struct.unpack(self.view.format, bytesitem)             # <<<<<<<<<<<<<<
 *         except struct.error:
 *             raise ValueError("Unable to convert item to object")
 */
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_unpack); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 443; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_5 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 443; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 443; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      __Pyx_GOTREF(__pyx_t_6);
      PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5);
      __Pyx_GIVEREF(__pyx_t_5);
      __Pyx_INCREF(__pyx_v_bytesitem);
      PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_v_bytesitem);
      __Pyx_GIVEREF(__pyx_v_bytesitem);
      __pyx_t_5 = 0;
      __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_6, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 443; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_v_result = __pyx_t_5;
      __pyx_t_5 = 0;
    }
    /*else:*/ {

      /* "View.MemoryView":447
 *             raise ValueError("Unable to convert item to object")
 *         else:
 *             if len(self.view.format) == 1:             # <<<<<<<<<<<<<<
 *                 return result[0]
 *             return result
 */
      __pyx_t_7 = strlen(__pyx_v_self->view.format); 
      __pyx_t_8 = ((__pyx_t_7 == 1) != 0);
      if (__pyx_t_8) {

        /* "View.MemoryView":448
 *         else:
 *             if len(self.view.format) == 1:
 *                 return result[0]             # <<<<<<<<<<<<<<
 *             return result
 * 
 */
        __Pyx_XDECREF(__pyx_r);
        __pyx_t_5 = __Pyx_GetItemInt(__pyx_v_result, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_5 == NULL)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 448; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;};
        __Pyx_GOTREF(__pyx_t_5);
        __pyx_r = __pyx_t_5;
        __pyx_t_5 = 0;
        goto __pyx_L6_except_return;
      }

      /* "View.MemoryView":449
 *             if len(self.view.format) == 1:
 *                 return result[0]
 *             return result             # <<<<<<<<<<<<<<
 * 
 *     cdef assign_item_from_object(self, char *itemp, object value):
 */
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(__pyx_v_result);
      __pyx_r = __pyx_v_result;
      goto __pyx_L6_except_return;
    }
    __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_L10_try_end;
    __pyx_L3_error:;
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "View.MemoryView":444
 *         try:
 *             result = struct.unpack(self.view.format, bytesitem)
 *         except struct.error:             # <<<<<<<<<<<<<<
 *             raise ValueError("Unable to convert item to object")
 *         else:
 */
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_error); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 444; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_9 = PyErr_ExceptionMatches(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (__pyx_t_9) {
      __Pyx_AddTraceback("View.MemoryView.memoryview.convert_item_to_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_1) < 0) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 444; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_GOTREF(__pyx_t_1);

      /* "View.MemoryView":445
 *             result = struct.unpack(self.view.format, bytesitem)
 *         except struct.error:
 *             raise ValueError("Unable to convert item to object")             # <<<<<<<<<<<<<<
 *         else:
 *             if len(self.view.format) == 1:
 */
      __pyx_t_10 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__227, NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 445; __pyx_clineno = __LINE__; goto __pyx_L5_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[7]; __pyx_lineno = 445; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L4_exception_handled;
    }
    goto __pyx_L5_except_error;
    __pyx_L5_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_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_L4_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_L10_try_end:;
  }

  /* "View.MemoryView":435
 *         self.assign_item_from_object(itemp, value)
 * 
 *     cdef convert_item_to_object(self, char *itemp):             # <<<<<<<<<<<<<<
 *         """Only used if instantiated manually by the user, or if Cython doesn't
 *         know how to convert the type"""
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_AddTraceback("View.MemoryView.memoryview.convert_item_to_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_struct);
  __Pyx_XDECREF(__pyx_v_bytesitem);
  __Pyx_XDECREF(__pyx_v_result);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "View.MemoryView":451
 *             return result
 * 
 *     cdef assign_item_from_object(self, char *itemp, object value):             # <<<<<<<<<<<<<<
 *         """Only used if instantiated manually by the user, or if Cython doesn't
 *         know how to convert the type"""
 */

static PyObject *__pyx_memoryview_assign_item_from_object(struct __pyx_memoryview_obj *__pyx_v_self, char *__pyx_v_itemp, PyObject *__pyx_v_value) {
  PyObject *__pyx_v_struct = NULL;
  char __pyx_v_c;
  PyObject *__pyx_v_bytesvalue = 0;
  Py_ssize_t __pyx_v_i;
  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;
  PyObject *__pyx_t_6 = NULL;
  Py_ssize_t __pyx_t_7;
  PyObject *__pyx_t_8 = NULL;
  char *__pyx_t_9;
  char *__pyx_t_10;
  char *__pyx_t_11;
  char *__pyx_t_12;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("assign_item_from_object", 0);

  /* "View.MemoryView":454
 *         """Only used if instantiated manually by the user, or if Cython doesn't
 *         know how to convert the type"""
 *         import struct             # <<<<<<<<<<<<<<
 *         cdef char c
 *         cdef bytes bytesvalue
 */
  __pyx_t_1 = __Pyx_Import(__pyx_n_s_struct, 0, -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 454; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_struct = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "View.MemoryView":459
 *         cdef Py_ssize_t i
 * 
 *         if isinstance(value, tuple):             # <<<<<<<<<<<<<<
 *             bytesvalue = struct.pack(self.view.format, *value)
 *         else:
 */
  __pyx_t_2 = PyTuple_Check(__pyx_v_value); 
  __pyx_t_3 = (__pyx_t_2 != 0);
  if (__pyx_t_3) {

    /* "View.MemoryView":460
 * 
 *         if isinstance(value, tuple):
 *             bytesvalue = struct.pack(self.view.format, *value)             # <<<<<<<<<<<<<<
 *         else:
 *             bytesvalue = struct.pack(self.view.format, value)
 */
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_pack); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 460; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_4 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 460; __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[7]; __pyx_lineno = 460; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__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 = PySequence_Tuple(__pyx_v_value); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 460; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_6 = PyNumber_Add(__pyx_t_5, __pyx_t_4); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 460; __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_4); __pyx_t_4 = 0;
    __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_6, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 460; __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_6); __pyx_t_6 = 0;
    if (!(likely(PyBytes_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_t_4)->tp_name), 0))) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 460; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_v_bytesvalue = ((PyObject*)__pyx_t_4);
    __pyx_t_4 = 0;
    goto __pyx_L3;
  }
  /*else*/ {

    /* "View.MemoryView":462
 *             bytesvalue = struct.pack(self.view.format, *value)
 *         else:
 *             bytesvalue = struct.pack(self.view.format, value)             # <<<<<<<<<<<<<<
 * 
 *         for i, c in enumerate(bytesvalue):
 */
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_pack); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 462; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_6 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 462; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 462; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_6);
    __Pyx_GIVEREF(__pyx_t_6);
    __Pyx_INCREF(__pyx_v_value);
    PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_value);
    __Pyx_GIVEREF(__pyx_v_value);
    __pyx_t_6 = 0;
    __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_1, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 462; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (!(likely(PyBytes_CheckExact(__pyx_t_6))||((__pyx_t_6) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_t_6)->tp_name), 0))) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 462; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_v_bytesvalue = ((PyObject*)__pyx_t_6);
    __pyx_t_6 = 0;
  }
  __pyx_L3:;

  /* "View.MemoryView":464
 *             bytesvalue = struct.pack(self.view.format, value)
 * 
 *         for i, c in enumerate(bytesvalue):             # <<<<<<<<<<<<<<
 *             itemp[i] = c
 * 
 */
  __pyx_t_7 = 0;
  if (unlikely(__pyx_v_bytesvalue == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' is not iterable");
    {__pyx_filename = __pyx_f[7]; __pyx_lineno = 464; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __Pyx_INCREF(__pyx_v_bytesvalue);
  __pyx_t_8 = __pyx_v_bytesvalue;
  __pyx_t_10 = PyBytes_AS_STRING(__pyx_t_8);
  __pyx_t_11 = (__pyx_t_10 + PyBytes_GET_SIZE(__pyx_t_8));
  for (__pyx_t_12 = __pyx_t_10; __pyx_t_12 < __pyx_t_11; __pyx_t_12++) {
    __pyx_t_9 = __pyx_t_12;
    __pyx_v_c = (__pyx_t_9[0]);

    /* "View.MemoryView":465
 * 
 *         for i, c in enumerate(bytesvalue):
 *             itemp[i] = c             # <<<<<<<<<<<<<<
 * 
 *     @cname('getbuffer')
 */
    __pyx_v_i = __pyx_t_7;

    /* "View.MemoryView":464
 *             bytesvalue = struct.pack(self.view.format, value)
 * 
 *         for i, c in enumerate(bytesvalue):             # <<<<<<<<<<<<<<
 *             itemp[i] = c
 * 
 */
    __pyx_t_7 = (__pyx_t_7 + 1);

    /* "View.MemoryView":465
 * 
 *         for i, c in enumerate(bytesvalue):
 *             itemp[i] = c             # <<<<<<<<<<<<<<
 * 
 *     @cname('getbuffer')
 */
    (__pyx_v_itemp[__pyx_v_i]) = __pyx_v_c;
  }
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

  /* "View.MemoryView":451
 *             return result
 * 
 *     cdef assign_item_from_object(self, char *itemp, object value):             # <<<<<<<<<<<<<<
 *         """Only used if instantiated manually by the user, or if Cython doesn't
 *         know how to convert the type"""
 */

  /* function exit code */
  __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);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_AddTraceback("View.MemoryView.memoryview.assign_item_from_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_struct);
  __Pyx_XDECREF(__pyx_v_bytesvalue);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "View.MemoryView":468
 * 
 *     @cname('getbuffer')
 *     def __getbuffer__(self, Py_buffer *info, int flags):             # <<<<<<<<<<<<<<
 *         if flags & PyBUF_STRIDES:
 *             info.shape = self.view.shape
 */

/* Python wrapper */
static CYTHON_UNUSED int __pyx_memoryview_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/
static CYTHON_UNUSED int __pyx_memoryview_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__getbuffer__ (wrapper)", 0);
  __pyx_r = __pyx_memoryview_getbuffer_MemoryView_10memoryview_8__getbuffer__(((struct __pyx_memoryview_obj *)__pyx_v_self), ((Py_buffer *)__pyx_v_info), ((int)__pyx_v_flags));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_memoryview_getbuffer_MemoryView_10memoryview_8__getbuffer__(struct __pyx_memoryview_obj *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  Py_ssize_t *__pyx_t_2;
  char *__pyx_t_3;
  void *__pyx_t_4;
  int __pyx_t_5;
  Py_ssize_t __pyx_t_6;
  __Pyx_RefNannySetupContext("__getbuffer__", 0);
  if (__pyx_v_info != NULL) {
    __pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None);
    __Pyx_GIVEREF(__pyx_v_info->obj);
  }

  /* "View.MemoryView":469
 *     @cname('getbuffer')
 *     def __getbuffer__(self, Py_buffer *info, int flags):
 *         if flags & PyBUF_STRIDES:             # <<<<<<<<<<<<<<
 *             info.shape = self.view.shape
 *         else:
 */
  __pyx_t_1 = ((__pyx_v_flags & PyBUF_STRIDES) != 0);
  if (__pyx_t_1) {

    /* "View.MemoryView":470
 *     def __getbuffer__(self, Py_buffer *info, int flags):
 *         if flags & PyBUF_STRIDES:
 *             info.shape = self.view.shape             # <<<<<<<<<<<<<<
 *         else:
 *             info.shape = NULL
 */
    __pyx_t_2 = __pyx_v_self->view.shape;
    __pyx_v_info->shape = __pyx_t_2;
    goto __pyx_L3;
  }
  /*else*/ {

    /* "View.MemoryView":472
 *             info.shape = self.view.shape
 *         else:
 *             info.shape = NULL             # <<<<<<<<<<<<<<
 * 
 *         if flags & PyBUF_STRIDES:
 */
    __pyx_v_info->shape = NULL;
  }
  __pyx_L3:;

  /* "View.MemoryView":474
 *             info.shape = NULL
 * 
 *         if flags & PyBUF_STRIDES:             # <<<<<<<<<<<<<<
 *             info.strides = self.view.strides
 *         else:
 */
  __pyx_t_1 = ((__pyx_v_flags & PyBUF_STRIDES) != 0);
  if (__pyx_t_1) {

    /* "View.MemoryView":475
 * 
 *         if flags & PyBUF_STRIDES:
 *             info.strides = self.view.strides             # <<<<<<<<<<<<<<
 *         else:
 *             info.strides = NULL
 */
    __pyx_t_2 = __pyx_v_self->view.strides;
    __pyx_v_info->strides = __pyx_t_2;
    goto __pyx_L4;
  }
  /*else*/ {

    /* "View.MemoryView":477
 *             info.strides = self.view.strides
 *         else:
 *             info.strides = NULL             # <<<<<<<<<<<<<<
 * 
 *         if flags & PyBUF_INDIRECT:
 */
    __pyx_v_info->strides = NULL;
  }
  __pyx_L4:;

  /* "View.MemoryView":479
 *             info.strides = NULL
 * 
 *         if flags & PyBUF_INDIRECT:             # <<<<<<<<<<<<<<
 *             info.suboffsets = self.view.suboffsets
 *         else:
 */
  __pyx_t_1 = ((__pyx_v_flags & PyBUF_INDIRECT) != 0);
  if (__pyx_t_1) {

    /* "View.MemoryView":480
 * 
 *         if flags & PyBUF_INDIRECT:
 *             info.suboffsets = self.view.suboffsets             # <<<<<<<<<<<<<<
 *         else:
 *             info.suboffsets = NULL
 */
    __pyx_t_2 = __pyx_v_self->view.suboffsets;
    __pyx_v_info->suboffsets = __pyx_t_2;
    goto __pyx_L5;
  }
  /*else*/ {

    /* "View.MemoryView":482
 *             info.suboffsets = self.view.suboffsets
 *         else:
 *             info.suboffsets = NULL             # <<<<<<<<<<<<<<
 * 
 *         if flags & PyBUF_FORMAT:
 */
    __pyx_v_info->suboffsets = NULL;
  }
  __pyx_L5:;

  /* "View.MemoryView":484
 *             info.suboffsets = NULL
 * 
 *         if flags & PyBUF_FORMAT:             # <<<<<<<<<<<<<<
 *             info.format = self.view.format
 *         else:
 */
  __pyx_t_1 = ((__pyx_v_flags & PyBUF_FORMAT) != 0);
  if (__pyx_t_1) {

    /* "View.MemoryView":485
 * 
 *         if flags & PyBUF_FORMAT:
 *             info.format = self.view.format             # <<<<<<<<<<<<<<
 *         else:
 *             info.format = NULL
 */
    __pyx_t_3 = __pyx_v_self->view.format;
    __pyx_v_info->format = __pyx_t_3;
    goto __pyx_L6;
  }
  /*else*/ {

    /* "View.MemoryView":487
 *             info.format = self.view.format
 *         else:
 *             info.format = NULL             # <<<<<<<<<<<<<<
 * 
 *         info.buf = self.view.buf
 */
    __pyx_v_info->format = NULL;
  }
  __pyx_L6:;

  /* "View.MemoryView":489
 *             info.format = NULL
 * 
 *         info.buf = self.view.buf             # <<<<<<<<<<<<<<
 *         info.ndim = self.view.ndim
 *         info.itemsize = self.view.itemsize
 */
  __pyx_t_4 = __pyx_v_self->view.buf;
  __pyx_v_info->buf = __pyx_t_4;

  /* "View.MemoryView":490
 * 
 *         info.buf = self.view.buf
 *         info.ndim = self.view.ndim             # <<<<<<<<<<<<<<
 *         info.itemsize = self.view.itemsize
 *         info.len = self.view.len
 */
  __pyx_t_5 = __pyx_v_self->view.ndim;
  __pyx_v_info->ndim = __pyx_t_5;

  /* "View.MemoryView":491
 *         info.buf = self.view.buf
 *         info.ndim = self.view.ndim
 *         info.itemsize = self.view.itemsize             # <<<<<<<<<<<<<<
 *         info.len = self.view.len
 *         info.readonly = 0
 */
  __pyx_t_6 = __pyx_v_self->view.itemsize;
  __pyx_v_info->itemsize = __pyx_t_6;

  /* "View.MemoryView":492
 *         info.ndim = self.view.ndim
 *         info.itemsize = self.view.itemsize
 *         info.len = self.view.len             # <<<<<<<<<<<<<<
 *         info.readonly = 0
 *         info.obj = self
 */
  __pyx_t_6 = __pyx_v_self->view.len;
  __pyx_v_info->len = __pyx_t_6;

  /* "View.MemoryView":493
 *         info.itemsize = self.view.itemsize
 *         info.len = self.view.len
 *         info.readonly = 0             # <<<<<<<<<<<<<<
 *         info.obj = self
 * 
 */
  __pyx_v_info->readonly = 0;

  /* "View.MemoryView":494
 *         info.len = self.view.len
 *         info.readonly = 0
 *         info.obj = self             # <<<<<<<<<<<<<<
 * 
 *     __pyx_getbuffer = capsule(<void *> &__pyx_memoryview_getbuffer, "getbuffer(obj, view, flags)")
 */
  __Pyx_INCREF(((PyObject *)__pyx_v_self));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
  __Pyx_GOTREF(__pyx_v_info->obj);
  __Pyx_DECREF(__pyx_v_info->obj);
  __pyx_v_info->obj = ((PyObject *)__pyx_v_self);

  /* "View.MemoryView":468
 * 
 *     @cname('getbuffer')
 *     def __getbuffer__(self, Py_buffer *info, int flags):             # <<<<<<<<<<<<<<
 *         if flags & PyBUF_STRIDES:
 *             info.shape = self.view.shape
 */

  /* function exit code */
  __pyx_r = 0;
  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_RefNannyFinishContext();
  return __pyx_r;
}

/* "View.MemoryView":501
 *     property T:
 *         @cname('__pyx_memoryview_transpose')
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             cdef _memoryviewslice result = memoryview_copy(self)
 *             transpose_memslice(&result.from_slice)
 */

/* Python wrapper */
static PyObject *__pyx_memoryview_transpose(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_memoryview_transpose(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_memoryview_transpose_MemoryView_10memoryview_1T___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_memoryview_transpose_MemoryView_10memoryview_1T___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
  struct __pyx_memoryviewslice_obj *__pyx_v_result = 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;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "View.MemoryView":502
 *         @cname('__pyx_memoryview_transpose')
 *         def __get__(self):
 *             cdef _memoryviewslice result = memoryview_copy(self)             # <<<<<<<<<<<<<<
 *             transpose_memslice(&result.from_slice)
 *             return result
 */
  __pyx_t_1 = __pyx_memoryview_copy_object(__pyx_v_self); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 502; __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_memoryviewslice_type))))) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 502; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_result = ((struct __pyx_memoryviewslice_obj *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "View.MemoryView":503
 *         def __get__(self):
 *             cdef _memoryviewslice result = memoryview_copy(self)
 *             transpose_memslice(&result.from_slice)             # <<<<<<<<<<<<<<
 *             return result
 * 
 */
  __pyx_t_2 = __pyx_memslice_transpose((&__pyx_v_result->from_slice)); if (unlikely(__pyx_t_2 == 0)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 503; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "View.MemoryView":504
 *             cdef _memoryviewslice result = memoryview_copy(self)
 *             transpose_memslice(&result.from_slice)
 *             return result             # <<<<<<<<<<<<<<
 * 
 *     property base:
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_result));
  __pyx_r = ((PyObject *)__pyx_v_result);
  goto __pyx_L0;

  /* "View.MemoryView":501
 *     property T:
 *         @cname('__pyx_memoryview_transpose')
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             cdef _memoryviewslice result = memoryview_copy(self)
 *             transpose_memslice(&result.from_slice)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("View.MemoryView.memoryview.T.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_result);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "View.MemoryView":508
 *     property base:
 *         @cname('__pyx_memoryview__get__base')
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             return self.obj
 * 
 */

/* Python wrapper */
static PyObject *__pyx_memoryview__get__base(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_memoryview__get__base(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_memoryview__get__base_MemoryView_10memoryview_4base___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_memoryview__get__base_MemoryView_10memoryview_4base___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "View.MemoryView":509
 *         @cname('__pyx_memoryview__get__base')
 *         def __get__(self):
 *             return self.obj             # <<<<<<<<<<<<<<
 * 
 *     property shape:
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->obj);
  __pyx_r = __pyx_v_self->obj;
  goto __pyx_L0;

  /* "View.MemoryView":508
 *     property base:
 *         @cname('__pyx_memoryview__get__base')
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             return self.obj
 * 
 */

  /* function exit code */
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "View.MemoryView":513
 *     property shape:
 *         @cname('__pyx_memoryview_get_shape')
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             return tuple([self.view.shape[i] for i in xrange(self.view.ndim)])
 * 
 */

/* Python wrapper */
static PyObject *__pyx_memoryview_get_shape(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_memoryview_get_shape(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_memoryview_get_shape_MemoryView_10memoryview_5shape___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_memoryview_get_shape_MemoryView_10memoryview_5shape___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
  int __pyx_v_i;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "View.MemoryView":514
 *         @cname('__pyx_memoryview_get_shape')
 *         def __get__(self):
 *             return tuple([self.view.shape[i] for i in xrange(self.view.ndim)])             # <<<<<<<<<<<<<<
 * 
 *     property strides:
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 514; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __pyx_v_self->view.ndim;
  for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
    __pyx_v_i = __pyx_t_3;
    __pyx_t_4 = PyInt_FromSsize_t((__pyx_v_self->view.shape[__pyx_v_i])); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 514; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_4))) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 514; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  }
  __pyx_t_4 = PyList_AsTuple(((PyObject*)__pyx_t_1)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 514; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_r = __pyx_t_4;
  __pyx_t_4 = 0;
  goto __pyx_L0;

  /* "View.MemoryView":513
 *     property shape:
 *         @cname('__pyx_memoryview_get_shape')
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             return tuple([self.view.shape[i] for i in xrange(self.view.ndim)])
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("View.MemoryView.memoryview.shape.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "View.MemoryView":518
 *     property strides:
 *         @cname('__pyx_memoryview_get_strides')
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             if self.view.strides == NULL:
 * 
 */

/* Python wrapper */
static PyObject *__pyx_memoryview_get_strides(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_memoryview_get_strides(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_memoryview_get_strides_MemoryView_10memoryview_7strides___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_memoryview_get_strides_MemoryView_10memoryview_7strides___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
  int __pyx_v_i;
  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;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "View.MemoryView":519
 *         @cname('__pyx_memoryview_get_strides')
 *         def __get__(self):
 *             if self.view.strides == NULL:             # <<<<<<<<<<<<<<
 * 
 *                 raise ValueError("Buffer view does not expose strides")
 */
  __pyx_t_1 = ((__pyx_v_self->view.strides == NULL) != 0);
  if (__pyx_t_1) {

    /* "View.MemoryView":521
 *             if self.view.strides == NULL:
 * 
 *                 raise ValueError("Buffer view does not expose strides")             # <<<<<<<<<<<<<<
 * 
 *             return tuple([self.view.strides[i] for i in xrange(self.view.ndim)])
 */
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__228, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 521; __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 = 521; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }

  /* "View.MemoryView":523
 *                 raise ValueError("Buffer view does not expose strides")
 * 
 *             return tuple([self.view.strides[i] for i in xrange(self.view.ndim)])             # <<<<<<<<<<<<<<
 * 
 *     property suboffsets:
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 523; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __pyx_v_self->view.ndim;
  for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
    __pyx_v_i = __pyx_t_4;
    __pyx_t_5 = PyInt_FromSsize_t((__pyx_v_self->view.strides[__pyx_v_i])); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 523; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_5))) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 523; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  }
  __pyx_t_5 = PyList_AsTuple(((PyObject*)__pyx_t_2)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 523; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_r = __pyx_t_5;
  __pyx_t_5 = 0;
  goto __pyx_L0;

  /* "View.MemoryView":518
 *     property strides:
 *         @cname('__pyx_memoryview_get_strides')
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             if self.view.strides == NULL:
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("View.MemoryView.memoryview.strides.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "View.MemoryView":527
 *     property suboffsets:
 *         @cname('__pyx_memoryview_get_suboffsets')
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             if self.view.suboffsets == NULL:
 *                 return [-1] * self.view.ndim
 */

/* Python wrapper */
static PyObject *__pyx_memoryview_get_suboffsets(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_memoryview_get_suboffsets(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_memoryview_get_suboffsets_MemoryView_10memoryview_10suboffsets___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_memoryview_get_suboffsets_MemoryView_10memoryview_10suboffsets___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
  int __pyx_v_i;
  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;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "View.MemoryView":528
 *         @cname('__pyx_memoryview_get_suboffsets')
 *         def __get__(self):
 *             if self.view.suboffsets == NULL:             # <<<<<<<<<<<<<<
 *                 return [-1] * self.view.ndim
 * 
 */
  __pyx_t_1 = ((__pyx_v_self->view.suboffsets == NULL) != 0);
  if (__pyx_t_1) {

    /* "View.MemoryView":529
 *         def __get__(self):
 *             if self.view.suboffsets == NULL:
 *                 return [-1] * self.view.ndim             # <<<<<<<<<<<<<<
 * 
 *             return tuple([self.view.suboffsets[i] for i in xrange(self.view.ndim)])
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = PyList_New(1 * ((__pyx_v_self->view.ndim<0) ? 0:__pyx_v_self->view.ndim)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 529; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    { Py_ssize_t __pyx_temp;
      for (__pyx_temp=0; __pyx_temp < __pyx_v_self->view.ndim; __pyx_temp++) {
        __Pyx_INCREF(__pyx_int_neg_1);
        PyList_SET_ITEM(__pyx_t_2, __pyx_temp, __pyx_int_neg_1);
        __Pyx_GIVEREF(__pyx_int_neg_1);
      }
    }
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L0;
  }

  /* "View.MemoryView":531
 *                 return [-1] * self.view.ndim
 * 
 *             return tuple([self.view.suboffsets[i] for i in xrange(self.view.ndim)])             # <<<<<<<<<<<<<<
 * 
 *     property ndim:
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 531; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __pyx_v_self->view.ndim;
  for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
    __pyx_v_i = __pyx_t_4;
    __pyx_t_5 = PyInt_FromSsize_t((__pyx_v_self->view.suboffsets[__pyx_v_i])); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 531; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_5))) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 531; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  }
  __pyx_t_5 = PyList_AsTuple(((PyObject*)__pyx_t_2)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 531; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_r = __pyx_t_5;
  __pyx_t_5 = 0;
  goto __pyx_L0;

  /* "View.MemoryView":527
 *     property suboffsets:
 *         @cname('__pyx_memoryview_get_suboffsets')
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             if self.view.suboffsets == NULL:
 *                 return [-1] * self.view.ndim
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("View.MemoryView.memoryview.suboffsets.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "View.MemoryView":535
 *     property ndim:
 *         @cname('__pyx_memoryview_get_ndim')
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             return self.view.ndim
 * 
 */

/* Python wrapper */
static PyObject *__pyx_memoryview_get_ndim(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_memoryview_get_ndim(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_memoryview_get_ndim_MemoryView_10memoryview_4ndim___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_memoryview_get_ndim_MemoryView_10memoryview_4ndim___get__(struct __pyx_memoryview_obj *__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__", 0);

  /* "View.MemoryView":536
 *         @cname('__pyx_memoryview_get_ndim')
 *         def __get__(self):
 *             return self.view.ndim             # <<<<<<<<<<<<<<
 * 
 *     property itemsize:
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->view.ndim); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 536; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "View.MemoryView":535
 *     property ndim:
 *         @cname('__pyx_memoryview_get_ndim')
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             return self.view.ndim
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("View.MemoryView.memoryview.ndim.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "View.MemoryView":540
 *     property itemsize:
 *         @cname('__pyx_memoryview_get_itemsize')
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             return self.view.itemsize
 * 
 */

/* Python wrapper */
static PyObject *__pyx_memoryview_get_itemsize(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_memoryview_get_itemsize(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_memoryview_get_itemsize_MemoryView_10memoryview_8itemsize___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_memoryview_get_itemsize_MemoryView_10memoryview_8itemsize___get__(struct __pyx_memoryview_obj *__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__", 0);

  /* "View.MemoryView":541
 *         @cname('__pyx_memoryview_get_itemsize')
 *         def __get__(self):
 *             return self.view.itemsize             # <<<<<<<<<<<<<<
 * 
 *     property nbytes:
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_self->view.itemsize); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 541; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "View.MemoryView":540
 *     property itemsize:
 *         @cname('__pyx_memoryview_get_itemsize')
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             return self.view.itemsize
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("View.MemoryView.memoryview.itemsize.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "View.MemoryView":545
 *     property nbytes:
 *         @cname('__pyx_memoryview_get_nbytes')
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             return self.size * self.view.itemsize
 * 
 */

/* Python wrapper */
static PyObject *__pyx_memoryview_get_nbytes(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_memoryview_get_nbytes(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_memoryview_get_nbytes_MemoryView_10memoryview_6nbytes___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_memoryview_get_nbytes_MemoryView_10memoryview_6nbytes___get__(struct __pyx_memoryview_obj *__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("__get__", 0);

  /* "View.MemoryView":546
 *         @cname('__pyx_memoryview_get_nbytes')
 *         def __get__(self):
 *             return self.size * self.view.itemsize             # <<<<<<<<<<<<<<
 * 
 *     property size:
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 546; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_self->view.itemsize); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 546; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyNumber_Multiply(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 546; __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_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "View.MemoryView":545
 *     property nbytes:
 *         @cname('__pyx_memoryview_get_nbytes')
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             return self.size * self.view.itemsize
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("View.MemoryView.memoryview.nbytes.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "View.MemoryView":550
 *     property size:
 *         @cname('__pyx_memoryview_get_size')
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             if self._size is None:
 *                 result = 1
 */

/* Python wrapper */
static PyObject *__pyx_memoryview_get_size(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_memoryview_get_size(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_memoryview_get_size_MemoryView_10memoryview_4size___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_memoryview_get_size_MemoryView_10memoryview_4size___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
  PyObject *__pyx_v_result = NULL;
  PyObject *__pyx_v_length = 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;
  Py_ssize_t __pyx_t_5;
  PyObject *(*__pyx_t_6)(PyObject *);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "View.MemoryView":551
 *         @cname('__pyx_memoryview_get_size')
 *         def __get__(self):
 *             if self._size is None:             # <<<<<<<<<<<<<<
 *                 result = 1
 * 
 */
  __pyx_t_1 = (__pyx_v_self->_size == Py_None);
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (__pyx_t_2) {

    /* "View.MemoryView":552
 *         def __get__(self):
 *             if self._size is None:
 *                 result = 1             # <<<<<<<<<<<<<<
 * 
 *                 for length in self.shape:
 */
    __Pyx_INCREF(__pyx_int_1);
    __pyx_v_result = __pyx_int_1;

    /* "View.MemoryView":554
 *                 result = 1
 * 
 *                 for length in self.shape:             # <<<<<<<<<<<<<<
 *                     result *= length
 * 
 */
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_shape); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 554; __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_4 = __pyx_t_3; __Pyx_INCREF(__pyx_t_4); __pyx_t_5 = 0;
      __pyx_t_6 = NULL;
    } else {
      __pyx_t_5 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 554; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_6 = Py_TYPE(__pyx_t_4)->tp_iternext;
    }
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    for (;;) {
      if (!__pyx_t_6 && PyList_CheckExact(__pyx_t_4)) {
        if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_4)) break;
        #if CYTHON_COMPILING_IN_CPYTHON
        __pyx_t_3 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_3); __pyx_t_5++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 554; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #else
        __pyx_t_3 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 554; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #endif
      } else if (!__pyx_t_6 && PyTuple_CheckExact(__pyx_t_4)) {
        if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_4)) break;
        #if CYTHON_COMPILING_IN_CPYTHON
        __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_3); __pyx_t_5++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 554; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #else
        __pyx_t_3 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 554; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #endif
      } else {
        __pyx_t_3 = __pyx_t_6(__pyx_t_4);
        if (unlikely(!__pyx_t_3)) {
          PyObject* exc_type = PyErr_Occurred();
          if (exc_type) {
            if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
            else {__pyx_filename = __pyx_f[7]; __pyx_lineno = 554; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          }
          break;
        }
        __Pyx_GOTREF(__pyx_t_3);
      }
      __Pyx_XDECREF_SET(__pyx_v_length, __pyx_t_3);
      __pyx_t_3 = 0;

      /* "View.MemoryView":555
 * 
 *                 for length in self.shape:
 *                     result *= length             # <<<<<<<<<<<<<<
 * 
 *                 self._size = result
 */
      __pyx_t_3 = PyNumber_InPlaceMultiply(__pyx_v_result, __pyx_v_length); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 555; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF_SET(__pyx_v_result, __pyx_t_3);
      __pyx_t_3 = 0;
    }
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "View.MemoryView":557
 *                     result *= length
 * 
 *                 self._size = result             # <<<<<<<<<<<<<<
 * 
 *             return self._size
 */
    __Pyx_INCREF(__pyx_v_result);
    __Pyx_GIVEREF(__pyx_v_result);
    __Pyx_GOTREF(__pyx_v_self->_size);
    __Pyx_DECREF(__pyx_v_self->_size);
    __pyx_v_self->_size = __pyx_v_result;
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "View.MemoryView":559
 *                 self._size = result
 * 
 *             return self._size             # <<<<<<<<<<<<<<
 * 
 *     def __len__(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->_size);
  __pyx_r = __pyx_v_self->_size;
  goto __pyx_L0;

  /* "View.MemoryView":550
 *     property size:
 *         @cname('__pyx_memoryview_get_size')
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             if self._size is None:
 *                 result = 1
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("View.MemoryView.memoryview.size.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_result);
  __Pyx_XDECREF(__pyx_v_length);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "View.MemoryView":561
 *             return self._size
 * 
 *     def __len__(self):             # <<<<<<<<<<<<<<
 *         if self.view.ndim >= 1:
 *             return self.view.shape[0]
 */

/* Python wrapper */
static Py_ssize_t __pyx_memoryview___len__(PyObject *__pyx_v_self); /*proto*/
static Py_ssize_t __pyx_memoryview___len__(PyObject *__pyx_v_self) {
  Py_ssize_t __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__len__ (wrapper)", 0);
  __pyx_r = __pyx_memoryview_MemoryView_10memoryview_10__len__(((struct __pyx_memoryview_obj *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static Py_ssize_t __pyx_memoryview_MemoryView_10memoryview_10__len__(struct __pyx_memoryview_obj *__pyx_v_self) {
  Py_ssize_t __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  __Pyx_RefNannySetupContext("__len__", 0);

  /* "View.MemoryView":562
 * 
 *     def __len__(self):
 *         if self.view.ndim >= 1:             # <<<<<<<<<<<<<<
 *             return self.view.shape[0]
 * 
 */
  __pyx_t_1 = ((__pyx_v_self->view.ndim >= 1) != 0);
  if (__pyx_t_1) {

    /* "View.MemoryView":563
 *     def __len__(self):
 *         if self.view.ndim >= 1:
 *             return self.view.shape[0]             # <<<<<<<<<<<<<<
 * 
 *         return 0
 */
    __pyx_r = (__pyx_v_self->view.shape[0]);
    goto __pyx_L0;
  }

  /* "View.MemoryView":565
 *             return self.view.shape[0]
 * 
 *         return 0             # <<<<<<<<<<<<<<
 * 
 *     def __repr__(self):
 */
  __pyx_r = 0;
  goto __pyx_L0;

  /* "View.MemoryView":561
 *             return self._size
 * 
 *     def __len__(self):             # <<<<<<<<<<<<<<
 *         if self.view.ndim >= 1:
 *             return self.view.shape[0]
 */

  /* function exit code */
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "View.MemoryView":567
 *         return 0
 * 
 *     def __repr__(self):             # <<<<<<<<<<<<<<
 *         return "<MemoryView of %r at 0x%x>" % (self.base.__class__.__name__,
 *                                                id(self))
 */

/* Python wrapper */
static PyObject *__pyx_memoryview___repr__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_memoryview___repr__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0);
  __pyx_r = __pyx_memoryview_MemoryView_10memoryview_12__repr__(((struct __pyx_memoryview_obj *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_memoryview_MemoryView_10memoryview_12__repr__(struct __pyx_memoryview_obj *__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("__repr__", 0);

  /* "View.MemoryView":568
 * 
 *     def __repr__(self):
 *         return "<MemoryView of %r at 0x%x>" % (self.base.__class__.__name__,             # <<<<<<<<<<<<<<
 *                                                id(self))
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_base); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 568; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_class); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 568; __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_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_name_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 568; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "View.MemoryView":569
 *     def __repr__(self):
 *         return "<MemoryView of %r at 0x%x>" % (self.base.__class__.__name__,
 *                                                id(self))             # <<<<<<<<<<<<<<
 * 
 *     def __str__(self):
 */
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 569; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(((PyObject *)__pyx_v_self));
  PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_self));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_id, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 569; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "View.MemoryView":568
 * 
 *     def __repr__(self):
 *         return "<MemoryView of %r at 0x%x>" % (self.base.__class__.__name__,             # <<<<<<<<<<<<<<
 *                                                id(self))
 * 
 */
  __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 568; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_3);
  __pyx_t_1 = 0;
  __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_MemoryView_of_r_at_0x_x, __pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 568; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "View.MemoryView":567
 *         return 0
 * 
 *     def __repr__(self):             # <<<<<<<<<<<<<<
 *         return "<MemoryView of %r at 0x%x>" % (self.base.__class__.__name__,
 *                                                id(self))
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("View.MemoryView.memoryview.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "View.MemoryView":571
 *                                                id(self))
 * 
 *     def __str__(self):             # <<<<<<<<<<<<<<
 *         return "<MemoryView of %r object>" % (self.base.__class__.__name__,)
 * 
 */

/* Python wrapper */
static PyObject *__pyx_memoryview___str__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_memoryview___str__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__str__ (wrapper)", 0);
  __pyx_r = __pyx_memoryview_MemoryView_10memoryview_14__str__(((struct __pyx_memoryview_obj *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_memoryview_MemoryView_10memoryview_14__str__(struct __pyx_memoryview_obj *__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("__str__", 0);

  /* "View.MemoryView":572
 * 
 *     def __str__(self):
 *         return "<MemoryView of %r object>" % (self.base.__class__.__name__,)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_base); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 572; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_class); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 572; __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_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_name_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 572; __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[7]; __pyx_lineno = 572; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__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 = __Pyx_PyString_Format(__pyx_kp_s_MemoryView_of_r_object, __pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 572; __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;

  /* "View.MemoryView":571
 *                                                id(self))
 * 
 *     def __str__(self):             # <<<<<<<<<<<<<<
 *         return "<MemoryView of %r object>" % (self.base.__class__.__name__,)
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("View.MemoryView.memoryview.__str__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "View.MemoryView":575
 * 
 * 
 *     def is_c_contig(self):             # <<<<<<<<<<<<<<
 *         cdef __Pyx_memviewslice *mslice
 *         cdef __Pyx_memviewslice tmp
 */

/* Python wrapper */
static PyObject *__pyx_memoryview_is_c_contig(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_memoryview_is_c_contig(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("is_c_contig (wrapper)", 0);
  __pyx_r = __pyx_memoryview_MemoryView_10memoryview_16is_c_contig(((struct __pyx_memoryview_obj *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_memoryview_MemoryView_10memoryview_16is_c_contig(struct __pyx_memoryview_obj *__pyx_v_self) {
  __Pyx_memviewslice *__pyx_v_mslice;
  __Pyx_memviewslice __pyx_v_tmp;
  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_c_contig", 0);

  /* "View.MemoryView":578
 *         cdef __Pyx_memviewslice *mslice
 *         cdef __Pyx_memviewslice tmp
 *         mslice = get_slice_from_memview(self, &tmp)             # <<<<<<<<<<<<<<
 *         return slice_is_contig(mslice, 'C', self.view.ndim)
 * 
 */
  __pyx_v_mslice = __pyx_memoryview_get_slice_from_memoryview(__pyx_v_self, (&__pyx_v_tmp));

  /* "View.MemoryView":579
 *         cdef __Pyx_memviewslice tmp
 *         mslice = get_slice_from_memview(self, &tmp)
 *         return slice_is_contig(mslice, 'C', self.view.ndim)             # <<<<<<<<<<<<<<
 * 
 *     def is_f_contig(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_memviewslice_is_contig(__pyx_v_mslice, 'C', __pyx_v_self->view.ndim)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 579; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "View.MemoryView":575
 * 
 * 
 *     def is_c_contig(self):             # <<<<<<<<<<<<<<
 *         cdef __Pyx_memviewslice *mslice
 *         cdef __Pyx_memviewslice tmp
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("View.MemoryView.memoryview.is_c_contig", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "View.MemoryView":581
 *         return slice_is_contig(mslice, 'C', self.view.ndim)
 * 
 *     def is_f_contig(self):             # <<<<<<<<<<<<<<
 *         cdef __Pyx_memviewslice *mslice
 *         cdef __Pyx_memviewslice tmp
 */

/* Python wrapper */
static PyObject *__pyx_memoryview_is_f_contig(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_memoryview_is_f_contig(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("is_f_contig (wrapper)", 0);
  __pyx_r = __pyx_memoryview_MemoryView_10memoryview_18is_f_contig(((struct __pyx_memoryview_obj *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_memoryview_MemoryView_10memoryview_18is_f_contig(struct __pyx_memoryview_obj *__pyx_v_self) {
  __Pyx_memviewslice *__pyx_v_mslice;
  __Pyx_memviewslice __pyx_v_tmp;
  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_f_contig", 0);

  /* "View.MemoryView":584
 *         cdef __Pyx_memviewslice *mslice
 *         cdef __Pyx_memviewslice tmp
 *         mslice = get_slice_from_memview(self, &tmp)             # <<<<<<<<<<<<<<
 *         return slice_is_contig(mslice, 'F', self.view.ndim)
 * 
 */
  __pyx_v_mslice = __pyx_memoryview_get_slice_from_memoryview(__pyx_v_self, (&__pyx_v_tmp));

  /* "View.MemoryView":585
 *         cdef __Pyx_memviewslice tmp
 *         mslice = get_slice_from_memview(self, &tmp)
 *         return slice_is_contig(mslice, 'F', self.view.ndim)             # <<<<<<<<<<<<<<
 * 
 *     def copy(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_memviewslice_is_contig(__pyx_v_mslice, 'F', __pyx_v_self->view.ndim)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[7]; __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;

  /* "View.MemoryView":581
 *         return slice_is_contig(mslice, 'C', self.view.ndim)
 * 
 *     def is_f_contig(self):             # <<<<<<<<<<<<<<
 *         cdef __Pyx_memviewslice *mslice
 *         cdef __Pyx_memviewslice tmp
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("View.MemoryView.memoryview.is_f_contig", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "View.MemoryView":587
 *         return slice_is_contig(mslice, 'F', self.view.ndim)
 * 
 *     def copy(self):             # <<<<<<<<<<<<<<
 *         cdef __Pyx_memviewslice mslice
 *         cdef int flags = self.flags & ~PyBUF_F_CONTIGUOUS
 */

/* Python wrapper */
static PyObject *__pyx_memoryview_copy(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_memoryview_copy(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("copy (wrapper)", 0);
  __pyx_r = __pyx_memoryview_MemoryView_10memoryview_20copy(((struct __pyx_memoryview_obj *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_memoryview_MemoryView_10memoryview_20copy(struct __pyx_memoryview_obj *__pyx_v_self) {
  __Pyx_memviewslice __pyx_v_mslice;
  int __pyx_v_flags;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_memviewslice __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("copy", 0);

  /* "View.MemoryView":589
 *     def copy(self):
 *         cdef __Pyx_memviewslice mslice
 *         cdef int flags = self.flags & ~PyBUF_F_CONTIGUOUS             # <<<<<<<<<<<<<<
 * 
 *         slice_copy(self, &mslice)
 */
  __pyx_v_flags = (__pyx_v_self->flags & (~PyBUF_F_CONTIGUOUS));

  /* "View.MemoryView":591
 *         cdef int flags = self.flags & ~PyBUF_F_CONTIGUOUS
 * 
 *         slice_copy(self, &mslice)             # <<<<<<<<<<<<<<
 *         mslice = slice_copy_contig(&mslice, "c", self.view.ndim,
 *                                    self.view.itemsize,
 */
  __pyx_memoryview_slice_copy(__pyx_v_self, (&__pyx_v_mslice));

  /* "View.MemoryView":592
 * 
 *         slice_copy(self, &mslice)
 *         mslice = slice_copy_contig(&mslice, "c", self.view.ndim,             # <<<<<<<<<<<<<<
 *                                    self.view.itemsize,
 *                                    flags|PyBUF_C_CONTIGUOUS,
 */
  __pyx_t_1 = __pyx_memoryview_copy_new_contig((&__pyx_v_mslice), __pyx_k_c, __pyx_v_self->view.ndim, __pyx_v_self->view.itemsize, (__pyx_v_flags | PyBUF_C_CONTIGUOUS), __pyx_v_self->dtype_is_object); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 592; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_mslice = __pyx_t_1;

  /* "View.MemoryView":597
 *                                    self.dtype_is_object)
 * 
 *         return memoryview_copy_from_slice(self, &mslice)             # <<<<<<<<<<<<<<
 * 
 *     def copy_fortran(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __pyx_memoryview_copy_object_from_slice(__pyx_v_self, (&__pyx_v_mslice)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 597; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "View.MemoryView":587
 *         return slice_is_contig(mslice, 'F', self.view.ndim)
 * 
 *     def copy(self):             # <<<<<<<<<<<<<<
 *         cdef __Pyx_memviewslice mslice
 *         cdef int flags = self.flags & ~PyBUF_F_CONTIGUOUS
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("View.MemoryView.memoryview.copy", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "View.MemoryView":599
 *         return memoryview_copy_from_slice(self, &mslice)
 * 
 *     def copy_fortran(self):             # <<<<<<<<<<<<<<
 *         cdef __Pyx_memviewslice src, dst
 *         cdef int flags = self.flags & ~PyBUF_C_CONTIGUOUS
 */

/* Python wrapper */
static PyObject *__pyx_memoryview_copy_fortran(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_memoryview_copy_fortran(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("copy_fortran (wrapper)", 0);
  __pyx_r = __pyx_memoryview_MemoryView_10memoryview_22copy_fortran(((struct __pyx_memoryview_obj *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_memoryview_MemoryView_10memoryview_22copy_fortran(struct __pyx_memoryview_obj *__pyx_v_self) {
  __Pyx_memviewslice __pyx_v_src;
  __Pyx_memviewslice __pyx_v_dst;
  int __pyx_v_flags;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_memviewslice __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("copy_fortran", 0);

  /* "View.MemoryView":601
 *     def copy_fortran(self):
 *         cdef __Pyx_memviewslice src, dst
 *         cdef int flags = self.flags & ~PyBUF_C_CONTIGUOUS             # <<<<<<<<<<<<<<
 * 
 *         slice_copy(self, &src)
 */
  __pyx_v_flags = (__pyx_v_self->flags & (~PyBUF_C_CONTIGUOUS));

  /* "View.MemoryView":603
 *         cdef int flags = self.flags & ~PyBUF_C_CONTIGUOUS
 * 
 *         slice_copy(self, &src)             # <<<<<<<<<<<<<<
 *         dst = slice_copy_contig(&src, "fortran", self.view.ndim,
 *                                 self.view.itemsize,
 */
  __pyx_memoryview_slice_copy(__pyx_v_self, (&__pyx_v_src));

  /* "View.MemoryView":604
 * 
 *         slice_copy(self, &src)
 *         dst = slice_copy_contig(&src, "fortran", self.view.ndim,             # <<<<<<<<<<<<<<
 *                                 self.view.itemsize,
 *                                 flags|PyBUF_F_CONTIGUOUS,
 */
  __pyx_t_1 = __pyx_memoryview_copy_new_contig((&__pyx_v_src), __pyx_k_fortran, __pyx_v_self->view.ndim, __pyx_v_self->view.itemsize, (__pyx_v_flags | PyBUF_F_CONTIGUOUS), __pyx_v_self->dtype_is_object); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 604; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_dst = __pyx_t_1;

  /* "View.MemoryView":609
 *                                 self.dtype_is_object)
 * 
 *         return memoryview_copy_from_slice(self, &dst)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __pyx_memoryview_copy_object_from_slice(__pyx_v_self, (&__pyx_v_dst)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 609; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "View.MemoryView":599
 *         return memoryview_copy_from_slice(self, &mslice)
 * 
 *     def copy_fortran(self):             # <<<<<<<<<<<<<<
 *         cdef __Pyx_memviewslice src, dst
 *         cdef int flags = self.flags & ~PyBUF_C_CONTIGUOUS
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("View.MemoryView.memoryview.copy_fortran", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "View.MemoryView":613
 * 
 * @cname('__pyx_memoryview_new')
 * cdef memoryview_cwrapper(object o, int flags, bint dtype_is_object, __Pyx_TypeInfo *typeinfo):             # <<<<<<<<<<<<<<
 *     cdef memoryview result = memoryview(o, flags, dtype_is_object)
 *     result.typeinfo = typeinfo
 */

static PyObject *__pyx_memoryview_new(PyObject *__pyx_v_o, int __pyx_v_flags, int __pyx_v_dtype_is_object, __Pyx_TypeInfo *__pyx_v_typeinfo) {
  struct __pyx_memoryview_obj *__pyx_v_result = 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("memoryview_cwrapper", 0);

  /* "View.MemoryView":614
 * @cname('__pyx_memoryview_new')
 * cdef memoryview_cwrapper(object o, int flags, bint dtype_is_object, __Pyx_TypeInfo *typeinfo):
 *     cdef memoryview result = memoryview(o, flags, dtype_is_object)             # <<<<<<<<<<<<<<
 *     result.typeinfo = typeinfo
 *     return result
 */
  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_flags); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 614; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_dtype_is_object); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 614; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 614; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_INCREF(__pyx_v_o);
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_o);
  __Pyx_GIVEREF(__pyx_v_o);
  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_1 = 0;
  __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)((PyObject *)__pyx_memoryview_type)), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 614; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_v_result = ((struct __pyx_memoryview_obj *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "View.MemoryView":615
 * cdef memoryview_cwrapper(object o, int flags, bint dtype_is_object, __Pyx_TypeInfo *typeinfo):
 *     cdef memoryview result = memoryview(o, flags, dtype_is_object)
 *     result.typeinfo = typeinfo             # <<<<<<<<<<<<<<
 *     return result
 * 
 */
  __pyx_v_result->typeinfo = __pyx_v_typeinfo;

  /* "View.MemoryView":616
 *     cdef memoryview result = memoryview(o, flags, dtype_is_object)
 *     result.typeinfo = typeinfo
 *     return result             # <<<<<<<<<<<<<<
 * 
 * @cname('__pyx_memoryview_check')
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_result));
  __pyx_r = ((PyObject *)__pyx_v_result);
  goto __pyx_L0;

  /* "View.MemoryView":613
 * 
 * @cname('__pyx_memoryview_new')
 * cdef memoryview_cwrapper(object o, int flags, bint dtype_is_object, __Pyx_TypeInfo *typeinfo):             # <<<<<<<<<<<<<<
 *     cdef memoryview result = memoryview(o, flags, dtype_is_object)
 *     result.typeinfo = typeinfo
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("View.MemoryView.memoryview_cwrapper", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_result);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "View.MemoryView":619
 * 
 * @cname('__pyx_memoryview_check')
 * cdef inline bint memoryview_check(object o):             # <<<<<<<<<<<<<<
 *     return isinstance(o, memoryview)
 * 
 */

static CYTHON_INLINE int __pyx_memoryview_check(PyObject *__pyx_v_o) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  __Pyx_RefNannySetupContext("memoryview_check", 0);

  /* "View.MemoryView":620
 * @cname('__pyx_memoryview_check')
 * cdef inline bint memoryview_check(object o):
 *     return isinstance(o, memoryview)             # <<<<<<<<<<<<<<
 * 
 * cdef tuple _unellipsify(object index, int ndim):
 */
  __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_o, ((PyObject *)__pyx_memoryview_type)); 
  __pyx_r = __pyx_t_1;
  goto __pyx_L0;

  /* "View.MemoryView":619
 * 
 * @cname('__pyx_memoryview_check')
 * cdef inline bint memoryview_check(object o):             # <<<<<<<<<<<<<<
 *     return isinstance(o, memoryview)
 * 
 */

  /* function exit code */
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "View.MemoryView":622
 *     return isinstance(o, memoryview)
 * 
 * cdef tuple _unellipsify(object index, int ndim):             # <<<<<<<<<<<<<<
 *     """
 *     Replace all ellipses with full slices and fill incomplete indices with
 */

static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) {
  PyObject *__pyx_v_tup = NULL;
  PyObject *__pyx_v_result = NULL;
  int __pyx_v_have_slices;
  int __pyx_v_seen_ellipsis;
  CYTHON_UNUSED PyObject *__pyx_v_idx = NULL;
  PyObject *__pyx_v_item = NULL;
  Py_ssize_t __pyx_v_nslices;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  Py_ssize_t __pyx_t_5;
  PyObject *(*__pyx_t_6)(PyObject *);
  PyObject *__pyx_t_7 = NULL;
  Py_ssize_t __pyx_t_8;
  PyObject *__pyx_t_9 = NULL;
  int __pyx_t_10;
  int __pyx_t_11;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_unellipsify", 0);

  /* "View.MemoryView":627
 *     full slices.
 *     """
 *     if not isinstance(index, tuple):             # <<<<<<<<<<<<<<
 *         tup = (index,)
 *     else:
 */
  __pyx_t_1 = PyTuple_Check(__pyx_v_index); 
  __pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0);
  if (__pyx_t_2) {

    /* "View.MemoryView":628
 *     """
 *     if not isinstance(index, tuple):
 *         tup = (index,)             # <<<<<<<<<<<<<<
 *     else:
 *         tup = index
 */
    __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 628; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_INCREF(__pyx_v_index);
    PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_index);
    __Pyx_GIVEREF(__pyx_v_index);
    __pyx_v_tup = __pyx_t_3;
    __pyx_t_3 = 0;
    goto __pyx_L3;
  }
  /*else*/ {

    /* "View.MemoryView":630
 *         tup = (index,)
 *     else:
 *         tup = index             # <<<<<<<<<<<<<<
 * 
 *     result = []
 */
    __Pyx_INCREF(__pyx_v_index);
    __pyx_v_tup = __pyx_v_index;
  }
  __pyx_L3:;

  /* "View.MemoryView":632
 *         tup = index
 * 
 *     result = []             # <<<<<<<<<<<<<<
 *     have_slices = False
 *     seen_ellipsis = False
 */
  __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 632; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_v_result = ((PyObject*)__pyx_t_3);
  __pyx_t_3 = 0;

  /* "View.MemoryView":633
 * 
 *     result = []
 *     have_slices = False             # <<<<<<<<<<<<<<
 *     seen_ellipsis = False
 *     for idx, item in enumerate(tup):
 */
  __pyx_v_have_slices = 0;

  /* "View.MemoryView":634
 *     result = []
 *     have_slices = False
 *     seen_ellipsis = False             # <<<<<<<<<<<<<<
 *     for idx, item in enumerate(tup):
 *         if item is Ellipsis:
 */
  __pyx_v_seen_ellipsis = 0;

  /* "View.MemoryView":635
 *     have_slices = False
 *     seen_ellipsis = False
 *     for idx, item in enumerate(tup):             # <<<<<<<<<<<<<<
 *         if item is Ellipsis:
 *             if not seen_ellipsis:
 */
  __Pyx_INCREF(__pyx_int_0);
  __pyx_t_3 = __pyx_int_0;
  if (PyList_CheckExact(__pyx_v_tup) || PyTuple_CheckExact(__pyx_v_tup)) {
    __pyx_t_4 = __pyx_v_tup; __Pyx_INCREF(__pyx_t_4); __pyx_t_5 = 0;
    __pyx_t_6 = NULL;
  } else {
    __pyx_t_5 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_v_tup); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 635; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_6 = Py_TYPE(__pyx_t_4)->tp_iternext;
  }
  for (;;) {
    if (!__pyx_t_6 && PyList_CheckExact(__pyx_t_4)) {
      if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_4)) break;
      #if CYTHON_COMPILING_IN_CPYTHON
      __pyx_t_7 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 635; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #else
      __pyx_t_7 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 635; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #endif
    } else if (!__pyx_t_6 && PyTuple_CheckExact(__pyx_t_4)) {
      if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_4)) break;
      #if CYTHON_COMPILING_IN_CPYTHON
      __pyx_t_7 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 635; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #else
      __pyx_t_7 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 635; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #endif
    } else {
      __pyx_t_7 = __pyx_t_6(__pyx_t_4);
      if (unlikely(!__pyx_t_7)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else {__pyx_filename = __pyx_f[7]; __pyx_lineno = 635; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_7);
    }
    __Pyx_XDECREF_SET(__pyx_v_item, __pyx_t_7);
    __pyx_t_7 = 0;
    __Pyx_INCREF(__pyx_t_3);
    __Pyx_XDECREF_SET(__pyx_v_idx, __pyx_t_3);
    __pyx_t_7 = PyNumber_Add(__pyx_t_3, __pyx_int_1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 635; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_3);
    __pyx_t_3 = __pyx_t_7;
    __pyx_t_7 = 0;

    /* "View.MemoryView":636
 *     seen_ellipsis = False
 *     for idx, item in enumerate(tup):
 *         if item is Ellipsis:             # <<<<<<<<<<<<<<
 *             if not seen_ellipsis:
 *                 result.extend([slice(None)] * (ndim - len(tup) + 1))
 */
    __pyx_t_2 = (__pyx_v_item == __pyx_builtin_Ellipsis);
    __pyx_t_1 = (__pyx_t_2 != 0);
    if (__pyx_t_1) {

      /* "View.MemoryView":637
 *     for idx, item in enumerate(tup):
 *         if item is Ellipsis:
 *             if not seen_ellipsis:             # <<<<<<<<<<<<<<
 *                 result.extend([slice(None)] * (ndim - len(tup) + 1))
 *                 seen_ellipsis = True
 */
      __pyx_t_1 = ((!(__pyx_v_seen_ellipsis != 0)) != 0);
      if (__pyx_t_1) {

        /* "View.MemoryView":638
 *         if item is Ellipsis:
 *             if not seen_ellipsis:
 *                 result.extend([slice(None)] * (ndim - len(tup) + 1))             # <<<<<<<<<<<<<<
 *                 seen_ellipsis = True
 *             else:
 */
        __pyx_t_7 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PySlice_Type))), __pyx_tuple__229, NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 638; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_7);
        __pyx_t_8 = PyObject_Length(__pyx_v_tup); if (unlikely(__pyx_t_8 == -1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 638; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __pyx_t_9 = PyList_New(1 * ((((__pyx_v_ndim - __pyx_t_8) + 1)<0) ? 0:((__pyx_v_ndim - __pyx_t_8) + 1))); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 638; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_9);
        { Py_ssize_t __pyx_temp;
          for (__pyx_temp=0; __pyx_temp < ((__pyx_v_ndim - __pyx_t_8) + 1); __pyx_temp++) {
            __Pyx_INCREF(__pyx_t_7);
            PyList_SET_ITEM(__pyx_t_9, __pyx_temp, __pyx_t_7);
            __Pyx_GIVEREF(__pyx_t_7);
          }
        }
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __pyx_t_10 = __Pyx_PyList_Extend(__pyx_v_result, __pyx_t_9); if (unlikely(__pyx_t_10 == -1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 638; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;

        /* "View.MemoryView":639
 *             if not seen_ellipsis:
 *                 result.extend([slice(None)] * (ndim - len(tup) + 1))
 *                 seen_ellipsis = True             # <<<<<<<<<<<<<<
 *             else:
 *                 result.append(slice(None))
 */
        __pyx_v_seen_ellipsis = 1;
        goto __pyx_L7;
      }
      /*else*/ {

        /* "View.MemoryView":641
 *                 seen_ellipsis = True
 *             else:
 *                 result.append(slice(None))             # <<<<<<<<<<<<<<
 *             have_slices = True
 *         else:
 */
        __pyx_t_9 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PySlice_Type))), __pyx_tuple__230, NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 641; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_9);
        __pyx_t_10 = __Pyx_PyList_Append(__pyx_v_result, __pyx_t_9); if (unlikely(__pyx_t_10 == -1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 641; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      }
      __pyx_L7:;

      /* "View.MemoryView":642
 *             else:
 *                 result.append(slice(None))
 *             have_slices = True             # <<<<<<<<<<<<<<
 *         else:
 *             if not isinstance(item, slice) and not PyIndex_Check(item):
 */
      __pyx_v_have_slices = 1;
      goto __pyx_L6;
    }
    /*else*/ {

      /* "View.MemoryView":644
 *             have_slices = True
 *         else:
 *             if not isinstance(item, slice) and not PyIndex_Check(item):             # <<<<<<<<<<<<<<
 *                 raise TypeError("Cannot index with type '%s'" % type(item))
 * 
 */
      __pyx_t_1 = PySlice_Check(__pyx_v_item); 
      __pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0);
      if (__pyx_t_2) {
        __pyx_t_1 = ((!(__Pyx_PyIndex_Check(__pyx_v_item) != 0)) != 0);
        __pyx_t_11 = __pyx_t_1;
      } else {
        __pyx_t_11 = __pyx_t_2;
      }
      if (__pyx_t_11) {

        /* "View.MemoryView":645
 *         else:
 *             if not isinstance(item, slice) and not PyIndex_Check(item):
 *                 raise TypeError("Cannot index with type '%s'" % type(item))             # <<<<<<<<<<<<<<
 * 
 *             have_slices = have_slices or isinstance(item, slice)
 */
        __pyx_t_9 = __Pyx_PyString_Format(__pyx_kp_s_Cannot_index_with_type_s, ((PyObject *)Py_TYPE(__pyx_v_item))); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 645; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_9);
        __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 645; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_7);
        PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_9);
        __Pyx_GIVEREF(__pyx_t_9);
        __pyx_t_9 = 0;
        __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_t_7, NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 645; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_9);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __Pyx_Raise(__pyx_t_9, 0, 0, 0);
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        {__pyx_filename = __pyx_f[7]; __pyx_lineno = 645; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }

      /* "View.MemoryView":647
 *                 raise TypeError("Cannot index with type '%s'" % type(item))
 * 
 *             have_slices = have_slices or isinstance(item, slice)             # <<<<<<<<<<<<<<
 *             result.append(item)
 * 
 */
      if (!__pyx_v_have_slices) {
        __pyx_t_11 = PySlice_Check(__pyx_v_item); 
        __pyx_t_2 = __pyx_t_11;
      } else {
        __pyx_t_2 = __pyx_v_have_slices;
      }
      __pyx_v_have_slices = __pyx_t_2;

      /* "View.MemoryView":648
 * 
 *             have_slices = have_slices or isinstance(item, slice)
 *             result.append(item)             # <<<<<<<<<<<<<<
 * 
 *     nslices = ndim - len(result)
 */
      __pyx_t_10 = __Pyx_PyList_Append(__pyx_v_result, __pyx_v_item); if (unlikely(__pyx_t_10 == -1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 648; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_L6:;
  }
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "View.MemoryView":650
 *             result.append(item)
 * 
 *     nslices = ndim - len(result)             # <<<<<<<<<<<<<<
 *     if nslices:
 *         result.extend([slice(None)] * nslices)
 */
  __pyx_t_5 = PyList_GET_SIZE(__pyx_v_result); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 650; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_nslices = (__pyx_v_ndim - __pyx_t_5);

  /* "View.MemoryView":651
 * 
 *     nslices = ndim - len(result)
 *     if nslices:             # <<<<<<<<<<<<<<
 *         result.extend([slice(None)] * nslices)
 * 
 */
  __pyx_t_2 = (__pyx_v_nslices != 0);
  if (__pyx_t_2) {

    /* "View.MemoryView":652
 *     nslices = ndim - len(result)
 *     if nslices:
 *         result.extend([slice(None)] * nslices)             # <<<<<<<<<<<<<<
 * 
 *     return have_slices or nslices, tuple(result)
 */
    __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PySlice_Type))), __pyx_tuple__231, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 652; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = PyList_New(1 * ((__pyx_v_nslices<0) ? 0:__pyx_v_nslices)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 652; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    { Py_ssize_t __pyx_temp;
      for (__pyx_temp=0; __pyx_temp < __pyx_v_nslices; __pyx_temp++) {
        __Pyx_INCREF(__pyx_t_3);
        PyList_SET_ITEM(__pyx_t_4, __pyx_temp, __pyx_t_3);
        __Pyx_GIVEREF(__pyx_t_3);
      }
    }
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_10 = __Pyx_PyList_Extend(__pyx_v_result, __pyx_t_4); if (unlikely(__pyx_t_10 == -1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 652; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    goto __pyx_L9;
  }
  __pyx_L9:;

  /* "View.MemoryView":654
 *         result.extend([slice(None)] * nslices)
 * 
 *     return have_slices or nslices, tuple(result)             # <<<<<<<<<<<<<<
 * 
 * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_4 = __Pyx_PyBool_FromLong(__pyx_v_have_slices); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 654; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 654; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (!__pyx_t_2) {
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_nslices); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 654; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_9 = __pyx_t_3;
    __pyx_t_3 = 0;
  } else {
    __pyx_t_9 = __pyx_t_4;
    __pyx_t_4 = 0;
  }
  __pyx_t_4 = PyList_AsTuple(__pyx_v_result); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 654; __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[7]; __pyx_lineno = 654; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_9);
  __Pyx_GIVEREF(__pyx_t_9);
  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_4);
  __pyx_t_9 = 0;
  __pyx_t_4 = 0;
  __pyx_r = ((PyObject*)__pyx_t_3);
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "View.MemoryView":622
 *     return isinstance(o, memoryview)
 * 
 * cdef tuple _unellipsify(object index, int ndim):             # <<<<<<<<<<<<<<
 *     """
 *     Replace all ellipses with full slices and fill incomplete indices with
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_AddTraceback("View.MemoryView._unellipsify", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_tup);
  __Pyx_XDECREF(__pyx_v_result);
  __Pyx_XDECREF(__pyx_v_idx);
  __Pyx_XDECREF(__pyx_v_item);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "View.MemoryView":656
 *     return have_slices or nslices, tuple(result)
 * 
 * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim):             # <<<<<<<<<<<<<<
 *     cdef int i
 *     for i in range(ndim):
 */

static PyObject *assert_direct_dimensions(Py_ssize_t *__pyx_v_suboffsets, int __pyx_v_ndim) {
  int __pyx_v_i;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("assert_direct_dimensions", 0);

  /* "View.MemoryView":658
 * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim):
 *     cdef int i
 *     for i in range(ndim):             # <<<<<<<<<<<<<<
 *         if suboffsets[i] >= 0:
 *             raise ValueError("Indirect dimensions not supported")
 */
  __pyx_t_1 = __pyx_v_ndim;
  for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) {
    __pyx_v_i = __pyx_t_2;

    /* "View.MemoryView":659
 *     cdef int i
 *     for i in range(ndim):
 *         if suboffsets[i] >= 0:             # <<<<<<<<<<<<<<
 *             raise ValueError("Indirect dimensions not supported")
 * 
 */
    __pyx_t_3 = (((__pyx_v_suboffsets[__pyx_v_i]) >= 0) != 0);
    if (__pyx_t_3) {

      /* "View.MemoryView":660
 *     for i in range(ndim):
 *         if suboffsets[i] >= 0:
 *             raise ValueError("Indirect dimensions not supported")             # <<<<<<<<<<<<<<
 * 
 * 
 */
      __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__232, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 660; __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[7]; __pyx_lineno = 660; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
  }

  /* "View.MemoryView":656
 *     return have_slices or nslices, tuple(result)
 * 
 * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim):             # <<<<<<<<<<<<<<
 *     cdef int i
 *     for i in range(ndim):
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("View.MemoryView.assert_direct_dimensions", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "View.MemoryView":667
 * 
 * @cname('__pyx_memview_slice')
 * cdef memoryview memview_slice(memoryview memview, object indices):             # <<<<<<<<<<<<<<
 *     cdef int new_ndim = 0, suboffset_dim = -1, dim
 *     cdef bint negative_step
 */

static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_obj *__pyx_v_memview, PyObject *__pyx_v_indices) {
  int __pyx_v_new_ndim;
  int __pyx_v_suboffset_dim;
  int __pyx_v_dim;
  __Pyx_memviewslice __pyx_v_src;
  __Pyx_memviewslice __pyx_v_dst;
  __Pyx_memviewslice *__pyx_v_p_src;
  struct __pyx_memoryviewslice_obj *__pyx_v_memviewsliceobj = 0;
  __Pyx_memviewslice *__pyx_v_p_dst;
  int *__pyx_v_p_suboffset_dim;
  Py_ssize_t __pyx_v_start;
  Py_ssize_t __pyx_v_stop;
  Py_ssize_t __pyx_v_step;
  int __pyx_v_have_start;
  int __pyx_v_have_stop;
  int __pyx_v_have_step;
  PyObject *__pyx_v_index = NULL;
  struct __pyx_memoryview_obj *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  struct __pyx_memoryview_obj *__pyx_t_4;
  char *__pyx_t_5;
  int __pyx_t_6;
  Py_ssize_t __pyx_t_7;
  PyObject *(*__pyx_t_8)(PyObject *);
  PyObject *__pyx_t_9 = NULL;
  Py_ssize_t __pyx_t_10;
  int __pyx_t_11;
  PyObject *__pyx_t_12 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("memview_slice", 0);

  /* "View.MemoryView":668
 * @cname('__pyx_memview_slice')
 * cdef memoryview memview_slice(memoryview memview, object indices):
 *     cdef int new_ndim = 0, suboffset_dim = -1, dim             # <<<<<<<<<<<<<<
 *     cdef bint negative_step
 *     cdef __Pyx_memviewslice src, dst
 */
  __pyx_v_new_ndim = 0;
  __pyx_v_suboffset_dim = -1;

  /* "View.MemoryView":675
 * 
 * 
 *     memset(&dst, 0, sizeof(dst))             # <<<<<<<<<<<<<<
 * 
 *     cdef _memoryviewslice memviewsliceobj
 */
  memset((&__pyx_v_dst), 0, (sizeof(__pyx_v_dst)));

  /* "View.MemoryView":679
 *     cdef _memoryviewslice memviewsliceobj
 * 
 *     assert memview.view.ndim > 0             # <<<<<<<<<<<<<<
 * 
 *     if isinstance(memview, _memoryviewslice):
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(!Py_OptimizeFlag)) {
    if (unlikely(!((__pyx_v_memview->view.ndim > 0) != 0))) {
      PyErr_SetNone(PyExc_AssertionError);
      {__pyx_filename = __pyx_f[7]; __pyx_lineno = 679; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
  }
  #endif

  /* "View.MemoryView":681
 *     assert memview.view.ndim > 0
 * 
 *     if isinstance(memview, _memoryviewslice):             # <<<<<<<<<<<<<<
 *         memviewsliceobj = memview
 *         p_src = &memviewsliceobj.from_slice
 */
  __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), ((PyObject *)__pyx_memoryviewslice_type)); 
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (__pyx_t_2) {

    /* "View.MemoryView":682
 * 
 *     if isinstance(memview, _memoryviewslice):
 *         memviewsliceobj = memview             # <<<<<<<<<<<<<<
 *         p_src = &memviewsliceobj.from_slice
 *     else:
 */
    if (!(likely(((((PyObject *)__pyx_v_memview)) == Py_None) || likely(__Pyx_TypeTest(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type))))) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 682; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_3 = ((PyObject *)__pyx_v_memview);
    __Pyx_INCREF(__pyx_t_3);
    __pyx_v_memviewsliceobj = ((struct __pyx_memoryviewslice_obj *)__pyx_t_3);
    __pyx_t_3 = 0;

    /* "View.MemoryView":683
 *     if isinstance(memview, _memoryviewslice):
 *         memviewsliceobj = memview
 *         p_src = &memviewsliceobj.from_slice             # <<<<<<<<<<<<<<
 *     else:
 *         slice_copy(memview, &src)
 */
    __pyx_v_p_src = (&__pyx_v_memviewsliceobj->from_slice);
    goto __pyx_L3;
  }
  /*else*/ {

    /* "View.MemoryView":685
 *         p_src = &memviewsliceobj.from_slice
 *     else:
 *         slice_copy(memview, &src)             # <<<<<<<<<<<<<<
 *         p_src = &src
 * 
 */
    __pyx_memoryview_slice_copy(__pyx_v_memview, (&__pyx_v_src));

    /* "View.MemoryView":686
 *     else:
 *         slice_copy(memview, &src)
 *         p_src = &src             # <<<<<<<<<<<<<<
 * 
 * 
 */
    __pyx_v_p_src = (&__pyx_v_src);
  }
  __pyx_L3:;

  /* "View.MemoryView":692
 * 
 * 
 *     dst.memview = p_src.memview             # <<<<<<<<<<<<<<
 *     dst.data = p_src.data
 * 
 */
  __pyx_t_4 = __pyx_v_p_src->memview;
  __pyx_v_dst.memview = __pyx_t_4;

  /* "View.MemoryView":693
 * 
 *     dst.memview = p_src.memview
 *     dst.data = p_src.data             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_5 = __pyx_v_p_src->data;
  __pyx_v_dst.data = __pyx_t_5;

  /* "View.MemoryView":698
 * 
 * 
 *     cdef __Pyx_memviewslice *p_dst = &dst             # <<<<<<<<<<<<<<
 *     cdef int *p_suboffset_dim = &suboffset_dim
 *     cdef Py_ssize_t start, stop, step
 */
  __pyx_v_p_dst = (&__pyx_v_dst);

  /* "View.MemoryView":699
 * 
 *     cdef __Pyx_memviewslice *p_dst = &dst
 *     cdef int *p_suboffset_dim = &suboffset_dim             # <<<<<<<<<<<<<<
 *     cdef Py_ssize_t start, stop, step
 *     cdef bint have_start, have_stop, have_step
 */
  __pyx_v_p_suboffset_dim = (&__pyx_v_suboffset_dim);

  /* "View.MemoryView":703
 *     cdef bint have_start, have_stop, have_step
 * 
 *     for dim, index in enumerate(indices):             # <<<<<<<<<<<<<<
 *         if PyIndex_Check(index):
 *             slice_memviewslice(
 */
  __pyx_t_6 = 0;
  if (PyList_CheckExact(__pyx_v_indices) || PyTuple_CheckExact(__pyx_v_indices)) {
    __pyx_t_3 = __pyx_v_indices; __Pyx_INCREF(__pyx_t_3); __pyx_t_7 = 0;
    __pyx_t_8 = NULL;
  } else {
    __pyx_t_7 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_indices); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 703; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_8 = Py_TYPE(__pyx_t_3)->tp_iternext;
  }
  for (;;) {
    if (!__pyx_t_8 && PyList_CheckExact(__pyx_t_3)) {
      if (__pyx_t_7 >= PyList_GET_SIZE(__pyx_t_3)) break;
      #if CYTHON_COMPILING_IN_CPYTHON
      __pyx_t_9 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_7); __Pyx_INCREF(__pyx_t_9); __pyx_t_7++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 703; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #else
      __pyx_t_9 = PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 703; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #endif
    } else if (!__pyx_t_8 && PyTuple_CheckExact(__pyx_t_3)) {
      if (__pyx_t_7 >= PyTuple_GET_SIZE(__pyx_t_3)) break;
      #if CYTHON_COMPILING_IN_CPYTHON
      __pyx_t_9 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_7); __Pyx_INCREF(__pyx_t_9); __pyx_t_7++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 703; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #else
      __pyx_t_9 = PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 703; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #endif
    } else {
      __pyx_t_9 = __pyx_t_8(__pyx_t_3);
      if (unlikely(!__pyx_t_9)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else {__pyx_filename = __pyx_f[7]; __pyx_lineno = 703; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_9);
    }
    __Pyx_XDECREF_SET(__pyx_v_index, __pyx_t_9);
    __pyx_t_9 = 0;
    __pyx_v_dim = __pyx_t_6;
    __pyx_t_6 = (__pyx_t_6 + 1);

    /* "View.MemoryView":704
 * 
 *     for dim, index in enumerate(indices):
 *         if PyIndex_Check(index):             # <<<<<<<<<<<<<<
 *             slice_memviewslice(
 *                 p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim],
 */
    __pyx_t_2 = (__Pyx_PyIndex_Check(__pyx_v_index) != 0);
    if (__pyx_t_2) {

      /* "View.MemoryView":708
 *                 p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim],
 *                 dim, new_ndim, p_suboffset_dim,
 *                 index, 0, 0, # start, stop, step             # <<<<<<<<<<<<<<
 *                 0, 0, 0, # have_{start,stop,step}
 *                 False)
 */
      __pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_v_index); if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 708; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

      /* "View.MemoryView":705
 *     for dim, index in enumerate(indices):
 *         if PyIndex_Check(index):
 *             slice_memviewslice(             # <<<<<<<<<<<<<<
 *                 p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim],
 *                 dim, new_ndim, p_suboffset_dim,
 */
      __pyx_t_11 = __pyx_memoryview_slice_memviewslice(__pyx_v_p_dst, (__pyx_v_p_src->shape[__pyx_v_dim]), (__pyx_v_p_src->strides[__pyx_v_dim]), (__pyx_v_p_src->suboffsets[__pyx_v_dim]), __pyx_v_dim, __pyx_v_new_ndim, __pyx_v_p_suboffset_dim, __pyx_t_10, 0, 0, 0, 0, 0, 0); if (unlikely(__pyx_t_11 == -1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 705; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      goto __pyx_L6;
    }

    /* "View.MemoryView":711
 *                 0, 0, 0, # have_{start,stop,step}
 *                 False)
 *         elif index is None:             # <<<<<<<<<<<<<<
 *             p_dst.shape[new_ndim] = 1
 *             p_dst.strides[new_ndim] = 0
 */
    __pyx_t_2 = (__pyx_v_index == Py_None);
    __pyx_t_1 = (__pyx_t_2 != 0);
    if (__pyx_t_1) {

      /* "View.MemoryView":712
 *                 False)
 *         elif index is None:
 *             p_dst.shape[new_ndim] = 1             # <<<<<<<<<<<<<<
 *             p_dst.strides[new_ndim] = 0
 *             p_dst.suboffsets[new_ndim] = -1
 */
      (__pyx_v_p_dst->shape[__pyx_v_new_ndim]) = 1;

      /* "View.MemoryView":713
 *         elif index is None:
 *             p_dst.shape[new_ndim] = 1
 *             p_dst.strides[new_ndim] = 0             # <<<<<<<<<<<<<<
 *             p_dst.suboffsets[new_ndim] = -1
 *             new_ndim += 1
 */
      (__pyx_v_p_dst->strides[__pyx_v_new_ndim]) = 0;

      /* "View.MemoryView":714
 *             p_dst.shape[new_ndim] = 1
 *             p_dst.strides[new_ndim] = 0
 *             p_dst.suboffsets[new_ndim] = -1             # <<<<<<<<<<<<<<
 *             new_ndim += 1
 *         else:
 */
      (__pyx_v_p_dst->suboffsets[__pyx_v_new_ndim]) = -1;

      /* "View.MemoryView":715
 *             p_dst.strides[new_ndim] = 0
 *             p_dst.suboffsets[new_ndim] = -1
 *             new_ndim += 1             # <<<<<<<<<<<<<<
 *         else:
 *             start = index.start or 0
 */
      __pyx_v_new_ndim = (__pyx_v_new_ndim + 1);
      goto __pyx_L6;
    }
    /*else*/ {

      /* "View.MemoryView":717
 *             new_ndim += 1
 *         else:
 *             start = index.start or 0             # <<<<<<<<<<<<<<
 *             stop = index.stop or 0
 *             step = index.step or 0
 */
      __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_start); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 717; __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[7]; __pyx_lineno = 717; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      if (!__pyx_t_1) {
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        __Pyx_INCREF(__pyx_int_0);
        __pyx_t_12 = __pyx_int_0;
      } else {
        __pyx_t_12 = __pyx_t_9;
        __pyx_t_9 = 0;
      }
      __pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_t_12); if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 717; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      __pyx_v_start = __pyx_t_10;

      /* "View.MemoryView":718
 *         else:
 *             start = index.start or 0
 *             stop = index.stop or 0             # <<<<<<<<<<<<<<
 *             step = index.step or 0
 * 
 */
      __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_stop); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 718; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_12);
      __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_12); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 718; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      if (!__pyx_t_1) {
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        __Pyx_INCREF(__pyx_int_0);
        __pyx_t_9 = __pyx_int_0;
      } else {
        __pyx_t_9 = __pyx_t_12;
        __pyx_t_12 = 0;
      }
      __pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9); if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 718; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __pyx_v_stop = __pyx_t_10;

      /* "View.MemoryView":719
 *             start = index.start or 0
 *             stop = index.stop or 0
 *             step = index.step or 0             # <<<<<<<<<<<<<<
 * 
 *             have_start = index.start is not None
 */
      __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_step); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 719; __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[7]; __pyx_lineno = 719; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      if (!__pyx_t_1) {
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        __Pyx_INCREF(__pyx_int_0);
        __pyx_t_12 = __pyx_int_0;
      } else {
        __pyx_t_12 = __pyx_t_9;
        __pyx_t_9 = 0;
      }
      __pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_t_12); if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 719; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      __pyx_v_step = __pyx_t_10;

      /* "View.MemoryView":721
 *             step = index.step or 0
 * 
 *             have_start = index.start is not None             # <<<<<<<<<<<<<<
 *             have_stop = index.stop is not None
 *             have_step = index.step is not None
 */
      __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_start); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 721; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_12);
      __pyx_t_1 = (__pyx_t_12 != Py_None);
      __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      __pyx_v_have_start = __pyx_t_1;

      /* "View.MemoryView":722
 * 
 *             have_start = index.start is not None
 *             have_stop = index.stop is not None             # <<<<<<<<<<<<<<
 *             have_step = index.step is not None
 * 
 */
      __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_stop); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 722; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_12);
      __pyx_t_1 = (__pyx_t_12 != Py_None);
      __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      __pyx_v_have_stop = __pyx_t_1;

      /* "View.MemoryView":723
 *             have_start = index.start is not None
 *             have_stop = index.stop is not None
 *             have_step = index.step is not None             # <<<<<<<<<<<<<<
 * 
 *             slice_memviewslice(
 */
      __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_step); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 723; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_12);
      __pyx_t_1 = (__pyx_t_12 != Py_None);
      __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      __pyx_v_have_step = __pyx_t_1;

      /* "View.MemoryView":725
 *             have_step = index.step is not None
 * 
 *             slice_memviewslice(             # <<<<<<<<<<<<<<
 *                 p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim],
 *                 dim, new_ndim, p_suboffset_dim,
 */
      __pyx_t_11 = __pyx_memoryview_slice_memviewslice(__pyx_v_p_dst, (__pyx_v_p_src->shape[__pyx_v_dim]), (__pyx_v_p_src->strides[__pyx_v_dim]), (__pyx_v_p_src->suboffsets[__pyx_v_dim]), __pyx_v_dim, __pyx_v_new_ndim, __pyx_v_p_suboffset_dim, __pyx_v_start, __pyx_v_stop, __pyx_v_step, __pyx_v_have_start, __pyx_v_have_stop, __pyx_v_have_step, 1); if (unlikely(__pyx_t_11 == -1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 725; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

      /* "View.MemoryView":731
 *                 have_start, have_stop, have_step,
 *                 True)
 *             new_ndim += 1             # <<<<<<<<<<<<<<
 * 
 *     if isinstance(memview, _memoryviewslice):
 */
      __pyx_v_new_ndim = (__pyx_v_new_ndim + 1);
    }
    __pyx_L6:;
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "View.MemoryView":733
 *             new_ndim += 1
 * 
 *     if isinstance(memview, _memoryviewslice):             # <<<<<<<<<<<<<<
 *         return memoryview_fromslice(dst, new_ndim,
 *                                     memviewsliceobj.to_object_func,
 */
  __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), ((PyObject *)__pyx_memoryviewslice_type)); 
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (__pyx_t_2) {

    /* "View.MemoryView":734
 * 
 *     if isinstance(memview, _memoryviewslice):
 *         return memoryview_fromslice(dst, new_ndim,             # <<<<<<<<<<<<<<
 *                                     memviewsliceobj.to_object_func,
 *                                     memviewsliceobj.to_dtype_func,
 */
    __Pyx_XDECREF(((PyObject *)__pyx_r));

    /* "View.MemoryView":735
 *     if isinstance(memview, _memoryviewslice):
 *         return memoryview_fromslice(dst, new_ndim,
 *                                     memviewsliceobj.to_object_func,             # <<<<<<<<<<<<<<
 *                                     memviewsliceobj.to_dtype_func,
 *                                     memview.dtype_is_object)
 */
    if (unlikely(!__pyx_v_memviewsliceobj)) { __Pyx_RaiseUnboundLocalError("memviewsliceobj"); {__pyx_filename = __pyx_f[7]; __pyx_lineno = 735; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }

    /* "View.MemoryView":736
 *         return memoryview_fromslice(dst, new_ndim,
 *                                     memviewsliceobj.to_object_func,
 *                                     memviewsliceobj.to_dtype_func,             # <<<<<<<<<<<<<<
 *                                     memview.dtype_is_object)
 *     else:
 */
    if (unlikely(!__pyx_v_memviewsliceobj)) { __Pyx_RaiseUnboundLocalError("memviewsliceobj"); {__pyx_filename = __pyx_f[7]; __pyx_lineno = 736; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }

    /* "View.MemoryView":734
 * 
 *     if isinstance(memview, _memoryviewslice):
 *         return memoryview_fromslice(dst, new_ndim,             # <<<<<<<<<<<<<<
 *                                     memviewsliceobj.to_object_func,
 *                                     memviewsliceobj.to_dtype_func,
 */
    __pyx_t_3 = __pyx_memoryview_fromslice(__pyx_v_dst, __pyx_v_new_ndim, __pyx_v_memviewsliceobj->to_object_func, __pyx_v_memviewsliceobj->to_dtype_func, __pyx_v_memview->dtype_is_object); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 734; __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_memoryview_type))))) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 734; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_r = ((struct __pyx_memoryview_obj *)__pyx_t_3);
    __pyx_t_3 = 0;
    goto __pyx_L0;
  }
  /*else*/ {

    /* "View.MemoryView":739
 *                                     memview.dtype_is_object)
 *     else:
 *         return memoryview_fromslice(dst, new_ndim, NULL, NULL,             # <<<<<<<<<<<<<<
 *                                     memview.dtype_is_object)
 * 
 */
    __Pyx_XDECREF(((PyObject *)__pyx_r));

    /* "View.MemoryView":740
 *     else:
 *         return memoryview_fromslice(dst, new_ndim, NULL, NULL,
 *                                     memview.dtype_is_object)             # <<<<<<<<<<<<<<
 * 
 * 
 */
    __pyx_t_3 = __pyx_memoryview_fromslice(__pyx_v_dst, __pyx_v_new_ndim, NULL, NULL, __pyx_v_memview->dtype_is_object); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 739; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);

    /* "View.MemoryView":739
 *                                     memview.dtype_is_object)
 *     else:
 *         return memoryview_fromslice(dst, new_ndim, NULL, NULL,             # <<<<<<<<<<<<<<
 *                                     memview.dtype_is_object)
 * 
 */
    if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_memoryview_type))))) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 739; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_r = ((struct __pyx_memoryview_obj *)__pyx_t_3);
    __pyx_t_3 = 0;
    goto __pyx_L0;
  }

  /* "View.MemoryView":667
 * 
 * @cname('__pyx_memview_slice')
 * cdef memoryview memview_slice(memoryview memview, object indices):             # <<<<<<<<<<<<<<
 *     cdef int new_ndim = 0, suboffset_dim = -1, dim
 *     cdef bint negative_step
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_AddTraceback("View.MemoryView.memview_slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_memviewsliceobj);
  __Pyx_XDECREF(__pyx_v_index);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "View.MemoryView":764
 * 
 * @cname('__pyx_memoryview_slice_memviewslice')
 * cdef int slice_memviewslice(             # <<<<<<<<<<<<<<
 *         __Pyx_memviewslice *dst,
 *         Py_ssize_t shape, Py_ssize_t stride, Py_ssize_t suboffset,
 */

static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, Py_ssize_t __pyx_v_shape, Py_ssize_t __pyx_v_stride, Py_ssize_t __pyx_v_suboffset, int __pyx_v_dim, int __pyx_v_new_ndim, int *__pyx_v_suboffset_dim, Py_ssize_t __pyx_v_start, Py_ssize_t __pyx_v_stop, Py_ssize_t __pyx_v_step, int __pyx_v_have_start, int __pyx_v_have_stop, int __pyx_v_have_step, int __pyx_v_is_slice) {
  Py_ssize_t __pyx_v_new_shape;
  int __pyx_v_negative_step;
  int __pyx_r;
  int __pyx_t_1;
  int __pyx_t_2;
  int __pyx_t_3;
  int __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* "View.MemoryView":784
 *     cdef bint negative_step
 * 
 *     if not is_slice:             # <<<<<<<<<<<<<<
 * 
 *         if start < 0:
 */
  __pyx_t_1 = ((!(__pyx_v_is_slice != 0)) != 0);
  if (__pyx_t_1) {

    /* "View.MemoryView":786
 *     if not is_slice:
 * 
 *         if start < 0:             # <<<<<<<<<<<<<<
 *             start += shape
 *         if not 0 <= start < shape:
 */
    __pyx_t_1 = ((__pyx_v_start < 0) != 0);
    if (__pyx_t_1) {

      /* "View.MemoryView":787
 * 
 *         if start < 0:
 *             start += shape             # <<<<<<<<<<<<<<
 *         if not 0 <= start < shape:
 *             _err_dim(IndexError, "Index out of bounds (axis %d)", dim)
 */
      __pyx_v_start = (__pyx_v_start + __pyx_v_shape);
      goto __pyx_L4;
    }
    __pyx_L4:;

    /* "View.MemoryView":788
 *         if start < 0:
 *             start += shape
 *         if not 0 <= start < shape:             # <<<<<<<<<<<<<<
 *             _err_dim(IndexError, "Index out of bounds (axis %d)", dim)
 *     else:
 */
    __pyx_t_1 = (0 <= __pyx_v_start);
    if (__pyx_t_1) {
      __pyx_t_1 = (__pyx_v_start < __pyx_v_shape);
    }
    __pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0);
    if (__pyx_t_2) {

      /* "View.MemoryView":789
 *             start += shape
 *         if not 0 <= start < shape:
 *             _err_dim(IndexError, "Index out of bounds (axis %d)", dim)             # <<<<<<<<<<<<<<
 *     else:
 * 
 */
      __pyx_t_3 = __pyx_memoryview_err_dim(__pyx_builtin_IndexError, __pyx_k_Index_out_of_bounds_axis_d, __pyx_v_dim); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 789; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      goto __pyx_L5;
    }
    __pyx_L5:;
    goto __pyx_L3;
  }
  /*else*/ {

    /* "View.MemoryView":792
 *     else:
 * 
 *         negative_step = have_step != 0 and step < 0             # <<<<<<<<<<<<<<
 * 
 *         if have_step and step == 0:
 */
    __pyx_t_2 = (__pyx_v_have_step != 0);
    if (__pyx_t_2) {
      __pyx_t_1 = (__pyx_v_step < 0);
      __pyx_t_4 = __pyx_t_1;
    } else {
      __pyx_t_4 = __pyx_t_2;
    }
    __pyx_v_negative_step = __pyx_t_4;

    /* "View.MemoryView":794
 *         negative_step = have_step != 0 and step < 0
 * 
 *         if have_step and step == 0:             # <<<<<<<<<<<<<<
 *             _err_dim(ValueError, "Step may not be zero (axis %d)", dim)
 * 
 */
    if ((__pyx_v_have_step != 0)) {
      __pyx_t_4 = (__pyx_v_step == 0);
      __pyx_t_2 = __pyx_t_4;
    } else {
      __pyx_t_2 = (__pyx_v_have_step != 0);
    }
    if (__pyx_t_2) {

      /* "View.MemoryView":795
 * 
 *         if have_step and step == 0:
 *             _err_dim(ValueError, "Step may not be zero (axis %d)", dim)             # <<<<<<<<<<<<<<
 * 
 * 
 */
      __pyx_t_3 = __pyx_memoryview_err_dim(__pyx_builtin_ValueError, __pyx_k_Step_may_not_be_zero_axis_d, __pyx_v_dim); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 795; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      goto __pyx_L6;
    }
    __pyx_L6:;

    /* "View.MemoryView":798
 * 
 * 
 *         if have_start:             # <<<<<<<<<<<<<<
 *             if start < 0:
 *                 start += shape
 */
    __pyx_t_2 = (__pyx_v_have_start != 0);
    if (__pyx_t_2) {

      /* "View.MemoryView":799
 * 
 *         if have_start:
 *             if start < 0:             # <<<<<<<<<<<<<<
 *                 start += shape
 *                 if start < 0:
 */
      __pyx_t_2 = ((__pyx_v_start < 0) != 0);
      if (__pyx_t_2) {

        /* "View.MemoryView":800
 *         if have_start:
 *             if start < 0:
 *                 start += shape             # <<<<<<<<<<<<<<
 *                 if start < 0:
 *                     start = 0
 */
        __pyx_v_start = (__pyx_v_start + __pyx_v_shape);

        /* "View.MemoryView":801
 *             if start < 0:
 *                 start += shape
 *                 if start < 0:             # <<<<<<<<<<<<<<
 *                     start = 0
 *             elif start >= shape:
 */
        __pyx_t_2 = ((__pyx_v_start < 0) != 0);
        if (__pyx_t_2) {

          /* "View.MemoryView":802
 *                 start += shape
 *                 if start < 0:
 *                     start = 0             # <<<<<<<<<<<<<<
 *             elif start >= shape:
 *                 if negative_step:
 */
          __pyx_v_start = 0;
          goto __pyx_L9;
        }
        __pyx_L9:;
        goto __pyx_L8;
      }

      /* "View.MemoryView":803
 *                 if start < 0:
 *                     start = 0
 *             elif start >= shape:             # <<<<<<<<<<<<<<
 *                 if negative_step:
 *                     start = shape - 1
 */
      __pyx_t_2 = ((__pyx_v_start >= __pyx_v_shape) != 0);
      if (__pyx_t_2) {

        /* "View.MemoryView":804
 *                     start = 0
 *             elif start >= shape:
 *                 if negative_step:             # <<<<<<<<<<<<<<
 *                     start = shape - 1
 *                 else:
 */
        __pyx_t_2 = (__pyx_v_negative_step != 0);
        if (__pyx_t_2) {

          /* "View.MemoryView":805
 *             elif start >= shape:
 *                 if negative_step:
 *                     start = shape - 1             # <<<<<<<<<<<<<<
 *                 else:
 *                     start = shape
 */
          __pyx_v_start = (__pyx_v_shape - 1);
          goto __pyx_L10;
        }
        /*else*/ {

          /* "View.MemoryView":807
 *                     start = shape - 1
 *                 else:
 *                     start = shape             # <<<<<<<<<<<<<<
 *         else:
 *             if negative_step:
 */
          __pyx_v_start = __pyx_v_shape;
        }
        __pyx_L10:;
        goto __pyx_L8;
      }
      __pyx_L8:;
      goto __pyx_L7;
    }
    /*else*/ {

      /* "View.MemoryView":809
 *                     start = shape
 *         else:
 *             if negative_step:             # <<<<<<<<<<<<<<
 *                 start = shape - 1
 *             else:
 */
      __pyx_t_2 = (__pyx_v_negative_step != 0);
      if (__pyx_t_2) {

        /* "View.MemoryView":810
 *         else:
 *             if negative_step:
 *                 start = shape - 1             # <<<<<<<<<<<<<<
 *             else:
 *                 start = 0
 */
        __pyx_v_start = (__pyx_v_shape - 1);
        goto __pyx_L11;
      }
      /*else*/ {

        /* "View.MemoryView":812
 *                 start = shape - 1
 *             else:
 *                 start = 0             # <<<<<<<<<<<<<<
 * 
 *         if have_stop:
 */
        __pyx_v_start = 0;
      }
      __pyx_L11:;
    }
    __pyx_L7:;

    /* "View.MemoryView":814
 *                 start = 0
 * 
 *         if have_stop:             # <<<<<<<<<<<<<<
 *             if stop < 0:
 *                 stop += shape
 */
    __pyx_t_2 = (__pyx_v_have_stop != 0);
    if (__pyx_t_2) {

      /* "View.MemoryView":815
 * 
 *         if have_stop:
 *             if stop < 0:             # <<<<<<<<<<<<<<
 *                 stop += shape
 *                 if stop < 0:
 */
      __pyx_t_2 = ((__pyx_v_stop < 0) != 0);
      if (__pyx_t_2) {

        /* "View.MemoryView":816
 *         if have_stop:
 *             if stop < 0:
 *                 stop += shape             # <<<<<<<<<<<<<<
 *                 if stop < 0:
 *                     stop = 0
 */
        __pyx_v_stop = (__pyx_v_stop + __pyx_v_shape);

        /* "View.MemoryView":817
 *             if stop < 0:
 *                 stop += shape
 *                 if stop < 0:             # <<<<<<<<<<<<<<
 *                     stop = 0
 *             elif stop > shape:
 */
        __pyx_t_2 = ((__pyx_v_stop < 0) != 0);
        if (__pyx_t_2) {

          /* "View.MemoryView":818
 *                 stop += shape
 *                 if stop < 0:
 *                     stop = 0             # <<<<<<<<<<<<<<
 *             elif stop > shape:
 *                 stop = shape
 */
          __pyx_v_stop = 0;
          goto __pyx_L14;
        }
        __pyx_L14:;
        goto __pyx_L13;
      }

      /* "View.MemoryView":819
 *                 if stop < 0:
 *                     stop = 0
 *             elif stop > shape:             # <<<<<<<<<<<<<<
 *                 stop = shape
 *         else:
 */
      __pyx_t_2 = ((__pyx_v_stop > __pyx_v_shape) != 0);
      if (__pyx_t_2) {

        /* "View.MemoryView":820
 *                     stop = 0
 *             elif stop > shape:
 *                 stop = shape             # <<<<<<<<<<<<<<
 *         else:
 *             if negative_step:
 */
        __pyx_v_stop = __pyx_v_shape;
        goto __pyx_L13;
      }
      __pyx_L13:;
      goto __pyx_L12;
    }
    /*else*/ {

      /* "View.MemoryView":822
 *                 stop = shape
 *         else:
 *             if negative_step:             # <<<<<<<<<<<<<<
 *                 stop = -1
 *             else:
 */
      __pyx_t_2 = (__pyx_v_negative_step != 0);
      if (__pyx_t_2) {

        /* "View.MemoryView":823
 *         else:
 *             if negative_step:
 *                 stop = -1             # <<<<<<<<<<<<<<
 *             else:
 *                 stop = shape
 */
        __pyx_v_stop = -1;
        goto __pyx_L15;
      }
      /*else*/ {

        /* "View.MemoryView":825
 *                 stop = -1
 *             else:
 *                 stop = shape             # <<<<<<<<<<<<<<
 * 
 *         if not have_step:
 */
        __pyx_v_stop = __pyx_v_shape;
      }
      __pyx_L15:;
    }
    __pyx_L12:;

    /* "View.MemoryView":827
 *                 stop = shape
 * 
 *         if not have_step:             # <<<<<<<<<<<<<<
 *             step = 1
 * 
 */
    __pyx_t_2 = ((!(__pyx_v_have_step != 0)) != 0);
    if (__pyx_t_2) {

      /* "View.MemoryView":828
 * 
 *         if not have_step:
 *             step = 1             # <<<<<<<<<<<<<<
 * 
 * 
 */
      __pyx_v_step = 1;
      goto __pyx_L16;
    }
    __pyx_L16:;

    /* "View.MemoryView":832
 * 
 *         with cython.cdivision(True):
 *             new_shape = (stop - start) // step             # <<<<<<<<<<<<<<
 * 
 *             if (stop - start) - step * new_shape:
 */
    __pyx_v_new_shape = ((__pyx_v_stop - __pyx_v_start) / __pyx_v_step);

    /* "View.MemoryView":834
 *             new_shape = (stop - start) // step
 * 
 *             if (stop - start) - step * new_shape:             # <<<<<<<<<<<<<<
 *                 new_shape += 1
 * 
 */
    __pyx_t_2 = (((__pyx_v_stop - __pyx_v_start) - (__pyx_v_step * __pyx_v_new_shape)) != 0);
    if (__pyx_t_2) {

      /* "View.MemoryView":835
 * 
 *             if (stop - start) - step * new_shape:
 *                 new_shape += 1             # <<<<<<<<<<<<<<
 * 
 *         if new_shape < 0:
 */
      __pyx_v_new_shape = (__pyx_v_new_shape + 1);
      goto __pyx_L17;
    }
    __pyx_L17:;

    /* "View.MemoryView":837
 *                 new_shape += 1
 * 
 *         if new_shape < 0:             # <<<<<<<<<<<<<<
 *             new_shape = 0
 * 
 */
    __pyx_t_2 = ((__pyx_v_new_shape < 0) != 0);
    if (__pyx_t_2) {

      /* "View.MemoryView":838
 * 
 *         if new_shape < 0:
 *             new_shape = 0             # <<<<<<<<<<<<<<
 * 
 * 
 */
      __pyx_v_new_shape = 0;
      goto __pyx_L18;
    }
    __pyx_L18:;

    /* "View.MemoryView":841
 * 
 * 
 *         dst.strides[new_ndim] = stride * step             # <<<<<<<<<<<<<<
 *         dst.shape[new_ndim] = new_shape
 *         dst.suboffsets[new_ndim] = suboffset
 */
    (__pyx_v_dst->strides[__pyx_v_new_ndim]) = (__pyx_v_stride * __pyx_v_step);

    /* "View.MemoryView":842
 * 
 *         dst.strides[new_ndim] = stride * step
 *         dst.shape[new_ndim] = new_shape             # <<<<<<<<<<<<<<
 *         dst.suboffsets[new_ndim] = suboffset
 * 
 */
    (__pyx_v_dst->shape[__pyx_v_new_ndim]) = __pyx_v_new_shape;

    /* "View.MemoryView":843
 *         dst.strides[new_ndim] = stride * step
 *         dst.shape[new_ndim] = new_shape
 *         dst.suboffsets[new_ndim] = suboffset             # <<<<<<<<<<<<<<
 * 
 * 
 */
    (__pyx_v_dst->suboffsets[__pyx_v_new_ndim]) = __pyx_v_suboffset;
  }
  __pyx_L3:;

  /* "View.MemoryView":846
 * 
 * 
 *     if suboffset_dim[0] < 0:             # <<<<<<<<<<<<<<
 *         dst.data += start * stride
 *     else:
 */
  __pyx_t_2 = (((__pyx_v_suboffset_dim[0]) < 0) != 0);
  if (__pyx_t_2) {

    /* "View.MemoryView":847
 * 
 *     if suboffset_dim[0] < 0:
 *         dst.data += start * stride             # <<<<<<<<<<<<<<
 *     else:
 *         dst.suboffsets[suboffset_dim[0]] += start * stride
 */
    __pyx_v_dst->data = (__pyx_v_dst->data + (__pyx_v_start * __pyx_v_stride));
    goto __pyx_L19;
  }
  /*else*/ {

    /* "View.MemoryView":849
 *         dst.data += start * stride
 *     else:
 *         dst.suboffsets[suboffset_dim[0]] += start * stride             # <<<<<<<<<<<<<<
 * 
 *     if suboffset >= 0:
 */
    __pyx_t_3 = (__pyx_v_suboffset_dim[0]);
    (__pyx_v_dst->suboffsets[__pyx_t_3]) = ((__pyx_v_dst->suboffsets[__pyx_t_3]) + (__pyx_v_start * __pyx_v_stride));
  }
  __pyx_L19:;

  /* "View.MemoryView":851
 *         dst.suboffsets[suboffset_dim[0]] += start * stride
 * 
 *     if suboffset >= 0:             # <<<<<<<<<<<<<<
 *         if not is_slice:
 *             if new_ndim == 0:
 */
  __pyx_t_2 = ((__pyx_v_suboffset >= 0) != 0);
  if (__pyx_t_2) {

    /* "View.MemoryView":852
 * 
 *     if suboffset >= 0:
 *         if not is_slice:             # <<<<<<<<<<<<<<
 *             if new_ndim == 0:
 *                 dst.data = (<char **> dst.data)[0] + suboffset
 */
    __pyx_t_2 = ((!(__pyx_v_is_slice != 0)) != 0);
    if (__pyx_t_2) {

      /* "View.MemoryView":853
 *     if suboffset >= 0:
 *         if not is_slice:
 *             if new_ndim == 0:             # <<<<<<<<<<<<<<
 *                 dst.data = (<char **> dst.data)[0] + suboffset
 *             else:
 */
      __pyx_t_2 = ((__pyx_v_new_ndim == 0) != 0);
      if (__pyx_t_2) {

        /* "View.MemoryView":854
 *         if not is_slice:
 *             if new_ndim == 0:
 *                 dst.data = (<char **> dst.data)[0] + suboffset             # <<<<<<<<<<<<<<
 *             else:
 *                 _err_dim(IndexError, "All dimensions preceding dimension %d "
 */
        __pyx_v_dst->data = ((((char **)__pyx_v_dst->data)[0]) + __pyx_v_suboffset);
        goto __pyx_L22;
      }
      /*else*/ {

        /* "View.MemoryView":856
 *                 dst.data = (<char **> dst.data)[0] + suboffset
 *             else:
 *                 _err_dim(IndexError, "All dimensions preceding dimension %d "             # <<<<<<<<<<<<<<
 *                                      "must be indexed and not sliced", dim)
 *         else:
 */
        __pyx_t_3 = __pyx_memoryview_err_dim(__pyx_builtin_IndexError, __pyx_k_All_dimensions_preceding_dimensi, __pyx_v_dim); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 856; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_L22:;
      goto __pyx_L21;
    }
    /*else*/ {

      /* "View.MemoryView":859
 *                                      "must be indexed and not sliced", dim)
 *         else:
 *             suboffset_dim[0] = new_ndim             # <<<<<<<<<<<<<<
 * 
 *     return 0
 */
      (__pyx_v_suboffset_dim[0]) = __pyx_v_new_ndim;
    }
    __pyx_L21:;
    goto __pyx_L20;
  }
  __pyx_L20:;

  /* "View.MemoryView":861
 *             suboffset_dim[0] = new_ndim
 * 
 *     return 0             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = 0;
  goto __pyx_L0;

  /* "View.MemoryView":764
 * 
 * @cname('__pyx_memoryview_slice_memviewslice')
 * cdef int slice_memviewslice(             # <<<<<<<<<<<<<<
 *         __Pyx_memviewslice *dst,
 *         Py_ssize_t shape, Py_ssize_t stride, Py_ssize_t suboffset,
 */

  /* function exit code */
  __pyx_L1_error:;
  {
    #ifdef WITH_THREAD
    PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
    #endif
    __Pyx_AddTraceback("View.MemoryView.slice_memviewslice", __pyx_clineno, __pyx_lineno, __pyx_filename);
    #ifdef WITH_THREAD
    PyGILState_Release(__pyx_gilstate_save);
    #endif
  }
  __pyx_r = -1;
  __pyx_L0:;
  return __pyx_r;
}

/* "View.MemoryView":867
 * 
 * @cname('__pyx_pybuffer_index')
 * cdef char *pybuffer_index(Py_buffer *view, char *bufp, Py_ssize_t index,             # <<<<<<<<<<<<<<
 *                           Py_ssize_t dim) except NULL:
 *     cdef Py_ssize_t shape, stride, suboffset = -1
 */

static char *__pyx_pybuffer_index(Py_buffer *__pyx_v_view, char *__pyx_v_bufp, Py_ssize_t __pyx_v_index, Py_ssize_t __pyx_v_dim) {
  Py_ssize_t __pyx_v_shape;
  Py_ssize_t __pyx_v_stride;
  Py_ssize_t __pyx_v_suboffset;
  Py_ssize_t __pyx_v_itemsize;
  char *__pyx_v_resultp;
  char *__pyx_r;
  __Pyx_RefNannyDeclarations
  Py_ssize_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("pybuffer_index", 0);

  /* "View.MemoryView":869
 * cdef char *pybuffer_index(Py_buffer *view, char *bufp, Py_ssize_t index,
 *                           Py_ssize_t dim) except NULL:
 *     cdef Py_ssize_t shape, stride, suboffset = -1             # <<<<<<<<<<<<<<
 *     cdef Py_ssize_t itemsize = view.itemsize
 *     cdef char *resultp
 */
  __pyx_v_suboffset = -1;

  /* "View.MemoryView":870
 *                           Py_ssize_t dim) except NULL:
 *     cdef Py_ssize_t shape, stride, suboffset = -1
 *     cdef Py_ssize_t itemsize = view.itemsize             # <<<<<<<<<<<<<<
 *     cdef char *resultp
 * 
 */
  __pyx_t_1 = __pyx_v_view->itemsize;
  __pyx_v_itemsize = __pyx_t_1;

  /* "View.MemoryView":873
 *     cdef char *resultp
 * 
 *     if view.ndim == 0:             # <<<<<<<<<<<<<<
 *         shape = view.len / itemsize
 *         stride = itemsize
 */
  __pyx_t_2 = ((__pyx_v_view->ndim == 0) != 0);
  if (__pyx_t_2) {

    /* "View.MemoryView":874
 * 
 *     if view.ndim == 0:
 *         shape = view.len / itemsize             # <<<<<<<<<<<<<<
 *         stride = itemsize
 *     else:
 */
    if (unlikely(__pyx_v_itemsize == 0)) {
      #ifdef WITH_THREAD
      PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
      #endif
      PyErr_SetString(PyExc_ZeroDivisionError, "integer division or modulo by zero");
      #ifdef WITH_THREAD
      PyGILState_Release(__pyx_gilstate_save);
      #endif
      {__pyx_filename = __pyx_f[7]; __pyx_lineno = 874; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    else if (sizeof(Py_ssize_t) == sizeof(long) && unlikely(__pyx_v_itemsize == -1)  && unlikely(UNARY_NEG_WOULD_OVERFLOW(__pyx_v_view->len))) {
      #ifdef WITH_THREAD
      PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
      #endif
      PyErr_SetString(PyExc_OverflowError, "value too large to perform division");
      #ifdef WITH_THREAD
      PyGILState_Release(__pyx_gilstate_save);
      #endif
      {__pyx_filename = __pyx_f[7]; __pyx_lineno = 874; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_v_shape = __Pyx_div_Py_ssize_t(__pyx_v_view->len, __pyx_v_itemsize);

    /* "View.MemoryView":875
 *     if view.ndim == 0:
 *         shape = view.len / itemsize
 *         stride = itemsize             # <<<<<<<<<<<<<<
 *     else:
 *         shape = view.shape[dim]
 */
    __pyx_v_stride = __pyx_v_itemsize;
    goto __pyx_L3;
  }
  /*else*/ {

    /* "View.MemoryView":877
 *         stride = itemsize
 *     else:
 *         shape = view.shape[dim]             # <<<<<<<<<<<<<<
 *         stride = view.strides[dim]
 *         if view.suboffsets != NULL:
 */
    __pyx_v_shape = (__pyx_v_view->shape[__pyx_v_dim]);

    /* "View.MemoryView":878
 *     else:
 *         shape = view.shape[dim]
 *         stride = view.strides[dim]             # <<<<<<<<<<<<<<
 *         if view.suboffsets != NULL:
 *             suboffset = view.suboffsets[dim]
 */
    __pyx_v_stride = (__pyx_v_view->strides[__pyx_v_dim]);

    /* "View.MemoryView":879
 *         shape = view.shape[dim]
 *         stride = view.strides[dim]
 *         if view.suboffsets != NULL:             # <<<<<<<<<<<<<<
 *             suboffset = view.suboffsets[dim]
 * 
 */
    __pyx_t_2 = ((__pyx_v_view->suboffsets != NULL) != 0);
    if (__pyx_t_2) {

      /* "View.MemoryView":880
 *         stride = view.strides[dim]
 *         if view.suboffsets != NULL:
 *             suboffset = view.suboffsets[dim]             # <<<<<<<<<<<<<<
 * 
 *     if index < 0:
 */
      __pyx_v_suboffset = (__pyx_v_view->suboffsets[__pyx_v_dim]);
      goto __pyx_L4;
    }
    __pyx_L4:;
  }
  __pyx_L3:;

  /* "View.MemoryView":882
 *             suboffset = view.suboffsets[dim]
 * 
 *     if index < 0:             # <<<<<<<<<<<<<<
 *         index += view.shape[dim]
 *         if index < 0:
 */
  __pyx_t_2 = ((__pyx_v_index < 0) != 0);
  if (__pyx_t_2) {

    /* "View.MemoryView":883
 * 
 *     if index < 0:
 *         index += view.shape[dim]             # <<<<<<<<<<<<<<
 *         if index < 0:
 *             raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
 */
    __pyx_v_index = (__pyx_v_index + (__pyx_v_view->shape[__pyx_v_dim]));

    /* "View.MemoryView":884
 *     if index < 0:
 *         index += view.shape[dim]
 *         if index < 0:             # <<<<<<<<<<<<<<
 *             raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
 * 
 */
    __pyx_t_2 = ((__pyx_v_index < 0) != 0);
    if (__pyx_t_2) {

      /* "View.MemoryView":885
 *         index += view.shape[dim]
 *         if index < 0:
 *             raise IndexError("Out of bounds on buffer access (axis %d)" % dim)             # <<<<<<<<<<<<<<
 * 
 *     if index >= shape:
 */
      __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_dim); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 885; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_Out_of_bounds_on_buffer_access_a, __pyx_t_3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 885; __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[7]; __pyx_lineno = 885; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__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 = __Pyx_PyObject_Call(__pyx_builtin_IndexError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 885; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__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[7]; __pyx_lineno = 885; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    goto __pyx_L5;
  }
  __pyx_L5:;

  /* "View.MemoryView":887
 *             raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
 * 
 *     if index >= shape:             # <<<<<<<<<<<<<<
 *         raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
 * 
 */
  __pyx_t_2 = ((__pyx_v_index >= __pyx_v_shape) != 0);
  if (__pyx_t_2) {

    /* "View.MemoryView":888
 * 
 *     if index >= shape:
 *         raise IndexError("Out of bounds on buffer access (axis %d)" % dim)             # <<<<<<<<<<<<<<
 * 
 *     resultp = bufp + index * stride
 */
    __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_dim); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 888; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_Out_of_bounds_on_buffer_access_a, __pyx_t_4); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 888; __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[7]; __pyx_lineno = 888; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__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 = __Pyx_PyObject_Call(__pyx_builtin_IndexError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 888; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__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[7]; __pyx_lineno = 888; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }

  /* "View.MemoryView":890
 *         raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
 * 
 *     resultp = bufp + index * stride             # <<<<<<<<<<<<<<
 *     if suboffset >= 0:
 *         resultp = (<char **> resultp)[0] + suboffset
 */
  __pyx_v_resultp = (__pyx_v_bufp + (__pyx_v_index * __pyx_v_stride));

  /* "View.MemoryView":891
 * 
 *     resultp = bufp + index * stride
 *     if suboffset >= 0:             # <<<<<<<<<<<<<<
 *         resultp = (<char **> resultp)[0] + suboffset
 * 
 */
  __pyx_t_2 = ((__pyx_v_suboffset >= 0) != 0);
  if (__pyx_t_2) {

    /* "View.MemoryView":892
 *     resultp = bufp + index * stride
 *     if suboffset >= 0:
 *         resultp = (<char **> resultp)[0] + suboffset             # <<<<<<<<<<<<<<
 * 
 *     return resultp
 */
    __pyx_v_resultp = ((((char **)__pyx_v_resultp)[0]) + __pyx_v_suboffset);
    goto __pyx_L8;
  }
  __pyx_L8:;

  /* "View.MemoryView":894
 *         resultp = (<char **> resultp)[0] + suboffset
 * 
 *     return resultp             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = __pyx_v_resultp;
  goto __pyx_L0;

  /* "View.MemoryView":867
 * 
 * @cname('__pyx_pybuffer_index')
 * cdef char *pybuffer_index(Py_buffer *view, char *bufp, Py_ssize_t index,             # <<<<<<<<<<<<<<
 *                           Py_ssize_t dim) except NULL:
 *     cdef Py_ssize_t shape, stride, suboffset = -1
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("View.MemoryView.pybuffer_index", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "View.MemoryView":900
 * 
 * @cname('__pyx_memslice_transpose')
 * cdef int transpose_memslice(__Pyx_memviewslice *memslice) nogil except 0:             # <<<<<<<<<<<<<<
 *     cdef int ndim = memslice.memview.view.ndim
 * 
 */

static int __pyx_memslice_transpose(__Pyx_memviewslice *__pyx_v_memslice) {
  int __pyx_v_ndim;
  Py_ssize_t *__pyx_v_shape;
  Py_ssize_t *__pyx_v_strides;
  int __pyx_v_i;
  int __pyx_v_j;
  int __pyx_r;
  int __pyx_t_1;
  Py_ssize_t *__pyx_t_2;
  long __pyx_t_3;
  Py_ssize_t __pyx_t_4;
  Py_ssize_t __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;

  /* "View.MemoryView":901
 * @cname('__pyx_memslice_transpose')
 * cdef int transpose_memslice(__Pyx_memviewslice *memslice) nogil except 0:
 *     cdef int ndim = memslice.memview.view.ndim             # <<<<<<<<<<<<<<
 * 
 *     cdef Py_ssize_t *shape = memslice.shape
 */
  __pyx_t_1 = __pyx_v_memslice->memview->view.ndim;
  __pyx_v_ndim = __pyx_t_1;

  /* "View.MemoryView":903
 *     cdef int ndim = memslice.memview.view.ndim
 * 
 *     cdef Py_ssize_t *shape = memslice.shape             # <<<<<<<<<<<<<<
 *     cdef Py_ssize_t *strides = memslice.strides
 * 
 */
  __pyx_t_2 = __pyx_v_memslice->shape;
  __pyx_v_shape = __pyx_t_2;

  /* "View.MemoryView":904
 * 
 *     cdef Py_ssize_t *shape = memslice.shape
 *     cdef Py_ssize_t *strides = memslice.strides             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_2 = __pyx_v_memslice->strides;
  __pyx_v_strides = __pyx_t_2;

  /* "View.MemoryView":908
 * 
 *     cdef int i, j
 *     for i in range(ndim / 2):             # <<<<<<<<<<<<<<
 *         j = ndim - 1 - i
 *         strides[i], strides[j] = strides[j], strides[i]
 */
  __pyx_t_3 = __Pyx_div_long(__pyx_v_ndim, 2);
  for (__pyx_t_1 = 0; __pyx_t_1 < __pyx_t_3; __pyx_t_1+=1) {
    __pyx_v_i = __pyx_t_1;

    /* "View.MemoryView":909
 *     cdef int i, j
 *     for i in range(ndim / 2):
 *         j = ndim - 1 - i             # <<<<<<<<<<<<<<
 *         strides[i], strides[j] = strides[j], strides[i]
 *         shape[i], shape[j] = shape[j], shape[i]
 */
    __pyx_v_j = ((__pyx_v_ndim - 1) - __pyx_v_i);

    /* "View.MemoryView":910
 *     for i in range(ndim / 2):
 *         j = ndim - 1 - i
 *         strides[i], strides[j] = strides[j], strides[i]             # <<<<<<<<<<<<<<
 *         shape[i], shape[j] = shape[j], shape[i]
 * 
 */
    __pyx_t_4 = (__pyx_v_strides[__pyx_v_j]);
    __pyx_t_5 = (__pyx_v_strides[__pyx_v_i]);
    (__pyx_v_strides[__pyx_v_i]) = __pyx_t_4;
    (__pyx_v_strides[__pyx_v_j]) = __pyx_t_5;

    /* "View.MemoryView":911
 *         j = ndim - 1 - i
 *         strides[i], strides[j] = strides[j], strides[i]
 *         shape[i], shape[j] = shape[j], shape[i]             # <<<<<<<<<<<<<<
 * 
 *         if memslice.suboffsets[i] >= 0 or memslice.suboffsets[j] >= 0:
 */
    __pyx_t_5 = (__pyx_v_shape[__pyx_v_j]);
    __pyx_t_4 = (__pyx_v_shape[__pyx_v_i]);
    (__pyx_v_shape[__pyx_v_i]) = __pyx_t_5;
    (__pyx_v_shape[__pyx_v_j]) = __pyx_t_4;

    /* "View.MemoryView":913
 *         shape[i], shape[j] = shape[j], shape[i]
 * 
 *         if memslice.suboffsets[i] >= 0 or memslice.suboffsets[j] >= 0:             # <<<<<<<<<<<<<<
 *             _err(ValueError, "Cannot transpose memoryview with indirect dimensions")
 * 
 */
    __pyx_t_6 = (((__pyx_v_memslice->suboffsets[__pyx_v_i]) >= 0) != 0);
    if (!__pyx_t_6) {
      __pyx_t_7 = (((__pyx_v_memslice->suboffsets[__pyx_v_j]) >= 0) != 0);
      __pyx_t_8 = __pyx_t_7;
    } else {
      __pyx_t_8 = __pyx_t_6;
    }
    if (__pyx_t_8) {

      /* "View.MemoryView":914
 * 
 *         if memslice.suboffsets[i] >= 0 or memslice.suboffsets[j] >= 0:
 *             _err(ValueError, "Cannot transpose memoryview with indirect dimensions")             # <<<<<<<<<<<<<<
 * 
 *     return 1
 */
      __pyx_t_9 = __pyx_memoryview_err(__pyx_builtin_ValueError, __pyx_k_Cannot_transpose_memoryview_with); if (unlikely(__pyx_t_9 == -1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 914; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      goto __pyx_L5;
    }
    __pyx_L5:;
  }

  /* "View.MemoryView":916
 *             _err(ValueError, "Cannot transpose memoryview with indirect dimensions")
 * 
 *     return 1             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = 1;
  goto __pyx_L0;

  /* "View.MemoryView":900
 * 
 * @cname('__pyx_memslice_transpose')
 * cdef int transpose_memslice(__Pyx_memviewslice *memslice) nogil except 0:             # <<<<<<<<<<<<<<
 *     cdef int ndim = memslice.memview.view.ndim
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  {
    #ifdef WITH_THREAD
    PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
    #endif
    __Pyx_AddTraceback("View.MemoryView.transpose_memslice", __pyx_clineno, __pyx_lineno, __pyx_filename);
    #ifdef WITH_THREAD
    PyGILState_Release(__pyx_gilstate_save);
    #endif
  }
  __pyx_r = 0;
  __pyx_L0:;
  return __pyx_r;
}

/* "View.MemoryView":933
 *     cdef int (*to_dtype_func)(char *, object) except 0
 * 
 *     def __dealloc__(self):             # <<<<<<<<<<<<<<
 *         __PYX_XDEC_MEMVIEW(&self.from_slice, 1)
 * 
 */

/* Python wrapper */
static void __pyx_memoryviewslice___dealloc__(PyObject *__pyx_v_self); /*proto*/
static void __pyx_memoryviewslice___dealloc__(PyObject *__pyx_v_self) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
  __pyx_memoryviewslice_MemoryView_16_memoryviewslice___dealloc__(((struct __pyx_memoryviewslice_obj *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
}

static void __pyx_memoryviewslice_MemoryView_16_memoryviewslice___dealloc__(struct __pyx_memoryviewslice_obj *__pyx_v_self) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__dealloc__", 0);

  /* "View.MemoryView":934
 * 
 *     def __dealloc__(self):
 *         __PYX_XDEC_MEMVIEW(&self.from_slice, 1)             # <<<<<<<<<<<<<<
 * 
 *     cdef convert_item_to_object(self, char *itemp):
 */
  __PYX_XDEC_MEMVIEW((&__pyx_v_self->from_slice), 1);

  /* "View.MemoryView":933
 *     cdef int (*to_dtype_func)(char *, object) except 0
 * 
 *     def __dealloc__(self):             # <<<<<<<<<<<<<<
 *         __PYX_XDEC_MEMVIEW(&self.from_slice, 1)
 * 
 */

  /* function exit code */
  __Pyx_RefNannyFinishContext();
}

/* "View.MemoryView":936
 *         __PYX_XDEC_MEMVIEW(&self.from_slice, 1)
 * 
 *     cdef convert_item_to_object(self, char *itemp):             # <<<<<<<<<<<<<<
 *         if self.to_object_func != NULL:
 *             return self.to_object_func(itemp)
 */

static PyObject *__pyx_memoryviewslice_convert_item_to_object(struct __pyx_memoryviewslice_obj *__pyx_v_self, char *__pyx_v_itemp) {
  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("convert_item_to_object", 0);

  /* "View.MemoryView":937
 * 
 *     cdef convert_item_to_object(self, char *itemp):
 *         if self.to_object_func != NULL:             # <<<<<<<<<<<<<<
 *             return self.to_object_func(itemp)
 *         else:
 */
  __pyx_t_1 = ((__pyx_v_self->to_object_func != NULL) != 0);
  if (__pyx_t_1) {

    /* "View.MemoryView":938
 *     cdef convert_item_to_object(self, char *itemp):
 *         if self.to_object_func != NULL:
 *             return self.to_object_func(itemp)             # <<<<<<<<<<<<<<
 *         else:
 *             return memoryview.convert_item_to_object(self, itemp)
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = __pyx_v_self->to_object_func(__pyx_v_itemp); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 938; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L0;
  }
  /*else*/ {

    /* "View.MemoryView":940
 *             return self.to_object_func(itemp)
 *         else:
 *             return memoryview.convert_item_to_object(self, itemp)             # <<<<<<<<<<<<<<
 * 
 *     cdef assign_item_from_object(self, char *itemp, object value):
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = __pyx_vtabptr_memoryview->convert_item_to_object(((struct __pyx_memoryview_obj *)__pyx_v_self), __pyx_v_itemp); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 940; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L0;
  }

  /* "View.MemoryView":936
 *         __PYX_XDEC_MEMVIEW(&self.from_slice, 1)
 * 
 *     cdef convert_item_to_object(self, char *itemp):             # <<<<<<<<<<<<<<
 *         if self.to_object_func != NULL:
 *             return self.to_object_func(itemp)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("View.MemoryView._memoryviewslice.convert_item_to_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "View.MemoryView":942
 *             return memoryview.convert_item_to_object(self, itemp)
 * 
 *     cdef assign_item_from_object(self, char *itemp, object value):             # <<<<<<<<<<<<<<
 *         if self.to_dtype_func != NULL:
 *             self.to_dtype_func(itemp, value)
 */

static PyObject *__pyx_memoryviewslice_assign_item_from_object(struct __pyx_memoryviewslice_obj *__pyx_v_self, char *__pyx_v_itemp, PyObject *__pyx_v_value) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("assign_item_from_object", 0);

  /* "View.MemoryView":943
 * 
 *     cdef assign_item_from_object(self, char *itemp, object value):
 *         if self.to_dtype_func != NULL:             # <<<<<<<<<<<<<<
 *             self.to_dtype_func(itemp, value)
 *         else:
 */
  __pyx_t_1 = ((__pyx_v_self->to_dtype_func != NULL) != 0);
  if (__pyx_t_1) {

    /* "View.MemoryView":944
 *     cdef assign_item_from_object(self, char *itemp, object value):
 *         if self.to_dtype_func != NULL:
 *             self.to_dtype_func(itemp, value)             # <<<<<<<<<<<<<<
 *         else:
 *             memoryview.assign_item_from_object(self, itemp, value)
 */
    __pyx_t_2 = __pyx_v_self->to_dtype_func(__pyx_v_itemp, __pyx_v_value); if (unlikely(__pyx_t_2 == 0)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 944; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L3;
  }
  /*else*/ {

    /* "View.MemoryView":946
 *             self.to_dtype_func(itemp, value)
 *         else:
 *             memoryview.assign_item_from_object(self, itemp, value)             # <<<<<<<<<<<<<<
 * 
 *     property base:
 */
    __pyx_t_3 = __pyx_vtabptr_memoryview->assign_item_from_object(((struct __pyx_memoryview_obj *)__pyx_v_self), __pyx_v_itemp, __pyx_v_value); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 946; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  }
  __pyx_L3:;

  /* "View.MemoryView":942
 *             return memoryview.convert_item_to_object(self, itemp)
 * 
 *     cdef assign_item_from_object(self, char *itemp, object value):             # <<<<<<<<<<<<<<
 *         if self.to_dtype_func != NULL:
 *             self.to_dtype_func(itemp, value)
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("View.MemoryView._memoryviewslice.assign_item_from_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "View.MemoryView":950
 *     property base:
 *         @cname('__pyx_memoryviewslice__get__base')
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             return self.from_object
 * 
 */

/* Python wrapper */
static PyObject *__pyx_memoryviewslice__get__base(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_memoryviewslice__get__base(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_memoryviewslice__get__base_MemoryView_16_memoryviewslice_4base___get__(((struct __pyx_memoryviewslice_obj *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_memoryviewslice__get__base_MemoryView_16_memoryviewslice_4base___get__(struct __pyx_memoryviewslice_obj *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "View.MemoryView":951
 *         @cname('__pyx_memoryviewslice__get__base')
 *         def __get__(self):
 *             return self.from_object             # <<<<<<<<<<<<<<
 * 
 *     __pyx_getbuffer = capsule(<void *> &__pyx_memoryview_getbuffer, "getbuffer(obj, view, flags)")
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->from_object);
  __pyx_r = __pyx_v_self->from_object;
  goto __pyx_L0;

  /* "View.MemoryView":950
 *     property base:
 *         @cname('__pyx_memoryviewslice__get__base')
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             return self.from_object
 * 
 */

  /* function exit code */
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "View.MemoryView":957
 * 
 * @cname('__pyx_memoryview_fromslice')
 * cdef memoryview_fromslice(__Pyx_memviewslice memviewslice,             # <<<<<<<<<<<<<<
 *                           int ndim,
 *                           object (*to_object_func)(char *),
 */

static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewslice, int __pyx_v_ndim, PyObject *(*__pyx_v_to_object_func)(char *), int (*__pyx_v_to_dtype_func)(char *, PyObject *), int __pyx_v_dtype_is_object) {
  struct __pyx_memoryviewslice_obj *__pyx_v_result = 0;
  int __pyx_v_i;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_TypeInfo *__pyx_t_4;
  Py_buffer __pyx_t_5;
  Py_ssize_t __pyx_t_6;
  int __pyx_t_7;
  int __pyx_t_8;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("memoryview_fromslice", 0);

  /* "View.MemoryView":966
 *     cdef int i
 * 
 *     if <PyObject *> memviewslice.memview == Py_None:             # <<<<<<<<<<<<<<
 *         return None
 * 
 */
  __pyx_t_1 = ((((PyObject *)__pyx_v_memviewslice.memview) == Py_None) != 0);
  if (__pyx_t_1) {

    /* "View.MemoryView":967
 * 
 *     if <PyObject *> memviewslice.memview == Py_None:
 *         return None             # <<<<<<<<<<<<<<
 * 
 * 
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(Py_None);
    __pyx_r = Py_None;
    goto __pyx_L0;
  }

  /* "View.MemoryView":972
 * 
 * 
 *     result = _memoryviewslice(None, 0, dtype_is_object)             # <<<<<<<<<<<<<<
 * 
 *     result.from_slice = memviewslice
 */
  __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_dtype_is_object); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 972; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 972; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_INCREF(Py_None);
  PyTuple_SET_ITEM(__pyx_t_3, 0, Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_INCREF(__pyx_int_0);
  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_int_0);
  __Pyx_GIVEREF(__pyx_int_0);
  PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)((PyObject *)__pyx_memoryviewslice_type)), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 972; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_v_result = ((struct __pyx_memoryviewslice_obj *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "View.MemoryView":974
 *     result = _memoryviewslice(None, 0, dtype_is_object)
 * 
 *     result.from_slice = memviewslice             # <<<<<<<<<<<<<<
 *     __PYX_INC_MEMVIEW(&memviewslice, 1)
 * 
 */
  __pyx_v_result->from_slice = __pyx_v_memviewslice;

  /* "View.MemoryView":975
 * 
 *     result.from_slice = memviewslice
 *     __PYX_INC_MEMVIEW(&memviewslice, 1)             # <<<<<<<<<<<<<<
 * 
 *     result.from_object = (<memoryview> memviewslice.memview).base
 */
  __PYX_INC_MEMVIEW((&__pyx_v_memviewslice), 1);

  /* "View.MemoryView":977
 *     __PYX_INC_MEMVIEW(&memviewslice, 1)
 * 
 *     result.from_object = (<memoryview> memviewslice.memview).base             # <<<<<<<<<<<<<<
 *     result.typeinfo = memviewslice.memview.typeinfo
 * 
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_memviewslice.memview), __pyx_n_s_base); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 977; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  __Pyx_GOTREF(__pyx_v_result->from_object);
  __Pyx_DECREF(__pyx_v_result->from_object);
  __pyx_v_result->from_object = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "View.MemoryView":978
 * 
 *     result.from_object = (<memoryview> memviewslice.memview).base
 *     result.typeinfo = memviewslice.memview.typeinfo             # <<<<<<<<<<<<<<
 * 
 *     result.view = memviewslice.memview.view
 */
  __pyx_t_4 = __pyx_v_memviewslice.memview->typeinfo;
  __pyx_v_result->__pyx_base.typeinfo = __pyx_t_4;

  /* "View.MemoryView":980
 *     result.typeinfo = memviewslice.memview.typeinfo
 * 
 *     result.view = memviewslice.memview.view             # <<<<<<<<<<<<<<
 *     result.view.buf = <void *> memviewslice.data
 *     result.view.ndim = ndim
 */
  __pyx_t_5 = __pyx_v_memviewslice.memview->view;
  __pyx_v_result->__pyx_base.view = __pyx_t_5;

  /* "View.MemoryView":981
 * 
 *     result.view = memviewslice.memview.view
 *     result.view.buf = <void *> memviewslice.data             # <<<<<<<<<<<<<<
 *     result.view.ndim = ndim
 *     (<__pyx_buffer *> &result.view).obj = Py_None
 */
  __pyx_v_result->__pyx_base.view.buf = ((void *)__pyx_v_memviewslice.data);

  /* "View.MemoryView":982
 *     result.view = memviewslice.memview.view
 *     result.view.buf = <void *> memviewslice.data
 *     result.view.ndim = ndim             # <<<<<<<<<<<<<<
 *     (<__pyx_buffer *> &result.view).obj = Py_None
 *     Py_INCREF(Py_None)
 */
  __pyx_v_result->__pyx_base.view.ndim = __pyx_v_ndim;

  /* "View.MemoryView":983
 *     result.view.buf = <void *> memviewslice.data
 *     result.view.ndim = ndim
 *     (<__pyx_buffer *> &result.view).obj = Py_None             # <<<<<<<<<<<<<<
 *     Py_INCREF(Py_None)
 * 
 */
  ((Py_buffer *)(&__pyx_v_result->__pyx_base.view))->obj = Py_None;

  /* "View.MemoryView":984
 *     result.view.ndim = ndim
 *     (<__pyx_buffer *> &result.view).obj = Py_None
 *     Py_INCREF(Py_None)             # <<<<<<<<<<<<<<
 * 
 *     result.flags = PyBUF_RECORDS
 */
  Py_INCREF(Py_None);

  /* "View.MemoryView":986
 *     Py_INCREF(Py_None)
 * 
 *     result.flags = PyBUF_RECORDS             # <<<<<<<<<<<<<<
 * 
 *     result.view.shape = <Py_ssize_t *> result.from_slice.shape
 */
  __pyx_v_result->__pyx_base.flags = PyBUF_RECORDS;

  /* "View.MemoryView":988
 *     result.flags = PyBUF_RECORDS
 * 
 *     result.view.shape = <Py_ssize_t *> result.from_slice.shape             # <<<<<<<<<<<<<<
 *     result.view.strides = <Py_ssize_t *> result.from_slice.strides
 *     result.view.suboffsets = <Py_ssize_t *> result.from_slice.suboffsets
 */
  __pyx_v_result->__pyx_base.view.shape = ((Py_ssize_t *)__pyx_v_result->from_slice.shape);

  /* "View.MemoryView":989
 * 
 *     result.view.shape = <Py_ssize_t *> result.from_slice.shape
 *     result.view.strides = <Py_ssize_t *> result.from_slice.strides             # <<<<<<<<<<<<<<
 *     result.view.suboffsets = <Py_ssize_t *> result.from_slice.suboffsets
 * 
 */
  __pyx_v_result->__pyx_base.view.strides = ((Py_ssize_t *)__pyx_v_result->from_slice.strides);

  /* "View.MemoryView":990
 *     result.view.shape = <Py_ssize_t *> result.from_slice.shape
 *     result.view.strides = <Py_ssize_t *> result.from_slice.strides
 *     result.view.suboffsets = <Py_ssize_t *> result.from_slice.suboffsets             # <<<<<<<<<<<<<<
 * 
 *     result.view.len = result.view.itemsize
 */
  __pyx_v_result->__pyx_base.view.suboffsets = ((Py_ssize_t *)__pyx_v_result->from_slice.suboffsets);

  /* "View.MemoryView":992
 *     result.view.suboffsets = <Py_ssize_t *> result.from_slice.suboffsets
 * 
 *     result.view.len = result.view.itemsize             # <<<<<<<<<<<<<<
 *     for i in range(ndim):
 *         result.view.len *= result.view.shape[i]
 */
  __pyx_t_6 = __pyx_v_result->__pyx_base.view.itemsize;
  __pyx_v_result->__pyx_base.view.len = __pyx_t_6;

  /* "View.MemoryView":993
 * 
 *     result.view.len = result.view.itemsize
 *     for i in range(ndim):             # <<<<<<<<<<<<<<
 *         result.view.len *= result.view.shape[i]
 * 
 */
  __pyx_t_7 = __pyx_v_ndim;
  for (__pyx_t_8 = 0; __pyx_t_8 < __pyx_t_7; __pyx_t_8+=1) {
    __pyx_v_i = __pyx_t_8;

    /* "View.MemoryView":994
 *     result.view.len = result.view.itemsize
 *     for i in range(ndim):
 *         result.view.len *= result.view.shape[i]             # <<<<<<<<<<<<<<
 * 
 *     result.to_object_func = to_object_func
 */
    __pyx_v_result->__pyx_base.view.len = (__pyx_v_result->__pyx_base.view.len * (__pyx_v_result->__pyx_base.view.shape[__pyx_v_i]));
  }

  /* "View.MemoryView":996
 *         result.view.len *= result.view.shape[i]
 * 
 *     result.to_object_func = to_object_func             # <<<<<<<<<<<<<<
 *     result.to_dtype_func = to_dtype_func
 * 
 */
  __pyx_v_result->to_object_func = __pyx_v_to_object_func;

  /* "View.MemoryView":997
 * 
 *     result.to_object_func = to_object_func
 *     result.to_dtype_func = to_dtype_func             # <<<<<<<<<<<<<<
 * 
 *     return result
 */
  __pyx_v_result->to_dtype_func = __pyx_v_to_dtype_func;

  /* "View.MemoryView":999
 *     result.to_dtype_func = to_dtype_func
 * 
 *     return result             # <<<<<<<<<<<<<<
 * 
 * @cname('__pyx_memoryview_get_slice_from_memoryview')
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_result));
  __pyx_r = ((PyObject *)__pyx_v_result);
  goto __pyx_L0;

  /* "View.MemoryView":957
 * 
 * @cname('__pyx_memoryview_fromslice')
 * cdef memoryview_fromslice(__Pyx_memviewslice memviewslice,             # <<<<<<<<<<<<<<
 *                           int ndim,
 *                           object (*to_object_func)(char *),
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("View.MemoryView.memoryview_fromslice", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_result);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "View.MemoryView":1002
 * 
 * @cname('__pyx_memoryview_get_slice_from_memoryview')
 * cdef __Pyx_memviewslice *get_slice_from_memview(memoryview memview,             # <<<<<<<<<<<<<<
 *                                                    __Pyx_memviewslice *mslice):
 *     cdef _memoryviewslice obj
 */

static __Pyx_memviewslice *__pyx_memoryview_get_slice_from_memoryview(struct __pyx_memoryview_obj *__pyx_v_memview, __Pyx_memviewslice *__pyx_v_mslice) {
  struct __pyx_memoryviewslice_obj *__pyx_v_obj = 0;
  __Pyx_memviewslice *__pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  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_slice_from_memview", 0);

  /* "View.MemoryView":1005
 *                                                    __Pyx_memviewslice *mslice):
 *     cdef _memoryviewslice obj
 *     if isinstance(memview, _memoryviewslice):             # <<<<<<<<<<<<<<
 *         obj = memview
 *         return &obj.from_slice
 */
  __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), ((PyObject *)__pyx_memoryviewslice_type)); 
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (__pyx_t_2) {

    /* "View.MemoryView":1006
 *     cdef _memoryviewslice obj
 *     if isinstance(memview, _memoryviewslice):
 *         obj = memview             # <<<<<<<<<<<<<<
 *         return &obj.from_slice
 *     else:
 */
    if (!(likely(((((PyObject *)__pyx_v_memview)) == Py_None) || likely(__Pyx_TypeTest(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type))))) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 1006; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_3 = ((PyObject *)__pyx_v_memview);
    __Pyx_INCREF(__pyx_t_3);
    __pyx_v_obj = ((struct __pyx_memoryviewslice_obj *)__pyx_t_3);
    __pyx_t_3 = 0;

    /* "View.MemoryView":1007
 *     if isinstance(memview, _memoryviewslice):
 *         obj = memview
 *         return &obj.from_slice             # <<<<<<<<<<<<<<
 *     else:
 *         slice_copy(memview, mslice)
 */
    __pyx_r = (&__pyx_v_obj->from_slice);
    goto __pyx_L0;
  }
  /*else*/ {

    /* "View.MemoryView":1009
 *         return &obj.from_slice
 *     else:
 *         slice_copy(memview, mslice)             # <<<<<<<<<<<<<<
 *         return mslice
 * 
 */
    __pyx_memoryview_slice_copy(__pyx_v_memview, __pyx_v_mslice);

    /* "View.MemoryView":1010
 *     else:
 *         slice_copy(memview, mslice)
 *         return mslice             # <<<<<<<<<<<<<<
 * 
 * @cname('__pyx_memoryview_slice_copy')
 */
    __pyx_r = __pyx_v_mslice;
    goto __pyx_L0;
  }

  /* "View.MemoryView":1002
 * 
 * @cname('__pyx_memoryview_get_slice_from_memoryview')
 * cdef __Pyx_memviewslice *get_slice_from_memview(memoryview memview,             # <<<<<<<<<<<<<<
 *                                                    __Pyx_memviewslice *mslice):
 *     cdef _memoryviewslice obj
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_WriteUnraisable("View.MemoryView.get_slice_from_memview", __pyx_clineno, __pyx_lineno, __pyx_filename, 0);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_obj);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "View.MemoryView":1013
 * 
 * @cname('__pyx_memoryview_slice_copy')
 * cdef void slice_copy(memoryview memview, __Pyx_memviewslice *dst):             # <<<<<<<<<<<<<<
 *     cdef int dim
 *     cdef (Py_ssize_t*) shape, strides, suboffsets
 */

static void __pyx_memoryview_slice_copy(struct __pyx_memoryview_obj *__pyx_v_memview, __Pyx_memviewslice *__pyx_v_dst) {
  int __pyx_v_dim;
  Py_ssize_t *__pyx_v_shape;
  Py_ssize_t *__pyx_v_strides;
  Py_ssize_t *__pyx_v_suboffsets;
  __Pyx_RefNannyDeclarations
  Py_ssize_t *__pyx_t_1;
  int __pyx_t_2;
  int __pyx_t_3;
  int __pyx_t_4;
  __Pyx_RefNannySetupContext("slice_copy", 0);

  /* "View.MemoryView":1017
 *     cdef (Py_ssize_t*) shape, strides, suboffsets
 * 
 *     shape = memview.view.shape             # <<<<<<<<<<<<<<
 *     strides = memview.view.strides
 *     suboffsets = memview.view.suboffsets
 */
  __pyx_t_1 = __pyx_v_memview->view.shape;
  __pyx_v_shape = __pyx_t_1;

  /* "View.MemoryView":1018
 * 
 *     shape = memview.view.shape
 *     strides = memview.view.strides             # <<<<<<<<<<<<<<
 *     suboffsets = memview.view.suboffsets
 * 
 */
  __pyx_t_1 = __pyx_v_memview->view.strides;
  __pyx_v_strides = __pyx_t_1;

  /* "View.MemoryView":1019
 *     shape = memview.view.shape
 *     strides = memview.view.strides
 *     suboffsets = memview.view.suboffsets             # <<<<<<<<<<<<<<
 * 
 *     dst.memview = <__pyx_memoryview *> memview
 */
  __pyx_t_1 = __pyx_v_memview->view.suboffsets;
  __pyx_v_suboffsets = __pyx_t_1;

  /* "View.MemoryView":1021
 *     suboffsets = memview.view.suboffsets
 * 
 *     dst.memview = <__pyx_memoryview *> memview             # <<<<<<<<<<<<<<
 *     dst.data = <char *> memview.view.buf
 * 
 */
  __pyx_v_dst->memview = ((struct __pyx_memoryview_obj *)__pyx_v_memview);

  /* "View.MemoryView":1022
 * 
 *     dst.memview = <__pyx_memoryview *> memview
 *     dst.data = <char *> memview.view.buf             # <<<<<<<<<<<<<<
 * 
 *     for dim in range(memview.view.ndim):
 */
  __pyx_v_dst->data = ((char *)__pyx_v_memview->view.buf);

  /* "View.MemoryView":1024
 *     dst.data = <char *> memview.view.buf
 * 
 *     for dim in range(memview.view.ndim):             # <<<<<<<<<<<<<<
 *         dst.shape[dim] = shape[dim]
 *         dst.strides[dim] = strides[dim]
 */
  __pyx_t_2 = __pyx_v_memview->view.ndim;
  for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
    __pyx_v_dim = __pyx_t_3;

    /* "View.MemoryView":1025
 * 
 *     for dim in range(memview.view.ndim):
 *         dst.shape[dim] = shape[dim]             # <<<<<<<<<<<<<<
 *         dst.strides[dim] = strides[dim]
 *         if suboffsets == NULL:
 */
    (__pyx_v_dst->shape[__pyx_v_dim]) = (__pyx_v_shape[__pyx_v_dim]);

    /* "View.MemoryView":1026
 *     for dim in range(memview.view.ndim):
 *         dst.shape[dim] = shape[dim]
 *         dst.strides[dim] = strides[dim]             # <<<<<<<<<<<<<<
 *         if suboffsets == NULL:
 *             dst.suboffsets[dim] = -1
 */
    (__pyx_v_dst->strides[__pyx_v_dim]) = (__pyx_v_strides[__pyx_v_dim]);

    /* "View.MemoryView":1027
 *         dst.shape[dim] = shape[dim]
 *         dst.strides[dim] = strides[dim]
 *         if suboffsets == NULL:             # <<<<<<<<<<<<<<
 *             dst.suboffsets[dim] = -1
 *         else:
 */
    __pyx_t_4 = ((__pyx_v_suboffsets == NULL) != 0);
    if (__pyx_t_4) {

      /* "View.MemoryView":1028
 *         dst.strides[dim] = strides[dim]
 *         if suboffsets == NULL:
 *             dst.suboffsets[dim] = -1             # <<<<<<<<<<<<<<
 *         else:
 *             dst.suboffsets[dim] = suboffsets[dim]
 */
      (__pyx_v_dst->suboffsets[__pyx_v_dim]) = -1;
      goto __pyx_L5;
    }
    /*else*/ {

      /* "View.MemoryView":1030
 *             dst.suboffsets[dim] = -1
 *         else:
 *             dst.suboffsets[dim] = suboffsets[dim]             # <<<<<<<<<<<<<<
 * 
 * @cname('__pyx_memoryview_copy_object')
 */
      (__pyx_v_dst->suboffsets[__pyx_v_dim]) = (__pyx_v_suboffsets[__pyx_v_dim]);
    }
    __pyx_L5:;
  }

  /* "View.MemoryView":1013
 * 
 * @cname('__pyx_memoryview_slice_copy')
 * cdef void slice_copy(memoryview memview, __Pyx_memviewslice *dst):             # <<<<<<<<<<<<<<
 *     cdef int dim
 *     cdef (Py_ssize_t*) shape, strides, suboffsets
 */

  /* function exit code */
  __Pyx_RefNannyFinishContext();
}

/* "View.MemoryView":1033
 * 
 * @cname('__pyx_memoryview_copy_object')
 * cdef memoryview_copy(memoryview memview):             # <<<<<<<<<<<<<<
 *     "Create a new memoryview object"
 *     cdef __Pyx_memviewslice memviewslice
 */

static PyObject *__pyx_memoryview_copy_object(struct __pyx_memoryview_obj *__pyx_v_memview) {
  __Pyx_memviewslice __pyx_v_memviewslice;
  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("memoryview_copy", 0);

  /* "View.MemoryView":1036
 *     "Create a new memoryview object"
 *     cdef __Pyx_memviewslice memviewslice
 *     slice_copy(memview, &memviewslice)             # <<<<<<<<<<<<<<
 *     return memoryview_copy_from_slice(memview, &memviewslice)
 * 
 */
  __pyx_memoryview_slice_copy(__pyx_v_memview, (&__pyx_v_memviewslice));

  /* "View.MemoryView":1037
 *     cdef __Pyx_memviewslice memviewslice
 *     slice_copy(memview, &memviewslice)
 *     return memoryview_copy_from_slice(memview, &memviewslice)             # <<<<<<<<<<<<<<
 * 
 * @cname('__pyx_memoryview_copy_object_from_slice')
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_memoryview_copy_object_from_slice(__pyx_v_memview, (&__pyx_v_memviewslice)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 1037; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "View.MemoryView":1033
 * 
 * @cname('__pyx_memoryview_copy_object')
 * cdef memoryview_copy(memoryview memview):             # <<<<<<<<<<<<<<
 *     "Create a new memoryview object"
 *     cdef __Pyx_memviewslice memviewslice
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("View.MemoryView.memoryview_copy", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "View.MemoryView":1040
 * 
 * @cname('__pyx_memoryview_copy_object_from_slice')
 * cdef memoryview_copy_from_slice(memoryview memview, __Pyx_memviewslice *memviewslice):             # <<<<<<<<<<<<<<
 *     """
 *     Create a new memoryview object from a given memoryview object and slice.
 */

static PyObject *__pyx_memoryview_copy_object_from_slice(struct __pyx_memoryview_obj *__pyx_v_memview, __Pyx_memviewslice *__pyx_v_memviewslice) {
  PyObject *(*__pyx_v_to_object_func)(char *);
  int (*__pyx_v_to_dtype_func)(char *, PyObject *);
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *(*__pyx_t_3)(char *);
  int (*__pyx_t_4)(char *, PyObject *);
  PyObject *__pyx_t_5 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("memoryview_copy_from_slice", 0);

  /* "View.MemoryView":1047
 *     cdef int (*to_dtype_func)(char *, object) except 0
 * 
 *     if isinstance(memview, _memoryviewslice):             # <<<<<<<<<<<<<<
 *         to_object_func = (<_memoryviewslice> memview).to_object_func
 *         to_dtype_func = (<_memoryviewslice> memview).to_dtype_func
 */
  __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), ((PyObject *)__pyx_memoryviewslice_type)); 
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (__pyx_t_2) {

    /* "View.MemoryView":1048
 * 
 *     if isinstance(memview, _memoryviewslice):
 *         to_object_func = (<_memoryviewslice> memview).to_object_func             # <<<<<<<<<<<<<<
 *         to_dtype_func = (<_memoryviewslice> memview).to_dtype_func
 *     else:
 */
    __pyx_t_3 = ((struct __pyx_memoryviewslice_obj *)__pyx_v_memview)->to_object_func;
    __pyx_v_to_object_func = __pyx_t_3;

    /* "View.MemoryView":1049
 *     if isinstance(memview, _memoryviewslice):
 *         to_object_func = (<_memoryviewslice> memview).to_object_func
 *         to_dtype_func = (<_memoryviewslice> memview).to_dtype_func             # <<<<<<<<<<<<<<
 *     else:
 *         to_object_func = NULL
 */
    __pyx_t_4 = ((struct __pyx_memoryviewslice_obj *)__pyx_v_memview)->to_dtype_func;
    __pyx_v_to_dtype_func = __pyx_t_4;
    goto __pyx_L3;
  }
  /*else*/ {

    /* "View.MemoryView":1051
 *         to_dtype_func = (<_memoryviewslice> memview).to_dtype_func
 *     else:
 *         to_object_func = NULL             # <<<<<<<<<<<<<<
 *         to_dtype_func = NULL
 * 
 */
    __pyx_v_to_object_func = NULL;

    /* "View.MemoryView":1052
 *     else:
 *         to_object_func = NULL
 *         to_dtype_func = NULL             # <<<<<<<<<<<<<<
 * 
 *     return memoryview_fromslice(memviewslice[0], memview.view.ndim,
 */
    __pyx_v_to_dtype_func = NULL;
  }
  __pyx_L3:;

  /* "View.MemoryView":1054
 *         to_dtype_func = NULL
 * 
 *     return memoryview_fromslice(memviewslice[0], memview.view.ndim,             # <<<<<<<<<<<<<<
 *                                 to_object_func, to_dtype_func,
 *                                 memview.dtype_is_object)
 */
  __Pyx_XDECREF(__pyx_r);

  /* "View.MemoryView":1056
 *     return memoryview_fromslice(memviewslice[0], memview.view.ndim,
 *                                 to_object_func, to_dtype_func,
 *                                 memview.dtype_is_object)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_5 = __pyx_memoryview_fromslice((__pyx_v_memviewslice[0]), __pyx_v_memview->view.ndim, __pyx_v_to_object_func, __pyx_v_to_dtype_func, __pyx_v_memview->dtype_is_object); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 1054; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_r = __pyx_t_5;
  __pyx_t_5 = 0;
  goto __pyx_L0;

  /* "View.MemoryView":1040
 * 
 * @cname('__pyx_memoryview_copy_object_from_slice')
 * cdef memoryview_copy_from_slice(memoryview memview, __Pyx_memviewslice *memviewslice):             # <<<<<<<<<<<<<<
 *     """
 *     Create a new memoryview object from a given memoryview object and slice.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("View.MemoryView.memoryview_copy_from_slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "View.MemoryView":1062
 * 
 * 
 * cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) nogil:             # <<<<<<<<<<<<<<
 *     if arg < 0:
 *         return -arg
 */

static Py_ssize_t abs_py_ssize_t(Py_ssize_t __pyx_v_arg) {
  Py_ssize_t __pyx_r;
  int __pyx_t_1;

  /* "View.MemoryView":1063
 * 
 * cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) nogil:
 *     if arg < 0:             # <<<<<<<<<<<<<<
 *         return -arg
 *     else:
 */
  __pyx_t_1 = ((__pyx_v_arg < 0) != 0);
  if (__pyx_t_1) {

    /* "View.MemoryView":1064
 * cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) nogil:
 *     if arg < 0:
 *         return -arg             # <<<<<<<<<<<<<<
 *     else:
 *         return arg
 */
    __pyx_r = (-__pyx_v_arg);
    goto __pyx_L0;
  }
  /*else*/ {

    /* "View.MemoryView":1066
 *         return -arg
 *     else:
 *         return arg             # <<<<<<<<<<<<<<
 * 
 * @cname('__pyx_get_best_slice_order')
 */
    __pyx_r = __pyx_v_arg;
    goto __pyx_L0;
  }

  /* "View.MemoryView":1062
 * 
 * 
 * cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) nogil:             # <<<<<<<<<<<<<<
 *     if arg < 0:
 *         return -arg
 */

  /* function exit code */
  __pyx_L0:;
  return __pyx_r;
}

/* "View.MemoryView":1069
 * 
 * @cname('__pyx_get_best_slice_order')
 * cdef char get_best_order(__Pyx_memviewslice *mslice, int ndim) nogil:             # <<<<<<<<<<<<<<
 *     """
 *     Figure out the best memory access order for a given slice.
 */

static char __pyx_get_best_slice_order(__Pyx_memviewslice *__pyx_v_mslice, int __pyx_v_ndim) {
  int __pyx_v_i;
  Py_ssize_t __pyx_v_c_stride;
  Py_ssize_t __pyx_v_f_stride;
  char __pyx_r;
  int __pyx_t_1;
  int __pyx_t_2;
  int __pyx_t_3;

  /* "View.MemoryView":1074
 *     """
 *     cdef int i
 *     cdef Py_ssize_t c_stride = 0             # <<<<<<<<<<<<<<
 *     cdef Py_ssize_t f_stride = 0
 * 
 */
  __pyx_v_c_stride = 0;

  /* "View.MemoryView":1075
 *     cdef int i
 *     cdef Py_ssize_t c_stride = 0
 *     cdef Py_ssize_t f_stride = 0             # <<<<<<<<<<<<<<
 * 
 *     for i in range(ndim - 1, -1, -1):
 */
  __pyx_v_f_stride = 0;

  /* "View.MemoryView":1077
 *     cdef Py_ssize_t f_stride = 0
 * 
 *     for i in range(ndim - 1, -1, -1):             # <<<<<<<<<<<<<<
 *         if mslice.shape[i] > 1:
 *             c_stride = mslice.strides[i]
 */
  for (__pyx_t_1 = (__pyx_v_ndim - 1); __pyx_t_1 > -1; __pyx_t_1-=1) {
    __pyx_v_i = __pyx_t_1;

    /* "View.MemoryView":1078
 * 
 *     for i in range(ndim - 1, -1, -1):
 *         if mslice.shape[i] > 1:             # <<<<<<<<<<<<<<
 *             c_stride = mslice.strides[i]
 *             break
 */
    __pyx_t_2 = (((__pyx_v_mslice->shape[__pyx_v_i]) > 1) != 0);
    if (__pyx_t_2) {

      /* "View.MemoryView":1079
 *     for i in range(ndim - 1, -1, -1):
 *         if mslice.shape[i] > 1:
 *             c_stride = mslice.strides[i]             # <<<<<<<<<<<<<<
 *             break
 * 
 */
      __pyx_v_c_stride = (__pyx_v_mslice->strides[__pyx_v_i]);

      /* "View.MemoryView":1080
 *         if mslice.shape[i] > 1:
 *             c_stride = mslice.strides[i]
 *             break             # <<<<<<<<<<<<<<
 * 
 *     for i in range(ndim):
 */
      goto __pyx_L4_break;
    }
  }
  __pyx_L4_break:;

  /* "View.MemoryView":1082
 *             break
 * 
 *     for i in range(ndim):             # <<<<<<<<<<<<<<
 *         if mslice.shape[i] > 1:
 *             f_stride = mslice.strides[i]
 */
  __pyx_t_1 = __pyx_v_ndim;
  for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_1; __pyx_t_3+=1) {
    __pyx_v_i = __pyx_t_3;

    /* "View.MemoryView":1083
 * 
 *     for i in range(ndim):
 *         if mslice.shape[i] > 1:             # <<<<<<<<<<<<<<
 *             f_stride = mslice.strides[i]
 *             break
 */
    __pyx_t_2 = (((__pyx_v_mslice->shape[__pyx_v_i]) > 1) != 0);
    if (__pyx_t_2) {

      /* "View.MemoryView":1084
 *     for i in range(ndim):
 *         if mslice.shape[i] > 1:
 *             f_stride = mslice.strides[i]             # <<<<<<<<<<<<<<
 *             break
 * 
 */
      __pyx_v_f_stride = (__pyx_v_mslice->strides[__pyx_v_i]);

      /* "View.MemoryView":1085
 *         if mslice.shape[i] > 1:
 *             f_stride = mslice.strides[i]
 *             break             # <<<<<<<<<<<<<<
 * 
 *     if abs_py_ssize_t(c_stride) <= abs_py_ssize_t(f_stride):
 */
      goto __pyx_L7_break;
    }
  }
  __pyx_L7_break:;

  /* "View.MemoryView":1087
 *             break
 * 
 *     if abs_py_ssize_t(c_stride) <= abs_py_ssize_t(f_stride):             # <<<<<<<<<<<<<<
 *         return 'C'
 *     else:
 */
  __pyx_t_2 = ((abs_py_ssize_t(__pyx_v_c_stride) <= abs_py_ssize_t(__pyx_v_f_stride)) != 0);
  if (__pyx_t_2) {

    /* "View.MemoryView":1088
 * 
 *     if abs_py_ssize_t(c_stride) <= abs_py_ssize_t(f_stride):
 *         return 'C'             # <<<<<<<<<<<<<<
 *     else:
 *         return 'F'
 */
    __pyx_r = 'C';
    goto __pyx_L0;
  }
  /*else*/ {

    /* "View.MemoryView":1090
 *         return 'C'
 *     else:
 *         return 'F'             # <<<<<<<<<<<<<<
 * 
 * @cython.cdivision(True)
 */
    __pyx_r = 'F';
    goto __pyx_L0;
  }

  /* "View.MemoryView":1069
 * 
 * @cname('__pyx_get_best_slice_order')
 * cdef char get_best_order(__Pyx_memviewslice *mslice, int ndim) nogil:             # <<<<<<<<<<<<<<
 *     """
 *     Figure out the best memory access order for a given slice.
 */

  /* function exit code */
  __pyx_L0:;
  return __pyx_r;
}

/* "View.MemoryView":1093
 * 
 * @cython.cdivision(True)
 * cdef void _copy_strided_to_strided(char *src_data, Py_ssize_t *src_strides,             # <<<<<<<<<<<<<<
 *                                    char *dst_data, Py_ssize_t *dst_strides,
 *                                    Py_ssize_t *src_shape, Py_ssize_t *dst_shape,
 */

static void _copy_strided_to_strided(char *__pyx_v_src_data, Py_ssize_t *__pyx_v_src_strides, char *__pyx_v_dst_data, Py_ssize_t *__pyx_v_dst_strides, Py_ssize_t *__pyx_v_src_shape, Py_ssize_t *__pyx_v_dst_shape, int __pyx_v_ndim, size_t __pyx_v_itemsize) {
  CYTHON_UNUSED Py_ssize_t __pyx_v_i;
  CYTHON_UNUSED Py_ssize_t __pyx_v_src_extent;
  Py_ssize_t __pyx_v_dst_extent;
  Py_ssize_t __pyx_v_src_stride;
  Py_ssize_t __pyx_v_dst_stride;
  int __pyx_t_1;
  int __pyx_t_2;
  int __pyx_t_3;
  int __pyx_t_4;
  Py_ssize_t __pyx_t_5;
  Py_ssize_t __pyx_t_6;

  /* "View.MemoryView":1100
 * 
 *     cdef Py_ssize_t i
 *     cdef Py_ssize_t src_extent = src_shape[0]             # <<<<<<<<<<<<<<
 *     cdef Py_ssize_t dst_extent = dst_shape[0]
 *     cdef Py_ssize_t src_stride = src_strides[0]
 */
  __pyx_v_src_extent = (__pyx_v_src_shape[0]);

  /* "View.MemoryView":1101
 *     cdef Py_ssize_t i
 *     cdef Py_ssize_t src_extent = src_shape[0]
 *     cdef Py_ssize_t dst_extent = dst_shape[0]             # <<<<<<<<<<<<<<
 *     cdef Py_ssize_t src_stride = src_strides[0]
 *     cdef Py_ssize_t dst_stride = dst_strides[0]
 */
  __pyx_v_dst_extent = (__pyx_v_dst_shape[0]);

  /* "View.MemoryView":1102
 *     cdef Py_ssize_t src_extent = src_shape[0]
 *     cdef Py_ssize_t dst_extent = dst_shape[0]
 *     cdef Py_ssize_t src_stride = src_strides[0]             # <<<<<<<<<<<<<<
 *     cdef Py_ssize_t dst_stride = dst_strides[0]
 * 
 */
  __pyx_v_src_stride = (__pyx_v_src_strides[0]);

  /* "View.MemoryView":1103
 *     cdef Py_ssize_t dst_extent = dst_shape[0]
 *     cdef Py_ssize_t src_stride = src_strides[0]
 *     cdef Py_ssize_t dst_stride = dst_strides[0]             # <<<<<<<<<<<<<<
 * 
 *     if ndim == 1:
 */
  __pyx_v_dst_stride = (__pyx_v_dst_strides[0]);

  /* "View.MemoryView":1105
 *     cdef Py_ssize_t dst_stride = dst_strides[0]
 * 
 *     if ndim == 1:             # <<<<<<<<<<<<<<
 *        if (src_stride > 0 and dst_stride > 0 and
 *            <size_t> src_stride == itemsize == <size_t> dst_stride):
 */
  __pyx_t_1 = ((__pyx_v_ndim == 1) != 0);
  if (__pyx_t_1) {

    /* "View.MemoryView":1106
 * 
 *     if ndim == 1:
 *        if (src_stride > 0 and dst_stride > 0 and             # <<<<<<<<<<<<<<
 *            <size_t> src_stride == itemsize == <size_t> dst_stride):
 *            memcpy(dst_data, src_data, itemsize * dst_extent)
 */
    __pyx_t_1 = ((__pyx_v_src_stride > 0) != 0);
    if (__pyx_t_1) {
      __pyx_t_2 = ((__pyx_v_dst_stride > 0) != 0);
      if (__pyx_t_2) {

        /* "View.MemoryView":1107
 *     if ndim == 1:
 *        if (src_stride > 0 and dst_stride > 0 and
 *            <size_t> src_stride == itemsize == <size_t> dst_stride):             # <<<<<<<<<<<<<<
 *            memcpy(dst_data, src_data, itemsize * dst_extent)
 *        else:
 */
        __pyx_t_3 = (((size_t)__pyx_v_src_stride) == __pyx_v_itemsize);
        if (__pyx_t_3) {
          __pyx_t_3 = (__pyx_v_itemsize == ((size_t)__pyx_v_dst_stride));
        }
        __pyx_t_4 = (__pyx_t_3 != 0);
      } else {
        __pyx_t_4 = __pyx_t_2;
      }
      __pyx_t_2 = __pyx_t_4;
    } else {
      __pyx_t_2 = __pyx_t_1;
    }
    if (__pyx_t_2) {

      /* "View.MemoryView":1108
 *        if (src_stride > 0 and dst_stride > 0 and
 *            <size_t> src_stride == itemsize == <size_t> dst_stride):
 *            memcpy(dst_data, src_data, itemsize * dst_extent)             # <<<<<<<<<<<<<<
 *        else:
 *            for i in range(dst_extent):
 */
      memcpy(__pyx_v_dst_data, __pyx_v_src_data, (__pyx_v_itemsize * __pyx_v_dst_extent));
      goto __pyx_L4;
    }
    /*else*/ {

      /* "View.MemoryView":1110
 *            memcpy(dst_data, src_data, itemsize * dst_extent)
 *        else:
 *            for i in range(dst_extent):             # <<<<<<<<<<<<<<
 *                memcpy(dst_data, src_data, itemsize)
 *                src_data += src_stride
 */
      __pyx_t_5 = __pyx_v_dst_extent;
      for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
        __pyx_v_i = __pyx_t_6;

        /* "View.MemoryView":1111
 *        else:
 *            for i in range(dst_extent):
 *                memcpy(dst_data, src_data, itemsize)             # <<<<<<<<<<<<<<
 *                src_data += src_stride
 *                dst_data += dst_stride
 */
        memcpy(__pyx_v_dst_data, __pyx_v_src_data, __pyx_v_itemsize);

        /* "View.MemoryView":1112
 *            for i in range(dst_extent):
 *                memcpy(dst_data, src_data, itemsize)
 *                src_data += src_stride             # <<<<<<<<<<<<<<
 *                dst_data += dst_stride
 *     else:
 */
        __pyx_v_src_data = (__pyx_v_src_data + __pyx_v_src_stride);

        /* "View.MemoryView":1113
 *                memcpy(dst_data, src_data, itemsize)
 *                src_data += src_stride
 *                dst_data += dst_stride             # <<<<<<<<<<<<<<
 *     else:
 *         for i in range(dst_extent):
 */
        __pyx_v_dst_data = (__pyx_v_dst_data + __pyx_v_dst_stride);
      }
    }
    __pyx_L4:;
    goto __pyx_L3;
  }
  /*else*/ {

    /* "View.MemoryView":1115
 *                dst_data += dst_stride
 *     else:
 *         for i in range(dst_extent):             # <<<<<<<<<<<<<<
 *             _copy_strided_to_strided(src_data, src_strides + 1,
 *                                      dst_data, dst_strides + 1,
 */
    __pyx_t_5 = __pyx_v_dst_extent;
    for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
      __pyx_v_i = __pyx_t_6;

      /* "View.MemoryView":1116
 *     else:
 *         for i in range(dst_extent):
 *             _copy_strided_to_strided(src_data, src_strides + 1,             # <<<<<<<<<<<<<<
 *                                      dst_data, dst_strides + 1,
 *                                      src_shape + 1, dst_shape + 1,
 */
      _copy_strided_to_strided(__pyx_v_src_data, (__pyx_v_src_strides + 1), __pyx_v_dst_data, (__pyx_v_dst_strides + 1), (__pyx_v_src_shape + 1), (__pyx_v_dst_shape + 1), (__pyx_v_ndim - 1), __pyx_v_itemsize);

      /* "View.MemoryView":1120
 *                                      src_shape + 1, dst_shape + 1,
 *                                      ndim - 1, itemsize)
 *             src_data += src_stride             # <<<<<<<<<<<<<<
 *             dst_data += dst_stride
 * 
 */
      __pyx_v_src_data = (__pyx_v_src_data + __pyx_v_src_stride);

      /* "View.MemoryView":1121
 *                                      ndim - 1, itemsize)
 *             src_data += src_stride
 *             dst_data += dst_stride             # <<<<<<<<<<<<<<
 * 
 * cdef void copy_strided_to_strided(__Pyx_memviewslice *src,
 */
      __pyx_v_dst_data = (__pyx_v_dst_data + __pyx_v_dst_stride);
    }
  }
  __pyx_L3:;

  /* "View.MemoryView":1093
 * 
 * @cython.cdivision(True)
 * cdef void _copy_strided_to_strided(char *src_data, Py_ssize_t *src_strides,             # <<<<<<<<<<<<<<
 *                                    char *dst_data, Py_ssize_t *dst_strides,
 *                                    Py_ssize_t *src_shape, Py_ssize_t *dst_shape,
 */

  /* function exit code */
}

/* "View.MemoryView":1123
 *             dst_data += dst_stride
 * 
 * cdef void copy_strided_to_strided(__Pyx_memviewslice *src,             # <<<<<<<<<<<<<<
 *                                   __Pyx_memviewslice *dst,
 *                                   int ndim, size_t itemsize) nogil:
 */

static void copy_strided_to_strided(__Pyx_memviewslice *__pyx_v_src, __Pyx_memviewslice *__pyx_v_dst, int __pyx_v_ndim, size_t __pyx_v_itemsize) {

  /* "View.MemoryView":1126
 *                                   __Pyx_memviewslice *dst,
 *                                   int ndim, size_t itemsize) nogil:
 *     _copy_strided_to_strided(src.data, src.strides, dst.data, dst.strides,             # <<<<<<<<<<<<<<
 *                              src.shape, dst.shape, ndim, itemsize)
 * 
 */
  _copy_strided_to_strided(__pyx_v_src->data, __pyx_v_src->strides, __pyx_v_dst->data, __pyx_v_dst->strides, __pyx_v_src->shape, __pyx_v_dst->shape, __pyx_v_ndim, __pyx_v_itemsize);

  /* "View.MemoryView":1123
 *             dst_data += dst_stride
 * 
 * cdef void copy_strided_to_strided(__Pyx_memviewslice *src,             # <<<<<<<<<<<<<<
 *                                   __Pyx_memviewslice *dst,
 *                                   int ndim, size_t itemsize) nogil:
 */

  /* function exit code */
}

/* "View.MemoryView":1130
 * 
 * @cname('__pyx_memoryview_slice_get_size')
 * cdef Py_ssize_t slice_get_size(__Pyx_memviewslice *src, int ndim) nogil:             # <<<<<<<<<<<<<<
 *     "Return the size of the memory occupied by the slice in number of bytes"
 *     cdef int i
 */

static Py_ssize_t __pyx_memoryview_slice_get_size(__Pyx_memviewslice *__pyx_v_src, int __pyx_v_ndim) {
  int __pyx_v_i;
  Py_ssize_t __pyx_v_size;
  Py_ssize_t __pyx_r;
  Py_ssize_t __pyx_t_1;
  int __pyx_t_2;
  int __pyx_t_3;

  /* "View.MemoryView":1133
 *     "Return the size of the memory occupied by the slice in number of bytes"
 *     cdef int i
 *     cdef Py_ssize_t size = src.memview.view.itemsize             # <<<<<<<<<<<<<<
 * 
 *     for i in range(ndim):
 */
  __pyx_t_1 = __pyx_v_src->memview->view.itemsize;
  __pyx_v_size = __pyx_t_1;

  /* "View.MemoryView":1135
 *     cdef Py_ssize_t size = src.memview.view.itemsize
 * 
 *     for i in range(ndim):             # <<<<<<<<<<<<<<
 *         size *= src.shape[i]
 * 
 */
  __pyx_t_2 = __pyx_v_ndim;
  for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
    __pyx_v_i = __pyx_t_3;

    /* "View.MemoryView":1136
 * 
 *     for i in range(ndim):
 *         size *= src.shape[i]             # <<<<<<<<<<<<<<
 * 
 *     return size
 */
    __pyx_v_size = (__pyx_v_size * (__pyx_v_src->shape[__pyx_v_i]));
  }

  /* "View.MemoryView":1138
 *         size *= src.shape[i]
 * 
 *     return size             # <<<<<<<<<<<<<<
 * 
 * @cname('__pyx_fill_contig_strides_array')
 */
  __pyx_r = __pyx_v_size;
  goto __pyx_L0;

  /* "View.MemoryView":1130
 * 
 * @cname('__pyx_memoryview_slice_get_size')
 * cdef Py_ssize_t slice_get_size(__Pyx_memviewslice *src, int ndim) nogil:             # <<<<<<<<<<<<<<
 *     "Return the size of the memory occupied by the slice in number of bytes"
 *     cdef int i
 */

  /* function exit code */
  __pyx_L0:;
  return __pyx_r;
}

/* "View.MemoryView":1141
 * 
 * @cname('__pyx_fill_contig_strides_array')
 * cdef Py_ssize_t fill_contig_strides_array(             # <<<<<<<<<<<<<<
 *                 Py_ssize_t *shape, Py_ssize_t *strides, Py_ssize_t stride,
 *                 int ndim, char order) nogil:
 */

static Py_ssize_t __pyx_fill_contig_strides_array(Py_ssize_t *__pyx_v_shape, Py_ssize_t *__pyx_v_strides, Py_ssize_t __pyx_v_stride, int __pyx_v_ndim, char __pyx_v_order) {
  int __pyx_v_idx;
  Py_ssize_t __pyx_r;
  int __pyx_t_1;
  int __pyx_t_2;
  int __pyx_t_3;

  /* "View.MemoryView":1150
 *     cdef int idx
 * 
 *     if order == 'F':             # <<<<<<<<<<<<<<
 *         for idx in range(ndim):
 *             strides[idx] = stride
 */
  __pyx_t_1 = ((__pyx_v_order == 'F') != 0);
  if (__pyx_t_1) {

    /* "View.MemoryView":1151
 * 
 *     if order == 'F':
 *         for idx in range(ndim):             # <<<<<<<<<<<<<<
 *             strides[idx] = stride
 *             stride = stride * shape[idx]
 */
    __pyx_t_2 = __pyx_v_ndim;
    for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
      __pyx_v_idx = __pyx_t_3;

      /* "View.MemoryView":1152
 *     if order == 'F':
 *         for idx in range(ndim):
 *             strides[idx] = stride             # <<<<<<<<<<<<<<
 *             stride = stride * shape[idx]
 *     else:
 */
      (__pyx_v_strides[__pyx_v_idx]) = __pyx_v_stride;

      /* "View.MemoryView":1153
 *         for idx in range(ndim):
 *             strides[idx] = stride
 *             stride = stride * shape[idx]             # <<<<<<<<<<<<<<
 *     else:
 *         for idx in range(ndim - 1, -1, -1):
 */
      __pyx_v_stride = (__pyx_v_stride * (__pyx_v_shape[__pyx_v_idx]));
    }
    goto __pyx_L3;
  }
  /*else*/ {

    /* "View.MemoryView":1155
 *             stride = stride * shape[idx]
 *     else:
 *         for idx in range(ndim - 1, -1, -1):             # <<<<<<<<<<<<<<
 *             strides[idx] = stride
 *             stride = stride * shape[idx]
 */
    for (__pyx_t_2 = (__pyx_v_ndim - 1); __pyx_t_2 > -1; __pyx_t_2-=1) {
      __pyx_v_idx = __pyx_t_2;

      /* "View.MemoryView":1156
 *     else:
 *         for idx in range(ndim - 1, -1, -1):
 *             strides[idx] = stride             # <<<<<<<<<<<<<<
 *             stride = stride * shape[idx]
 * 
 */
      (__pyx_v_strides[__pyx_v_idx]) = __pyx_v_stride;

      /* "View.MemoryView":1157
 *         for idx in range(ndim - 1, -1, -1):
 *             strides[idx] = stride
 *             stride = stride * shape[idx]             # <<<<<<<<<<<<<<
 * 
 *     return stride
 */
      __pyx_v_stride = (__pyx_v_stride * (__pyx_v_shape[__pyx_v_idx]));
    }
  }
  __pyx_L3:;

  /* "View.MemoryView":1159
 *             stride = stride * shape[idx]
 * 
 *     return stride             # <<<<<<<<<<<<<<
 * 
 * @cname('__pyx_memoryview_copy_data_to_temp')
 */
  __pyx_r = __pyx_v_stride;
  goto __pyx_L0;

  /* "View.MemoryView":1141
 * 
 * @cname('__pyx_fill_contig_strides_array')
 * cdef Py_ssize_t fill_contig_strides_array(             # <<<<<<<<<<<<<<
 *                 Py_ssize_t *shape, Py_ssize_t *strides, Py_ssize_t stride,
 *                 int ndim, char order) nogil:
 */

  /* function exit code */
  __pyx_L0:;
  return __pyx_r;
}

/* "View.MemoryView":1162
 * 
 * @cname('__pyx_memoryview_copy_data_to_temp')
 * cdef void *copy_data_to_temp(__Pyx_memviewslice *src,             # <<<<<<<<<<<<<<
 *                              __Pyx_memviewslice *tmpslice,
 *                              char order,
 */

static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *__pyx_v_src, __Pyx_memviewslice *__pyx_v_tmpslice, char __pyx_v_order, int __pyx_v_ndim) {
  int __pyx_v_i;
  void *__pyx_v_result;
  size_t __pyx_v_itemsize;
  size_t __pyx_v_size;
  void *__pyx_r;
  Py_ssize_t __pyx_t_1;
  int __pyx_t_2;
  int __pyx_t_3;
  struct __pyx_memoryview_obj *__pyx_t_4;
  int __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* "View.MemoryView":1173
 *     cdef void *result
 * 
 *     cdef size_t itemsize = src.memview.view.itemsize             # <<<<<<<<<<<<<<
 *     cdef size_t size = slice_get_size(src, ndim)
 * 
 */
  __pyx_t_1 = __pyx_v_src->memview->view.itemsize;
  __pyx_v_itemsize = __pyx_t_1;

  /* "View.MemoryView":1174
 * 
 *     cdef size_t itemsize = src.memview.view.itemsize
 *     cdef size_t size = slice_get_size(src, ndim)             # <<<<<<<<<<<<<<
 * 
 *     result = malloc(size)
 */
  __pyx_v_size = __pyx_memoryview_slice_get_size(__pyx_v_src, __pyx_v_ndim);

  /* "View.MemoryView":1176
 *     cdef size_t size = slice_get_size(src, ndim)
 * 
 *     result = malloc(size)             # <<<<<<<<<<<<<<
 *     if not result:
 *         _err(MemoryError, NULL)
 */
  __pyx_v_result = malloc(__pyx_v_size);

  /* "View.MemoryView":1177
 * 
 *     result = malloc(size)
 *     if not result:             # <<<<<<<<<<<<<<
 *         _err(MemoryError, NULL)
 * 
 */
  __pyx_t_2 = ((!(__pyx_v_result != 0)) != 0);
  if (__pyx_t_2) {

    /* "View.MemoryView":1178
 *     result = malloc(size)
 *     if not result:
 *         _err(MemoryError, NULL)             # <<<<<<<<<<<<<<
 * 
 * 
 */
    __pyx_t_3 = __pyx_memoryview_err(__pyx_builtin_MemoryError, NULL); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 1178; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "View.MemoryView":1181
 * 
 * 
 *     tmpslice.data = <char *> result             # <<<<<<<<<<<<<<
 *     tmpslice.memview = src.memview
 *     for i in range(ndim):
 */
  __pyx_v_tmpslice->data = ((char *)__pyx_v_result);

  /* "View.MemoryView":1182
 * 
 *     tmpslice.data = <char *> result
 *     tmpslice.memview = src.memview             # <<<<<<<<<<<<<<
 *     for i in range(ndim):
 *         tmpslice.shape[i] = src.shape[i]
 */
  __pyx_t_4 = __pyx_v_src->memview;
  __pyx_v_tmpslice->memview = __pyx_t_4;

  /* "View.MemoryView":1183
 *     tmpslice.data = <char *> result
 *     tmpslice.memview = src.memview
 *     for i in range(ndim):             # <<<<<<<<<<<<<<
 *         tmpslice.shape[i] = src.shape[i]
 *         tmpslice.suboffsets[i] = -1
 */
  __pyx_t_3 = __pyx_v_ndim;
  for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_3; __pyx_t_5+=1) {
    __pyx_v_i = __pyx_t_5;

    /* "View.MemoryView":1184
 *     tmpslice.memview = src.memview
 *     for i in range(ndim):
 *         tmpslice.shape[i] = src.shape[i]             # <<<<<<<<<<<<<<
 *         tmpslice.suboffsets[i] = -1
 * 
 */
    (__pyx_v_tmpslice->shape[__pyx_v_i]) = (__pyx_v_src->shape[__pyx_v_i]);

    /* "View.MemoryView":1185
 *     for i in range(ndim):
 *         tmpslice.shape[i] = src.shape[i]
 *         tmpslice.suboffsets[i] = -1             # <<<<<<<<<<<<<<
 * 
 *     fill_contig_strides_array(&tmpslice.shape[0], &tmpslice.strides[0], itemsize,
 */
    (__pyx_v_tmpslice->suboffsets[__pyx_v_i]) = -1;
  }

  /* "View.MemoryView":1187
 *         tmpslice.suboffsets[i] = -1
 * 
 *     fill_contig_strides_array(&tmpslice.shape[0], &tmpslice.strides[0], itemsize,             # <<<<<<<<<<<<<<
 *                               ndim, order)
 * 
 */
  __pyx_fill_contig_strides_array((&(__pyx_v_tmpslice->shape[0])), (&(__pyx_v_tmpslice->strides[0])), __pyx_v_itemsize, __pyx_v_ndim, __pyx_v_order);

  /* "View.MemoryView":1191
 * 
 * 
 *     for i in range(ndim):             # <<<<<<<<<<<<<<
 *         if tmpslice.shape[i] == 1:
 *             tmpslice.strides[i] = 0
 */
  __pyx_t_3 = __pyx_v_ndim;
  for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_3; __pyx_t_5+=1) {
    __pyx_v_i = __pyx_t_5;

    /* "View.MemoryView":1192
 * 
 *     for i in range(ndim):
 *         if tmpslice.shape[i] == 1:             # <<<<<<<<<<<<<<
 *             tmpslice.strides[i] = 0
 * 
 */
    __pyx_t_2 = (((__pyx_v_tmpslice->shape[__pyx_v_i]) == 1) != 0);
    if (__pyx_t_2) {

      /* "View.MemoryView":1193
 *     for i in range(ndim):
 *         if tmpslice.shape[i] == 1:
 *             tmpslice.strides[i] = 0             # <<<<<<<<<<<<<<
 * 
 *     if slice_is_contig(src, order, ndim):
 */
      (__pyx_v_tmpslice->strides[__pyx_v_i]) = 0;
      goto __pyx_L8;
    }
    __pyx_L8:;
  }

  /* "View.MemoryView":1195
 *             tmpslice.strides[i] = 0
 * 
 *     if slice_is_contig(src, order, ndim):             # <<<<<<<<<<<<<<
 *         memcpy(result, src.data, size)
 *     else:
 */
  __pyx_t_2 = (__pyx_memviewslice_is_contig(__pyx_v_src, __pyx_v_order, __pyx_v_ndim) != 0);
  if (__pyx_t_2) {

    /* "View.MemoryView":1196
 * 
 *     if slice_is_contig(src, order, ndim):
 *         memcpy(result, src.data, size)             # <<<<<<<<<<<<<<
 *     else:
 *         copy_strided_to_strided(src, tmpslice, ndim, itemsize)
 */
    memcpy(__pyx_v_result, __pyx_v_src->data, __pyx_v_size);
    goto __pyx_L9;
  }
  /*else*/ {

    /* "View.MemoryView":1198
 *         memcpy(result, src.data, size)
 *     else:
 *         copy_strided_to_strided(src, tmpslice, ndim, itemsize)             # <<<<<<<<<<<<<<
 * 
 *     return result
 */
    copy_strided_to_strided(__pyx_v_src, __pyx_v_tmpslice, __pyx_v_ndim, __pyx_v_itemsize);
  }
  __pyx_L9:;

  /* "View.MemoryView":1200
 *         copy_strided_to_strided(src, tmpslice, ndim, itemsize)
 * 
 *     return result             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = __pyx_v_result;
  goto __pyx_L0;

  /* "View.MemoryView":1162
 * 
 * @cname('__pyx_memoryview_copy_data_to_temp')
 * cdef void *copy_data_to_temp(__Pyx_memviewslice *src,             # <<<<<<<<<<<<<<
 *                              __Pyx_memviewslice *tmpslice,
 *                              char order,
 */

  /* function exit code */
  __pyx_L1_error:;
  {
    #ifdef WITH_THREAD
    PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
    #endif
    __Pyx_AddTraceback("View.MemoryView.copy_data_to_temp", __pyx_clineno, __pyx_lineno, __pyx_filename);
    #ifdef WITH_THREAD
    PyGILState_Release(__pyx_gilstate_save);
    #endif
  }
  __pyx_r = NULL;
  __pyx_L0:;
  return __pyx_r;
}

/* "View.MemoryView":1205
 * 
 * @cname('__pyx_memoryview_err_extents')
 * cdef int _err_extents(int i, Py_ssize_t extent1,             # <<<<<<<<<<<<<<
 *                              Py_ssize_t extent2) except -1 with gil:
 *     raise ValueError("got differing extents in dimension %d (got %d and %d)" %
 */

static int __pyx_memoryview_err_extents(int __pyx_v_i, Py_ssize_t __pyx_v_extent1, Py_ssize_t __pyx_v_extent2) {
  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;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  #ifdef WITH_THREAD
  PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
  #endif
  __Pyx_RefNannySetupContext("_err_extents", 0);

  /* "View.MemoryView":1208
 *                              Py_ssize_t extent2) except -1 with gil:
 *     raise ValueError("got differing extents in dimension %d (got %d and %d)" %
 *                                                         (i, extent1, extent2))             # <<<<<<<<<<<<<<
 * 
 * @cname('__pyx_memoryview_err_dim')
 */
  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_i); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 1208; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_extent1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 1208; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_extent2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 1208; __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[7]; __pyx_lineno = 1208; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__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;

  /* "View.MemoryView":1207
 * cdef int _err_extents(int i, Py_ssize_t extent1,
 *                              Py_ssize_t extent2) except -1 with gil:
 *     raise ValueError("got differing extents in dimension %d (got %d and %d)" %             # <<<<<<<<<<<<<<
 *                                                         (i, extent1, extent2))
 * 
 */
  __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_got_differing_extents_in_dimensi, __pyx_t_4); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 1207; __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[7]; __pyx_lineno = 1207; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__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 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 1207; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__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[7]; __pyx_lineno = 1207; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "View.MemoryView":1205
 * 
 * @cname('__pyx_memoryview_err_extents')
 * cdef int _err_extents(int i, Py_ssize_t extent1,             # <<<<<<<<<<<<<<
 *                              Py_ssize_t extent2) except -1 with gil:
 *     raise ValueError("got differing extents in dimension %d (got %d and %d)" %
 */

  /* function exit code */
  __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("View.MemoryView._err_extents", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __Pyx_RefNannyFinishContext();
  #ifdef WITH_THREAD
  PyGILState_Release(__pyx_gilstate_save);
  #endif
  return __pyx_r;
}

/* "View.MemoryView":1211
 * 
 * @cname('__pyx_memoryview_err_dim')
 * cdef int _err_dim(object error, char *msg, int dim) except -1 with gil:             # <<<<<<<<<<<<<<
 *     raise error(msg.decode('ascii') % dim)
 * 
 */

static int __pyx_memoryview_err_dim(PyObject *__pyx_v_error, char *__pyx_v_msg, int __pyx_v_dim) {
  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;
  #ifdef WITH_THREAD
  PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
  #endif
  __Pyx_RefNannySetupContext("_err_dim", 0);
  __Pyx_INCREF(__pyx_v_error);

  /* "View.MemoryView":1212
 * @cname('__pyx_memoryview_err_dim')
 * cdef int _err_dim(object error, char *msg, int dim) except -1 with gil:
 *     raise error(msg.decode('ascii') % dim)             # <<<<<<<<<<<<<<
 * 
 * @cname('__pyx_memoryview_err')
 */
  __pyx_t_1 = __Pyx_decode_c_string(__pyx_v_msg, 0, strlen(__pyx_v_msg), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 1212; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_dim); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 1212; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyUnicode_Format(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 1212; __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_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 1212; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__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 = __Pyx_PyObject_Call(__pyx_v_error, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 1212; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__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[7]; __pyx_lineno = 1212; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "View.MemoryView":1211
 * 
 * @cname('__pyx_memoryview_err_dim')
 * cdef int _err_dim(object error, char *msg, int dim) except -1 with gil:             # <<<<<<<<<<<<<<
 *     raise error(msg.decode('ascii') % dim)
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("View.MemoryView._err_dim", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __Pyx_XDECREF(__pyx_v_error);
  __Pyx_RefNannyFinishContext();
  #ifdef WITH_THREAD
  PyGILState_Release(__pyx_gilstate_save);
  #endif
  return __pyx_r;
}

/* "View.MemoryView":1215
 * 
 * @cname('__pyx_memoryview_err')
 * cdef int _err(object error, char *msg) except -1 with gil:             # <<<<<<<<<<<<<<
 *     if msg != NULL:
 *         raise error(msg.decode('ascii'))
 */

static int __pyx_memoryview_err(PyObject *__pyx_v_error, char *__pyx_v_msg) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  #ifdef WITH_THREAD
  PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
  #endif
  __Pyx_RefNannySetupContext("_err", 0);
  __Pyx_INCREF(__pyx_v_error);

  /* "View.MemoryView":1216
 * @cname('__pyx_memoryview_err')
 * cdef int _err(object error, char *msg) except -1 with gil:
 *     if msg != NULL:             # <<<<<<<<<<<<<<
 *         raise error(msg.decode('ascii'))
 *     else:
 */
  __pyx_t_1 = ((__pyx_v_msg != NULL) != 0);
  if (__pyx_t_1) {

    /* "View.MemoryView":1217
 * cdef int _err(object error, char *msg) except -1 with gil:
 *     if msg != NULL:
 *         raise error(msg.decode('ascii'))             # <<<<<<<<<<<<<<
 *     else:
 *         raise error
 */
    __pyx_t_2 = __Pyx_decode_c_string(__pyx_v_msg, 0, strlen(__pyx_v_msg), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 1217; __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 = 1217; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__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 = __Pyx_PyObject_Call(__pyx_v_error, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 1217; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    {__pyx_filename = __pyx_f[7]; __pyx_lineno = 1217; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  /*else*/ {

    /* "View.MemoryView":1219
 *         raise error(msg.decode('ascii'))
 *     else:
 *         raise error             # <<<<<<<<<<<<<<
 * 
 * @cname('__pyx_memoryview_copy_contents')
 */
    __Pyx_Raise(__pyx_v_error, 0, 0, 0);
    {__pyx_filename = __pyx_f[7]; __pyx_lineno = 1219; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }

  /* "View.MemoryView":1215
 * 
 * @cname('__pyx_memoryview_err')
 * cdef int _err(object error, char *msg) except -1 with gil:             # <<<<<<<<<<<<<<
 *     if msg != NULL:
 *         raise error(msg.decode('ascii'))
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("View.MemoryView._err", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __Pyx_XDECREF(__pyx_v_error);
  __Pyx_RefNannyFinishContext();
  #ifdef WITH_THREAD
  PyGILState_Release(__pyx_gilstate_save);
  #endif
  return __pyx_r;
}

/* "View.MemoryView":1222
 * 
 * @cname('__pyx_memoryview_copy_contents')
 * cdef int memoryview_copy_contents(__Pyx_memviewslice src,             # <<<<<<<<<<<<<<
 *                                   __Pyx_memviewslice dst,
 *                                   int src_ndim, int dst_ndim,
 */

static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_memviewslice __pyx_v_dst, int __pyx_v_src_ndim, int __pyx_v_dst_ndim, int __pyx_v_dtype_is_object) {
  void *__pyx_v_tmpdata;
  size_t __pyx_v_itemsize;
  int __pyx_v_i;
  char __pyx_v_order;
  int __pyx_v_broadcasting;
  int __pyx_v_direct_copy;
  __Pyx_memviewslice __pyx_v_tmp;
  int __pyx_v_ndim;
  int __pyx_r;
  Py_ssize_t __pyx_t_1;
  int __pyx_t_2;
  int __pyx_t_3;
  int __pyx_t_4;
  int __pyx_t_5;
  void *__pyx_t_6;
  int __pyx_t_7;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* "View.MemoryView":1230
 *     Check for overlapping memory and verify the shapes.
 *     """
 *     cdef void *tmpdata = NULL             # <<<<<<<<<<<<<<
 *     cdef size_t itemsize = src.memview.view.itemsize
 *     cdef int i
 */
  __pyx_v_tmpdata = NULL;

  /* "View.MemoryView":1231
 *     """
 *     cdef void *tmpdata = NULL
 *     cdef size_t itemsize = src.memview.view.itemsize             # <<<<<<<<<<<<<<
 *     cdef int i
 *     cdef char order = get_best_order(&src, src_ndim)
 */
  __pyx_t_1 = __pyx_v_src.memview->view.itemsize;
  __pyx_v_itemsize = __pyx_t_1;

  /* "View.MemoryView":1233
 *     cdef size_t itemsize = src.memview.view.itemsize
 *     cdef int i
 *     cdef char order = get_best_order(&src, src_ndim)             # <<<<<<<<<<<<<<
 *     cdef bint broadcasting = False
 *     cdef bint direct_copy = False
 */
  __pyx_v_order = __pyx_get_best_slice_order((&__pyx_v_src), __pyx_v_src_ndim);

  /* "View.MemoryView":1234
 *     cdef int i
 *     cdef char order = get_best_order(&src, src_ndim)
 *     cdef bint broadcasting = False             # <<<<<<<<<<<<<<
 *     cdef bint direct_copy = False
 *     cdef __Pyx_memviewslice tmp
 */
  __pyx_v_broadcasting = 0;

  /* "View.MemoryView":1235
 *     cdef char order = get_best_order(&src, src_ndim)
 *     cdef bint broadcasting = False
 *     cdef bint direct_copy = False             # <<<<<<<<<<<<<<
 *     cdef __Pyx_memviewslice tmp
 * 
 */
  __pyx_v_direct_copy = 0;

  /* "View.MemoryView":1238
 *     cdef __Pyx_memviewslice tmp
 * 
 *     if src_ndim < dst_ndim:             # <<<<<<<<<<<<<<
 *         broadcast_leading(&src, src_ndim, dst_ndim)
 *     elif dst_ndim < src_ndim:
 */
  __pyx_t_2 = ((__pyx_v_src_ndim < __pyx_v_dst_ndim) != 0);
  if (__pyx_t_2) {

    /* "View.MemoryView":1239
 * 
 *     if src_ndim < dst_ndim:
 *         broadcast_leading(&src, src_ndim, dst_ndim)             # <<<<<<<<<<<<<<
 *     elif dst_ndim < src_ndim:
 *         broadcast_leading(&dst, dst_ndim, src_ndim)
 */
    __pyx_memoryview_broadcast_leading((&__pyx_v_src), __pyx_v_src_ndim, __pyx_v_dst_ndim);
    goto __pyx_L3;
  }

  /* "View.MemoryView":1240
 *     if src_ndim < dst_ndim:
 *         broadcast_leading(&src, src_ndim, dst_ndim)
 *     elif dst_ndim < src_ndim:             # <<<<<<<<<<<<<<
 *         broadcast_leading(&dst, dst_ndim, src_ndim)
 * 
 */
  __pyx_t_2 = ((__pyx_v_dst_ndim < __pyx_v_src_ndim) != 0);
  if (__pyx_t_2) {

    /* "View.MemoryView":1241
 *         broadcast_leading(&src, src_ndim, dst_ndim)
 *     elif dst_ndim < src_ndim:
 *         broadcast_leading(&dst, dst_ndim, src_ndim)             # <<<<<<<<<<<<<<
 * 
 *     cdef int ndim = max(src_ndim, dst_ndim)
 */
    __pyx_memoryview_broadcast_leading((&__pyx_v_dst), __pyx_v_dst_ndim, __pyx_v_src_ndim);
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "View.MemoryView":1243
 *         broadcast_leading(&dst, dst_ndim, src_ndim)
 * 
 *     cdef int ndim = max(src_ndim, dst_ndim)             # <<<<<<<<<<<<<<
 * 
 *     for i in range(ndim):
 */
  __pyx_t_3 = __pyx_v_dst_ndim;
  __pyx_t_4 = __pyx_v_src_ndim;
  if (((__pyx_t_3 > __pyx_t_4) != 0)) {
    __pyx_t_5 = __pyx_t_3;
  } else {
    __pyx_t_5 = __pyx_t_4;
  }
  __pyx_v_ndim = __pyx_t_5;

  /* "View.MemoryView":1245
 *     cdef int ndim = max(src_ndim, dst_ndim)
 * 
 *     for i in range(ndim):             # <<<<<<<<<<<<<<
 *         if src.shape[i] != dst.shape[i]:
 *             if src.shape[i] == 1:
 */
  __pyx_t_5 = __pyx_v_ndim;
  for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_5; __pyx_t_3+=1) {
    __pyx_v_i = __pyx_t_3;

    /* "View.MemoryView":1246
 * 
 *     for i in range(ndim):
 *         if src.shape[i] != dst.shape[i]:             # <<<<<<<<<<<<<<
 *             if src.shape[i] == 1:
 *                 broadcasting = True
 */
    __pyx_t_2 = (((__pyx_v_src.shape[__pyx_v_i]) != (__pyx_v_dst.shape[__pyx_v_i])) != 0);
    if (__pyx_t_2) {

      /* "View.MemoryView":1247
 *     for i in range(ndim):
 *         if src.shape[i] != dst.shape[i]:
 *             if src.shape[i] == 1:             # <<<<<<<<<<<<<<
 *                 broadcasting = True
 *                 src.strides[i] = 0
 */
      __pyx_t_2 = (((__pyx_v_src.shape[__pyx_v_i]) == 1) != 0);
      if (__pyx_t_2) {

        /* "View.MemoryView":1248
 *         if src.shape[i] != dst.shape[i]:
 *             if src.shape[i] == 1:
 *                 broadcasting = True             # <<<<<<<<<<<<<<
 *                 src.strides[i] = 0
 *             else:
 */
        __pyx_v_broadcasting = 1;

        /* "View.MemoryView":1249
 *             if src.shape[i] == 1:
 *                 broadcasting = True
 *                 src.strides[i] = 0             # <<<<<<<<<<<<<<
 *             else:
 *                 _err_extents(i, dst.shape[i], src.shape[i])
 */
        (__pyx_v_src.strides[__pyx_v_i]) = 0;
        goto __pyx_L7;
      }
      /*else*/ {

        /* "View.MemoryView":1251
 *                 src.strides[i] = 0
 *             else:
 *                 _err_extents(i, dst.shape[i], src.shape[i])             # <<<<<<<<<<<<<<
 * 
 *         if src.suboffsets[i] >= 0:
 */
        __pyx_t_4 = __pyx_memoryview_err_extents(__pyx_v_i, (__pyx_v_dst.shape[__pyx_v_i]), (__pyx_v_src.shape[__pyx_v_i])); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 1251; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_L7:;
      goto __pyx_L6;
    }
    __pyx_L6:;

    /* "View.MemoryView":1253
 *                 _err_extents(i, dst.shape[i], src.shape[i])
 * 
 *         if src.suboffsets[i] >= 0:             # <<<<<<<<<<<<<<
 *             _err_dim(ValueError, "Dimension %d is not direct", i)
 * 
 */
    __pyx_t_2 = (((__pyx_v_src.suboffsets[__pyx_v_i]) >= 0) != 0);
    if (__pyx_t_2) {

      /* "View.MemoryView":1254
 * 
 *         if src.suboffsets[i] >= 0:
 *             _err_dim(ValueError, "Dimension %d is not direct", i)             # <<<<<<<<<<<<<<
 * 
 *     if slices_overlap(&src, &dst, ndim, itemsize):
 */
      __pyx_t_4 = __pyx_memoryview_err_dim(__pyx_builtin_ValueError, __pyx_k_Dimension_d_is_not_direct, __pyx_v_i); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 1254; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      goto __pyx_L8;
    }
    __pyx_L8:;
  }

  /* "View.MemoryView":1256
 *             _err_dim(ValueError, "Dimension %d is not direct", i)
 * 
 *     if slices_overlap(&src, &dst, ndim, itemsize):             # <<<<<<<<<<<<<<
 * 
 *         if not slice_is_contig(&src, order, ndim):
 */
  __pyx_t_2 = (__pyx_slices_overlap((&__pyx_v_src), (&__pyx_v_dst), __pyx_v_ndim, __pyx_v_itemsize) != 0);
  if (__pyx_t_2) {

    /* "View.MemoryView":1258
 *     if slices_overlap(&src, &dst, ndim, itemsize):
 * 
 *         if not slice_is_contig(&src, order, ndim):             # <<<<<<<<<<<<<<
 *             order = get_best_order(&dst, ndim)
 * 
 */
    __pyx_t_2 = ((!(__pyx_memviewslice_is_contig((&__pyx_v_src), __pyx_v_order, __pyx_v_ndim) != 0)) != 0);
    if (__pyx_t_2) {

      /* "View.MemoryView":1259
 * 
 *         if not slice_is_contig(&src, order, ndim):
 *             order = get_best_order(&dst, ndim)             # <<<<<<<<<<<<<<
 * 
 *         tmpdata = copy_data_to_temp(&src, &tmp, order, ndim)
 */
      __pyx_v_order = __pyx_get_best_slice_order((&__pyx_v_dst), __pyx_v_ndim);
      goto __pyx_L10;
    }
    __pyx_L10:;

    /* "View.MemoryView":1261
 *             order = get_best_order(&dst, ndim)
 * 
 *         tmpdata = copy_data_to_temp(&src, &tmp, order, ndim)             # <<<<<<<<<<<<<<
 *         src = tmp
 * 
 */
    __pyx_t_6 = __pyx_memoryview_copy_data_to_temp((&__pyx_v_src), (&__pyx_v_tmp), __pyx_v_order, __pyx_v_ndim); if (unlikely(__pyx_t_6 == NULL)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 1261; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_v_tmpdata = __pyx_t_6;

    /* "View.MemoryView":1262
 * 
 *         tmpdata = copy_data_to_temp(&src, &tmp, order, ndim)
 *         src = tmp             # <<<<<<<<<<<<<<
 * 
 *     if not broadcasting:
 */
    __pyx_v_src = __pyx_v_tmp;
    goto __pyx_L9;
  }
  __pyx_L9:;

  /* "View.MemoryView":1264
 *         src = tmp
 * 
 *     if not broadcasting:             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_2 = ((!(__pyx_v_broadcasting != 0)) != 0);
  if (__pyx_t_2) {

    /* "View.MemoryView":1267
 * 
 * 
 *         if slice_is_contig(&src, 'C', ndim):             # <<<<<<<<<<<<<<
 *             direct_copy = slice_is_contig(&dst, 'C', ndim)
 *         elif slice_is_contig(&src, 'F', ndim):
 */
    __pyx_t_2 = (__pyx_memviewslice_is_contig((&__pyx_v_src), 'C', __pyx_v_ndim) != 0);
    if (__pyx_t_2) {

      /* "View.MemoryView":1268
 * 
 *         if slice_is_contig(&src, 'C', ndim):
 *             direct_copy = slice_is_contig(&dst, 'C', ndim)             # <<<<<<<<<<<<<<
 *         elif slice_is_contig(&src, 'F', ndim):
 *             direct_copy = slice_is_contig(&dst, 'F', ndim)
 */
      __pyx_v_direct_copy = __pyx_memviewslice_is_contig((&__pyx_v_dst), 'C', __pyx_v_ndim);
      goto __pyx_L12;
    }

    /* "View.MemoryView":1269
 *         if slice_is_contig(&src, 'C', ndim):
 *             direct_copy = slice_is_contig(&dst, 'C', ndim)
 *         elif slice_is_contig(&src, 'F', ndim):             # <<<<<<<<<<<<<<
 *             direct_copy = slice_is_contig(&dst, 'F', ndim)
 * 
 */
    __pyx_t_2 = (__pyx_memviewslice_is_contig((&__pyx_v_src), 'F', __pyx_v_ndim) != 0);
    if (__pyx_t_2) {

      /* "View.MemoryView":1270
 *             direct_copy = slice_is_contig(&dst, 'C', ndim)
 *         elif slice_is_contig(&src, 'F', ndim):
 *             direct_copy = slice_is_contig(&dst, 'F', ndim)             # <<<<<<<<<<<<<<
 * 
 *         if direct_copy:
 */
      __pyx_v_direct_copy = __pyx_memviewslice_is_contig((&__pyx_v_dst), 'F', __pyx_v_ndim);
      goto __pyx_L12;
    }
    __pyx_L12:;

    /* "View.MemoryView":1272
 *             direct_copy = slice_is_contig(&dst, 'F', ndim)
 * 
 *         if direct_copy:             # <<<<<<<<<<<<<<
 * 
 *             refcount_copying(&dst, dtype_is_object, ndim, False)
 */
    __pyx_t_2 = (__pyx_v_direct_copy != 0);
    if (__pyx_t_2) {

      /* "View.MemoryView":1274
 *         if direct_copy:
 * 
 *             refcount_copying(&dst, dtype_is_object, ndim, False)             # <<<<<<<<<<<<<<
 *             memcpy(dst.data, src.data, slice_get_size(&src, ndim))
 *             refcount_copying(&dst, dtype_is_object, ndim, True)
 */
      __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 0);

      /* "View.MemoryView":1275
 * 
 *             refcount_copying(&dst, dtype_is_object, ndim, False)
 *             memcpy(dst.data, src.data, slice_get_size(&src, ndim))             # <<<<<<<<<<<<<<
 *             refcount_copying(&dst, dtype_is_object, ndim, True)
 *             free(tmpdata)
 */
      memcpy(__pyx_v_dst.data, __pyx_v_src.data, __pyx_memoryview_slice_get_size((&__pyx_v_src), __pyx_v_ndim));

      /* "View.MemoryView":1276
 *             refcount_copying(&dst, dtype_is_object, ndim, False)
 *             memcpy(dst.data, src.data, slice_get_size(&src, ndim))
 *             refcount_copying(&dst, dtype_is_object, ndim, True)             # <<<<<<<<<<<<<<
 *             free(tmpdata)
 *             return 0
 */
      __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 1);

      /* "View.MemoryView":1277
 *             memcpy(dst.data, src.data, slice_get_size(&src, ndim))
 *             refcount_copying(&dst, dtype_is_object, ndim, True)
 *             free(tmpdata)             # <<<<<<<<<<<<<<
 *             return 0
 * 
 */
      free(__pyx_v_tmpdata);

      /* "View.MemoryView":1278
 *             refcount_copying(&dst, dtype_is_object, ndim, True)
 *             free(tmpdata)
 *             return 0             # <<<<<<<<<<<<<<
 * 
 *     if order == 'F' == get_best_order(&dst, ndim):
 */
      __pyx_r = 0;
      goto __pyx_L0;
    }
    goto __pyx_L11;
  }
  __pyx_L11:;

  /* "View.MemoryView":1280
 *             return 0
 * 
 *     if order == 'F' == get_best_order(&dst, ndim):             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_2 = (__pyx_v_order == 'F');
  if (__pyx_t_2) {
    __pyx_t_2 = ('F' == __pyx_get_best_slice_order((&__pyx_v_dst), __pyx_v_ndim));
  }
  __pyx_t_7 = (__pyx_t_2 != 0);
  if (__pyx_t_7) {

    /* "View.MemoryView":1283
 * 
 * 
 *         transpose_memslice(&src)             # <<<<<<<<<<<<<<
 *         transpose_memslice(&dst)
 * 
 */
    __pyx_t_5 = __pyx_memslice_transpose((&__pyx_v_src)); if (unlikely(__pyx_t_5 == 0)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 1283; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

    /* "View.MemoryView":1284
 * 
 *         transpose_memslice(&src)
 *         transpose_memslice(&dst)             # <<<<<<<<<<<<<<
 * 
 *     refcount_copying(&dst, dtype_is_object, ndim, False)
 */
    __pyx_t_5 = __pyx_memslice_transpose((&__pyx_v_dst)); if (unlikely(__pyx_t_5 == 0)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 1284; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L14;
  }
  __pyx_L14:;

  /* "View.MemoryView":1286
 *         transpose_memslice(&dst)
 * 
 *     refcount_copying(&dst, dtype_is_object, ndim, False)             # <<<<<<<<<<<<<<
 *     copy_strided_to_strided(&src, &dst, ndim, itemsize)
 *     refcount_copying(&dst, dtype_is_object, ndim, True)
 */
  __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 0);

  /* "View.MemoryView":1287
 * 
 *     refcount_copying(&dst, dtype_is_object, ndim, False)
 *     copy_strided_to_strided(&src, &dst, ndim, itemsize)             # <<<<<<<<<<<<<<
 *     refcount_copying(&dst, dtype_is_object, ndim, True)
 * 
 */
  copy_strided_to_strided((&__pyx_v_src), (&__pyx_v_dst), __pyx_v_ndim, __pyx_v_itemsize);

  /* "View.MemoryView":1288
 *     refcount_copying(&dst, dtype_is_object, ndim, False)
 *     copy_strided_to_strided(&src, &dst, ndim, itemsize)
 *     refcount_copying(&dst, dtype_is_object, ndim, True)             # <<<<<<<<<<<<<<
 * 
 *     free(tmpdata)
 */
  __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 1);

  /* "View.MemoryView":1290
 *     refcount_copying(&dst, dtype_is_object, ndim, True)
 * 
 *     free(tmpdata)             # <<<<<<<<<<<<<<
 *     return 0
 * 
 */
  free(__pyx_v_tmpdata);

  /* "View.MemoryView":1291
 * 
 *     free(tmpdata)
 *     return 0             # <<<<<<<<<<<<<<
 * 
 * @cname('__pyx_memoryview_broadcast_leading')
 */
  __pyx_r = 0;
  goto __pyx_L0;

  /* "View.MemoryView":1222
 * 
 * @cname('__pyx_memoryview_copy_contents')
 * cdef int memoryview_copy_contents(__Pyx_memviewslice src,             # <<<<<<<<<<<<<<
 *                                   __Pyx_memviewslice dst,
 *                                   int src_ndim, int dst_ndim,
 */

  /* function exit code */
  __pyx_L1_error:;
  {
    #ifdef WITH_THREAD
    PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
    #endif
    __Pyx_AddTraceback("View.MemoryView.memoryview_copy_contents", __pyx_clineno, __pyx_lineno, __pyx_filename);
    #ifdef WITH_THREAD
    PyGILState_Release(__pyx_gilstate_save);
    #endif
  }
  __pyx_r = -1;
  __pyx_L0:;
  return __pyx_r;
}

/* "View.MemoryView":1294
 * 
 * @cname('__pyx_memoryview_broadcast_leading')
 * cdef void broadcast_leading(__Pyx_memviewslice *slice,             # <<<<<<<<<<<<<<
 *                             int ndim,
 *                             int ndim_other) nogil:
 */

static void __pyx_memoryview_broadcast_leading(__Pyx_memviewslice *__pyx_v_slice, int __pyx_v_ndim, int __pyx_v_ndim_other) {
  int __pyx_v_i;
  int __pyx_v_offset;
  int __pyx_t_1;
  int __pyx_t_2;

  /* "View.MemoryView":1298
 *                             int ndim_other) nogil:
 *     cdef int i
 *     cdef int offset = ndim_other - ndim             # <<<<<<<<<<<<<<
 * 
 *     for i in range(ndim - 1, -1, -1):
 */
  __pyx_v_offset = (__pyx_v_ndim_other - __pyx_v_ndim);

  /* "View.MemoryView":1300
 *     cdef int offset = ndim_other - ndim
 * 
 *     for i in range(ndim - 1, -1, -1):             # <<<<<<<<<<<<<<
 *         slice.shape[i + offset] = slice.shape[i]
 *         slice.strides[i + offset] = slice.strides[i]
 */
  for (__pyx_t_1 = (__pyx_v_ndim - 1); __pyx_t_1 > -1; __pyx_t_1-=1) {
    __pyx_v_i = __pyx_t_1;

    /* "View.MemoryView":1301
 * 
 *     for i in range(ndim - 1, -1, -1):
 *         slice.shape[i + offset] = slice.shape[i]             # <<<<<<<<<<<<<<
 *         slice.strides[i + offset] = slice.strides[i]
 *         slice.suboffsets[i + offset] = slice.suboffsets[i]
 */
    (__pyx_v_slice->shape[(__pyx_v_i + __pyx_v_offset)]) = (__pyx_v_slice->shape[__pyx_v_i]);

    /* "View.MemoryView":1302
 *     for i in range(ndim - 1, -1, -1):
 *         slice.shape[i + offset] = slice.shape[i]
 *         slice.strides[i + offset] = slice.strides[i]             # <<<<<<<<<<<<<<
 *         slice.suboffsets[i + offset] = slice.suboffsets[i]
 * 
 */
    (__pyx_v_slice->strides[(__pyx_v_i + __pyx_v_offset)]) = (__pyx_v_slice->strides[__pyx_v_i]);

    /* "View.MemoryView":1303
 *         slice.shape[i + offset] = slice.shape[i]
 *         slice.strides[i + offset] = slice.strides[i]
 *         slice.suboffsets[i + offset] = slice.suboffsets[i]             # <<<<<<<<<<<<<<
 * 
 *     for i in range(offset):
 */
    (__pyx_v_slice->suboffsets[(__pyx_v_i + __pyx_v_offset)]) = (__pyx_v_slice->suboffsets[__pyx_v_i]);
  }

  /* "View.MemoryView":1305
 *         slice.suboffsets[i + offset] = slice.suboffsets[i]
 * 
 *     for i in range(offset):             # <<<<<<<<<<<<<<
 *         slice.shape[i] = 1
 *         slice.strides[i] = slice.strides[0]
 */
  __pyx_t_1 = __pyx_v_offset;
  for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) {
    __pyx_v_i = __pyx_t_2;

    /* "View.MemoryView":1306
 * 
 *     for i in range(offset):
 *         slice.shape[i] = 1             # <<<<<<<<<<<<<<
 *         slice.strides[i] = slice.strides[0]
 *         slice.suboffsets[i] = -1
 */
    (__pyx_v_slice->shape[__pyx_v_i]) = 1;

    /* "View.MemoryView":1307
 *     for i in range(offset):
 *         slice.shape[i] = 1
 *         slice.strides[i] = slice.strides[0]             # <<<<<<<<<<<<<<
 *         slice.suboffsets[i] = -1
 * 
 */
    (__pyx_v_slice->strides[__pyx_v_i]) = (__pyx_v_slice->strides[0]);

    /* "View.MemoryView":1308
 *         slice.shape[i] = 1
 *         slice.strides[i] = slice.strides[0]
 *         slice.suboffsets[i] = -1             # <<<<<<<<<<<<<<
 * 
 * 
 */
    (__pyx_v_slice->suboffsets[__pyx_v_i]) = -1;
  }

  /* "View.MemoryView":1294
 * 
 * @cname('__pyx_memoryview_broadcast_leading')
 * cdef void broadcast_leading(__Pyx_memviewslice *slice,             # <<<<<<<<<<<<<<
 *                             int ndim,
 *                             int ndim_other) nogil:
 */

  /* function exit code */
}

/* "View.MemoryView":1316
 * 
 * @cname('__pyx_memoryview_refcount_copying')
 * cdef void refcount_copying(__Pyx_memviewslice *dst, bint dtype_is_object,             # <<<<<<<<<<<<<<
 *                            int ndim, bint inc) nogil:
 * 
 */

static void __pyx_memoryview_refcount_copying(__Pyx_memviewslice *__pyx_v_dst, int __pyx_v_dtype_is_object, int __pyx_v_ndim, int __pyx_v_inc) {
  int __pyx_t_1;

  /* "View.MemoryView":1320
 * 
 * 
 *     if dtype_is_object:             # <<<<<<<<<<<<<<
 *         refcount_objects_in_slice_with_gil(dst.data, dst.shape,
 *                                            dst.strides, ndim, inc)
 */
  __pyx_t_1 = (__pyx_v_dtype_is_object != 0);
  if (__pyx_t_1) {

    /* "View.MemoryView":1321
 * 
 *     if dtype_is_object:
 *         refcount_objects_in_slice_with_gil(dst.data, dst.shape,             # <<<<<<<<<<<<<<
 *                                            dst.strides, ndim, inc)
 * 
 */
    __pyx_memoryview_refcount_objects_in_slice_with_gil(__pyx_v_dst->data, __pyx_v_dst->shape, __pyx_v_dst->strides, __pyx_v_ndim, __pyx_v_inc);
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "View.MemoryView":1316
 * 
 * @cname('__pyx_memoryview_refcount_copying')
 * cdef void refcount_copying(__Pyx_memviewslice *dst, bint dtype_is_object,             # <<<<<<<<<<<<<<
 *                            int ndim, bint inc) nogil:
 * 
 */

  /* function exit code */
}

/* "View.MemoryView":1325
 * 
 * @cname('__pyx_memoryview_refcount_objects_in_slice_with_gil')
 * cdef void refcount_objects_in_slice_with_gil(char *data, Py_ssize_t *shape,             # <<<<<<<<<<<<<<
 *                                              Py_ssize_t *strides, int ndim,
 *                                              bint inc) with gil:
 */

static void __pyx_memoryview_refcount_objects_in_slice_with_gil(char *__pyx_v_data, Py_ssize_t *__pyx_v_shape, Py_ssize_t *__pyx_v_strides, int __pyx_v_ndim, int __pyx_v_inc) {
  __Pyx_RefNannyDeclarations
  #ifdef WITH_THREAD
  PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
  #endif
  __Pyx_RefNannySetupContext("refcount_objects_in_slice_with_gil", 0);

  /* "View.MemoryView":1328
 *                                              Py_ssize_t *strides, int ndim,
 *                                              bint inc) with gil:
 *     refcount_objects_in_slice(data, shape, strides, ndim, inc)             # <<<<<<<<<<<<<<
 * 
 * @cname('__pyx_memoryview_refcount_objects_in_slice')
 */
  __pyx_memoryview_refcount_objects_in_slice(__pyx_v_data, __pyx_v_shape, __pyx_v_strides, __pyx_v_ndim, __pyx_v_inc);

  /* "View.MemoryView":1325
 * 
 * @cname('__pyx_memoryview_refcount_objects_in_slice_with_gil')
 * cdef void refcount_objects_in_slice_with_gil(char *data, Py_ssize_t *shape,             # <<<<<<<<<<<<<<
 *                                              Py_ssize_t *strides, int ndim,
 *                                              bint inc) with gil:
 */

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  #ifdef WITH_THREAD
  PyGILState_Release(__pyx_gilstate_save);
  #endif
}

/* "View.MemoryView":1331
 * 
 * @cname('__pyx_memoryview_refcount_objects_in_slice')
 * cdef void refcount_objects_in_slice(char *data, Py_ssize_t *shape,             # <<<<<<<<<<<<<<
 *                                     Py_ssize_t *strides, int ndim, bint inc):
 *     cdef Py_ssize_t i
 */

static void __pyx_memoryview_refcount_objects_in_slice(char *__pyx_v_data, Py_ssize_t *__pyx_v_shape, Py_ssize_t *__pyx_v_strides, int __pyx_v_ndim, int __pyx_v_inc) {
  CYTHON_UNUSED Py_ssize_t __pyx_v_i;
  __Pyx_RefNannyDeclarations
  Py_ssize_t __pyx_t_1;
  Py_ssize_t __pyx_t_2;
  int __pyx_t_3;
  __Pyx_RefNannySetupContext("refcount_objects_in_slice", 0);

  /* "View.MemoryView":1335
 *     cdef Py_ssize_t i
 * 
 *     for i in range(shape[0]):             # <<<<<<<<<<<<<<
 *         if ndim == 1:
 *             if inc:
 */
  __pyx_t_1 = (__pyx_v_shape[0]);
  for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) {
    __pyx_v_i = __pyx_t_2;

    /* "View.MemoryView":1336
 * 
 *     for i in range(shape[0]):
 *         if ndim == 1:             # <<<<<<<<<<<<<<
 *             if inc:
 *                 Py_INCREF((<PyObject **> data)[0])
 */
    __pyx_t_3 = ((__pyx_v_ndim == 1) != 0);
    if (__pyx_t_3) {

      /* "View.MemoryView":1337
 *     for i in range(shape[0]):
 *         if ndim == 1:
 *             if inc:             # <<<<<<<<<<<<<<
 *                 Py_INCREF((<PyObject **> data)[0])
 *             else:
 */
      __pyx_t_3 = (__pyx_v_inc != 0);
      if (__pyx_t_3) {

        /* "View.MemoryView":1338
 *         if ndim == 1:
 *             if inc:
 *                 Py_INCREF((<PyObject **> data)[0])             # <<<<<<<<<<<<<<
 *             else:
 *                 Py_DECREF((<PyObject **> data)[0])
 */
        Py_INCREF((((PyObject **)__pyx_v_data)[0]));
        goto __pyx_L6;
      }
      /*else*/ {

        /* "View.MemoryView":1340
 *                 Py_INCREF((<PyObject **> data)[0])
 *             else:
 *                 Py_DECREF((<PyObject **> data)[0])             # <<<<<<<<<<<<<<
 *         else:
 *             refcount_objects_in_slice(data, shape + 1, strides + 1,
 */
        Py_DECREF((((PyObject **)__pyx_v_data)[0]));
      }
      __pyx_L6:;
      goto __pyx_L5;
    }
    /*else*/ {

      /* "View.MemoryView":1342
 *                 Py_DECREF((<PyObject **> data)[0])
 *         else:
 *             refcount_objects_in_slice(data, shape + 1, strides + 1,             # <<<<<<<<<<<<<<
 *                                       ndim - 1, inc)
 * 
 */
      __pyx_memoryview_refcount_objects_in_slice(__pyx_v_data, (__pyx_v_shape + 1), (__pyx_v_strides + 1), (__pyx_v_ndim - 1), __pyx_v_inc);
    }
    __pyx_L5:;

    /* "View.MemoryView":1345
 *                                       ndim - 1, inc)
 * 
 *         data += strides[0]             # <<<<<<<<<<<<<<
 * 
 * 
 */
    __pyx_v_data = (__pyx_v_data + (__pyx_v_strides[0]));
  }

  /* "View.MemoryView":1331
 * 
 * @cname('__pyx_memoryview_refcount_objects_in_slice')
 * cdef void refcount_objects_in_slice(char *data, Py_ssize_t *shape,             # <<<<<<<<<<<<<<
 *                                     Py_ssize_t *strides, int ndim, bint inc):
 *     cdef Py_ssize_t i
 */

  /* function exit code */
  __Pyx_RefNannyFinishContext();
}

/* "View.MemoryView":1351
 * 
 * @cname('__pyx_memoryview_slice_assign_scalar')
 * cdef void slice_assign_scalar(__Pyx_memviewslice *dst, int ndim,             # <<<<<<<<<<<<<<
 *                               size_t itemsize, void *item,
 *                               bint dtype_is_object) nogil:
 */

static void __pyx_memoryview_slice_assign_scalar(__Pyx_memviewslice *__pyx_v_dst, int __pyx_v_ndim, size_t __pyx_v_itemsize, void *__pyx_v_item, int __pyx_v_dtype_is_object) {

  /* "View.MemoryView":1354
 *                               size_t itemsize, void *item,
 *                               bint dtype_is_object) nogil:
 *     refcount_copying(dst, dtype_is_object, ndim, False)             # <<<<<<<<<<<<<<
 *     _slice_assign_scalar(dst.data, dst.shape, dst.strides, ndim,
 *                          itemsize, item)
 */
  __pyx_memoryview_refcount_copying(__pyx_v_dst, __pyx_v_dtype_is_object, __pyx_v_ndim, 0);

  /* "View.MemoryView":1355
 *                               bint dtype_is_object) nogil:
 *     refcount_copying(dst, dtype_is_object, ndim, False)
 *     _slice_assign_scalar(dst.data, dst.shape, dst.strides, ndim,             # <<<<<<<<<<<<<<
 *                          itemsize, item)
 *     refcount_copying(dst, dtype_is_object, ndim, True)
 */
  __pyx_memoryview__slice_assign_scalar(__pyx_v_dst->data, __pyx_v_dst->shape, __pyx_v_dst->strides, __pyx_v_ndim, __pyx_v_itemsize, __pyx_v_item);

  /* "View.MemoryView":1357
 *     _slice_assign_scalar(dst.data, dst.shape, dst.strides, ndim,
 *                          itemsize, item)
 *     refcount_copying(dst, dtype_is_object, ndim, True)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_memoryview_refcount_copying(__pyx_v_dst, __pyx_v_dtype_is_object, __pyx_v_ndim, 1);

  /* "View.MemoryView":1351
 * 
 * @cname('__pyx_memoryview_slice_assign_scalar')
 * cdef void slice_assign_scalar(__Pyx_memviewslice *dst, int ndim,             # <<<<<<<<<<<<<<
 *                               size_t itemsize, void *item,
 *                               bint dtype_is_object) nogil:
 */

  /* function exit code */
}

/* "View.MemoryView":1361
 * 
 * @cname('__pyx_memoryview__slice_assign_scalar')
 * cdef void _slice_assign_scalar(char *data, Py_ssize_t *shape,             # <<<<<<<<<<<<<<
 *                               Py_ssize_t *strides, int ndim,
 *                               size_t itemsize, void *item) nogil:
 */

static void __pyx_memoryview__slice_assign_scalar(char *__pyx_v_data, Py_ssize_t *__pyx_v_shape, Py_ssize_t *__pyx_v_strides, int __pyx_v_ndim, size_t __pyx_v_itemsize, void *__pyx_v_item) {
  CYTHON_UNUSED Py_ssize_t __pyx_v_i;
  Py_ssize_t __pyx_v_stride;
  Py_ssize_t __pyx_v_extent;
  int __pyx_t_1;
  Py_ssize_t __pyx_t_2;
  Py_ssize_t __pyx_t_3;

  /* "View.MemoryView":1365
 *                               size_t itemsize, void *item) nogil:
 *     cdef Py_ssize_t i
 *     cdef Py_ssize_t stride = strides[0]             # <<<<<<<<<<<<<<
 *     cdef Py_ssize_t extent = shape[0]
 * 
 */
  __pyx_v_stride = (__pyx_v_strides[0]);

  /* "View.MemoryView":1366
 *     cdef Py_ssize_t i
 *     cdef Py_ssize_t stride = strides[0]
 *     cdef Py_ssize_t extent = shape[0]             # <<<<<<<<<<<<<<
 * 
 *     if ndim == 1:
 */
  __pyx_v_extent = (__pyx_v_shape[0]);

  /* "View.MemoryView":1368
 *     cdef Py_ssize_t extent = shape[0]
 * 
 *     if ndim == 1:             # <<<<<<<<<<<<<<
 *         for i in range(extent):
 *             memcpy(data, item, itemsize)
 */
  __pyx_t_1 = ((__pyx_v_ndim == 1) != 0);
  if (__pyx_t_1) {

    /* "View.MemoryView":1369
 * 
 *     if ndim == 1:
 *         for i in range(extent):             # <<<<<<<<<<<<<<
 *             memcpy(data, item, itemsize)
 *             data += stride
 */
    __pyx_t_2 = __pyx_v_extent;
    for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
      __pyx_v_i = __pyx_t_3;

      /* "View.MemoryView":1370
 *     if ndim == 1:
 *         for i in range(extent):
 *             memcpy(data, item, itemsize)             # <<<<<<<<<<<<<<
 *             data += stride
 *     else:
 */
      memcpy(__pyx_v_data, __pyx_v_item, __pyx_v_itemsize);

      /* "View.MemoryView":1371
 *         for i in range(extent):
 *             memcpy(data, item, itemsize)
 *             data += stride             # <<<<<<<<<<<<<<
 *     else:
 *         for i in range(extent):
 */
      __pyx_v_data = (__pyx_v_data + __pyx_v_stride);
    }
    goto __pyx_L3;
  }
  /*else*/ {

    /* "View.MemoryView":1373
 *             data += stride
 *     else:
 *         for i in range(extent):             # <<<<<<<<<<<<<<
 *             _slice_assign_scalar(data, shape + 1, strides + 1,
 *                                 ndim - 1, itemsize, item)
 */
    __pyx_t_2 = __pyx_v_extent;
    for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
      __pyx_v_i = __pyx_t_3;

      /* "View.MemoryView":1374
 *     else:
 *         for i in range(extent):
 *             _slice_assign_scalar(data, shape + 1, strides + 1,             # <<<<<<<<<<<<<<
 *                                 ndim - 1, itemsize, item)
 *             data += stride
 */
      __pyx_memoryview__slice_assign_scalar(__pyx_v_data, (__pyx_v_shape + 1), (__pyx_v_strides + 1), (__pyx_v_ndim - 1), __pyx_v_itemsize, __pyx_v_item);

      /* "View.MemoryView":1376
 *             _slice_assign_scalar(data, shape + 1, strides + 1,
 *                                 ndim - 1, itemsize, item)
 *             data += stride             # <<<<<<<<<<<<<<
 * 
 * 
 */
      __pyx_v_data = (__pyx_v_data + __pyx_v_stride);
    }
  }
  __pyx_L3:;

  /* "View.MemoryView":1361
 * 
 * @cname('__pyx_memoryview__slice_assign_scalar')
 * cdef void _slice_assign_scalar(char *data, Py_ssize_t *shape,             # <<<<<<<<<<<<<<
 *                               Py_ssize_t *strides, int ndim,
 *                               size_t itemsize, void *item) nogil:
 */

  /* function exit code */
}

static PyObject *__pyx_tp_new_6pandas_5algos_Node(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  struct __pyx_obj_6pandas_5algos_Node *p;
  PyObject *o;
  if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
    o = (*t->tp_alloc)(t, 0);
  } else {
    o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
  }
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_6pandas_5algos_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_5algos_Node(PyObject *o) {
  struct __pyx_obj_6pandas_5algos_Node *p = (struct __pyx_obj_6pandas_5algos_Node *)o;
  #if PY_VERSION_HEX >= 0x030400a1
  if (unlikely(Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
    if (PyObject_CallFinalizerFromDealloc(o)) return;
  }
  #endif
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->next);
  Py_CLEAR(p->width);
  (*Py_TYPE(o)->tp_free)(o);
}

static int __pyx_tp_traverse_6pandas_5algos_Node(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_6pandas_5algos_Node *p = (struct __pyx_obj_6pandas_5algos_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_5algos_Node(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_6pandas_5algos_Node *p = (struct __pyx_obj_6pandas_5algos_Node *)o;
  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_5algos_4Node_value(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6pandas_5algos_4Node_5value_1__get__(o);
}

static int __pyx_setprop_6pandas_5algos_4Node_value(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_6pandas_5algos_4Node_5value_3__set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyObject *__pyx_getprop_6pandas_5algos_4Node_next(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6pandas_5algos_4Node_4next_1__get__(o);
}

static int __pyx_setprop_6pandas_5algos_4Node_next(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_6pandas_5algos_4Node_4next_3__set__(o, v);
  }
  else {
    return __pyx_pw_6pandas_5algos_4Node_4next_5__del__(o);
  }
}

static PyObject *__pyx_getprop_6pandas_5algos_4Node_width(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6pandas_5algos_4Node_5width_1__get__(o);
}

static int __pyx_setprop_6pandas_5algos_4Node_width(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_6pandas_5algos_4Node_5width_3__set__(o, v);
  }
  else {
    return __pyx_pw_6pandas_5algos_4Node_5width_5__del__(o);
  }
}

static PyMethodDef __pyx_methods_6pandas_5algos_Node[] = {
  {0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_6pandas_5algos_Node[] = {
  {(char *)"value", __pyx_getprop_6pandas_5algos_4Node_value, __pyx_setprop_6pandas_5algos_4Node_value, 0, 0},
  {(char *)"next", __pyx_getprop_6pandas_5algos_4Node_next, __pyx_setprop_6pandas_5algos_4Node_next, 0, 0},
  {(char *)"width", __pyx_getprop_6pandas_5algos_4Node_width, __pyx_setprop_6pandas_5algos_4Node_width, 0, 0},
  {0, 0, 0, 0, 0}
};

static PyTypeObject __pyx_type_6pandas_5algos_Node = {
  PyVarObject_HEAD_INIT(0, 0)
  __Pyx_NAMESTR("pandas.algos.Node"), /*tp_name*/
  sizeof(struct __pyx_obj_6pandas_5algos_Node), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_6pandas_5algos_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*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_6pandas_5algos_Node, /*tp_traverse*/
  __pyx_tp_clear_6pandas_5algos_Node, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_6pandas_5algos_Node, /*tp_methods*/
  0, /*tp_members*/
  __pyx_getsets_6pandas_5algos_Node, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  __pyx_pw_6pandas_5algos_4Node_1__init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_6pandas_5algos_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
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
};
static struct __pyx_vtabstruct_6pandas_5algos_IndexableSkiplist __pyx_vtable_6pandas_5algos_IndexableSkiplist;

static PyObject *__pyx_tp_new_6pandas_5algos_IndexableSkiplist(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  struct __pyx_obj_6pandas_5algos_IndexableSkiplist *p;
  PyObject *o;
  if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
    o = (*t->tp_alloc)(t, 0);
  } else {
    o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
  }
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_6pandas_5algos_IndexableSkiplist *)o);
  p->__pyx_vtab = __pyx_vtabptr_6pandas_5algos_IndexableSkiplist;
  p->head = ((struct __pyx_obj_6pandas_5algos_Node *)Py_None); Py_INCREF(Py_None);
  return o;
}

static void __pyx_tp_dealloc_6pandas_5algos_IndexableSkiplist(PyObject *o) {
  struct __pyx_obj_6pandas_5algos_IndexableSkiplist *p = (struct __pyx_obj_6pandas_5algos_IndexableSkiplist *)o;
  #if PY_VERSION_HEX >= 0x030400a1
  if (unlikely(Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
    if (PyObject_CallFinalizerFromDealloc(o)) return;
  }
  #endif
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->head);
  (*Py_TYPE(o)->tp_free)(o);
}

static int __pyx_tp_traverse_6pandas_5algos_IndexableSkiplist(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_6pandas_5algos_IndexableSkiplist *p = (struct __pyx_obj_6pandas_5algos_IndexableSkiplist *)o;
  if (p->head) {
    e = (*v)(((PyObject*)p->head), a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_6pandas_5algos_IndexableSkiplist(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_6pandas_5algos_IndexableSkiplist *p = (struct __pyx_obj_6pandas_5algos_IndexableSkiplist *)o;
  tmp = ((PyObject*)p->head);
  p->head = ((struct __pyx_obj_6pandas_5algos_Node *)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}
static PyObject *__pyx_sq_item_6pandas_5algos_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_5algos_IndexableSkiplist[] = {
  {__Pyx_NAMESTR("get"), (PyCFunction)__pyx_pw_6pandas_5algos_17IndexableSkiplist_7get, METH_O, __Pyx_DOCSTR(0)},
  {__Pyx_NAMESTR("insert"), (PyCFunction)__pyx_pw_6pandas_5algos_17IndexableSkiplist_9insert, METH_O, __Pyx_DOCSTR(0)},
  {__Pyx_NAMESTR("remove"), (PyCFunction)__pyx_pw_6pandas_5algos_17IndexableSkiplist_11remove, METH_O, __Pyx_DOCSTR(0)},
  {0, 0, 0, 0}
};

static PySequenceMethods __pyx_tp_as_sequence_IndexableSkiplist = {
  __pyx_pw_6pandas_5algos_17IndexableSkiplist_3__len__, /*sq_length*/
  0, /*sq_concat*/
  0, /*sq_repeat*/
  __pyx_sq_item_6pandas_5algos_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_pw_6pandas_5algos_17IndexableSkiplist_3__len__, /*mp_length*/
  __pyx_pw_6pandas_5algos_17IndexableSkiplist_5__getitem__, /*mp_subscript*/
  0, /*mp_ass_subscript*/
};

static PyTypeObject __pyx_type_6pandas_5algos_IndexableSkiplist = {
  PyVarObject_HEAD_INIT(0, 0)
  __Pyx_NAMESTR("pandas.algos.IndexableSkiplist"), /*tp_name*/
  sizeof(struct __pyx_obj_6pandas_5algos_IndexableSkiplist), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_6pandas_5algos_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*/
  0, /*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*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|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_5algos_IndexableSkiplist, /*tp_traverse*/
  __pyx_tp_clear_6pandas_5algos_IndexableSkiplist, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_6pandas_5algos_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_pw_6pandas_5algos_17IndexableSkiplist_1__init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_6pandas_5algos_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
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
};

static PyObject *__pyx_tp_new_array(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_array_obj *p;
  PyObject *o;
  if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
    o = (*t->tp_alloc)(t, 0);
  } else {
    o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
  }
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_array_obj *)o);
  p->mode = ((PyObject*)Py_None); Py_INCREF(Py_None);
  p->_format = ((PyObject*)Py_None); Py_INCREF(Py_None);
  if (unlikely(__pyx_array___cinit__(o, a, k) < 0)) {
    Py_DECREF(o); o = 0;
  }
  return o;
}

static void __pyx_tp_dealloc_array(PyObject *o) {
  struct __pyx_array_obj *p = (struct __pyx_array_obj *)o;
  #if PY_VERSION_HEX >= 0x030400a1
  if (unlikely(Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !_PyGC_FINALIZED(o))) {
    if (PyObject_CallFinalizerFromDealloc(o)) return;
  }
  #endif
  {
    PyObject *etype, *eval, *etb;
    PyErr_Fetch(&etype, &eval, &etb);
    ++Py_REFCNT(o);
    __pyx_array___dealloc__(o);
    --Py_REFCNT(o);
    PyErr_Restore(etype, eval, etb);
  }
  Py_CLEAR(p->mode);
  Py_CLEAR(p->_format);
  (*Py_TYPE(o)->tp_free)(o);
}
static PyObject *__pyx_sq_item_array(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 int __pyx_mp_ass_subscript_array(PyObject *o, PyObject *i, PyObject *v) {
  if (v) {
    return __pyx_array___setitem__(o, i, v);
  }
  else {
    PyErr_Format(PyExc_NotImplementedError,
      "Subscript deletion not supported by %.200s", Py_TYPE(o)->tp_name);
    return -1;
  }
}

static PyObject *__pyx_tp_getattro_array(PyObject *o, PyObject *n) {
  PyObject *v = PyObject_GenericGetAttr(o, n);
  if (!v && PyErr_ExceptionMatches(PyExc_AttributeError)) {
    PyErr_Clear();
    v = __pyx_array___getattr__(o, n);
  }
  return v;
}

static PyObject *__pyx_getprop___pyx_array_memview(PyObject *o, CYTHON_UNUSED void *x) {
  return get_memview(o);
}

static PyMethodDef __pyx_methods_array[] = {
  {__Pyx_NAMESTR("__getattr__"), (PyCFunction)__pyx_array___getattr__, METH_O|METH_COEXIST, __Pyx_DOCSTR(0)},
  {0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_array[] = {
  {(char *)"memview", __pyx_getprop___pyx_array_memview, 0, 0, 0},
  {0, 0, 0, 0, 0}
};

static PySequenceMethods __pyx_tp_as_sequence_array = {
  0, /*sq_length*/
  0, /*sq_concat*/
  0, /*sq_repeat*/
  __pyx_sq_item_array, /*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_array = {
  0, /*mp_length*/
  __pyx_array___getitem__, /*mp_subscript*/
  __pyx_mp_ass_subscript_array, /*mp_ass_subscript*/
};

static PyBufferProcs __pyx_tp_as_buffer_array = {
  #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
  __pyx_array_getbuffer, /*bf_getbuffer*/
  #endif
  #if PY_VERSION_HEX >= 0x02060000
  0, /*bf_releasebuffer*/
  #endif
};

static PyTypeObject __pyx_type___pyx_array = {
  PyVarObject_HEAD_INIT(0, 0)
  __Pyx_NAMESTR("pandas.algos.array"), /*tp_name*/
  sizeof(struct __pyx_array_obj), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_array, /*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*/
  0, /*tp_as_number*/
  &__pyx_tp_as_sequence_array, /*tp_as_sequence*/
  &__pyx_tp_as_mapping_array, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  __pyx_tp_getattro_array, /*tp_getattro*/
  0, /*tp_setattro*/
  &__pyx_tp_as_buffer_array, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|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_array, /*tp_methods*/
  0, /*tp_members*/
  __pyx_getsets_array, /*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_array, /*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
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
};

static PyObject *__pyx_tp_new_Enum(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  struct __pyx_MemviewEnum_obj *p;
  PyObject *o;
  if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
    o = (*t->tp_alloc)(t, 0);
  } else {
    o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
  }
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_MemviewEnum_obj *)o);
  p->name = Py_None; Py_INCREF(Py_None);
  return o;
}

static void __pyx_tp_dealloc_Enum(PyObject *o) {
  struct __pyx_MemviewEnum_obj *p = (struct __pyx_MemviewEnum_obj *)o;
  #if PY_VERSION_HEX >= 0x030400a1
  if (unlikely(Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
    if (PyObject_CallFinalizerFromDealloc(o)) return;
  }
  #endif
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->name);
  (*Py_TYPE(o)->tp_free)(o);
}

static int __pyx_tp_traverse_Enum(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_MemviewEnum_obj *p = (struct __pyx_MemviewEnum_obj *)o;
  if (p->name) {
    e = (*v)(p->name, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_Enum(PyObject *o) {
  PyObject* tmp;
  struct __pyx_MemviewEnum_obj *p = (struct __pyx_MemviewEnum_obj *)o;
  tmp = ((PyObject*)p->name);
  p->name = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyMethodDef __pyx_methods_Enum[] = {
  {0, 0, 0, 0}
};

static PyTypeObject __pyx_type___pyx_MemviewEnum = {
  PyVarObject_HEAD_INIT(0, 0)
  __Pyx_NAMESTR("pandas.algos.Enum"), /*tp_name*/
  sizeof(struct __pyx_MemviewEnum_obj), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_Enum, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #else
  0, /*reserved*/
  #endif
  __pyx_MemviewEnum___repr__, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_Enum, /*tp_traverse*/
  __pyx_tp_clear_Enum, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_Enum, /*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_MemviewEnum___init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_Enum, /*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
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
};
static struct __pyx_vtabstruct_memoryview __pyx_vtable_memoryview;

static PyObject *__pyx_tp_new_memoryview(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_memoryview_obj *p;
  PyObject *o;
  if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
    o = (*t->tp_alloc)(t, 0);
  } else {
    o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
  }
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_memoryview_obj *)o);
  p->__pyx_vtab = __pyx_vtabptr_memoryview;
  p->obj = Py_None; Py_INCREF(Py_None);
  p->_size = Py_None; Py_INCREF(Py_None);
  p->_array_interface = Py_None; Py_INCREF(Py_None);
  p->view.obj = NULL;
  if (unlikely(__pyx_memoryview___cinit__(o, a, k) < 0)) {
    Py_DECREF(o); o = 0;
  }
  return o;
}

static void __pyx_tp_dealloc_memoryview(PyObject *o) {
  struct __pyx_memoryview_obj *p = (struct __pyx_memoryview_obj *)o;
  #if PY_VERSION_HEX >= 0x030400a1
  if (unlikely(Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
    if (PyObject_CallFinalizerFromDealloc(o)) return;
  }
  #endif
  PyObject_GC_UnTrack(o);
  {
    PyObject *etype, *eval, *etb;
    PyErr_Fetch(&etype, &eval, &etb);
    ++Py_REFCNT(o);
    __pyx_memoryview___dealloc__(o);
    --Py_REFCNT(o);
    PyErr_Restore(etype, eval, etb);
  }
  Py_CLEAR(p->obj);
  Py_CLEAR(p->_size);
  Py_CLEAR(p->_array_interface);
  (*Py_TYPE(o)->tp_free)(o);
}

static int __pyx_tp_traverse_memoryview(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_memoryview_obj *p = (struct __pyx_memoryview_obj *)o;
  if (p->obj) {
    e = (*v)(p->obj, a); if (e) return e;
  }
  if (p->_size) {
    e = (*v)(p->_size, a); if (e) return e;
  }
  if (p->_array_interface) {
    e = (*v)(p->_array_interface, a); if (e) return e;
  }
  if (p->view.obj) {
    e = (*v)(p->view.obj, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_memoryview(PyObject *o) {
  PyObject* tmp;
  struct __pyx_memoryview_obj *p = (struct __pyx_memoryview_obj *)o;
  tmp = ((PyObject*)p->obj);
  p->obj = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->_size);
  p->_size = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->_array_interface);
  p->_array_interface = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  Py_CLEAR(p->view.obj);
  return 0;
}
static PyObject *__pyx_sq_item_memoryview(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 int __pyx_mp_ass_subscript_memoryview(PyObject *o, PyObject *i, PyObject *v) {
  if (v) {
    return __pyx_memoryview___setitem__(o, i, v);
  }
  else {
    PyErr_Format(PyExc_NotImplementedError,
      "Subscript deletion not supported by %.200s", Py_TYPE(o)->tp_name);
    return -1;
  }
}

static PyObject *__pyx_getprop___pyx_memoryview_T(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_memoryview_transpose(o);
}

static PyObject *__pyx_getprop___pyx_memoryview_base(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_memoryview__get__base(o);
}

static PyObject *__pyx_getprop___pyx_memoryview_shape(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_memoryview_get_shape(o);
}

static PyObject *__pyx_getprop___pyx_memoryview_strides(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_memoryview_get_strides(o);
}

static PyObject *__pyx_getprop___pyx_memoryview_suboffsets(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_memoryview_get_suboffsets(o);
}

static PyObject *__pyx_getprop___pyx_memoryview_ndim(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_memoryview_get_ndim(o);
}

static PyObject *__pyx_getprop___pyx_memoryview_itemsize(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_memoryview_get_itemsize(o);
}

static PyObject *__pyx_getprop___pyx_memoryview_nbytes(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_memoryview_get_nbytes(o);
}

static PyObject *__pyx_getprop___pyx_memoryview_size(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_memoryview_get_size(o);
}

static PyMethodDef __pyx_methods_memoryview[] = {
  {__Pyx_NAMESTR("is_c_contig"), (PyCFunction)__pyx_memoryview_is_c_contig, METH_NOARGS, __Pyx_DOCSTR(0)},
  {__Pyx_NAMESTR("is_f_contig"), (PyCFunction)__pyx_memoryview_is_f_contig, METH_NOARGS, __Pyx_DOCSTR(0)},
  {__Pyx_NAMESTR("copy"), (PyCFunction)__pyx_memoryview_copy, METH_NOARGS, __Pyx_DOCSTR(0)},
  {__Pyx_NAMESTR("copy_fortran"), (PyCFunction)__pyx_memoryview_copy_fortran, METH_NOARGS, __Pyx_DOCSTR(0)},
  {0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_memoryview[] = {
  {(char *)"T", __pyx_getprop___pyx_memoryview_T, 0, 0, 0},
  {(char *)"base", __pyx_getprop___pyx_memoryview_base, 0, 0, 0},
  {(char *)"shape", __pyx_getprop___pyx_memoryview_shape, 0, 0, 0},
  {(char *)"strides", __pyx_getprop___pyx_memoryview_strides, 0, 0, 0},
  {(char *)"suboffsets", __pyx_getprop___pyx_memoryview_suboffsets, 0, 0, 0},
  {(char *)"ndim", __pyx_getprop___pyx_memoryview_ndim, 0, 0, 0},
  {(char *)"itemsize", __pyx_getprop___pyx_memoryview_itemsize, 0, 0, 0},
  {(char *)"nbytes", __pyx_getprop___pyx_memoryview_nbytes, 0, 0, 0},
  {(char *)"size", __pyx_getprop___pyx_memoryview_size, 0, 0, 0},
  {0, 0, 0, 0, 0}
};

static PySequenceMethods __pyx_tp_as_sequence_memoryview = {
  __pyx_memoryview___len__, /*sq_length*/
  0, /*sq_concat*/
  0, /*sq_repeat*/
  __pyx_sq_item_memoryview, /*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_memoryview = {
  __pyx_memoryview___len__, /*mp_length*/
  __pyx_memoryview___getitem__, /*mp_subscript*/
  __pyx_mp_ass_subscript_memoryview, /*mp_ass_subscript*/
};

static PyBufferProcs __pyx_tp_as_buffer_memoryview = {
  #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
  __pyx_memoryview_getbuffer, /*bf_getbuffer*/
  #endif
  #if PY_VERSION_HEX >= 0x02060000
  0, /*bf_releasebuffer*/
  #endif
};

static PyTypeObject __pyx_type___pyx_memoryview = {
  PyVarObject_HEAD_INIT(0, 0)
  __Pyx_NAMESTR("pandas.algos.memoryview"), /*tp_name*/
  sizeof(struct __pyx_memoryview_obj), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_memoryview, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #else
  0, /*reserved*/
  #endif
  __pyx_memoryview___repr__, /*tp_repr*/
  0, /*tp_as_number*/
  &__pyx_tp_as_sequence_memoryview, /*tp_as_sequence*/
  &__pyx_tp_as_mapping_memoryview, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  __pyx_memoryview___str__, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  &__pyx_tp_as_buffer_memoryview, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_memoryview, /*tp_traverse*/
  __pyx_tp_clear_memoryview, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_memoryview, /*tp_methods*/
  0, /*tp_members*/
  __pyx_getsets_memoryview, /*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_memoryview, /*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
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
};
static struct __pyx_vtabstruct__memoryviewslice __pyx_vtable__memoryviewslice;

static PyObject *__pyx_tp_new__memoryviewslice(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_memoryviewslice_obj *p;
  PyObject *o = __pyx_tp_new_memoryview(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_memoryviewslice_obj *)o);
  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_memoryview*)__pyx_vtabptr__memoryviewslice;
  p->from_object = Py_None; Py_INCREF(Py_None);
  p->from_slice.memview = NULL;
  return o;
}

static void __pyx_tp_dealloc__memoryviewslice(PyObject *o) {
  struct __pyx_memoryviewslice_obj *p = (struct __pyx_memoryviewslice_obj *)o;
  #if PY_VERSION_HEX >= 0x030400a1
  if (unlikely(Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
    if (PyObject_CallFinalizerFromDealloc(o)) return;
  }
  #endif
  PyObject_GC_UnTrack(o);
  {
    PyObject *etype, *eval, *etb;
    PyErr_Fetch(&etype, &eval, &etb);
    ++Py_REFCNT(o);
    __pyx_memoryviewslice___dealloc__(o);
    --Py_REFCNT(o);
    PyErr_Restore(etype, eval, etb);
  }
  Py_CLEAR(p->from_object);
  PyObject_GC_Track(o);
  __pyx_tp_dealloc_memoryview(o);
}

static int __pyx_tp_traverse__memoryviewslice(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_memoryviewslice_obj *p = (struct __pyx_memoryviewslice_obj *)o;
  e = __pyx_tp_traverse_memoryview(o, v, a); if (e) return e;
  if (p->from_object) {
    e = (*v)(p->from_object, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear__memoryviewslice(PyObject *o) {
  PyObject* tmp;
  struct __pyx_memoryviewslice_obj *p = (struct __pyx_memoryviewslice_obj *)o;
  __pyx_tp_clear_memoryview(o);
  tmp = ((PyObject*)p->from_object);
  p->from_object = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  __PYX_XDEC_MEMVIEW(&p->from_slice, 1);
  return 0;
}

static PyObject *__pyx_getprop___pyx_memoryviewslice_base(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_memoryviewslice__get__base(o);
}

static PyMethodDef __pyx_methods__memoryviewslice[] = {
  {0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets__memoryviewslice[] = {
  {(char *)"base", __pyx_getprop___pyx_memoryviewslice_base, 0, 0, 0},
  {0, 0, 0, 0, 0}
};

static PyTypeObject __pyx_type___pyx_memoryviewslice = {
  PyVarObject_HEAD_INIT(0, 0)
  __Pyx_NAMESTR("pandas.algos._memoryviewslice"), /*tp_name*/
  sizeof(struct __pyx_memoryviewslice_obj), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc__memoryviewslice, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #else
  0, /*reserved*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_memoryview___repr__, /*tp_repr*/
  #else
  0, /*tp_repr*/
  #endif
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_memoryview___str__, /*tp_str*/
  #else
  0, /*tp_str*/
  #endif
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  __Pyx_DOCSTR("Internal class for passing memoryview slices to Python"), /*tp_doc*/
  __pyx_tp_traverse__memoryviewslice, /*tp_traverse*/
  __pyx_tp_clear__memoryviewslice, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods__memoryviewslice, /*tp_methods*/
  0, /*tp_members*/
  __pyx_getsets__memoryviewslice, /*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__memoryviewslice, /*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
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
};

static PyMethodDef __pyx_methods[] = {
  {__Pyx_NAMESTR("ensure_platform_int"), (PyCFunction)__pyx_pw_6pandas_5algos_87ensure_platform_int, METH_O, __Pyx_DOCSTR(0)},
  {__Pyx_NAMESTR("ensure_float64"), (PyCFunction)__pyx_pw_6pandas_5algos_89ensure_float64, METH_O, __Pyx_DOCSTR(0)},
  {__Pyx_NAMESTR("ensure_float32"), (PyCFunction)__pyx_pw_6pandas_5algos_91ensure_float32, METH_O, __Pyx_DOCSTR(0)},
  {__Pyx_NAMESTR("ensure_int8"), (PyCFunction)__pyx_pw_6pandas_5algos_93ensure_int8, METH_O, __Pyx_DOCSTR(0)},
  {__Pyx_NAMESTR("ensure_int16"), (PyCFunction)__pyx_pw_6pandas_5algos_95ensure_int16, METH_O, __Pyx_DOCSTR(0)},
  {__Pyx_NAMESTR("ensure_int32"), (PyCFunction)__pyx_pw_6pandas_5algos_97ensure_int32, METH_O, __Pyx_DOCSTR(0)},
  {__Pyx_NAMESTR("ensure_int64"), (PyCFunction)__pyx_pw_6pandas_5algos_99ensure_int64, METH_O, __Pyx_DOCSTR(0)},
  {__Pyx_NAMESTR("ensure_object"), (PyCFunction)__pyx_pw_6pandas_5algos_101ensure_object, METH_O, __Pyx_DOCSTR(0)},
  {__Pyx_NAMESTR("map_indices_float64"), (PyCFunction)__pyx_pw_6pandas_5algos_103map_indices_float64, METH_O, __Pyx_DOCSTR(__pyx_doc_6pandas_5algos_102map_indices_float64)},
  {__Pyx_NAMESTR("map_indices_float32"), (PyCFunction)__pyx_pw_6pandas_5algos_105map_indices_float32, METH_O, __Pyx_DOCSTR(__pyx_doc_6pandas_5algos_104map_indices_float32)},
  {__Pyx_NAMESTR("map_indices_object"), (PyCFunction)__pyx_pw_6pandas_5algos_107map_indices_object, METH_O, __Pyx_DOCSTR(__pyx_doc_6pandas_5algos_106map_indices_object)},
  {__Pyx_NAMESTR("map_indices_int32"), (PyCFunction)__pyx_pw_6pandas_5algos_109map_indices_int32, METH_O, __Pyx_DOCSTR(__pyx_doc_6pandas_5algos_108map_indices_int32)},
  {__Pyx_NAMESTR("map_indices_int64"), (PyCFunction)__pyx_pw_6pandas_5algos_111map_indices_int64, METH_O, __Pyx_DOCSTR(__pyx_doc_6pandas_5algos_110map_indices_int64)},
  {__Pyx_NAMESTR("map_indices_bool"), (PyCFunction)__pyx_pw_6pandas_5algos_113map_indices_bool, METH_O, __Pyx_DOCSTR(__pyx_doc_6pandas_5algos_112map_indices_bool)},
  {0, 0, 0, 0}
};

#if PY_MAJOR_VERSION >= 3
static struct PyModuleDef __pyx_moduledef = {
  #if PY_VERSION_HEX < 0x03020000
    { PyObject_HEAD_INIT(NULL) NULL, 0, NULL },
  #else
    PyModuleDef_HEAD_INIT,
  #endif
    __Pyx_NAMESTR("algos"),
    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_n_s_A, __pyx_k_A, sizeof(__pyx_k_A), 0, 0, 1, 1},
  {&__pyx_n_s_AssertionError, __pyx_k_AssertionError, sizeof(__pyx_k_AssertionError), 0, 0, 1, 1},
  {&__pyx_n_s_B, __pyx_k_B, sizeof(__pyx_k_B), 0, 0, 1, 1},
  {&__pyx_kp_s_Buffer_view_does_not_expose_stri, __pyx_k_Buffer_view_does_not_expose_stri, sizeof(__pyx_k_Buffer_view_does_not_expose_stri), 0, 0, 1, 0},
  {&__pyx_n_s_C, __pyx_k_C, sizeof(__pyx_k_C), 0, 0, 1, 1},
  {&__pyx_kp_s_Can_only_create_a_buffer_that_is, __pyx_k_Can_only_create_a_buffer_that_is, sizeof(__pyx_k_Can_only_create_a_buffer_that_is), 0, 0, 1, 0},
  {&__pyx_kp_s_Cannot_index_with_type_s, __pyx_k_Cannot_index_with_type_s, sizeof(__pyx_k_Cannot_index_with_type_s), 0, 0, 1, 0},
  {&__pyx_n_s_D, __pyx_k_D, sizeof(__pyx_k_D), 0, 0, 1, 1},
  {&__pyx_n_s_Ellipsis, __pyx_k_Ellipsis, sizeof(__pyx_k_Ellipsis), 0, 0, 1, 1},
  {&__pyx_kp_s_Empty_shape_tuple_for_cython_arr, __pyx_k_Empty_shape_tuple_for_cython_arr, sizeof(__pyx_k_Empty_shape_tuple_for_cython_arr), 0, 0, 1, 0},
  {&__pyx_kp_s_Expected_at_least_d_arguments, __pyx_k_Expected_at_least_d_arguments, sizeof(__pyx_k_Expected_at_least_d_arguments), 0, 0, 1, 0},
  {&__pyx_kp_u_Format_string_allocated_too_shor, __pyx_k_Format_string_allocated_too_shor, sizeof(__pyx_k_Format_string_allocated_too_shor), 0, 1, 0, 0},
  {&__pyx_kp_u_Format_string_allocated_too_shor_2, __pyx_k_Format_string_allocated_too_shor_2, sizeof(__pyx_k_Format_string_allocated_too_shor_2), 0, 1, 0, 0},
  {&__pyx_kp_s_Function_call_with_ambiguous_arg, __pyx_k_Function_call_with_ambiguous_arg, sizeof(__pyx_k_Function_call_with_ambiguous_arg), 0, 0, 1, 0},
  {&__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_kp_s_Indirect_dimensions_not_supporte, __pyx_k_Indirect_dimensions_not_supporte, sizeof(__pyx_k_Indirect_dimensions_not_supporte), 0, 0, 1, 0},
  {&__pyx_n_s_Infinity, __pyx_k_Infinity, sizeof(__pyx_k_Infinity), 0, 0, 1, 1},
  {&__pyx_kp_s_Invalid_min_periods_size_d_great, __pyx_k_Invalid_min_periods_size_d_great, sizeof(__pyx_k_Invalid_min_periods_size_d_great), 0, 0, 1, 0},
  {&__pyx_kp_s_Invalid_mode_expected_c_or_fortr, __pyx_k_Invalid_mode_expected_c_or_fortr, sizeof(__pyx_k_Invalid_mode_expected_c_or_fortr), 0, 0, 1, 0},
  {&__pyx_kp_s_Invalid_shape_in_axis_d_d, __pyx_k_Invalid_shape_in_axis_d_d, sizeof(__pyx_k_Invalid_shape_in_axis_d_d), 0, 0, 1, 0},
  {&__pyx_kp_s_Invalid_window_size_d, __pyx_k_Invalid_window_size_d, sizeof(__pyx_k_Invalid_window_size_d), 0, 0, 1, 0},
  {&__pyx_n_s_K, __pyx_k_K, sizeof(__pyx_k_K), 0, 0, 1, 1},
  {&__pyx_n_s_KeyError, __pyx_k_KeyError, sizeof(__pyx_k_KeyError), 0, 0, 1, 1},
  {&__pyx_kp_s_Limit_must_be_non_negative, __pyx_k_Limit_must_be_non_negative, sizeof(__pyx_k_Limit_must_be_non_negative), 0, 0, 1, 0},
  {&__pyx_n_s_MemoryError, __pyx_k_MemoryError, sizeof(__pyx_k_MemoryError), 0, 0, 1, 1},
  {&__pyx_kp_s_MemoryView_of_r_at_0x_x, __pyx_k_MemoryView_of_r_at_0x_x, sizeof(__pyx_k_MemoryView_of_r_at_0x_x), 0, 0, 1, 0},
  {&__pyx_kp_s_MemoryView_of_r_object, __pyx_k_MemoryView_of_r_object, sizeof(__pyx_k_MemoryView_of_r_object), 0, 0, 1, 0},
  {&__pyx_n_s_N, __pyx_k_N, sizeof(__pyx_k_N), 0, 0, 1, 1},
  {&__pyx_n_s_NA, __pyx_k_NA, sizeof(__pyx_k_NA), 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_NegInfinity, __pyx_k_NegInfinity, sizeof(__pyx_k_NegInfinity), 0, 0, 1, 1},
  {&__pyx_kp_s_No_matching_signature_found, __pyx_k_No_matching_signature_found, sizeof(__pyx_k_No_matching_signature_found), 0, 0, 1, 0},
  {&__pyx_kp_u_Non_native_byte_order_not_suppor, __pyx_k_Non_native_byte_order_not_suppor, sizeof(__pyx_k_Non_native_byte_order_not_suppor), 0, 1, 0, 0},
  {&__pyx_n_s_NotImplementedError, __pyx_k_NotImplementedError, sizeof(__pyx_k_NotImplementedError), 0, 0, 1, 1},
  {&__pyx_kp_s_Not_Found, __pyx_k_Not_Found, sizeof(__pyx_k_Not_Found), 0, 0, 1, 0},
  {&__pyx_n_b_O, __pyx_k_O, sizeof(__pyx_k_O), 0, 0, 0, 1},
  {&__pyx_n_s_O, __pyx_k_O, sizeof(__pyx_k_O), 0, 0, 1, 1},
  {&__pyx_kp_s_Out_of_bounds_on_buffer_access_a, __pyx_k_Out_of_bounds_on_buffer_access_a, sizeof(__pyx_k_Out_of_bounds_on_buffer_access_a), 0, 0, 1, 0},
  {&__pyx_kp_s_Output_array_must_have_4_columns, __pyx_k_Output_array_must_have_4_columns, sizeof(__pyx_k_Output_array_must_have_4_columns), 0, 0, 1, 0},
  {&__pyx_n_s_R, __pyx_k_R, sizeof(__pyx_k_R), 0, 0, 1, 1},
  {&__pyx_n_s_RuntimeError, __pyx_k_RuntimeError, sizeof(__pyx_k_RuntimeError), 0, 0, 1, 1},
  {&__pyx_n_s_S, __pyx_k_S, sizeof(__pyx_k_S), 0, 0, 1, 1},
  {&__pyx_n_s_T, __pyx_k_T, sizeof(__pyx_k_T), 0, 0, 1, 1},
  {&__pyx_n_s_TypeError, __pyx_k_TypeError, sizeof(__pyx_k_TypeError), 0, 0, 1, 1},
  {&__pyx_kp_s_Unable_to_convert_item_to_object, __pyx_k_Unable_to_convert_item_to_object, sizeof(__pyx_k_Unable_to_convert_item_to_object), 0, 0, 1, 0},
  {&__pyx_kp_s_Unable_to_parse_s, __pyx_k_Unable_to_parse_s, sizeof(__pyx_k_Unable_to_parse_s), 0, 0, 1, 0},
  {&__pyx_n_s_ValueError, __pyx_k_ValueError, sizeof(__pyx_k_ValueError), 0, 0, 1, 1},
  {&__pyx_kp_s__32, __pyx_k__32, sizeof(__pyx_k__32), 0, 0, 1, 0},
  {&__pyx_kp_s__34, __pyx_k__34, sizeof(__pyx_k__34), 0, 0, 1, 0},
  {&__pyx_n_s_a, __pyx_k_a, sizeof(__pyx_k_a), 0, 0, 1, 1},
  {&__pyx_n_s_adj, __pyx_k_adj, sizeof(__pyx_k_adj), 0, 0, 1, 1},
  {&__pyx_n_s_adjust, __pyx_k_adjust, sizeof(__pyx_k_adjust), 0, 0, 1, 1},
  {&__pyx_n_s_ai, __pyx_k_ai, sizeof(__pyx_k_ai), 0, 0, 1, 1},
  {&__pyx_n_s_allocate_buffer, __pyx_k_allocate_buffer, sizeof(__pyx_k_allocate_buffer), 0, 0, 1, 1},
  {&__pyx_n_s_aold, __pyx_k_aold, sizeof(__pyx_k_aold), 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_argsorted, __pyx_k_argsorted, sizeof(__pyx_k_argsorted), 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_arrmap_bool, __pyx_k_arrmap_bool, sizeof(__pyx_k_arrmap_bool), 0, 0, 1, 1},
  {&__pyx_n_s_arrmap_float32, __pyx_k_arrmap_float32, sizeof(__pyx_k_arrmap_float32), 0, 0, 1, 1},
  {&__pyx_n_s_arrmap_float64, __pyx_k_arrmap_float64, sizeof(__pyx_k_arrmap_float64), 0, 0, 1, 1},
  {&__pyx_n_s_arrmap_int32, __pyx_k_arrmap_int32, sizeof(__pyx_k_arrmap_int32), 0, 0, 1, 1},
  {&__pyx_n_s_arrmap_int64, __pyx_k_arrmap_int64, sizeof(__pyx_k_arrmap_int64), 0, 0, 1, 1},
  {&__pyx_n_s_arrmap_object, __pyx_k_arrmap_object, sizeof(__pyx_k_arrmap_object), 0, 0, 1, 1},
  {&__pyx_n_s_as, __pyx_k_as, sizeof(__pyx_k_as), 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_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_avg, __pyx_k_avg, sizeof(__pyx_k_avg), 0, 0, 1, 1},
  {&__pyx_n_s_avg_wgt, __pyx_k_avg_wgt, sizeof(__pyx_k_avg_wgt), 0, 0, 1, 1},
  {&__pyx_n_s_axis, __pyx_k_axis, sizeof(__pyx_k_axis), 0, 0, 1, 1},
  {&__pyx_n_s_b, __pyx_k_b, sizeof(__pyx_k_b), 0, 0, 1, 1},
  {&__pyx_n_s_backfill_2d_inplace_bool, __pyx_k_backfill_2d_inplace_bool, sizeof(__pyx_k_backfill_2d_inplace_bool), 0, 0, 1, 1},
  {&__pyx_n_s_backfill_2d_inplace_float32, __pyx_k_backfill_2d_inplace_float32, sizeof(__pyx_k_backfill_2d_inplace_float32), 0, 0, 1, 1},
  {&__pyx_n_s_backfill_2d_inplace_float64, __pyx_k_backfill_2d_inplace_float64, sizeof(__pyx_k_backfill_2d_inplace_float64), 0, 0, 1, 1},
  {&__pyx_n_s_backfill_2d_inplace_int32, __pyx_k_backfill_2d_inplace_int32, sizeof(__pyx_k_backfill_2d_inplace_int32), 0, 0, 1, 1},
  {&__pyx_n_s_backfill_2d_inplace_int64, __pyx_k_backfill_2d_inplace_int64, sizeof(__pyx_k_backfill_2d_inplace_int64), 0, 0, 1, 1},
  {&__pyx_n_s_backfill_2d_inplace_object, __pyx_k_backfill_2d_inplace_object, sizeof(__pyx_k_backfill_2d_inplace_object), 0, 0, 1, 1},
  {&__pyx_n_s_backfill_bool, __pyx_k_backfill_bool, sizeof(__pyx_k_backfill_bool), 0, 0, 1, 1},
  {&__pyx_n_s_backfill_float32, __pyx_k_backfill_float32, sizeof(__pyx_k_backfill_float32), 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_inplace_bool, __pyx_k_backfill_inplace_bool, sizeof(__pyx_k_backfill_inplace_bool), 0, 0, 1, 1},
  {&__pyx_n_s_backfill_inplace_float32, __pyx_k_backfill_inplace_float32, sizeof(__pyx_k_backfill_inplace_float32), 0, 0, 1, 1},
  {&__pyx_n_s_backfill_inplace_float64, __pyx_k_backfill_inplace_float64, sizeof(__pyx_k_backfill_inplace_float64), 0, 0, 1, 1},
  {&__pyx_n_s_backfill_inplace_int32, __pyx_k_backfill_inplace_int32, sizeof(__pyx_k_backfill_inplace_int32), 0, 0, 1, 1},
  {&__pyx_n_s_backfill_inplace_int64, __pyx_k_backfill_inplace_int64, sizeof(__pyx_k_backfill_inplace_int64), 0, 0, 1, 1},
  {&__pyx_n_s_backfill_inplace_object, __pyx_k_backfill_inplace_object, sizeof(__pyx_k_backfill_inplace_object), 0, 0, 1, 1},
  {&__pyx_n_s_backfill_int32, __pyx_k_backfill_int32, sizeof(__pyx_k_backfill_int32), 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_base, __pyx_k_base, sizeof(__pyx_k_base), 0, 0, 1, 1},
  {&__pyx_n_s_bins, __pyx_k_bins, sizeof(__pyx_k_bins), 0, 0, 1, 1},
  {&__pyx_n_s_buf, __pyx_k_buf, sizeof(__pyx_k_buf), 0, 0, 1, 1},
  {&__pyx_n_s_bufarr, __pyx_k_bufarr, sizeof(__pyx_k_bufarr), 0, 0, 1, 1},
  {&__pyx_n_s_c, __pyx_k_c, sizeof(__pyx_k_c), 0, 0, 1, 1},
  {&__pyx_n_u_c, __pyx_k_c, sizeof(__pyx_k_c), 0, 1, 0, 1},
  {&__pyx_n_s_c_contiguous, __pyx_k_c_contiguous, sizeof(__pyx_k_c_contiguous), 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_class, __pyx_k_class, sizeof(__pyx_k_class), 0, 0, 1, 1},
  {&__pyx_n_s_cmp, __pyx_k_cmp, sizeof(__pyx_k_cmp), 0, 0, 1, 1},
  {&__pyx_n_s_com, __pyx_k_com, sizeof(__pyx_k_com), 0, 0, 1, 1},
  {&__pyx_kp_s_contiguous_and_direct, __pyx_k_contiguous_and_direct, sizeof(__pyx_k_contiguous_and_direct), 0, 0, 1, 0},
  {&__pyx_kp_s_contiguous_and_indirect, __pyx_k_contiguous_and_indirect, sizeof(__pyx_k_contiguous_and_indirect), 0, 0, 1, 0},
  {&__pyx_n_s_copy, __pyx_k_copy, sizeof(__pyx_k_copy), 0, 0, 1, 1},
  {&__pyx_n_s_count, __pyx_k_count, sizeof(__pyx_k_count), 0, 0, 1, 1},
  {&__pyx_n_s_counts, __pyx_k_counts, sizeof(__pyx_k_counts), 0, 0, 1, 1},
  {&__pyx_n_s_counts_2, __pyx_k_counts_2, sizeof(__pyx_k_counts_2), 0, 0, 1, 1},
  {&__pyx_n_s_cov, __pyx_k_cov, sizeof(__pyx_k_cov), 0, 0, 1, 1},
  {&__pyx_n_s_ct, __pyx_k_ct, sizeof(__pyx_k_ct), 0, 0, 1, 1},
  {&__pyx_n_s_cur, __pyx_k_cur, sizeof(__pyx_k_cur), 0, 0, 1, 1},
  {&__pyx_n_s_data, __pyx_k_data, sizeof(__pyx_k_data), 0, 0, 1, 1},
  {&__pyx_n_s_datetime, __pyx_k_datetime, sizeof(__pyx_k_datetime), 0, 0, 1, 1},
  {&__pyx_n_s_day, __pyx_k_day, sizeof(__pyx_k_day), 0, 0, 1, 1},
  {&__pyx_n_s_ddof, __pyx_k_ddof, sizeof(__pyx_k_ddof), 0, 0, 1, 1},
  {&__pyx_n_s_defaults, __pyx_k_defaults, sizeof(__pyx_k_defaults), 0, 0, 1, 1},
  {&__pyx_n_s_delta, __pyx_k_delta, sizeof(__pyx_k_delta), 0, 0, 1, 1},
  {&__pyx_n_s_dense, __pyx_k_dense, sizeof(__pyx_k_dense), 0, 0, 1, 1},
  {&__pyx_n_s_diff_2d_float32, __pyx_k_diff_2d_float32, sizeof(__pyx_k_diff_2d_float32), 0, 0, 1, 1},
  {&__pyx_n_s_diff_2d_float64, __pyx_k_diff_2d_float64, sizeof(__pyx_k_diff_2d_float64), 0, 0, 1, 1},
  {&__pyx_n_s_diff_2d_int16, __pyx_k_diff_2d_int16, sizeof(__pyx_k_diff_2d_int16), 0, 0, 1, 1},
  {&__pyx_n_s_diff_2d_int32, __pyx_k_diff_2d_int32, sizeof(__pyx_k_diff_2d_int32), 0, 0, 1, 1},
  {&__pyx_n_s_diff_2d_int64, __pyx_k_diff_2d_int64, sizeof(__pyx_k_diff_2d_int64), 0, 0, 1, 1},
  {&__pyx_n_s_diff_2d_int8, __pyx_k_diff_2d_int8, sizeof(__pyx_k_diff_2d_int8), 0, 0, 1, 1},
  {&__pyx_n_s_dim, __pyx_k_dim, sizeof(__pyx_k_dim), 0, 0, 1, 1},
  {&__pyx_n_s_dims, __pyx_k_dims, sizeof(__pyx_k_dims), 0, 0, 1, 1},
  {&__pyx_n_s_divisor, __pyx_k_divisor, sizeof(__pyx_k_divisor), 0, 0, 1, 1},
  {&__pyx_n_s_doc, __pyx_k_doc, sizeof(__pyx_k_doc), 0, 0, 1, 1},
  {&__pyx_n_s_dtype, __pyx_k_dtype, sizeof(__pyx_k_dtype), 0, 0, 1, 1},
  {&__pyx_n_s_dtype_is_object, __pyx_k_dtype_is_object, sizeof(__pyx_k_dtype_is_object), 0, 0, 1, 1},
  {&__pyx_n_s_dups, __pyx_k_dups, sizeof(__pyx_k_dups), 0, 0, 1, 1},
  {&__pyx_n_s_e, __pyx_k_e, sizeof(__pyx_k_e), 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_end, __pyx_k_end, sizeof(__pyx_k_end), 0, 0, 1, 1},
  {&__pyx_n_s_enumerate, __pyx_k_enumerate, sizeof(__pyx_k_enumerate), 0, 0, 1, 1},
  {&__pyx_n_s_eq, __pyx_k_eq, sizeof(__pyx_k_eq), 0, 0, 1, 1},
  {&__pyx_n_s_error, __pyx_k_error, sizeof(__pyx_k_error), 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_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_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_fill, __pyx_k_fill, sizeof(__pyx_k_fill), 0, 0, 1, 1},
  {&__pyx_n_s_fill_count, __pyx_k_fill_count, sizeof(__pyx_k_fill_count), 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_kp_s_first_not_supported_for_non_nume, __pyx_k_first_not_supported_for_non_nume, sizeof(__pyx_k_first_not_supported_for_non_nume), 0, 0, 1, 0},
  {&__pyx_n_s_flags, __pyx_k_flags, sizeof(__pyx_k_flags), 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_float32_t, __pyx_k_float32_t, sizeof(__pyx_k_float32_t), 0, 0, 1, 1},
  {&__pyx_n_s_float64, __pyx_k_float64, sizeof(__pyx_k_float64), 0, 0, 1, 1},
  {&__pyx_n_s_float64_t, __pyx_k_float64_t, sizeof(__pyx_k_float64_t), 0, 0, 1, 1},
  {&__pyx_n_s_format, __pyx_k_format, sizeof(__pyx_k_format), 0, 0, 1, 1},
  {&__pyx_n_s_fortran, __pyx_k_fortran, sizeof(__pyx_k_fortran), 0, 0, 1, 1},
  {&__pyx_n_u_fortran, __pyx_k_fortran, sizeof(__pyx_k_fortran), 0, 1, 0, 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_fv, __pyx_k_fv, sizeof(__pyx_k_fv), 0, 0, 1, 1},
  {&__pyx_n_s_ge, __pyx_k_ge, sizeof(__pyx_k_ge), 0, 0, 1, 1},
  {&__pyx_n_s_get, __pyx_k_get, sizeof(__pyx_k_get), 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_gid, __pyx_k_gid, sizeof(__pyx_k_gid), 0, 0, 1, 1},
  {&__pyx_kp_s_got_differing_extents_in_dimensi, __pyx_k_got_differing_extents_in_dimensi, sizeof(__pyx_k_got_differing_extents_in_dimensi), 0, 0, 1, 0},
  {&__pyx_n_s_got_first, __pyx_k_got_first, sizeof(__pyx_k_got_first), 0, 0, 1, 1},
  {&__pyx_n_s_group_add_bin_float32, __pyx_k_group_add_bin_float32, sizeof(__pyx_k_group_add_bin_float32), 0, 0, 1, 1},
  {&__pyx_n_s_group_add_bin_float64, __pyx_k_group_add_bin_float64, sizeof(__pyx_k_group_add_bin_float64), 0, 0, 1, 1},
  {&__pyx_n_s_group_add_float32, __pyx_k_group_add_float32, sizeof(__pyx_k_group_add_float32), 0, 0, 1, 1},
  {&__pyx_n_s_group_add_float64, __pyx_k_group_add_float64, sizeof(__pyx_k_group_add_float64), 0, 0, 1, 1},
  {&__pyx_n_s_group_count_bin_float32, __pyx_k_group_count_bin_float32, sizeof(__pyx_k_group_count_bin_float32), 0, 0, 1, 1},
  {&__pyx_n_s_group_count_bin_float64, __pyx_k_group_count_bin_float64, sizeof(__pyx_k_group_count_bin_float64), 0, 0, 1, 1},
  {&__pyx_n_s_group_count_bin_int64, __pyx_k_group_count_bin_int64, sizeof(__pyx_k_group_count_bin_int64), 0, 0, 1, 1},
  {&__pyx_n_s_group_count_bin_object, __pyx_k_group_count_bin_object, sizeof(__pyx_k_group_count_bin_object), 0, 0, 1, 1},
  {&__pyx_n_s_group_count_float32, __pyx_k_group_count_float32, sizeof(__pyx_k_group_count_float32), 0, 0, 1, 1},
  {&__pyx_n_s_group_count_float64, __pyx_k_group_count_float64, sizeof(__pyx_k_group_count_float64), 0, 0, 1, 1},
  {&__pyx_n_s_group_count_int64, __pyx_k_group_count_int64, sizeof(__pyx_k_group_count_int64), 0, 0, 1, 1},
  {&__pyx_n_s_group_count_object, __pyx_k_group_count_object, sizeof(__pyx_k_group_count_object), 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_bin_float32, __pyx_k_group_last_bin_float32, sizeof(__pyx_k_group_last_bin_float32), 0, 0, 1, 1},
  {&__pyx_n_s_group_last_bin_float64, __pyx_k_group_last_bin_float64, sizeof(__pyx_k_group_last_bin_float64), 0, 0, 1, 1},
  {&__pyx_n_s_group_last_bin_object, __pyx_k_group_last_bin_object, sizeof(__pyx_k_group_last_bin_object), 0, 0, 1, 1},
  {&__pyx_n_s_group_last_float32, __pyx_k_group_last_float32, sizeof(__pyx_k_group_last_float32), 0, 0, 1, 1},
  {&__pyx_n_s_group_last_float64, __pyx_k_group_last_float64, sizeof(__pyx_k_group_last_float64), 0, 0, 1, 1},
  {&__pyx_n_s_group_last_object, __pyx_k_group_last_object, sizeof(__pyx_k_group_last_object), 0, 0, 1, 1},
  {&__pyx_n_s_group_max_bin_float32, __pyx_k_group_max_bin_float32, sizeof(__pyx_k_group_max_bin_float32), 0, 0, 1, 1},
  {&__pyx_n_s_group_max_bin_float64, __pyx_k_group_max_bin_float64, sizeof(__pyx_k_group_max_bin_float64), 0, 0, 1, 1},
  {&__pyx_n_s_group_max_float32, __pyx_k_group_max_float32, sizeof(__pyx_k_group_max_float32), 0, 0, 1, 1},
  {&__pyx_n_s_group_max_float64, __pyx_k_group_max_float64, sizeof(__pyx_k_group_max_float64), 0, 0, 1, 1},
  {&__pyx_n_s_group_mean_bin_float32, __pyx_k_group_mean_bin_float32, sizeof(__pyx_k_group_mean_bin_float32), 0, 0, 1, 1},
  {&__pyx_n_s_group_mean_bin_float64, __pyx_k_group_mean_bin_float64, sizeof(__pyx_k_group_mean_bin_float64), 0, 0, 1, 1},
  {&__pyx_n_s_group_mean_float32, __pyx_k_group_mean_float32, sizeof(__pyx_k_group_mean_float32), 0, 0, 1, 1},
  {&__pyx_n_s_group_mean_float64, __pyx_k_group_mean_float64, sizeof(__pyx_k_group_mean_float64), 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_bin_float32, __pyx_k_group_min_bin_float32, sizeof(__pyx_k_group_min_bin_float32), 0, 0, 1, 1},
  {&__pyx_n_s_group_min_bin_float64, __pyx_k_group_min_bin_float64, sizeof(__pyx_k_group_min_bin_float64), 0, 0, 1, 1},
  {&__pyx_n_s_group_min_float32, __pyx_k_group_min_float32, sizeof(__pyx_k_group_min_float32), 0, 0, 1, 1},
  {&__pyx_n_s_group_min_float64, __pyx_k_group_min_float64, sizeof(__pyx_k_group_min_float64), 0, 0, 1, 1},
  {&__pyx_n_s_group_nth_bin_float32, __pyx_k_group_nth_bin_float32, sizeof(__pyx_k_group_nth_bin_float32), 0, 0, 1, 1},
  {&__pyx_n_s_group_nth_bin_float64, __pyx_k_group_nth_bin_float64, sizeof(__pyx_k_group_nth_bin_float64), 0, 0, 1, 1},
  {&__pyx_n_s_group_nth_bin_object, __pyx_k_group_nth_bin_object, sizeof(__pyx_k_group_nth_bin_object), 0, 0, 1, 1},
  {&__pyx_n_s_group_nth_float32, __pyx_k_group_nth_float32, sizeof(__pyx_k_group_nth_float32), 0, 0, 1, 1},
  {&__pyx_n_s_group_nth_float64, __pyx_k_group_nth_float64, sizeof(__pyx_k_group_nth_float64), 0, 0, 1, 1},
  {&__pyx_n_s_group_nth_object, __pyx_k_group_nth_object, sizeof(__pyx_k_group_nth_object), 0, 0, 1, 1},
  {&__pyx_n_s_group_ohlc_float32, __pyx_k_group_ohlc_float32, sizeof(__pyx_k_group_ohlc_float32), 0, 0, 1, 1},
  {&__pyx_n_s_group_ohlc_float64, __pyx_k_group_ohlc_float64, sizeof(__pyx_k_group_ohlc_float64), 0, 0, 1, 1},
  {&__pyx_n_s_group_prod_bin_float32, __pyx_k_group_prod_bin_float32, sizeof(__pyx_k_group_prod_bin_float32), 0, 0, 1, 1},
  {&__pyx_n_s_group_prod_bin_float64, __pyx_k_group_prod_bin_float64, sizeof(__pyx_k_group_prod_bin_float64), 0, 0, 1, 1},
  {&__pyx_n_s_group_prod_float32, __pyx_k_group_prod_float32, sizeof(__pyx_k_group_prod_float32), 0, 0, 1, 1},
  {&__pyx_n_s_group_prod_float64, __pyx_k_group_prod_float64, sizeof(__pyx_k_group_prod_float64), 0, 0, 1, 1},
  {&__pyx_n_s_group_var_bin_float32, __pyx_k_group_var_bin_float32, sizeof(__pyx_k_group_var_bin_float32), 0, 0, 1, 1},
  {&__pyx_n_s_group_var_bin_float64, __pyx_k_group_var_bin_float64, sizeof(__pyx_k_group_var_bin_float64), 0, 0, 1, 1},
  {&__pyx_n_s_group_var_float32, __pyx_k_group_var_float32, sizeof(__pyx_k_group_var_float32), 0, 0, 1, 1},
  {&__pyx_n_s_group_var_float64, __pyx_k_group_var_float64, sizeof(__pyx_k_group_var_float64), 0, 0, 1, 1},
  {&__pyx_n_s_groupby_bool, __pyx_k_groupby_bool, sizeof(__pyx_k_groupby_bool), 0, 0, 1, 1},
  {&__pyx_n_s_groupby_float32, __pyx_k_groupby_float32, sizeof(__pyx_k_groupby_float32), 0, 0, 1, 1},
  {&__pyx_n_s_groupby_float64, __pyx_k_groupby_float64, sizeof(__pyx_k_groupby_float64), 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_groupby_int32, __pyx_k_groupby_int32, sizeof(__pyx_k_groupby_int32), 0, 0, 1, 1},
  {&__pyx_n_s_groupby_int64, __pyx_k_groupby_int64, sizeof(__pyx_k_groupby_int64), 0, 0, 1, 1},
  {&__pyx_n_s_groupby_object, __pyx_k_groupby_object, sizeof(__pyx_k_groupby_object), 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_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_k_home_yoh_deb_gits_pkg_exppsy_pa, sizeof(__pyx_k_home_yoh_deb_gits_pkg_exppsy_pa), 0, 0, 1, 0},
  {&__pyx_n_s_hour, __pyx_k_hour, sizeof(__pyx_k_hour), 0, 0, 1, 1},
  {&__pyx_n_s_i, __pyx_k_i, sizeof(__pyx_k_i), 0, 0, 1, 1},
  {&__pyx_n_s_i0, __pyx_k_i0, sizeof(__pyx_k_i0), 0, 0, 1, 1},
  {&__pyx_n_s_i8, __pyx_k_i8, sizeof(__pyx_k_i8), 0, 0, 1, 1},
  {&__pyx_n_s_id, __pyx_k_id, sizeof(__pyx_k_id), 0, 0, 1, 1},
  {&__pyx_n_s_ids, __pyx_k_ids, sizeof(__pyx_k_ids), 0, 0, 1, 1},
  {&__pyx_n_s_idx, __pyx_k_idx, sizeof(__pyx_k_idx), 0, 0, 1, 1},
  {&__pyx_n_s_idx0, __pyx_k_idx0, sizeof(__pyx_k_idx0), 0, 0, 1, 1},
  {&__pyx_n_s_idx1, __pyx_k_idx1, sizeof(__pyx_k_idx1), 0, 0, 1, 1},
  {&__pyx_n_s_iinfo, __pyx_k_iinfo, sizeof(__pyx_k_iinfo), 0, 0, 1, 1},
  {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 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_in_i, __pyx_k_in_i, sizeof(__pyx_k_in_i), 0, 0, 1, 1},
  {&__pyx_n_s_in_k, __pyx_k_in_k, sizeof(__pyx_k_in_k), 0, 0, 1, 1},
  {&__pyx_n_s_in_n, __pyx_k_in_n, sizeof(__pyx_k_in_n), 0, 0, 1, 1},
  {&__pyx_n_s_index, __pyx_k_index, sizeof(__pyx_k_index), 0, 0, 1, 1},
  {&__pyx_kp_s_index_out_of_bounds, __pyx_k_index_out_of_bounds, sizeof(__pyx_k_index_out_of_bounds), 0, 0, 1, 0},
  {&__pyx_n_s_indexer, __pyx_k_indexer, sizeof(__pyx_k_indexer), 0, 0, 1, 1},
  {&__pyx_n_s_inf, __pyx_k_inf, sizeof(__pyx_k_inf), 0, 0, 1, 1},
  {&__pyx_n_s_infs, __pyx_k_infs, sizeof(__pyx_k_infs), 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_inner_join_indexer_float32, __pyx_k_inner_join_indexer_float32, sizeof(__pyx_k_inner_join_indexer_float32), 0, 0, 1, 1},
  {&__pyx_n_s_inner_join_indexer_float64, __pyx_k_inner_join_indexer_float64, sizeof(__pyx_k_inner_join_indexer_float64), 0, 0, 1, 1},
  {&__pyx_n_s_inner_join_indexer_int32, __pyx_k_inner_join_indexer_int32, sizeof(__pyx_k_inner_join_indexer_int32), 0, 0, 1, 1},
  {&__pyx_n_s_inner_join_indexer_int64, __pyx_k_inner_join_indexer_int64, sizeof(__pyx_k_inner_join_indexer_int64), 0, 0, 1, 1},
  {&__pyx_n_s_inner_join_indexer_object, __pyx_k_inner_join_indexer_object, sizeof(__pyx_k_inner_join_indexer_object), 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_int, __pyx_k_int, sizeof(__pyx_k_int), 0, 0, 1, 1},
  {&__pyx_n_s_int16, __pyx_k_int16, sizeof(__pyx_k_int16), 0, 0, 1, 1},
  {&__pyx_n_s_int16_t, __pyx_k_int16_t, sizeof(__pyx_k_int16_t), 0, 0, 1, 1},
  {&__pyx_n_s_int32, __pyx_k_int32, sizeof(__pyx_k_int32), 0, 0, 1, 1},
  {&__pyx_n_s_int32_t, __pyx_k_int32_t, sizeof(__pyx_k_int32_t), 0, 0, 1, 1},
  {&__pyx_n_s_int64, __pyx_k_int64, sizeof(__pyx_k_int64), 0, 0, 1, 1},
  {&__pyx_n_s_int64_t, __pyx_k_int64_t, sizeof(__pyx_k_int64_t), 0, 0, 1, 1},
  {&__pyx_n_s_int8, __pyx_k_int8, sizeof(__pyx_k_int8), 0, 0, 1, 1},
  {&__pyx_n_s_int8_t, __pyx_k_int8_t, sizeof(__pyx_k_int8_t), 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_bool, __pyx_k_is_monotonic_bool, sizeof(__pyx_k_is_monotonic_bool), 0, 0, 1, 1},
  {&__pyx_n_s_is_monotonic_float32, __pyx_k_is_monotonic_float32, sizeof(__pyx_k_is_monotonic_float32), 0, 0, 1, 1},
  {&__pyx_n_s_is_monotonic_float64, __pyx_k_is_monotonic_float64, sizeof(__pyx_k_is_monotonic_float64), 0, 0, 1, 1},
  {&__pyx_n_s_is_monotonic_int32, __pyx_k_is_monotonic_int32, sizeof(__pyx_k_is_monotonic_int32), 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_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_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_itemsize, __pyx_k_itemsize, sizeof(__pyx_k_itemsize), 0, 0, 1, 1},
  {&__pyx_kp_s_itemsize_0_for_cython_array, __pyx_k_itemsize_0_for_cython_array, sizeof(__pyx_k_itemsize_0_for_cython_array), 0, 0, 1, 0},
  {&__pyx_n_s_j, __pyx_k_j, sizeof(__pyx_k_j), 0, 0, 1, 1},
  {&__pyx_n_s_k, __pyx_k_k, sizeof(__pyx_k_k), 0, 0, 1, 1},
  {&__pyx_n_s_keep, __pyx_k_keep, sizeof(__pyx_k_keep), 0, 0, 1, 1},
  {&__pyx_n_s_keep_na, __pyx_k_keep_na, sizeof(__pyx_k_keep_na), 0, 0, 1, 1},
  {&__pyx_n_s_key, __pyx_k_key, sizeof(__pyx_k_key), 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_kwargs, __pyx_k_kwargs, sizeof(__pyx_k_kwargs), 0, 0, 1, 1},
  {&__pyx_n_s_lab, __pyx_k_lab, sizeof(__pyx_k_lab), 0, 0, 1, 1},
  {&__pyx_n_s_label, __pyx_k_label, sizeof(__pyx_k_label), 0, 0, 1, 1},
  {&__pyx_n_s_labels, __pyx_k_labels, sizeof(__pyx_k_labels), 0, 0, 1, 1},
  {&__pyx_n_s_lambda, __pyx_k_lambda, sizeof(__pyx_k_lambda), 0, 0, 1, 1},
  {&__pyx_n_s_last, __pyx_k_last, sizeof(__pyx_k_last), 0, 0, 1, 1},
  {&__pyx_n_s_last_obs, __pyx_k_last_obs, sizeof(__pyx_k_last_obs), 0, 0, 1, 1},
  {&__pyx_n_s_lc, __pyx_k_lc, sizeof(__pyx_k_lc), 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_count, __pyx_k_left_count, sizeof(__pyx_k_left_count), 0, 0, 1, 1},
  {&__pyx_n_s_left_indexer, __pyx_k_left_indexer, sizeof(__pyx_k_left_indexer), 0, 0, 1, 1},
  {&__pyx_n_s_left_join_indexer_float32, __pyx_k_left_join_indexer_float32, sizeof(__pyx_k_left_join_indexer_float32), 0, 0, 1, 1},
  {&__pyx_n_s_left_join_indexer_float64, __pyx_k_left_join_indexer_float64, sizeof(__pyx_k_left_join_indexer_float64), 0, 0, 1, 1},
  {&__pyx_n_s_left_join_indexer_int32, __pyx_k_left_join_indexer_int32, sizeof(__pyx_k_left_join_indexer_int32), 0, 0, 1, 1},
  {&__pyx_n_s_left_join_indexer_int64, __pyx_k_left_join_indexer_int64, sizeof(__pyx_k_left_join_indexer_int64), 0, 0, 1, 1},
  {&__pyx_n_s_left_join_indexer_object, __pyx_k_left_join_indexer_object, sizeof(__pyx_k_left_join_indexer_object), 0, 0, 1, 1},
  {&__pyx_n_s_left_join_indexer_unique_float32, __pyx_k_left_join_indexer_unique_float32, sizeof(__pyx_k_left_join_indexer_unique_float32), 0, 0, 1, 1},
  {&__pyx_n_s_left_join_indexer_unique_float64, __pyx_k_left_join_indexer_unique_float64, sizeof(__pyx_k_left_join_indexer_unique_float64), 0, 0, 1, 1},
  {&__pyx_n_s_left_join_indexer_unique_int32, __pyx_k_left_join_indexer_unique_int32, sizeof(__pyx_k_left_join_indexer_unique_int32), 0, 0, 1, 1},
  {&__pyx_n_s_left_join_indexer_unique_int64, __pyx_k_left_join_indexer_unique_int64, sizeof(__pyx_k_left_join_indexer_unique_int64), 0, 0, 1, 1},
  {&__pyx_n_s_left_join_indexer_unique_object, __pyx_k_left_join_indexer_unique_object, sizeof(__pyx_k_left_join_indexer_unique_object), 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_left_pos, __pyx_k_left_pos, sizeof(__pyx_k_left_pos), 0, 0, 1, 1},
  {&__pyx_n_s_left_sorter, __pyx_k_left_sorter, sizeof(__pyx_k_left_sorter), 0, 0, 1, 1},
  {&__pyx_kp_s_len_index_len_labels, __pyx_k_len_index_len_labels, sizeof(__pyx_k_len_index_len_labels), 0, 0, 1, 0},
  {&__pyx_n_s_length, __pyx_k_length, sizeof(__pyx_k_length), 0, 0, 1, 1},
  {&__pyx_n_s_lib, __pyx_k_lib, sizeof(__pyx_k_lib), 0, 0, 1, 1},
  {&__pyx_n_s_lim, __pyx_k_lim, sizeof(__pyx_k_lim), 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_list_of_arrays, __pyx_k_list_of_arrays, sizeof(__pyx_k_list_of_arrays), 0, 0, 1, 1},
  {&__pyx_n_s_loc, __pyx_k_loc, sizeof(__pyx_k_loc), 0, 0, 1, 1},
  {&__pyx_n_s_lt, __pyx_k_lt, sizeof(__pyx_k_lt), 0, 0, 1, 1},
  {&__pyx_n_s_lval, __pyx_k_lval, sizeof(__pyx_k_lval), 0, 0, 1, 1},
  {&__pyx_n_s_m, __pyx_k_m, sizeof(__pyx_k_m), 0, 0, 1, 1},
  {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1},
  {&__pyx_n_s_mask, __pyx_k_mask, sizeof(__pyx_k_mask), 0, 0, 1, 1},
  {&__pyx_n_s_maskedx, __pyx_k_maskedx, sizeof(__pyx_k_maskedx), 0, 0, 1, 1},
  {&__pyx_n_s_maskedy, __pyx_k_maskedy, sizeof(__pyx_k_maskedy), 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_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_maxx, __pyx_k_maxx, sizeof(__pyx_k_maxx), 0, 0, 1, 1},
  {&__pyx_n_s_maybe_convert_objects, __pyx_k_maybe_convert_objects, sizeof(__pyx_k_maybe_convert_objects), 0, 0, 1, 1},
  {&__pyx_n_s_mean, __pyx_k_mean, sizeof(__pyx_k_mean), 0, 0, 1, 1},
  {&__pyx_n_s_mean_x, __pyx_k_mean_x, sizeof(__pyx_k_mean_x), 0, 0, 1, 1},
  {&__pyx_n_s_meanx, __pyx_k_meanx, sizeof(__pyx_k_meanx), 0, 0, 1, 1},
  {&__pyx_n_s_meany, __pyx_k_meany, sizeof(__pyx_k_meany), 0, 0, 1, 1},
  {&__pyx_n_s_median, __pyx_k_median, sizeof(__pyx_k_median), 0, 0, 1, 1},
  {&__pyx_n_s_members, __pyx_k_members, sizeof(__pyx_k_members), 0, 0, 1, 1},
  {&__pyx_n_s_memview, __pyx_k_memview, sizeof(__pyx_k_memview), 0, 0, 1, 1},
  {&__pyx_n_s_mergesort, __pyx_k_mergesort, sizeof(__pyx_k_mergesort), 0, 0, 1, 1},
  {&__pyx_n_s_metaclass, __pyx_k_metaclass, sizeof(__pyx_k_metaclass), 0, 0, 1, 1},
  {&__pyx_n_s_microsecond, __pyx_k_microsecond, sizeof(__pyx_k_microsecond), 0, 0, 1, 1},
  {&__pyx_n_s_midpoint, __pyx_k_midpoint, sizeof(__pyx_k_midpoint), 0, 0, 1, 1},
  {&__pyx_n_s_min, __pyx_k_min, sizeof(__pyx_k_min), 0, 0, 1, 1},
  {&__pyx_kp_s_min_periods_d_must_be_window_d, __pyx_k_min_periods_d_must_be_window_d, sizeof(__pyx_k_min_periods_d_must_be_window_d), 0, 0, 1, 0},
  {&__pyx_kp_s_min_periods_must_be_0, __pyx_k_min_periods_must_be_0, sizeof(__pyx_k_min_periods_must_be_0), 0, 0, 1, 0},
  {&__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_minpair, __pyx_k_minpair, sizeof(__pyx_k_minpair), 0, 0, 1, 1},
  {&__pyx_n_s_minute, __pyx_k_minute, sizeof(__pyx_k_minute), 0, 0, 1, 1},
  {&__pyx_n_s_minx, __pyx_k_minx, sizeof(__pyx_k_minx), 0, 0, 1, 1},
  {&__pyx_n_s_mode, __pyx_k_mode, sizeof(__pyx_k_mode), 0, 0, 1, 1},
  {&__pyx_n_s_module, __pyx_k_module, sizeof(__pyx_k_module), 0, 0, 1, 1},
  {&__pyx_n_s_month, __pyx_k_month, sizeof(__pyx_k_month), 0, 0, 1, 1},
  {&__pyx_n_s_n, __pyx_k_n, sizeof(__pyx_k_n), 0, 0, 1, 1},
  {&__pyx_n_s_n0, __pyx_k_n0, sizeof(__pyx_k_n0), 0, 0, 1, 1},
  {&__pyx_n_s_na_option, __pyx_k_na_option, sizeof(__pyx_k_na_option), 0, 0, 1, 1},
  {&__pyx_n_s_name, __pyx_k_name, sizeof(__pyx_k_name), 0, 0, 1, 1},
  {&__pyx_n_s_name_2, __pyx_k_name_2, sizeof(__pyx_k_name_2), 0, 0, 1, 1},
  {&__pyx_n_s_nan, __pyx_k_nan, sizeof(__pyx_k_nan), 0, 0, 1, 1},
  {&__pyx_n_s_nan_value, __pyx_k_nan_value, sizeof(__pyx_k_nan_value), 0, 0, 1, 1},
  {&__pyx_n_s_nancorr, __pyx_k_nancorr, sizeof(__pyx_k_nancorr), 0, 0, 1, 1},
  {&__pyx_n_s_nancorr_spearman, __pyx_k_nancorr_spearman, sizeof(__pyx_k_nancorr_spearman), 0, 0, 1, 1},
  {&__pyx_n_s_nbins, __pyx_k_nbins, sizeof(__pyx_k_nbins), 0, 0, 1, 1},
  {&__pyx_n_s_ndarray, __pyx_k_ndarray, sizeof(__pyx_k_ndarray), 0, 0, 1, 1},
  {&__pyx_kp_u_ndarray_is_not_C_contiguous, __pyx_k_ndarray_is_not_C_contiguous, sizeof(__pyx_k_ndarray_is_not_C_contiguous), 0, 1, 0, 0},
  {&__pyx_kp_u_ndarray_is_not_Fortran_contiguou, __pyx_k_ndarray_is_not_Fortran_contiguou, sizeof(__pyx_k_ndarray_is_not_Fortran_contiguou), 0, 1, 0, 0},
  {&__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_neg_ct, __pyx_k_neg_ct, sizeof(__pyx_k_neg_ct), 0, 0, 1, 1},
  {&__pyx_n_s_new, __pyx_k_new, sizeof(__pyx_k_new), 0, 0, 1, 1},
  {&__pyx_n_s_neww, __pyx_k_neww, sizeof(__pyx_k_neww), 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_nleft, __pyx_k_nleft, sizeof(__pyx_k_nleft), 0, 0, 1, 1},
  {&__pyx_n_s_nlevels, __pyx_k_nlevels, sizeof(__pyx_k_nlevels), 0, 0, 1, 1},
  {&__pyx_n_s_nobs, __pyx_k_nobs, sizeof(__pyx_k_nobs), 0, 0, 1, 1},
  {&__pyx_n_s_nonzero, __pyx_k_nonzero, sizeof(__pyx_k_nonzero), 0, 0, 1, 1},
  {&__pyx_n_s_np, __pyx_k_np, sizeof(__pyx_k_np), 0, 0, 1, 1},
  {&__pyx_n_s_nright, __pyx_k_nright, sizeof(__pyx_k_nright), 0, 0, 1, 1},
  {&__pyx_n_s_numpy, __pyx_k_numpy, sizeof(__pyx_k_numpy), 0, 0, 1, 1},
  {&__pyx_n_s_o, __pyx_k_o, sizeof(__pyx_k_o), 0, 0, 1, 1},
  {&__pyx_n_s_obj, __pyx_k_obj, sizeof(__pyx_k_obj), 0, 0, 1, 1},
  {&__pyx_n_s_object, __pyx_k_object, sizeof(__pyx_k_object), 0, 0, 1, 1},
  {&__pyx_n_s_object_2, __pyx_k_object_2, sizeof(__pyx_k_object_2), 0, 0, 1, 1},
  {&__pyx_n_s_offset, __pyx_k_offset, sizeof(__pyx_k_offset), 0, 0, 1, 1},
  {&__pyx_n_s_old, __pyx_k_old, sizeof(__pyx_k_old), 0, 0, 1, 1},
  {&__pyx_n_s_oldbuf, __pyx_k_oldbuf, sizeof(__pyx_k_oldbuf), 0, 0, 1, 1},
  {&__pyx_n_s_oldw, __pyx_k_oldw, sizeof(__pyx_k_oldw), 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_ord, __pyx_k_ord, sizeof(__pyx_k_ord), 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_outer_join_indexer_float32, __pyx_k_outer_join_indexer_float32, sizeof(__pyx_k_outer_join_indexer_float32), 0, 0, 1, 1},
  {&__pyx_n_s_outer_join_indexer_float64, __pyx_k_outer_join_indexer_float64, sizeof(__pyx_k_outer_join_indexer_float64), 0, 0, 1, 1},
  {&__pyx_n_s_outer_join_indexer_int32, __pyx_k_outer_join_indexer_int32, sizeof(__pyx_k_outer_join_indexer_int32), 0, 0, 1, 1},
  {&__pyx_n_s_outer_join_indexer_int64, __pyx_k_outer_join_indexer_int64, sizeof(__pyx_k_outer_join_indexer_int64), 0, 0, 1, 1},
  {&__pyx_n_s_outer_join_indexer_object, __pyx_k_outer_join_indexer_object, sizeof(__pyx_k_outer_join_indexer_object), 0, 0, 1, 1},
  {&__pyx_n_s_output, __pyx_k_output, sizeof(__pyx_k_output), 0, 0, 1, 1},
  {&__pyx_n_s_pack, __pyx_k_pack, sizeof(__pyx_k_pack), 0, 0, 1, 1},
  {&__pyx_n_s_pad_2d_inplace_bool, __pyx_k_pad_2d_inplace_bool, sizeof(__pyx_k_pad_2d_inplace_bool), 0, 0, 1, 1},
  {&__pyx_n_s_pad_2d_inplace_float32, __pyx_k_pad_2d_inplace_float32, sizeof(__pyx_k_pad_2d_inplace_float32), 0, 0, 1, 1},
  {&__pyx_n_s_pad_2d_inplace_float64, __pyx_k_pad_2d_inplace_float64, sizeof(__pyx_k_pad_2d_inplace_float64), 0, 0, 1, 1},
  {&__pyx_n_s_pad_2d_inplace_int32, __pyx_k_pad_2d_inplace_int32, sizeof(__pyx_k_pad_2d_inplace_int32), 0, 0, 1, 1},
  {&__pyx_n_s_pad_2d_inplace_int64, __pyx_k_pad_2d_inplace_int64, sizeof(__pyx_k_pad_2d_inplace_int64), 0, 0, 1, 1},
  {&__pyx_n_s_pad_2d_inplace_object, __pyx_k_pad_2d_inplace_object, sizeof(__pyx_k_pad_2d_inplace_object), 0, 0, 1, 1},
  {&__pyx_n_s_pad_bool, __pyx_k_pad_bool, sizeof(__pyx_k_pad_bool), 0, 0, 1, 1},
  {&__pyx_n_s_pad_float32, __pyx_k_pad_float32, sizeof(__pyx_k_pad_float32), 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_inplace_bool, __pyx_k_pad_inplace_bool, sizeof(__pyx_k_pad_inplace_bool), 0, 0, 1, 1},
  {&__pyx_n_s_pad_inplace_float32, __pyx_k_pad_inplace_float32, sizeof(__pyx_k_pad_inplace_float32), 0, 0, 1, 1},
  {&__pyx_n_s_pad_inplace_float64, __pyx_k_pad_inplace_float64, sizeof(__pyx_k_pad_inplace_float64), 0, 0, 1, 1},
  {&__pyx_n_s_pad_inplace_int32, __pyx_k_pad_inplace_int32, sizeof(__pyx_k_pad_inplace_int32), 0, 0, 1, 1},
  {&__pyx_n_s_pad_inplace_int64, __pyx_k_pad_inplace_int64, sizeof(__pyx_k_pad_inplace_int64), 0, 0, 1, 1},
  {&__pyx_n_s_pad_inplace_object, __pyx_k_pad_inplace_object, sizeof(__pyx_k_pad_inplace_object), 0, 0, 1, 1},
  {&__pyx_n_s_pad_int32, __pyx_k_pad_int32, sizeof(__pyx_k_pad_int32), 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_algos, __pyx_k_pandas_algos, sizeof(__pyx_k_pandas_algos), 0, 0, 1, 1},
  {&__pyx_n_s_pandas_lib, __pyx_k_pandas_lib, sizeof(__pyx_k_pandas_lib), 0, 0, 1, 1},
  {&__pyx_kp_s_pandas_src_generated_pyx, __pyx_k_pandas_src_generated_pyx, sizeof(__pyx_k_pandas_src_generated_pyx), 0, 0, 1, 0},
  {&__pyx_kp_s_pandas_src_join_pyx, __pyx_k_pandas_src_join_pyx, sizeof(__pyx_k_pandas_src_join_pyx), 0, 0, 1, 0},
  {&__pyx_n_s_pct, __pyx_k_pct, sizeof(__pyx_k_pct), 0, 0, 1, 1},
  {&__pyx_n_s_periods, __pyx_k_periods, sizeof(__pyx_k_periods), 0, 0, 1, 1},
  {&__pyx_n_s_position, __pyx_k_position, sizeof(__pyx_k_position), 0, 0, 1, 1},
  {&__pyx_n_s_pre, __pyx_k_pre, sizeof(__pyx_k_pre), 0, 0, 1, 1},
  {&__pyx_n_s_prepare, __pyx_k_prepare, sizeof(__pyx_k_prepare), 0, 0, 1, 1},
  {&__pyx_n_s_prev, __pyx_k_prev, sizeof(__pyx_k_prev), 0, 0, 1, 1},
  {&__pyx_n_s_prodx, __pyx_k_prodx, sizeof(__pyx_k_prodx), 0, 0, 1, 1},
  {&__pyx_n_s_ptr, __pyx_k_ptr, sizeof(__pyx_k_ptr), 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_pydatetime, __pyx_k_pydatetime, sizeof(__pyx_k_pydatetime), 0, 0, 1, 1},
  {&__pyx_n_s_pyx_fuse_0kth_smallest, __pyx_k_pyx_fuse_0kth_smallest, sizeof(__pyx_k_pyx_fuse_0kth_smallest), 0, 0, 1, 1},
  {&__pyx_n_s_pyx_fuse_0median, __pyx_k_pyx_fuse_0median, sizeof(__pyx_k_pyx_fuse_0median), 0, 0, 1, 1},
  {&__pyx_n_s_pyx_fuse_1kth_smallest, __pyx_k_pyx_fuse_1kth_smallest, sizeof(__pyx_k_pyx_fuse_1kth_smallest), 0, 0, 1, 1},
  {&__pyx_n_s_pyx_fuse_1median, __pyx_k_pyx_fuse_1median, sizeof(__pyx_k_pyx_fuse_1median), 0, 0, 1, 1},
  {&__pyx_n_s_pyx_fuse_2kth_smallest, __pyx_k_pyx_fuse_2kth_smallest, sizeof(__pyx_k_pyx_fuse_2kth_smallest), 0, 0, 1, 1},
  {&__pyx_n_s_pyx_fuse_2median, __pyx_k_pyx_fuse_2median, sizeof(__pyx_k_pyx_fuse_2median), 0, 0, 1, 1},
  {&__pyx_n_s_pyx_fuse_3kth_smallest, __pyx_k_pyx_fuse_3kth_smallest, sizeof(__pyx_k_pyx_fuse_3kth_smallest), 0, 0, 1, 1},
  {&__pyx_n_s_pyx_fuse_3median, __pyx_k_pyx_fuse_3median, sizeof(__pyx_k_pyx_fuse_3median), 0, 0, 1, 1},
  {&__pyx_n_s_pyx_fuse_4kth_smallest, __pyx_k_pyx_fuse_4kth_smallest, sizeof(__pyx_k_pyx_fuse_4kth_smallest), 0, 0, 1, 1},
  {&__pyx_n_s_pyx_fuse_4median, __pyx_k_pyx_fuse_4median, sizeof(__pyx_k_pyx_fuse_4median), 0, 0, 1, 1},
  {&__pyx_n_s_pyx_fuse_5kth_smallest, __pyx_k_pyx_fuse_5kth_smallest, sizeof(__pyx_k_pyx_fuse_5kth_smallest), 0, 0, 1, 1},
  {&__pyx_n_s_pyx_fuse_5median, __pyx_k_pyx_fuse_5median, sizeof(__pyx_k_pyx_fuse_5median), 0, 0, 1, 1},
  {&__pyx_n_s_pyx_fuse_6kth_smallest, __pyx_k_pyx_fuse_6kth_smallest, sizeof(__pyx_k_pyx_fuse_6kth_smallest), 0, 0, 1, 1},
  {&__pyx_n_s_pyx_fuse_6median, __pyx_k_pyx_fuse_6median, sizeof(__pyx_k_pyx_fuse_6median), 0, 0, 1, 1},
  {&__pyx_n_s_pyx_fuse_7kth_smallest, __pyx_k_pyx_fuse_7kth_smallest, sizeof(__pyx_k_pyx_fuse_7kth_smallest), 0, 0, 1, 1},
  {&__pyx_n_s_pyx_fuse_7median, __pyx_k_pyx_fuse_7median, sizeof(__pyx_k_pyx_fuse_7median), 0, 0, 1, 1},
  {&__pyx_n_s_pyx_fuse_8kth_smallest, __pyx_k_pyx_fuse_8kth_smallest, sizeof(__pyx_k_pyx_fuse_8kth_smallest), 0, 0, 1, 1},
  {&__pyx_n_s_pyx_fuse_8median, __pyx_k_pyx_fuse_8median, sizeof(__pyx_k_pyx_fuse_8median), 0, 0, 1, 1},
  {&__pyx_n_s_pyx_fuse_9kth_smallest, __pyx_k_pyx_fuse_9kth_smallest, sizeof(__pyx_k_pyx_fuse_9kth_smallest), 0, 0, 1, 1},
  {&__pyx_n_s_pyx_fuse_9median, __pyx_k_pyx_fuse_9median, sizeof(__pyx_k_pyx_fuse_9median), 0, 0, 1, 1},
  {&__pyx_n_s_pyx_getbuffer, __pyx_k_pyx_getbuffer, sizeof(__pyx_k_pyx_getbuffer), 0, 0, 1, 1},
  {&__pyx_n_s_pyx_releasebuffer, __pyx_k_pyx_releasebuffer, sizeof(__pyx_k_pyx_releasebuffer), 0, 0, 1, 1},
  {&__pyx_n_s_pyx_vtable, __pyx_k_pyx_vtable, sizeof(__pyx_k_pyx_vtable), 0, 0, 1, 1},
  {&__pyx_n_s_qualname, __pyx_k_qualname, sizeof(__pyx_k_qualname), 0, 0, 1, 1},
  {&__pyx_n_s_quantile, __pyx_k_quantile, sizeof(__pyx_k_quantile), 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_ranks, __pyx_k_ranks, sizeof(__pyx_k_ranks), 0, 0, 1, 1},
  {&__pyx_n_s_rc, __pyx_k_rc, sizeof(__pyx_k_rc), 0, 0, 1, 1},
  {&__pyx_n_s_remove, __pyx_k_remove, sizeof(__pyx_k_remove), 0, 0, 1, 1},
  {&__pyx_n_s_res, __pyx_k_res, sizeof(__pyx_k_res), 0, 0, 1, 1},
  {&__pyx_n_s_result, __pyx_k_result, sizeof(__pyx_k_result), 0, 0, 1, 1},
  {&__pyx_n_s_resx, __pyx_k_resx, sizeof(__pyx_k_resx), 0, 0, 1, 1},
  {&__pyx_n_s_ret, __pyx_k_ret, sizeof(__pyx_k_ret), 0, 0, 1, 1},
  {&__pyx_n_s_retry, __pyx_k_retry, sizeof(__pyx_k_retry), 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_rev, __pyx_k_rev, sizeof(__pyx_k_rev), 0, 0, 1, 1},
  {&__pyx_n_s_reverse, __pyx_k_reverse, sizeof(__pyx_k_reverse), 0, 0, 1, 1},
  {&__pyx_n_s_right, __pyx_k_right, sizeof(__pyx_k_right), 0, 0, 1, 1},
  {&__pyx_n_s_right_count, __pyx_k_right_count, sizeof(__pyx_k_right_count), 0, 0, 1, 1},
  {&__pyx_n_s_right_indexer, __pyx_k_right_indexer, sizeof(__pyx_k_right_indexer), 0, 0, 1, 1},
  {&__pyx_n_s_right_pos, __pyx_k_right_pos, sizeof(__pyx_k_right_pos), 0, 0, 1, 1},
  {&__pyx_n_s_right_sorter, __pyx_k_right_sorter, sizeof(__pyx_k_right_sorter), 0, 0, 1, 1},
  {&__pyx_n_s_rindexer, __pyx_k_rindexer, sizeof(__pyx_k_rindexer), 0, 0, 1, 1},
  {&__pyx_n_s_ring, __pyx_k_ring, sizeof(__pyx_k_ring), 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_roll_window, __pyx_k_roll_window, sizeof(__pyx_k_roll_window), 0, 0, 1, 1},
  {&__pyx_n_s_rval, __pyx_k_rval, sizeof(__pyx_k_rval), 0, 0, 1, 1},
  {&__pyx_n_s_s, __pyx_k_s, sizeof(__pyx_k_s), 0, 0, 1, 1},
  {&__pyx_n_s_second, __pyx_k_second, sizeof(__pyx_k_second), 0, 0, 1, 1},
  {&__pyx_n_s_seen, __pyx_k_seen, sizeof(__pyx_k_seen), 0, 0, 1, 1},
  {&__pyx_n_s_self, __pyx_k_self, sizeof(__pyx_k_self), 0, 0, 1, 1},
  {&__pyx_n_s_shape, __pyx_k_shape, sizeof(__pyx_k_shape), 0, 0, 1, 1},
  {&__pyx_n_s_signatures, __pyx_k_signatures, sizeof(__pyx_k_signatures), 0, 0, 1, 1},
  {&__pyx_n_s_size, __pyx_k_size, sizeof(__pyx_k_size), 0, 0, 1, 1},
  {&__pyx_n_s_skiplist, __pyx_k_skiplist, sizeof(__pyx_k_skiplist), 0, 0, 1, 1},
  {&__pyx_n_s_sl, __pyx_k_sl, sizeof(__pyx_k_sl), 0, 0, 1, 1},
  {&__pyx_n_s_sort, __pyx_k_sort, sizeof(__pyx_k_sort), 0, 0, 1, 1},
  {&__pyx_n_s_sorted_data, __pyx_k_sorted_data, sizeof(__pyx_k_sorted_data), 0, 0, 1, 1},
  {&__pyx_n_s_sorter, __pyx_k_sorter, sizeof(__pyx_k_sorter), 0, 0, 1, 1},
  {&__pyx_n_s_split, __pyx_k_split, sizeof(__pyx_k_split), 0, 0, 1, 1},
  {&__pyx_n_s_ssqdm_x, __pyx_k_ssqdm_x, sizeof(__pyx_k_ssqdm_x), 0, 0, 1, 1},
  {&__pyx_n_s_start, __pyx_k_start, sizeof(__pyx_k_start), 0, 0, 1, 1},
  {&__pyx_n_s_step, __pyx_k_step, sizeof(__pyx_k_step), 0, 0, 1, 1},
  {&__pyx_n_s_stop, __pyx_k_stop, sizeof(__pyx_k_stop), 0, 0, 1, 1},
  {&__pyx_kp_s_strided_and_direct, __pyx_k_strided_and_direct, sizeof(__pyx_k_strided_and_direct), 0, 0, 1, 0},
  {&__pyx_kp_s_strided_and_direct_or_indirect, __pyx_k_strided_and_direct_or_indirect, sizeof(__pyx_k_strided_and_direct_or_indirect), 0, 0, 1, 0},
  {&__pyx_kp_s_strided_and_indirect, __pyx_k_strided_and_indirect, sizeof(__pyx_k_strided_and_indirect), 0, 0, 1, 0},
  {&__pyx_n_s_strip, __pyx_k_strip, sizeof(__pyx_k_strip), 0, 0, 1, 1},
  {&__pyx_n_s_struct, __pyx_k_struct, sizeof(__pyx_k_struct), 0, 0, 1, 1},
  {&__pyx_n_s_sum_ranks, __pyx_k_sum_ranks, sizeof(__pyx_k_sum_ranks), 0, 0, 1, 1},
  {&__pyx_n_s_sum_x, __pyx_k_sum_x, sizeof(__pyx_k_sum_x), 0, 0, 1, 1},
  {&__pyx_n_s_sumx, __pyx_k_sumx, sizeof(__pyx_k_sumx), 0, 0, 1, 1},
  {&__pyx_n_s_sumxx, __pyx_k_sumxx, sizeof(__pyx_k_sumxx), 0, 0, 1, 1},
  {&__pyx_n_s_sumy, __pyx_k_sumy, sizeof(__pyx_k_sumy), 0, 0, 1, 1},
  {&__pyx_n_s_sumyy, __pyx_k_sumyy, sizeof(__pyx_k_sumyy), 0, 0, 1, 1},
  {&__pyx_n_s_sx, __pyx_k_sx, sizeof(__pyx_k_sx), 0, 0, 1, 1},
  {&__pyx_n_s_sy, __pyx_k_sy, sizeof(__pyx_k_sy), 0, 0, 1, 1},
  {&__pyx_n_s_take, __pyx_k_take, sizeof(__pyx_k_take), 0, 0, 1, 1},
  {&__pyx_n_s_take_1d_bool_bool, __pyx_k_take_1d_bool_bool, sizeof(__pyx_k_take_1d_bool_bool), 0, 0, 1, 1},
  {&__pyx_n_s_take_1d_bool_object, __pyx_k_take_1d_bool_object, sizeof(__pyx_k_take_1d_bool_object), 0, 0, 1, 1},
  {&__pyx_n_s_take_1d_float32_float32, __pyx_k_take_1d_float32_float32, sizeof(__pyx_k_take_1d_float32_float32), 0, 0, 1, 1},
  {&__pyx_n_s_take_1d_float32_float64, __pyx_k_take_1d_float32_float64, sizeof(__pyx_k_take_1d_float32_float64), 0, 0, 1, 1},
  {&__pyx_n_s_take_1d_float64_float64, __pyx_k_take_1d_float64_float64, sizeof(__pyx_k_take_1d_float64_float64), 0, 0, 1, 1},
  {&__pyx_n_s_take_1d_int16_float64, __pyx_k_take_1d_int16_float64, sizeof(__pyx_k_take_1d_int16_float64), 0, 0, 1, 1},
  {&__pyx_n_s_take_1d_int16_int16, __pyx_k_take_1d_int16_int16, sizeof(__pyx_k_take_1d_int16_int16), 0, 0, 1, 1},
  {&__pyx_n_s_take_1d_int16_int32, __pyx_k_take_1d_int16_int32, sizeof(__pyx_k_take_1d_int16_int32), 0, 0, 1, 1},
  {&__pyx_n_s_take_1d_int16_int64, __pyx_k_take_1d_int16_int64, sizeof(__pyx_k_take_1d_int16_int64), 0, 0, 1, 1},
  {&__pyx_n_s_take_1d_int32_float64, __pyx_k_take_1d_int32_float64, sizeof(__pyx_k_take_1d_int32_float64), 0, 0, 1, 1},
  {&__pyx_n_s_take_1d_int32_int32, __pyx_k_take_1d_int32_int32, sizeof(__pyx_k_take_1d_int32_int32), 0, 0, 1, 1},
  {&__pyx_n_s_take_1d_int32_int64, __pyx_k_take_1d_int32_int64, sizeof(__pyx_k_take_1d_int32_int64), 0, 0, 1, 1},
  {&__pyx_n_s_take_1d_int64_float64, __pyx_k_take_1d_int64_float64, sizeof(__pyx_k_take_1d_int64_float64), 0, 0, 1, 1},
  {&__pyx_n_s_take_1d_int64_int64, __pyx_k_take_1d_int64_int64, sizeof(__pyx_k_take_1d_int64_int64), 0, 0, 1, 1},
  {&__pyx_n_s_take_1d_int8_float64, __pyx_k_take_1d_int8_float64, sizeof(__pyx_k_take_1d_int8_float64), 0, 0, 1, 1},
  {&__pyx_n_s_take_1d_int8_int32, __pyx_k_take_1d_int8_int32, sizeof(__pyx_k_take_1d_int8_int32), 0, 0, 1, 1},
  {&__pyx_n_s_take_1d_int8_int64, __pyx_k_take_1d_int8_int64, sizeof(__pyx_k_take_1d_int8_int64), 0, 0, 1, 1},
  {&__pyx_n_s_take_1d_int8_int8, __pyx_k_take_1d_int8_int8, sizeof(__pyx_k_take_1d_int8_int8), 0, 0, 1, 1},
  {&__pyx_n_s_take_1d_object_object, __pyx_k_take_1d_object_object, sizeof(__pyx_k_take_1d_object_object), 0, 0, 1, 1},
  {&__pyx_n_s_take_2d_axis0_bool_bool, __pyx_k_take_2d_axis0_bool_bool, sizeof(__pyx_k_take_2d_axis0_bool_bool), 0, 0, 1, 1},
  {&__pyx_n_s_take_2d_axis0_bool_object, __pyx_k_take_2d_axis0_bool_object, sizeof(__pyx_k_take_2d_axis0_bool_object), 0, 0, 1, 1},
  {&__pyx_n_s_take_2d_axis0_float32_float32, __pyx_k_take_2d_axis0_float32_float32, sizeof(__pyx_k_take_2d_axis0_float32_float32), 0, 0, 1, 1},
  {&__pyx_n_s_take_2d_axis0_float32_float64, __pyx_k_take_2d_axis0_float32_float64, sizeof(__pyx_k_take_2d_axis0_float32_float64), 0, 0, 1, 1},
  {&__pyx_n_s_take_2d_axis0_float64_float64, __pyx_k_take_2d_axis0_float64_float64, sizeof(__pyx_k_take_2d_axis0_float64_float64), 0, 0, 1, 1},
  {&__pyx_n_s_take_2d_axis0_int16_float64, __pyx_k_take_2d_axis0_int16_float64, sizeof(__pyx_k_take_2d_axis0_int16_float64), 0, 0, 1, 1},
  {&__pyx_n_s_take_2d_axis0_int16_int16, __pyx_k_take_2d_axis0_int16_int16, sizeof(__pyx_k_take_2d_axis0_int16_int16), 0, 0, 1, 1},
  {&__pyx_n_s_take_2d_axis0_int16_int32, __pyx_k_take_2d_axis0_int16_int32, sizeof(__pyx_k_take_2d_axis0_int16_int32), 0, 0, 1, 1},
  {&__pyx_n_s_take_2d_axis0_int16_int64, __pyx_k_take_2d_axis0_int16_int64, sizeof(__pyx_k_take_2d_axis0_int16_int64), 0, 0, 1, 1},
  {&__pyx_n_s_take_2d_axis0_int32_float64, __pyx_k_take_2d_axis0_int32_float64, sizeof(__pyx_k_take_2d_axis0_int32_float64), 0, 0, 1, 1},
  {&__pyx_n_s_take_2d_axis0_int32_int32, __pyx_k_take_2d_axis0_int32_int32, sizeof(__pyx_k_take_2d_axis0_int32_int32), 0, 0, 1, 1},
  {&__pyx_n_s_take_2d_axis0_int32_int64, __pyx_k_take_2d_axis0_int32_int64, sizeof(__pyx_k_take_2d_axis0_int32_int64), 0, 0, 1, 1},
  {&__pyx_n_s_take_2d_axis0_int64_float64, __pyx_k_take_2d_axis0_int64_float64, sizeof(__pyx_k_take_2d_axis0_int64_float64), 0, 0, 1, 1},
  {&__pyx_n_s_take_2d_axis0_int64_int64, __pyx_k_take_2d_axis0_int64_int64, sizeof(__pyx_k_take_2d_axis0_int64_int64), 0, 0, 1, 1},
  {&__pyx_n_s_take_2d_axis0_int8_float64, __pyx_k_take_2d_axis0_int8_float64, sizeof(__pyx_k_take_2d_axis0_int8_float64), 0, 0, 1, 1},
  {&__pyx_n_s_take_2d_axis0_int8_int32, __pyx_k_take_2d_axis0_int8_int32, sizeof(__pyx_k_take_2d_axis0_int8_int32), 0, 0, 1, 1},
  {&__pyx_n_s_take_2d_axis0_int8_int64, __pyx_k_take_2d_axis0_int8_int64, sizeof(__pyx_k_take_2d_axis0_int8_int64), 0, 0, 1, 1},
  {&__pyx_n_s_take_2d_axis0_int8_int8, __pyx_k_take_2d_axis0_int8_int8, sizeof(__pyx_k_take_2d_axis0_int8_int8), 0, 0, 1, 1},
  {&__pyx_n_s_take_2d_axis0_object_object, __pyx_k_take_2d_axis0_object_object, sizeof(__pyx_k_take_2d_axis0_object_object), 0, 0, 1, 1},
  {&__pyx_n_s_take_2d_axis1_bool_bool, __pyx_k_take_2d_axis1_bool_bool, sizeof(__pyx_k_take_2d_axis1_bool_bool), 0, 0, 1, 1},
  {&__pyx_n_s_take_2d_axis1_bool_object, __pyx_k_take_2d_axis1_bool_object, sizeof(__pyx_k_take_2d_axis1_bool_object), 0, 0, 1, 1},
  {&__pyx_n_s_take_2d_axis1_float32_float32, __pyx_k_take_2d_axis1_float32_float32, sizeof(__pyx_k_take_2d_axis1_float32_float32), 0, 0, 1, 1},
  {&__pyx_n_s_take_2d_axis1_float32_float64, __pyx_k_take_2d_axis1_float32_float64, sizeof(__pyx_k_take_2d_axis1_float32_float64), 0, 0, 1, 1},
  {&__pyx_n_s_take_2d_axis1_float64_float64, __pyx_k_take_2d_axis1_float64_float64, sizeof(__pyx_k_take_2d_axis1_float64_float64), 0, 0, 1, 1},
  {&__pyx_n_s_take_2d_axis1_int16_float64, __pyx_k_take_2d_axis1_int16_float64, sizeof(__pyx_k_take_2d_axis1_int16_float64), 0, 0, 1, 1},
  {&__pyx_n_s_take_2d_axis1_int16_int16, __pyx_k_take_2d_axis1_int16_int16, sizeof(__pyx_k_take_2d_axis1_int16_int16), 0, 0, 1, 1},
  {&__pyx_n_s_take_2d_axis1_int16_int32, __pyx_k_take_2d_axis1_int16_int32, sizeof(__pyx_k_take_2d_axis1_int16_int32), 0, 0, 1, 1},
  {&__pyx_n_s_take_2d_axis1_int16_int64, __pyx_k_take_2d_axis1_int16_int64, sizeof(__pyx_k_take_2d_axis1_int16_int64), 0, 0, 1, 1},
  {&__pyx_n_s_take_2d_axis1_int32_float64, __pyx_k_take_2d_axis1_int32_float64, sizeof(__pyx_k_take_2d_axis1_int32_float64), 0, 0, 1, 1},
  {&__pyx_n_s_take_2d_axis1_int32_int32, __pyx_k_take_2d_axis1_int32_int32, sizeof(__pyx_k_take_2d_axis1_int32_int32), 0, 0, 1, 1},
  {&__pyx_n_s_take_2d_axis1_int32_int64, __pyx_k_take_2d_axis1_int32_int64, sizeof(__pyx_k_take_2d_axis1_int32_int64), 0, 0, 1, 1},
  {&__pyx_n_s_take_2d_axis1_int64_float64, __pyx_k_take_2d_axis1_int64_float64, sizeof(__pyx_k_take_2d_axis1_int64_float64), 0, 0, 1, 1},
  {&__pyx_n_s_take_2d_axis1_int64_int64, __pyx_k_take_2d_axis1_int64_int64, sizeof(__pyx_k_take_2d_axis1_int64_int64), 0, 0, 1, 1},
  {&__pyx_n_s_take_2d_axis1_int8_float64, __pyx_k_take_2d_axis1_int8_float64, sizeof(__pyx_k_take_2d_axis1_int8_float64), 0, 0, 1, 1},
  {&__pyx_n_s_take_2d_axis1_int8_int32, __pyx_k_take_2d_axis1_int8_int32, sizeof(__pyx_k_take_2d_axis1_int8_int32), 0, 0, 1, 1},
  {&__pyx_n_s_take_2d_axis1_int8_int64, __pyx_k_take_2d_axis1_int8_int64, sizeof(__pyx_k_take_2d_axis1_int8_int64), 0, 0, 1, 1},
  {&__pyx_n_s_take_2d_axis1_int8_int8, __pyx_k_take_2d_axis1_int8_int8, sizeof(__pyx_k_take_2d_axis1_int8_int8), 0, 0, 1, 1},
  {&__pyx_n_s_take_2d_axis1_object_object, __pyx_k_take_2d_axis1_object_object, sizeof(__pyx_k_take_2d_axis1_object_object), 0, 0, 1, 1},
  {&__pyx_n_s_take_2d_multi_bool_bool, __pyx_k_take_2d_multi_bool_bool, sizeof(__pyx_k_take_2d_multi_bool_bool), 0, 0, 1, 1},
  {&__pyx_n_s_take_2d_multi_bool_object, __pyx_k_take_2d_multi_bool_object, sizeof(__pyx_k_take_2d_multi_bool_object), 0, 0, 1, 1},
  {&__pyx_n_s_take_2d_multi_float32_float32, __pyx_k_take_2d_multi_float32_float32, sizeof(__pyx_k_take_2d_multi_float32_float32), 0, 0, 1, 1},
  {&__pyx_n_s_take_2d_multi_float32_float64, __pyx_k_take_2d_multi_float32_float64, sizeof(__pyx_k_take_2d_multi_float32_float64), 0, 0, 1, 1},
  {&__pyx_n_s_take_2d_multi_float64_float64, __pyx_k_take_2d_multi_float64_float64, sizeof(__pyx_k_take_2d_multi_float64_float64), 0, 0, 1, 1},
  {&__pyx_n_s_take_2d_multi_int16_float64, __pyx_k_take_2d_multi_int16_float64, sizeof(__pyx_k_take_2d_multi_int16_float64), 0, 0, 1, 1},
  {&__pyx_n_s_take_2d_multi_int16_int16, __pyx_k_take_2d_multi_int16_int16, sizeof(__pyx_k_take_2d_multi_int16_int16), 0, 0, 1, 1},
  {&__pyx_n_s_take_2d_multi_int16_int32, __pyx_k_take_2d_multi_int16_int32, sizeof(__pyx_k_take_2d_multi_int16_int32), 0, 0, 1, 1},
  {&__pyx_n_s_take_2d_multi_int16_int64, __pyx_k_take_2d_multi_int16_int64, sizeof(__pyx_k_take_2d_multi_int16_int64), 0, 0, 1, 1},
  {&__pyx_n_s_take_2d_multi_int32_float64, __pyx_k_take_2d_multi_int32_float64, sizeof(__pyx_k_take_2d_multi_int32_float64), 0, 0, 1, 1},
  {&__pyx_n_s_take_2d_multi_int32_int32, __pyx_k_take_2d_multi_int32_int32, sizeof(__pyx_k_take_2d_multi_int32_int32), 0, 0, 1, 1},
  {&__pyx_n_s_take_2d_multi_int32_int64, __pyx_k_take_2d_multi_int32_int64, sizeof(__pyx_k_take_2d_multi_int32_int64), 0, 0, 1, 1},
  {&__pyx_n_s_take_2d_multi_int64_float64, __pyx_k_take_2d_multi_int64_float64, sizeof(__pyx_k_take_2d_multi_int64_float64), 0, 0, 1, 1},
  {&__pyx_n_s_take_2d_multi_int64_int64, __pyx_k_take_2d_multi_int64_int64, sizeof(__pyx_k_take_2d_multi_int64_int64), 0, 0, 1, 1},
  {&__pyx_n_s_take_2d_multi_int8_float64, __pyx_k_take_2d_multi_int8_float64, sizeof(__pyx_k_take_2d_multi_int8_float64), 0, 0, 1, 1},
  {&__pyx_n_s_take_2d_multi_int8_int32, __pyx_k_take_2d_multi_int8_int32, sizeof(__pyx_k_take_2d_multi_int8_int32), 0, 0, 1, 1},
  {&__pyx_n_s_take_2d_multi_int8_int64, __pyx_k_take_2d_multi_int8_int64, sizeof(__pyx_k_take_2d_multi_int8_int64), 0, 0, 1, 1},
  {&__pyx_n_s_take_2d_multi_int8_int8, __pyx_k_take_2d_multi_int8_int8, sizeof(__pyx_k_take_2d_multi_int8_int8), 0, 0, 1, 1},
  {&__pyx_n_s_take_2d_multi_object_object, __pyx_k_take_2d_multi_object_object, sizeof(__pyx_k_take_2d_multi_object_object), 0, 0, 1, 1},
  {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1},
  {&__pyx_n_s_tiebreak, __pyx_k_tiebreak, sizeof(__pyx_k_tiebreak), 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_top, __pyx_k_top, sizeof(__pyx_k_top), 0, 0, 1, 1},
  {&__pyx_n_s_tot_wgt, __pyx_k_tot_wgt, sizeof(__pyx_k_tot_wgt), 0, 0, 1, 1},
  {&__pyx_n_s_total_tie_count, __pyx_k_total_tie_count, sizeof(__pyx_k_total_tie_count), 0, 0, 1, 1},
  {&__pyx_n_s_u, __pyx_k_u, sizeof(__pyx_k_u), 0, 0, 1, 1},
  {&__pyx_n_s_uint16_t, __pyx_k_uint16_t, sizeof(__pyx_k_uint16_t), 0, 0, 1, 1},
  {&__pyx_n_s_uint32_t, __pyx_k_uint32_t, sizeof(__pyx_k_uint32_t), 0, 0, 1, 1},
  {&__pyx_n_s_uint64_t, __pyx_k_uint64_t, sizeof(__pyx_k_uint64_t), 0, 0, 1, 1},
  {&__pyx_n_s_uint8, __pyx_k_uint8, sizeof(__pyx_k_uint8), 0, 0, 1, 1},
  {&__pyx_n_s_uint8_t, __pyx_k_uint8_t, sizeof(__pyx_k_uint8_t), 0, 0, 1, 1},
  {&__pyx_kp_s_unable_to_allocate_array_data, __pyx_k_unable_to_allocate_array_data, sizeof(__pyx_k_unable_to_allocate_array_data), 0, 0, 1, 0},
  {&__pyx_kp_s_unable_to_allocate_shape_and_str, __pyx_k_unable_to_allocate_shape_and_str, sizeof(__pyx_k_unable_to_allocate_shape_and_str), 0, 0, 1, 0},
  {&__pyx_kp_u_unknown_dtype_code_in_numpy_pxd, __pyx_k_unknown_dtype_code_in_numpy_pxd, sizeof(__pyx_k_unknown_dtype_code_in_numpy_pxd), 0, 1, 0, 0},
  {&__pyx_n_s_unpack, __pyx_k_unpack, sizeof(__pyx_k_unpack), 0, 0, 1, 1},
  {&__pyx_n_s_v, __pyx_k_v, sizeof(__pyx_k_v), 0, 0, 1, 1},
  {&__pyx_n_s_val, __pyx_k_val, sizeof(__pyx_k_val), 0, 0, 1, 1},
  {&__pyx_n_s_val_in, __pyx_k_val_in, sizeof(__pyx_k_val_in), 0, 0, 1, 1},
  {&__pyx_n_s_val_win, __pyx_k_val_win, sizeof(__pyx_k_val_win), 0, 0, 1, 1},
  {&__pyx_n_s_valid_locs, __pyx_k_valid_locs, sizeof(__pyx_k_valid_locs), 0, 0, 1, 1},
  {&__pyx_n_s_value, __pyx_k_value, sizeof(__pyx_k_value), 0, 0, 1, 1},
  {&__pyx_n_s_values, __pyx_k_values, sizeof(__pyx_k_values), 0, 0, 1, 1},
  {&__pyx_n_s_vclose, __pyx_k_vclose, sizeof(__pyx_k_vclose), 0, 0, 1, 1},
  {&__pyx_n_s_vecs, __pyx_k_vecs, sizeof(__pyx_k_vecs), 0, 0, 1, 1},
  {&__pyx_n_s_vhigh, __pyx_k_vhigh, sizeof(__pyx_k_vhigh), 0, 0, 1, 1},
  {&__pyx_n_s_view, __pyx_k_view, sizeof(__pyx_k_view), 0, 0, 1, 1},
  {&__pyx_n_s_vlow, __pyx_k_vlow, sizeof(__pyx_k_vlow), 0, 0, 1, 1},
  {&__pyx_n_s_vopen, __pyx_k_vopen, sizeof(__pyx_k_vopen), 0, 0, 1, 1},
  {&__pyx_n_s_vx, __pyx_k_vx, sizeof(__pyx_k_vx), 0, 0, 1, 1},
  {&__pyx_n_s_vy, __pyx_k_vy, sizeof(__pyx_k_vy), 0, 0, 1, 1},
  {&__pyx_n_s_w, __pyx_k_w, sizeof(__pyx_k_w), 0, 0, 1, 1},
  {&__pyx_n_s_weights, __pyx_k_weights, sizeof(__pyx_k_weights), 0, 0, 1, 1},
  {&__pyx_n_s_where, __pyx_k_where, sizeof(__pyx_k_where), 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_win_i, __pyx_k_win_i, sizeof(__pyx_k_win_i), 0, 0, 1, 1},
  {&__pyx_n_s_win_k, __pyx_k_win_k, sizeof(__pyx_k_win_k), 0, 0, 1, 1},
  {&__pyx_n_s_win_n, __pyx_k_win_n, sizeof(__pyx_k_win_n), 0, 0, 1, 1},
  {&__pyx_n_s_window, __pyx_k_window, sizeof(__pyx_k_window), 0, 0, 1, 1},
  {&__pyx_n_s_x, __pyx_k_x, sizeof(__pyx_k_x), 0, 0, 1, 1},
  {&__pyx_n_s_xi, __pyx_k_xi, sizeof(__pyx_k_xi), 0, 0, 1, 1},
  {&__pyx_n_s_xrange, __pyx_k_xrange, sizeof(__pyx_k_xrange), 0, 0, 1, 1},
  {&__pyx_n_s_xx, __pyx_k_xx, sizeof(__pyx_k_xx), 0, 0, 1, 1},
  {&__pyx_n_s_xxx, __pyx_k_xxx, sizeof(__pyx_k_xxx), 0, 0, 1, 1},
  {&__pyx_n_s_xxxx, __pyx_k_xxxx, sizeof(__pyx_k_xxxx), 0, 0, 1, 1},
  {&__pyx_n_s_y, __pyx_k_y, sizeof(__pyx_k_y), 0, 0, 1, 1},
  {&__pyx_n_s_year, __pyx_k_year, sizeof(__pyx_k_year), 0, 0, 1, 1},
  {&__pyx_n_s_yi, __pyx_k_yi, sizeof(__pyx_k_yi), 0, 0, 1, 1},
  {&__pyx_n_s_z, __pyx_k_z, sizeof(__pyx_k_z), 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_zip, __pyx_k_zip, sizeof(__pyx_k_zip), 0, 0, 1, 1},
  {0, 0, 0, 0, 0, 0, 0}
};
static int __Pyx_InitCachedBuiltins(void) {
  __pyx_builtin_object = __Pyx_GetBuiltinName(__pyx_n_s_object); if (!__pyx_builtin_object) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 568; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_range) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 73; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_builtin_KeyError = __Pyx_GetBuiltinName(__pyx_n_s_KeyError); if (!__pyx_builtin_KeyError) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 138; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_builtin_TypeError = __Pyx_GetBuiltinName(__pyx_n_s_TypeError); if (!__pyx_builtin_TypeError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 512; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError); if (!__pyx_builtin_ValueError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 548; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_builtin_ImportError = __Pyx_GetBuiltinName(__pyx_n_s_ImportError); if (!__pyx_builtin_ImportError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_builtin_ord = __Pyx_GetBuiltinName(__pyx_n_s_ord); if (!__pyx_builtin_ord) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_builtin_zip = __Pyx_GetBuiltinName(__pyx_n_s_zip); if (!__pyx_builtin_zip) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_builtin_AssertionError = __Pyx_GetBuiltinName(__pyx_n_s_AssertionError); if (!__pyx_builtin_AssertionError) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1973; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_builtin_NotImplementedError = __Pyx_GetBuiltinName(__pyx_n_s_NotImplementedError); if (!__pyx_builtin_NotImplementedError) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6508; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_builtin_RuntimeError = __Pyx_GetBuiltinName(__pyx_n_s_RuntimeError); if (!__pyx_builtin_RuntimeError) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 803; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_builtin_IndexError = __Pyx_GetBuiltinName(__pyx_n_s_IndexError); if (!__pyx_builtin_IndexError) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 40; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_builtin_MemoryError = __Pyx_GetBuiltinName(__pyx_n_s_MemoryError); if (!__pyx_builtin_MemoryError) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 142; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_builtin_enumerate = __Pyx_GetBuiltinName(__pyx_n_s_enumerate); if (!__pyx_builtin_enumerate) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 145; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_builtin_Ellipsis = __Pyx_GetBuiltinName(__pyx_n_s_Ellipsis); if (!__pyx_builtin_Ellipsis) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 357; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  #if PY_MAJOR_VERSION >= 3
  __pyx_builtin_xrange = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_xrange) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 514; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  #else
  __pyx_builtin_xrange = __Pyx_GetBuiltinName(__pyx_n_s_xrange); if (!__pyx_builtin_xrange) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 514; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  #endif
  __pyx_builtin_id = __Pyx_GetBuiltinName(__pyx_n_s_id); if (!__pyx_builtin_id) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 569; __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", 0);

  /* "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_tuple_ = PyTuple_Pack(1, __pyx_kp_s_Not_Found); if (unlikely(!__pyx_tuple_)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 138; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple_);
  __Pyx_GIVEREF(__pyx_tuple_);

  /* "pandas/algos.pyx":192
 * 
 *     if not ascending:
 *         _as = _as[::-1]             # <<<<<<<<<<<<<<
 * 
 *     sorted_data = values.take(_as)
 */
  __pyx_slice__2 = PySlice_New(Py_None, Py_None, __pyx_int_neg_1); if (unlikely(!__pyx_slice__2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 192; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_slice__2);
  __Pyx_GIVEREF(__pyx_slice__2);

  /* "pandas/algos.pyx":195
 * 
 *     sorted_data = values.take(_as)
 *     argsorted = _as.astype('i8')             # <<<<<<<<<<<<<<
 * 
 *     for i in range(n):
 */
  __pyx_tuple__3 = PyTuple_Pack(1, __pyx_n_s_i8); if (unlikely(!__pyx_tuple__3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 195; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__3);
  __Pyx_GIVEREF(__pyx_tuple__3);

  /* "pandas/algos.pyx":264
 * 
 *     if not ascending:
 *         _as = _as[::-1]             # <<<<<<<<<<<<<<
 * 
 *     sorted_data = values.take(_as)
 */
  __pyx_slice__4 = PySlice_New(Py_None, Py_None, __pyx_int_neg_1); if (unlikely(!__pyx_slice__4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 264; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_slice__4);
  __Pyx_GIVEREF(__pyx_slice__4);

  /* "pandas/algos.pyx":267
 * 
 *     sorted_data = values.take(_as)
 *     argsorted = _as.astype('i8')             # <<<<<<<<<<<<<<
 * 
 *     for i in range(n):
 */
  __pyx_tuple__5 = PyTuple_Pack(1, __pyx_n_s_i8); if (unlikely(!__pyx_tuple__5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 267; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__5);
  __Pyx_GIVEREF(__pyx_tuple__5);

  /* "pandas/algos.pyx":344
 *             tiebreak = TIEBREAK_FIRST_DESCENDING
 *     else:
 *         _as = values.argsort(1)             # <<<<<<<<<<<<<<
 * 
 *     if not ascending:
 */
  __pyx_tuple__6 = PyTuple_Pack(1, __pyx_int_1); if (unlikely(!__pyx_tuple__6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 344; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__6);
  __Pyx_GIVEREF(__pyx_tuple__6);

  /* "pandas/algos.pyx":347
 * 
 *     if not ascending:
 *         _as = _as[:, ::-1]             # <<<<<<<<<<<<<<
 * 
 *     values = _take_2d_float64(values, _as)
 */
  __pyx_slice__7 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 347; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_slice__7);
  __Pyx_GIVEREF(__pyx_slice__7);
  __pyx_slice__8 = PySlice_New(Py_None, Py_None, __pyx_int_neg_1); if (unlikely(!__pyx_slice__8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 347; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_slice__8);
  __Pyx_GIVEREF(__pyx_slice__8);
  __pyx_tuple__9 = PyTuple_Pack(2, __pyx_slice__7, __pyx_slice__8); if (unlikely(!__pyx_tuple__9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 347; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__9);
  __Pyx_GIVEREF(__pyx_tuple__9);

  /* "pandas/algos.pyx":350
 * 
 *     values = _take_2d_float64(values, _as)
 *     argsorted = _as.astype('i8')             # <<<<<<<<<<<<<<
 * 
 *     for i in range(n):
 */
  __pyx_tuple__10 = PyTuple_Pack(1, __pyx_n_s_i8); if (unlikely(!__pyx_tuple__10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 350; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__10);
  __Pyx_GIVEREF(__pyx_tuple__10);

  /* "pandas/algos.pyx":386
 *                 sum_ranks = dups = 0
 *         if pct:
 *             ranks[i, :] /= count             # <<<<<<<<<<<<<<
 *     if axis == 0:
 *         return ranks.T
 */
  __pyx_slice__11 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 386; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_slice__11);
  __Pyx_GIVEREF(__pyx_slice__11);

  /* "pandas/algos.pyx":424
 *             tiebreak = TIEBREAK_FIRST_DESCENDING
 *     else:
 *         _as = values.argsort(1)             # <<<<<<<<<<<<<<
 * 
 *     if not ascending:
 */
  __pyx_tuple__12 = PyTuple_Pack(1, __pyx_int_1); if (unlikely(!__pyx_tuple__12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 424; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__12);
  __Pyx_GIVEREF(__pyx_tuple__12);

  /* "pandas/algos.pyx":427
 * 
 *     if not ascending:
 *         _as = _as[:, ::-1]             # <<<<<<<<<<<<<<
 * 
 *     values = _take_2d_int64(values, _as)
 */
  __pyx_slice__13 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 427; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_slice__13);
  __Pyx_GIVEREF(__pyx_slice__13);
  __pyx_slice__14 = PySlice_New(Py_None, Py_None, __pyx_int_neg_1); if (unlikely(!__pyx_slice__14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 427; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_slice__14);
  __Pyx_GIVEREF(__pyx_slice__14);
  __pyx_tuple__15 = PyTuple_Pack(2, __pyx_slice__13, __pyx_slice__14); if (unlikely(!__pyx_tuple__15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 427; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__15);
  __Pyx_GIVEREF(__pyx_tuple__15);

  /* "pandas/algos.pyx":430
 * 
 *     values = _take_2d_int64(values, _as)
 *     argsorted = _as.astype('i8')             # <<<<<<<<<<<<<<
 * 
 *     for i in range(n):
 */
  __pyx_tuple__16 = PyTuple_Pack(1, __pyx_n_s_i8); if (unlikely(!__pyx_tuple__16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 430; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__16);
  __Pyx_GIVEREF(__pyx_tuple__16);

  /* "pandas/algos.pyx":463
 *                 sum_ranks = dups = 0
 *         if pct:
 *             ranks[i, :] /= count             # <<<<<<<<<<<<<<
 *     if axis == 0:
 *         return ranks.T
 */
  __pyx_slice__17 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 463; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_slice__17);
  __Pyx_GIVEREF(__pyx_slice__17);

  /* "pandas/algos.pyx":495
 * 
 *     if values.dtype != np.object_:
 *         values = values.astype('O')             # <<<<<<<<<<<<<<
 * 
 *     if ascending ^ (na_option == 'top'):
 */
  __pyx_tuple__18 = PyTuple_Pack(1, __pyx_n_s_O); if (unlikely(!__pyx_tuple__18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 495; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__18);
  __Pyx_GIVEREF(__pyx_tuple__18);

  /* "pandas/algos.pyx":524
 * 
 *     if not ascending:
 *         _as = _as[::-1]             # <<<<<<<<<<<<<<
 * 
 *     sorted_data = values.take(_as)
 */
  __pyx_slice__19 = PySlice_New(Py_None, Py_None, __pyx_int_neg_1); if (unlikely(!__pyx_slice__19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 524; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_slice__19);
  __Pyx_GIVEREF(__pyx_slice__19);

  /* "pandas/algos.pyx":527
 * 
 *     sorted_data = values.take(_as)
 *     argsorted = _as.astype('i8')             # <<<<<<<<<<<<<<
 *     for i in range(n):
 *         sum_ranks += i + 1
 */
  __pyx_tuple__20 = PyTuple_Pack(1, __pyx_n_s_i8); if (unlikely(!__pyx_tuple__20)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 527; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__20);
  __Pyx_GIVEREF(__pyx_tuple__20);

  /* "pandas/algos.pyx":548
 *                     ranks[argsorted[j]] = i + 1
 *             elif tiebreak == TIEBREAK_FIRST:
 *                 raise ValueError('first not supported for non-numeric data')             # <<<<<<<<<<<<<<
 *             elif tiebreak == TIEBREAK_DENSE:
 *                 total_tie_count += 1
 */
  __pyx_tuple__21 = PyTuple_Pack(1, __pyx_kp_s_first_not_supported_for_non_nume); if (unlikely(!__pyx_tuple__21)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 548; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__21);
  __Pyx_GIVEREF(__pyx_tuple__21);

  /* "pandas/algos.pyx":618
 * 
 *     if values.dtype != np.object_:
 *         values = values.astype('O')             # <<<<<<<<<<<<<<
 * 
 *     if ascending ^ (na_option == 'top'):
 */
  __pyx_tuple__22 = PyTuple_Pack(1, __pyx_n_s_O); if (unlikely(!__pyx_tuple__22)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 618; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__22);
  __Pyx_GIVEREF(__pyx_tuple__22);

  /* "pandas/algos.pyx":633
 * 
 *     try:
 *         _as = values.argsort(1)             # <<<<<<<<<<<<<<
 *     except TypeError:
 *         values = in_arr
 */
  __pyx_tuple__23 = PyTuple_Pack(1, __pyx_int_1); if (unlikely(!__pyx_tuple__23)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 633; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__23);
  __Pyx_GIVEREF(__pyx_tuple__23);

  /* "pandas/algos.pyx":647
 * 
 *     if not ascending:
 *         _as = _as[:, ::-1]             # <<<<<<<<<<<<<<
 * 
 *     values = _take_2d_object(values, _as)
 */
  __pyx_slice__24 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__24)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 647; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_slice__24);
  __Pyx_GIVEREF(__pyx_slice__24);
  __pyx_slice__25 = PySlice_New(Py_None, Py_None, __pyx_int_neg_1); if (unlikely(!__pyx_slice__25)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 647; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_slice__25);
  __Pyx_GIVEREF(__pyx_slice__25);
  __pyx_tuple__26 = PyTuple_Pack(2, __pyx_slice__24, __pyx_slice__25); if (unlikely(!__pyx_tuple__26)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 647; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__26);
  __Pyx_GIVEREF(__pyx_tuple__26);

  /* "pandas/algos.pyx":650
 * 
 *     values = _take_2d_object(values, _as)
 *     argsorted = _as.astype('i8')             # <<<<<<<<<<<<<<
 * 
 *     for i in range(n):
 */
  __pyx_tuple__27 = PyTuple_Pack(1, __pyx_n_s_i8); if (unlikely(!__pyx_tuple__27)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 650; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__27);
  __Pyx_GIVEREF(__pyx_tuple__27);

  /* "pandas/algos.pyx":676
 *                         ranks[i, argsorted[i, z]] = j + 1
 *                 elif tiebreak == TIEBREAK_FIRST:
 *                     raise ValueError('first not supported for '             # <<<<<<<<<<<<<<
 *                                      'non-numeric data')
 *                 elif tiebreak == TIEBREAK_DENSE:
 */
  __pyx_tuple__28 = PyTuple_Pack(1, __pyx_kp_s_first_not_supported_for_non_nume); if (unlikely(!__pyx_tuple__28)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 676; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__28);
  __Pyx_GIVEREF(__pyx_tuple__28);

  /* "pandas/algos.pyx":684
 *                 sum_ranks = dups = 0
 *         if pct:
 *             ranks[i, :] /= count             # <<<<<<<<<<<<<<
 *     if axis == 0:
 *         return ranks.T
 */
  __pyx_slice__29 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__29)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 684; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_slice__29);
  __Pyx_GIVEREF(__pyx_slice__29);

  /* "pandas/algos.pyx":724
 *         minp = 1
 *     elif minp < 0:
 *         raise ValueError('min_periods must be >= 0')             # <<<<<<<<<<<<<<
 *     return minp
 * 
 */
  __pyx_tuple__30 = PyTuple_Pack(1, __pyx_kp_s_min_periods_must_be_0); if (unlikely(!__pyx_tuple__30)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 724; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__30);
  __Pyx_GIVEREF(__pyx_tuple__30);

  /* "pandas/algos.pyx":770
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * cpdef numeric kth_smallest(numeric[:] a, Py_ssize_t k):             # <<<<<<<<<<<<<<
 *     cdef:
 *         Py_ssize_t i, j, l, m, n = a.size
 */
  __pyx_tuple__31 = PyTuple_Pack(2, __pyx_n_s_i, __pyx_n_s_u); if (unlikely(!__pyx_tuple__31)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__31);
  __Pyx_GIVEREF(__pyx_tuple__31);
  __pyx_tuple__33 = PyTuple_Pack(1, __pyx_kp_s__32); if (unlikely(!__pyx_tuple__33)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__33);
  __Pyx_GIVEREF(__pyx_tuple__33);
  __pyx_tuple__35 = PyTuple_Pack(1, __pyx_kp_s__34); if (unlikely(!__pyx_tuple__35)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__35);
  __Pyx_GIVEREF(__pyx_tuple__35);
  __pyx_tuple__36 = PyTuple_Pack(1, __pyx_kp_s_No_matching_signature_found); if (unlikely(!__pyx_tuple__36)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__36);
  __Pyx_GIVEREF(__pyx_tuple__36);
  __pyx_tuple__37 = PyTuple_Pack(1, __pyx_kp_s_Function_call_with_ambiguous_arg); if (unlikely(!__pyx_tuple__37)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__37);
  __Pyx_GIVEREF(__pyx_tuple__37);

  /* "pandas/algos.pyx":823
 * 
 * 
 * cpdef numeric median(numeric[:] arr):             # <<<<<<<<<<<<<<
 *     '''
 *     A faster median
 */
  __pyx_tuple__38 = PyTuple_Pack(2, __pyx_n_s_i, __pyx_n_s_u); if (unlikely(!__pyx_tuple__38)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__38);
  __Pyx_GIVEREF(__pyx_tuple__38);
  __pyx_tuple__39 = PyTuple_Pack(1, __pyx_kp_s__32); if (unlikely(!__pyx_tuple__39)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__39);
  __Pyx_GIVEREF(__pyx_tuple__39);
  __pyx_tuple__40 = PyTuple_Pack(1, __pyx_kp_s__34); if (unlikely(!__pyx_tuple__40)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__40);
  __Pyx_GIVEREF(__pyx_tuple__40);
  __pyx_tuple__41 = PyTuple_Pack(1, __pyx_kp_s_No_matching_signature_found); if (unlikely(!__pyx_tuple__41)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__41);
  __Pyx_GIVEREF(__pyx_tuple__41);
  __pyx_tuple__42 = PyTuple_Pack(1, __pyx_kp_s_Function_call_with_ambiguous_arg); if (unlikely(!__pyx_tuple__42)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__42);
  __Pyx_GIVEREF(__pyx_tuple__42);

  /* "pandas/algos.pyx":851
 * 
 *     if len(arr) == 0:
 *         return (-1,-1,None)             # <<<<<<<<<<<<<<
 * 
 *     m = arr[0]
 */
  __pyx_tuple__43 = PyTuple_Pack(3, __pyx_int_neg_1, __pyx_int_neg_1, Py_None); if (unlikely(!__pyx_tuple__43)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 851; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__43);
  __Pyx_GIVEREF(__pyx_tuple__43);

  /* "pandas/algos.pyx":1702
 * cdef double_t _get_min(object skiplist, int nobs, int minp):
 *     if nobs >= minp:
 *         return <IndexableSkiplist> skiplist.get(0)             # <<<<<<<<<<<<<<
 *     else:
 *         return NaN
 */
  __pyx_tuple__44 = PyTuple_Pack(1, __pyx_int_0); if (unlikely(!__pyx_tuple__44)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1702; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__44);
  __Pyx_GIVEREF(__pyx_tuple__44);

  /* "pandas/algos.pyx":1761
 * 
 *     if not input.flags.c_contiguous:
 *         input = input.copy('C')             # <<<<<<<<<<<<<<
 * 
 *     buf = <float64_t*> input.data
 */
  __pyx_tuple__45 = PyTuple_Pack(1, __pyx_n_s_C); if (unlikely(!__pyx_tuple__45)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1761; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__45);
  __Pyx_GIVEREF(__pyx_tuple__45);

  /* "pandas/algos.pyx":2213
 * 
 *     indexer, _counts = groupsort_indexer(labels, ngroups)
 *     counts[:] = _counts[1:]             # <<<<<<<<<<<<<<
 * 
 *     data = np.empty((K, N), dtype=np.float64)
 */
  __pyx_slice__46 = PySlice_New(__pyx_int_1, Py_None, Py_None); if (unlikely(!__pyx_slice__46)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2213; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_slice__46);
  __Pyx_GIVEREF(__pyx_slice__46);
  __pyx_slice__47 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__47)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2213; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_slice__47);
  __Pyx_GIVEREF(__pyx_slice__47);

  /* "pandas/src/join.pyx":193
 *         # length-0 case
 *         res = np.empty(len(indexer), dtype=np.int64)
 *         res.fill(-1)             # <<<<<<<<<<<<<<
 * 
 *     return res
 */
  __pyx_tuple__48 = PyTuple_Pack(1, __pyx_int_neg_1); if (unlikely(!__pyx_tuple__48)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 193; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__48);
  __Pyx_GIVEREF(__pyx_tuple__48);

  /* "pandas/src/join.pyx":229
 * 
 *     last_obs = np.empty(max_group, dtype=np.int64)
 *     last_obs.fill(-1)             # <<<<<<<<<<<<<<
 * 
 *     for i in range(n):
 */
  __pyx_tuple__49 = PyTuple_Pack(1, __pyx_int_neg_1); if (unlikely(!__pyx_tuple__49)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 229; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__49);
  __Pyx_GIVEREF(__pyx_tuple__49);

  /* "pandas/src/generated.pyx":269
 *     nright = len(new)
 *     indexer = np.empty(nright, dtype=np.int64)
 *     indexer.fill(-1)             # <<<<<<<<<<<<<<
 * 
 *     if limit is None:
 */
  __pyx_tuple__50 = PyTuple_Pack(1, __pyx_int_neg_1); if (unlikely(!__pyx_tuple__50)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 269; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__50);
  __Pyx_GIVEREF(__pyx_tuple__50);

  /* "pandas/src/generated.pyx":275
 *     else:
 *         if limit < 0:
 *             raise ValueError('Limit must be non-negative')             # <<<<<<<<<<<<<<
 *         lim = limit
 * 
 */
  __pyx_tuple__51 = PyTuple_Pack(1, __pyx_kp_s_Limit_must_be_non_negative); if (unlikely(!__pyx_tuple__51)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 275; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__51);
  __Pyx_GIVEREF(__pyx_tuple__51);

  /* "pandas/src/generated.pyx":330
 *     nright = len(new)
 *     indexer = np.empty(nright, dtype=np.int64)
 *     indexer.fill(-1)             # <<<<<<<<<<<<<<
 * 
 *     if limit is None:
 */
  __pyx_tuple__52 = PyTuple_Pack(1, __pyx_int_neg_1); if (unlikely(!__pyx_tuple__52)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 330; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__52);
  __Pyx_GIVEREF(__pyx_tuple__52);

  /* "pandas/src/generated.pyx":336
 *     else:
 *         if limit < 0:
 *             raise ValueError('Limit must be non-negative')             # <<<<<<<<<<<<<<
 *         lim = limit
 * 
 */
  __pyx_tuple__53 = PyTuple_Pack(1, __pyx_kp_s_Limit_must_be_non_negative); if (unlikely(!__pyx_tuple__53)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 336; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__53);
  __Pyx_GIVEREF(__pyx_tuple__53);

  /* "pandas/src/generated.pyx":391
 *     nright = len(new)
 *     indexer = np.empty(nright, dtype=np.int64)
 *     indexer.fill(-1)             # <<<<<<<<<<<<<<
 * 
 *     if limit is None:
 */
  __pyx_tuple__54 = PyTuple_Pack(1, __pyx_int_neg_1); if (unlikely(!__pyx_tuple__54)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 391; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__54);
  __Pyx_GIVEREF(__pyx_tuple__54);

  /* "pandas/src/generated.pyx":397
 *     else:
 *         if limit < 0:
 *             raise ValueError('Limit must be non-negative')             # <<<<<<<<<<<<<<
 *         lim = limit
 * 
 */
  __pyx_tuple__55 = PyTuple_Pack(1, __pyx_kp_s_Limit_must_be_non_negative); if (unlikely(!__pyx_tuple__55)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 397; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__55);
  __Pyx_GIVEREF(__pyx_tuple__55);

  /* "pandas/src/generated.pyx":452
 *     nright = len(new)
 *     indexer = np.empty(nright, dtype=np.int64)
 *     indexer.fill(-1)             # <<<<<<<<<<<<<<
 * 
 *     if limit is None:
 */
  __pyx_tuple__56 = PyTuple_Pack(1, __pyx_int_neg_1); if (unlikely(!__pyx_tuple__56)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 452; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__56);
  __Pyx_GIVEREF(__pyx_tuple__56);

  /* "pandas/src/generated.pyx":458
 *     else:
 *         if limit < 0:
 *             raise ValueError('Limit must be non-negative')             # <<<<<<<<<<<<<<
 *         lim = limit
 * 
 */
  __pyx_tuple__57 = PyTuple_Pack(1, __pyx_kp_s_Limit_must_be_non_negative); if (unlikely(!__pyx_tuple__57)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 458; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__57);
  __Pyx_GIVEREF(__pyx_tuple__57);

  /* "pandas/src/generated.pyx":513
 *     nright = len(new)
 *     indexer = np.empty(nright, dtype=np.int64)
 *     indexer.fill(-1)             # <<<<<<<<<<<<<<
 * 
 *     if limit is None:
 */
  __pyx_tuple__58 = PyTuple_Pack(1, __pyx_int_neg_1); if (unlikely(!__pyx_tuple__58)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 513; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__58);
  __Pyx_GIVEREF(__pyx_tuple__58);

  /* "pandas/src/generated.pyx":519
 *     else:
 *         if limit < 0:
 *             raise ValueError('Limit must be non-negative')             # <<<<<<<<<<<<<<
 *         lim = limit
 * 
 */
  __pyx_tuple__59 = PyTuple_Pack(1, __pyx_kp_s_Limit_must_be_non_negative); if (unlikely(!__pyx_tuple__59)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 519; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__59);
  __Pyx_GIVEREF(__pyx_tuple__59);

  /* "pandas/src/generated.pyx":574
 *     nright = len(new)
 *     indexer = np.empty(nright, dtype=np.int64)
 *     indexer.fill(-1)             # <<<<<<<<<<<<<<
 * 
 *     if limit is None:
 */
  __pyx_tuple__60 = PyTuple_Pack(1, __pyx_int_neg_1); if (unlikely(!__pyx_tuple__60)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 574; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__60);
  __Pyx_GIVEREF(__pyx_tuple__60);

  /* "pandas/src/generated.pyx":580
 *     else:
 *         if limit < 0:
 *             raise ValueError('Limit must be non-negative')             # <<<<<<<<<<<<<<
 *         lim = limit
 * 
 */
  __pyx_tuple__61 = PyTuple_Pack(1, __pyx_kp_s_Limit_must_be_non_negative); if (unlikely(!__pyx_tuple__61)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 580; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__61);
  __Pyx_GIVEREF(__pyx_tuple__61);

  /* "pandas/src/generated.pyx":636
 *     nright = len(new)
 *     indexer = np.empty(nright, dtype=np.int64)
 *     indexer.fill(-1)             # <<<<<<<<<<<<<<
 * 
 *     if limit is None:
 */
  __pyx_tuple__62 = PyTuple_Pack(1, __pyx_int_neg_1); if (unlikely(!__pyx_tuple__62)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 636; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__62);
  __Pyx_GIVEREF(__pyx_tuple__62);

  /* "pandas/src/generated.pyx":642
 *     else:
 *         if limit < 0:
 *             raise ValueError('Limit must be non-negative')             # <<<<<<<<<<<<<<
 *         lim = limit
 * 
 */
  __pyx_tuple__63 = PyTuple_Pack(1, __pyx_kp_s_Limit_must_be_non_negative); if (unlikely(!__pyx_tuple__63)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 642; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__63);
  __Pyx_GIVEREF(__pyx_tuple__63);

  /* "pandas/src/generated.pyx":698
 *     nright = len(new)
 *     indexer = np.empty(nright, dtype=np.int64)
 *     indexer.fill(-1)             # <<<<<<<<<<<<<<
 * 
 *     if limit is None:
 */
  __pyx_tuple__64 = PyTuple_Pack(1, __pyx_int_neg_1); if (unlikely(!__pyx_tuple__64)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 698; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__64);
  __Pyx_GIVEREF(__pyx_tuple__64);

  /* "pandas/src/generated.pyx":704
 *     else:
 *         if limit < 0:
 *             raise ValueError('Limit must be non-negative')             # <<<<<<<<<<<<<<
 *         lim = limit
 * 
 */
  __pyx_tuple__65 = PyTuple_Pack(1, __pyx_kp_s_Limit_must_be_non_negative); if (unlikely(!__pyx_tuple__65)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 704; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__65);
  __Pyx_GIVEREF(__pyx_tuple__65);

  /* "pandas/src/generated.pyx":760
 *     nright = len(new)
 *     indexer = np.empty(nright, dtype=np.int64)
 *     indexer.fill(-1)             # <<<<<<<<<<<<<<
 * 
 *     if limit is None:
 */
  __pyx_tuple__66 = PyTuple_Pack(1, __pyx_int_neg_1); if (unlikely(!__pyx_tuple__66)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 760; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__66);
  __Pyx_GIVEREF(__pyx_tuple__66);

  /* "pandas/src/generated.pyx":766
 *     else:
 *         if limit < 0:
 *             raise ValueError('Limit must be non-negative')             # <<<<<<<<<<<<<<
 *         lim = limit
 * 
 */
  __pyx_tuple__67 = PyTuple_Pack(1, __pyx_kp_s_Limit_must_be_non_negative); if (unlikely(!__pyx_tuple__67)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 766; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__67);
  __Pyx_GIVEREF(__pyx_tuple__67);

  /* "pandas/src/generated.pyx":822
 *     nright = len(new)
 *     indexer = np.empty(nright, dtype=np.int64)
 *     indexer.fill(-1)             # <<<<<<<<<<<<<<
 * 
 *     if limit is None:
 */
  __pyx_tuple__68 = PyTuple_Pack(1, __pyx_int_neg_1); if (unlikely(!__pyx_tuple__68)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 822; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__68);
  __Pyx_GIVEREF(__pyx_tuple__68);

  /* "pandas/src/generated.pyx":828
 *     else:
 *         if limit < 0:
 *             raise ValueError('Limit must be non-negative')             # <<<<<<<<<<<<<<
 *         lim = limit
 * 
 */
  __pyx_tuple__69 = PyTuple_Pack(1, __pyx_kp_s_Limit_must_be_non_negative); if (unlikely(!__pyx_tuple__69)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 828; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__69);
  __Pyx_GIVEREF(__pyx_tuple__69);

  /* "pandas/src/generated.pyx":884
 *     nright = len(new)
 *     indexer = np.empty(nright, dtype=np.int64)
 *     indexer.fill(-1)             # <<<<<<<<<<<<<<
 * 
 *     if limit is None:
 */
  __pyx_tuple__70 = PyTuple_Pack(1, __pyx_int_neg_1); if (unlikely(!__pyx_tuple__70)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 884; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__70);
  __Pyx_GIVEREF(__pyx_tuple__70);

  /* "pandas/src/generated.pyx":890
 *     else:
 *         if limit < 0:
 *             raise ValueError('Limit must be non-negative')             # <<<<<<<<<<<<<<
 *         lim = limit
 * 
 */
  __pyx_tuple__71 = PyTuple_Pack(1, __pyx_kp_s_Limit_must_be_non_negative); if (unlikely(!__pyx_tuple__71)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 890; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__71);
  __Pyx_GIVEREF(__pyx_tuple__71);

  /* "pandas/src/generated.pyx":946
 *     nright = len(new)
 *     indexer = np.empty(nright, dtype=np.int64)
 *     indexer.fill(-1)             # <<<<<<<<<<<<<<
 * 
 *     if limit is None:
 */
  __pyx_tuple__72 = PyTuple_Pack(1, __pyx_int_neg_1); if (unlikely(!__pyx_tuple__72)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 946; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__72);
  __Pyx_GIVEREF(__pyx_tuple__72);

  /* "pandas/src/generated.pyx":952
 *     else:
 *         if limit < 0:
 *             raise ValueError('Limit must be non-negative')             # <<<<<<<<<<<<<<
 *         lim = limit
 * 
 */
  __pyx_tuple__73 = PyTuple_Pack(1, __pyx_kp_s_Limit_must_be_non_negative); if (unlikely(!__pyx_tuple__73)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 952; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__73);
  __Pyx_GIVEREF(__pyx_tuple__73);

  /* "pandas/src/generated.pyx":1016
 *     else:
 *         if limit < 0:
 *             raise ValueError('Limit must be non-negative')             # <<<<<<<<<<<<<<
 *         lim = limit
 * 
 */
  __pyx_tuple__74 = PyTuple_Pack(1, __pyx_kp_s_Limit_must_be_non_negative); if (unlikely(!__pyx_tuple__74)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1016; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__74);
  __Pyx_GIVEREF(__pyx_tuple__74);

  /* "pandas/src/generated.pyx":1049
 *     else:
 *         if limit < 0:
 *             raise ValueError('Limit must be non-negative')             # <<<<<<<<<<<<<<
 *         lim = limit
 * 
 */
  __pyx_tuple__75 = PyTuple_Pack(1, __pyx_kp_s_Limit_must_be_non_negative); if (unlikely(!__pyx_tuple__75)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1049; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__75);
  __Pyx_GIVEREF(__pyx_tuple__75);

  /* "pandas/src/generated.pyx":1082
 *     else:
 *         if limit < 0:
 *             raise ValueError('Limit must be non-negative')             # <<<<<<<<<<<<<<
 *         lim = limit
 * 
 */
  __pyx_tuple__76 = PyTuple_Pack(1, __pyx_kp_s_Limit_must_be_non_negative); if (unlikely(!__pyx_tuple__76)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1082; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__76);
  __Pyx_GIVEREF(__pyx_tuple__76);

  /* "pandas/src/generated.pyx":1115
 *     else:
 *         if limit < 0:
 *             raise ValueError('Limit must be non-negative')             # <<<<<<<<<<<<<<
 *         lim = limit
 * 
 */
  __pyx_tuple__77 = PyTuple_Pack(1, __pyx_kp_s_Limit_must_be_non_negative); if (unlikely(!__pyx_tuple__77)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1115; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__77);
  __Pyx_GIVEREF(__pyx_tuple__77);

  /* "pandas/src/generated.pyx":1148
 *     else:
 *         if limit < 0:
 *             raise ValueError('Limit must be non-negative')             # <<<<<<<<<<<<<<
 *         lim = limit
 * 
 */
  __pyx_tuple__78 = PyTuple_Pack(1, __pyx_kp_s_Limit_must_be_non_negative); if (unlikely(!__pyx_tuple__78)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1148; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__78);
  __Pyx_GIVEREF(__pyx_tuple__78);

  /* "pandas/src/generated.pyx":1181
 *     else:
 *         if limit < 0:
 *             raise ValueError('Limit must be non-negative')             # <<<<<<<<<<<<<<
 *         lim = limit
 * 
 */
  __pyx_tuple__79 = PyTuple_Pack(1, __pyx_kp_s_Limit_must_be_non_negative); if (unlikely(!__pyx_tuple__79)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1181; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__79);
  __Pyx_GIVEREF(__pyx_tuple__79);

  /* "pandas/src/generated.pyx":1215
 *     else:
 *         if limit < 0:
 *             raise ValueError('Limit must be non-negative')             # <<<<<<<<<<<<<<
 *         lim = limit
 * 
 */
  __pyx_tuple__80 = PyTuple_Pack(1, __pyx_kp_s_Limit_must_be_non_negative); if (unlikely(!__pyx_tuple__80)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1215; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__80);
  __Pyx_GIVEREF(__pyx_tuple__80);

  /* "pandas/src/generated.pyx":1247
 *     else:
 *         if limit < 0:
 *             raise ValueError('Limit must be non-negative')             # <<<<<<<<<<<<<<
 *         lim = limit
 * 
 */
  __pyx_tuple__81 = PyTuple_Pack(1, __pyx_kp_s_Limit_must_be_non_negative); if (unlikely(!__pyx_tuple__81)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1247; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__81);
  __Pyx_GIVEREF(__pyx_tuple__81);

  /* "pandas/src/generated.pyx":1279
 *     else:
 *         if limit < 0:
 *             raise ValueError('Limit must be non-negative')             # <<<<<<<<<<<<<<
 *         lim = limit
 * 
 */
  __pyx_tuple__82 = PyTuple_Pack(1, __pyx_kp_s_Limit_must_be_non_negative); if (unlikely(!__pyx_tuple__82)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1279; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__82);
  __Pyx_GIVEREF(__pyx_tuple__82);

  /* "pandas/src/generated.pyx":1311
 *     else:
 *         if limit < 0:
 *             raise ValueError('Limit must be non-negative')             # <<<<<<<<<<<<<<
 *         lim = limit
 * 
 */
  __pyx_tuple__83 = PyTuple_Pack(1, __pyx_kp_s_Limit_must_be_non_negative); if (unlikely(!__pyx_tuple__83)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1311; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__83);
  __Pyx_GIVEREF(__pyx_tuple__83);

  /* "pandas/src/generated.pyx":1343
 *     else:
 *         if limit < 0:
 *             raise ValueError('Limit must be non-negative')             # <<<<<<<<<<<<<<
 *         lim = limit
 * 
 */
  __pyx_tuple__84 = PyTuple_Pack(1, __pyx_kp_s_Limit_must_be_non_negative); if (unlikely(!__pyx_tuple__84)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1343; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__84);
  __Pyx_GIVEREF(__pyx_tuple__84);

  /* "pandas/src/generated.pyx":1375
 *     else:
 *         if limit < 0:
 *             raise ValueError('Limit must be non-negative')             # <<<<<<<<<<<<<<
 *         lim = limit
 * 
 */
  __pyx_tuple__85 = PyTuple_Pack(1, __pyx_kp_s_Limit_must_be_non_negative); if (unlikely(!__pyx_tuple__85)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1375; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__85);
  __Pyx_GIVEREF(__pyx_tuple__85);

  /* "pandas/src/generated.pyx":1408
 *     else:
 *         if limit < 0:
 *             raise ValueError('Limit must be non-negative')             # <<<<<<<<<<<<<<
 *         lim = limit
 * 
 */
  __pyx_tuple__86 = PyTuple_Pack(1, __pyx_kp_s_Limit_must_be_non_negative); if (unlikely(!__pyx_tuple__86)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1408; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__86);
  __Pyx_GIVEREF(__pyx_tuple__86);

  /* "pandas/src/generated.pyx":1442
 *     else:
 *         if limit < 0:
 *             raise ValueError('Limit must be non-negative')             # <<<<<<<<<<<<<<
 *         lim = limit
 * 
 */
  __pyx_tuple__87 = PyTuple_Pack(1, __pyx_kp_s_Limit_must_be_non_negative); if (unlikely(!__pyx_tuple__87)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1442; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__87);
  __Pyx_GIVEREF(__pyx_tuple__87);

  /* "pandas/src/generated.pyx":1476
 *     else:
 *         if limit < 0:
 *             raise ValueError('Limit must be non-negative')             # <<<<<<<<<<<<<<
 *         lim = limit
 * 
 */
  __pyx_tuple__88 = PyTuple_Pack(1, __pyx_kp_s_Limit_must_be_non_negative); if (unlikely(!__pyx_tuple__88)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1476; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__88);
  __Pyx_GIVEREF(__pyx_tuple__88);

  /* "pandas/src/generated.pyx":1510
 *     else:
 *         if limit < 0:
 *             raise ValueError('Limit must be non-negative')             # <<<<<<<<<<<<<<
 *         lim = limit
 * 
 */
  __pyx_tuple__89 = PyTuple_Pack(1, __pyx_kp_s_Limit_must_be_non_negative); if (unlikely(!__pyx_tuple__89)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1510; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__89);
  __Pyx_GIVEREF(__pyx_tuple__89);

  /* "pandas/src/generated.pyx":1544
 *     else:
 *         if limit < 0:
 *             raise ValueError('Limit must be non-negative')             # <<<<<<<<<<<<<<
 *         lim = limit
 * 
 */
  __pyx_tuple__90 = PyTuple_Pack(1, __pyx_kp_s_Limit_must_be_non_negative); if (unlikely(!__pyx_tuple__90)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1544; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__90);
  __Pyx_GIVEREF(__pyx_tuple__90);

  /* "pandas/src/generated.pyx":1578
 *     else:
 *         if limit < 0:
 *             raise ValueError('Limit must be non-negative')             # <<<<<<<<<<<<<<
 *         lim = limit
 * 
 */
  __pyx_tuple__91 = PyTuple_Pack(1, __pyx_kp_s_Limit_must_be_non_negative); if (unlikely(!__pyx_tuple__91)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1578; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__91);
  __Pyx_GIVEREF(__pyx_tuple__91);

  /* "pandas/src/generated.pyx":1613
 *     else:
 *         if limit < 0:
 *             raise ValueError('Limit must be non-negative')             # <<<<<<<<<<<<<<
 *         lim = limit
 * 
 */
  __pyx_tuple__92 = PyTuple_Pack(1, __pyx_kp_s_Limit_must_be_non_negative); if (unlikely(!__pyx_tuple__92)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1613; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__92);
  __Pyx_GIVEREF(__pyx_tuple__92);

  /* "pandas/src/generated.pyx":1647
 *     else:
 *         if limit < 0:
 *             raise ValueError('Limit must be non-negative')             # <<<<<<<<<<<<<<
 *         lim = limit
 * 
 */
  __pyx_tuple__93 = PyTuple_Pack(1, __pyx_kp_s_Limit_must_be_non_negative); if (unlikely(!__pyx_tuple__93)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1647; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__93);
  __Pyx_GIVEREF(__pyx_tuple__93);

  /* "pandas/src/generated.pyx":1681
 *     else:
 *         if limit < 0:
 *             raise ValueError('Limit must be non-negative')             # <<<<<<<<<<<<<<
 *         lim = limit
 * 
 */
  __pyx_tuple__94 = PyTuple_Pack(1, __pyx_kp_s_Limit_must_be_non_negative); if (unlikely(!__pyx_tuple__94)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1681; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__94);
  __Pyx_GIVEREF(__pyx_tuple__94);

  /* "pandas/src/generated.pyx":1715
 *     else:
 *         if limit < 0:
 *             raise ValueError('Limit must be non-negative')             # <<<<<<<<<<<<<<
 *         lim = limit
 * 
 */
  __pyx_tuple__95 = PyTuple_Pack(1, __pyx_kp_s_Limit_must_be_non_negative); if (unlikely(!__pyx_tuple__95)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1715; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__95);
  __Pyx_GIVEREF(__pyx_tuple__95);

  /* "pandas/src/generated.pyx":1749
 *     else:
 *         if limit < 0:
 *             raise ValueError('Limit must be non-negative')             # <<<<<<<<<<<<<<
 *         lim = limit
 * 
 */
  __pyx_tuple__96 = PyTuple_Pack(1, __pyx_kp_s_Limit_must_be_non_negative); if (unlikely(!__pyx_tuple__96)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1749; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__96);
  __Pyx_GIVEREF(__pyx_tuple__96);

  /* "pandas/src/generated.pyx":1783
 *     else:
 *         if limit < 0:
 *             raise ValueError('Limit must be non-negative')             # <<<<<<<<<<<<<<
 *         lim = limit
 * 
 */
  __pyx_tuple__97 = PyTuple_Pack(1, __pyx_kp_s_Limit_must_be_non_negative); if (unlikely(!__pyx_tuple__97)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1783; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__97);
  __Pyx_GIVEREF(__pyx_tuple__97);

  /* "pandas/src/generated.pyx":1815
 * 
 *     if n < 2:
 *         return True, True             # <<<<<<<<<<<<<<
 * 
 *     prev = arr[0]
 */
  __pyx_tuple__98 = PyTuple_Pack(2, Py_True, Py_True); if (unlikely(!__pyx_tuple__98)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1815; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__98);
  __Pyx_GIVEREF(__pyx_tuple__98);

  /* "pandas/src/generated.pyx":1821
 *         cur = arr[i]
 *         if cur < prev:
 *             return False, None             # <<<<<<<<<<<<<<
 *         elif cur == prev:
 *             is_unique = 0
 */
  __pyx_tuple__99 = PyTuple_Pack(2, Py_False, Py_None); if (unlikely(!__pyx_tuple__99)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1821; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__99);
  __Pyx_GIVEREF(__pyx_tuple__99);

  /* "pandas/src/generated.pyx":1842
 * 
 *     if n < 2:
 *         return True, True             # <<<<<<<<<<<<<<
 * 
 *     prev = arr[0]
 */
  __pyx_tuple__100 = PyTuple_Pack(2, Py_True, Py_True); if (unlikely(!__pyx_tuple__100)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1842; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__100);
  __Pyx_GIVEREF(__pyx_tuple__100);

  /* "pandas/src/generated.pyx":1848
 *         cur = arr[i]
 *         if cur < prev:
 *             return False, None             # <<<<<<<<<<<<<<
 *         elif cur == prev:
 *             is_unique = 0
 */
  __pyx_tuple__101 = PyTuple_Pack(2, Py_False, Py_None); if (unlikely(!__pyx_tuple__101)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1848; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__101);
  __Pyx_GIVEREF(__pyx_tuple__101);

  /* "pandas/src/generated.pyx":1869
 * 
 *     if n < 2:
 *         return True, True             # <<<<<<<<<<<<<<
 * 
 *     prev = arr[0]
 */
  __pyx_tuple__102 = PyTuple_Pack(2, Py_True, Py_True); if (unlikely(!__pyx_tuple__102)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1869; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__102);
  __Pyx_GIVEREF(__pyx_tuple__102);

  /* "pandas/src/generated.pyx":1875
 *         cur = arr[i]
 *         if cur < prev:
 *             return False, None             # <<<<<<<<<<<<<<
 *         elif cur == prev:
 *             is_unique = 0
 */
  __pyx_tuple__103 = PyTuple_Pack(2, Py_False, Py_None); if (unlikely(!__pyx_tuple__103)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1875; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__103);
  __Pyx_GIVEREF(__pyx_tuple__103);

  /* "pandas/src/generated.pyx":1896
 * 
 *     if n < 2:
 *         return True, True             # <<<<<<<<<<<<<<
 * 
 *     prev = arr[0]
 */
  __pyx_tuple__104 = PyTuple_Pack(2, Py_True, Py_True); if (unlikely(!__pyx_tuple__104)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1896; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__104);
  __Pyx_GIVEREF(__pyx_tuple__104);

  /* "pandas/src/generated.pyx":1902
 *         cur = arr[i]
 *         if cur < prev:
 *             return False, None             # <<<<<<<<<<<<<<
 *         elif cur == prev:
 *             is_unique = 0
 */
  __pyx_tuple__105 = PyTuple_Pack(2, Py_False, Py_None); if (unlikely(!__pyx_tuple__105)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1902; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__105);
  __Pyx_GIVEREF(__pyx_tuple__105);

  /* "pandas/src/generated.pyx":1923
 * 
 *     if n < 2:
 *         return True, True             # <<<<<<<<<<<<<<
 * 
 *     prev = arr[0]
 */
  __pyx_tuple__106 = PyTuple_Pack(2, Py_True, Py_True); if (unlikely(!__pyx_tuple__106)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1923; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__106);
  __Pyx_GIVEREF(__pyx_tuple__106);

  /* "pandas/src/generated.pyx":1929
 *         cur = arr[i]
 *         if cur < prev:
 *             return False, None             # <<<<<<<<<<<<<<
 *         elif cur == prev:
 *             is_unique = 0
 */
  __pyx_tuple__107 = PyTuple_Pack(2, Py_False, Py_None); if (unlikely(!__pyx_tuple__107)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1929; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__107);
  __Pyx_GIVEREF(__pyx_tuple__107);

  /* "pandas/src/generated.pyx":1950
 * 
 *     if n < 2:
 *         return True, True             # <<<<<<<<<<<<<<
 * 
 *     prev = arr[0]
 */
  __pyx_tuple__108 = PyTuple_Pack(2, Py_True, Py_True); if (unlikely(!__pyx_tuple__108)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1950; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__108);
  __Pyx_GIVEREF(__pyx_tuple__108);

  /* "pandas/src/generated.pyx":1956
 *         cur = arr[i]
 *         if cur < prev:
 *             return False, None             # <<<<<<<<<<<<<<
 *         elif cur == prev:
 *             is_unique = 0
 */
  __pyx_tuple__109 = PyTuple_Pack(2, Py_False, Py_None); if (unlikely(!__pyx_tuple__109)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1956; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__109);
  __Pyx_GIVEREF(__pyx_tuple__109);

  /* "pandas/src/generated.pyx":1973
 * 
 *     if not length == len(labels):
 *        raise AssertionError("len(index) != len(labels)")             # <<<<<<<<<<<<<<
 * 
 *     for i in range(length):
 */
  __pyx_tuple__110 = PyTuple_Pack(1, __pyx_kp_s_len_index_len_labels); if (unlikely(!__pyx_tuple__110)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1973; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__110);
  __Pyx_GIVEREF(__pyx_tuple__110);

  /* "pandas/src/generated.pyx":2001
 * 
 *     if not length == len(labels):
 *        raise AssertionError("len(index) != len(labels)")             # <<<<<<<<<<<<<<
 * 
 *     for i in range(length):
 */
  __pyx_tuple__111 = PyTuple_Pack(1, __pyx_kp_s_len_index_len_labels); if (unlikely(!__pyx_tuple__111)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2001; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__111);
  __Pyx_GIVEREF(__pyx_tuple__111);

  /* "pandas/src/generated.pyx":2029
 * 
 *     if not length == len(labels):
 *        raise AssertionError("len(index) != len(labels)")             # <<<<<<<<<<<<<<
 * 
 *     for i in range(length):
 */
  __pyx_tuple__112 = PyTuple_Pack(1, __pyx_kp_s_len_index_len_labels); if (unlikely(!__pyx_tuple__112)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2029; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__112);
  __Pyx_GIVEREF(__pyx_tuple__112);

  /* "pandas/src/generated.pyx":2057
 * 
 *     if not length == len(labels):
 *        raise AssertionError("len(index) != len(labels)")             # <<<<<<<<<<<<<<
 * 
 *     for i in range(length):
 */
  __pyx_tuple__113 = PyTuple_Pack(1, __pyx_kp_s_len_index_len_labels); if (unlikely(!__pyx_tuple__113)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2057; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__113);
  __Pyx_GIVEREF(__pyx_tuple__113);

  /* "pandas/src/generated.pyx":2085
 * 
 *     if not length == len(labels):
 *        raise AssertionError("len(index) != len(labels)")             # <<<<<<<<<<<<<<
 * 
 *     for i in range(length):
 */
  __pyx_tuple__114 = PyTuple_Pack(1, __pyx_kp_s_len_index_len_labels); if (unlikely(!__pyx_tuple__114)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2085; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__114);
  __Pyx_GIVEREF(__pyx_tuple__114);

  /* "pandas/src/generated.pyx":2113
 * 
 *     if not length == len(labels):
 *        raise AssertionError("len(index) != len(labels)")             # <<<<<<<<<<<<<<
 * 
 *     for i in range(length):
 */
  __pyx_tuple__115 = PyTuple_Pack(1, __pyx_kp_s_len_index_len_labels); if (unlikely(!__pyx_tuple__115)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2113; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__115);
  __Pyx_GIVEREF(__pyx_tuple__115);

  /* "pandas/src/generated.pyx":4743
 * 
 *     if not len(values) == len(labels):
 *        raise AssertionError("len(index) != len(labels)")             # <<<<<<<<<<<<<<
 * 
 *     nobs = np.zeros((<object> out).shape, dtype=np.int64)
 */
  __pyx_tuple__192 = PyTuple_Pack(1, __pyx_kp_s_len_index_len_labels); if (unlikely(!__pyx_tuple__192)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4743; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__192);
  __Pyx_GIVEREF(__pyx_tuple__192);

  /* "pandas/src/generated.pyx":4786
 * 
 *     if not len(values) == len(labels):
 *        raise AssertionError("len(index) != len(labels)")             # <<<<<<<<<<<<<<
 * 
 *     nobs = np.zeros((<object> out).shape, dtype=np.int64)
 */
  __pyx_tuple__193 = PyTuple_Pack(1, __pyx_kp_s_len_index_len_labels); if (unlikely(!__pyx_tuple__193)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4786; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__193);
  __Pyx_GIVEREF(__pyx_tuple__193);

  /* "pandas/src/generated.pyx":4919
 * 
 *     if not len(values) == len(labels):
 *        raise AssertionError("len(index) != len(labels)")             # <<<<<<<<<<<<<<
 * 
 *     nobs = np.zeros((<object> out).shape, dtype=np.int64)
 */
  __pyx_tuple__194 = PyTuple_Pack(1, __pyx_kp_s_len_index_len_labels); if (unlikely(!__pyx_tuple__194)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4919; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__194);
  __Pyx_GIVEREF(__pyx_tuple__194);

  /* "pandas/src/generated.pyx":4963
 * 
 *     if not len(values) == len(labels):
 *        raise AssertionError("len(index) != len(labels)")             # <<<<<<<<<<<<<<
 * 
 *     nobs = np.zeros((<object> out).shape, dtype=np.int64)
 */
  __pyx_tuple__195 = PyTuple_Pack(1, __pyx_kp_s_len_index_len_labels); if (unlikely(!__pyx_tuple__195)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4963; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__195);
  __Pyx_GIVEREF(__pyx_tuple__195);

  /* "pandas/src/generated.pyx":5098
 * 
 *     if not len(values) == len(labels):
 *        raise AssertionError("len(index) != len(labels)")             # <<<<<<<<<<<<<<
 * 
 *     nobs = np.zeros_like(out)
 */
  __pyx_tuple__196 = PyTuple_Pack(1, __pyx_kp_s_len_index_len_labels); if (unlikely(!__pyx_tuple__196)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5098; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__196);
  __Pyx_GIVEREF(__pyx_tuple__196);

  /* "pandas/src/generated.pyx":5154
 * 
 *     if not len(values) == len(labels):
 *        raise AssertionError("len(index) != len(labels)")             # <<<<<<<<<<<<<<
 * 
 *     nobs = np.zeros_like(out)
 */
  __pyx_tuple__197 = PyTuple_Pack(1, __pyx_kp_s_len_index_len_labels); if (unlikely(!__pyx_tuple__197)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5154; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__197);
  __Pyx_GIVEREF(__pyx_tuple__197);

  /* "pandas/src/generated.pyx":5324
 * 
 *     if not len(values) == len(labels):
 *        raise AssertionError("len(index) != len(labels)")             # <<<<<<<<<<<<<<
 * 
 *     nobs = np.zeros_like(out)
 */
  __pyx_tuple__198 = PyTuple_Pack(1, __pyx_kp_s_len_index_len_labels); if (unlikely(!__pyx_tuple__198)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5324; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__198);
  __Pyx_GIVEREF(__pyx_tuple__198);

  /* "pandas/src/generated.pyx":5380
 * 
 *     if not len(values) == len(labels):
 *        raise AssertionError("len(index) != len(labels)")             # <<<<<<<<<<<<<<
 * 
 *     nobs = np.zeros_like(out)
 */
  __pyx_tuple__199 = PyTuple_Pack(1, __pyx_kp_s_len_index_len_labels); if (unlikely(!__pyx_tuple__199)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5380; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__199);
  __Pyx_GIVEREF(__pyx_tuple__199);

  /* "pandas/src/generated.pyx":5547
 * 
 *     if not len(values) == len(labels):
 *        raise AssertionError("len(index) != len(labels)")             # <<<<<<<<<<<<<<
 * 
 *     nobs = np.zeros_like(out)
 */
  __pyx_tuple__200 = PyTuple_Pack(1, __pyx_kp_s_len_index_len_labels); if (unlikely(!__pyx_tuple__200)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5547; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__200);
  __Pyx_GIVEREF(__pyx_tuple__200);

  /* "pandas/src/generated.pyx":5608
 * 
 *     if not len(values) == len(labels):
 *        raise AssertionError("len(index) != len(labels)")             # <<<<<<<<<<<<<<
 * 
 *     nobs = np.zeros_like(out)
 */
  __pyx_tuple__201 = PyTuple_Pack(1, __pyx_kp_s_len_index_len_labels); if (unlikely(!__pyx_tuple__201)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5608; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__201);
  __Pyx_GIVEREF(__pyx_tuple__201);

  /* "pandas/src/generated.pyx":5793
 * 
 *     if not len(values) == len(labels):
 *        raise AssertionError("len(index) != len(labels)")             # <<<<<<<<<<<<<<
 * 
 *     nobs = np.zeros_like(out)
 */
  __pyx_tuple__202 = PyTuple_Pack(1, __pyx_kp_s_len_index_len_labels); if (unlikely(!__pyx_tuple__202)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5793; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__202);
  __Pyx_GIVEREF(__pyx_tuple__202);

  /* "pandas/src/generated.pyx":5845
 * 
 *     if not len(values) == len(labels):
 *        raise AssertionError("len(index) != len(labels)")             # <<<<<<<<<<<<<<
 * 
 *     nobs = np.zeros_like(out)
 */
  __pyx_tuple__203 = PyTuple_Pack(1, __pyx_kp_s_len_index_len_labels); if (unlikely(!__pyx_tuple__203)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5845; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__203);
  __Pyx_GIVEREF(__pyx_tuple__203);

  /* "pandas/src/generated.pyx":6008
 * 
 *     if not len(values) == len(labels):
 *        raise AssertionError("len(index) != len(labels)")             # <<<<<<<<<<<<<<
 * 
 *     nobs = np.zeros_like(out)
 */
  __pyx_tuple__204 = PyTuple_Pack(1, __pyx_kp_s_len_index_len_labels); if (unlikely(!__pyx_tuple__204)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6008; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__204);
  __Pyx_GIVEREF(__pyx_tuple__204);

  /* "pandas/src/generated.pyx":6068
 * 
 *     if not len(values) == len(labels):
 *        raise AssertionError("len(index) != len(labels)")             # <<<<<<<<<<<<<<
 * 
 *     nobs = np.zeros_like(out)
 */
  __pyx_tuple__205 = PyTuple_Pack(1, __pyx_kp_s_len_index_len_labels); if (unlikely(!__pyx_tuple__205)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6068; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__205);
  __Pyx_GIVEREF(__pyx_tuple__205);

  /* "pandas/src/generated.pyx":6252
 * 
 *     if not len(values) == len(labels):
 *        raise AssertionError("len(index) != len(labels)")             # <<<<<<<<<<<<<<
 * 
 *     nobs = np.zeros_like(out)
 */
  __pyx_tuple__206 = PyTuple_Pack(1, __pyx_kp_s_len_index_len_labels); if (unlikely(!__pyx_tuple__206)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6252; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__206);
  __Pyx_GIVEREF(__pyx_tuple__206);

  /* "pandas/src/generated.pyx":6312
 * 
 *     if not len(values) == len(labels):
 *        raise AssertionError("len(index) != len(labels)")             # <<<<<<<<<<<<<<
 * 
 *     nobs = np.zeros_like(out)
 */
  __pyx_tuple__207 = PyTuple_Pack(1, __pyx_kp_s_len_index_len_labels); if (unlikely(!__pyx_tuple__207)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6312; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__207);
  __Pyx_GIVEREF(__pyx_tuple__207);

  /* "pandas/src/generated.pyx":6502
 * 
 *     if out.shape[1] != 4:
 *         raise ValueError('Output array must have 4 columns')             # <<<<<<<<<<<<<<
 * 
 *     NA = np.nan
 */
  __pyx_tuple__208 = PyTuple_Pack(1, __pyx_kp_s_Output_array_must_have_4_columns); if (unlikely(!__pyx_tuple__208)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6502; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__208);
  __Pyx_GIVEREF(__pyx_tuple__208);

  /* "pandas/src/generated.pyx":6575
 * 
 *     if out.shape[1] != 4:
 *         raise ValueError('Output array must have 4 columns')             # <<<<<<<<<<<<<<
 * 
 *     NA = np.nan
 */
  __pyx_tuple__209 = PyTuple_Pack(1, __pyx_kp_s_Output_array_must_have_4_columns); if (unlikely(!__pyx_tuple__209)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6575; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__209);
  __Pyx_GIVEREF(__pyx_tuple__209);

  /* "pandas/src/generated.pyx":6643
 * 
 *     if len(values) != len(labels):
 *        raise AssertionError("len(index) != len(labels)")             # <<<<<<<<<<<<<<
 * 
 *     for i in range(N):
 */
  __pyx_tuple__210 = PyTuple_Pack(1, __pyx_kp_s_len_index_len_labels); if (unlikely(!__pyx_tuple__210)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6643; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__210);
  __Pyx_GIVEREF(__pyx_tuple__210);

  /* "pandas/src/generated.pyx":6679
 * 
 *     if len(values) != len(labels):
 *        raise AssertionError("len(index) != len(labels)")             # <<<<<<<<<<<<<<
 * 
 *     for i in range(N):
 */
  __pyx_tuple__211 = PyTuple_Pack(1, __pyx_kp_s_len_index_len_labels); if (unlikely(!__pyx_tuple__211)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6679; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__211);
  __Pyx_GIVEREF(__pyx_tuple__211);

  /* "pandas/src/generated.pyx":6715
 * 
 *     if len(values) != len(labels):
 *        raise AssertionError("len(index) != len(labels)")             # <<<<<<<<<<<<<<
 * 
 *     for i in range(N):
 */
  __pyx_tuple__212 = PyTuple_Pack(1, __pyx_kp_s_len_index_len_labels); if (unlikely(!__pyx_tuple__212)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6715; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__212);
  __Pyx_GIVEREF(__pyx_tuple__212);

  /* "pandas/src/generated.pyx":6751
 * 
 *     if len(values) != len(labels):
 *        raise AssertionError("len(index) != len(labels)")             # <<<<<<<<<<<<<<
 * 
 *     for i in range(N):
 */
  __pyx_tuple__213 = PyTuple_Pack(1, __pyx_kp_s_len_index_len_labels); if (unlikely(!__pyx_tuple__213)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6751; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__213);
  __Pyx_GIVEREF(__pyx_tuple__213);

  /* "numpy.pxd":217
 *             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_tuple__214 = PyTuple_Pack(1, __pyx_kp_u_ndarray_is_not_C_contiguous); if (unlikely(!__pyx_tuple__214)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 217; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__214);
  __Pyx_GIVEREF(__pyx_tuple__214);

  /* "numpy.pxd":221
 *             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_tuple__215 = PyTuple_Pack(1, __pyx_kp_u_ndarray_is_not_Fortran_contiguou); if (unlikely(!__pyx_tuple__215)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 221; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__215);
  __Pyx_GIVEREF(__pyx_tuple__215);

  /* "numpy.pxd":259
 *                 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_tuple__216 = PyTuple_Pack(1, __pyx_kp_u_Non_native_byte_order_not_suppor); if (unlikely(!__pyx_tuple__216)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 259; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__216);
  __Pyx_GIVEREF(__pyx_tuple__216);

  /* "numpy.pxd":803
 * 
 *         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_tuple__217 = PyTuple_Pack(1, __pyx_kp_u_Format_string_allocated_too_shor); if (unlikely(!__pyx_tuple__217)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 803; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__217);
  __Pyx_GIVEREF(__pyx_tuple__217);

  /* "numpy.pxd":807
 *         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_tuple__218 = PyTuple_Pack(1, __pyx_kp_u_Non_native_byte_order_not_suppor); if (unlikely(!__pyx_tuple__218)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 807; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__218);
  __Pyx_GIVEREF(__pyx_tuple__218);

  /* "numpy.pxd":827
 *             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_tuple__219 = PyTuple_Pack(1, __pyx_kp_u_Format_string_allocated_too_shor_2); if (unlikely(!__pyx_tuple__219)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 827; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__219);
  __Pyx_GIVEREF(__pyx_tuple__219);

  /* "util.pxd":40
 *         i += sz
 *     elif i >= sz or sz == 0:
 *         raise IndexError('index out of bounds')             # <<<<<<<<<<<<<<
 * 
 *     return get_value_1d(arr, i)
 */
  __pyx_tuple__220 = PyTuple_Pack(1, __pyx_kp_s_index_out_of_bounds); if (unlikely(!__pyx_tuple__220)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 40; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__220);
  __Pyx_GIVEREF(__pyx_tuple__220);

  /* "util.pxd":57
 *         i += sz
 *     elif i >= sz:
 *         raise IndexError('index out of bounds')             # <<<<<<<<<<<<<<
 * 
 *     assign_value_1d(arr, i, value)
 */
  __pyx_tuple__221 = PyTuple_Pack(1, __pyx_kp_s_index_out_of_bounds); if (unlikely(!__pyx_tuple__221)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 57; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__221);
  __Pyx_GIVEREF(__pyx_tuple__221);

  /* "View.MemoryView":127
 * 
 *         if not self.ndim:
 *             raise ValueError("Empty shape tuple for cython.array")             # <<<<<<<<<<<<<<
 * 
 *         if itemsize <= 0:
 */
  __pyx_tuple__222 = PyTuple_Pack(1, __pyx_kp_s_Empty_shape_tuple_for_cython_arr); if (unlikely(!__pyx_tuple__222)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 127; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__222);
  __Pyx_GIVEREF(__pyx_tuple__222);

  /* "View.MemoryView":130
 * 
 *         if itemsize <= 0:
 *             raise ValueError("itemsize <= 0 for cython.array")             # <<<<<<<<<<<<<<
 * 
 *         if isinstance(format, unicode):
 */
  __pyx_tuple__223 = PyTuple_Pack(1, __pyx_kp_s_itemsize_0_for_cython_array); if (unlikely(!__pyx_tuple__223)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__223);
  __Pyx_GIVEREF(__pyx_tuple__223);

  /* "View.MemoryView":142
 * 
 *         if not self._shape:
 *             raise MemoryError("unable to allocate shape and strides.")             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_tuple__224 = PyTuple_Pack(1, __pyx_kp_s_unable_to_allocate_shape_and_str); if (unlikely(!__pyx_tuple__224)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 142; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__224);
  __Pyx_GIVEREF(__pyx_tuple__224);

  /* "View.MemoryView":170
 *             self.data = <char *>malloc(self.len)
 *             if not self.data:
 *                 raise MemoryError("unable to allocate array data.")             # <<<<<<<<<<<<<<
 * 
 *             if self.dtype_is_object:
 */
  __pyx_tuple__225 = PyTuple_Pack(1, __pyx_kp_s_unable_to_allocate_array_data); if (unlikely(!__pyx_tuple__225)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 170; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__225);
  __Pyx_GIVEREF(__pyx_tuple__225);

  /* "View.MemoryView":186
 *             bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
 *         if not (flags & bufmode):
 *             raise ValueError("Can only create a buffer that is contiguous in memory.")             # <<<<<<<<<<<<<<
 *         info.buf = self.data
 *         info.len = self.len
 */
  __pyx_tuple__226 = PyTuple_Pack(1, __pyx_kp_s_Can_only_create_a_buffer_that_is); if (unlikely(!__pyx_tuple__226)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 186; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__226);
  __Pyx_GIVEREF(__pyx_tuple__226);

  /* "View.MemoryView":445
 *             result = struct.unpack(self.view.format, bytesitem)
 *         except struct.error:
 *             raise ValueError("Unable to convert item to object")             # <<<<<<<<<<<<<<
 *         else:
 *             if len(self.view.format) == 1:
 */
  __pyx_tuple__227 = PyTuple_Pack(1, __pyx_kp_s_Unable_to_convert_item_to_object); if (unlikely(!__pyx_tuple__227)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 445; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__227);
  __Pyx_GIVEREF(__pyx_tuple__227);

  /* "View.MemoryView":521
 *             if self.view.strides == NULL:
 * 
 *                 raise ValueError("Buffer view does not expose strides")             # <<<<<<<<<<<<<<
 * 
 *             return tuple([self.view.strides[i] for i in xrange(self.view.ndim)])
 */
  __pyx_tuple__228 = PyTuple_Pack(1, __pyx_kp_s_Buffer_view_does_not_expose_stri); if (unlikely(!__pyx_tuple__228)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 521; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__228);
  __Pyx_GIVEREF(__pyx_tuple__228);

  /* "View.MemoryView":638
 *         if item is Ellipsis:
 *             if not seen_ellipsis:
 *                 result.extend([slice(None)] * (ndim - len(tup) + 1))             # <<<<<<<<<<<<<<
 *                 seen_ellipsis = True
 *             else:
 */
  __pyx_tuple__229 = PyTuple_Pack(1, Py_None); if (unlikely(!__pyx_tuple__229)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 638; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__229);
  __Pyx_GIVEREF(__pyx_tuple__229);

  /* "View.MemoryView":641
 *                 seen_ellipsis = True
 *             else:
 *                 result.append(slice(None))             # <<<<<<<<<<<<<<
 *             have_slices = True
 *         else:
 */
  __pyx_tuple__230 = PyTuple_Pack(1, Py_None); if (unlikely(!__pyx_tuple__230)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 641; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__230);
  __Pyx_GIVEREF(__pyx_tuple__230);

  /* "View.MemoryView":652
 *     nslices = ndim - len(result)
 *     if nslices:
 *         result.extend([slice(None)] * nslices)             # <<<<<<<<<<<<<<
 * 
 *     return have_slices or nslices, tuple(result)
 */
  __pyx_tuple__231 = PyTuple_Pack(1, Py_None); if (unlikely(!__pyx_tuple__231)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 652; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__231);
  __Pyx_GIVEREF(__pyx_tuple__231);

  /* "View.MemoryView":660
 *     for i in range(ndim):
 *         if suboffsets[i] >= 0:
 *             raise ValueError("Indirect dimensions not supported")             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_tuple__232 = PyTuple_Pack(1, __pyx_kp_s_Indirect_dimensions_not_supporte); if (unlikely(!__pyx_tuple__232)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 660; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__232);
  __Pyx_GIVEREF(__pyx_tuple__232);

  /* "pandas/algos.pyx":151
 *         return abs_diff > allowed
 * 
 * def rank_1d_float64(object in_arr, ties_method='average', ascending=True,             # <<<<<<<<<<<<<<
 *                     na_option='keep', pct=False):
 *     """
 */
  __pyx_tuple__233 = PyTuple_Pack(22, __pyx_n_s_in_arr, __pyx_n_s_ties_method, __pyx_n_s_ascending, __pyx_n_s_na_option, __pyx_n_s_pct, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_n, __pyx_n_s_dups, __pyx_n_s_total_tie_count, __pyx_n_s_sorted_data, __pyx_n_s_ranks, __pyx_n_s_values, __pyx_n_s_argsorted, __pyx_n_s_val, __pyx_n_s_nan_value, __pyx_n_s_sum_ranks, __pyx_n_s_tiebreak, __pyx_n_s_keep_na, __pyx_n_s_count, __pyx_n_s_mask, __pyx_n_s_as); if (unlikely(!__pyx_tuple__233)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 151; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__233);
  __Pyx_GIVEREF(__pyx_tuple__233);
  __pyx_codeobj__234 = (PyObject*)__Pyx_PyCode_New(5, 0, 22, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__233, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_n_s_rank_1d_float64, 151, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__234)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 151; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/algos.pyx":232
 * 
 * 
 * def rank_1d_int64(object in_arr, ties_method='average', ascending=True,             # <<<<<<<<<<<<<<
 *                   na_option='keep', pct=False):
 *     """
 */
  __pyx_tuple__235 = PyTuple_Pack(19, __pyx_n_s_in_arr, __pyx_n_s_ties_method, __pyx_n_s_ascending, __pyx_n_s_na_option, __pyx_n_s_pct, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_n, __pyx_n_s_dups, __pyx_n_s_total_tie_count, __pyx_n_s_sorted_data, __pyx_n_s_values, __pyx_n_s_ranks, __pyx_n_s_argsorted, __pyx_n_s_val, __pyx_n_s_sum_ranks, __pyx_n_s_tiebreak, __pyx_n_s_count, __pyx_n_s_as); if (unlikely(!__pyx_tuple__235)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 232; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__235);
  __Pyx_GIVEREF(__pyx_tuple__235);
  __pyx_codeobj__236 = (PyObject*)__Pyx_PyCode_New(5, 0, 19, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__235, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_n_s_rank_1d_int64, 232, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__236)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 232; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/algos.pyx":301
 * 
 * 
 * def rank_2d_float64(object in_arr, axis=0, ties_method='average',             # <<<<<<<<<<<<<<
 *                     ascending=True, na_option='keep', pct=False):
 *     """
 */
  __pyx_tuple__237 = PyTuple_Pack(23, __pyx_n_s_in_arr, __pyx_n_s_axis, __pyx_n_s_ties_method, __pyx_n_s_ascending, __pyx_n_s_na_option, __pyx_n_s_pct, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_z, __pyx_n_s_k, __pyx_n_s_n, __pyx_n_s_dups, __pyx_n_s_total_tie_count, __pyx_n_s_ranks, __pyx_n_s_values, __pyx_n_s_argsorted, __pyx_n_s_val, __pyx_n_s_nan_value, __pyx_n_s_sum_ranks, __pyx_n_s_tiebreak, __pyx_n_s_keep_na, __pyx_n_s_count, __pyx_n_s_as); if (unlikely(!__pyx_tuple__237)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 301; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__237);
  __Pyx_GIVEREF(__pyx_tuple__237);
  __pyx_codeobj__238 = (PyObject*)__Pyx_PyCode_New(6, 0, 23, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__237, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_n_s_rank_2d_float64, 301, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__238)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 301; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/algos.pyx":393
 * 
 * 
 * def rank_2d_int64(object in_arr, axis=0, ties_method='average',             # <<<<<<<<<<<<<<
 *                     ascending=True, na_option='keep', pct=False):
 *     """
 */
  __pyx_tuple__239 = PyTuple_Pack(21, __pyx_n_s_in_arr, __pyx_n_s_axis, __pyx_n_s_ties_method, __pyx_n_s_ascending, __pyx_n_s_na_option, __pyx_n_s_pct, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_z, __pyx_n_s_k, __pyx_n_s_n, __pyx_n_s_dups, __pyx_n_s_total_tie_count, __pyx_n_s_ranks, __pyx_n_s_argsorted, __pyx_n_s_values, __pyx_n_s_val, __pyx_n_s_sum_ranks, __pyx_n_s_tiebreak, __pyx_n_s_count, __pyx_n_s_as); if (unlikely(!__pyx_tuple__239)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 393; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__239);
  __Pyx_GIVEREF(__pyx_tuple__239);
  __pyx_codeobj__240 = (PyObject*)__Pyx_PyCode_New(6, 0, 21, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__239, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_n_s_rank_2d_int64, 393, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__240)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 393; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/algos.pyx":470
 * 
 * 
 * def rank_1d_generic(object in_arr, bint retry=1, ties_method='average',             # <<<<<<<<<<<<<<
 *                     ascending=True, na_option='keep', pct=False):
 *     """
 */
  __pyx_tuple__241 = PyTuple_Pack(24, __pyx_n_s_in_arr, __pyx_n_s_retry, __pyx_n_s_ties_method, __pyx_n_s_ascending, __pyx_n_s_na_option, __pyx_n_s_pct, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_n, __pyx_n_s_dups, __pyx_n_s_total_tie_count, __pyx_n_s_ranks, __pyx_n_s_sorted_data, __pyx_n_s_values, __pyx_n_s_argsorted, __pyx_n_s_val, __pyx_n_s_nan_value, __pyx_n_s_sum_ranks, __pyx_n_s_tiebreak, __pyx_n_s_keep_na, __pyx_n_s_count, __pyx_n_s_mask, __pyx_n_s_as, __pyx_n_s_valid_locs); if (unlikely(!__pyx_tuple__241)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 470; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__241);
  __Pyx_GIVEREF(__pyx_tuple__241);
  __pyx_codeobj__242 = (PyObject*)__Pyx_PyCode_New(6, 0, 24, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__241, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_n_s_rank_1d_generic, 470, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__242)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 470; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/algos.pyx":588
 *     __cmp__ = _return_true
 * 
 * def rank_2d_generic(object in_arr, axis=0, ties_method='average',             # <<<<<<<<<<<<<<
 *                     ascending=True, na_option='keep', pct=False):
 *     """
 */
  __pyx_tuple__243 = PyTuple_Pack(25, __pyx_n_s_in_arr, __pyx_n_s_axis, __pyx_n_s_ties_method, __pyx_n_s_ascending, __pyx_n_s_na_option, __pyx_n_s_pct, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_z, __pyx_n_s_k, __pyx_n_s_n, __pyx_n_s_infs, __pyx_n_s_dups, __pyx_n_s_total_tie_count, __pyx_n_s_ranks, __pyx_n_s_values, __pyx_n_s_argsorted, __pyx_n_s_val, __pyx_n_s_nan_value, __pyx_n_s_sum_ranks, __pyx_n_s_tiebreak, __pyx_n_s_keep_na, __pyx_n_s_count, __pyx_n_s_mask, __pyx_n_s_as); if (unlikely(!__pyx_tuple__243)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 588; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__243);
  __Pyx_GIVEREF(__pyx_tuple__243);
  __pyx_codeobj__244 = (PyObject*)__Pyx_PyCode_New(6, 0, 25, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__243, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_n_s_rank_2d_generic, 588, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__244)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 588; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/algos.pyx":715
 * # -
 * 
 * def _check_minp(win, minp, N):             # <<<<<<<<<<<<<<
 *     if minp > win:
 *         raise ValueError('min_periods (%d) must be <= window (%d)'
 */
  __pyx_tuple__245 = PyTuple_Pack(3, __pyx_n_s_win, __pyx_n_s_minp, __pyx_n_s_N); if (unlikely(!__pyx_tuple__245)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 715; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__245);
  __Pyx_GIVEREF(__pyx_tuple__245);
  __pyx_codeobj__246 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__245, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_n_s_check_minp, 715, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__246)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 715; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/algos.pyx":770
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * cpdef numeric kth_smallest(numeric[:] a, Py_ssize_t k):             # <<<<<<<<<<<<<<
 *     cdef:
 *         Py_ssize_t i, j, l, m, n = a.size
 */
  __pyx_tuple__247 = PyTuple_Pack(2, __pyx_n_s_a, __pyx_n_s_k); if (unlikely(!__pyx_tuple__247)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__247);
  __Pyx_GIVEREF(__pyx_tuple__247);
  __pyx_codeobj__248 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__247, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_n_s_pyx_fuse_0kth_smallest, 770, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__248)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/algos.pyx":823
 * 
 * 
 * cpdef numeric median(numeric[:] arr):             # <<<<<<<<<<<<<<
 *     '''
 *     A faster median
 */
  __pyx_tuple__249 = PyTuple_Pack(2, __pyx_n_s_arr, __pyx_n_s_arr); if (unlikely(!__pyx_tuple__249)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__249);
  __Pyx_GIVEREF(__pyx_tuple__249);
  __pyx_codeobj__250 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__249, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_n_s_pyx_fuse_0median, 823, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__250)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/algos.pyx":843
 * # -------------- Min, Max subsequence
 * 
 * def max_subseq(ndarray[double_t] arr):             # <<<<<<<<<<<<<<
 *     cdef:
 *         Py_ssize_t i=0,s=0,e=0,T,n
 */
  __pyx_tuple__251 = PyTuple_Pack(8, __pyx_n_s_arr, __pyx_n_s_i, __pyx_n_s_s, __pyx_n_s_e, __pyx_n_s_T, __pyx_n_s_n, __pyx_n_s_m, __pyx_n_s_S); if (unlikely(!__pyx_tuple__251)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 843; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__251);
  __Pyx_GIVEREF(__pyx_tuple__251);
  __pyx_codeobj__252 = (PyObject*)__Pyx_PyCode_New(1, 0, 8, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__251, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_n_s_max_subseq, 843, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__252)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 843; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/algos.pyx":871
 *     return (s, e, m)
 * 
 * def min_subseq(ndarray[double_t] arr):             # <<<<<<<<<<<<<<
 *     cdef:
 *         Py_ssize_t s, e
 */
  __pyx_tuple__253 = PyTuple_Pack(4, __pyx_n_s_arr, __pyx_n_s_s, __pyx_n_s_e, __pyx_n_s_m); if (unlikely(!__pyx_tuple__253)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 871; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__253);
  __Pyx_GIVEREF(__pyx_tuple__253);
  __pyx_codeobj__254 = (PyObject*)__Pyx_PyCode_New(1, 0, 4, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__253, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_n_s_min_subseq, 871, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__254)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 871; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/algos.pyx":883
 * # 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_tuple__255 = PyTuple_Pack(10, __pyx_n_s_input, __pyx_n_s_win, __pyx_n_s_minp, __pyx_n_s_val, __pyx_n_s_prev, __pyx_n_s_sum_x, __pyx_n_s_nobs, __pyx_n_s_i, __pyx_n_s_N, __pyx_n_s_output); if (unlikely(!__pyx_tuple__255)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 883; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__255);
  __Pyx_GIVEREF(__pyx_tuple__255);
  __pyx_codeobj__256 = (PyObject*)__Pyx_PyCode_New(3, 0, 10, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__255, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_n_s_roll_sum, 883, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__256)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 883; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/algos.pyx":925
 * # Rolling mean
 * 
 * def roll_mean(ndarray[double_t] input,             # <<<<<<<<<<<<<<
 *                int win, int minp):
 *     cdef:
 */
  __pyx_tuple__257 = PyTuple_Pack(12, __pyx_n_s_input, __pyx_n_s_win, __pyx_n_s_minp, __pyx_n_s_val, __pyx_n_s_prev, __pyx_n_s_result, __pyx_n_s_sum_x, __pyx_n_s_nobs, __pyx_n_s_i, __pyx_n_s_neg_ct, __pyx_n_s_N, __pyx_n_s_output); if (unlikely(!__pyx_tuple__257)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 925; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__257);
  __Pyx_GIVEREF(__pyx_tuple__257);
  __pyx_codeobj__258 = (PyObject*)__Pyx_PyCode_New(3, 0, 12, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__257, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_n_s_roll_mean, 925, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__258)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 925; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/algos.pyx":982
 * # 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_tuple__259 = PyTuple_Pack(11, __pyx_n_s_input, __pyx_n_s_com, __pyx_n_s_adjust, __pyx_n_s_cur, __pyx_n_s_prev, __pyx_n_s_neww, __pyx_n_s_oldw, __pyx_n_s_adj, __pyx_n_s_i, __pyx_n_s_N, __pyx_n_s_output); if (unlikely(!__pyx_tuple__259)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 982; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__259);
  __Pyx_GIVEREF(__pyx_tuple__259);
  __pyx_codeobj__260 = (PyObject*)__Pyx_PyCode_New(3, 0, 11, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__259, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_n_s_ewma, 982, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__260)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 982; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/algos.pyx":1044
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def nancorr(ndarray[float64_t, ndim=2] mat, cov=False, minp=None):             # <<<<<<<<<<<<<<
 *     cdef:
 *         Py_ssize_t i, j, xi, yi, N, K
 */
  __pyx_tuple__261 = PyTuple_Pack(21, __pyx_n_s_mat, __pyx_n_s_cov, __pyx_n_s_minp, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_xi, __pyx_n_s_yi, __pyx_n_s_N, __pyx_n_s_K, __pyx_n_s_result, __pyx_n_s_mask, __pyx_n_s_nobs, __pyx_n_s_vx, __pyx_n_s_vy, __pyx_n_s_sumx, __pyx_n_s_sumy, __pyx_n_s_sumxx, __pyx_n_s_sumyy, __pyx_n_s_meanx, __pyx_n_s_meany, __pyx_n_s_divisor); if (unlikely(!__pyx_tuple__261)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1044; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__261);
  __Pyx_GIVEREF(__pyx_tuple__261);
  __pyx_codeobj__262 = (PyObject*)__Pyx_PyCode_New(3, 0, 21, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__261, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_n_s_nancorr, 1044, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__262)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1044; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/algos.pyx":1103
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def nancorr_spearman(ndarray[float64_t, ndim=2] mat, Py_ssize_t minp=1):             # <<<<<<<<<<<<<<
 *     cdef:
 *         Py_ssize_t i, j, xi, yi, N, K
 */
  __pyx_tuple__263 = PyTuple_Pack(20, __pyx_n_s_mat, __pyx_n_s_minp, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_xi, __pyx_n_s_yi, __pyx_n_s_N, __pyx_n_s_K, __pyx_n_s_result, __pyx_n_s_maskedx, __pyx_n_s_maskedy, __pyx_n_s_mask, __pyx_n_s_nobs, __pyx_n_s_vx, __pyx_n_s_vy, __pyx_n_s_sumx, __pyx_n_s_sumxx, __pyx_n_s_sumyy, __pyx_n_s_mean, __pyx_n_s_divisor); if (unlikely(!__pyx_tuple__263)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1103; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__263);
  __Pyx_GIVEREF(__pyx_tuple__263);
  __pyx_codeobj__264 = (PyObject*)__Pyx_PyCode_New(2, 0, 20, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__263, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_n_s_nancorr_spearman, 1103, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__264)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1103; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/algos.pyx":1164
 * # Rolling variance
 * 
 * def roll_var(ndarray[double_t] input, int win, int minp, int ddof=1):             # <<<<<<<<<<<<<<
 *     """
 *     Numerically stable implementation using Welford's method.
 */
  __pyx_tuple__265 = PyTuple_Pack(13, __pyx_n_s_input, __pyx_n_s_win, __pyx_n_s_minp, __pyx_n_s_ddof, __pyx_n_s_val, __pyx_n_s_prev, __pyx_n_s_mean_x, __pyx_n_s_ssqdm_x, __pyx_n_s_nobs, __pyx_n_s_delta, __pyx_n_s_i, __pyx_n_s_N, __pyx_n_s_output); if (unlikely(!__pyx_tuple__265)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1164; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__265);
  __Pyx_GIVEREF(__pyx_tuple__265);
  __pyx_codeobj__266 = (PyObject*)__Pyx_PyCode_New(4, 0, 13, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__265, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_n_s_roll_var, 1164, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__266)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1164; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/algos.pyx":1244
 * # 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_tuple__267 = PyTuple_Pack(16, __pyx_n_s_input, __pyx_n_s_win, __pyx_n_s_minp, __pyx_n_s_val, __pyx_n_s_prev, __pyx_n_s_x, __pyx_n_s_xx, __pyx_n_s_xxx, __pyx_n_s_nobs, __pyx_n_s_i, __pyx_n_s_N, __pyx_n_s_output, __pyx_n_s_A, __pyx_n_s_B, __pyx_n_s_C, __pyx_n_s_R); if (unlikely(!__pyx_tuple__267)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1244; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__267);
  __Pyx_GIVEREF(__pyx_tuple__267);
  __pyx_codeobj__268 = (PyObject*)__Pyx_PyCode_New(3, 0, 16, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__267, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_n_s_roll_skew, 1244, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__268)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1244; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/algos.pyx":1308
 * 
 * 
 * def roll_kurt(ndarray[double_t] input,             # <<<<<<<<<<<<<<
 *                int win, int minp):
 *     cdef double val, prev
 */
  __pyx_tuple__269 = PyTuple_Pack(19, __pyx_n_s_input, __pyx_n_s_win, __pyx_n_s_minp, __pyx_n_s_val, __pyx_n_s_prev, __pyx_n_s_x, __pyx_n_s_xx, __pyx_n_s_xxx, __pyx_n_s_xxxx, __pyx_n_s_nobs, __pyx_n_s_i, __pyx_n_s_N, __pyx_n_s_output, __pyx_n_s_A, __pyx_n_s_B, __pyx_n_s_C, __pyx_n_s_D, __pyx_n_s_R, __pyx_n_s_K); if (unlikely(!__pyx_tuple__269)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1308; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__269);
  __Pyx_GIVEREF(__pyx_tuple__269);
  __pyx_codeobj__270 = (PyObject*)__Pyx_PyCode_New(3, 0, 19, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__269, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_n_s_roll_kurt, 1308, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__270)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1308; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/algos.pyx":1428
 * from skiplist cimport *
 * 
 * def roll_median_c(ndarray[float64_t] arg, int win, int minp):             # <<<<<<<<<<<<<<
 *     cdef double val, res, prev
 *     cdef:
 */
  __pyx_tuple__271 = PyTuple_Pack(13, __pyx_n_s_arg, __pyx_n_s_win, __pyx_n_s_minp, __pyx_n_s_val, __pyx_n_s_res, __pyx_n_s_prev, __pyx_n_s_ret, __pyx_n_s_sl, __pyx_n_s_midpoint, __pyx_n_s_nobs, __pyx_n_s_i, __pyx_n_s_N, __pyx_n_s_output); if (unlikely(!__pyx_tuple__271)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1428; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__271);
  __Pyx_GIVEREF(__pyx_tuple__271);
  __pyx_codeobj__272 = (PyObject*)__Pyx_PyCode_New(3, 0, 13, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__271, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_n_s_roll_median_c, 1428, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__272)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1428; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/algos.pyx":1483
 *     return output
 * 
 * def roll_median_cython(ndarray input, int win, int minp):             # <<<<<<<<<<<<<<
 *     '''
 *     O(N log(window)) implementation using skip list
 */
  __pyx_tuple__273 = PyTuple_Pack(3, __pyx_n_s_input, __pyx_n_s_win, __pyx_n_s_minp); if (unlikely(!__pyx_tuple__273)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1483; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__273);
  __Pyx_GIVEREF(__pyx_tuple__273);
  __pyx_codeobj__274 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__273, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_n_s_roll_median_cython, 1483, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__274)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1483; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/algos.pyx":1519
 * @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_tuple__275 = PyTuple_Pack(15, __pyx_n_s_a, __pyx_n_s_window, __pyx_n_s_minp, __pyx_n_s_ai, __pyx_n_s_aold, __pyx_n_s_count, __pyx_n_s_ring, __pyx_n_s_minpair, __pyx_n_s_end, __pyx_n_s_last, __pyx_n_s_i0, __pyx_n_s_dim, __pyx_n_s_n0, __pyx_n_s_dims, __pyx_n_s_y); if (unlikely(!__pyx_tuple__275)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1519; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__275);
  __Pyx_GIVEREF(__pyx_tuple__275);
  __pyx_codeobj__276 = (PyObject*)__Pyx_PyCode_New(3, 0, 15, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__275, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_n_s_roll_max2, 1519, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__276)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1519; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/algos.pyx":1599
 *     return y
 * 
 * def roll_max(ndarray input, int win, int minp):             # <<<<<<<<<<<<<<
 *     '''
 *     O(N log(window)) implementation using skip list
 */
  __pyx_tuple__277 = PyTuple_Pack(3, __pyx_n_s_input, __pyx_n_s_win, __pyx_n_s_minp); if (unlikely(!__pyx_tuple__277)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1599; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__277);
  __Pyx_GIVEREF(__pyx_tuple__277);
  __pyx_codeobj__278 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__277, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_n_s_roll_max, 1599, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__278)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1599; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/algos.pyx":1612
 *         return NaN
 * 
 * def roll_min(ndarray input, int win, int minp):             # <<<<<<<<<<<<<<
 *     '''
 *     O(N log(window)) implementation using skip list
 */
  __pyx_tuple__279 = PyTuple_Pack(3, __pyx_n_s_input, __pyx_n_s_win, __pyx_n_s_minp); if (unlikely(!__pyx_tuple__279)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1612; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__279);
  __Pyx_GIVEREF(__pyx_tuple__279);
  __pyx_codeobj__280 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__279, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_n_s_roll_min, 1612, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__280)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1612; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/algos.pyx":1620
 * @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_tuple__281 = PyTuple_Pack(15, __pyx_n_s_a, __pyx_n_s_window, __pyx_n_s_minp, __pyx_n_s_ai, __pyx_n_s_aold, __pyx_n_s_count, __pyx_n_s_ring, __pyx_n_s_minpair, __pyx_n_s_end, __pyx_n_s_last, __pyx_n_s_i0, __pyx_n_s_dim, __pyx_n_s_n0, __pyx_n_s_dims, __pyx_n_s_y); if (unlikely(!__pyx_tuple__281)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1620; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__281);
  __Pyx_GIVEREF(__pyx_tuple__281);
  __pyx_codeobj__282 = (PyObject*)__Pyx_PyCode_New(3, 0, 15, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__281, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_n_s_roll_min2, 1620, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__282)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1620; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/algos.pyx":1706
 *         return NaN
 * 
 * def roll_quantile(ndarray[float64_t, cast=True] input, int win,             # <<<<<<<<<<<<<<
 *                   int minp, double quantile):
 *     '''
 */
  __pyx_tuple__283 = PyTuple_Pack(13, __pyx_n_s_input, __pyx_n_s_win, __pyx_n_s_minp, __pyx_n_s_quantile, __pyx_n_s_val, __pyx_n_s_prev, __pyx_n_s_midpoint, __pyx_n_s_skiplist, __pyx_n_s_nobs, __pyx_n_s_i, __pyx_n_s_N, __pyx_n_s_output, __pyx_n_s_idx); if (unlikely(!__pyx_tuple__283)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1706; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__283);
  __Pyx_GIVEREF(__pyx_tuple__283);
  __pyx_codeobj__284 = (PyObject*)__Pyx_PyCode_New(4, 0, 13, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__283, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_n_s_roll_quantile, 1706, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__284)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1706; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/algos.pyx":1753
 *     return output
 * 
 * def roll_generic(ndarray[float64_t, cast=True] input, int win,             # <<<<<<<<<<<<<<
 *                  int minp, object func, object args, object kwargs):
 *     cdef ndarray[double_t] output, counts, bufarr
 */
  __pyx_tuple__285 = PyTuple_Pack(13, __pyx_n_s_input, __pyx_n_s_win, __pyx_n_s_minp, __pyx_n_s_func, __pyx_n_s_args, __pyx_n_s_kwargs, __pyx_n_s_output, __pyx_n_s_counts, __pyx_n_s_bufarr, __pyx_n_s_i, __pyx_n_s_n, __pyx_n_s_buf, __pyx_n_s_oldbuf); if (unlikely(!__pyx_tuple__285)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1753; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__285);
  __Pyx_GIVEREF(__pyx_tuple__285);
  __pyx_codeobj__286 = (PyObject*)__Pyx_PyCode_New(6, 0, 13, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__285, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_n_s_roll_generic, 1753, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__286)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1753; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/algos.pyx":1797
 * 
 * 
 * def roll_window(ndarray[float64_t, ndim=1, cast=True] input,             # <<<<<<<<<<<<<<
 *                 ndarray[float64_t, ndim=1, cast=True] weights,
 *                 int minp, bint avg=True, bint avg_wgt=False):
 */
  __pyx_tuple__287 = PyTuple_Pack(18, __pyx_n_s_input, __pyx_n_s_weights, __pyx_n_s_minp, __pyx_n_s_avg, __pyx_n_s_avg_wgt, __pyx_n_s_output, __pyx_n_s_tot_wgt, __pyx_n_s_counts, __pyx_n_s_in_i, __pyx_n_s_win_i, __pyx_n_s_win_n, __pyx_n_s_win_k, __pyx_n_s_in_n, __pyx_n_s_in_k, __pyx_n_s_val_in, __pyx_n_s_val_win, __pyx_n_s_c, __pyx_n_s_w); if (unlikely(!__pyx_tuple__287)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1797; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__287);
  __Pyx_GIVEREF(__pyx_tuple__287);
  __pyx_codeobj__288 = (PyObject*)__Pyx_PyCode_New(5, 0, 18, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__287, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_n_s_roll_window, 1797, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__288)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1797; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/algos.pyx":1870
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def is_lexsorted(list list_of_arrays):             # <<<<<<<<<<<<<<
 *     cdef:
 *         int i
 */
  __pyx_tuple__289 = PyTuple_Pack(9, __pyx_n_s_list_of_arrays, __pyx_n_s_i, __pyx_n_s_n, __pyx_n_s_nlevels, __pyx_n_s_k, __pyx_n_s_cur, __pyx_n_s_pre, __pyx_n_s_arr, __pyx_n_s_vecs); if (unlikely(!__pyx_tuple__289)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1870; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__289);
  __Pyx_GIVEREF(__pyx_tuple__289);
  __pyx_codeobj__290 = (PyObject*)__Pyx_PyCode_New(1, 0, 9, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__289, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_n_s_is_lexsorted, 1870, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__290)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1870; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/algos.pyx":1903
 * 
 * @cython.boundscheck(False)
 * def groupby_indices(ndarray values):             # <<<<<<<<<<<<<<
 *     cdef:
 *         Py_ssize_t i, n = len(values)
 */
  __pyx_tuple__291 = PyTuple_Pack(13, __pyx_n_s_values, __pyx_n_s_i, __pyx_n_s_n, __pyx_n_s_labels, __pyx_n_s_counts, __pyx_n_s_arr, __pyx_n_s_seen, __pyx_n_s_loc, __pyx_n_s_ids, __pyx_n_s_val, __pyx_n_s_k, __pyx_n_s_vecs, __pyx_n_s_result); if (unlikely(!__pyx_tuple__291)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1903; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__291);
  __Pyx_GIVEREF(__pyx_tuple__291);
  __pyx_codeobj__292 = (PyObject*)__Pyx_PyCode_New(1, 0, 13, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__291, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_n_s_groupby_indices, 1903, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__292)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1903; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/algos.pyx":1940
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def group_labels(ndarray[object] values):             # <<<<<<<<<<<<<<
 *     '''
 *     Compute label vector from input values and associated useful data
 */
  __pyx_tuple__293 = PyTuple_Pack(10, __pyx_n_s_values, __pyx_n_s_i, __pyx_n_s_n, __pyx_n_s_labels, __pyx_n_s_counts, __pyx_n_s_ids, __pyx_n_s_reverse, __pyx_n_s_idx, __pyx_n_s_val, __pyx_n_s_count); if (unlikely(!__pyx_tuple__293)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1940; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__293);
  __Pyx_GIVEREF(__pyx_tuple__293);
  __pyx_codeobj__294 = (PyObject*)__Pyx_PyCode_New(1, 0, 10, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__293, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_n_s_group_labels, 1940, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__294)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1940; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/algos.pyx":1982
 * @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_tuple__295 = PyTuple_Pack(9, __pyx_n_s_index, __pyx_n_s_ngroups, __pyx_n_s_i, __pyx_n_s_loc, __pyx_n_s_label, __pyx_n_s_n, __pyx_n_s_counts, __pyx_n_s_where, __pyx_n_s_result); if (unlikely(!__pyx_tuple__295)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1982; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__295);
  __Pyx_GIVEREF(__pyx_tuple__295);
  __pyx_codeobj__296 = (PyObject*)__Pyx_PyCode_New(2, 0, 9, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__295, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_n_s_groupsort_indexer, 1982, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__296)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1982; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/algos.pyx":2013
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def group_nth_object(ndarray[object, ndim=2] out,             # <<<<<<<<<<<<<<
 *                      ndarray[int64_t] counts,
 *                      ndarray[object, ndim=2] values,
 */
  __pyx_tuple__297 = PyTuple_Pack(14, __pyx_n_s_out, __pyx_n_s_counts, __pyx_n_s_values, __pyx_n_s_labels, __pyx_n_s_rank, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_N, __pyx_n_s_K, __pyx_n_s_lab, __pyx_n_s_val, __pyx_n_s_count, __pyx_n_s_nobs, __pyx_n_s_resx); if (unlikely(!__pyx_tuple__297)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2013; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__297);
  __Pyx_GIVEREF(__pyx_tuple__297);
  __pyx_codeobj__298 = (PyObject*)__Pyx_PyCode_New(5, 0, 14, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__297, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_n_s_group_nth_object, 2013, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__298)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2013; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/algos.pyx":2057
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def group_nth_bin_object(ndarray[object, ndim=2] out,             # <<<<<<<<<<<<<<
 *                          ndarray[int64_t] counts,
 *                          ndarray[object, ndim=2] values,
 */
  __pyx_tuple__299 = PyTuple_Pack(15, __pyx_n_s_out, __pyx_n_s_counts, __pyx_n_s_values, __pyx_n_s_bins, __pyx_n_s_rank, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_N, __pyx_n_s_K, __pyx_n_s_ngroups, __pyx_n_s_b, __pyx_n_s_val, __pyx_n_s_count, __pyx_n_s_resx, __pyx_n_s_nobs); if (unlikely(!__pyx_tuple__299)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2057; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__299);
  __Pyx_GIVEREF(__pyx_tuple__299);
  __pyx_codeobj__300 = (PyObject*)__Pyx_PyCode_New(5, 0, 15, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__299, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_n_s_group_nth_bin_object, 2057, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__300)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2057; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/algos.pyx":2105
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def group_last_object(ndarray[object, ndim=2] out,             # <<<<<<<<<<<<<<
 *                       ndarray[int64_t] counts,
 *                       ndarray[object, ndim=2] values,
 */
  __pyx_tuple__301 = PyTuple_Pack(13, __pyx_n_s_out, __pyx_n_s_counts, __pyx_n_s_values, __pyx_n_s_labels, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_N, __pyx_n_s_K, __pyx_n_s_lab, __pyx_n_s_val, __pyx_n_s_count, __pyx_n_s_resx, __pyx_n_s_nobs); if (unlikely(!__pyx_tuple__301)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2105; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__301);
  __Pyx_GIVEREF(__pyx_tuple__301);
  __pyx_codeobj__302 = (PyObject*)__Pyx_PyCode_New(4, 0, 13, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__301, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_n_s_group_last_object, 2105, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__302)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2105; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/algos.pyx":2147
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def group_last_bin_object(ndarray[object, ndim=2] out,             # <<<<<<<<<<<<<<
 *                           ndarray[int64_t] counts,
 *                           ndarray[object, ndim=2] values,
 */
  __pyx_tuple__303 = PyTuple_Pack(14, __pyx_n_s_out, __pyx_n_s_counts, __pyx_n_s_values, __pyx_n_s_bins, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_N, __pyx_n_s_K, __pyx_n_s_ngroups, __pyx_n_s_b, __pyx_n_s_val, __pyx_n_s_count, __pyx_n_s_resx, __pyx_n_s_nobs); if (unlikely(!__pyx_tuple__303)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2147; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__303);
  __Pyx_GIVEREF(__pyx_tuple__303);
  __pyx_codeobj__304 = (PyObject*)__Pyx_PyCode_New(4, 0, 14, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__303, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_n_s_group_last_bin_object, 2147, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__304)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2147; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/algos.pyx":2197
 * # median
 * 
 * def group_median(ndarray[float64_t, ndim=2] out,             # <<<<<<<<<<<<<<
 *                  ndarray[int64_t] counts,
 *                  ndarray[float64_t, ndim=2] values,
 */
  __pyx_tuple__305 = PyTuple_Pack(14, __pyx_n_s_out, __pyx_n_s_counts, __pyx_n_s_values, __pyx_n_s_labels, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_N, __pyx_n_s_K, __pyx_n_s_ngroups, __pyx_n_s_size, __pyx_n_s_counts_2, __pyx_n_s_data, __pyx_n_s_ptr, __pyx_n_s_indexer); if (unlikely(!__pyx_tuple__305)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2197; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__305);
  __Pyx_GIVEREF(__pyx_tuple__305);
  __pyx_codeobj__306 = (PyObject*)__Pyx_PyCode_New(4, 0, 14, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__305, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_n_s_group_median, 2197, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__306)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2197; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/src/join.pyx":1
 * def inner_join(ndarray[int64_t] left, ndarray[int64_t] right,             # <<<<<<<<<<<<<<
 *                Py_ssize_t max_groups):
 *     cdef:
 */
  __pyx_tuple__307 = PyTuple_Pack(20, __pyx_n_s_left, __pyx_n_s_right, __pyx_n_s_max_groups, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_k, __pyx_n_s_count, __pyx_n_s_left_count, __pyx_n_s_right_count, __pyx_n_s_left_sorter, __pyx_n_s_right_sorter, __pyx_n_s_left_indexer, __pyx_n_s_right_indexer, __pyx_n_s_lc, __pyx_n_s_rc, __pyx_n_s_loc, __pyx_n_s_left_pos, __pyx_n_s_right_pos, __pyx_n_s_position, __pyx_n_s_offset); if (unlikely(!__pyx_tuple__307)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__307);
  __Pyx_GIVEREF(__pyx_tuple__307);
  __pyx_codeobj__308 = (PyObject*)__Pyx_PyCode_New(3, 0, 20, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__307, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_join_pyx, __pyx_n_s_inner_join, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__308)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/src/join.pyx":51
 *             _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_tuple__309 = PyTuple_Pack(22, __pyx_n_s_left, __pyx_n_s_right, __pyx_n_s_max_groups, __pyx_n_s_sort, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_k, __pyx_n_s_count, __pyx_n_s_left_count, __pyx_n_s_right_count, __pyx_n_s_left_sorter, __pyx_n_s_right_sorter, __pyx_n_s_rev, __pyx_n_s_left_indexer, __pyx_n_s_right_indexer, __pyx_n_s_lc, __pyx_n_s_rc, __pyx_n_s_loc, __pyx_n_s_left_pos, __pyx_n_s_right_pos, __pyx_n_s_position, __pyx_n_s_offset); if (unlikely(!__pyx_tuple__309)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__309);
  __Pyx_GIVEREF(__pyx_tuple__309);
  __pyx_codeobj__310 = (PyObject*)__Pyx_PyCode_New(4, 0, 22, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__309, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_join_pyx, __pyx_n_s_left_outer_join, 51, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__310)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/src/join.pyx":120
 * 
 * 
 * def full_outer_join(ndarray[int64_t] left, ndarray[int64_t] right,             # <<<<<<<<<<<<<<
 *                           Py_ssize_t max_groups):
 *     cdef:
 */
  __pyx_tuple__311 = PyTuple_Pack(19, __pyx_n_s_left, __pyx_n_s_right, __pyx_n_s_max_groups, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_k, __pyx_n_s_count, __pyx_n_s_left_count, __pyx_n_s_right_count, __pyx_n_s_left_sorter, __pyx_n_s_right_sorter, __pyx_n_s_left_indexer, __pyx_n_s_right_indexer, __pyx_n_s_lc, __pyx_n_s_rc, __pyx_n_s_left_pos, __pyx_n_s_right_pos, __pyx_n_s_offset, __pyx_n_s_position); if (unlikely(!__pyx_tuple__311)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 120; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__311);
  __Pyx_GIVEREF(__pyx_tuple__311);
  __pyx_codeobj__312 = (PyObject*)__Pyx_PyCode_New(3, 0, 19, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__311, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_join_pyx, __pyx_n_s_full_outer_join, 120, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__312)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 120; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/src/join.pyx":184
 * 
 * 
 * def _get_result_indexer(sorter, indexer):             # <<<<<<<<<<<<<<
 *     if indexer.dtype != np.int_:
 *         indexer = indexer.astype(np.int_)
 */
  __pyx_tuple__313 = PyTuple_Pack(3, __pyx_n_s_sorter, __pyx_n_s_indexer, __pyx_n_s_res); if (unlikely(!__pyx_tuple__313)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 184; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__313);
  __Pyx_GIVEREF(__pyx_tuple__313);
  __pyx_codeobj__314 = (PyObject*)__Pyx_PyCode_New(2, 0, 3, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__313, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_join_pyx, __pyx_n_s_get_result_indexer, 184, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__314)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 184; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/src/join.pyx":199
 * 
 * 
 * def ffill_indexer(ndarray[int64_t] indexer):             # <<<<<<<<<<<<<<
 *     cdef:
 *         Py_ssize_t i, n = len(indexer)
 */
  __pyx_tuple__315 = PyTuple_Pack(6, __pyx_n_s_indexer, __pyx_n_s_i, __pyx_n_s_n, __pyx_n_s_result, __pyx_n_s_val, __pyx_n_s_last_obs); if (unlikely(!__pyx_tuple__315)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 199; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__315);
  __Pyx_GIVEREF(__pyx_tuple__315);
  __pyx_codeobj__316 = (PyObject*)__Pyx_PyCode_New(1, 0, 6, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__315, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_join_pyx, __pyx_n_s_ffill_indexer, 199, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__316)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 199; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/src/join.pyx":219
 * 
 * 
 * def ffill_by_group(ndarray[int64_t] indexer, ndarray[int64_t] group_ids,             # <<<<<<<<<<<<<<
 *                    int64_t max_group):
 *     cdef:
 */
  __pyx_tuple__317 = PyTuple_Pack(9, __pyx_n_s_indexer, __pyx_n_s_group_ids, __pyx_n_s_max_group, __pyx_n_s_i, __pyx_n_s_n, __pyx_n_s_result, __pyx_n_s_last_obs, __pyx_n_s_gid, __pyx_n_s_val); if (unlikely(!__pyx_tuple__317)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 219; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__317);
  __Pyx_GIVEREF(__pyx_tuple__317);
  __pyx_codeobj__318 = (PyObject*)__Pyx_PyCode_New(3, 0, 9, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__317, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_join_pyx, __pyx_n_s_ffill_by_group, 219, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__318)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 219; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/src/generated.pyx":41
 * import_ufunc()
 * 
 * cdef int PLATFORM_INT = (<ndarray> np.arange(0, dtype=np.int_)).descr.type_num             # <<<<<<<<<<<<<<
 * 
 * cpdef ensure_platform_int(object arr):
 */
  __pyx_tuple__319 = PyTuple_Pack(1, __pyx_int_0); if (unlikely(!__pyx_tuple__319)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__319);
  __Pyx_GIVEREF(__pyx_tuple__319);

  /* "pandas/src/generated.pyx":259
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def pad_float64(ndarray[float64_t] old, ndarray[float64_t] new,             # <<<<<<<<<<<<<<
 *                    limit=None):
 *     cdef Py_ssize_t i, j, nleft, nright
 */
  __pyx_tuple__320 = PyTuple_Pack(12, __pyx_n_s_old, __pyx_n_s_new, __pyx_n_s_limit, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_nleft, __pyx_n_s_nright, __pyx_n_s_indexer, __pyx_n_s_cur, __pyx_n_s_next, __pyx_n_s_lim, __pyx_n_s_fill_count); if (unlikely(!__pyx_tuple__320)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 259; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__320);
  __Pyx_GIVEREF(__pyx_tuple__320);
  __pyx_codeobj__321 = (PyObject*)__Pyx_PyCode_New(3, 0, 12, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__320, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_pad_float64, 259, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__321)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 259; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/src/generated.pyx":320
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def pad_float32(ndarray[float32_t] old, ndarray[float32_t] new,             # <<<<<<<<<<<<<<
 *                    limit=None):
 *     cdef Py_ssize_t i, j, nleft, nright
 */
  __pyx_tuple__322 = PyTuple_Pack(12, __pyx_n_s_old, __pyx_n_s_new, __pyx_n_s_limit, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_nleft, __pyx_n_s_nright, __pyx_n_s_indexer, __pyx_n_s_cur, __pyx_n_s_next, __pyx_n_s_lim, __pyx_n_s_fill_count); if (unlikely(!__pyx_tuple__322)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 320; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__322);
  __Pyx_GIVEREF(__pyx_tuple__322);
  __pyx_codeobj__323 = (PyObject*)__Pyx_PyCode_New(3, 0, 12, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__322, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_pad_float32, 320, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__323)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 320; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/src/generated.pyx":381
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def pad_object(ndarray[object] old, ndarray[object] new,             # <<<<<<<<<<<<<<
 *                    limit=None):
 *     cdef Py_ssize_t i, j, nleft, nright
 */
  __pyx_tuple__324 = PyTuple_Pack(12, __pyx_n_s_old, __pyx_n_s_new, __pyx_n_s_limit, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_nleft, __pyx_n_s_nright, __pyx_n_s_indexer, __pyx_n_s_cur, __pyx_n_s_next, __pyx_n_s_lim, __pyx_n_s_fill_count); if (unlikely(!__pyx_tuple__324)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 381; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__324);
  __Pyx_GIVEREF(__pyx_tuple__324);
  __pyx_codeobj__325 = (PyObject*)__Pyx_PyCode_New(3, 0, 12, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__324, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_pad_object, 381, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__325)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 381; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/src/generated.pyx":442
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def pad_int32(ndarray[int32_t] old, ndarray[int32_t] new,             # <<<<<<<<<<<<<<
 *                    limit=None):
 *     cdef Py_ssize_t i, j, nleft, nright
 */
  __pyx_tuple__326 = PyTuple_Pack(12, __pyx_n_s_old, __pyx_n_s_new, __pyx_n_s_limit, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_nleft, __pyx_n_s_nright, __pyx_n_s_indexer, __pyx_n_s_cur, __pyx_n_s_next, __pyx_n_s_lim, __pyx_n_s_fill_count); if (unlikely(!__pyx_tuple__326)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 442; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__326);
  __Pyx_GIVEREF(__pyx_tuple__326);
  __pyx_codeobj__327 = (PyObject*)__Pyx_PyCode_New(3, 0, 12, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__326, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_pad_int32, 442, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__327)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 442; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/src/generated.pyx":503
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def pad_int64(ndarray[int64_t] old, ndarray[int64_t] new,             # <<<<<<<<<<<<<<
 *                    limit=None):
 *     cdef Py_ssize_t i, j, nleft, nright
 */
  __pyx_tuple__328 = PyTuple_Pack(12, __pyx_n_s_old, __pyx_n_s_new, __pyx_n_s_limit, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_nleft, __pyx_n_s_nright, __pyx_n_s_indexer, __pyx_n_s_cur, __pyx_n_s_next, __pyx_n_s_lim, __pyx_n_s_fill_count); if (unlikely(!__pyx_tuple__328)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 503; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__328);
  __Pyx_GIVEREF(__pyx_tuple__328);
  __pyx_codeobj__329 = (PyObject*)__Pyx_PyCode_New(3, 0, 12, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__328, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_pad_int64, 503, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__329)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 503; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/src/generated.pyx":564
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def pad_bool(ndarray[uint8_t] old, ndarray[uint8_t] new,             # <<<<<<<<<<<<<<
 *                    limit=None):
 *     cdef Py_ssize_t i, j, nleft, nright
 */
  __pyx_tuple__330 = PyTuple_Pack(12, __pyx_n_s_old, __pyx_n_s_new, __pyx_n_s_limit, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_nleft, __pyx_n_s_nright, __pyx_n_s_indexer, __pyx_n_s_cur, __pyx_n_s_next, __pyx_n_s_lim, __pyx_n_s_fill_count); if (unlikely(!__pyx_tuple__330)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 564; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__330);
  __Pyx_GIVEREF(__pyx_tuple__330);
  __pyx_codeobj__331 = (PyObject*)__Pyx_PyCode_New(3, 0, 12, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__330, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_pad_bool, 564, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__331)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 564; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/src/generated.pyx":626
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def backfill_float64(ndarray[float64_t] old, ndarray[float64_t] new,             # <<<<<<<<<<<<<<
 *                       limit=None):
 *     cdef Py_ssize_t i, j, nleft, nright
 */
  __pyx_tuple__332 = PyTuple_Pack(12, __pyx_n_s_old, __pyx_n_s_new, __pyx_n_s_limit, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_nleft, __pyx_n_s_nright, __pyx_n_s_indexer, __pyx_n_s_cur, __pyx_n_s_prev, __pyx_n_s_lim, __pyx_n_s_fill_count); if (unlikely(!__pyx_tuple__332)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 626; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__332);
  __Pyx_GIVEREF(__pyx_tuple__332);
  __pyx_codeobj__333 = (PyObject*)__Pyx_PyCode_New(3, 0, 12, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__332, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_backfill_float64, 626, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__333)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 626; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/src/generated.pyx":688
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def backfill_float32(ndarray[float32_t] old, ndarray[float32_t] new,             # <<<<<<<<<<<<<<
 *                       limit=None):
 *     cdef Py_ssize_t i, j, nleft, nright
 */
  __pyx_tuple__334 = PyTuple_Pack(12, __pyx_n_s_old, __pyx_n_s_new, __pyx_n_s_limit, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_nleft, __pyx_n_s_nright, __pyx_n_s_indexer, __pyx_n_s_cur, __pyx_n_s_prev, __pyx_n_s_lim, __pyx_n_s_fill_count); if (unlikely(!__pyx_tuple__334)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 688; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__334);
  __Pyx_GIVEREF(__pyx_tuple__334);
  __pyx_codeobj__335 = (PyObject*)__Pyx_PyCode_New(3, 0, 12, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__334, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_backfill_float32, 688, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__335)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 688; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/src/generated.pyx":750
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def backfill_object(ndarray[object] old, ndarray[object] new,             # <<<<<<<<<<<<<<
 *                       limit=None):
 *     cdef Py_ssize_t i, j, nleft, nright
 */
  __pyx_tuple__336 = PyTuple_Pack(12, __pyx_n_s_old, __pyx_n_s_new, __pyx_n_s_limit, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_nleft, __pyx_n_s_nright, __pyx_n_s_indexer, __pyx_n_s_cur, __pyx_n_s_prev, __pyx_n_s_lim, __pyx_n_s_fill_count); if (unlikely(!__pyx_tuple__336)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 750; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__336);
  __Pyx_GIVEREF(__pyx_tuple__336);
  __pyx_codeobj__337 = (PyObject*)__Pyx_PyCode_New(3, 0, 12, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__336, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_backfill_object, 750, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__337)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 750; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/src/generated.pyx":812
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def backfill_int32(ndarray[int32_t] old, ndarray[int32_t] new,             # <<<<<<<<<<<<<<
 *                       limit=None):
 *     cdef Py_ssize_t i, j, nleft, nright
 */
  __pyx_tuple__338 = PyTuple_Pack(12, __pyx_n_s_old, __pyx_n_s_new, __pyx_n_s_limit, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_nleft, __pyx_n_s_nright, __pyx_n_s_indexer, __pyx_n_s_cur, __pyx_n_s_prev, __pyx_n_s_lim, __pyx_n_s_fill_count); if (unlikely(!__pyx_tuple__338)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 812; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__338);
  __Pyx_GIVEREF(__pyx_tuple__338);
  __pyx_codeobj__339 = (PyObject*)__Pyx_PyCode_New(3, 0, 12, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__338, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_backfill_int32, 812, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__339)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 812; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/src/generated.pyx":874
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def backfill_int64(ndarray[int64_t] old, ndarray[int64_t] new,             # <<<<<<<<<<<<<<
 *                       limit=None):
 *     cdef Py_ssize_t i, j, nleft, nright
 */
  __pyx_tuple__340 = PyTuple_Pack(12, __pyx_n_s_old, __pyx_n_s_new, __pyx_n_s_limit, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_nleft, __pyx_n_s_nright, __pyx_n_s_indexer, __pyx_n_s_cur, __pyx_n_s_prev, __pyx_n_s_lim, __pyx_n_s_fill_count); if (unlikely(!__pyx_tuple__340)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 874; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__340);
  __Pyx_GIVEREF(__pyx_tuple__340);
  __pyx_codeobj__341 = (PyObject*)__Pyx_PyCode_New(3, 0, 12, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__340, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_backfill_int64, 874, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__341)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 874; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/src/generated.pyx":936
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def backfill_bool(ndarray[uint8_t] old, ndarray[uint8_t] new,             # <<<<<<<<<<<<<<
 *                       limit=None):
 *     cdef Py_ssize_t i, j, nleft, nright
 */
  __pyx_tuple__342 = PyTuple_Pack(12, __pyx_n_s_old, __pyx_n_s_new, __pyx_n_s_limit, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_nleft, __pyx_n_s_nright, __pyx_n_s_indexer, __pyx_n_s_cur, __pyx_n_s_prev, __pyx_n_s_lim, __pyx_n_s_fill_count); if (unlikely(!__pyx_tuple__342)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 936; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__342);
  __Pyx_GIVEREF(__pyx_tuple__342);
  __pyx_codeobj__343 = (PyObject*)__Pyx_PyCode_New(3, 0, 12, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__342, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_backfill_bool, 936, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__343)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 936; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/src/generated.pyx":999
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def pad_inplace_float64(ndarray[float64_t] values,             # <<<<<<<<<<<<<<
 *                          ndarray[uint8_t, cast=True] mask,
 *                          limit=None):
 */
  __pyx_tuple__344 = PyTuple_Pack(8, __pyx_n_s_values, __pyx_n_s_mask, __pyx_n_s_limit, __pyx_n_s_i, __pyx_n_s_N, __pyx_n_s_val, __pyx_n_s_lim, __pyx_n_s_fill_count); if (unlikely(!__pyx_tuple__344)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 999; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__344);
  __Pyx_GIVEREF(__pyx_tuple__344);
  __pyx_codeobj__345 = (PyObject*)__Pyx_PyCode_New(3, 0, 8, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__344, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_pad_inplace_float64, 999, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__345)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 999; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/src/generated.pyx":1032
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def pad_inplace_float32(ndarray[float32_t] values,             # <<<<<<<<<<<<<<
 *                          ndarray[uint8_t, cast=True] mask,
 *                          limit=None):
 */
  __pyx_tuple__346 = PyTuple_Pack(8, __pyx_n_s_values, __pyx_n_s_mask, __pyx_n_s_limit, __pyx_n_s_i, __pyx_n_s_N, __pyx_n_s_val, __pyx_n_s_lim, __pyx_n_s_fill_count); if (unlikely(!__pyx_tuple__346)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1032; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__346);
  __Pyx_GIVEREF(__pyx_tuple__346);
  __pyx_codeobj__347 = (PyObject*)__Pyx_PyCode_New(3, 0, 8, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__346, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_pad_inplace_float32, 1032, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__347)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1032; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/src/generated.pyx":1065
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def pad_inplace_object(ndarray[object] values,             # <<<<<<<<<<<<<<
 *                          ndarray[uint8_t, cast=True] mask,
 *                          limit=None):
 */
  __pyx_tuple__348 = PyTuple_Pack(8, __pyx_n_s_values, __pyx_n_s_mask, __pyx_n_s_limit, __pyx_n_s_i, __pyx_n_s_N, __pyx_n_s_val, __pyx_n_s_lim, __pyx_n_s_fill_count); if (unlikely(!__pyx_tuple__348)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1065; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__348);
  __Pyx_GIVEREF(__pyx_tuple__348);
  __pyx_codeobj__349 = (PyObject*)__Pyx_PyCode_New(3, 0, 8, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__348, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_pad_inplace_object, 1065, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__349)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1065; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/src/generated.pyx":1098
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def pad_inplace_int32(ndarray[int32_t] values,             # <<<<<<<<<<<<<<
 *                          ndarray[uint8_t, cast=True] mask,
 *                          limit=None):
 */
  __pyx_tuple__350 = PyTuple_Pack(8, __pyx_n_s_values, __pyx_n_s_mask, __pyx_n_s_limit, __pyx_n_s_i, __pyx_n_s_N, __pyx_n_s_val, __pyx_n_s_lim, __pyx_n_s_fill_count); if (unlikely(!__pyx_tuple__350)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1098; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__350);
  __Pyx_GIVEREF(__pyx_tuple__350);
  __pyx_codeobj__351 = (PyObject*)__Pyx_PyCode_New(3, 0, 8, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__350, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_pad_inplace_int32, 1098, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__351)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1098; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/src/generated.pyx":1131
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def pad_inplace_int64(ndarray[int64_t] values,             # <<<<<<<<<<<<<<
 *                          ndarray[uint8_t, cast=True] mask,
 *                          limit=None):
 */
  __pyx_tuple__352 = PyTuple_Pack(8, __pyx_n_s_values, __pyx_n_s_mask, __pyx_n_s_limit, __pyx_n_s_i, __pyx_n_s_N, __pyx_n_s_val, __pyx_n_s_lim, __pyx_n_s_fill_count); if (unlikely(!__pyx_tuple__352)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1131; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__352);
  __Pyx_GIVEREF(__pyx_tuple__352);
  __pyx_codeobj__353 = (PyObject*)__Pyx_PyCode_New(3, 0, 8, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__352, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_pad_inplace_int64, 1131, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__353)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1131; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/src/generated.pyx":1164
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def pad_inplace_bool(ndarray[uint8_t] values,             # <<<<<<<<<<<<<<
 *                          ndarray[uint8_t, cast=True] mask,
 *                          limit=None):
 */
  __pyx_tuple__354 = PyTuple_Pack(8, __pyx_n_s_values, __pyx_n_s_mask, __pyx_n_s_limit, __pyx_n_s_i, __pyx_n_s_N, __pyx_n_s_val, __pyx_n_s_lim, __pyx_n_s_fill_count); if (unlikely(!__pyx_tuple__354)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1164; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__354);
  __Pyx_GIVEREF(__pyx_tuple__354);
  __pyx_codeobj__355 = (PyObject*)__Pyx_PyCode_New(3, 0, 8, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__354, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_pad_inplace_bool, 1164, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__355)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1164; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/src/generated.pyx":1198
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def backfill_inplace_float64(ndarray[float64_t] values,             # <<<<<<<<<<<<<<
 *                               ndarray[uint8_t, cast=True] mask,
 *                               limit=None):
 */
  __pyx_tuple__356 = PyTuple_Pack(8, __pyx_n_s_values, __pyx_n_s_mask, __pyx_n_s_limit, __pyx_n_s_i, __pyx_n_s_N, __pyx_n_s_val, __pyx_n_s_lim, __pyx_n_s_fill_count); if (unlikely(!__pyx_tuple__356)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1198; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__356);
  __Pyx_GIVEREF(__pyx_tuple__356);
  __pyx_codeobj__357 = (PyObject*)__Pyx_PyCode_New(3, 0, 8, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__356, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_backfill_inplace_float64, 1198, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__357)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1198; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/src/generated.pyx":1230
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def backfill_inplace_float32(ndarray[float32_t] values,             # <<<<<<<<<<<<<<
 *                               ndarray[uint8_t, cast=True] mask,
 *                               limit=None):
 */
  __pyx_tuple__358 = PyTuple_Pack(8, __pyx_n_s_values, __pyx_n_s_mask, __pyx_n_s_limit, __pyx_n_s_i, __pyx_n_s_N, __pyx_n_s_val, __pyx_n_s_lim, __pyx_n_s_fill_count); if (unlikely(!__pyx_tuple__358)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1230; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__358);
  __Pyx_GIVEREF(__pyx_tuple__358);
  __pyx_codeobj__359 = (PyObject*)__Pyx_PyCode_New(3, 0, 8, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__358, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_backfill_inplace_float32, 1230, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__359)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1230; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/src/generated.pyx":1262
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def backfill_inplace_object(ndarray[object] values,             # <<<<<<<<<<<<<<
 *                               ndarray[uint8_t, cast=True] mask,
 *                               limit=None):
 */
  __pyx_tuple__360 = PyTuple_Pack(8, __pyx_n_s_values, __pyx_n_s_mask, __pyx_n_s_limit, __pyx_n_s_i, __pyx_n_s_N, __pyx_n_s_val, __pyx_n_s_lim, __pyx_n_s_fill_count); if (unlikely(!__pyx_tuple__360)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1262; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__360);
  __Pyx_GIVEREF(__pyx_tuple__360);
  __pyx_codeobj__361 = (PyObject*)__Pyx_PyCode_New(3, 0, 8, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__360, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_backfill_inplace_object, 1262, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__361)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1262; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/src/generated.pyx":1294
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def backfill_inplace_int32(ndarray[int32_t] values,             # <<<<<<<<<<<<<<
 *                               ndarray[uint8_t, cast=True] mask,
 *                               limit=None):
 */
  __pyx_tuple__362 = PyTuple_Pack(8, __pyx_n_s_values, __pyx_n_s_mask, __pyx_n_s_limit, __pyx_n_s_i, __pyx_n_s_N, __pyx_n_s_val, __pyx_n_s_lim, __pyx_n_s_fill_count); if (unlikely(!__pyx_tuple__362)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1294; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__362);
  __Pyx_GIVEREF(__pyx_tuple__362);
  __pyx_codeobj__363 = (PyObject*)__Pyx_PyCode_New(3, 0, 8, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__362, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_backfill_inplace_int32, 1294, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__363)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1294; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/src/generated.pyx":1326
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def backfill_inplace_int64(ndarray[int64_t] values,             # <<<<<<<<<<<<<<
 *                               ndarray[uint8_t, cast=True] mask,
 *                               limit=None):
 */
  __pyx_tuple__364 = PyTuple_Pack(8, __pyx_n_s_values, __pyx_n_s_mask, __pyx_n_s_limit, __pyx_n_s_i, __pyx_n_s_N, __pyx_n_s_val, __pyx_n_s_lim, __pyx_n_s_fill_count); if (unlikely(!__pyx_tuple__364)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1326; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__364);
  __Pyx_GIVEREF(__pyx_tuple__364);
  __pyx_codeobj__365 = (PyObject*)__Pyx_PyCode_New(3, 0, 8, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__364, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_backfill_inplace_int64, 1326, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__365)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1326; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/src/generated.pyx":1358
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def backfill_inplace_bool(ndarray[uint8_t] values,             # <<<<<<<<<<<<<<
 *                               ndarray[uint8_t, cast=True] mask,
 *                               limit=None):
 */
  __pyx_tuple__366 = PyTuple_Pack(8, __pyx_n_s_values, __pyx_n_s_mask, __pyx_n_s_limit, __pyx_n_s_i, __pyx_n_s_N, __pyx_n_s_val, __pyx_n_s_lim, __pyx_n_s_fill_count); if (unlikely(!__pyx_tuple__366)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1358; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__366);
  __Pyx_GIVEREF(__pyx_tuple__366);
  __pyx_codeobj__367 = (PyObject*)__Pyx_PyCode_New(3, 0, 8, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__366, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_backfill_inplace_bool, 1358, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__367)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1358; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/src/generated.pyx":1391
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def pad_2d_inplace_float64(ndarray[float64_t, ndim=2] values,             # <<<<<<<<<<<<<<
 *                             ndarray[uint8_t, ndim=2] mask,
 *                             limit=None):
 */
  __pyx_tuple__368 = PyTuple_Pack(10, __pyx_n_s_values, __pyx_n_s_mask, __pyx_n_s_limit, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_N, __pyx_n_s_K, __pyx_n_s_val, __pyx_n_s_lim, __pyx_n_s_fill_count); if (unlikely(!__pyx_tuple__368)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1391; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__368);
  __Pyx_GIVEREF(__pyx_tuple__368);
  __pyx_codeobj__369 = (PyObject*)__Pyx_PyCode_New(3, 0, 10, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__368, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_pad_2d_inplace_float64, 1391, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__369)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1391; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/src/generated.pyx":1425
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def pad_2d_inplace_float32(ndarray[float32_t, ndim=2] values,             # <<<<<<<<<<<<<<
 *                             ndarray[uint8_t, ndim=2] mask,
 *                             limit=None):
 */
  __pyx_tuple__370 = PyTuple_Pack(10, __pyx_n_s_values, __pyx_n_s_mask, __pyx_n_s_limit, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_N, __pyx_n_s_K, __pyx_n_s_val, __pyx_n_s_lim, __pyx_n_s_fill_count); if (unlikely(!__pyx_tuple__370)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1425; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__370);
  __Pyx_GIVEREF(__pyx_tuple__370);
  __pyx_codeobj__371 = (PyObject*)__Pyx_PyCode_New(3, 0, 10, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__370, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_pad_2d_inplace_float32, 1425, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__371)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1425; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/src/generated.pyx":1459
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def pad_2d_inplace_object(ndarray[object, ndim=2] values,             # <<<<<<<<<<<<<<
 *                             ndarray[uint8_t, ndim=2] mask,
 *                             limit=None):
 */
  __pyx_tuple__372 = PyTuple_Pack(10, __pyx_n_s_values, __pyx_n_s_mask, __pyx_n_s_limit, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_N, __pyx_n_s_K, __pyx_n_s_val, __pyx_n_s_lim, __pyx_n_s_fill_count); if (unlikely(!__pyx_tuple__372)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1459; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__372);
  __Pyx_GIVEREF(__pyx_tuple__372);
  __pyx_codeobj__373 = (PyObject*)__Pyx_PyCode_New(3, 0, 10, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__372, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_pad_2d_inplace_object, 1459, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__373)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1459; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/src/generated.pyx":1493
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def pad_2d_inplace_int32(ndarray[int32_t, ndim=2] values,             # <<<<<<<<<<<<<<
 *                             ndarray[uint8_t, ndim=2] mask,
 *                             limit=None):
 */
  __pyx_tuple__374 = PyTuple_Pack(10, __pyx_n_s_values, __pyx_n_s_mask, __pyx_n_s_limit, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_N, __pyx_n_s_K, __pyx_n_s_val, __pyx_n_s_lim, __pyx_n_s_fill_count); if (unlikely(!__pyx_tuple__374)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1493; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__374);
  __Pyx_GIVEREF(__pyx_tuple__374);
  __pyx_codeobj__375 = (PyObject*)__Pyx_PyCode_New(3, 0, 10, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__374, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_pad_2d_inplace_int32, 1493, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__375)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1493; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/src/generated.pyx":1527
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def pad_2d_inplace_int64(ndarray[int64_t, ndim=2] values,             # <<<<<<<<<<<<<<
 *                             ndarray[uint8_t, ndim=2] mask,
 *                             limit=None):
 */
  __pyx_tuple__376 = PyTuple_Pack(10, __pyx_n_s_values, __pyx_n_s_mask, __pyx_n_s_limit, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_N, __pyx_n_s_K, __pyx_n_s_val, __pyx_n_s_lim, __pyx_n_s_fill_count); if (unlikely(!__pyx_tuple__376)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1527; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__376);
  __Pyx_GIVEREF(__pyx_tuple__376);
  __pyx_codeobj__377 = (PyObject*)__Pyx_PyCode_New(3, 0, 10, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__376, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_pad_2d_inplace_int64, 1527, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__377)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1527; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/src/generated.pyx":1561
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def pad_2d_inplace_bool(ndarray[uint8_t, ndim=2] values,             # <<<<<<<<<<<<<<
 *                             ndarray[uint8_t, ndim=2] mask,
 *                             limit=None):
 */
  __pyx_tuple__378 = PyTuple_Pack(10, __pyx_n_s_values, __pyx_n_s_mask, __pyx_n_s_limit, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_N, __pyx_n_s_K, __pyx_n_s_val, __pyx_n_s_lim, __pyx_n_s_fill_count); if (unlikely(!__pyx_tuple__378)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1561; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__378);
  __Pyx_GIVEREF(__pyx_tuple__378);
  __pyx_codeobj__379 = (PyObject*)__Pyx_PyCode_New(3, 0, 10, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__378, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_pad_2d_inplace_bool, 1561, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__379)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1561; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/src/generated.pyx":1596
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def backfill_2d_inplace_float64(ndarray[float64_t, ndim=2] values,             # <<<<<<<<<<<<<<
 *                                  ndarray[uint8_t, ndim=2] mask,
 *                                  limit=None):
 */
  __pyx_tuple__380 = PyTuple_Pack(10, __pyx_n_s_values, __pyx_n_s_mask, __pyx_n_s_limit, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_N, __pyx_n_s_K, __pyx_n_s_val, __pyx_n_s_lim, __pyx_n_s_fill_count); if (unlikely(!__pyx_tuple__380)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1596; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__380);
  __Pyx_GIVEREF(__pyx_tuple__380);
  __pyx_codeobj__381 = (PyObject*)__Pyx_PyCode_New(3, 0, 10, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__380, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_backfill_2d_inplace_float64, 1596, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__381)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1596; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/src/generated.pyx":1630
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def backfill_2d_inplace_float32(ndarray[float32_t, ndim=2] values,             # <<<<<<<<<<<<<<
 *                                  ndarray[uint8_t, ndim=2] mask,
 *                                  limit=None):
 */
  __pyx_tuple__382 = PyTuple_Pack(10, __pyx_n_s_values, __pyx_n_s_mask, __pyx_n_s_limit, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_N, __pyx_n_s_K, __pyx_n_s_val, __pyx_n_s_lim, __pyx_n_s_fill_count); if (unlikely(!__pyx_tuple__382)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1630; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__382);
  __Pyx_GIVEREF(__pyx_tuple__382);
  __pyx_codeobj__383 = (PyObject*)__Pyx_PyCode_New(3, 0, 10, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__382, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_backfill_2d_inplace_float32, 1630, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__383)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1630; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/src/generated.pyx":1664
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def backfill_2d_inplace_object(ndarray[object, ndim=2] values,             # <<<<<<<<<<<<<<
 *                                  ndarray[uint8_t, ndim=2] mask,
 *                                  limit=None):
 */
  __pyx_tuple__384 = PyTuple_Pack(10, __pyx_n_s_values, __pyx_n_s_mask, __pyx_n_s_limit, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_N, __pyx_n_s_K, __pyx_n_s_val, __pyx_n_s_lim, __pyx_n_s_fill_count); if (unlikely(!__pyx_tuple__384)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1664; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__384);
  __Pyx_GIVEREF(__pyx_tuple__384);
  __pyx_codeobj__385 = (PyObject*)__Pyx_PyCode_New(3, 0, 10, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__384, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_backfill_2d_inplace_object, 1664, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__385)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1664; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/src/generated.pyx":1698
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def backfill_2d_inplace_int32(ndarray[int32_t, ndim=2] values,             # <<<<<<<<<<<<<<
 *                                  ndarray[uint8_t, ndim=2] mask,
 *                                  limit=None):
 */
  __pyx_tuple__386 = PyTuple_Pack(10, __pyx_n_s_values, __pyx_n_s_mask, __pyx_n_s_limit, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_N, __pyx_n_s_K, __pyx_n_s_val, __pyx_n_s_lim, __pyx_n_s_fill_count); if (unlikely(!__pyx_tuple__386)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1698; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__386);
  __Pyx_GIVEREF(__pyx_tuple__386);
  __pyx_codeobj__387 = (PyObject*)__Pyx_PyCode_New(3, 0, 10, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__386, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_backfill_2d_inplace_int32, 1698, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__387)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1698; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/src/generated.pyx":1732
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def backfill_2d_inplace_int64(ndarray[int64_t, ndim=2] values,             # <<<<<<<<<<<<<<
 *                                  ndarray[uint8_t, ndim=2] mask,
 *                                  limit=None):
 */
  __pyx_tuple__388 = PyTuple_Pack(10, __pyx_n_s_values, __pyx_n_s_mask, __pyx_n_s_limit, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_N, __pyx_n_s_K, __pyx_n_s_val, __pyx_n_s_lim, __pyx_n_s_fill_count); if (unlikely(!__pyx_tuple__388)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1732; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__388);
  __Pyx_GIVEREF(__pyx_tuple__388);
  __pyx_codeobj__389 = (PyObject*)__Pyx_PyCode_New(3, 0, 10, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__388, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_backfill_2d_inplace_int64, 1732, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__389)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1732; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/src/generated.pyx":1766
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def backfill_2d_inplace_bool(ndarray[uint8_t, ndim=2] values,             # <<<<<<<<<<<<<<
 *                                  ndarray[uint8_t, ndim=2] mask,
 *                                  limit=None):
 */
  __pyx_tuple__390 = PyTuple_Pack(10, __pyx_n_s_values, __pyx_n_s_mask, __pyx_n_s_limit, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_N, __pyx_n_s_K, __pyx_n_s_val, __pyx_n_s_lim, __pyx_n_s_fill_count); if (unlikely(!__pyx_tuple__390)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1766; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__390);
  __Pyx_GIVEREF(__pyx_tuple__390);
  __pyx_codeobj__391 = (PyObject*)__Pyx_PyCode_New(3, 0, 10, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__390, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_backfill_2d_inplace_bool, 1766, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__391)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1766; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/src/generated.pyx":1801
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def is_monotonic_float64(ndarray[float64_t] arr):             # <<<<<<<<<<<<<<
 *     '''
 *     Returns
 */
  __pyx_tuple__392 = PyTuple_Pack(6, __pyx_n_s_arr, __pyx_n_s_i, __pyx_n_s_n, __pyx_n_s_prev, __pyx_n_s_cur, __pyx_n_s_is_unique); if (unlikely(!__pyx_tuple__392)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1801; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__392);
  __Pyx_GIVEREF(__pyx_tuple__392);
  __pyx_codeobj__393 = (PyObject*)__Pyx_PyCode_New(1, 0, 6, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__392, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_is_monotonic_float64, 1801, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__393)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1801; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/src/generated.pyx":1828
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def is_monotonic_float32(ndarray[float32_t] arr):             # <<<<<<<<<<<<<<
 *     '''
 *     Returns
 */
  __pyx_tuple__394 = PyTuple_Pack(6, __pyx_n_s_arr, __pyx_n_s_i, __pyx_n_s_n, __pyx_n_s_prev, __pyx_n_s_cur, __pyx_n_s_is_unique); if (unlikely(!__pyx_tuple__394)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1828; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__394);
  __Pyx_GIVEREF(__pyx_tuple__394);
  __pyx_codeobj__395 = (PyObject*)__Pyx_PyCode_New(1, 0, 6, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__394, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_is_monotonic_float32, 1828, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__395)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1828; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/src/generated.pyx":1855
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def is_monotonic_object(ndarray[object] arr):             # <<<<<<<<<<<<<<
 *     '''
 *     Returns
 */
  __pyx_tuple__396 = PyTuple_Pack(6, __pyx_n_s_arr, __pyx_n_s_i, __pyx_n_s_n, __pyx_n_s_prev, __pyx_n_s_cur, __pyx_n_s_is_unique); if (unlikely(!__pyx_tuple__396)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1855; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__396);
  __Pyx_GIVEREF(__pyx_tuple__396);
  __pyx_codeobj__397 = (PyObject*)__Pyx_PyCode_New(1, 0, 6, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__396, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_is_monotonic_object, 1855, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__397)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1855; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/src/generated.pyx":1882
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def is_monotonic_int32(ndarray[int32_t] arr):             # <<<<<<<<<<<<<<
 *     '''
 *     Returns
 */
  __pyx_tuple__398 = PyTuple_Pack(6, __pyx_n_s_arr, __pyx_n_s_i, __pyx_n_s_n, __pyx_n_s_prev, __pyx_n_s_cur, __pyx_n_s_is_unique); if (unlikely(!__pyx_tuple__398)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1882; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__398);
  __Pyx_GIVEREF(__pyx_tuple__398);
  __pyx_codeobj__399 = (PyObject*)__Pyx_PyCode_New(1, 0, 6, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__398, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_is_monotonic_int32, 1882, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__399)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1882; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/src/generated.pyx":1909
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def is_monotonic_int64(ndarray[int64_t] arr):             # <<<<<<<<<<<<<<
 *     '''
 *     Returns
 */
  __pyx_tuple__400 = PyTuple_Pack(6, __pyx_n_s_arr, __pyx_n_s_i, __pyx_n_s_n, __pyx_n_s_prev, __pyx_n_s_cur, __pyx_n_s_is_unique); if (unlikely(!__pyx_tuple__400)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1909; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__400);
  __Pyx_GIVEREF(__pyx_tuple__400);
  __pyx_codeobj__401 = (PyObject*)__Pyx_PyCode_New(1, 0, 6, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__400, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_is_monotonic_int64, 1909, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__401)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1909; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/src/generated.pyx":1936
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def is_monotonic_bool(ndarray[uint8_t] arr):             # <<<<<<<<<<<<<<
 *     '''
 *     Returns
 */
  __pyx_tuple__402 = PyTuple_Pack(6, __pyx_n_s_arr, __pyx_n_s_i, __pyx_n_s_n, __pyx_n_s_prev, __pyx_n_s_cur, __pyx_n_s_is_unique); if (unlikely(!__pyx_tuple__402)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1936; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__402);
  __Pyx_GIVEREF(__pyx_tuple__402);
  __pyx_codeobj__403 = (PyObject*)__Pyx_PyCode_New(1, 0, 6, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__402, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_is_monotonic_bool, 1936, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__403)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1936; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/src/generated.pyx":1964
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def groupby_float64(ndarray[float64_t] index, ndarray labels):             # <<<<<<<<<<<<<<
 *     cdef dict result = {}
 *     cdef Py_ssize_t i, length
 */
  __pyx_tuple__404 = PyTuple_Pack(8, __pyx_n_s_index, __pyx_n_s_labels, __pyx_n_s_result, __pyx_n_s_i, __pyx_n_s_length, __pyx_n_s_members, __pyx_n_s_idx, __pyx_n_s_key); if (unlikely(!__pyx_tuple__404)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1964; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__404);
  __Pyx_GIVEREF(__pyx_tuple__404);
  __pyx_codeobj__405 = (PyObject*)__Pyx_PyCode_New(2, 0, 8, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__404, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_groupby_float64, 1964, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__405)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1964; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/src/generated.pyx":1992
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def groupby_float32(ndarray[float32_t] index, ndarray labels):             # <<<<<<<<<<<<<<
 *     cdef dict result = {}
 *     cdef Py_ssize_t i, length
 */
  __pyx_tuple__406 = PyTuple_Pack(8, __pyx_n_s_index, __pyx_n_s_labels, __pyx_n_s_result, __pyx_n_s_i, __pyx_n_s_length, __pyx_n_s_members, __pyx_n_s_idx, __pyx_n_s_key); if (unlikely(!__pyx_tuple__406)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1992; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__406);
  __Pyx_GIVEREF(__pyx_tuple__406);
  __pyx_codeobj__407 = (PyObject*)__Pyx_PyCode_New(2, 0, 8, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__406, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_groupby_float32, 1992, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__407)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1992; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/src/generated.pyx":2020
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def groupby_object(ndarray[object] index, ndarray labels):             # <<<<<<<<<<<<<<
 *     cdef dict result = {}
 *     cdef Py_ssize_t i, length
 */
  __pyx_tuple__408 = PyTuple_Pack(8, __pyx_n_s_index, __pyx_n_s_labels, __pyx_n_s_result, __pyx_n_s_i, __pyx_n_s_length, __pyx_n_s_members, __pyx_n_s_idx, __pyx_n_s_key); if (unlikely(!__pyx_tuple__408)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2020; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__408);
  __Pyx_GIVEREF(__pyx_tuple__408);
  __pyx_codeobj__409 = (PyObject*)__Pyx_PyCode_New(2, 0, 8, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__408, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_groupby_object, 2020, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__409)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2020; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/src/generated.pyx":2048
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def groupby_int32(ndarray[int32_t] index, ndarray labels):             # <<<<<<<<<<<<<<
 *     cdef dict result = {}
 *     cdef Py_ssize_t i, length
 */
  __pyx_tuple__410 = PyTuple_Pack(8, __pyx_n_s_index, __pyx_n_s_labels, __pyx_n_s_result, __pyx_n_s_i, __pyx_n_s_length, __pyx_n_s_members, __pyx_n_s_idx, __pyx_n_s_key); if (unlikely(!__pyx_tuple__410)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2048; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__410);
  __Pyx_GIVEREF(__pyx_tuple__410);
  __pyx_codeobj__411 = (PyObject*)__Pyx_PyCode_New(2, 0, 8, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__410, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_groupby_int32, 2048, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__411)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2048; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/src/generated.pyx":2076
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def groupby_int64(ndarray[int64_t] index, ndarray labels):             # <<<<<<<<<<<<<<
 *     cdef dict result = {}
 *     cdef Py_ssize_t i, length
 */
  __pyx_tuple__412 = PyTuple_Pack(8, __pyx_n_s_index, __pyx_n_s_labels, __pyx_n_s_result, __pyx_n_s_i, __pyx_n_s_length, __pyx_n_s_members, __pyx_n_s_idx, __pyx_n_s_key); if (unlikely(!__pyx_tuple__412)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2076; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__412);
  __Pyx_GIVEREF(__pyx_tuple__412);
  __pyx_codeobj__413 = (PyObject*)__Pyx_PyCode_New(2, 0, 8, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__412, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_groupby_int64, 2076, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__413)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2076; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/src/generated.pyx":2104
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def groupby_bool(ndarray[uint8_t] index, ndarray labels):             # <<<<<<<<<<<<<<
 *     cdef dict result = {}
 *     cdef Py_ssize_t i, length
 */
  __pyx_tuple__414 = PyTuple_Pack(8, __pyx_n_s_index, __pyx_n_s_labels, __pyx_n_s_result, __pyx_n_s_i, __pyx_n_s_length, __pyx_n_s_members, __pyx_n_s_idx, __pyx_n_s_key); if (unlikely(!__pyx_tuple__414)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2104; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__414);
  __Pyx_GIVEREF(__pyx_tuple__414);
  __pyx_codeobj__415 = (PyObject*)__Pyx_PyCode_New(2, 0, 8, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__414, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_groupby_bool, 2104, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__415)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2104; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/src/generated.pyx":2133
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def arrmap_float64(ndarray[float64_t] index, object func):             # <<<<<<<<<<<<<<
 *     cdef Py_ssize_t length = index.shape[0]
 *     cdef Py_ssize_t i = 0
 */
  __pyx_tuple__416 = PyTuple_Pack(6, __pyx_n_s_index, __pyx_n_s_func, __pyx_n_s_length, __pyx_n_s_i, __pyx_n_s_result, __pyx_n_s_maybe_convert_objects); if (unlikely(!__pyx_tuple__416)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2133; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__416);
  __Pyx_GIVEREF(__pyx_tuple__416);
  __pyx_codeobj__417 = (PyObject*)__Pyx_PyCode_New(2, 0, 6, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__416, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_arrmap_float64, 2133, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__417)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2133; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/src/generated.pyx":2148
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def arrmap_float32(ndarray[float32_t] index, object func):             # <<<<<<<<<<<<<<
 *     cdef Py_ssize_t length = index.shape[0]
 *     cdef Py_ssize_t i = 0
 */
  __pyx_tuple__418 = PyTuple_Pack(6, __pyx_n_s_index, __pyx_n_s_func, __pyx_n_s_length, __pyx_n_s_i, __pyx_n_s_result, __pyx_n_s_maybe_convert_objects); if (unlikely(!__pyx_tuple__418)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2148; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__418);
  __Pyx_GIVEREF(__pyx_tuple__418);
  __pyx_codeobj__419 = (PyObject*)__Pyx_PyCode_New(2, 0, 6, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__418, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_arrmap_float32, 2148, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__419)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2148; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/src/generated.pyx":2163
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def arrmap_object(ndarray[object] index, object func):             # <<<<<<<<<<<<<<
 *     cdef Py_ssize_t length = index.shape[0]
 *     cdef Py_ssize_t i = 0
 */
  __pyx_tuple__420 = PyTuple_Pack(6, __pyx_n_s_index, __pyx_n_s_func, __pyx_n_s_length, __pyx_n_s_i, __pyx_n_s_result, __pyx_n_s_maybe_convert_objects); if (unlikely(!__pyx_tuple__420)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2163; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__420);
  __Pyx_GIVEREF(__pyx_tuple__420);
  __pyx_codeobj__421 = (PyObject*)__Pyx_PyCode_New(2, 0, 6, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__420, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_arrmap_object, 2163, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__421)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2163; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/src/generated.pyx":2178
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def arrmap_int32(ndarray[int32_t] index, object func):             # <<<<<<<<<<<<<<
 *     cdef Py_ssize_t length = index.shape[0]
 *     cdef Py_ssize_t i = 0
 */
  __pyx_tuple__422 = PyTuple_Pack(6, __pyx_n_s_index, __pyx_n_s_func, __pyx_n_s_length, __pyx_n_s_i, __pyx_n_s_result, __pyx_n_s_maybe_convert_objects); if (unlikely(!__pyx_tuple__422)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2178; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__422);
  __Pyx_GIVEREF(__pyx_tuple__422);
  __pyx_codeobj__423 = (PyObject*)__Pyx_PyCode_New(2, 0, 6, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__422, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_arrmap_int32, 2178, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__423)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2178; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/src/generated.pyx":2193
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def arrmap_int64(ndarray[int64_t] index, object func):             # <<<<<<<<<<<<<<
 *     cdef Py_ssize_t length = index.shape[0]
 *     cdef Py_ssize_t i = 0
 */
  __pyx_tuple__424 = PyTuple_Pack(6, __pyx_n_s_index, __pyx_n_s_func, __pyx_n_s_length, __pyx_n_s_i, __pyx_n_s_result, __pyx_n_s_maybe_convert_objects); if (unlikely(!__pyx_tuple__424)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2193; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__424);
  __Pyx_GIVEREF(__pyx_tuple__424);
  __pyx_codeobj__425 = (PyObject*)__Pyx_PyCode_New(2, 0, 6, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__424, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_arrmap_int64, 2193, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__425)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2193; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/src/generated.pyx":2208
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def arrmap_bool(ndarray[uint8_t] index, object func):             # <<<<<<<<<<<<<<
 *     cdef Py_ssize_t length = index.shape[0]
 *     cdef Py_ssize_t i = 0
 */
  __pyx_tuple__426 = PyTuple_Pack(6, __pyx_n_s_index, __pyx_n_s_func, __pyx_n_s_length, __pyx_n_s_i, __pyx_n_s_result, __pyx_n_s_maybe_convert_objects); if (unlikely(!__pyx_tuple__426)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2208; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__426);
  __Pyx_GIVEREF(__pyx_tuple__426);
  __pyx_codeobj__427 = (PyObject*)__Pyx_PyCode_New(2, 0, 6, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__426, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_arrmap_bool, 2208, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__427)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2208; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/src/generated.pyx":2223
 * 
 * @cython.wraparound(False)
 * def take_1d_bool_bool(ndarray[uint8_t] values,             # <<<<<<<<<<<<<<
 *                               ndarray[int64_t] indexer,
 *                               ndarray[uint8_t] out,
 */
  __pyx_tuple__428 = PyTuple_Pack(8, __pyx_n_s_values, __pyx_n_s_indexer, __pyx_n_s_out, __pyx_n_s_fill_value, __pyx_n_s_i, __pyx_n_s_n, __pyx_n_s_idx, __pyx_n_s_fv); if (unlikely(!__pyx_tuple__428)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2223; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__428);
  __Pyx_GIVEREF(__pyx_tuple__428);
  __pyx_codeobj__429 = (PyObject*)__Pyx_PyCode_New(4, 0, 8, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__428, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_take_1d_bool_bool, 2223, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__429)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2223; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/src/generated.pyx":2242
 * 
 * @cython.wraparound(False)
 * def take_1d_bool_object(ndarray[uint8_t] values,             # <<<<<<<<<<<<<<
 *                               ndarray[int64_t] indexer,
 *                               ndarray[object] out,
 */
  __pyx_tuple__430 = PyTuple_Pack(8, __pyx_n_s_values, __pyx_n_s_indexer, __pyx_n_s_out, __pyx_n_s_fill_value, __pyx_n_s_i, __pyx_n_s_n, __pyx_n_s_idx, __pyx_n_s_fv); if (unlikely(!__pyx_tuple__430)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2242; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__430);
  __Pyx_GIVEREF(__pyx_tuple__430);
  __pyx_codeobj__431 = (PyObject*)__Pyx_PyCode_New(4, 0, 8, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__430, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_take_1d_bool_object, 2242, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__431)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2242; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/src/generated.pyx":2261
 * 
 * @cython.wraparound(False)
 * def take_1d_int8_int8(ndarray[int8_t] values,             # <<<<<<<<<<<<<<
 *                               ndarray[int64_t] indexer,
 *                               ndarray[int8_t] out,
 */
  __pyx_tuple__432 = PyTuple_Pack(8, __pyx_n_s_values, __pyx_n_s_indexer, __pyx_n_s_out, __pyx_n_s_fill_value, __pyx_n_s_i, __pyx_n_s_n, __pyx_n_s_idx, __pyx_n_s_fv); if (unlikely(!__pyx_tuple__432)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2261; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__432);
  __Pyx_GIVEREF(__pyx_tuple__432);
  __pyx_codeobj__433 = (PyObject*)__Pyx_PyCode_New(4, 0, 8, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__432, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_take_1d_int8_int8, 2261, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__433)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2261; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/src/generated.pyx":2280
 * 
 * @cython.wraparound(False)
 * def take_1d_int8_int32(ndarray[int8_t] values,             # <<<<<<<<<<<<<<
 *                               ndarray[int64_t] indexer,
 *                               ndarray[int32_t] out,
 */
  __pyx_tuple__434 = PyTuple_Pack(8, __pyx_n_s_values, __pyx_n_s_indexer, __pyx_n_s_out, __pyx_n_s_fill_value, __pyx_n_s_i, __pyx_n_s_n, __pyx_n_s_idx, __pyx_n_s_fv); if (unlikely(!__pyx_tuple__434)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2280; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__434);
  __Pyx_GIVEREF(__pyx_tuple__434);
  __pyx_codeobj__435 = (PyObject*)__Pyx_PyCode_New(4, 0, 8, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__434, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_take_1d_int8_int32, 2280, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__435)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2280; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/src/generated.pyx":2299
 * 
 * @cython.wraparound(False)
 * def take_1d_int8_int64(ndarray[int8_t] values,             # <<<<<<<<<<<<<<
 *                               ndarray[int64_t] indexer,
 *                               ndarray[int64_t] out,
 */
  __pyx_tuple__436 = PyTuple_Pack(8, __pyx_n_s_values, __pyx_n_s_indexer, __pyx_n_s_out, __pyx_n_s_fill_value, __pyx_n_s_i, __pyx_n_s_n, __pyx_n_s_idx, __pyx_n_s_fv); if (unlikely(!__pyx_tuple__436)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2299; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__436);
  __Pyx_GIVEREF(__pyx_tuple__436);
  __pyx_codeobj__437 = (PyObject*)__Pyx_PyCode_New(4, 0, 8, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__436, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_take_1d_int8_int64, 2299, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__437)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2299; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/src/generated.pyx":2318
 * 
 * @cython.wraparound(False)
 * def take_1d_int8_float64(ndarray[int8_t] values,             # <<<<<<<<<<<<<<
 *                               ndarray[int64_t] indexer,
 *                               ndarray[float64_t] out,
 */
  __pyx_tuple__438 = PyTuple_Pack(8, __pyx_n_s_values, __pyx_n_s_indexer, __pyx_n_s_out, __pyx_n_s_fill_value, __pyx_n_s_i, __pyx_n_s_n, __pyx_n_s_idx, __pyx_n_s_fv); if (unlikely(!__pyx_tuple__438)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2318; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__438);
  __Pyx_GIVEREF(__pyx_tuple__438);
  __pyx_codeobj__439 = (PyObject*)__Pyx_PyCode_New(4, 0, 8, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__438, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_take_1d_int8_float64, 2318, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__439)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2318; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/src/generated.pyx":2337
 * 
 * @cython.wraparound(False)
 * def take_1d_int16_int16(ndarray[int16_t] values,             # <<<<<<<<<<<<<<
 *                               ndarray[int64_t] indexer,
 *                               ndarray[int16_t] out,
 */
  __pyx_tuple__440 = PyTuple_Pack(8, __pyx_n_s_values, __pyx_n_s_indexer, __pyx_n_s_out, __pyx_n_s_fill_value, __pyx_n_s_i, __pyx_n_s_n, __pyx_n_s_idx, __pyx_n_s_fv); if (unlikely(!__pyx_tuple__440)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2337; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__440);
  __Pyx_GIVEREF(__pyx_tuple__440);
  __pyx_codeobj__441 = (PyObject*)__Pyx_PyCode_New(4, 0, 8, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__440, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_take_1d_int16_int16, 2337, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__441)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2337; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/src/generated.pyx":2356
 * 
 * @cython.wraparound(False)
 * def take_1d_int16_int32(ndarray[int16_t] values,             # <<<<<<<<<<<<<<
 *                               ndarray[int64_t] indexer,
 *                               ndarray[int32_t] out,
 */
  __pyx_tuple__442 = PyTuple_Pack(8, __pyx_n_s_values, __pyx_n_s_indexer, __pyx_n_s_out, __pyx_n_s_fill_value, __pyx_n_s_i, __pyx_n_s_n, __pyx_n_s_idx, __pyx_n_s_fv); if (unlikely(!__pyx_tuple__442)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2356; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__442);
  __Pyx_GIVEREF(__pyx_tuple__442);
  __pyx_codeobj__443 = (PyObject*)__Pyx_PyCode_New(4, 0, 8, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__442, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_take_1d_int16_int32, 2356, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__443)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2356; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/src/generated.pyx":2375
 * 
 * @cython.wraparound(False)
 * def take_1d_int16_int64(ndarray[int16_t] values,             # <<<<<<<<<<<<<<
 *                               ndarray[int64_t] indexer,
 *                               ndarray[int64_t] out,
 */
  __pyx_tuple__444 = PyTuple_Pack(8, __pyx_n_s_values, __pyx_n_s_indexer, __pyx_n_s_out, __pyx_n_s_fill_value, __pyx_n_s_i, __pyx_n_s_n, __pyx_n_s_idx, __pyx_n_s_fv); if (unlikely(!__pyx_tuple__444)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2375; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__444);
  __Pyx_GIVEREF(__pyx_tuple__444);
  __pyx_codeobj__445 = (PyObject*)__Pyx_PyCode_New(4, 0, 8, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__444, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_take_1d_int16_int64, 2375, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__445)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2375; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/src/generated.pyx":2394
 * 
 * @cython.wraparound(False)
 * def take_1d_int16_float64(ndarray[int16_t] values,             # <<<<<<<<<<<<<<
 *                               ndarray[int64_t] indexer,
 *                               ndarray[float64_t] out,
 */
  __pyx_tuple__446 = PyTuple_Pack(8, __pyx_n_s_values, __pyx_n_s_indexer, __pyx_n_s_out, __pyx_n_s_fill_value, __pyx_n_s_i, __pyx_n_s_n, __pyx_n_s_idx, __pyx_n_s_fv); if (unlikely(!__pyx_tuple__446)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2394; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__446);
  __Pyx_GIVEREF(__pyx_tuple__446);
  __pyx_codeobj__447 = (PyObject*)__Pyx_PyCode_New(4, 0, 8, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__446, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_take_1d_int16_float64, 2394, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__447)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2394; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/src/generated.pyx":2413
 * 
 * @cython.wraparound(False)
 * def take_1d_int32_int32(ndarray[int32_t] values,             # <<<<<<<<<<<<<<
 *                               ndarray[int64_t] indexer,
 *                               ndarray[int32_t] out,
 */
  __pyx_tuple__448 = PyTuple_Pack(8, __pyx_n_s_values, __pyx_n_s_indexer, __pyx_n_s_out, __pyx_n_s_fill_value, __pyx_n_s_i, __pyx_n_s_n, __pyx_n_s_idx, __pyx_n_s_fv); if (unlikely(!__pyx_tuple__448)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2413; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__448);
  __Pyx_GIVEREF(__pyx_tuple__448);
  __pyx_codeobj__449 = (PyObject*)__Pyx_PyCode_New(4, 0, 8, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__448, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_take_1d_int32_int32, 2413, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__449)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2413; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/src/generated.pyx":2432
 * 
 * @cython.wraparound(False)
 * def take_1d_int32_int64(ndarray[int32_t] values,             # <<<<<<<<<<<<<<
 *                               ndarray[int64_t] indexer,
 *                               ndarray[int64_t] out,
 */
  __pyx_tuple__450 = PyTuple_Pack(8, __pyx_n_s_values, __pyx_n_s_indexer, __pyx_n_s_out, __pyx_n_s_fill_value, __pyx_n_s_i, __pyx_n_s_n, __pyx_n_s_idx, __pyx_n_s_fv); if (unlikely(!__pyx_tuple__450)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2432; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__450);
  __Pyx_GIVEREF(__pyx_tuple__450);
  __pyx_codeobj__451 = (PyObject*)__Pyx_PyCode_New(4, 0, 8, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__450, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_take_1d_int32_int64, 2432, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__451)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2432; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/src/generated.pyx":2451
 * 
 * @cython.wraparound(False)
 * def take_1d_int32_float64(ndarray[int32_t] values,             # <<<<<<<<<<<<<<
 *                               ndarray[int64_t] indexer,
 *                               ndarray[float64_t] out,
 */
  __pyx_tuple__452 = PyTuple_Pack(8, __pyx_n_s_values, __pyx_n_s_indexer, __pyx_n_s_out, __pyx_n_s_fill_value, __pyx_n_s_i, __pyx_n_s_n, __pyx_n_s_idx, __pyx_n_s_fv); if (unlikely(!__pyx_tuple__452)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2451; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__452);
  __Pyx_GIVEREF(__pyx_tuple__452);
  __pyx_codeobj__453 = (PyObject*)__Pyx_PyCode_New(4, 0, 8, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__452, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_take_1d_int32_float64, 2451, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__453)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2451; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/src/generated.pyx":2470
 * 
 * @cython.wraparound(False)
 * def take_1d_int64_int64(ndarray[int64_t] values,             # <<<<<<<<<<<<<<
 *                               ndarray[int64_t] indexer,
 *                               ndarray[int64_t] out,
 */
  __pyx_tuple__454 = PyTuple_Pack(8, __pyx_n_s_values, __pyx_n_s_indexer, __pyx_n_s_out, __pyx_n_s_fill_value, __pyx_n_s_i, __pyx_n_s_n, __pyx_n_s_idx, __pyx_n_s_fv); if (unlikely(!__pyx_tuple__454)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2470; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__454);
  __Pyx_GIVEREF(__pyx_tuple__454);
  __pyx_codeobj__455 = (PyObject*)__Pyx_PyCode_New(4, 0, 8, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__454, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_take_1d_int64_int64, 2470, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__455)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2470; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/src/generated.pyx":2489
 * 
 * @cython.wraparound(False)
 * def take_1d_int64_float64(ndarray[int64_t] values,             # <<<<<<<<<<<<<<
 *                               ndarray[int64_t] indexer,
 *                               ndarray[float64_t] out,
 */
  __pyx_tuple__456 = PyTuple_Pack(8, __pyx_n_s_values, __pyx_n_s_indexer, __pyx_n_s_out, __pyx_n_s_fill_value, __pyx_n_s_i, __pyx_n_s_n, __pyx_n_s_idx, __pyx_n_s_fv); if (unlikely(!__pyx_tuple__456)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2489; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__456);
  __Pyx_GIVEREF(__pyx_tuple__456);
  __pyx_codeobj__457 = (PyObject*)__Pyx_PyCode_New(4, 0, 8, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__456, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_take_1d_int64_float64, 2489, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__457)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2489; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/src/generated.pyx":2508
 * 
 * @cython.wraparound(False)
 * def take_1d_float32_float32(ndarray[float32_t] values,             # <<<<<<<<<<<<<<
 *                               ndarray[int64_t] indexer,
 *                               ndarray[float32_t] out,
 */
  __pyx_tuple__458 = PyTuple_Pack(8, __pyx_n_s_values, __pyx_n_s_indexer, __pyx_n_s_out, __pyx_n_s_fill_value, __pyx_n_s_i, __pyx_n_s_n, __pyx_n_s_idx, __pyx_n_s_fv); if (unlikely(!__pyx_tuple__458)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2508; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__458);
  __Pyx_GIVEREF(__pyx_tuple__458);
  __pyx_codeobj__459 = (PyObject*)__Pyx_PyCode_New(4, 0, 8, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__458, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_take_1d_float32_float32, 2508, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__459)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2508; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/src/generated.pyx":2527
 * 
 * @cython.wraparound(False)
 * def take_1d_float32_float64(ndarray[float32_t] values,             # <<<<<<<<<<<<<<
 *                               ndarray[int64_t] indexer,
 *                               ndarray[float64_t] out,
 */
  __pyx_tuple__460 = PyTuple_Pack(8, __pyx_n_s_values, __pyx_n_s_indexer, __pyx_n_s_out, __pyx_n_s_fill_value, __pyx_n_s_i, __pyx_n_s_n, __pyx_n_s_idx, __pyx_n_s_fv); if (unlikely(!__pyx_tuple__460)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2527; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__460);
  __Pyx_GIVEREF(__pyx_tuple__460);
  __pyx_codeobj__461 = (PyObject*)__Pyx_PyCode_New(4, 0, 8, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__460, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_take_1d_float32_float64, 2527, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__461)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2527; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/src/generated.pyx":2546
 * 
 * @cython.wraparound(False)
 * def take_1d_float64_float64(ndarray[float64_t] values,             # <<<<<<<<<<<<<<
 *                               ndarray[int64_t] indexer,
 *                               ndarray[float64_t] out,
 */
  __pyx_tuple__462 = PyTuple_Pack(8, __pyx_n_s_values, __pyx_n_s_indexer, __pyx_n_s_out, __pyx_n_s_fill_value, __pyx_n_s_i, __pyx_n_s_n, __pyx_n_s_idx, __pyx_n_s_fv); if (unlikely(!__pyx_tuple__462)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2546; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__462);
  __Pyx_GIVEREF(__pyx_tuple__462);
  __pyx_codeobj__463 = (PyObject*)__Pyx_PyCode_New(4, 0, 8, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__462, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_take_1d_float64_float64, 2546, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__463)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2546; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/src/generated.pyx":2565
 * 
 * @cython.wraparound(False)
 * def take_1d_object_object(ndarray[object] values,             # <<<<<<<<<<<<<<
 *                               ndarray[int64_t] indexer,
 *                               ndarray[object] out,
 */
  __pyx_tuple__464 = PyTuple_Pack(8, __pyx_n_s_values, __pyx_n_s_indexer, __pyx_n_s_out, __pyx_n_s_fill_value, __pyx_n_s_i, __pyx_n_s_n, __pyx_n_s_idx, __pyx_n_s_fv); if (unlikely(!__pyx_tuple__464)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2565; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__464);
  __Pyx_GIVEREF(__pyx_tuple__464);
  __pyx_codeobj__465 = (PyObject*)__Pyx_PyCode_New(4, 0, 8, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__464, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_take_1d_object_object, 2565, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__465)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2565; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/src/generated.pyx":2586
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def take_2d_axis0_bool_bool(uint8_t[:, :] values,             # <<<<<<<<<<<<<<
 *                                     ndarray[int64_t] indexer,
 *                                     uint8_t[:, :] out,
 */
  __pyx_tuple__466 = PyTuple_Pack(12, __pyx_n_s_values, __pyx_n_s_indexer, __pyx_n_s_out, __pyx_n_s_fill_value, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_k, __pyx_n_s_n, __pyx_n_s_idx, __pyx_n_s_fv, __pyx_n_s_v, __pyx_n_s_o); if (unlikely(!__pyx_tuple__466)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2586; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__466);
  __Pyx_GIVEREF(__pyx_tuple__466);
  __pyx_codeobj__467 = (PyObject*)__Pyx_PyCode_New(4, 0, 12, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__466, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_take_2d_axis0_bool_bool, 2586, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__467)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2586; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/src/generated.pyx":2631
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def take_2d_axis0_bool_object(uint8_t[:, :] values,             # <<<<<<<<<<<<<<
 *                                     ndarray[int64_t] indexer,
 *                                     object[:, :] out,
 */
  __pyx_tuple__468 = PyTuple_Pack(10, __pyx_n_s_values, __pyx_n_s_indexer, __pyx_n_s_out, __pyx_n_s_fill_value, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_k, __pyx_n_s_n, __pyx_n_s_idx, __pyx_n_s_fv); if (unlikely(!__pyx_tuple__468)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2631; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__468);
  __Pyx_GIVEREF(__pyx_tuple__468);
  __pyx_codeobj__469 = (PyObject*)__Pyx_PyCode_New(4, 0, 10, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__468, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_take_2d_axis0_bool_object, 2631, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__469)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2631; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/src/generated.pyx":2676
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def take_2d_axis0_int8_int8(int8_t[:, :] values,             # <<<<<<<<<<<<<<
 *                                     ndarray[int64_t] indexer,
 *                                     int8_t[:, :] out,
 */
  __pyx_tuple__470 = PyTuple_Pack(12, __pyx_n_s_values, __pyx_n_s_indexer, __pyx_n_s_out, __pyx_n_s_fill_value, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_k, __pyx_n_s_n, __pyx_n_s_idx, __pyx_n_s_fv, __pyx_n_s_v, __pyx_n_s_o); if (unlikely(!__pyx_tuple__470)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2676; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__470);
  __Pyx_GIVEREF(__pyx_tuple__470);
  __pyx_codeobj__471 = (PyObject*)__Pyx_PyCode_New(4, 0, 12, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__470, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_take_2d_axis0_int8_int8, 2676, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__471)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2676; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/src/generated.pyx":2721
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def take_2d_axis0_int8_int32(int8_t[:, :] values,             # <<<<<<<<<<<<<<
 *                                     ndarray[int64_t] indexer,
 *                                     int32_t[:, :] out,
 */
  __pyx_tuple__472 = PyTuple_Pack(10, __pyx_n_s_values, __pyx_n_s_indexer, __pyx_n_s_out, __pyx_n_s_fill_value, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_k, __pyx_n_s_n, __pyx_n_s_idx, __pyx_n_s_fv); if (unlikely(!__pyx_tuple__472)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2721; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__472);
  __Pyx_GIVEREF(__pyx_tuple__472);
  __pyx_codeobj__473 = (PyObject*)__Pyx_PyCode_New(4, 0, 10, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__472, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_take_2d_axis0_int8_int32, 2721, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__473)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2721; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/src/generated.pyx":2766
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def take_2d_axis0_int8_int64(int8_t[:, :] values,             # <<<<<<<<<<<<<<
 *                                     ndarray[int64_t] indexer,
 *                                     int64_t[:, :] out,
 */
  __pyx_tuple__474 = PyTuple_Pack(10, __pyx_n_s_values, __pyx_n_s_indexer, __pyx_n_s_out, __pyx_n_s_fill_value, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_k, __pyx_n_s_n, __pyx_n_s_idx, __pyx_n_s_fv); if (unlikely(!__pyx_tuple__474)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2766; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__474);
  __Pyx_GIVEREF(__pyx_tuple__474);
  __pyx_codeobj__475 = (PyObject*)__Pyx_PyCode_New(4, 0, 10, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__474, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_take_2d_axis0_int8_int64, 2766, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__475)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2766; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/src/generated.pyx":2811
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def take_2d_axis0_int8_float64(int8_t[:, :] values,             # <<<<<<<<<<<<<<
 *                                     ndarray[int64_t] indexer,
 *                                     float64_t[:, :] out,
 */
  __pyx_tuple__476 = PyTuple_Pack(10, __pyx_n_s_values, __pyx_n_s_indexer, __pyx_n_s_out, __pyx_n_s_fill_value, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_k, __pyx_n_s_n, __pyx_n_s_idx, __pyx_n_s_fv); if (unlikely(!__pyx_tuple__476)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2811; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__476);
  __Pyx_GIVEREF(__pyx_tuple__476);
  __pyx_codeobj__477 = (PyObject*)__Pyx_PyCode_New(4, 0, 10, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__476, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_take_2d_axis0_int8_float64, 2811, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__477)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2811; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/src/generated.pyx":2856
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def take_2d_axis0_int16_int16(int16_t[:, :] values,             # <<<<<<<<<<<<<<
 *                                     ndarray[int64_t] indexer,
 *                                     int16_t[:, :] out,
 */
  __pyx_tuple__478 = PyTuple_Pack(12, __pyx_n_s_values, __pyx_n_s_indexer, __pyx_n_s_out, __pyx_n_s_fill_value, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_k, __pyx_n_s_n, __pyx_n_s_idx, __pyx_n_s_fv, __pyx_n_s_v, __pyx_n_s_o); if (unlikely(!__pyx_tuple__478)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2856; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__478);
  __Pyx_GIVEREF(__pyx_tuple__478);
  __pyx_codeobj__479 = (PyObject*)__Pyx_PyCode_New(4, 0, 12, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__478, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_take_2d_axis0_int16_int16, 2856, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__479)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2856; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/src/generated.pyx":2901
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def take_2d_axis0_int16_int32(int16_t[:, :] values,             # <<<<<<<<<<<<<<
 *                                     ndarray[int64_t] indexer,
 *                                     int32_t[:, :] out,
 */
  __pyx_tuple__480 = PyTuple_Pack(10, __pyx_n_s_values, __pyx_n_s_indexer, __pyx_n_s_out, __pyx_n_s_fill_value, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_k, __pyx_n_s_n, __pyx_n_s_idx, __pyx_n_s_fv); if (unlikely(!__pyx_tuple__480)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2901; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__480);
  __Pyx_GIVEREF(__pyx_tuple__480);
  __pyx_codeobj__481 = (PyObject*)__Pyx_PyCode_New(4, 0, 10, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__480, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_take_2d_axis0_int16_int32, 2901, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__481)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2901; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/src/generated.pyx":2946
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def take_2d_axis0_int16_int64(int16_t[:, :] values,             # <<<<<<<<<<<<<<
 *                                     ndarray[int64_t] indexer,
 *                                     int64_t[:, :] out,
 */
  __pyx_tuple__482 = PyTuple_Pack(10, __pyx_n_s_values, __pyx_n_s_indexer, __pyx_n_s_out, __pyx_n_s_fill_value, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_k, __pyx_n_s_n, __pyx_n_s_idx, __pyx_n_s_fv); if (unlikely(!__pyx_tuple__482)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2946; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__482);
  __Pyx_GIVEREF(__pyx_tuple__482);
  __pyx_codeobj__483 = (PyObject*)__Pyx_PyCode_New(4, 0, 10, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__482, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_take_2d_axis0_int16_int64, 2946, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__483)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2946; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/src/generated.pyx":2991
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def take_2d_axis0_int16_float64(int16_t[:, :] values,             # <<<<<<<<<<<<<<
 *                                     ndarray[int64_t] indexer,
 *                                     float64_t[:, :] out,
 */
  __pyx_tuple__484 = PyTuple_Pack(10, __pyx_n_s_values, __pyx_n_s_indexer, __pyx_n_s_out, __pyx_n_s_fill_value, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_k, __pyx_n_s_n, __pyx_n_s_idx, __pyx_n_s_fv); if (unlikely(!__pyx_tuple__484)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2991; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__484);
  __Pyx_GIVEREF(__pyx_tuple__484);
  __pyx_codeobj__485 = (PyObject*)__Pyx_PyCode_New(4, 0, 10, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__484, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_take_2d_axis0_int16_float64, 2991, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__485)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2991; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/src/generated.pyx":3036
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def take_2d_axis0_int32_int32(int32_t[:, :] values,             # <<<<<<<<<<<<<<
 *                                     ndarray[int64_t] indexer,
 *                                     int32_t[:, :] out,
 */
  __pyx_tuple__486 = PyTuple_Pack(12, __pyx_n_s_values, __pyx_n_s_indexer, __pyx_n_s_out, __pyx_n_s_fill_value, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_k, __pyx_n_s_n, __pyx_n_s_idx, __pyx_n_s_fv, __pyx_n_s_v, __pyx_n_s_o); if (unlikely(!__pyx_tuple__486)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3036; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__486);
  __Pyx_GIVEREF(__pyx_tuple__486);
  __pyx_codeobj__487 = (PyObject*)__Pyx_PyCode_New(4, 0, 12, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__486, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_take_2d_axis0_int32_int32, 3036, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__487)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3036; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/src/generated.pyx":3081
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def take_2d_axis0_int32_int64(int32_t[:, :] values,             # <<<<<<<<<<<<<<
 *                                     ndarray[int64_t] indexer,
 *                                     int64_t[:, :] out,
 */
  __pyx_tuple__488 = PyTuple_Pack(10, __pyx_n_s_values, __pyx_n_s_indexer, __pyx_n_s_out, __pyx_n_s_fill_value, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_k, __pyx_n_s_n, __pyx_n_s_idx, __pyx_n_s_fv); if (unlikely(!__pyx_tuple__488)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3081; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__488);
  __Pyx_GIVEREF(__pyx_tuple__488);
  __pyx_codeobj__489 = (PyObject*)__Pyx_PyCode_New(4, 0, 10, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__488, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_take_2d_axis0_int32_int64, 3081, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__489)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3081; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/src/generated.pyx":3126
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def take_2d_axis0_int32_float64(int32_t[:, :] values,             # <<<<<<<<<<<<<<
 *                                     ndarray[int64_t] indexer,
 *                                     float64_t[:, :] out,
 */
  __pyx_tuple__490 = PyTuple_Pack(10, __pyx_n_s_values, __pyx_n_s_indexer, __pyx_n_s_out, __pyx_n_s_fill_value, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_k, __pyx_n_s_n, __pyx_n_s_idx, __pyx_n_s_fv); if (unlikely(!__pyx_tuple__490)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3126; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__490);
  __Pyx_GIVEREF(__pyx_tuple__490);
  __pyx_codeobj__491 = (PyObject*)__Pyx_PyCode_New(4, 0, 10, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__490, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_take_2d_axis0_int32_float64, 3126, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__491)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3126; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/src/generated.pyx":3171
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def take_2d_axis0_int64_int64(int64_t[:, :] values,             # <<<<<<<<<<<<<<
 *                                     ndarray[int64_t] indexer,
 *                                     int64_t[:, :] out,
 */
  __pyx_tuple__492 = PyTuple_Pack(12, __pyx_n_s_values, __pyx_n_s_indexer, __pyx_n_s_out, __pyx_n_s_fill_value, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_k, __pyx_n_s_n, __pyx_n_s_idx, __pyx_n_s_fv, __pyx_n_s_v, __pyx_n_s_o); if (unlikely(!__pyx_tuple__492)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3171; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__492);
  __Pyx_GIVEREF(__pyx_tuple__492);
  __pyx_codeobj__493 = (PyObject*)__Pyx_PyCode_New(4, 0, 12, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__492, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_take_2d_axis0_int64_int64, 3171, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__493)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3171; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/src/generated.pyx":3216
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def take_2d_axis0_int64_float64(int64_t[:, :] values,             # <<<<<<<<<<<<<<
 *                                     ndarray[int64_t] indexer,
 *                                     float64_t[:, :] out,
 */
  __pyx_tuple__494 = PyTuple_Pack(10, __pyx_n_s_values, __pyx_n_s_indexer, __pyx_n_s_out, __pyx_n_s_fill_value, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_k, __pyx_n_s_n, __pyx_n_s_idx, __pyx_n_s_fv); if (unlikely(!__pyx_tuple__494)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3216; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__494);
  __Pyx_GIVEREF(__pyx_tuple__494);
  __pyx_codeobj__495 = (PyObject*)__Pyx_PyCode_New(4, 0, 10, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__494, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_take_2d_axis0_int64_float64, 3216, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__495)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3216; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/src/generated.pyx":3261
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def take_2d_axis0_float32_float32(float32_t[:, :] values,             # <<<<<<<<<<<<<<
 *                                     ndarray[int64_t] indexer,
 *                                     float32_t[:, :] out,
 */
  __pyx_tuple__496 = PyTuple_Pack(12, __pyx_n_s_values, __pyx_n_s_indexer, __pyx_n_s_out, __pyx_n_s_fill_value, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_k, __pyx_n_s_n, __pyx_n_s_idx, __pyx_n_s_fv, __pyx_n_s_v, __pyx_n_s_o); if (unlikely(!__pyx_tuple__496)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3261; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__496);
  __Pyx_GIVEREF(__pyx_tuple__496);
  __pyx_codeobj__497 = (PyObject*)__Pyx_PyCode_New(4, 0, 12, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__496, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_take_2d_axis0_float32_float32, 3261, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__497)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3261; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/src/generated.pyx":3306
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def take_2d_axis0_float32_float64(float32_t[:, :] values,             # <<<<<<<<<<<<<<
 *                                     ndarray[int64_t] indexer,
 *                                     float64_t[:, :] out,
 */
  __pyx_tuple__498 = PyTuple_Pack(10, __pyx_n_s_values, __pyx_n_s_indexer, __pyx_n_s_out, __pyx_n_s_fill_value, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_k, __pyx_n_s_n, __pyx_n_s_idx, __pyx_n_s_fv); if (unlikely(!__pyx_tuple__498)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3306; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__498);
  __Pyx_GIVEREF(__pyx_tuple__498);
  __pyx_codeobj__499 = (PyObject*)__Pyx_PyCode_New(4, 0, 10, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__498, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_take_2d_axis0_float32_float64, 3306, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__499)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3306; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/src/generated.pyx":3351
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def take_2d_axis0_float64_float64(float64_t[:, :] values,             # <<<<<<<<<<<<<<
 *                                     ndarray[int64_t] indexer,
 *                                     float64_t[:, :] out,
 */
  __pyx_tuple__500 = PyTuple_Pack(12, __pyx_n_s_values, __pyx_n_s_indexer, __pyx_n_s_out, __pyx_n_s_fill_value, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_k, __pyx_n_s_n, __pyx_n_s_idx, __pyx_n_s_fv, __pyx_n_s_v, __pyx_n_s_o); if (unlikely(!__pyx_tuple__500)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3351; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__500);
  __Pyx_GIVEREF(__pyx_tuple__500);
  __pyx_codeobj__501 = (PyObject*)__Pyx_PyCode_New(4, 0, 12, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__500, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_take_2d_axis0_float64_float64, 3351, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__501)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3351; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/src/generated.pyx":3396
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def take_2d_axis0_object_object(object[:, :] values,             # <<<<<<<<<<<<<<
 *                                     ndarray[int64_t] indexer,
 *                                     object[:, :] out,
 */
  __pyx_tuple__502 = PyTuple_Pack(10, __pyx_n_s_values, __pyx_n_s_indexer, __pyx_n_s_out, __pyx_n_s_fill_value, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_k, __pyx_n_s_n, __pyx_n_s_idx, __pyx_n_s_fv); if (unlikely(!__pyx_tuple__502)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3396; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__502);
  __Pyx_GIVEREF(__pyx_tuple__502);
  __pyx_codeobj__503 = (PyObject*)__Pyx_PyCode_New(4, 0, 10, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__502, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_take_2d_axis0_object_object, 3396, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__503)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3396; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/src/generated.pyx":3442
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def take_2d_axis1_bool_bool(uint8_t[:, :] values,             # <<<<<<<<<<<<<<
 *                                     ndarray[int64_t] indexer,
 *                                     uint8_t[:, :] out,
 */
  __pyx_tuple__504 = PyTuple_Pack(10, __pyx_n_s_values, __pyx_n_s_indexer, __pyx_n_s_out, __pyx_n_s_fill_value, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_k, __pyx_n_s_n, __pyx_n_s_idx, __pyx_n_s_fv); if (unlikely(!__pyx_tuple__504)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3442; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__504);
  __Pyx_GIVEREF(__pyx_tuple__504);
  __pyx_codeobj__505 = (PyObject*)__Pyx_PyCode_New(4, 0, 10, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__504, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_take_2d_axis1_bool_bool, 3442, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__505)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3442; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/src/generated.pyx":3468
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def take_2d_axis1_bool_object(uint8_t[:, :] values,             # <<<<<<<<<<<<<<
 *                                     ndarray[int64_t] indexer,
 *                                     object[:, :] out,
 */
  __pyx_tuple__506 = PyTuple_Pack(10, __pyx_n_s_values, __pyx_n_s_indexer, __pyx_n_s_out, __pyx_n_s_fill_value, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_k, __pyx_n_s_n, __pyx_n_s_idx, __pyx_n_s_fv); if (unlikely(!__pyx_tuple__506)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3468; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__506);
  __Pyx_GIVEREF(__pyx_tuple__506);
  __pyx_codeobj__507 = (PyObject*)__Pyx_PyCode_New(4, 0, 10, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__506, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_take_2d_axis1_bool_object, 3468, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__507)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3468; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/src/generated.pyx":3494
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def take_2d_axis1_int8_int8(int8_t[:, :] values,             # <<<<<<<<<<<<<<
 *                                     ndarray[int64_t] indexer,
 *                                     int8_t[:, :] out,
 */
  __pyx_tuple__508 = PyTuple_Pack(10, __pyx_n_s_values, __pyx_n_s_indexer, __pyx_n_s_out, __pyx_n_s_fill_value, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_k, __pyx_n_s_n, __pyx_n_s_idx, __pyx_n_s_fv); if (unlikely(!__pyx_tuple__508)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3494; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__508);
  __Pyx_GIVEREF(__pyx_tuple__508);
  __pyx_codeobj__509 = (PyObject*)__Pyx_PyCode_New(4, 0, 10, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__508, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_take_2d_axis1_int8_int8, 3494, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__509)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3494; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/src/generated.pyx":3520
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def take_2d_axis1_int8_int32(int8_t[:, :] values,             # <<<<<<<<<<<<<<
 *                                     ndarray[int64_t] indexer,
 *                                     int32_t[:, :] out,
 */
  __pyx_tuple__510 = PyTuple_Pack(10, __pyx_n_s_values, __pyx_n_s_indexer, __pyx_n_s_out, __pyx_n_s_fill_value, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_k, __pyx_n_s_n, __pyx_n_s_idx, __pyx_n_s_fv); if (unlikely(!__pyx_tuple__510)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3520; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__510);
  __Pyx_GIVEREF(__pyx_tuple__510);
  __pyx_codeobj__511 = (PyObject*)__Pyx_PyCode_New(4, 0, 10, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__510, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_take_2d_axis1_int8_int32, 3520, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__511)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3520; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/src/generated.pyx":3546
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def take_2d_axis1_int8_int64(int8_t[:, :] values,             # <<<<<<<<<<<<<<
 *                                     ndarray[int64_t] indexer,
 *                                     int64_t[:, :] out,
 */
  __pyx_tuple__512 = PyTuple_Pack(10, __pyx_n_s_values, __pyx_n_s_indexer, __pyx_n_s_out, __pyx_n_s_fill_value, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_k, __pyx_n_s_n, __pyx_n_s_idx, __pyx_n_s_fv); if (unlikely(!__pyx_tuple__512)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3546; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__512);
  __Pyx_GIVEREF(__pyx_tuple__512);
  __pyx_codeobj__513 = (PyObject*)__Pyx_PyCode_New(4, 0, 10, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__512, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_take_2d_axis1_int8_int64, 3546, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__513)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3546; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/src/generated.pyx":3572
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def take_2d_axis1_int8_float64(int8_t[:, :] values,             # <<<<<<<<<<<<<<
 *                                     ndarray[int64_t] indexer,
 *                                     float64_t[:, :] out,
 */
  __pyx_tuple__514 = PyTuple_Pack(10, __pyx_n_s_values, __pyx_n_s_indexer, __pyx_n_s_out, __pyx_n_s_fill_value, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_k, __pyx_n_s_n, __pyx_n_s_idx, __pyx_n_s_fv); if (unlikely(!__pyx_tuple__514)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3572; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__514);
  __Pyx_GIVEREF(__pyx_tuple__514);
  __pyx_codeobj__515 = (PyObject*)__Pyx_PyCode_New(4, 0, 10, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__514, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_take_2d_axis1_int8_float64, 3572, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__515)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3572; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/src/generated.pyx":3598
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def take_2d_axis1_int16_int16(int16_t[:, :] values,             # <<<<<<<<<<<<<<
 *                                     ndarray[int64_t] indexer,
 *                                     int16_t[:, :] out,
 */
  __pyx_tuple__516 = PyTuple_Pack(10, __pyx_n_s_values, __pyx_n_s_indexer, __pyx_n_s_out, __pyx_n_s_fill_value, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_k, __pyx_n_s_n, __pyx_n_s_idx, __pyx_n_s_fv); if (unlikely(!__pyx_tuple__516)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3598; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__516);
  __Pyx_GIVEREF(__pyx_tuple__516);
  __pyx_codeobj__517 = (PyObject*)__Pyx_PyCode_New(4, 0, 10, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__516, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_take_2d_axis1_int16_int16, 3598, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__517)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3598; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/src/generated.pyx":3624
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def take_2d_axis1_int16_int32(int16_t[:, :] values,             # <<<<<<<<<<<<<<
 *                                     ndarray[int64_t] indexer,
 *                                     int32_t[:, :] out,
 */
  __pyx_tuple__518 = PyTuple_Pack(10, __pyx_n_s_values, __pyx_n_s_indexer, __pyx_n_s_out, __pyx_n_s_fill_value, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_k, __pyx_n_s_n, __pyx_n_s_idx, __pyx_n_s_fv); if (unlikely(!__pyx_tuple__518)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3624; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__518);
  __Pyx_GIVEREF(__pyx_tuple__518);
  __pyx_codeobj__519 = (PyObject*)__Pyx_PyCode_New(4, 0, 10, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__518, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_take_2d_axis1_int16_int32, 3624, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__519)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3624; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/src/generated.pyx":3650
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def take_2d_axis1_int16_int64(int16_t[:, :] values,             # <<<<<<<<<<<<<<
 *                                     ndarray[int64_t] indexer,
 *                                     int64_t[:, :] out,
 */
  __pyx_tuple__520 = PyTuple_Pack(10, __pyx_n_s_values, __pyx_n_s_indexer, __pyx_n_s_out, __pyx_n_s_fill_value, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_k, __pyx_n_s_n, __pyx_n_s_idx, __pyx_n_s_fv); if (unlikely(!__pyx_tuple__520)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3650; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__520);
  __Pyx_GIVEREF(__pyx_tuple__520);
  __pyx_codeobj__521 = (PyObject*)__Pyx_PyCode_New(4, 0, 10, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__520, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_take_2d_axis1_int16_int64, 3650, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__521)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3650; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/src/generated.pyx":3676
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def take_2d_axis1_int16_float64(int16_t[:, :] values,             # <<<<<<<<<<<<<<
 *                                     ndarray[int64_t] indexer,
 *                                     float64_t[:, :] out,
 */
  __pyx_tuple__522 = PyTuple_Pack(10, __pyx_n_s_values, __pyx_n_s_indexer, __pyx_n_s_out, __pyx_n_s_fill_value, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_k, __pyx_n_s_n, __pyx_n_s_idx, __pyx_n_s_fv); if (unlikely(!__pyx_tuple__522)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3676; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__522);
  __Pyx_GIVEREF(__pyx_tuple__522);
  __pyx_codeobj__523 = (PyObject*)__Pyx_PyCode_New(4, 0, 10, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__522, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_take_2d_axis1_int16_float64, 3676, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__523)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3676; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/src/generated.pyx":3702
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def take_2d_axis1_int32_int32(int32_t[:, :] values,             # <<<<<<<<<<<<<<
 *                                     ndarray[int64_t] indexer,
 *                                     int32_t[:, :] out,
 */
  __pyx_tuple__524 = PyTuple_Pack(10, __pyx_n_s_values, __pyx_n_s_indexer, __pyx_n_s_out, __pyx_n_s_fill_value, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_k, __pyx_n_s_n, __pyx_n_s_idx, __pyx_n_s_fv); if (unlikely(!__pyx_tuple__524)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3702; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__524);
  __Pyx_GIVEREF(__pyx_tuple__524);
  __pyx_codeobj__525 = (PyObject*)__Pyx_PyCode_New(4, 0, 10, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__524, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_take_2d_axis1_int32_int32, 3702, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__525)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3702; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/src/generated.pyx":3728
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def take_2d_axis1_int32_int64(int32_t[:, :] values,             # <<<<<<<<<<<<<<
 *                                     ndarray[int64_t] indexer,
 *                                     int64_t[:, :] out,
 */
  __pyx_tuple__526 = PyTuple_Pack(10, __pyx_n_s_values, __pyx_n_s_indexer, __pyx_n_s_out, __pyx_n_s_fill_value, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_k, __pyx_n_s_n, __pyx_n_s_idx, __pyx_n_s_fv); if (unlikely(!__pyx_tuple__526)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3728; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__526);
  __Pyx_GIVEREF(__pyx_tuple__526);
  __pyx_codeobj__527 = (PyObject*)__Pyx_PyCode_New(4, 0, 10, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__526, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_take_2d_axis1_int32_int64, 3728, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__527)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3728; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/src/generated.pyx":3754
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def take_2d_axis1_int32_float64(int32_t[:, :] values,             # <<<<<<<<<<<<<<
 *                                     ndarray[int64_t] indexer,
 *                                     float64_t[:, :] out,
 */
  __pyx_tuple__528 = PyTuple_Pack(10, __pyx_n_s_values, __pyx_n_s_indexer, __pyx_n_s_out, __pyx_n_s_fill_value, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_k, __pyx_n_s_n, __pyx_n_s_idx, __pyx_n_s_fv); if (unlikely(!__pyx_tuple__528)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3754; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__528);
  __Pyx_GIVEREF(__pyx_tuple__528);
  __pyx_codeobj__529 = (PyObject*)__Pyx_PyCode_New(4, 0, 10, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__528, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_take_2d_axis1_int32_float64, 3754, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__529)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3754; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/src/generated.pyx":3780
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def take_2d_axis1_int64_int64(int64_t[:, :] values,             # <<<<<<<<<<<<<<
 *                                     ndarray[int64_t] indexer,
 *                                     int64_t[:, :] out,
 */
  __pyx_tuple__530 = PyTuple_Pack(10, __pyx_n_s_values, __pyx_n_s_indexer, __pyx_n_s_out, __pyx_n_s_fill_value, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_k, __pyx_n_s_n, __pyx_n_s_idx, __pyx_n_s_fv); if (unlikely(!__pyx_tuple__530)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3780; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__530);
  __Pyx_GIVEREF(__pyx_tuple__530);
  __pyx_codeobj__531 = (PyObject*)__Pyx_PyCode_New(4, 0, 10, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__530, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_take_2d_axis1_int64_int64, 3780, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__531)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3780; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/src/generated.pyx":3806
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def take_2d_axis1_int64_float64(int64_t[:, :] values,             # <<<<<<<<<<<<<<
 *                                     ndarray[int64_t] indexer,
 *                                     float64_t[:, :] out,
 */
  __pyx_tuple__532 = PyTuple_Pack(10, __pyx_n_s_values, __pyx_n_s_indexer, __pyx_n_s_out, __pyx_n_s_fill_value, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_k, __pyx_n_s_n, __pyx_n_s_idx, __pyx_n_s_fv); if (unlikely(!__pyx_tuple__532)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3806; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__532);
  __Pyx_GIVEREF(__pyx_tuple__532);
  __pyx_codeobj__533 = (PyObject*)__Pyx_PyCode_New(4, 0, 10, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__532, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_take_2d_axis1_int64_float64, 3806, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__533)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3806; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/src/generated.pyx":3832
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def take_2d_axis1_float32_float32(float32_t[:, :] values,             # <<<<<<<<<<<<<<
 *                                     ndarray[int64_t] indexer,
 *                                     float32_t[:, :] out,
 */
  __pyx_tuple__534 = PyTuple_Pack(10, __pyx_n_s_values, __pyx_n_s_indexer, __pyx_n_s_out, __pyx_n_s_fill_value, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_k, __pyx_n_s_n, __pyx_n_s_idx, __pyx_n_s_fv); if (unlikely(!__pyx_tuple__534)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3832; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__534);
  __Pyx_GIVEREF(__pyx_tuple__534);
  __pyx_codeobj__535 = (PyObject*)__Pyx_PyCode_New(4, 0, 10, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__534, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_take_2d_axis1_float32_float32, 3832, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__535)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3832; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/src/generated.pyx":3858
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def take_2d_axis1_float32_float64(float32_t[:, :] values,             # <<<<<<<<<<<<<<
 *                                     ndarray[int64_t] indexer,
 *                                     float64_t[:, :] out,
 */
  __pyx_tuple__536 = PyTuple_Pack(10, __pyx_n_s_values, __pyx_n_s_indexer, __pyx_n_s_out, __pyx_n_s_fill_value, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_k, __pyx_n_s_n, __pyx_n_s_idx, __pyx_n_s_fv); if (unlikely(!__pyx_tuple__536)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3858; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__536);
  __Pyx_GIVEREF(__pyx_tuple__536);
  __pyx_codeobj__537 = (PyObject*)__Pyx_PyCode_New(4, 0, 10, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__536, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_take_2d_axis1_float32_float64, 3858, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__537)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3858; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/src/generated.pyx":3884
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def take_2d_axis1_float64_float64(float64_t[:, :] values,             # <<<<<<<<<<<<<<
 *                                     ndarray[int64_t] indexer,
 *                                     float64_t[:, :] out,
 */
  __pyx_tuple__538 = PyTuple_Pack(10, __pyx_n_s_values, __pyx_n_s_indexer, __pyx_n_s_out, __pyx_n_s_fill_value, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_k, __pyx_n_s_n, __pyx_n_s_idx, __pyx_n_s_fv); if (unlikely(!__pyx_tuple__538)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3884; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__538);
  __Pyx_GIVEREF(__pyx_tuple__538);
  __pyx_codeobj__539 = (PyObject*)__Pyx_PyCode_New(4, 0, 10, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__538, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_take_2d_axis1_float64_float64, 3884, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__539)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3884; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/src/generated.pyx":3910
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def take_2d_axis1_object_object(object[:, :] values,             # <<<<<<<<<<<<<<
 *                                     ndarray[int64_t] indexer,
 *                                     object[:, :] out,
 */
  __pyx_tuple__540 = PyTuple_Pack(10, __pyx_n_s_values, __pyx_n_s_indexer, __pyx_n_s_out, __pyx_n_s_fill_value, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_k, __pyx_n_s_n, __pyx_n_s_idx, __pyx_n_s_fv); if (unlikely(!__pyx_tuple__540)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3910; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__540);
  __Pyx_GIVEREF(__pyx_tuple__540);
  __pyx_codeobj__541 = (PyObject*)__Pyx_PyCode_New(4, 0, 10, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__540, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_take_2d_axis1_object_object, 3910, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__541)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3910; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/src/generated.pyx":3937
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def take_2d_multi_bool_bool(ndarray[uint8_t, ndim=2] values,             # <<<<<<<<<<<<<<
 *                                     indexer,
 *                                     ndarray[uint8_t, ndim=2] out,
 */
  __pyx_tuple__542 = PyTuple_Pack(12, __pyx_n_s_values, __pyx_n_s_indexer, __pyx_n_s_out, __pyx_n_s_fill_value, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_k, __pyx_n_s_n, __pyx_n_s_idx, __pyx_n_s_idx0, __pyx_n_s_idx1, __pyx_n_s_fv); if (unlikely(!__pyx_tuple__542)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3937; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__542);
  __Pyx_GIVEREF(__pyx_tuple__542);
  __pyx_codeobj__543 = (PyObject*)__Pyx_PyCode_New(4, 0, 12, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__542, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_take_2d_multi_bool_bool, 3937, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__543)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3937; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/src/generated.pyx":3965
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def take_2d_multi_bool_object(ndarray[uint8_t, ndim=2] values,             # <<<<<<<<<<<<<<
 *                                     indexer,
 *                                     ndarray[object, ndim=2] out,
 */
  __pyx_tuple__544 = PyTuple_Pack(12, __pyx_n_s_values, __pyx_n_s_indexer, __pyx_n_s_out, __pyx_n_s_fill_value, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_k, __pyx_n_s_n, __pyx_n_s_idx, __pyx_n_s_idx0, __pyx_n_s_idx1, __pyx_n_s_fv); if (unlikely(!__pyx_tuple__544)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3965; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__544);
  __Pyx_GIVEREF(__pyx_tuple__544);
  __pyx_codeobj__545 = (PyObject*)__Pyx_PyCode_New(4, 0, 12, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__544, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_take_2d_multi_bool_object, 3965, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__545)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3965; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/src/generated.pyx":3993
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def take_2d_multi_int8_int8(ndarray[int8_t, ndim=2] values,             # <<<<<<<<<<<<<<
 *                                     indexer,
 *                                     ndarray[int8_t, ndim=2] out,
 */
  __pyx_tuple__546 = PyTuple_Pack(12, __pyx_n_s_values, __pyx_n_s_indexer, __pyx_n_s_out, __pyx_n_s_fill_value, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_k, __pyx_n_s_n, __pyx_n_s_idx, __pyx_n_s_idx0, __pyx_n_s_idx1, __pyx_n_s_fv); if (unlikely(!__pyx_tuple__546)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3993; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__546);
  __Pyx_GIVEREF(__pyx_tuple__546);
  __pyx_codeobj__547 = (PyObject*)__Pyx_PyCode_New(4, 0, 12, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__546, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_take_2d_multi_int8_int8, 3993, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__547)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3993; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/src/generated.pyx":4021
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def take_2d_multi_int8_int32(ndarray[int8_t, ndim=2] values,             # <<<<<<<<<<<<<<
 *                                     indexer,
 *                                     ndarray[int32_t, ndim=2] out,
 */
  __pyx_tuple__548 = PyTuple_Pack(12, __pyx_n_s_values, __pyx_n_s_indexer, __pyx_n_s_out, __pyx_n_s_fill_value, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_k, __pyx_n_s_n, __pyx_n_s_idx, __pyx_n_s_idx0, __pyx_n_s_idx1, __pyx_n_s_fv); if (unlikely(!__pyx_tuple__548)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4021; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__548);
  __Pyx_GIVEREF(__pyx_tuple__548);
  __pyx_codeobj__549 = (PyObject*)__Pyx_PyCode_New(4, 0, 12, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__548, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_take_2d_multi_int8_int32, 4021, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__549)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4021; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/src/generated.pyx":4049
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def take_2d_multi_int8_int64(ndarray[int8_t, ndim=2] values,             # <<<<<<<<<<<<<<
 *                                     indexer,
 *                                     ndarray[int64_t, ndim=2] out,
 */
  __pyx_tuple__550 = PyTuple_Pack(12, __pyx_n_s_values, __pyx_n_s_indexer, __pyx_n_s_out, __pyx_n_s_fill_value, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_k, __pyx_n_s_n, __pyx_n_s_idx, __pyx_n_s_idx0, __pyx_n_s_idx1, __pyx_n_s_fv); if (unlikely(!__pyx_tuple__550)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4049; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__550);
  __Pyx_GIVEREF(__pyx_tuple__550);
  __pyx_codeobj__551 = (PyObject*)__Pyx_PyCode_New(4, 0, 12, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__550, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_take_2d_multi_int8_int64, 4049, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__551)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4049; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/src/generated.pyx":4077
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def take_2d_multi_int8_float64(ndarray[int8_t, ndim=2] values,             # <<<<<<<<<<<<<<
 *                                     indexer,
 *                                     ndarray[float64_t, ndim=2] out,
 */
  __pyx_tuple__552 = PyTuple_Pack(12, __pyx_n_s_values, __pyx_n_s_indexer, __pyx_n_s_out, __pyx_n_s_fill_value, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_k, __pyx_n_s_n, __pyx_n_s_idx, __pyx_n_s_idx0, __pyx_n_s_idx1, __pyx_n_s_fv); if (unlikely(!__pyx_tuple__552)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4077; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__552);
  __Pyx_GIVEREF(__pyx_tuple__552);
  __pyx_codeobj__553 = (PyObject*)__Pyx_PyCode_New(4, 0, 12, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__552, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_take_2d_multi_int8_float64, 4077, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__553)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4077; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/src/generated.pyx":4105
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def take_2d_multi_int16_int16(ndarray[int16_t, ndim=2] values,             # <<<<<<<<<<<<<<
 *                                     indexer,
 *                                     ndarray[int16_t, ndim=2] out,
 */
  __pyx_tuple__554 = PyTuple_Pack(12, __pyx_n_s_values, __pyx_n_s_indexer, __pyx_n_s_out, __pyx_n_s_fill_value, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_k, __pyx_n_s_n, __pyx_n_s_idx, __pyx_n_s_idx0, __pyx_n_s_idx1, __pyx_n_s_fv); if (unlikely(!__pyx_tuple__554)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4105; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__554);
  __Pyx_GIVEREF(__pyx_tuple__554);
  __pyx_codeobj__555 = (PyObject*)__Pyx_PyCode_New(4, 0, 12, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__554, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_take_2d_multi_int16_int16, 4105, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__555)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4105; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/src/generated.pyx":4133
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def take_2d_multi_int16_int32(ndarray[int16_t, ndim=2] values,             # <<<<<<<<<<<<<<
 *                                     indexer,
 *                                     ndarray[int32_t, ndim=2] out,
 */
  __pyx_tuple__556 = PyTuple_Pack(12, __pyx_n_s_values, __pyx_n_s_indexer, __pyx_n_s_out, __pyx_n_s_fill_value, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_k, __pyx_n_s_n, __pyx_n_s_idx, __pyx_n_s_idx0, __pyx_n_s_idx1, __pyx_n_s_fv); if (unlikely(!__pyx_tuple__556)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4133; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__556);
  __Pyx_GIVEREF(__pyx_tuple__556);
  __pyx_codeobj__557 = (PyObject*)__Pyx_PyCode_New(4, 0, 12, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__556, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_take_2d_multi_int16_int32, 4133, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__557)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4133; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/src/generated.pyx":4161
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def take_2d_multi_int16_int64(ndarray[int16_t, ndim=2] values,             # <<<<<<<<<<<<<<
 *                                     indexer,
 *                                     ndarray[int64_t, ndim=2] out,
 */
  __pyx_tuple__558 = PyTuple_Pack(12, __pyx_n_s_values, __pyx_n_s_indexer, __pyx_n_s_out, __pyx_n_s_fill_value, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_k, __pyx_n_s_n, __pyx_n_s_idx, __pyx_n_s_idx0, __pyx_n_s_idx1, __pyx_n_s_fv); if (unlikely(!__pyx_tuple__558)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4161; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__558);
  __Pyx_GIVEREF(__pyx_tuple__558);
  __pyx_codeobj__559 = (PyObject*)__Pyx_PyCode_New(4, 0, 12, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__558, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_take_2d_multi_int16_int64, 4161, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__559)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4161; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/src/generated.pyx":4189
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def take_2d_multi_int16_float64(ndarray[int16_t, ndim=2] values,             # <<<<<<<<<<<<<<
 *                                     indexer,
 *                                     ndarray[float64_t, ndim=2] out,
 */
  __pyx_tuple__560 = PyTuple_Pack(12, __pyx_n_s_values, __pyx_n_s_indexer, __pyx_n_s_out, __pyx_n_s_fill_value, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_k, __pyx_n_s_n, __pyx_n_s_idx, __pyx_n_s_idx0, __pyx_n_s_idx1, __pyx_n_s_fv); if (unlikely(!__pyx_tuple__560)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4189; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__560);
  __Pyx_GIVEREF(__pyx_tuple__560);
  __pyx_codeobj__561 = (PyObject*)__Pyx_PyCode_New(4, 0, 12, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__560, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_take_2d_multi_int16_float64, 4189, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__561)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4189; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/src/generated.pyx":4217
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def take_2d_multi_int32_int32(ndarray[int32_t, ndim=2] values,             # <<<<<<<<<<<<<<
 *                                     indexer,
 *                                     ndarray[int32_t, ndim=2] out,
 */
  __pyx_tuple__562 = PyTuple_Pack(12, __pyx_n_s_values, __pyx_n_s_indexer, __pyx_n_s_out, __pyx_n_s_fill_value, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_k, __pyx_n_s_n, __pyx_n_s_idx, __pyx_n_s_idx0, __pyx_n_s_idx1, __pyx_n_s_fv); if (unlikely(!__pyx_tuple__562)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4217; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__562);
  __Pyx_GIVEREF(__pyx_tuple__562);
  __pyx_codeobj__563 = (PyObject*)__Pyx_PyCode_New(4, 0, 12, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__562, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_take_2d_multi_int32_int32, 4217, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__563)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4217; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/src/generated.pyx":4245
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def take_2d_multi_int32_int64(ndarray[int32_t, ndim=2] values,             # <<<<<<<<<<<<<<
 *                                     indexer,
 *                                     ndarray[int64_t, ndim=2] out,
 */
  __pyx_tuple__564 = PyTuple_Pack(12, __pyx_n_s_values, __pyx_n_s_indexer, __pyx_n_s_out, __pyx_n_s_fill_value, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_k, __pyx_n_s_n, __pyx_n_s_idx, __pyx_n_s_idx0, __pyx_n_s_idx1, __pyx_n_s_fv); if (unlikely(!__pyx_tuple__564)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4245; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__564);
  __Pyx_GIVEREF(__pyx_tuple__564);
  __pyx_codeobj__565 = (PyObject*)__Pyx_PyCode_New(4, 0, 12, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__564, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_take_2d_multi_int32_int64, 4245, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__565)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4245; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/src/generated.pyx":4273
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def take_2d_multi_int32_float64(ndarray[int32_t, ndim=2] values,             # <<<<<<<<<<<<<<
 *                                     indexer,
 *                                     ndarray[float64_t, ndim=2] out,
 */
  __pyx_tuple__566 = PyTuple_Pack(12, __pyx_n_s_values, __pyx_n_s_indexer, __pyx_n_s_out, __pyx_n_s_fill_value, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_k, __pyx_n_s_n, __pyx_n_s_idx, __pyx_n_s_idx0, __pyx_n_s_idx1, __pyx_n_s_fv); if (unlikely(!__pyx_tuple__566)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4273; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__566);
  __Pyx_GIVEREF(__pyx_tuple__566);
  __pyx_codeobj__567 = (PyObject*)__Pyx_PyCode_New(4, 0, 12, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__566, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_take_2d_multi_int32_float64, 4273, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__567)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4273; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/src/generated.pyx":4301
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def take_2d_multi_int64_int64(ndarray[int64_t, ndim=2] values,             # <<<<<<<<<<<<<<
 *                                     indexer,
 *                                     ndarray[int64_t, ndim=2] out,
 */
  __pyx_tuple__568 = PyTuple_Pack(12, __pyx_n_s_values, __pyx_n_s_indexer, __pyx_n_s_out, __pyx_n_s_fill_value, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_k, __pyx_n_s_n, __pyx_n_s_idx, __pyx_n_s_idx0, __pyx_n_s_idx1, __pyx_n_s_fv); if (unlikely(!__pyx_tuple__568)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4301; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__568);
  __Pyx_GIVEREF(__pyx_tuple__568);
  __pyx_codeobj__569 = (PyObject*)__Pyx_PyCode_New(4, 0, 12, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__568, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_take_2d_multi_int64_int64, 4301, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__569)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4301; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/src/generated.pyx":4329
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def take_2d_multi_int64_float64(ndarray[int64_t, ndim=2] values,             # <<<<<<<<<<<<<<
 *                                     indexer,
 *                                     ndarray[float64_t, ndim=2] out,
 */
  __pyx_tuple__570 = PyTuple_Pack(12, __pyx_n_s_values, __pyx_n_s_indexer, __pyx_n_s_out, __pyx_n_s_fill_value, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_k, __pyx_n_s_n, __pyx_n_s_idx, __pyx_n_s_idx0, __pyx_n_s_idx1, __pyx_n_s_fv); if (unlikely(!__pyx_tuple__570)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4329; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__570);
  __Pyx_GIVEREF(__pyx_tuple__570);
  __pyx_codeobj__571 = (PyObject*)__Pyx_PyCode_New(4, 0, 12, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__570, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_take_2d_multi_int64_float64, 4329, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__571)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4329; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/src/generated.pyx":4357
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def take_2d_multi_float32_float32(ndarray[float32_t, ndim=2] values,             # <<<<<<<<<<<<<<
 *                                     indexer,
 *                                     ndarray[float32_t, ndim=2] out,
 */
  __pyx_tuple__572 = PyTuple_Pack(12, __pyx_n_s_values, __pyx_n_s_indexer, __pyx_n_s_out, __pyx_n_s_fill_value, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_k, __pyx_n_s_n, __pyx_n_s_idx, __pyx_n_s_idx0, __pyx_n_s_idx1, __pyx_n_s_fv); if (unlikely(!__pyx_tuple__572)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4357; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__572);
  __Pyx_GIVEREF(__pyx_tuple__572);
  __pyx_codeobj__573 = (PyObject*)__Pyx_PyCode_New(4, 0, 12, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__572, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_take_2d_multi_float32_float32, 4357, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__573)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4357; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/src/generated.pyx":4385
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def take_2d_multi_float32_float64(ndarray[float32_t, ndim=2] values,             # <<<<<<<<<<<<<<
 *                                     indexer,
 *                                     ndarray[float64_t, ndim=2] out,
 */
  __pyx_tuple__574 = PyTuple_Pack(12, __pyx_n_s_values, __pyx_n_s_indexer, __pyx_n_s_out, __pyx_n_s_fill_value, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_k, __pyx_n_s_n, __pyx_n_s_idx, __pyx_n_s_idx0, __pyx_n_s_idx1, __pyx_n_s_fv); if (unlikely(!__pyx_tuple__574)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4385; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__574);
  __Pyx_GIVEREF(__pyx_tuple__574);
  __pyx_codeobj__575 = (PyObject*)__Pyx_PyCode_New(4, 0, 12, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__574, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_take_2d_multi_float32_float64, 4385, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__575)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4385; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/src/generated.pyx":4413
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def take_2d_multi_float64_float64(ndarray[float64_t, ndim=2] values,             # <<<<<<<<<<<<<<
 *                                     indexer,
 *                                     ndarray[float64_t, ndim=2] out,
 */
  __pyx_tuple__576 = PyTuple_Pack(12, __pyx_n_s_values, __pyx_n_s_indexer, __pyx_n_s_out, __pyx_n_s_fill_value, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_k, __pyx_n_s_n, __pyx_n_s_idx, __pyx_n_s_idx0, __pyx_n_s_idx1, __pyx_n_s_fv); if (unlikely(!__pyx_tuple__576)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4413; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__576);
  __Pyx_GIVEREF(__pyx_tuple__576);
  __pyx_codeobj__577 = (PyObject*)__Pyx_PyCode_New(4, 0, 12, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__576, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_take_2d_multi_float64_float64, 4413, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__577)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4413; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/src/generated.pyx":4441
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def take_2d_multi_object_object(ndarray[object, ndim=2] values,             # <<<<<<<<<<<<<<
 *                                     indexer,
 *                                     ndarray[object, ndim=2] out,
 */
  __pyx_tuple__578 = PyTuple_Pack(12, __pyx_n_s_values, __pyx_n_s_indexer, __pyx_n_s_out, __pyx_n_s_fill_value, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_k, __pyx_n_s_n, __pyx_n_s_idx, __pyx_n_s_idx0, __pyx_n_s_idx1, __pyx_n_s_fv); if (unlikely(!__pyx_tuple__578)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4441; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__578);
  __Pyx_GIVEREF(__pyx_tuple__578);
  __pyx_codeobj__579 = (PyObject*)__Pyx_PyCode_New(4, 0, 12, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__578, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_take_2d_multi_object_object, 4441, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__579)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4441; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/src/generated.pyx":4470
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def diff_2d_float64(ndarray[float64_t, ndim=2] arr,             # <<<<<<<<<<<<<<
 *                      ndarray[float64_t, ndim=2] out,
 *                     Py_ssize_t periods, int axis):
 */
  __pyx_tuple__580 = PyTuple_Pack(10, __pyx_n_s_arr, __pyx_n_s_out, __pyx_n_s_periods, __pyx_n_s_axis, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_sx, __pyx_n_s_sy, __pyx_n_s_start, __pyx_n_s_stop); if (unlikely(!__pyx_tuple__580)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4470; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__580);
  __Pyx_GIVEREF(__pyx_tuple__580);
  __pyx_codeobj__581 = (PyObject*)__Pyx_PyCode_New(4, 0, 10, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__580, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_diff_2d_float64, 4470, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__581)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4470; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/src/generated.pyx":4513
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def diff_2d_float32(ndarray[float32_t, ndim=2] arr,             # <<<<<<<<<<<<<<
 *                      ndarray[float32_t, ndim=2] out,
 *                     Py_ssize_t periods, int axis):
 */
  __pyx_tuple__582 = PyTuple_Pack(10, __pyx_n_s_arr, __pyx_n_s_out, __pyx_n_s_periods, __pyx_n_s_axis, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_sx, __pyx_n_s_sy, __pyx_n_s_start, __pyx_n_s_stop); if (unlikely(!__pyx_tuple__582)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4513; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__582);
  __Pyx_GIVEREF(__pyx_tuple__582);
  __pyx_codeobj__583 = (PyObject*)__Pyx_PyCode_New(4, 0, 10, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__582, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_diff_2d_float32, 4513, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__583)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4513; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/src/generated.pyx":4556
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def diff_2d_int8(ndarray[int8_t, ndim=2] arr,             # <<<<<<<<<<<<<<
 *                      ndarray[float32_t, ndim=2] out,
 *                     Py_ssize_t periods, int axis):
 */
  __pyx_tuple__584 = PyTuple_Pack(10, __pyx_n_s_arr, __pyx_n_s_out, __pyx_n_s_periods, __pyx_n_s_axis, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_sx, __pyx_n_s_sy, __pyx_n_s_start, __pyx_n_s_stop); if (unlikely(!__pyx_tuple__584)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4556; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__584);
  __Pyx_GIVEREF(__pyx_tuple__584);
  __pyx_codeobj__585 = (PyObject*)__Pyx_PyCode_New(4, 0, 10, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__584, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_diff_2d_int8, 4556, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__585)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4556; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/src/generated.pyx":4599
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def diff_2d_int16(ndarray[int16_t, ndim=2] arr,             # <<<<<<<<<<<<<<
 *                      ndarray[float32_t, ndim=2] out,
 *                     Py_ssize_t periods, int axis):
 */
  __pyx_tuple__586 = PyTuple_Pack(10, __pyx_n_s_arr, __pyx_n_s_out, __pyx_n_s_periods, __pyx_n_s_axis, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_sx, __pyx_n_s_sy, __pyx_n_s_start, __pyx_n_s_stop); if (unlikely(!__pyx_tuple__586)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4599; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__586);
  __Pyx_GIVEREF(__pyx_tuple__586);
  __pyx_codeobj__587 = (PyObject*)__Pyx_PyCode_New(4, 0, 10, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__586, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_diff_2d_int16, 4599, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__587)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4599; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/src/generated.pyx":4642
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def diff_2d_int32(ndarray[int32_t, ndim=2] arr,             # <<<<<<<<<<<<<<
 *                      ndarray[float64_t, ndim=2] out,
 *                     Py_ssize_t periods, int axis):
 */
  __pyx_tuple__588 = PyTuple_Pack(10, __pyx_n_s_arr, __pyx_n_s_out, __pyx_n_s_periods, __pyx_n_s_axis, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_sx, __pyx_n_s_sy, __pyx_n_s_start, __pyx_n_s_stop); if (unlikely(!__pyx_tuple__588)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4642; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__588);
  __Pyx_GIVEREF(__pyx_tuple__588);
  __pyx_codeobj__589 = (PyObject*)__Pyx_PyCode_New(4, 0, 10, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__588, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_diff_2d_int32, 4642, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__589)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4642; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/src/generated.pyx":4685
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def diff_2d_int64(ndarray[int64_t, ndim=2] arr,             # <<<<<<<<<<<<<<
 *                      ndarray[float64_t, ndim=2] out,
 *                     Py_ssize_t periods, int axis):
 */
  __pyx_tuple__590 = PyTuple_Pack(10, __pyx_n_s_arr, __pyx_n_s_out, __pyx_n_s_periods, __pyx_n_s_axis, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_sx, __pyx_n_s_sy, __pyx_n_s_start, __pyx_n_s_stop); if (unlikely(!__pyx_tuple__590)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4685; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__590);
  __Pyx_GIVEREF(__pyx_tuple__590);
  __pyx_codeobj__591 = (PyObject*)__Pyx_PyCode_New(4, 0, 10, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__590, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_diff_2d_int64, 4685, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__591)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4685; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/src/generated.pyx":4729
 * @cython.wraparound(False)
 * @cython.wraparound(False)
 * def group_last_float64(ndarray[float64_t, ndim=2] out,             # <<<<<<<<<<<<<<
 *                ndarray[int64_t] counts,
 *                ndarray[float64_t, ndim=2] values,
 */
  __pyx_tuple__592 = PyTuple_Pack(13, __pyx_n_s_out, __pyx_n_s_counts, __pyx_n_s_values, __pyx_n_s_labels, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_N, __pyx_n_s_K, __pyx_n_s_lab, __pyx_n_s_val, __pyx_n_s_count, __pyx_n_s_resx, __pyx_n_s_nobs); if (unlikely(!__pyx_tuple__592)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4729; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__592);
  __Pyx_GIVEREF(__pyx_tuple__592);
  __pyx_codeobj__593 = (PyObject*)__Pyx_PyCode_New(4, 0, 13, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__592, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_group_last_float64, 4729, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__593)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4729; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/src/generated.pyx":4772
 * @cython.wraparound(False)
 * @cython.wraparound(False)
 * def group_last_float32(ndarray[float32_t, ndim=2] out,             # <<<<<<<<<<<<<<
 *                ndarray[int64_t] counts,
 *                ndarray[float32_t, ndim=2] values,
 */
  __pyx_tuple__594 = PyTuple_Pack(13, __pyx_n_s_out, __pyx_n_s_counts, __pyx_n_s_values, __pyx_n_s_labels, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_N, __pyx_n_s_K, __pyx_n_s_lab, __pyx_n_s_val, __pyx_n_s_count, __pyx_n_s_resx, __pyx_n_s_nobs); if (unlikely(!__pyx_tuple__594)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4772; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__594);
  __Pyx_GIVEREF(__pyx_tuple__594);
  __pyx_codeobj__595 = (PyObject*)__Pyx_PyCode_New(4, 0, 13, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__594, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_group_last_float32, 4772, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__595)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4772; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/src/generated.pyx":4816
 * @cython.wraparound(False)
 * @cython.wraparound(False)
 * def group_last_bin_float64(ndarray[float64_t, ndim=2] out,             # <<<<<<<<<<<<<<
 *                    ndarray[int64_t] counts,
 *                    ndarray[float64_t, ndim=2] values,
 */
  __pyx_tuple__596 = PyTuple_Pack(14, __pyx_n_s_out, __pyx_n_s_counts, __pyx_n_s_values, __pyx_n_s_bins, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_N, __pyx_n_s_K, __pyx_n_s_ngroups, __pyx_n_s_b, __pyx_n_s_val, __pyx_n_s_count, __pyx_n_s_resx, __pyx_n_s_nobs); if (unlikely(!__pyx_tuple__596)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4816; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__596);
  __Pyx_GIVEREF(__pyx_tuple__596);
  __pyx_codeobj__597 = (PyObject*)__Pyx_PyCode_New(4, 0, 14, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__596, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_group_last_bin_float64, 4816, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__597)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4816; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/src/generated.pyx":4860
 * @cython.wraparound(False)
 * @cython.wraparound(False)
 * def group_last_bin_float32(ndarray[float32_t, ndim=2] out,             # <<<<<<<<<<<<<<
 *                    ndarray[int64_t] counts,
 *                    ndarray[float32_t, ndim=2] values,
 */
  __pyx_tuple__598 = PyTuple_Pack(14, __pyx_n_s_out, __pyx_n_s_counts, __pyx_n_s_values, __pyx_n_s_bins, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_N, __pyx_n_s_K, __pyx_n_s_ngroups, __pyx_n_s_b, __pyx_n_s_val, __pyx_n_s_count, __pyx_n_s_resx, __pyx_n_s_nobs); if (unlikely(!__pyx_tuple__598)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4860; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__598);
  __Pyx_GIVEREF(__pyx_tuple__598);
  __pyx_codeobj__599 = (PyObject*)__Pyx_PyCode_New(4, 0, 14, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__598, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_group_last_bin_float32, 4860, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__599)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4860; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/src/generated.pyx":4905
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def group_nth_float64(ndarray[float64_t, ndim=2] out,             # <<<<<<<<<<<<<<
 *               ndarray[int64_t] counts,
 *               ndarray[float64_t, ndim=2] values,
 */
  __pyx_tuple__600 = PyTuple_Pack(14, __pyx_n_s_out, __pyx_n_s_counts, __pyx_n_s_values, __pyx_n_s_labels, __pyx_n_s_rank, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_N, __pyx_n_s_K, __pyx_n_s_lab, __pyx_n_s_val, __pyx_n_s_count, __pyx_n_s_resx, __pyx_n_s_nobs); if (unlikely(!__pyx_tuple__600)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4905; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__600);
  __Pyx_GIVEREF(__pyx_tuple__600);
  __pyx_codeobj__601 = (PyObject*)__Pyx_PyCode_New(5, 0, 14, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__600, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_group_nth_float64, 4905, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__601)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4905; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/src/generated.pyx":4949
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def group_nth_float32(ndarray[float32_t, ndim=2] out,             # <<<<<<<<<<<<<<
 *               ndarray[int64_t] counts,
 *               ndarray[float32_t, ndim=2] values,
 */
  __pyx_tuple__602 = PyTuple_Pack(14, __pyx_n_s_out, __pyx_n_s_counts, __pyx_n_s_values, __pyx_n_s_labels, __pyx_n_s_rank, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_N, __pyx_n_s_K, __pyx_n_s_lab, __pyx_n_s_val, __pyx_n_s_count, __pyx_n_s_resx, __pyx_n_s_nobs); if (unlikely(!__pyx_tuple__602)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4949; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__602);
  __Pyx_GIVEREF(__pyx_tuple__602);
  __pyx_codeobj__603 = (PyObject*)__Pyx_PyCode_New(5, 0, 14, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__602, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_group_nth_float32, 4949, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__603)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4949; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/src/generated.pyx":4994
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def group_nth_bin_float64(ndarray[float64_t, ndim=2] out,             # <<<<<<<<<<<<<<
 *                   ndarray[int64_t] counts,
 *                   ndarray[float64_t, ndim=2] values,
 */
  __pyx_tuple__604 = PyTuple_Pack(15, __pyx_n_s_out, __pyx_n_s_counts, __pyx_n_s_values, __pyx_n_s_bins, __pyx_n_s_rank, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_N, __pyx_n_s_K, __pyx_n_s_ngroups, __pyx_n_s_b, __pyx_n_s_val, __pyx_n_s_count, __pyx_n_s_resx, __pyx_n_s_nobs); if (unlikely(!__pyx_tuple__604)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4994; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__604);
  __Pyx_GIVEREF(__pyx_tuple__604);
  __pyx_codeobj__605 = (PyObject*)__Pyx_PyCode_New(5, 0, 15, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__604, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_group_nth_bin_float64, 4994, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__605)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4994; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/src/generated.pyx":5039
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def group_nth_bin_float32(ndarray[float32_t, ndim=2] out,             # <<<<<<<<<<<<<<
 *                   ndarray[int64_t] counts,
 *                   ndarray[float32_t, ndim=2] values,
 */
  __pyx_tuple__606 = PyTuple_Pack(15, __pyx_n_s_out, __pyx_n_s_counts, __pyx_n_s_values, __pyx_n_s_bins, __pyx_n_s_rank, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_N, __pyx_n_s_K, __pyx_n_s_ngroups, __pyx_n_s_b, __pyx_n_s_val, __pyx_n_s_count, __pyx_n_s_resx, __pyx_n_s_nobs); if (unlikely(!__pyx_tuple__606)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5039; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__606);
  __Pyx_GIVEREF(__pyx_tuple__606);
  __pyx_codeobj__607 = (PyObject*)__Pyx_PyCode_New(5, 0, 15, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__606, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_group_nth_bin_float32, 5039, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__607)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5039; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/src/generated.pyx":5085
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def group_add_float64(ndarray[float64_t, ndim=2] out,             # <<<<<<<<<<<<<<
 *               ndarray[int64_t] counts,
 *               ndarray[float64_t, ndim=2] values,
 */
  __pyx_tuple__608 = PyTuple_Pack(13, __pyx_n_s_out, __pyx_n_s_counts, __pyx_n_s_values, __pyx_n_s_labels, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_N, __pyx_n_s_K, __pyx_n_s_lab, __pyx_n_s_val, __pyx_n_s_count, __pyx_n_s_sumx, __pyx_n_s_nobs); if (unlikely(!__pyx_tuple__608)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5085; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__608);
  __Pyx_GIVEREF(__pyx_tuple__608);
  __pyx_codeobj__609 = (PyObject*)__Pyx_PyCode_New(4, 0, 13, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__608, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_group_add_float64, 5085, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__609)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5085; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/src/generated.pyx":5141
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def group_add_float32(ndarray[float32_t, ndim=2] out,             # <<<<<<<<<<<<<<
 *               ndarray[int64_t] counts,
 *               ndarray[float32_t, ndim=2] values,
 */
  __pyx_tuple__610 = PyTuple_Pack(13, __pyx_n_s_out, __pyx_n_s_counts, __pyx_n_s_values, __pyx_n_s_labels, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_N, __pyx_n_s_K, __pyx_n_s_lab, __pyx_n_s_val, __pyx_n_s_count, __pyx_n_s_sumx, __pyx_n_s_nobs); if (unlikely(!__pyx_tuple__610)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5141; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__610);
  __Pyx_GIVEREF(__pyx_tuple__610);
  __pyx_codeobj__611 = (PyObject*)__Pyx_PyCode_New(4, 0, 13, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__610, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_group_add_float32, 5141, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__611)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5141; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/src/generated.pyx":5198
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def group_add_bin_float64(ndarray[float64_t, ndim=2] out,             # <<<<<<<<<<<<<<
 *                   ndarray[int64_t] counts,
 *                   ndarray[float64_t, ndim=2] values,
 */
  __pyx_tuple__612 = PyTuple_Pack(15, __pyx_n_s_out, __pyx_n_s_counts, __pyx_n_s_values, __pyx_n_s_bins, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_N, __pyx_n_s_K, __pyx_n_s_ngroups, __pyx_n_s_b, __pyx_n_s_nbins, __pyx_n_s_val, __pyx_n_s_count, __pyx_n_s_sumx, __pyx_n_s_nobs); if (unlikely(!__pyx_tuple__612)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5198; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__612);
  __Pyx_GIVEREF(__pyx_tuple__612);
  __pyx_codeobj__613 = (PyObject*)__Pyx_PyCode_New(4, 0, 15, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__612, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_group_add_bin_float64, 5198, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__613)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5198; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/src/generated.pyx":5254
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def group_add_bin_float32(ndarray[float32_t, ndim=2] out,             # <<<<<<<<<<<<<<
 *                   ndarray[int64_t] counts,
 *                   ndarray[float32_t, ndim=2] values,
 */
  __pyx_tuple__614 = PyTuple_Pack(15, __pyx_n_s_out, __pyx_n_s_counts, __pyx_n_s_values, __pyx_n_s_bins, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_N, __pyx_n_s_K, __pyx_n_s_ngroups, __pyx_n_s_b, __pyx_n_s_nbins, __pyx_n_s_val, __pyx_n_s_count, __pyx_n_s_sumx, __pyx_n_s_nobs); if (unlikely(!__pyx_tuple__614)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5254; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__614);
  __Pyx_GIVEREF(__pyx_tuple__614);
  __pyx_codeobj__615 = (PyObject*)__Pyx_PyCode_New(4, 0, 15, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__614, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_group_add_bin_float32, 5254, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__615)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5254; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/src/generated.pyx":5311
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def group_prod_float64(ndarray[float64_t, ndim=2] out,             # <<<<<<<<<<<<<<
 *                ndarray[int64_t] counts,
 *                ndarray[float64_t, ndim=2] values,
 */
  __pyx_tuple__616 = PyTuple_Pack(13, __pyx_n_s_out, __pyx_n_s_counts, __pyx_n_s_values, __pyx_n_s_labels, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_N, __pyx_n_s_K, __pyx_n_s_lab, __pyx_n_s_val, __pyx_n_s_count, __pyx_n_s_prodx, __pyx_n_s_nobs); if (unlikely(!__pyx_tuple__616)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5311; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__616);
  __Pyx_GIVEREF(__pyx_tuple__616);
  __pyx_codeobj__617 = (PyObject*)__Pyx_PyCode_New(4, 0, 13, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__616, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_group_prod_float64, 5311, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__617)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5311; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/src/generated.pyx":5367
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def group_prod_float32(ndarray[float32_t, ndim=2] out,             # <<<<<<<<<<<<<<
 *                ndarray[int64_t] counts,
 *                ndarray[float32_t, ndim=2] values,
 */
  __pyx_tuple__618 = PyTuple_Pack(13, __pyx_n_s_out, __pyx_n_s_counts, __pyx_n_s_values, __pyx_n_s_labels, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_N, __pyx_n_s_K, __pyx_n_s_lab, __pyx_n_s_val, __pyx_n_s_count, __pyx_n_s_prodx, __pyx_n_s_nobs); if (unlikely(!__pyx_tuple__618)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5367; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__618);
  __Pyx_GIVEREF(__pyx_tuple__618);
  __pyx_codeobj__619 = (PyObject*)__Pyx_PyCode_New(4, 0, 13, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__618, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_group_prod_float32, 5367, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__619)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5367; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/src/generated.pyx":5424
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def group_prod_bin_float64(ndarray[float64_t, ndim=2] out,             # <<<<<<<<<<<<<<
 *                   ndarray[int64_t] counts,
 *                   ndarray[float64_t, ndim=2] values,
 */
  __pyx_tuple__620 = PyTuple_Pack(14, __pyx_n_s_out, __pyx_n_s_counts, __pyx_n_s_values, __pyx_n_s_bins, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_N, __pyx_n_s_K, __pyx_n_s_ngroups, __pyx_n_s_b, __pyx_n_s_val, __pyx_n_s_count, __pyx_n_s_prodx, __pyx_n_s_nobs); if (unlikely(!__pyx_tuple__620)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5424; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__620);
  __Pyx_GIVEREF(__pyx_tuple__620);
  __pyx_codeobj__621 = (PyObject*)__Pyx_PyCode_New(4, 0, 14, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__620, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_group_prod_bin_float64, 5424, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__621)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5424; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/src/generated.pyx":5480
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def group_prod_bin_float32(ndarray[float32_t, ndim=2] out,             # <<<<<<<<<<<<<<
 *                   ndarray[int64_t] counts,
 *                   ndarray[float32_t, ndim=2] values,
 */
  __pyx_tuple__622 = PyTuple_Pack(14, __pyx_n_s_out, __pyx_n_s_counts, __pyx_n_s_values, __pyx_n_s_bins, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_N, __pyx_n_s_K, __pyx_n_s_ngroups, __pyx_n_s_b, __pyx_n_s_val, __pyx_n_s_count, __pyx_n_s_prodx, __pyx_n_s_nobs); if (unlikely(!__pyx_tuple__622)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5480; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__622);
  __Pyx_GIVEREF(__pyx_tuple__622);
  __pyx_codeobj__623 = (PyObject*)__Pyx_PyCode_New(4, 0, 14, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__622, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_group_prod_bin_float32, 5480, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__623)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5480; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/src/generated.pyx":5537
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def group_var_float64(ndarray[float64_t, ndim=2] out,             # <<<<<<<<<<<<<<
 *               ndarray[int64_t] counts,
 *               ndarray[float64_t, ndim=2] values,
 */
  __pyx_tuple__624 = PyTuple_Pack(14, __pyx_n_s_out, __pyx_n_s_counts, __pyx_n_s_values, __pyx_n_s_labels, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_N, __pyx_n_s_K, __pyx_n_s_lab, __pyx_n_s_val, __pyx_n_s_ct, __pyx_n_s_nobs, __pyx_n_s_sumx, __pyx_n_s_sumxx); if (unlikely(!__pyx_tuple__624)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5537; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__624);
  __Pyx_GIVEREF(__pyx_tuple__624);
  __pyx_codeobj__625 = (PyObject*)__Pyx_PyCode_New(4, 0, 14, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__624, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_group_var_float64, 5537, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__625)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5537; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/src/generated.pyx":5598
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def group_var_float32(ndarray[float32_t, ndim=2] out,             # <<<<<<<<<<<<<<
 *               ndarray[int64_t] counts,
 *               ndarray[float32_t, ndim=2] values,
 */
  __pyx_tuple__626 = PyTuple_Pack(14, __pyx_n_s_out, __pyx_n_s_counts, __pyx_n_s_values, __pyx_n_s_labels, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_N, __pyx_n_s_K, __pyx_n_s_lab, __pyx_n_s_val, __pyx_n_s_ct, __pyx_n_s_nobs, __pyx_n_s_sumx, __pyx_n_s_sumxx); if (unlikely(!__pyx_tuple__626)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5598; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__626);
  __Pyx_GIVEREF(__pyx_tuple__626);
  __pyx_codeobj__627 = (PyObject*)__Pyx_PyCode_New(4, 0, 14, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__626, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_group_var_float32, 5598, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__627)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5598; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/src/generated.pyx":5660
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def group_var_bin_float64(ndarray[float64_t, ndim=2] out,             # <<<<<<<<<<<<<<
 *                   ndarray[int64_t] counts,
 *                   ndarray[float64_t, ndim=2] values,
 */
  __pyx_tuple__628 = PyTuple_Pack(15, __pyx_n_s_out, __pyx_n_s_counts, __pyx_n_s_values, __pyx_n_s_bins, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_N, __pyx_n_s_K, __pyx_n_s_ngroups, __pyx_n_s_b, __pyx_n_s_val, __pyx_n_s_ct, __pyx_n_s_nobs, __pyx_n_s_sumx, __pyx_n_s_sumxx); if (unlikely(!__pyx_tuple__628)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5660; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__628);
  __Pyx_GIVEREF(__pyx_tuple__628);
  __pyx_codeobj__629 = (PyObject*)__Pyx_PyCode_New(4, 0, 15, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__628, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_group_var_bin_float64, 5660, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__629)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5660; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/src/generated.pyx":5721
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def group_var_bin_float32(ndarray[float32_t, ndim=2] out,             # <<<<<<<<<<<<<<
 *                   ndarray[int64_t] counts,
 *                   ndarray[float32_t, ndim=2] values,
 */
  __pyx_tuple__630 = PyTuple_Pack(15, __pyx_n_s_out, __pyx_n_s_counts, __pyx_n_s_values, __pyx_n_s_bins, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_N, __pyx_n_s_K, __pyx_n_s_ngroups, __pyx_n_s_b, __pyx_n_s_val, __pyx_n_s_ct, __pyx_n_s_nobs, __pyx_n_s_sumx, __pyx_n_s_sumxx); if (unlikely(!__pyx_tuple__630)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5721; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__630);
  __Pyx_GIVEREF(__pyx_tuple__630);
  __pyx_codeobj__631 = (PyObject*)__Pyx_PyCode_New(4, 0, 15, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__630, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_group_var_bin_float32, 5721, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__631)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5721; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/src/generated.pyx":5783
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def group_mean_float64(ndarray[float64_t, ndim=2] out,             # <<<<<<<<<<<<<<
 *                ndarray[int64_t] counts,
 *                ndarray[float64_t, ndim=2] values,
 */
  __pyx_tuple__632 = PyTuple_Pack(13, __pyx_n_s_out, __pyx_n_s_counts, __pyx_n_s_values, __pyx_n_s_labels, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_N, __pyx_n_s_K, __pyx_n_s_lab, __pyx_n_s_val, __pyx_n_s_count, __pyx_n_s_sumx, __pyx_n_s_nobs); if (unlikely(!__pyx_tuple__632)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5783; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__632);
  __Pyx_GIVEREF(__pyx_tuple__632);
  __pyx_codeobj__633 = (PyObject*)__Pyx_PyCode_New(4, 0, 13, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__632, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_group_mean_float64, 5783, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__633)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5783; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/src/generated.pyx":5835
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def group_mean_float32(ndarray[float32_t, ndim=2] out,             # <<<<<<<<<<<<<<
 *                ndarray[int64_t] counts,
 *                ndarray[float32_t, ndim=2] values,
 */
  __pyx_tuple__634 = PyTuple_Pack(13, __pyx_n_s_out, __pyx_n_s_counts, __pyx_n_s_values, __pyx_n_s_labels, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_N, __pyx_n_s_K, __pyx_n_s_lab, __pyx_n_s_val, __pyx_n_s_count, __pyx_n_s_sumx, __pyx_n_s_nobs); if (unlikely(!__pyx_tuple__634)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5835; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__634);
  __Pyx_GIVEREF(__pyx_tuple__634);
  __pyx_codeobj__635 = (PyObject*)__Pyx_PyCode_New(4, 0, 13, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__634, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_group_mean_float32, 5835, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__635)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5835; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/src/generated.pyx":5887
 * 
 * 
 * def group_mean_bin_float64(ndarray[float64_t, ndim=2] out,             # <<<<<<<<<<<<<<
 *                    ndarray[int64_t] counts,
 *                    ndarray[float64_t, ndim=2] values,
 */
  __pyx_tuple__636 = PyTuple_Pack(14, __pyx_n_s_out, __pyx_n_s_counts, __pyx_n_s_values, __pyx_n_s_bins, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_N, __pyx_n_s_K, __pyx_n_s_ngroups, __pyx_n_s_b, __pyx_n_s_val, __pyx_n_s_count, __pyx_n_s_sumx, __pyx_n_s_nobs); if (unlikely(!__pyx_tuple__636)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5887; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__636);
  __Pyx_GIVEREF(__pyx_tuple__636);
  __pyx_codeobj__637 = (PyObject*)__Pyx_PyCode_New(4, 0, 14, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__636, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_group_mean_bin_float64, 5887, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__637)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5887; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/src/generated.pyx":5940
 *                 out[i, j] = sumx[i, j] / count
 * 
 * def group_mean_bin_float32(ndarray[float32_t, ndim=2] out,             # <<<<<<<<<<<<<<
 *                    ndarray[int64_t] counts,
 *                    ndarray[float32_t, ndim=2] values,
 */
  __pyx_tuple__638 = PyTuple_Pack(14, __pyx_n_s_out, __pyx_n_s_counts, __pyx_n_s_values, __pyx_n_s_bins, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_N, __pyx_n_s_K, __pyx_n_s_ngroups, __pyx_n_s_b, __pyx_n_s_val, __pyx_n_s_count, __pyx_n_s_sumx, __pyx_n_s_nobs); if (unlikely(!__pyx_tuple__638)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5940; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__638);
  __Pyx_GIVEREF(__pyx_tuple__638);
  __pyx_codeobj__639 = (PyObject*)__Pyx_PyCode_New(4, 0, 14, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__638, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_group_mean_bin_float32, 5940, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__639)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5940; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/src/generated.pyx":5995
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def group_min_float64(ndarray[float64_t, ndim=2] out,             # <<<<<<<<<<<<<<
 *               ndarray[int64_t] counts,
 *               ndarray[float64_t, ndim=2] values,
 */
  __pyx_tuple__640 = PyTuple_Pack(13, __pyx_n_s_out, __pyx_n_s_counts, __pyx_n_s_values, __pyx_n_s_labels, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_N, __pyx_n_s_K, __pyx_n_s_lab, __pyx_n_s_val, __pyx_n_s_count, __pyx_n_s_minx, __pyx_n_s_nobs); if (unlikely(!__pyx_tuple__640)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5995; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__640);
  __Pyx_GIVEREF(__pyx_tuple__640);
  __pyx_codeobj__641 = (PyObject*)__Pyx_PyCode_New(4, 0, 13, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__640, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_group_min_float64, 5995, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__641)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5995; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/src/generated.pyx":6055
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def group_min_float32(ndarray[float32_t, ndim=2] out,             # <<<<<<<<<<<<<<
 *               ndarray[int64_t] counts,
 *               ndarray[float32_t, ndim=2] values,
 */
  __pyx_tuple__642 = PyTuple_Pack(13, __pyx_n_s_out, __pyx_n_s_counts, __pyx_n_s_values, __pyx_n_s_labels, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_N, __pyx_n_s_K, __pyx_n_s_lab, __pyx_n_s_val, __pyx_n_s_count, __pyx_n_s_minx, __pyx_n_s_nobs); if (unlikely(!__pyx_tuple__642)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6055; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__642);
  __Pyx_GIVEREF(__pyx_tuple__642);
  __pyx_codeobj__643 = (PyObject*)__Pyx_PyCode_New(4, 0, 13, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__642, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_group_min_float32, 6055, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__643)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6055; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/src/generated.pyx":6116
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def group_min_bin_float64(ndarray[float64_t, ndim=2] out,             # <<<<<<<<<<<<<<
 *                    ndarray[int64_t] counts,
 *                    ndarray[float64_t, ndim=2] values,
 */
  __pyx_tuple__644 = PyTuple_Pack(14, __pyx_n_s_out, __pyx_n_s_counts, __pyx_n_s_values, __pyx_n_s_bins, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_N, __pyx_n_s_K, __pyx_n_s_ngroups, __pyx_n_s_b, __pyx_n_s_val, __pyx_n_s_count, __pyx_n_s_minx, __pyx_n_s_nobs); if (unlikely(!__pyx_tuple__644)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6116; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__644);
  __Pyx_GIVEREF(__pyx_tuple__644);
  __pyx_codeobj__645 = (PyObject*)__Pyx_PyCode_New(4, 0, 14, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__644, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_group_min_bin_float64, 6116, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__645)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6116; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/src/generated.pyx":6177
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def group_min_bin_float32(ndarray[float32_t, ndim=2] out,             # <<<<<<<<<<<<<<
 *                    ndarray[int64_t] counts,
 *                    ndarray[float32_t, ndim=2] values,
 */
  __pyx_tuple__646 = PyTuple_Pack(14, __pyx_n_s_out, __pyx_n_s_counts, __pyx_n_s_values, __pyx_n_s_bins, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_N, __pyx_n_s_K, __pyx_n_s_ngroups, __pyx_n_s_b, __pyx_n_s_val, __pyx_n_s_count, __pyx_n_s_minx, __pyx_n_s_nobs); if (unlikely(!__pyx_tuple__646)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6177; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__646);
  __Pyx_GIVEREF(__pyx_tuple__646);
  __pyx_codeobj__647 = (PyObject*)__Pyx_PyCode_New(4, 0, 14, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__646, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_group_min_bin_float32, 6177, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__647)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6177; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/src/generated.pyx":6239
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def group_max_float64(ndarray[float64_t, ndim=2] out,             # <<<<<<<<<<<<<<
 *               ndarray[int64_t] counts,
 *               ndarray[float64_t, ndim=2] values,
 */
  __pyx_tuple__648 = PyTuple_Pack(13, __pyx_n_s_out, __pyx_n_s_counts, __pyx_n_s_values, __pyx_n_s_labels, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_N, __pyx_n_s_K, __pyx_n_s_lab, __pyx_n_s_val, __pyx_n_s_count, __pyx_n_s_maxx, __pyx_n_s_nobs); if (unlikely(!__pyx_tuple__648)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6239; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__648);
  __Pyx_GIVEREF(__pyx_tuple__648);
  __pyx_codeobj__649 = (PyObject*)__Pyx_PyCode_New(4, 0, 13, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__648, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_group_max_float64, 6239, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__649)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6239; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/src/generated.pyx":6299
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def group_max_float32(ndarray[float32_t, ndim=2] out,             # <<<<<<<<<<<<<<
 *               ndarray[int64_t] counts,
 *               ndarray[float32_t, ndim=2] values,
 */
  __pyx_tuple__650 = PyTuple_Pack(13, __pyx_n_s_out, __pyx_n_s_counts, __pyx_n_s_values, __pyx_n_s_labels, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_N, __pyx_n_s_K, __pyx_n_s_lab, __pyx_n_s_val, __pyx_n_s_count, __pyx_n_s_maxx, __pyx_n_s_nobs); if (unlikely(!__pyx_tuple__650)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6299; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__650);
  __Pyx_GIVEREF(__pyx_tuple__650);
  __pyx_codeobj__651 = (PyObject*)__Pyx_PyCode_New(4, 0, 13, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__650, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_group_max_float32, 6299, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__651)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6299; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/src/generated.pyx":6360
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def group_max_bin_float64(ndarray[float64_t, ndim=2] out,             # <<<<<<<<<<<<<<
 *                   ndarray[int64_t] counts,
 *                   ndarray[float64_t, ndim=2] values,
 */
  __pyx_tuple__652 = PyTuple_Pack(14, __pyx_n_s_out, __pyx_n_s_counts, __pyx_n_s_values, __pyx_n_s_bins, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_N, __pyx_n_s_K, __pyx_n_s_ngroups, __pyx_n_s_b, __pyx_n_s_val, __pyx_n_s_count, __pyx_n_s_maxx, __pyx_n_s_nobs); if (unlikely(!__pyx_tuple__652)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6360; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__652);
  __Pyx_GIVEREF(__pyx_tuple__652);
  __pyx_codeobj__653 = (PyObject*)__Pyx_PyCode_New(4, 0, 14, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__652, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_group_max_bin_float64, 6360, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__653)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6360; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/src/generated.pyx":6420
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def group_max_bin_float32(ndarray[float32_t, ndim=2] out,             # <<<<<<<<<<<<<<
 *                   ndarray[int64_t] counts,
 *                   ndarray[float32_t, ndim=2] values,
 */
  __pyx_tuple__654 = PyTuple_Pack(14, __pyx_n_s_out, __pyx_n_s_counts, __pyx_n_s_values, __pyx_n_s_bins, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_N, __pyx_n_s_K, __pyx_n_s_ngroups, __pyx_n_s_b, __pyx_n_s_val, __pyx_n_s_count, __pyx_n_s_maxx, __pyx_n_s_nobs); if (unlikely(!__pyx_tuple__654)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6420; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__654);
  __Pyx_GIVEREF(__pyx_tuple__654);
  __pyx_codeobj__655 = (PyObject*)__Pyx_PyCode_New(4, 0, 14, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__654, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_group_max_bin_float32, 6420, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__655)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6420; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/src/generated.pyx":6481
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def group_ohlc_float64(ndarray[float64_t, ndim=2] out,             # <<<<<<<<<<<<<<
 *                   ndarray[int64_t] counts,
 *                   ndarray[float64_t, ndim=2] values,
 */
  __pyx_tuple__656 = PyTuple_Pack(18, __pyx_n_s_out, __pyx_n_s_counts, __pyx_n_s_values, __pyx_n_s_bins, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_N, __pyx_n_s_K, __pyx_n_s_ngroups, __pyx_n_s_b, __pyx_n_s_val, __pyx_n_s_count, __pyx_n_s_vopen, __pyx_n_s_vhigh, __pyx_n_s_vlow, __pyx_n_s_vclose, __pyx_n_s_NA, __pyx_n_s_got_first); if (unlikely(!__pyx_tuple__656)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6481; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__656);
  __Pyx_GIVEREF(__pyx_tuple__656);
  __pyx_codeobj__657 = (PyObject*)__Pyx_PyCode_New(4, 0, 18, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__656, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_group_ohlc_float64, 6481, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__657)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6481; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/src/generated.pyx":6554
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def group_ohlc_float32(ndarray[float32_t, ndim=2] out,             # <<<<<<<<<<<<<<
 *                   ndarray[int64_t] counts,
 *                   ndarray[float32_t, ndim=2] values,
 */
  __pyx_tuple__658 = PyTuple_Pack(18, __pyx_n_s_out, __pyx_n_s_counts, __pyx_n_s_values, __pyx_n_s_bins, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_N, __pyx_n_s_K, __pyx_n_s_ngroups, __pyx_n_s_b, __pyx_n_s_val, __pyx_n_s_count, __pyx_n_s_vopen, __pyx_n_s_vhigh, __pyx_n_s_vlow, __pyx_n_s_vclose, __pyx_n_s_NA, __pyx_n_s_got_first); if (unlikely(!__pyx_tuple__658)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6554; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__658);
  __Pyx_GIVEREF(__pyx_tuple__658);
  __pyx_codeobj__659 = (PyObject*)__Pyx_PyCode_New(4, 0, 18, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__658, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_group_ohlc_float32, 6554, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__659)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6554; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/src/generated.pyx":6628
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def group_count_float64(ndarray[float64_t, ndim=2] out,             # <<<<<<<<<<<<<<
 *                          ndarray[int64_t] counts,
 *                          ndarray[float64_t, ndim=2] values,
 */
  __pyx_tuple__660 = PyTuple_Pack(11, __pyx_n_s_out, __pyx_n_s_counts, __pyx_n_s_values, __pyx_n_s_labels, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_lab, __pyx_n_s_N, __pyx_n_s_K, __pyx_n_s_val, __pyx_n_s_nobs); if (unlikely(!__pyx_tuple__660)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6628; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__660);
  __Pyx_GIVEREF(__pyx_tuple__660);
  __pyx_codeobj__661 = (PyObject*)__Pyx_PyCode_New(4, 0, 11, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__660, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_group_count_float64, 6628, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__661)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6628; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/src/generated.pyx":6664
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def group_count_float32(ndarray[float32_t, ndim=2] out,             # <<<<<<<<<<<<<<
 *                          ndarray[int64_t] counts,
 *                          ndarray[float32_t, ndim=2] values,
 */
  __pyx_tuple__662 = PyTuple_Pack(11, __pyx_n_s_out, __pyx_n_s_counts, __pyx_n_s_values, __pyx_n_s_labels, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_lab, __pyx_n_s_N, __pyx_n_s_K, __pyx_n_s_val, __pyx_n_s_nobs); if (unlikely(!__pyx_tuple__662)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6664; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__662);
  __Pyx_GIVEREF(__pyx_tuple__662);
  __pyx_codeobj__663 = (PyObject*)__Pyx_PyCode_New(4, 0, 11, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__662, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_group_count_float32, 6664, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__663)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6664; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/src/generated.pyx":6700
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def group_count_object(ndarray[float64_t, ndim=2] out,             # <<<<<<<<<<<<<<
 *                          ndarray[int64_t] counts,
 *                          ndarray[object, ndim=2] values,
 */
  __pyx_tuple__664 = PyTuple_Pack(11, __pyx_n_s_out, __pyx_n_s_counts, __pyx_n_s_values, __pyx_n_s_labels, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_lab, __pyx_n_s_N, __pyx_n_s_K, __pyx_n_s_val, __pyx_n_s_nobs); if (unlikely(!__pyx_tuple__664)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6700; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__664);
  __Pyx_GIVEREF(__pyx_tuple__664);
  __pyx_codeobj__665 = (PyObject*)__Pyx_PyCode_New(4, 0, 11, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__664, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_group_count_object, 6700, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__665)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6700; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/src/generated.pyx":6736
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def group_count_int64(ndarray[float64_t, ndim=2] out,             # <<<<<<<<<<<<<<
 *                          ndarray[int64_t] counts,
 *                          ndarray[int64_t, ndim=2] values,
 */
  __pyx_tuple__666 = PyTuple_Pack(11, __pyx_n_s_out, __pyx_n_s_counts, __pyx_n_s_values, __pyx_n_s_labels, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_lab, __pyx_n_s_N, __pyx_n_s_K, __pyx_n_s_val, __pyx_n_s_nobs); if (unlikely(!__pyx_tuple__666)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6736; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__666);
  __Pyx_GIVEREF(__pyx_tuple__666);
  __pyx_codeobj__667 = (PyObject*)__Pyx_PyCode_New(4, 0, 11, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__666, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_group_count_int64, 6736, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__667)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6736; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/src/generated.pyx":6773
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def group_count_bin_float64(ndarray[float64_t, ndim=2] out,             # <<<<<<<<<<<<<<
 *                              ndarray[int64_t] counts,
 *                              ndarray[float64_t, ndim=2] values,
 */
  __pyx_tuple__668 = PyTuple_Pack(12, __pyx_n_s_out, __pyx_n_s_counts, __pyx_n_s_values, __pyx_n_s_bins, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_ngroups, __pyx_n_s_N, __pyx_n_s_K, __pyx_n_s_b, __pyx_n_s_val, __pyx_n_s_nobs); if (unlikely(!__pyx_tuple__668)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6773; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__668);
  __Pyx_GIVEREF(__pyx_tuple__668);
  __pyx_codeobj__669 = (PyObject*)__Pyx_PyCode_New(4, 0, 12, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__668, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_group_count_bin_float64, 6773, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__669)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6773; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/src/generated.pyx":6807
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def group_count_bin_float32(ndarray[float32_t, ndim=2] out,             # <<<<<<<<<<<<<<
 *                              ndarray[int64_t] counts,
 *                              ndarray[float32_t, ndim=2] values,
 */
  __pyx_tuple__670 = PyTuple_Pack(12, __pyx_n_s_out, __pyx_n_s_counts, __pyx_n_s_values, __pyx_n_s_bins, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_ngroups, __pyx_n_s_N, __pyx_n_s_K, __pyx_n_s_b, __pyx_n_s_val, __pyx_n_s_nobs); if (unlikely(!__pyx_tuple__670)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6807; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__670);
  __Pyx_GIVEREF(__pyx_tuple__670);
  __pyx_codeobj__671 = (PyObject*)__Pyx_PyCode_New(4, 0, 12, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__670, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_group_count_bin_float32, 6807, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__671)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6807; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/src/generated.pyx":6841
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def group_count_bin_object(ndarray[float64_t, ndim=2] out,             # <<<<<<<<<<<<<<
 *                              ndarray[int64_t] counts,
 *                              ndarray[object, ndim=2] values,
 */
  __pyx_tuple__672 = PyTuple_Pack(12, __pyx_n_s_out, __pyx_n_s_counts, __pyx_n_s_values, __pyx_n_s_bins, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_ngroups, __pyx_n_s_N, __pyx_n_s_K, __pyx_n_s_b, __pyx_n_s_val, __pyx_n_s_nobs); if (unlikely(!__pyx_tuple__672)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6841; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__672);
  __Pyx_GIVEREF(__pyx_tuple__672);
  __pyx_codeobj__673 = (PyObject*)__Pyx_PyCode_New(4, 0, 12, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__672, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_group_count_bin_object, 6841, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__673)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6841; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/src/generated.pyx":6875
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def group_count_bin_int64(ndarray[float64_t, ndim=2] out,             # <<<<<<<<<<<<<<
 *                              ndarray[int64_t] counts,
 *                              ndarray[int64_t, ndim=2] values,
 */
  __pyx_tuple__674 = PyTuple_Pack(12, __pyx_n_s_out, __pyx_n_s_counts, __pyx_n_s_values, __pyx_n_s_bins, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_ngroups, __pyx_n_s_N, __pyx_n_s_K, __pyx_n_s_b, __pyx_n_s_val, __pyx_n_s_nobs); if (unlikely(!__pyx_tuple__674)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6875; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__674);
  __Pyx_GIVEREF(__pyx_tuple__674);
  __pyx_codeobj__675 = (PyObject*)__Pyx_PyCode_New(4, 0, 12, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__674, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_group_count_bin_int64, 6875, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__675)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6875; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/src/generated.pyx":6910
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def left_join_indexer_unique_float64(ndarray[float64_t] left,             # <<<<<<<<<<<<<<
 *                                       ndarray[float64_t] right):
 *     cdef:
 */
  __pyx_tuple__676 = PyTuple_Pack(9, __pyx_n_s_left, __pyx_n_s_right, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_nleft, __pyx_n_s_nright, __pyx_n_s_indexer, __pyx_n_s_lval, __pyx_n_s_rval); if (unlikely(!__pyx_tuple__676)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6910; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__676);
  __Pyx_GIVEREF(__pyx_tuple__676);
  __pyx_codeobj__677 = (PyObject*)__Pyx_PyCode_New(2, 0, 9, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__676, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_left_join_indexer_unique_float64, 6910, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__677)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6910; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/src/generated.pyx":6955
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def left_join_indexer_unique_float32(ndarray[float32_t] left,             # <<<<<<<<<<<<<<
 *                                       ndarray[float32_t] right):
 *     cdef:
 */
  __pyx_tuple__678 = PyTuple_Pack(9, __pyx_n_s_left, __pyx_n_s_right, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_nleft, __pyx_n_s_nright, __pyx_n_s_indexer, __pyx_n_s_lval, __pyx_n_s_rval); if (unlikely(!__pyx_tuple__678)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6955; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__678);
  __Pyx_GIVEREF(__pyx_tuple__678);
  __pyx_codeobj__679 = (PyObject*)__Pyx_PyCode_New(2, 0, 9, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__678, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_left_join_indexer_unique_float32, 6955, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__679)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6955; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/src/generated.pyx":7000
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def left_join_indexer_unique_object(ndarray[object] left,             # <<<<<<<<<<<<<<
 *                                       ndarray[object] right):
 *     cdef:
 */
  __pyx_tuple__680 = PyTuple_Pack(9, __pyx_n_s_left, __pyx_n_s_right, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_nleft, __pyx_n_s_nright, __pyx_n_s_indexer, __pyx_n_s_lval, __pyx_n_s_rval); if (unlikely(!__pyx_tuple__680)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7000; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__680);
  __Pyx_GIVEREF(__pyx_tuple__680);
  __pyx_codeobj__681 = (PyObject*)__Pyx_PyCode_New(2, 0, 9, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__680, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_left_join_indexer_unique_object, 7000, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__681)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7000; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/src/generated.pyx":7045
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def left_join_indexer_unique_int32(ndarray[int32_t] left,             # <<<<<<<<<<<<<<
 *                                       ndarray[int32_t] right):
 *     cdef:
 */
  __pyx_tuple__682 = PyTuple_Pack(9, __pyx_n_s_left, __pyx_n_s_right, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_nleft, __pyx_n_s_nright, __pyx_n_s_indexer, __pyx_n_s_lval, __pyx_n_s_rval); if (unlikely(!__pyx_tuple__682)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7045; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__682);
  __Pyx_GIVEREF(__pyx_tuple__682);
  __pyx_codeobj__683 = (PyObject*)__Pyx_PyCode_New(2, 0, 9, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__682, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_left_join_indexer_unique_int32, 7045, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__683)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7045; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/src/generated.pyx":7090
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def left_join_indexer_unique_int64(ndarray[int64_t] left,             # <<<<<<<<<<<<<<
 *                                       ndarray[int64_t] right):
 *     cdef:
 */
  __pyx_tuple__684 = PyTuple_Pack(9, __pyx_n_s_left, __pyx_n_s_right, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_nleft, __pyx_n_s_nright, __pyx_n_s_indexer, __pyx_n_s_lval, __pyx_n_s_rval); if (unlikely(!__pyx_tuple__684)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7090; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__684);
  __Pyx_GIVEREF(__pyx_tuple__684);
  __pyx_codeobj__685 = (PyObject*)__Pyx_PyCode_New(2, 0, 9, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__684, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_left_join_indexer_unique_int64, 7090, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__685)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7090; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/src/generated.pyx":7135
 * 
 * 
 * def left_join_indexer_float64(ndarray[float64_t] left,             # <<<<<<<<<<<<<<
 *                               ndarray[float64_t] right):
 *     '''
 */
  __pyx_tuple__686 = PyTuple_Pack(13, __pyx_n_s_left, __pyx_n_s_right, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_k, __pyx_n_s_nright, __pyx_n_s_nleft, __pyx_n_s_count, __pyx_n_s_lval, __pyx_n_s_rval, __pyx_n_s_lindexer, __pyx_n_s_rindexer, __pyx_n_s_result); if (unlikely(!__pyx_tuple__686)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7135; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__686);
  __Pyx_GIVEREF(__pyx_tuple__686);
  __pyx_codeobj__687 = (PyObject*)__Pyx_PyCode_New(2, 0, 13, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__686, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_left_join_indexer_float64, 7135, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__687)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7135; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/src/generated.pyx":7237
 * 
 * 
 * def left_join_indexer_float32(ndarray[float32_t] left,             # <<<<<<<<<<<<<<
 *                               ndarray[float32_t] right):
 *     '''
 */
  __pyx_tuple__688 = PyTuple_Pack(13, __pyx_n_s_left, __pyx_n_s_right, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_k, __pyx_n_s_nright, __pyx_n_s_nleft, __pyx_n_s_count, __pyx_n_s_lval, __pyx_n_s_rval, __pyx_n_s_lindexer, __pyx_n_s_rindexer, __pyx_n_s_result); if (unlikely(!__pyx_tuple__688)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7237; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__688);
  __Pyx_GIVEREF(__pyx_tuple__688);
  __pyx_codeobj__689 = (PyObject*)__Pyx_PyCode_New(2, 0, 13, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__688, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_left_join_indexer_float32, 7237, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__689)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7237; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/src/generated.pyx":7339
 * 
 * 
 * def left_join_indexer_object(ndarray[object] left,             # <<<<<<<<<<<<<<
 *                               ndarray[object] right):
 *     '''
 */
  __pyx_tuple__690 = PyTuple_Pack(13, __pyx_n_s_left, __pyx_n_s_right, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_k, __pyx_n_s_nright, __pyx_n_s_nleft, __pyx_n_s_count, __pyx_n_s_lval, __pyx_n_s_rval, __pyx_n_s_lindexer, __pyx_n_s_rindexer, __pyx_n_s_result); if (unlikely(!__pyx_tuple__690)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7339; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__690);
  __Pyx_GIVEREF(__pyx_tuple__690);
  __pyx_codeobj__691 = (PyObject*)__Pyx_PyCode_New(2, 0, 13, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__690, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_left_join_indexer_object, 7339, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__691)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7339; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/src/generated.pyx":7441
 * 
 * 
 * def left_join_indexer_int32(ndarray[int32_t] left,             # <<<<<<<<<<<<<<
 *                               ndarray[int32_t] right):
 *     '''
 */
  __pyx_tuple__692 = PyTuple_Pack(13, __pyx_n_s_left, __pyx_n_s_right, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_k, __pyx_n_s_nright, __pyx_n_s_nleft, __pyx_n_s_count, __pyx_n_s_lval, __pyx_n_s_rval, __pyx_n_s_lindexer, __pyx_n_s_rindexer, __pyx_n_s_result); if (unlikely(!__pyx_tuple__692)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7441; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__692);
  __Pyx_GIVEREF(__pyx_tuple__692);
  __pyx_codeobj__693 = (PyObject*)__Pyx_PyCode_New(2, 0, 13, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__692, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_left_join_indexer_int32, 7441, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__693)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7441; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/src/generated.pyx":7543
 * 
 * 
 * def left_join_indexer_int64(ndarray[int64_t] left,             # <<<<<<<<<<<<<<
 *                               ndarray[int64_t] right):
 *     '''
 */
  __pyx_tuple__694 = PyTuple_Pack(13, __pyx_n_s_left, __pyx_n_s_right, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_k, __pyx_n_s_nright, __pyx_n_s_nleft, __pyx_n_s_count, __pyx_n_s_lval, __pyx_n_s_rval, __pyx_n_s_lindexer, __pyx_n_s_rindexer, __pyx_n_s_result); if (unlikely(!__pyx_tuple__694)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7543; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__694);
  __Pyx_GIVEREF(__pyx_tuple__694);
  __pyx_codeobj__695 = (PyObject*)__Pyx_PyCode_New(2, 0, 13, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__694, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_left_join_indexer_int64, 7543, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__695)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7543; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/src/generated.pyx":7647
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def outer_join_indexer_float64(ndarray[float64_t] left,             # <<<<<<<<<<<<<<
 *                                 ndarray[float64_t] right):
 *     cdef:
 */
  __pyx_tuple__696 = PyTuple_Pack(12, __pyx_n_s_left, __pyx_n_s_right, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_nright, __pyx_n_s_nleft, __pyx_n_s_count, __pyx_n_s_lval, __pyx_n_s_rval, __pyx_n_s_lindexer, __pyx_n_s_rindexer, __pyx_n_s_result); if (unlikely(!__pyx_tuple__696)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7647; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__696);
  __Pyx_GIVEREF(__pyx_tuple__696);
  __pyx_codeobj__697 = (PyObject*)__Pyx_PyCode_New(2, 0, 12, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__696, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_outer_join_indexer_float64, 7647, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__697)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7647; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/src/generated.pyx":7776
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def outer_join_indexer_float32(ndarray[float32_t] left,             # <<<<<<<<<<<<<<
 *                                 ndarray[float32_t] right):
 *     cdef:
 */
  __pyx_tuple__698 = PyTuple_Pack(12, __pyx_n_s_left, __pyx_n_s_right, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_nright, __pyx_n_s_nleft, __pyx_n_s_count, __pyx_n_s_lval, __pyx_n_s_rval, __pyx_n_s_lindexer, __pyx_n_s_rindexer, __pyx_n_s_result); if (unlikely(!__pyx_tuple__698)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7776; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__698);
  __Pyx_GIVEREF(__pyx_tuple__698);
  __pyx_codeobj__699 = (PyObject*)__Pyx_PyCode_New(2, 0, 12, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__698, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_outer_join_indexer_float32, 7776, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__699)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7776; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/src/generated.pyx":7905
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def outer_join_indexer_object(ndarray[object] left,             # <<<<<<<<<<<<<<
 *                                 ndarray[object] right):
 *     cdef:
 */
  __pyx_tuple__700 = PyTuple_Pack(12, __pyx_n_s_left, __pyx_n_s_right, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_nright, __pyx_n_s_nleft, __pyx_n_s_count, __pyx_n_s_lval, __pyx_n_s_rval, __pyx_n_s_lindexer, __pyx_n_s_rindexer, __pyx_n_s_result); if (unlikely(!__pyx_tuple__700)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7905; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__700);
  __Pyx_GIVEREF(__pyx_tuple__700);
  __pyx_codeobj__701 = (PyObject*)__Pyx_PyCode_New(2, 0, 12, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__700, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_outer_join_indexer_object, 7905, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__701)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7905; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/src/generated.pyx":8034
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def outer_join_indexer_int32(ndarray[int32_t] left,             # <<<<<<<<<<<<<<
 *                                 ndarray[int32_t] right):
 *     cdef:
 */
  __pyx_tuple__702 = PyTuple_Pack(12, __pyx_n_s_left, __pyx_n_s_right, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_nright, __pyx_n_s_nleft, __pyx_n_s_count, __pyx_n_s_lval, __pyx_n_s_rval, __pyx_n_s_lindexer, __pyx_n_s_rindexer, __pyx_n_s_result); if (unlikely(!__pyx_tuple__702)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8034; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__702);
  __Pyx_GIVEREF(__pyx_tuple__702);
  __pyx_codeobj__703 = (PyObject*)__Pyx_PyCode_New(2, 0, 12, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__702, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_outer_join_indexer_int32, 8034, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__703)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8034; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/src/generated.pyx":8163
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def outer_join_indexer_int64(ndarray[int64_t] left,             # <<<<<<<<<<<<<<
 *                                 ndarray[int64_t] right):
 *     cdef:
 */
  __pyx_tuple__704 = PyTuple_Pack(12, __pyx_n_s_left, __pyx_n_s_right, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_nright, __pyx_n_s_nleft, __pyx_n_s_count, __pyx_n_s_lval, __pyx_n_s_rval, __pyx_n_s_lindexer, __pyx_n_s_rindexer, __pyx_n_s_result); if (unlikely(!__pyx_tuple__704)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8163; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__704);
  __Pyx_GIVEREF(__pyx_tuple__704);
  __pyx_codeobj__705 = (PyObject*)__Pyx_PyCode_New(2, 0, 12, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__704, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_outer_join_indexer_int64, 8163, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__705)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8163; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/src/generated.pyx":8293
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def inner_join_indexer_float64(ndarray[float64_t] left,             # <<<<<<<<<<<<<<
 *                               ndarray[float64_t] right):
 *     '''
 */
  __pyx_tuple__706 = PyTuple_Pack(13, __pyx_n_s_left, __pyx_n_s_right, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_k, __pyx_n_s_nright, __pyx_n_s_nleft, __pyx_n_s_count, __pyx_n_s_lval, __pyx_n_s_rval, __pyx_n_s_lindexer, __pyx_n_s_rindexer, __pyx_n_s_result); if (unlikely(!__pyx_tuple__706)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8293; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__706);
  __Pyx_GIVEREF(__pyx_tuple__706);
  __pyx_codeobj__707 = (PyObject*)__Pyx_PyCode_New(2, 0, 13, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__706, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_inner_join_indexer_float64, 8293, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__707)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8293; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/src/generated.pyx":8386
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def inner_join_indexer_float32(ndarray[float32_t] left,             # <<<<<<<<<<<<<<
 *                               ndarray[float32_t] right):
 *     '''
 */
  __pyx_tuple__708 = PyTuple_Pack(13, __pyx_n_s_left, __pyx_n_s_right, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_k, __pyx_n_s_nright, __pyx_n_s_nleft, __pyx_n_s_count, __pyx_n_s_lval, __pyx_n_s_rval, __pyx_n_s_lindexer, __pyx_n_s_rindexer, __pyx_n_s_result); if (unlikely(!__pyx_tuple__708)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8386; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__708);
  __Pyx_GIVEREF(__pyx_tuple__708);
  __pyx_codeobj__709 = (PyObject*)__Pyx_PyCode_New(2, 0, 13, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__708, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_inner_join_indexer_float32, 8386, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__709)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8386; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/src/generated.pyx":8479
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def inner_join_indexer_object(ndarray[object] left,             # <<<<<<<<<<<<<<
 *                               ndarray[object] right):
 *     '''
 */
  __pyx_tuple__710 = PyTuple_Pack(13, __pyx_n_s_left, __pyx_n_s_right, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_k, __pyx_n_s_nright, __pyx_n_s_nleft, __pyx_n_s_count, __pyx_n_s_lval, __pyx_n_s_rval, __pyx_n_s_lindexer, __pyx_n_s_rindexer, __pyx_n_s_result); if (unlikely(!__pyx_tuple__710)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8479; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__710);
  __Pyx_GIVEREF(__pyx_tuple__710);
  __pyx_codeobj__711 = (PyObject*)__Pyx_PyCode_New(2, 0, 13, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__710, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_inner_join_indexer_object, 8479, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__711)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8479; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/src/generated.pyx":8572
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def inner_join_indexer_int32(ndarray[int32_t] left,             # <<<<<<<<<<<<<<
 *                               ndarray[int32_t] right):
 *     '''
 */
  __pyx_tuple__712 = PyTuple_Pack(13, __pyx_n_s_left, __pyx_n_s_right, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_k, __pyx_n_s_nright, __pyx_n_s_nleft, __pyx_n_s_count, __pyx_n_s_lval, __pyx_n_s_rval, __pyx_n_s_lindexer, __pyx_n_s_rindexer, __pyx_n_s_result); if (unlikely(!__pyx_tuple__712)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8572; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__712);
  __Pyx_GIVEREF(__pyx_tuple__712);
  __pyx_codeobj__713 = (PyObject*)__Pyx_PyCode_New(2, 0, 13, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__712, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_inner_join_indexer_int32, 8572, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__713)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8572; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/src/generated.pyx":8665
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def inner_join_indexer_int64(ndarray[int64_t] left,             # <<<<<<<<<<<<<<
 *                               ndarray[int64_t] right):
 *     '''
 */
  __pyx_tuple__714 = PyTuple_Pack(13, __pyx_n_s_left, __pyx_n_s_right, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_k, __pyx_n_s_nright, __pyx_n_s_nleft, __pyx_n_s_count, __pyx_n_s_lval, __pyx_n_s_rval, __pyx_n_s_lindexer, __pyx_n_s_rindexer, __pyx_n_s_result); if (unlikely(!__pyx_tuple__714)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8665; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__714);
  __Pyx_GIVEREF(__pyx_tuple__714);
  __pyx_codeobj__715 = (PyObject*)__Pyx_PyCode_New(2, 0, 13, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__714, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_inner_join_indexer_int64, 8665, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__715)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8665; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "View.MemoryView":276
 *         return self.name
 * 
 * cdef generic = Enum("<strided and direct or indirect>")             # <<<<<<<<<<<<<<
 * cdef strided = Enum("<strided and direct>") # default
 * cdef indirect = Enum("<strided and indirect>")
 */
  __pyx_tuple__716 = PyTuple_Pack(1, __pyx_kp_s_strided_and_direct_or_indirect); if (unlikely(!__pyx_tuple__716)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 276; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__716);
  __Pyx_GIVEREF(__pyx_tuple__716);

  /* "View.MemoryView":277
 * 
 * cdef generic = Enum("<strided and direct or indirect>")
 * cdef strided = Enum("<strided and direct>") # default             # <<<<<<<<<<<<<<
 * cdef indirect = Enum("<strided and indirect>")
 * 
 */
  __pyx_tuple__717 = PyTuple_Pack(1, __pyx_kp_s_strided_and_direct); if (unlikely(!__pyx_tuple__717)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 277; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__717);
  __Pyx_GIVEREF(__pyx_tuple__717);

  /* "View.MemoryView":278
 * cdef generic = Enum("<strided and direct or indirect>")
 * cdef strided = Enum("<strided and direct>") # default
 * cdef indirect = Enum("<strided and indirect>")             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_tuple__718 = PyTuple_Pack(1, __pyx_kp_s_strided_and_indirect); if (unlikely(!__pyx_tuple__718)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 278; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__718);
  __Pyx_GIVEREF(__pyx_tuple__718);

  /* "View.MemoryView":281
 * 
 * 
 * cdef contiguous = Enum("<contiguous and direct>")             # <<<<<<<<<<<<<<
 * cdef indirect_contiguous = Enum("<contiguous and indirect>")
 * 
 */
  __pyx_tuple__719 = PyTuple_Pack(1, __pyx_kp_s_contiguous_and_direct); if (unlikely(!__pyx_tuple__719)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 281; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__719);
  __Pyx_GIVEREF(__pyx_tuple__719);

  /* "View.MemoryView":282
 * 
 * cdef contiguous = Enum("<contiguous and direct>")
 * cdef indirect_contiguous = Enum("<contiguous and indirect>")             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_tuple__720 = PyTuple_Pack(1, __pyx_kp_s_contiguous_and_indirect); if (unlikely(!__pyx_tuple__720)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 282; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__720);
  __Pyx_GIVEREF(__pyx_tuple__720);
  __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[0]; __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[0]; __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[0]; __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[0]; __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[0]; __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[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_int_105 = PyInt_FromLong(105); if (unlikely(!__pyx_int_105)) {__pyx_filename = __pyx_f[0]; __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[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  return 0;
  __pyx_L1_error:;
  return -1;
}

#if PY_MAJOR_VERSION < 3
PyMODINIT_FUNC initalgos(void); /*proto*/
PyMODINIT_FUNC initalgos(void)
#else
PyMODINIT_FUNC PyInit_algos(void); /*proto*/
PyMODINIT_FUNC PyInit_algos(void)
#endif
{
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  __pyx_t_5numpy_int8_t __pyx_t_4;
  __pyx_t_5numpy_int16_t __pyx_t_5;
  __pyx_t_5numpy_int32_t __pyx_t_6;
  __pyx_t_5numpy_int64_t __pyx_t_7;
  __pyx_t_5numpy_float16_t __pyx_t_8;
  __pyx_t_5numpy_float32_t __pyx_t_9;
  __pyx_t_5numpy_float64_t __pyx_t_10;
  double __pyx_t_11;
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  PyObject *__pyx_t_14 = NULL;
  PyObject *__pyx_t_15 = NULL;
  PyObject *__pyx_t_16 = NULL;
  int __pyx_t_17;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __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_algos(void)", 0);
  if ( __Pyx_check_binary_version() < 0) {__pyx_filename = __pyx_f[0]; __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[0]; __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[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  #ifdef __Pyx_CyFunction_USED
  if (__Pyx_CyFunction_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  #endif
  #ifdef __Pyx_FusedFunction_USED
  if (__pyx_FusedFunction_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  #endif
  #ifdef __Pyx_Generator_USED
  if (__pyx_Generator_init() < 0) {__pyx_filename = __pyx_f[0]; __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("algos"), __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m);
  #else
  __pyx_m = PyModule_Create(&__pyx_moduledef);
  #endif
  if (unlikely(!__pyx_m)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  Py_INCREF(__pyx_d);
  __pyx_b = PyImport_AddModule(__Pyx_NAMESTR(__Pyx_BUILTIN_MODULE_NAME)); if (unlikely(!__pyx_b)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  #if CYTHON_COMPILING_IN_PYPY
  Py_INCREF(__pyx_b);
  #endif
  if (__Pyx_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  /*--- Initialize various global constants etc. ---*/
  if (unlikely(__Pyx_InitGlobals() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT)
  if (__Pyx_init_sys_getdefaultencoding_params() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  #endif
  if (__pyx_module_is_main_pandas__algos) {
    if (__Pyx_SetAttrString(__pyx_m, "__name__", __pyx_n_s_main) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  }
  #if PY_MAJOR_VERSION >= 3
  {
    PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    if (!PyDict_GetItemString(modules, "pandas.algos")) {
      if (unlikely(PyDict_SetItemString(modules, "pandas.algos", __pyx_m) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
  }
  #endif
  /*--- Builtin init code ---*/
  if (unlikely(__Pyx_InitCachedBuiltins() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  /*--- Constants init code ---*/
  if (unlikely(__Pyx_InitCachedConstants() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  /*--- Global init code ---*/
  generic = Py_None; Py_INCREF(Py_None);
  strided = Py_None; Py_INCREF(Py_None);
  indirect = Py_None; Py_INCREF(Py_None);
  contiguous = Py_None; Py_INCREF(Py_None);
  indirect_contiguous = Py_None; Py_INCREF(Py_None);
  /*--- Variable export code ---*/
  /*--- Function export code ---*/
  /*--- Type init code ---*/
  if (PyType_Ready(&__pyx_type_6pandas_5algos_Node) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 32; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_type_6pandas_5algos_Node.tp_print = 0;
  if (__Pyx_SetAttrString(__pyx_m, "Node", (PyObject *)&__pyx_type_6pandas_5algos_Node) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 32; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_6pandas_5algos_Node = &__pyx_type_6pandas_5algos_Node;
  __pyx_vtabptr_6pandas_5algos_IndexableSkiplist = &__pyx_vtable_6pandas_5algos_IndexableSkiplist;
  __pyx_vtable_6pandas_5algos_IndexableSkiplist.get = (PyObject *(*)(struct __pyx_obj_6pandas_5algos_IndexableSkiplist *, Py_ssize_t, int __pyx_skip_dispatch))__pyx_f_6pandas_5algos_17IndexableSkiplist_get;
  __pyx_vtable_6pandas_5algos_IndexableSkiplist.insert = (PyObject *(*)(struct __pyx_obj_6pandas_5algos_IndexableSkiplist *, double, int __pyx_skip_dispatch))__pyx_f_6pandas_5algos_17IndexableSkiplist_insert;
  __pyx_vtable_6pandas_5algos_IndexableSkiplist.remove = (PyObject *(*)(struct __pyx_obj_6pandas_5algos_IndexableSkiplist *, double, int __pyx_skip_dispatch))__pyx_f_6pandas_5algos_17IndexableSkiplist_remove;
  if (PyType_Ready(&__pyx_type_6pandas_5algos_IndexableSkiplist) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 46; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_type_6pandas_5algos_IndexableSkiplist.tp_print = 0;
  if (__Pyx_SetVtable(__pyx_type_6pandas_5algos_IndexableSkiplist.tp_dict, __pyx_vtabptr_6pandas_5algos_IndexableSkiplist) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 46; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__Pyx_SetAttrString(__pyx_m, "IndexableSkiplist", (PyObject *)&__pyx_type_6pandas_5algos_IndexableSkiplist) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 46; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_6pandas_5algos_IndexableSkiplist = &__pyx_type_6pandas_5algos_IndexableSkiplist;
  if (PyType_Ready(&__pyx_type___pyx_array) < 0) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 99; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_type___pyx_array.tp_print = 0;
  __pyx_array_type = &__pyx_type___pyx_array;
  if (PyType_Ready(&__pyx_type___pyx_MemviewEnum) < 0) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 269; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_type___pyx_MemviewEnum.tp_print = 0;
  __pyx_MemviewEnum_type = &__pyx_type___pyx_MemviewEnum;
  __pyx_vtabptr_memoryview = &__pyx_vtable_memoryview;
  __pyx_vtable_memoryview.get_item_pointer = (char *(*)(struct __pyx_memoryview_obj *, PyObject *))__pyx_memoryview_get_item_pointer;
  __pyx_vtable_memoryview.is_slice = (PyObject *(*)(struct __pyx_memoryview_obj *, PyObject *))__pyx_memoryview_is_slice;
  __pyx_vtable_memoryview.setitem_slice_assignment = (PyObject *(*)(struct __pyx_memoryview_obj *, PyObject *, PyObject *))__pyx_memoryview_setitem_slice_assignment;
  __pyx_vtable_memoryview.setitem_slice_assign_scalar = (PyObject *(*)(struct __pyx_memoryview_obj *, struct __pyx_memoryview_obj *, PyObject *))__pyx_memoryview_setitem_slice_assign_scalar;
  __pyx_vtable_memoryview.setitem_indexed = (PyObject *(*)(struct __pyx_memoryview_obj *, PyObject *, PyObject *))__pyx_memoryview_setitem_indexed;
  __pyx_vtable_memoryview.convert_item_to_object = (PyObject *(*)(struct __pyx_memoryview_obj *, char *))__pyx_memoryview_convert_item_to_object;
  __pyx_vtable_memoryview.assign_item_from_object = (PyObject *(*)(struct __pyx_memoryview_obj *, char *, PyObject *))__pyx_memoryview_assign_item_from_object;
  if (PyType_Ready(&__pyx_type___pyx_memoryview) < 0) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 302; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_type___pyx_memoryview.tp_print = 0;
  if (__Pyx_SetVtable(__pyx_type___pyx_memoryview.tp_dict, __pyx_vtabptr_memoryview) < 0) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 302; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_memoryview_type = &__pyx_type___pyx_memoryview;
  __pyx_vtabptr__memoryviewslice = &__pyx_vtable__memoryviewslice;
  __pyx_vtable__memoryviewslice.__pyx_base = *__pyx_vtabptr_memoryview;
  __pyx_vtable__memoryviewslice.__pyx_base.convert_item_to_object = (PyObject *(*)(struct __pyx_memoryview_obj *, char *))__pyx_memoryviewslice_convert_item_to_object;
  __pyx_vtable__memoryviewslice.__pyx_base.assign_item_from_object = (PyObject *(*)(struct __pyx_memoryview_obj *, char *, PyObject *))__pyx_memoryviewslice_assign_item_from_object;
  __pyx_type___pyx_memoryviewslice.tp_base = __pyx_memoryview_type;
  if (PyType_Ready(&__pyx_type___pyx_memoryviewslice) < 0) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 922; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_type___pyx_memoryviewslice.tp_print = 0;
  if (__Pyx_SetVtable(__pyx_type___pyx_memoryviewslice.tp_dict, __pyx_vtabptr__memoryviewslice) < 0) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 922; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_memoryviewslice_type = &__pyx_type___pyx_memoryviewslice;
  /*--- 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[5]; __pyx_lineno = 157; __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[5]; __pyx_lineno = 167; __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[5]; __pyx_lineno = 171; __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[5]; __pyx_lineno = 180; __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[5]; __pyx_lineno = 865; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_7cpython_4type_type = __Pyx_ImportType(__Pyx_BUILTIN_MODULE_NAME, "type", 
  #if CYTHON_COMPILING_IN_PYPY
  sizeof(PyTypeObject),
  #else
  sizeof(PyHeapTypeObject),
  #endif
  0); if (unlikely(!__pyx_ptype_7cpython_4type_type)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 9; __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[9]; __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[10]; __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[4]; __pyx_lineno = 15; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_8datetime_datetime = __Pyx_ImportType("datetime", "datetime", sizeof(PyDateTime_DateTime), 0); if (unlikely(!__pyx_ptype_8datetime_datetime)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 18; __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[4]; __pyx_lineno = 21; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  /*--- Variable import code ---*/
  /*--- Function import code ---*/
  /*--- Execution code ---*/

  /* "pandas/algos.pyx":3
 * from numpy cimport *
 * cimport numpy as np
 * import numpy as np             # <<<<<<<<<<<<<<
 * 
 * cimport cython
 */
  __pyx_t_1 = __Pyx_Import(__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 (PyDict_SetItem(__pyx_d, __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;

  /* "pandas/algos.pyx":7
 * cimport cython
 * 
 * import_array()             # <<<<<<<<<<<<<<
 * 
 * cdef float64_t FP_ERR = 1e-13
 */
  import_array();

  /* "pandas/algos.pyx":9
 * import_array()
 * 
 * cdef float64_t FP_ERR = 1e-13             # <<<<<<<<<<<<<<
 * cdef float64_t REL_TOL = 1e-07
 * 
 */
  __pyx_v_6pandas_5algos_FP_ERR = 1e-13;

  /* "pandas/algos.pyx":10
 * 
 * cdef float64_t FP_ERR = 1e-13
 * cdef float64_t REL_TOL = 1e-07             # <<<<<<<<<<<<<<
 * 
 * cimport util
 */
  __pyx_v_6pandas_5algos_REL_TOL = 1e-07;

  /* "pandas/algos.pyx":27
 *                     uint32_t, uint64_t, float16_t, float32_t, float64_t)
 * 
 * int8 = np.dtype(np.int8)             # <<<<<<<<<<<<<<
 * int16 = np.dtype(np.int16)
 * int32 = np.dtype(np.int32)
 */
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 27; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_int8); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 27; __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[0]; __pyx_lineno = 27; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__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 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_5numpy_dtype)), __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 27; __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_d, __pyx_n_s_int8, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 27; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pandas/algos.pyx":28
 * 
 * int8 = np.dtype(np.int8)
 * int16 = np.dtype(np.int16)             # <<<<<<<<<<<<<<
 * int32 = np.dtype(np.int32)
 * int64 = np.dtype(np.int64)
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 28; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_int16); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 28; __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[0]; __pyx_lineno = 28; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__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 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_5numpy_dtype)), __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 28; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_int16, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 28; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pandas/algos.pyx":29
 * int8 = np.dtype(np.int8)
 * int16 = np.dtype(np.int16)
 * int32 = np.dtype(np.int32)             # <<<<<<<<<<<<<<
 * int64 = np.dtype(np.int64)
 * float16 = np.dtype(np.float16)
 */
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 29; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_int32); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 29; __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[0]; __pyx_lineno = 29; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__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 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_5numpy_dtype)), __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 29; __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_d, __pyx_n_s_int32, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 29; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pandas/algos.pyx":30
 * int16 = np.dtype(np.int16)
 * int32 = np.dtype(np.int32)
 * int64 = np.dtype(np.int64)             # <<<<<<<<<<<<<<
 * float16 = np.dtype(np.float16)
 * float32 = np.dtype(np.float32)
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 30; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_int64); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 30; __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[0]; __pyx_lineno = 30; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__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 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_5numpy_dtype)), __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 30; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_int64, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 30; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pandas/algos.pyx":31
 * int32 = np.dtype(np.int32)
 * int64 = np.dtype(np.int64)
 * float16 = np.dtype(np.float16)             # <<<<<<<<<<<<<<
 * float32 = np.dtype(np.float32)
 * float64 = np.dtype(np.float64)
 */
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 31; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_float16); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 31; __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[0]; __pyx_lineno = 31; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__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 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_5numpy_dtype)), __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 31; __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_d, __pyx_n_s_float16, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 31; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pandas/algos.pyx":32
 * int64 = np.dtype(np.int64)
 * float16 = np.dtype(np.float16)
 * float32 = np.dtype(np.float32)             # <<<<<<<<<<<<<<
 * float64 = np.dtype(np.float64)
 * 
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 32; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_float32); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 32; __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[0]; __pyx_lineno = 32; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__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 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_5numpy_dtype)), __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 32; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_float32, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 32; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pandas/algos.pyx":33
 * float16 = np.dtype(np.float16)
 * float32 = np.dtype(np.float32)
 * float64 = np.dtype(np.float64)             # <<<<<<<<<<<<<<
 * 
 * cdef np.int8_t MINint8 = np.iinfo(np.int8).min
 */
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 33; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_float64); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __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 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 33; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__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 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_5numpy_dtype)), __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 33; __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_d, __pyx_n_s_float64, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 33; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pandas/algos.pyx":35
 * float64 = np.dtype(np.float64)
 * 
 * cdef np.int8_t MINint8 = np.iinfo(np.int8).min             # <<<<<<<<<<<<<<
 * cdef np.int16_t MINint16 = np.iinfo(np.int16).min
 * cdef np.int32_t MINint32 = np.iinfo(np.int32).min
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_iinfo); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 35; __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_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_int8); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 35; __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 = 35; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__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 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 35; __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_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_min); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_4 = __Pyx_PyInt_As_npy_int8(__pyx_t_2); if (unlikely((__pyx_t_4 == (npy_int8)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_6pandas_5algos_MINint8 = __pyx_t_4;

  /* "pandas/algos.pyx":36
 * 
 * cdef np.int8_t MINint8 = np.iinfo(np.int8).min
 * cdef np.int16_t MINint16 = np.iinfo(np.int16).min             # <<<<<<<<<<<<<<
 * cdef np.int32_t MINint32 = np.iinfo(np.int32).min
 * cdef np.int64_t MINint64 = np.iinfo(np.int64).min
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 36; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_iinfo); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 36; __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_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 36; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_int16); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 36; __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[0]; __pyx_lineno = 36; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__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 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 36; __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_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_min); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 36; __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_PyInt_As_npy_int16(__pyx_t_2); if (unlikely((__pyx_t_5 == (npy_int16)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 36; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_6pandas_5algos_MINint16 = __pyx_t_5;

  /* "pandas/algos.pyx":37
 * cdef np.int8_t MINint8 = np.iinfo(np.int8).min
 * cdef np.int16_t MINint16 = np.iinfo(np.int16).min
 * cdef np.int32_t MINint32 = np.iinfo(np.int32).min             # <<<<<<<<<<<<<<
 * cdef np.int64_t MINint64 = np.iinfo(np.int64).min
 * cdef np.float16_t MINfloat16 = np.NINF
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 37; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_iinfo); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 37; __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_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 37; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_int32); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 37; __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 = 37; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__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 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 37; __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_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_min); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 37; __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_PyInt_As_npy_int32(__pyx_t_2); if (unlikely((__pyx_t_6 == (npy_int32)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 37; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_6pandas_5algos_MINint32 = __pyx_t_6;

  /* "pandas/algos.pyx":38
 * cdef np.int16_t MINint16 = np.iinfo(np.int16).min
 * cdef np.int32_t MINint32 = np.iinfo(np.int32).min
 * cdef np.int64_t MINint64 = np.iinfo(np.int64).min             # <<<<<<<<<<<<<<
 * cdef np.float16_t MINfloat16 = np.NINF
 * cdef np.float32_t MINfloat32 = np.NINF
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__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 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_iinfo); 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 = __Pyx_GetModuleGlobalName(__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_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_int64); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 38; __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[0]; __pyx_lineno = 38; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__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 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 38; __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_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_min); 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_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_7 = __Pyx_PyInt_As_npy_int64(__pyx_t_2); if (unlikely((__pyx_t_7 == (npy_int64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 38; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_6pandas_5algos_MINint64 = __pyx_t_7;

  /* "pandas/algos.pyx":39
 * cdef np.int32_t MINint32 = np.iinfo(np.int32).min
 * cdef np.int64_t MINint64 = np.iinfo(np.int64).min
 * cdef np.float16_t MINfloat16 = np.NINF             # <<<<<<<<<<<<<<
 * cdef np.float32_t MINfloat32 = np.NINF
 * cdef np.float64_t MINfloat64 = np.NINF
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 39; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_NINF); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 39; __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_AsFloat(__pyx_t_1); if (unlikely((__pyx_t_8 == (npy_float16)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 39; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_6pandas_5algos_MINfloat16 = __pyx_t_8;

  /* "pandas/algos.pyx":40
 * cdef np.int64_t MINint64 = np.iinfo(np.int64).min
 * cdef np.float16_t MINfloat16 = np.NINF
 * cdef np.float32_t MINfloat32 = np.NINF             # <<<<<<<<<<<<<<
 * cdef np.float64_t MINfloat64 = np.NINF
 * 
 */
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 40; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_NINF); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 40; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_9 = __pyx_PyFloat_AsFloat(__pyx_t_2); if (unlikely((__pyx_t_9 == (npy_float32)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 40; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_6pandas_5algos_MINfloat32 = __pyx_t_9;

  /* "pandas/algos.pyx":41
 * cdef np.float16_t MINfloat16 = np.NINF
 * cdef np.float32_t MINfloat32 = np.NINF
 * cdef np.float64_t MINfloat64 = np.NINF             # <<<<<<<<<<<<<<
 * 
 * cdef np.int8_t MAXint8 = np.iinfo(np.int8).max
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); 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_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_NINF); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_10 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_10 == (npy_float64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_6pandas_5algos_MINfloat64 = __pyx_t_10;

  /* "pandas/algos.pyx":43
 * cdef np.float64_t MINfloat64 = np.NINF
 * 
 * cdef np.int8_t MAXint8 = np.iinfo(np.int8).max             # <<<<<<<<<<<<<<
 * cdef np.int16_t MAXint16 = np.iinfo(np.int16).max
 * cdef np.int32_t MAXint32 = np.iinfo(np.int32).max
 */
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 43; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_iinfo); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __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_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 43; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_int8); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 43; __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[0]; __pyx_lineno = 43; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__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 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 43; __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;
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_max); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 43; __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_As_npy_int8(__pyx_t_1); if (unlikely((__pyx_t_4 == (npy_int8)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 43; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_6pandas_5algos_MAXint8 = __pyx_t_4;

  /* "pandas/algos.pyx":44
 * 
 * cdef np.int8_t MAXint8 = np.iinfo(np.int8).max
 * cdef np.int16_t MAXint16 = np.iinfo(np.int16).max             # <<<<<<<<<<<<<<
 * cdef np.int32_t MAXint32 = np.iinfo(np.int32).max
 * cdef np.int64_t MAXint64 = np.iinfo(np.int64).max
 */
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 44; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_iinfo); 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);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 44; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_int16); 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_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 = 44; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__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 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_1, NULL); 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_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_max); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 44; __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_As_npy_int16(__pyx_t_1); if (unlikely((__pyx_t_5 == (npy_int16)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 44; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_6pandas_5algos_MAXint16 = __pyx_t_5;

  /* "pandas/algos.pyx":45
 * cdef np.int8_t MAXint8 = np.iinfo(np.int8).max
 * cdef np.int16_t MAXint16 = np.iinfo(np.int16).max
 * cdef np.int32_t MAXint32 = np.iinfo(np.int32).max             # <<<<<<<<<<<<<<
 * cdef np.int64_t MAXint64 = np.iinfo(np.int64).max
 * cdef np.float16_t MAXfloat16 = np.inf
 */
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 45; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_iinfo); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 45; __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_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 45; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_int32); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 45; __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[0]; __pyx_lineno = 45; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__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 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 45; __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;
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_max); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 45; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_6 = __Pyx_PyInt_As_npy_int32(__pyx_t_1); if (unlikely((__pyx_t_6 == (npy_int32)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 45; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_6pandas_5algos_MAXint32 = __pyx_t_6;

  /* "pandas/algos.pyx":46
 * cdef np.int16_t MAXint16 = np.iinfo(np.int16).max
 * cdef np.int32_t MAXint32 = np.iinfo(np.int32).max
 * cdef np.int64_t MAXint64 = np.iinfo(np.int64).max             # <<<<<<<<<<<<<<
 * cdef np.float16_t MAXfloat16 = np.inf
 * cdef np.float32_t MAXfloat32 = np.inf
 */
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 46; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_iinfo); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 46; __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_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 46; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_int64); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 46; __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[0]; __pyx_lineno = 46; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__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 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 46; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_max); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 46; __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_PyInt_As_npy_int64(__pyx_t_1); if (unlikely((__pyx_t_7 == (npy_int64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 46; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_6pandas_5algos_MAXint64 = __pyx_t_7;

  /* "pandas/algos.pyx":47
 * cdef np.int32_t MAXint32 = np.iinfo(np.int32).max
 * cdef np.int64_t MAXint64 = np.iinfo(np.int64).max
 * cdef np.float16_t MAXfloat16 = np.inf             # <<<<<<<<<<<<<<
 * cdef np.float32_t MAXfloat32 = np.inf
 * cdef np.float64_t MAXfloat64 = np.inf
 */
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 47; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_inf); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 47; __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_AsFloat(__pyx_t_2); if (unlikely((__pyx_t_8 == (npy_float16)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 47; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_6pandas_5algos_MAXfloat16 = __pyx_t_8;

  /* "pandas/algos.pyx":48
 * cdef np.int64_t MAXint64 = np.iinfo(np.int64).max
 * cdef np.float16_t MAXfloat16 = np.inf
 * cdef np.float32_t MAXfloat32 = np.inf             # <<<<<<<<<<<<<<
 * cdef np.float64_t MAXfloat64 = np.inf
 * 
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 48; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_inf); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 48; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_9 = __pyx_PyFloat_AsFloat(__pyx_t_1); if (unlikely((__pyx_t_9 == (npy_float32)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 48; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_6pandas_5algos_MAXfloat32 = __pyx_t_9;

  /* "pandas/algos.pyx":49
 * cdef np.float16_t MAXfloat16 = np.inf
 * cdef np.float32_t MAXfloat32 = np.inf
 * cdef np.float64_t MAXfloat64 = np.inf             # <<<<<<<<<<<<<<
 * 
 * cdef double NaN = <double> np.NaN
 */
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 49; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_inf); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 49; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_10 = __pyx_PyFloat_AsDouble(__pyx_t_2); if (unlikely((__pyx_t_10 == (npy_float64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 49; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_6pandas_5algos_MAXfloat64 = __pyx_t_10;

  /* "pandas/algos.pyx":51
 * cdef np.float64_t MAXfloat64 = np.inf
 * 
 * cdef double NaN = <double> np.NaN             # <<<<<<<<<<<<<<
 * cdef double nan = NaN
 * 
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_NaN); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_11 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_11 == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_6pandas_5algos_NaN = ((double)__pyx_t_11);

  /* "pandas/algos.pyx":52
 * 
 * cdef double NaN = <double> np.NaN
 * cdef double nan = NaN             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_v_6pandas_5algos_nan = __pyx_v_6pandas_5algos_NaN;

  /* "pandas/algos.pyx":64
 *     int signbit(double)
 * 
 * from pandas import lib             # <<<<<<<<<<<<<<
 * 
 * include "skiplist.pyx"
 */
  __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 64; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_n_s_lib);
  PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_lib);
  __Pyx_GIVEREF(__pyx_n_s_lib);
  __pyx_t_2 = __Pyx_Import(__pyx_n_s_pandas, __pyx_t_1, -1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __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_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_lib); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 64; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_lib, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 64; __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/skiplist.pyx":23
 * cimport numpy as np
 * from numpy cimport *
 * import numpy as np             # <<<<<<<<<<<<<<
 * 
 * from random import random
 */
  __pyx_t_2 = __Pyx_Import(__pyx_n_s_numpy, 0, -1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 23; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_np, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 23; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pandas/src/skiplist.pyx":25
 * import numpy as np
 * 
 * from random import random             # <<<<<<<<<<<<<<
 * 
 * # initialize numpy
 */
  __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 25; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(__pyx_n_s_random);
  PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_random);
  __Pyx_GIVEREF(__pyx_n_s_random);
  __pyx_t_1 = __Pyx_Import(__pyx_n_s_random, __pyx_t_2, -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 25; __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_ImportFrom(__pyx_t_1, __pyx_n_s_random); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 25; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_random, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 25; __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/skiplist.pyx":28
 * 
 * # initialize numpy
 * import_array()             # <<<<<<<<<<<<<<
 * 
 * # TODO: optimize this, make less messy
 */
  import_array();

  /* "pandas/src/skiplist.pyx":44
 * 
 * # Singleton terminator node
 * NIL = Node(np.inf, [], [])             # <<<<<<<<<<<<<<
 * 
 * cdef class IndexableSkiplist:
 */
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 44; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_inf); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 44; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 44; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 44; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_12 = PyTuple_New(3); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 44; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__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_1);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_12, 2, __pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_3);
  __pyx_t_2 = 0;
  __pyx_t_1 = 0;
  __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_6pandas_5algos_Node)), __pyx_t_12, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 44; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_NIL, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 44; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "pandas/algos.pyx":70
 * 
 * cdef:
 *     int TIEBREAK_AVERAGE = 0             # <<<<<<<<<<<<<<
 *     int TIEBREAK_MIN = 1
 *     int TIEBREAK_MAX = 2
 */
  __pyx_v_6pandas_5algos_TIEBREAK_AVERAGE = 0;

  /* "pandas/algos.pyx":71
 * cdef:
 *     int TIEBREAK_AVERAGE = 0
 *     int TIEBREAK_MIN = 1             # <<<<<<<<<<<<<<
 *     int TIEBREAK_MAX = 2
 *     int TIEBREAK_FIRST = 3
 */
  __pyx_v_6pandas_5algos_TIEBREAK_MIN = 1;

  /* "pandas/algos.pyx":72
 *     int TIEBREAK_AVERAGE = 0
 *     int TIEBREAK_MIN = 1
 *     int TIEBREAK_MAX = 2             # <<<<<<<<<<<<<<
 *     int TIEBREAK_FIRST = 3
 *     int TIEBREAK_FIRST_DESCENDING = 4
 */
  __pyx_v_6pandas_5algos_TIEBREAK_MAX = 2;

  /* "pandas/algos.pyx":73
 *     int TIEBREAK_MIN = 1
 *     int TIEBREAK_MAX = 2
 *     int TIEBREAK_FIRST = 3             # <<<<<<<<<<<<<<
 *     int TIEBREAK_FIRST_DESCENDING = 4
 *     int TIEBREAK_DENSE = 5
 */
  __pyx_v_6pandas_5algos_TIEBREAK_FIRST = 3;

  /* "pandas/algos.pyx":74
 *     int TIEBREAK_MAX = 2
 *     int TIEBREAK_FIRST = 3
 *     int TIEBREAK_FIRST_DESCENDING = 4             # <<<<<<<<<<<<<<
 *     int TIEBREAK_DENSE = 5
 * 
 */
  __pyx_v_6pandas_5algos_TIEBREAK_FIRST_DESCENDING = 4;

  /* "pandas/algos.pyx":75
 *     int TIEBREAK_FIRST = 3
 *     int TIEBREAK_FIRST_DESCENDING = 4
 *     int TIEBREAK_DENSE = 5             # <<<<<<<<<<<<<<
 * 
 * tiebreakers = {
 */
  __pyx_v_6pandas_5algos_TIEBREAK_DENSE = 5;

  /* "pandas/algos.pyx":77
 *     int TIEBREAK_DENSE = 5
 * 
 * tiebreakers = {             # <<<<<<<<<<<<<<
 *     'average' : TIEBREAK_AVERAGE,
 *     'min' : TIEBREAK_MIN,
 */
  __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);

  /* "pandas/algos.pyx":78
 * 
 * tiebreakers = {
 *     'average' : TIEBREAK_AVERAGE,             # <<<<<<<<<<<<<<
 *     'min' : TIEBREAK_MIN,
 *     'max' : TIEBREAK_MAX,
 */
  __pyx_t_12 = __Pyx_PyInt_From_int(__pyx_v_6pandas_5algos_TIEBREAK_AVERAGE); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_12);
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_average, __pyx_t_12) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;

  /* "pandas/algos.pyx":79
 * tiebreakers = {
 *     'average' : TIEBREAK_AVERAGE,
 *     'min' : TIEBREAK_MIN,             # <<<<<<<<<<<<<<
 *     'max' : TIEBREAK_MAX,
 *     'first' : TIEBREAK_FIRST,
 */
  __pyx_t_12 = __Pyx_PyInt_From_int(__pyx_v_6pandas_5algos_TIEBREAK_MIN); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_12);
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_min, __pyx_t_12) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;

  /* "pandas/algos.pyx":80
 *     'average' : TIEBREAK_AVERAGE,
 *     'min' : TIEBREAK_MIN,
 *     'max' : TIEBREAK_MAX,             # <<<<<<<<<<<<<<
 *     'first' : TIEBREAK_FIRST,
 *     'dense' : TIEBREAK_DENSE,
 */
  __pyx_t_12 = __Pyx_PyInt_From_int(__pyx_v_6pandas_5algos_TIEBREAK_MAX); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 80; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_12);
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_max, __pyx_t_12) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;

  /* "pandas/algos.pyx":81
 *     'min' : TIEBREAK_MIN,
 *     'max' : TIEBREAK_MAX,
 *     'first' : TIEBREAK_FIRST,             # <<<<<<<<<<<<<<
 *     'dense' : TIEBREAK_DENSE,
 * }
 */
  __pyx_t_12 = __Pyx_PyInt_From_int(__pyx_v_6pandas_5algos_TIEBREAK_FIRST); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_12);
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_first, __pyx_t_12) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;

  /* "pandas/algos.pyx":82
 *     'max' : TIEBREAK_MAX,
 *     'first' : TIEBREAK_FIRST,
 *     'dense' : TIEBREAK_DENSE,             # <<<<<<<<<<<<<<
 * }
 * 
 */
  __pyx_t_12 = __Pyx_PyInt_From_int(__pyx_v_6pandas_5algos_TIEBREAK_DENSE); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 82; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_12);
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_dense, __pyx_t_12) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_tiebreakers, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "pandas/algos.pyx":151
 *         return abs_diff > allowed
 * 
 * def rank_1d_float64(object in_arr, ties_method='average', ascending=True,             # <<<<<<<<<<<<<<
 *                     na_option='keep', pct=False):
 *     """
 */
  __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_1rank_1d_float64, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 151; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_rank_1d_float64, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 151; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "pandas/algos.pyx":232
 * 
 * 
 * def rank_1d_int64(object in_arr, ties_method='average', ascending=True,             # <<<<<<<<<<<<<<
 *                   na_option='keep', pct=False):
 *     """
 */
  __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_3rank_1d_int64, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 232; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_rank_1d_int64, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 232; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "pandas/algos.pyx":301
 * 
 * 
 * def rank_2d_float64(object in_arr, axis=0, ties_method='average',             # <<<<<<<<<<<<<<
 *                     ascending=True, na_option='keep', pct=False):
 *     """
 */
  __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_5rank_2d_float64, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 301; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_rank_2d_float64, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 301; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "pandas/algos.pyx":393
 * 
 * 
 * def rank_2d_int64(object in_arr, axis=0, ties_method='average',             # <<<<<<<<<<<<<<
 *                     ascending=True, na_option='keep', pct=False):
 *     """
 */
  __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_7rank_2d_int64, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 393; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_rank_2d_int64, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 393; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "pandas/algos.pyx":470
 * 
 * 
 * def rank_1d_generic(object in_arr, bint retry=1, ties_method='average',             # <<<<<<<<<<<<<<
 *                     ascending=True, na_option='keep', pct=False):
 *     """
 */
  __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_9rank_1d_generic, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 470; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_rank_1d_generic, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 470; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "pandas/algos.pyx":565
 *         return left != right
 * 
 * _return_false = lambda self, other: False             # <<<<<<<<<<<<<<
 * _return_true = lambda self, other: True
 * 
 */
  __pyx_t_3 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6pandas_5algos_510lambda1, 0, __pyx_n_s_lambda, NULL, __pyx_n_s_pandas_algos, PyModule_GetDict(__pyx_m), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 565; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_return_false, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 565; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "pandas/algos.pyx":566
 * 
 * _return_false = lambda self, other: False
 * _return_true = lambda self, other: True             # <<<<<<<<<<<<<<
 * 
 * class Infinity(object):
 */
  __pyx_t_3 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6pandas_5algos_511lambda2, 0, __pyx_n_s_lambda, NULL, __pyx_n_s_pandas_algos, PyModule_GetDict(__pyx_m), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 566; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_return_true, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 566; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "pandas/algos.pyx":568
 * _return_true = lambda self, other: True
 * 
 * class Infinity(object):             # <<<<<<<<<<<<<<
 * 
 *     __lt__ = _return_false
 */
  __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 568; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_INCREF(__pyx_builtin_object);
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_builtin_object);
  __Pyx_GIVEREF(__pyx_builtin_object);
  __pyx_t_12 = __Pyx_CalculateMetaclass(NULL, __pyx_t_3); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 568; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_12);
  __pyx_t_1 = __Pyx_Py3MetaclassPrepare(__pyx_t_12, __pyx_t_3, __pyx_n_s_Infinity, __pyx_n_s_Infinity, (PyObject *) NULL, __pyx_n_s_pandas_algos, (PyObject *) NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 568; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);

  /* "pandas/algos.pyx":570
 * class Infinity(object):
 * 
 *     __lt__ = _return_false             # <<<<<<<<<<<<<<
 *     __le__ = _return_false
 *     __eq__ = _return_false
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_return_false); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 570; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyObject_SetItem(__pyx_t_1, __pyx_n_s_lt, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 570; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pandas/algos.pyx":571
 * 
 *     __lt__ = _return_false
 *     __le__ = _return_false             # <<<<<<<<<<<<<<
 *     __eq__ = _return_false
 *     __ne__ = _return_true
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_return_false); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 571; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyObject_SetItem(__pyx_t_1, __pyx_n_s_le, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 571; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pandas/algos.pyx":572
 *     __lt__ = _return_false
 *     __le__ = _return_false
 *     __eq__ = _return_false             # <<<<<<<<<<<<<<
 *     __ne__ = _return_true
 *     __gt__ = _return_true
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_return_false); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 572; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyObject_SetItem(__pyx_t_1, __pyx_n_s_eq, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 572; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pandas/algos.pyx":573
 *     __le__ = _return_false
 *     __eq__ = _return_false
 *     __ne__ = _return_true             # <<<<<<<<<<<<<<
 *     __gt__ = _return_true
 *     __ge__ = _return_true
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_return_true); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 573; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyObject_SetItem(__pyx_t_1, __pyx_n_s_ne, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 573; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pandas/algos.pyx":574
 *     __eq__ = _return_false
 *     __ne__ = _return_true
 *     __gt__ = _return_true             # <<<<<<<<<<<<<<
 *     __ge__ = _return_true
 *     __cmp__ = _return_false
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_return_true); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 574; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyObject_SetItem(__pyx_t_1, __pyx_n_s_gt, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 574; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pandas/algos.pyx":575
 *     __ne__ = _return_true
 *     __gt__ = _return_true
 *     __ge__ = _return_true             # <<<<<<<<<<<<<<
 *     __cmp__ = _return_false
 * 
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_return_true); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 575; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyObject_SetItem(__pyx_t_1, __pyx_n_s_ge, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 575; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pandas/algos.pyx":576
 *     __gt__ = _return_true
 *     __ge__ = _return_true
 *     __cmp__ = _return_false             # <<<<<<<<<<<<<<
 * 
 * class NegInfinity(object):
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_return_false); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 576; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyObject_SetItem(__pyx_t_1, __pyx_n_s_cmp, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 576; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pandas/algos.pyx":568
 * _return_true = lambda self, other: True
 * 
 * class Infinity(object):             # <<<<<<<<<<<<<<
 * 
 *     __lt__ = _return_false
 */
  __pyx_t_2 = __Pyx_Py3ClassCreate(__pyx_t_12, __pyx_n_s_Infinity, __pyx_t_3, __pyx_t_1, NULL, 0, 1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 568; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_Infinity, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 568; __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;
  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "pandas/algos.pyx":578
 *     __cmp__ = _return_false
 * 
 * class NegInfinity(object):             # <<<<<<<<<<<<<<
 * 
 *     __lt__ = _return_true
 */
  __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 578; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_INCREF(__pyx_builtin_object);
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_builtin_object);
  __Pyx_GIVEREF(__pyx_builtin_object);
  __pyx_t_12 = __Pyx_CalculateMetaclass(NULL, __pyx_t_3); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 578; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_12);
  __pyx_t_1 = __Pyx_Py3MetaclassPrepare(__pyx_t_12, __pyx_t_3, __pyx_n_s_NegInfinity, __pyx_n_s_NegInfinity, (PyObject *) NULL, __pyx_n_s_pandas_algos, (PyObject *) NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 578; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);

  /* "pandas/algos.pyx":580
 * class NegInfinity(object):
 * 
 *     __lt__ = _return_true             # <<<<<<<<<<<<<<
 *     __le__ = _return_true
 *     __eq__ = _return_false
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_return_true); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 580; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyObject_SetItem(__pyx_t_1, __pyx_n_s_lt, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 580; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pandas/algos.pyx":581
 * 
 *     __lt__ = _return_true
 *     __le__ = _return_true             # <<<<<<<<<<<<<<
 *     __eq__ = _return_false
 *     __ne__ = _return_true
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_return_true); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 581; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyObject_SetItem(__pyx_t_1, __pyx_n_s_le, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 581; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pandas/algos.pyx":582
 *     __lt__ = _return_true
 *     __le__ = _return_true
 *     __eq__ = _return_false             # <<<<<<<<<<<<<<
 *     __ne__ = _return_true
 *     __gt__ = _return_false
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_return_false); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 582; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyObject_SetItem(__pyx_t_1, __pyx_n_s_eq, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 582; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pandas/algos.pyx":583
 *     __le__ = _return_true
 *     __eq__ = _return_false
 *     __ne__ = _return_true             # <<<<<<<<<<<<<<
 *     __gt__ = _return_false
 *     __ge__ = _return_false
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_return_true); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 583; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyObject_SetItem(__pyx_t_1, __pyx_n_s_ne, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 583; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pandas/algos.pyx":584
 *     __eq__ = _return_false
 *     __ne__ = _return_true
 *     __gt__ = _return_false             # <<<<<<<<<<<<<<
 *     __ge__ = _return_false
 *     __cmp__ = _return_true
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_return_false); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 584; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyObject_SetItem(__pyx_t_1, __pyx_n_s_gt, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 584; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pandas/algos.pyx":585
 *     __ne__ = _return_true
 *     __gt__ = _return_false
 *     __ge__ = _return_false             # <<<<<<<<<<<<<<
 *     __cmp__ = _return_true
 * 
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_return_false); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 585; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyObject_SetItem(__pyx_t_1, __pyx_n_s_ge, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 585; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pandas/algos.pyx":586
 *     __gt__ = _return_false
 *     __ge__ = _return_false
 *     __cmp__ = _return_true             # <<<<<<<<<<<<<<
 * 
 * def rank_2d_generic(object in_arr, axis=0, ties_method='average',
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_return_true); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 586; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyObject_SetItem(__pyx_t_1, __pyx_n_s_cmp, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 586; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pandas/algos.pyx":578
 *     __cmp__ = _return_false
 * 
 * class NegInfinity(object):             # <<<<<<<<<<<<<<
 * 
 *     __lt__ = _return_true
 */
  __pyx_t_2 = __Pyx_Py3ClassCreate(__pyx_t_12, __pyx_n_s_NegInfinity, __pyx_t_3, __pyx_t_1, NULL, 0, 1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 578; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_NegInfinity, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 578; __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;
  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "pandas/algos.pyx":588
 *     __cmp__ = _return_true
 * 
 * def rank_2d_generic(object in_arr, axis=0, ties_method='average',             # <<<<<<<<<<<<<<
 *                     ascending=True, na_option='keep', pct=False):
 *     """
 */
  __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_11rank_2d_generic, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 588; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_rank_2d_generic, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 588; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "pandas/algos.pyx":715
 * # -
 * 
 * def _check_minp(win, minp, N):             # <<<<<<<<<<<<<<
 *     if minp > win:
 *         raise ValueError('min_periods (%d) must be <= window (%d)'
 */
  __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_13_check_minp, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 715; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_check_minp, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 715; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "pandas/algos.pyx":770
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * cpdef numeric kth_smallest(numeric[:] a, Py_ssize_t k):             # <<<<<<<<<<<<<<
 *     cdef:
 *         Py_ssize_t i, j, l, m, n = a.size
 */
  __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_12 = __pyx_FusedFunction_NewEx(&__pyx_fuse_0__pyx_mdef_6pandas_5algos_513__pyx_fuse_0kth_smallest, 0, __pyx_n_s_pyx_fuse_0kth_smallest, NULL, __pyx_n_s_pandas_algos, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__248)); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_12);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_12, __pyx_empty_tuple);
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_int8_t, __pyx_t_12) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
  __pyx_t_12 = __pyx_FusedFunction_NewEx(&__pyx_fuse_1__pyx_mdef_6pandas_5algos_515__pyx_fuse_1kth_smallest, 0, __pyx_n_s_pyx_fuse_1kth_smallest, NULL, __pyx_n_s_pandas_algos, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__248)); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_12);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_12, __pyx_empty_tuple);
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_int16_t, __pyx_t_12) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
  __pyx_t_12 = __pyx_FusedFunction_NewEx(&__pyx_fuse_2__pyx_mdef_6pandas_5algos_517__pyx_fuse_2kth_smallest, 0, __pyx_n_s_pyx_fuse_2kth_smallest, NULL, __pyx_n_s_pandas_algos, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__248)); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_12);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_12, __pyx_empty_tuple);
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_int32_t, __pyx_t_12) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
  __pyx_t_12 = __pyx_FusedFunction_NewEx(&__pyx_fuse_3__pyx_mdef_6pandas_5algos_519__pyx_fuse_3kth_smallest, 0, __pyx_n_s_pyx_fuse_3kth_smallest, NULL, __pyx_n_s_pandas_algos, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__248)); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_12);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_12, __pyx_empty_tuple);
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_int64_t, __pyx_t_12) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
  __pyx_t_12 = __pyx_FusedFunction_NewEx(&__pyx_fuse_4__pyx_mdef_6pandas_5algos_521__pyx_fuse_4kth_smallest, 0, __pyx_n_s_pyx_fuse_4kth_smallest, NULL, __pyx_n_s_pandas_algos, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__248)); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_12);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_12, __pyx_empty_tuple);
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_uint8_t, __pyx_t_12) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
  __pyx_t_12 = __pyx_FusedFunction_NewEx(&__pyx_fuse_5__pyx_mdef_6pandas_5algos_523__pyx_fuse_5kth_smallest, 0, __pyx_n_s_pyx_fuse_5kth_smallest, NULL, __pyx_n_s_pandas_algos, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__248)); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_12);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_12, __pyx_empty_tuple);
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_uint16_t, __pyx_t_12) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
  __pyx_t_12 = __pyx_FusedFunction_NewEx(&__pyx_fuse_6__pyx_mdef_6pandas_5algos_525__pyx_fuse_6kth_smallest, 0, __pyx_n_s_pyx_fuse_6kth_smallest, NULL, __pyx_n_s_pandas_algos, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__248)); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_12);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_12, __pyx_empty_tuple);
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_uint32_t, __pyx_t_12) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
  __pyx_t_12 = __pyx_FusedFunction_NewEx(&__pyx_fuse_7__pyx_mdef_6pandas_5algos_527__pyx_fuse_7kth_smallest, 0, __pyx_n_s_pyx_fuse_7kth_smallest, NULL, __pyx_n_s_pandas_algos, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__248)); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_12);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_12, __pyx_empty_tuple);
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_uint64_t, __pyx_t_12) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
  __pyx_t_12 = __pyx_FusedFunction_NewEx(&__pyx_fuse_8__pyx_mdef_6pandas_5algos_529__pyx_fuse_8kth_smallest, 0, __pyx_n_s_pyx_fuse_8kth_smallest, NULL, __pyx_n_s_pandas_algos, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__248)); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_12);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_12, __pyx_empty_tuple);
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_float32_t, __pyx_t_12) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
  __pyx_t_12 = __pyx_FusedFunction_NewEx(&__pyx_fuse_9__pyx_mdef_6pandas_5algos_531__pyx_fuse_9kth_smallest, 0, __pyx_n_s_pyx_fuse_9kth_smallest, NULL, __pyx_n_s_pandas_algos, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__248)); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_12);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_12, __pyx_empty_tuple);
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_float64_t, __pyx_t_12) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
  __pyx_t_12 = __pyx_FusedFunction_NewEx(&__pyx_mdef_6pandas_5algos_15kth_smallest, 0, __pyx_n_s_kth_smallest, NULL, __pyx_n_s_pandas_algos, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__248)); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_12);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_12, __pyx_empty_tuple);
  ((__pyx_FusedFunctionObject *) __pyx_t_12)->__signatures__ = __pyx_t_3;
  __Pyx_GIVEREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_kth_smallest, __pyx_t_12) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;

  /* "pandas/algos.pyx":823
 * 
 * 
 * cpdef numeric median(numeric[:] arr):             # <<<<<<<<<<<<<<
 *     '''
 *     A faster median
 */
  __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __pyx_FusedFunction_NewEx(&__pyx_fuse_0__pyx_mdef_6pandas_5algos_535__pyx_fuse_0median, 0, __pyx_n_s_pyx_fuse_0median, NULL, __pyx_n_s_pandas_algos, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__250)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_empty_tuple);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_int8_t, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __pyx_FusedFunction_NewEx(&__pyx_fuse_1__pyx_mdef_6pandas_5algos_537__pyx_fuse_1median, 0, __pyx_n_s_pyx_fuse_1median, NULL, __pyx_n_s_pandas_algos, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__250)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_empty_tuple);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_int16_t, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __pyx_FusedFunction_NewEx(&__pyx_fuse_2__pyx_mdef_6pandas_5algos_539__pyx_fuse_2median, 0, __pyx_n_s_pyx_fuse_2median, NULL, __pyx_n_s_pandas_algos, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__250)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_empty_tuple);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_int32_t, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __pyx_FusedFunction_NewEx(&__pyx_fuse_3__pyx_mdef_6pandas_5algos_541__pyx_fuse_3median, 0, __pyx_n_s_pyx_fuse_3median, NULL, __pyx_n_s_pandas_algos, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__250)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_empty_tuple);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_int64_t, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __pyx_FusedFunction_NewEx(&__pyx_fuse_4__pyx_mdef_6pandas_5algos_543__pyx_fuse_4median, 0, __pyx_n_s_pyx_fuse_4median, NULL, __pyx_n_s_pandas_algos, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__250)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_empty_tuple);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_uint8_t, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __pyx_FusedFunction_NewEx(&__pyx_fuse_5__pyx_mdef_6pandas_5algos_545__pyx_fuse_5median, 0, __pyx_n_s_pyx_fuse_5median, NULL, __pyx_n_s_pandas_algos, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__250)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_empty_tuple);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_uint16_t, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __pyx_FusedFunction_NewEx(&__pyx_fuse_6__pyx_mdef_6pandas_5algos_547__pyx_fuse_6median, 0, __pyx_n_s_pyx_fuse_6median, NULL, __pyx_n_s_pandas_algos, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__250)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_empty_tuple);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_uint32_t, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __pyx_FusedFunction_NewEx(&__pyx_fuse_7__pyx_mdef_6pandas_5algos_549__pyx_fuse_7median, 0, __pyx_n_s_pyx_fuse_7median, NULL, __pyx_n_s_pandas_algos, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__250)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_empty_tuple);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_uint64_t, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __pyx_FusedFunction_NewEx(&__pyx_fuse_8__pyx_mdef_6pandas_5algos_551__pyx_fuse_8median, 0, __pyx_n_s_pyx_fuse_8median, NULL, __pyx_n_s_pandas_algos, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__250)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_empty_tuple);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_float32_t, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __pyx_FusedFunction_NewEx(&__pyx_fuse_9__pyx_mdef_6pandas_5algos_553__pyx_fuse_9median, 0, __pyx_n_s_pyx_fuse_9median, NULL, __pyx_n_s_pandas_algos, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__250)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_empty_tuple);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_float64_t, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __pyx_FusedFunction_NewEx(&__pyx_mdef_6pandas_5algos_17median, 0, __pyx_n_s_median, NULL, __pyx_n_s_pandas_algos, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__250)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_empty_tuple);
  ((__pyx_FusedFunctionObject *) __pyx_t_2)->__signatures__ = __pyx_t_1;
  __Pyx_GIVEREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_median, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pandas/algos.pyx":843
 * # -------------- Min, Max subsequence
 * 
 * def max_subseq(ndarray[double_t] arr):             # <<<<<<<<<<<<<<
 *     cdef:
 *         Py_ssize_t i=0,s=0,e=0,T,n
 */
  __pyx_t_13 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_19max_subseq, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 843; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_13);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_max_subseq, __pyx_t_13) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 843; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

  /* "pandas/algos.pyx":871
 *     return (s, e, m)
 * 
 * def min_subseq(ndarray[double_t] arr):             # <<<<<<<<<<<<<<
 *     cdef:
 *         Py_ssize_t s, e
 */
  __pyx_t_13 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_21min_subseq, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 871; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_13);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_min_subseq, __pyx_t_13) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 871; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

  /* "pandas/algos.pyx":883
 * # 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_13 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_23roll_sum, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 883; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_13);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_roll_sum, __pyx_t_13) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 883; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

  /* "pandas/algos.pyx":925
 * # Rolling mean
 * 
 * def roll_mean(ndarray[double_t] input,             # <<<<<<<<<<<<<<
 *                int win, int minp):
 *     cdef:
 */
  __pyx_t_13 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_25roll_mean, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 925; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_13);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_roll_mean, __pyx_t_13) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 925; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

  /* "pandas/algos.pyx":982
 * # 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_13 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_27ewma, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 982; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_13);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_ewma, __pyx_t_13) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 982; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

  /* "pandas/algos.pyx":1044
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def nancorr(ndarray[float64_t, ndim=2] mat, cov=False, minp=None):             # <<<<<<<<<<<<<<
 *     cdef:
 *         Py_ssize_t i, j, xi, yi, N, K
 */
  __pyx_t_13 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_29nancorr, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1044; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_13);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_nancorr, __pyx_t_13) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1044; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

  /* "pandas/algos.pyx":1103
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def nancorr_spearman(ndarray[float64_t, ndim=2] mat, Py_ssize_t minp=1):             # <<<<<<<<<<<<<<
 *     cdef:
 *         Py_ssize_t i, j, xi, yi, N, K
 */
  __pyx_t_13 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_31nancorr_spearman, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1103; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_13);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_nancorr_spearman, __pyx_t_13) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1103; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

  /* "pandas/algos.pyx":1164
 * # Rolling variance
 * 
 * def roll_var(ndarray[double_t] input, int win, int minp, int ddof=1):             # <<<<<<<<<<<<<<
 *     """
 *     Numerically stable implementation using Welford's method.
 */
  __pyx_t_13 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_33roll_var, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1164; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_13);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_roll_var, __pyx_t_13) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1164; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

  /* "pandas/algos.pyx":1244
 * # 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_13 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_35roll_skew, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1244; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_13);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_roll_skew, __pyx_t_13) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1244; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

  /* "pandas/algos.pyx":1308
 * 
 * 
 * def roll_kurt(ndarray[double_t] input,             # <<<<<<<<<<<<<<
 *                int win, int minp):
 *     cdef double val, prev
 */
  __pyx_t_13 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_37roll_kurt, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1308; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_13);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_roll_kurt, __pyx_t_13) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1308; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

  /* "pandas/algos.pyx":1428
 * from skiplist cimport *
 * 
 * def roll_median_c(ndarray[float64_t] arg, int win, int minp):             # <<<<<<<<<<<<<<
 *     cdef double val, res, prev
 *     cdef:
 */
  __pyx_t_13 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_39roll_median_c, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1428; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_13);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_roll_median_c, __pyx_t_13) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1428; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

  /* "pandas/algos.pyx":1483
 *     return output
 * 
 * def roll_median_cython(ndarray input, int win, int minp):             # <<<<<<<<<<<<<<
 *     '''
 *     O(N log(window)) implementation using skip list
 */
  __pyx_t_13 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_41roll_median_cython, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1483; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_13);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_roll_median_cython, __pyx_t_13) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1483; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

  /* "pandas/algos.pyx":1519
 * @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_13 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_43roll_max2, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1519; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_13);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_roll_max2, __pyx_t_13) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1519; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

  /* "pandas/algos.pyx":1599
 *     return y
 * 
 * def roll_max(ndarray input, int win, int minp):             # <<<<<<<<<<<<<<
 *     '''
 *     O(N log(window)) implementation using skip list
 */
  __pyx_t_13 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_45roll_max, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1599; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_13);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_roll_max, __pyx_t_13) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1599; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

  /* "pandas/algos.pyx":1612
 *         return NaN
 * 
 * def roll_min(ndarray input, int win, int minp):             # <<<<<<<<<<<<<<
 *     '''
 *     O(N log(window)) implementation using skip list
 */
  __pyx_t_13 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_47roll_min, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1612; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_13);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_roll_min, __pyx_t_13) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1612; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

  /* "pandas/algos.pyx":1620
 * @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_13 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_49roll_min2, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1620; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_13);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_roll_min2, __pyx_t_13) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1620; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

  /* "pandas/algos.pyx":1706
 *         return NaN
 * 
 * def roll_quantile(ndarray[float64_t, cast=True] input, int win,             # <<<<<<<<<<<<<<
 *                   int minp, double quantile):
 *     '''
 */
  __pyx_t_13 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_51roll_quantile, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1706; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_13);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_roll_quantile, __pyx_t_13) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1706; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

  /* "pandas/algos.pyx":1753
 *     return output
 * 
 * def roll_generic(ndarray[float64_t, cast=True] input, int win,             # <<<<<<<<<<<<<<
 *                  int minp, object func, object args, object kwargs):
 *     cdef ndarray[double_t] output, counts, bufarr
 */
  __pyx_t_13 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_53roll_generic, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1753; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_13);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_roll_generic, __pyx_t_13) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1753; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

  /* "pandas/algos.pyx":1797
 * 
 * 
 * def roll_window(ndarray[float64_t, ndim=1, cast=True] input,             # <<<<<<<<<<<<<<
 *                 ndarray[float64_t, ndim=1, cast=True] weights,
 *                 int minp, bint avg=True, bint avg_wgt=False):
 */
  __pyx_t_13 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_55roll_window, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1797; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_13);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_roll_window, __pyx_t_13) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1797; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

  /* "pandas/algos.pyx":1870
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def is_lexsorted(list list_of_arrays):             # <<<<<<<<<<<<<<
 *     cdef:
 *         int i
 */
  __pyx_t_13 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_57is_lexsorted, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1870; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_13);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_is_lexsorted, __pyx_t_13) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1870; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

  /* "pandas/algos.pyx":1903
 * 
 * @cython.boundscheck(False)
 * def groupby_indices(ndarray values):             # <<<<<<<<<<<<<<
 *     cdef:
 *         Py_ssize_t i, n = len(values)
 */
  __pyx_t_13 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_59groupby_indices, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1903; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_13);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_groupby_indices, __pyx_t_13) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1903; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

  /* "pandas/algos.pyx":1940
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def group_labels(ndarray[object] values):             # <<<<<<<<<<<<<<
 *     '''
 *     Compute label vector from input values and associated useful data
 */
  __pyx_t_13 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_61group_labels, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1940; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_13);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_group_labels, __pyx_t_13) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1940; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

  /* "pandas/algos.pyx":1982
 * @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_13 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_63groupsort_indexer, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1982; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_13);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_groupsort_indexer, __pyx_t_13) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1982; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

  /* "pandas/algos.pyx":2013
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def group_nth_object(ndarray[object, ndim=2] out,             # <<<<<<<<<<<<<<
 *                      ndarray[int64_t] counts,
 *                      ndarray[object, ndim=2] values,
 */
  __pyx_t_13 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_65group_nth_object, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2013; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_13);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_group_nth_object, __pyx_t_13) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2013; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

  /* "pandas/algos.pyx":2057
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def group_nth_bin_object(ndarray[object, ndim=2] out,             # <<<<<<<<<<<<<<
 *                          ndarray[int64_t] counts,
 *                          ndarray[object, ndim=2] values,
 */
  __pyx_t_13 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_67group_nth_bin_object, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2057; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_13);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_group_nth_bin_object, __pyx_t_13) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2057; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

  /* "pandas/algos.pyx":2105
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def group_last_object(ndarray[object, ndim=2] out,             # <<<<<<<<<<<<<<
 *                       ndarray[int64_t] counts,
 *                       ndarray[object, ndim=2] values,
 */
  __pyx_t_13 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_69group_last_object, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2105; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_13);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_group_last_object, __pyx_t_13) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2105; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

  /* "pandas/algos.pyx":2147
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def group_last_bin_object(ndarray[object, ndim=2] out,             # <<<<<<<<<<<<<<
 *                           ndarray[int64_t] counts,
 *                           ndarray[object, ndim=2] values,
 */
  __pyx_t_13 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_71group_last_bin_object, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2147; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_13);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_group_last_bin_object, __pyx_t_13) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2147; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

  /* "pandas/algos.pyx":2197
 * # median
 * 
 * def group_median(ndarray[float64_t, ndim=2] out,             # <<<<<<<<<<<<<<
 *                  ndarray[int64_t] counts,
 *                  ndarray[float64_t, ndim=2] values,
 */
  __pyx_t_13 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_73group_median, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2197; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_13);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_group_median, __pyx_t_13) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2197; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

  /* "pandas/src/join.pyx":1
 * def inner_join(ndarray[int64_t] left, ndarray[int64_t] right,             # <<<<<<<<<<<<<<
 *                Py_ssize_t max_groups):
 *     cdef:
 */
  __pyx_t_13 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_75inner_join, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_13);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_inner_join, __pyx_t_13) < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

  /* "pandas/src/join.pyx":51
 *             _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_13 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_77left_outer_join, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_13);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_left_outer_join, __pyx_t_13) < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

  /* "pandas/src/join.pyx":120
 * 
 * 
 * def full_outer_join(ndarray[int64_t] left, ndarray[int64_t] right,             # <<<<<<<<<<<<<<
 *                           Py_ssize_t max_groups):
 *     cdef:
 */
  __pyx_t_13 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_79full_outer_join, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 120; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_13);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_full_outer_join, __pyx_t_13) < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 120; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

  /* "pandas/src/join.pyx":184
 * 
 * 
 * def _get_result_indexer(sorter, indexer):             # <<<<<<<<<<<<<<
 *     if indexer.dtype != np.int_:
 *         indexer = indexer.astype(np.int_)
 */
  __pyx_t_13 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_81_get_result_indexer, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 184; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_13);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_result_indexer, __pyx_t_13) < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 184; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

  /* "pandas/src/join.pyx":199
 * 
 * 
 * def ffill_indexer(ndarray[int64_t] indexer):             # <<<<<<<<<<<<<<
 *     cdef:
 *         Py_ssize_t i, n = len(indexer)
 */
  __pyx_t_13 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_83ffill_indexer, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 199; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_13);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_ffill_indexer, __pyx_t_13) < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 199; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

  /* "pandas/src/join.pyx":219
 * 
 * 
 * def ffill_by_group(ndarray[int64_t] indexer, ndarray[int64_t] group_ids,             # <<<<<<<<<<<<<<
 *                    int64_t max_group):
 *     cdef:
 */
  __pyx_t_13 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_85ffill_by_group, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 219; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_13);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_ffill_by_group, __pyx_t_13) < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 219; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

  /* "pandas/src/generated.pyx":17
 * cimport cpython
 * 
 * import numpy as np             # <<<<<<<<<<<<<<
 * isnan = np.isnan
 * 
 */
  __pyx_t_13 = __Pyx_Import(__pyx_n_s_numpy, 0, -1); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 17; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_13);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_np, __pyx_t_13) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 17; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

  /* "pandas/src/generated.pyx":18
 * 
 * import numpy as np
 * isnan = np.isnan             # <<<<<<<<<<<<<<
 * 
 * from datetime import datetime as pydatetime
 */
  __pyx_t_13 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 18; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_13);
  __pyx_t_14 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_n_s_isnan); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 18; __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_d, __pyx_n_s_isnan, __pyx_t_14) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 18; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "pandas/src/generated.pyx":20
 * isnan = np.isnan
 * 
 * from datetime import datetime as pydatetime             # <<<<<<<<<<<<<<
 * 
 * # this is our datetime.pxd
 */
  __pyx_t_14 = PyList_New(1); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 20; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_14);
  __Pyx_INCREF(__pyx_n_s_datetime);
  PyList_SET_ITEM(__pyx_t_14, 0, __pyx_n_s_datetime);
  __Pyx_GIVEREF(__pyx_n_s_datetime);
  __pyx_t_13 = __Pyx_Import(__pyx_n_s_datetime, __pyx_t_14, -1); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 20; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_13);
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  __pyx_t_14 = __Pyx_ImportFrom(__pyx_t_13, __pyx_n_s_datetime); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 20; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_14);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_pydatetime, __pyx_t_14) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 20; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

  /* "pandas/src/generated.pyx":32
 * from util cimport is_array, _checknull, _checknan, get_nat
 * 
 * cdef int64_t iNaT = get_nat()             # <<<<<<<<<<<<<<
 * 
 * # import datetime C API
 */
  __pyx_v_6pandas_5algos_iNaT = get_nat();

  /* "pandas/src/generated.pyx":35
 * 
 * # import datetime C API
 * PyDateTime_IMPORT             # <<<<<<<<<<<<<<
 * 
 * # initialize numpy
 */
  PyDateTime_IMPORT;

  /* "pandas/src/generated.pyx":38
 * 
 * # initialize numpy
 * import_array()             # <<<<<<<<<<<<<<
 * import_ufunc()
 * 
 */
  import_array();

  /* "pandas/src/generated.pyx":39
 * # initialize numpy
 * import_array()
 * import_ufunc()             # <<<<<<<<<<<<<<
 * 
 * cdef int PLATFORM_INT = (<ndarray> np.arange(0, dtype=np.int_)).descr.type_num
 */
  import_ufunc();

  /* "pandas/src/generated.pyx":41
 * import_ufunc()
 * 
 * cdef int PLATFORM_INT = (<ndarray> np.arange(0, dtype=np.int_)).descr.type_num             # <<<<<<<<<<<<<<
 * 
 * cpdef ensure_platform_int(object arr):
 */
  __pyx_t_13 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_13);
  __pyx_t_14 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_n_s_arange); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_14);
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  __pyx_t_13 = PyDict_New(); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_13);
  __pyx_t_15 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_15);
  __pyx_t_16 = __Pyx_PyObject_GetAttrStr(__pyx_t_15, __pyx_n_s_int); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_16);
  __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
  if (PyDict_SetItem(__pyx_t_13, __pyx_n_s_dtype, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
  __pyx_t_16 = __Pyx_PyObject_Call(__pyx_t_14, __pyx_tuple__319, __pyx_t_13); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_16);
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  __pyx_t_17 = ((PyArrayObject *)__pyx_t_16)->descr->type_num;
  __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
  __pyx_v_6pandas_5algos_PLATFORM_INT = __pyx_t_17;

  /* "pandas/src/generated.pyx":259
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def pad_float64(ndarray[float64_t] old, ndarray[float64_t] new,             # <<<<<<<<<<<<<<
 *                    limit=None):
 *     cdef Py_ssize_t i, j, nleft, nright
 */
  __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_115pad_float64, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 259; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_16);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_pad_float64, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 259; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;

  /* "pandas/src/generated.pyx":320
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def pad_float32(ndarray[float32_t] old, ndarray[float32_t] new,             # <<<<<<<<<<<<<<
 *                    limit=None):
 *     cdef Py_ssize_t i, j, nleft, nright
 */
  __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_117pad_float32, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 320; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_16);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_pad_float32, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 320; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;

  /* "pandas/src/generated.pyx":381
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def pad_object(ndarray[object] old, ndarray[object] new,             # <<<<<<<<<<<<<<
 *                    limit=None):
 *     cdef Py_ssize_t i, j, nleft, nright
 */
  __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_119pad_object, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 381; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_16);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_pad_object, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 381; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;

  /* "pandas/src/generated.pyx":442
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def pad_int32(ndarray[int32_t] old, ndarray[int32_t] new,             # <<<<<<<<<<<<<<
 *                    limit=None):
 *     cdef Py_ssize_t i, j, nleft, nright
 */
  __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_121pad_int32, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 442; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_16);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_pad_int32, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 442; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;

  /* "pandas/src/generated.pyx":503
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def pad_int64(ndarray[int64_t] old, ndarray[int64_t] new,             # <<<<<<<<<<<<<<
 *                    limit=None):
 *     cdef Py_ssize_t i, j, nleft, nright
 */
  __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_123pad_int64, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 503; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_16);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_pad_int64, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 503; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;

  /* "pandas/src/generated.pyx":564
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def pad_bool(ndarray[uint8_t] old, ndarray[uint8_t] new,             # <<<<<<<<<<<<<<
 *                    limit=None):
 *     cdef Py_ssize_t i, j, nleft, nright
 */
  __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_125pad_bool, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 564; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_16);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_pad_bool, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 564; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;

  /* "pandas/src/generated.pyx":626
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def backfill_float64(ndarray[float64_t] old, ndarray[float64_t] new,             # <<<<<<<<<<<<<<
 *                       limit=None):
 *     cdef Py_ssize_t i, j, nleft, nright
 */
  __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_127backfill_float64, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 626; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_16);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_backfill_float64, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 626; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;

  /* "pandas/src/generated.pyx":688
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def backfill_float32(ndarray[float32_t] old, ndarray[float32_t] new,             # <<<<<<<<<<<<<<
 *                       limit=None):
 *     cdef Py_ssize_t i, j, nleft, nright
 */
  __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_129backfill_float32, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 688; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_16);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_backfill_float32, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 688; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;

  /* "pandas/src/generated.pyx":750
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def backfill_object(ndarray[object] old, ndarray[object] new,             # <<<<<<<<<<<<<<
 *                       limit=None):
 *     cdef Py_ssize_t i, j, nleft, nright
 */
  __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_131backfill_object, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 750; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_16);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_backfill_object, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 750; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;

  /* "pandas/src/generated.pyx":812
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def backfill_int32(ndarray[int32_t] old, ndarray[int32_t] new,             # <<<<<<<<<<<<<<
 *                       limit=None):
 *     cdef Py_ssize_t i, j, nleft, nright
 */
  __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_133backfill_int32, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 812; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_16);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_backfill_int32, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 812; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;

  /* "pandas/src/generated.pyx":874
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def backfill_int64(ndarray[int64_t] old, ndarray[int64_t] new,             # <<<<<<<<<<<<<<
 *                       limit=None):
 *     cdef Py_ssize_t i, j, nleft, nright
 */
  __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_135backfill_int64, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 874; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_16);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_backfill_int64, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 874; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;

  /* "pandas/src/generated.pyx":936
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def backfill_bool(ndarray[uint8_t] old, ndarray[uint8_t] new,             # <<<<<<<<<<<<<<
 *                       limit=None):
 *     cdef Py_ssize_t i, j, nleft, nright
 */
  __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_137backfill_bool, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 936; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_16);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_backfill_bool, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 936; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;

  /* "pandas/src/generated.pyx":999
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def pad_inplace_float64(ndarray[float64_t] values,             # <<<<<<<<<<<<<<
 *                          ndarray[uint8_t, cast=True] mask,
 *                          limit=None):
 */
  __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_139pad_inplace_float64, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 999; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_16);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_pad_inplace_float64, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 999; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;

  /* "pandas/src/generated.pyx":1032
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def pad_inplace_float32(ndarray[float32_t] values,             # <<<<<<<<<<<<<<
 *                          ndarray[uint8_t, cast=True] mask,
 *                          limit=None):
 */
  __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_141pad_inplace_float32, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1032; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_16);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_pad_inplace_float32, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1032; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;

  /* "pandas/src/generated.pyx":1065
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def pad_inplace_object(ndarray[object] values,             # <<<<<<<<<<<<<<
 *                          ndarray[uint8_t, cast=True] mask,
 *                          limit=None):
 */
  __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_143pad_inplace_object, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1065; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_16);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_pad_inplace_object, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1065; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;

  /* "pandas/src/generated.pyx":1098
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def pad_inplace_int32(ndarray[int32_t] values,             # <<<<<<<<<<<<<<
 *                          ndarray[uint8_t, cast=True] mask,
 *                          limit=None):
 */
  __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_145pad_inplace_int32, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1098; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_16);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_pad_inplace_int32, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1098; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;

  /* "pandas/src/generated.pyx":1131
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def pad_inplace_int64(ndarray[int64_t] values,             # <<<<<<<<<<<<<<
 *                          ndarray[uint8_t, cast=True] mask,
 *                          limit=None):
 */
  __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_147pad_inplace_int64, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1131; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_16);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_pad_inplace_int64, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1131; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;

  /* "pandas/src/generated.pyx":1164
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def pad_inplace_bool(ndarray[uint8_t] values,             # <<<<<<<<<<<<<<
 *                          ndarray[uint8_t, cast=True] mask,
 *                          limit=None):
 */
  __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_149pad_inplace_bool, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1164; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_16);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_pad_inplace_bool, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1164; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;

  /* "pandas/src/generated.pyx":1198
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def backfill_inplace_float64(ndarray[float64_t] values,             # <<<<<<<<<<<<<<
 *                               ndarray[uint8_t, cast=True] mask,
 *                               limit=None):
 */
  __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_151backfill_inplace_float64, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1198; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_16);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_backfill_inplace_float64, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1198; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;

  /* "pandas/src/generated.pyx":1230
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def backfill_inplace_float32(ndarray[float32_t] values,             # <<<<<<<<<<<<<<
 *                               ndarray[uint8_t, cast=True] mask,
 *                               limit=None):
 */
  __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_153backfill_inplace_float32, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1230; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_16);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_backfill_inplace_float32, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1230; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;

  /* "pandas/src/generated.pyx":1262
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def backfill_inplace_object(ndarray[object] values,             # <<<<<<<<<<<<<<
 *                               ndarray[uint8_t, cast=True] mask,
 *                               limit=None):
 */
  __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_155backfill_inplace_object, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1262; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_16);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_backfill_inplace_object, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1262; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;

  /* "pandas/src/generated.pyx":1294
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def backfill_inplace_int32(ndarray[int32_t] values,             # <<<<<<<<<<<<<<
 *                               ndarray[uint8_t, cast=True] mask,
 *                               limit=None):
 */
  __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_157backfill_inplace_int32, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1294; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_16);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_backfill_inplace_int32, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1294; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;

  /* "pandas/src/generated.pyx":1326
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def backfill_inplace_int64(ndarray[int64_t] values,             # <<<<<<<<<<<<<<
 *                               ndarray[uint8_t, cast=True] mask,
 *                               limit=None):
 */
  __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_159backfill_inplace_int64, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1326; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_16);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_backfill_inplace_int64, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1326; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;

  /* "pandas/src/generated.pyx":1358
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def backfill_inplace_bool(ndarray[uint8_t] values,             # <<<<<<<<<<<<<<
 *                               ndarray[uint8_t, cast=True] mask,
 *                               limit=None):
 */
  __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_161backfill_inplace_bool, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1358; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_16);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_backfill_inplace_bool, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1358; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;

  /* "pandas/src/generated.pyx":1391
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def pad_2d_inplace_float64(ndarray[float64_t, ndim=2] values,             # <<<<<<<<<<<<<<
 *                             ndarray[uint8_t, ndim=2] mask,
 *                             limit=None):
 */
  __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_163pad_2d_inplace_float64, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1391; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_16);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_pad_2d_inplace_float64, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1391; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;

  /* "pandas/src/generated.pyx":1425
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def pad_2d_inplace_float32(ndarray[float32_t, ndim=2] values,             # <<<<<<<<<<<<<<
 *                             ndarray[uint8_t, ndim=2] mask,
 *                             limit=None):
 */
  __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_165pad_2d_inplace_float32, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1425; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_16);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_pad_2d_inplace_float32, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1425; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;

  /* "pandas/src/generated.pyx":1459
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def pad_2d_inplace_object(ndarray[object, ndim=2] values,             # <<<<<<<<<<<<<<
 *                             ndarray[uint8_t, ndim=2] mask,
 *                             limit=None):
 */
  __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_167pad_2d_inplace_object, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1459; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_16);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_pad_2d_inplace_object, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1459; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;

  /* "pandas/src/generated.pyx":1493
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def pad_2d_inplace_int32(ndarray[int32_t, ndim=2] values,             # <<<<<<<<<<<<<<
 *                             ndarray[uint8_t, ndim=2] mask,
 *                             limit=None):
 */
  __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_169pad_2d_inplace_int32, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1493; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_16);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_pad_2d_inplace_int32, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1493; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;

  /* "pandas/src/generated.pyx":1527
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def pad_2d_inplace_int64(ndarray[int64_t, ndim=2] values,             # <<<<<<<<<<<<<<
 *                             ndarray[uint8_t, ndim=2] mask,
 *                             limit=None):
 */
  __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_171pad_2d_inplace_int64, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1527; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_16);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_pad_2d_inplace_int64, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1527; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;

  /* "pandas/src/generated.pyx":1561
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def pad_2d_inplace_bool(ndarray[uint8_t, ndim=2] values,             # <<<<<<<<<<<<<<
 *                             ndarray[uint8_t, ndim=2] mask,
 *                             limit=None):
 */
  __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_173pad_2d_inplace_bool, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1561; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_16);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_pad_2d_inplace_bool, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1561; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;

  /* "pandas/src/generated.pyx":1596
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def backfill_2d_inplace_float64(ndarray[float64_t, ndim=2] values,             # <<<<<<<<<<<<<<
 *                                  ndarray[uint8_t, ndim=2] mask,
 *                                  limit=None):
 */
  __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_175backfill_2d_inplace_float64, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1596; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_16);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_backfill_2d_inplace_float64, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1596; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;

  /* "pandas/src/generated.pyx":1630
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def backfill_2d_inplace_float32(ndarray[float32_t, ndim=2] values,             # <<<<<<<<<<<<<<
 *                                  ndarray[uint8_t, ndim=2] mask,
 *                                  limit=None):
 */
  __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_177backfill_2d_inplace_float32, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1630; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_16);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_backfill_2d_inplace_float32, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1630; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;

  /* "pandas/src/generated.pyx":1664
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def backfill_2d_inplace_object(ndarray[object, ndim=2] values,             # <<<<<<<<<<<<<<
 *                                  ndarray[uint8_t, ndim=2] mask,
 *                                  limit=None):
 */
  __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_179backfill_2d_inplace_object, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1664; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_16);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_backfill_2d_inplace_object, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1664; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;

  /* "pandas/src/generated.pyx":1698
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def backfill_2d_inplace_int32(ndarray[int32_t, ndim=2] values,             # <<<<<<<<<<<<<<
 *                                  ndarray[uint8_t, ndim=2] mask,
 *                                  limit=None):
 */
  __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_181backfill_2d_inplace_int32, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1698; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_16);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_backfill_2d_inplace_int32, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1698; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;

  /* "pandas/src/generated.pyx":1732
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def backfill_2d_inplace_int64(ndarray[int64_t, ndim=2] values,             # <<<<<<<<<<<<<<
 *                                  ndarray[uint8_t, ndim=2] mask,
 *                                  limit=None):
 */
  __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_183backfill_2d_inplace_int64, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1732; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_16);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_backfill_2d_inplace_int64, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1732; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;

  /* "pandas/src/generated.pyx":1766
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def backfill_2d_inplace_bool(ndarray[uint8_t, ndim=2] values,             # <<<<<<<<<<<<<<
 *                                  ndarray[uint8_t, ndim=2] mask,
 *                                  limit=None):
 */
  __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_185backfill_2d_inplace_bool, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1766; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_16);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_backfill_2d_inplace_bool, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1766; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;

  /* "pandas/src/generated.pyx":1801
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def is_monotonic_float64(ndarray[float64_t] arr):             # <<<<<<<<<<<<<<
 *     '''
 *     Returns
 */
  __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_187is_monotonic_float64, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1801; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_16);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_is_monotonic_float64, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1801; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;

  /* "pandas/src/generated.pyx":1828
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def is_monotonic_float32(ndarray[float32_t] arr):             # <<<<<<<<<<<<<<
 *     '''
 *     Returns
 */
  __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_189is_monotonic_float32, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1828; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_16);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_is_monotonic_float32, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1828; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;

  /* "pandas/src/generated.pyx":1855
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def is_monotonic_object(ndarray[object] arr):             # <<<<<<<<<<<<<<
 *     '''
 *     Returns
 */
  __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_191is_monotonic_object, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1855; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_16);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_is_monotonic_object, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1855; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;

  /* "pandas/src/generated.pyx":1882
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def is_monotonic_int32(ndarray[int32_t] arr):             # <<<<<<<<<<<<<<
 *     '''
 *     Returns
 */
  __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_193is_monotonic_int32, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1882; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_16);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_is_monotonic_int32, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1882; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;

  /* "pandas/src/generated.pyx":1909
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def is_monotonic_int64(ndarray[int64_t] arr):             # <<<<<<<<<<<<<<
 *     '''
 *     Returns
 */
  __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_195is_monotonic_int64, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1909; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_16);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_is_monotonic_int64, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1909; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;

  /* "pandas/src/generated.pyx":1936
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def is_monotonic_bool(ndarray[uint8_t] arr):             # <<<<<<<<<<<<<<
 *     '''
 *     Returns
 */
  __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_197is_monotonic_bool, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1936; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_16);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_is_monotonic_bool, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1936; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;

  /* "pandas/src/generated.pyx":1964
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def groupby_float64(ndarray[float64_t] index, ndarray labels):             # <<<<<<<<<<<<<<
 *     cdef dict result = {}
 *     cdef Py_ssize_t i, length
 */
  __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_199groupby_float64, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1964; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_16);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_groupby_float64, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1964; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;

  /* "pandas/src/generated.pyx":1992
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def groupby_float32(ndarray[float32_t] index, ndarray labels):             # <<<<<<<<<<<<<<
 *     cdef dict result = {}
 *     cdef Py_ssize_t i, length
 */
  __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_201groupby_float32, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1992; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_16);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_groupby_float32, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1992; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;

  /* "pandas/src/generated.pyx":2020
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def groupby_object(ndarray[object] index, ndarray labels):             # <<<<<<<<<<<<<<
 *     cdef dict result = {}
 *     cdef Py_ssize_t i, length
 */
  __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_203groupby_object, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2020; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_16);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_groupby_object, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2020; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;

  /* "pandas/src/generated.pyx":2048
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def groupby_int32(ndarray[int32_t] index, ndarray labels):             # <<<<<<<<<<<<<<
 *     cdef dict result = {}
 *     cdef Py_ssize_t i, length
 */
  __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_205groupby_int32, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2048; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_16);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_groupby_int32, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2048; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;

  /* "pandas/src/generated.pyx":2076
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def groupby_int64(ndarray[int64_t] index, ndarray labels):             # <<<<<<<<<<<<<<
 *     cdef dict result = {}
 *     cdef Py_ssize_t i, length
 */
  __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_207groupby_int64, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2076; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_16);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_groupby_int64, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2076; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;

  /* "pandas/src/generated.pyx":2104
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def groupby_bool(ndarray[uint8_t] index, ndarray labels):             # <<<<<<<<<<<<<<
 *     cdef dict result = {}
 *     cdef Py_ssize_t i, length
 */
  __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_209groupby_bool, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2104; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_16);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_groupby_bool, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2104; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;

  /* "pandas/src/generated.pyx":2133
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def arrmap_float64(ndarray[float64_t] index, object func):             # <<<<<<<<<<<<<<
 *     cdef Py_ssize_t length = index.shape[0]
 *     cdef Py_ssize_t i = 0
 */
  __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_211arrmap_float64, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2133; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_16);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_arrmap_float64, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2133; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;

  /* "pandas/src/generated.pyx":2148
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def arrmap_float32(ndarray[float32_t] index, object func):             # <<<<<<<<<<<<<<
 *     cdef Py_ssize_t length = index.shape[0]
 *     cdef Py_ssize_t i = 0
 */
  __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_213arrmap_float32, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2148; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_16);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_arrmap_float32, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2148; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;

  /* "pandas/src/generated.pyx":2163
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def arrmap_object(ndarray[object] index, object func):             # <<<<<<<<<<<<<<
 *     cdef Py_ssize_t length = index.shape[0]
 *     cdef Py_ssize_t i = 0
 */
  __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_215arrmap_object, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2163; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_16);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_arrmap_object, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2163; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;

  /* "pandas/src/generated.pyx":2178
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def arrmap_int32(ndarray[int32_t] index, object func):             # <<<<<<<<<<<<<<
 *     cdef Py_ssize_t length = index.shape[0]
 *     cdef Py_ssize_t i = 0
 */
  __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_217arrmap_int32, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2178; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_16);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_arrmap_int32, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2178; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;

  /* "pandas/src/generated.pyx":2193
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def arrmap_int64(ndarray[int64_t] index, object func):             # <<<<<<<<<<<<<<
 *     cdef Py_ssize_t length = index.shape[0]
 *     cdef Py_ssize_t i = 0
 */
  __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_219arrmap_int64, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2193; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_16);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_arrmap_int64, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2193; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;

  /* "pandas/src/generated.pyx":2208
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def arrmap_bool(ndarray[uint8_t] index, object func):             # <<<<<<<<<<<<<<
 *     cdef Py_ssize_t length = index.shape[0]
 *     cdef Py_ssize_t i = 0
 */
  __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_221arrmap_bool, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2208; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_16);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_arrmap_bool, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2208; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;

  /* "pandas/src/generated.pyx":2226
 *                               ndarray[int64_t] indexer,
 *                               ndarray[uint8_t] out,
 *                               fill_value=np.nan):             # <<<<<<<<<<<<<<
 *     cdef:
 *         Py_ssize_t i, n, idx
 */
  __pyx_t_16 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2226; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_16);
  __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_16, __pyx_n_s_nan); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2226; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_13);
  __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
  __pyx_k__116 = __pyx_t_13;
  __Pyx_GIVEREF(__pyx_t_13);
  __pyx_t_13 = 0;

  /* "pandas/src/generated.pyx":2223
 * 
 * @cython.wraparound(False)
 * def take_1d_bool_bool(ndarray[uint8_t] values,             # <<<<<<<<<<<<<<
 *                               ndarray[int64_t] indexer,
 *                               ndarray[uint8_t] out,
 */
  __pyx_t_13 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_223take_1d_bool_bool, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2223; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_13);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_take_1d_bool_bool, __pyx_t_13) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2223; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

  /* "pandas/src/generated.pyx":2245
 *                               ndarray[int64_t] indexer,
 *                               ndarray[object] out,
 *                               fill_value=np.nan):             # <<<<<<<<<<<<<<
 *     cdef:
 *         Py_ssize_t i, n, idx
 */
  __pyx_t_13 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2245; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_13);
  __pyx_t_16 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_n_s_nan); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2245; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_16);
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  __pyx_k__117 = __pyx_t_16;
  __Pyx_GIVEREF(__pyx_t_16);
  __pyx_t_16 = 0;

  /* "pandas/src/generated.pyx":2242
 * 
 * @cython.wraparound(False)
 * def take_1d_bool_object(ndarray[uint8_t] values,             # <<<<<<<<<<<<<<
 *                               ndarray[int64_t] indexer,
 *                               ndarray[object] out,
 */
  __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_225take_1d_bool_object, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2242; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_16);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_take_1d_bool_object, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2242; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;

  /* "pandas/src/generated.pyx":2264
 *                               ndarray[int64_t] indexer,
 *                               ndarray[int8_t] out,
 *                               fill_value=np.nan):             # <<<<<<<<<<<<<<
 *     cdef:
 *         Py_ssize_t i, n, idx
 */
  __pyx_t_16 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2264; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_16);
  __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_16, __pyx_n_s_nan); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2264; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_13);
  __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
  __pyx_k__118 = __pyx_t_13;
  __Pyx_GIVEREF(__pyx_t_13);
  __pyx_t_13 = 0;

  /* "pandas/src/generated.pyx":2261
 * 
 * @cython.wraparound(False)
 * def take_1d_int8_int8(ndarray[int8_t] values,             # <<<<<<<<<<<<<<
 *                               ndarray[int64_t] indexer,
 *                               ndarray[int8_t] out,
 */
  __pyx_t_13 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_227take_1d_int8_int8, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2261; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_13);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_take_1d_int8_int8, __pyx_t_13) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2261; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

  /* "pandas/src/generated.pyx":2283
 *                               ndarray[int64_t] indexer,
 *                               ndarray[int32_t] out,
 *                               fill_value=np.nan):             # <<<<<<<<<<<<<<
 *     cdef:
 *         Py_ssize_t i, n, idx
 */
  __pyx_t_13 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2283; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_13);
  __pyx_t_16 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_n_s_nan); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2283; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_16);
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  __pyx_k__119 = __pyx_t_16;
  __Pyx_GIVEREF(__pyx_t_16);
  __pyx_t_16 = 0;

  /* "pandas/src/generated.pyx":2280
 * 
 * @cython.wraparound(False)
 * def take_1d_int8_int32(ndarray[int8_t] values,             # <<<<<<<<<<<<<<
 *                               ndarray[int64_t] indexer,
 *                               ndarray[int32_t] out,
 */
  __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_229take_1d_int8_int32, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2280; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_16);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_take_1d_int8_int32, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2280; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;

  /* "pandas/src/generated.pyx":2302
 *                               ndarray[int64_t] indexer,
 *                               ndarray[int64_t] out,
 *                               fill_value=np.nan):             # <<<<<<<<<<<<<<
 *     cdef:
 *         Py_ssize_t i, n, idx
 */
  __pyx_t_16 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2302; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_16);
  __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_16, __pyx_n_s_nan); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2302; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_13);
  __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
  __pyx_k__120 = __pyx_t_13;
  __Pyx_GIVEREF(__pyx_t_13);
  __pyx_t_13 = 0;

  /* "pandas/src/generated.pyx":2299
 * 
 * @cython.wraparound(False)
 * def take_1d_int8_int64(ndarray[int8_t] values,             # <<<<<<<<<<<<<<
 *                               ndarray[int64_t] indexer,
 *                               ndarray[int64_t] out,
 */
  __pyx_t_13 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_231take_1d_int8_int64, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2299; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_13);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_take_1d_int8_int64, __pyx_t_13) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2299; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

  /* "pandas/src/generated.pyx":2321
 *                               ndarray[int64_t] indexer,
 *                               ndarray[float64_t] out,
 *                               fill_value=np.nan):             # <<<<<<<<<<<<<<
 *     cdef:
 *         Py_ssize_t i, n, idx
 */
  __pyx_t_13 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2321; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_13);
  __pyx_t_16 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_n_s_nan); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2321; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_16);
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  __pyx_k__121 = __pyx_t_16;
  __Pyx_GIVEREF(__pyx_t_16);
  __pyx_t_16 = 0;

  /* "pandas/src/generated.pyx":2318
 * 
 * @cython.wraparound(False)
 * def take_1d_int8_float64(ndarray[int8_t] values,             # <<<<<<<<<<<<<<
 *                               ndarray[int64_t] indexer,
 *                               ndarray[float64_t] out,
 */
  __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_233take_1d_int8_float64, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2318; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_16);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_take_1d_int8_float64, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2318; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;

  /* "pandas/src/generated.pyx":2340
 *                               ndarray[int64_t] indexer,
 *                               ndarray[int16_t] out,
 *                               fill_value=np.nan):             # <<<<<<<<<<<<<<
 *     cdef:
 *         Py_ssize_t i, n, idx
 */
  __pyx_t_16 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2340; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_16);
  __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_16, __pyx_n_s_nan); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2340; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_13);
  __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
  __pyx_k__122 = __pyx_t_13;
  __Pyx_GIVEREF(__pyx_t_13);
  __pyx_t_13 = 0;

  /* "pandas/src/generated.pyx":2337
 * 
 * @cython.wraparound(False)
 * def take_1d_int16_int16(ndarray[int16_t] values,             # <<<<<<<<<<<<<<
 *                               ndarray[int64_t] indexer,
 *                               ndarray[int16_t] out,
 */
  __pyx_t_13 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_235take_1d_int16_int16, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2337; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_13);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_take_1d_int16_int16, __pyx_t_13) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2337; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

  /* "pandas/src/generated.pyx":2359
 *                               ndarray[int64_t] indexer,
 *                               ndarray[int32_t] out,
 *                               fill_value=np.nan):             # <<<<<<<<<<<<<<
 *     cdef:
 *         Py_ssize_t i, n, idx
 */
  __pyx_t_13 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2359; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_13);
  __pyx_t_16 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_n_s_nan); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2359; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_16);
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  __pyx_k__123 = __pyx_t_16;
  __Pyx_GIVEREF(__pyx_t_16);
  __pyx_t_16 = 0;

  /* "pandas/src/generated.pyx":2356
 * 
 * @cython.wraparound(False)
 * def take_1d_int16_int32(ndarray[int16_t] values,             # <<<<<<<<<<<<<<
 *                               ndarray[int64_t] indexer,
 *                               ndarray[int32_t] out,
 */
  __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_237take_1d_int16_int32, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2356; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_16);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_take_1d_int16_int32, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2356; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;

  /* "pandas/src/generated.pyx":2378
 *                               ndarray[int64_t] indexer,
 *                               ndarray[int64_t] out,
 *                               fill_value=np.nan):             # <<<<<<<<<<<<<<
 *     cdef:
 *         Py_ssize_t i, n, idx
 */
  __pyx_t_16 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2378; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_16);
  __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_16, __pyx_n_s_nan); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2378; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_13);
  __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
  __pyx_k__124 = __pyx_t_13;
  __Pyx_GIVEREF(__pyx_t_13);
  __pyx_t_13 = 0;

  /* "pandas/src/generated.pyx":2375
 * 
 * @cython.wraparound(False)
 * def take_1d_int16_int64(ndarray[int16_t] values,             # <<<<<<<<<<<<<<
 *                               ndarray[int64_t] indexer,
 *                               ndarray[int64_t] out,
 */
  __pyx_t_13 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_239take_1d_int16_int64, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2375; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_13);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_take_1d_int16_int64, __pyx_t_13) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2375; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

  /* "pandas/src/generated.pyx":2397
 *                               ndarray[int64_t] indexer,
 *                               ndarray[float64_t] out,
 *                               fill_value=np.nan):             # <<<<<<<<<<<<<<
 *     cdef:
 *         Py_ssize_t i, n, idx
 */
  __pyx_t_13 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2397; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_13);
  __pyx_t_16 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_n_s_nan); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2397; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_16);
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  __pyx_k__125 = __pyx_t_16;
  __Pyx_GIVEREF(__pyx_t_16);
  __pyx_t_16 = 0;

  /* "pandas/src/generated.pyx":2394
 * 
 * @cython.wraparound(False)
 * def take_1d_int16_float64(ndarray[int16_t] values,             # <<<<<<<<<<<<<<
 *                               ndarray[int64_t] indexer,
 *                               ndarray[float64_t] out,
 */
  __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_241take_1d_int16_float64, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2394; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_16);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_take_1d_int16_float64, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2394; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;

  /* "pandas/src/generated.pyx":2416
 *                               ndarray[int64_t] indexer,
 *                               ndarray[int32_t] out,
 *                               fill_value=np.nan):             # <<<<<<<<<<<<<<
 *     cdef:
 *         Py_ssize_t i, n, idx
 */
  __pyx_t_16 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2416; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_16);
  __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_16, __pyx_n_s_nan); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2416; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_13);
  __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
  __pyx_k__126 = __pyx_t_13;
  __Pyx_GIVEREF(__pyx_t_13);
  __pyx_t_13 = 0;

  /* "pandas/src/generated.pyx":2413
 * 
 * @cython.wraparound(False)
 * def take_1d_int32_int32(ndarray[int32_t] values,             # <<<<<<<<<<<<<<
 *                               ndarray[int64_t] indexer,
 *                               ndarray[int32_t] out,
 */
  __pyx_t_13 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_243take_1d_int32_int32, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2413; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_13);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_take_1d_int32_int32, __pyx_t_13) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2413; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

  /* "pandas/src/generated.pyx":2435
 *                               ndarray[int64_t] indexer,
 *                               ndarray[int64_t] out,
 *                               fill_value=np.nan):             # <<<<<<<<<<<<<<
 *     cdef:
 *         Py_ssize_t i, n, idx
 */
  __pyx_t_13 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2435; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_13);
  __pyx_t_16 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_n_s_nan); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2435; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_16);
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  __pyx_k__127 = __pyx_t_16;
  __Pyx_GIVEREF(__pyx_t_16);
  __pyx_t_16 = 0;

  /* "pandas/src/generated.pyx":2432
 * 
 * @cython.wraparound(False)
 * def take_1d_int32_int64(ndarray[int32_t] values,             # <<<<<<<<<<<<<<
 *                               ndarray[int64_t] indexer,
 *                               ndarray[int64_t] out,
 */
  __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_245take_1d_int32_int64, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2432; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_16);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_take_1d_int32_int64, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2432; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;

  /* "pandas/src/generated.pyx":2454
 *                               ndarray[int64_t] indexer,
 *                               ndarray[float64_t] out,
 *                               fill_value=np.nan):             # <<<<<<<<<<<<<<
 *     cdef:
 *         Py_ssize_t i, n, idx
 */
  __pyx_t_16 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2454; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_16);
  __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_16, __pyx_n_s_nan); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2454; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_13);
  __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
  __pyx_k__128 = __pyx_t_13;
  __Pyx_GIVEREF(__pyx_t_13);
  __pyx_t_13 = 0;

  /* "pandas/src/generated.pyx":2451
 * 
 * @cython.wraparound(False)
 * def take_1d_int32_float64(ndarray[int32_t] values,             # <<<<<<<<<<<<<<
 *                               ndarray[int64_t] indexer,
 *                               ndarray[float64_t] out,
 */
  __pyx_t_13 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_247take_1d_int32_float64, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2451; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_13);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_take_1d_int32_float64, __pyx_t_13) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2451; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

  /* "pandas/src/generated.pyx":2473
 *                               ndarray[int64_t] indexer,
 *                               ndarray[int64_t] out,
 *                               fill_value=np.nan):             # <<<<<<<<<<<<<<
 *     cdef:
 *         Py_ssize_t i, n, idx
 */
  __pyx_t_13 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2473; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_13);
  __pyx_t_16 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_n_s_nan); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2473; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_16);
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  __pyx_k__129 = __pyx_t_16;
  __Pyx_GIVEREF(__pyx_t_16);
  __pyx_t_16 = 0;

  /* "pandas/src/generated.pyx":2470
 * 
 * @cython.wraparound(False)
 * def take_1d_int64_int64(ndarray[int64_t] values,             # <<<<<<<<<<<<<<
 *                               ndarray[int64_t] indexer,
 *                               ndarray[int64_t] out,
 */
  __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_249take_1d_int64_int64, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2470; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_16);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_take_1d_int64_int64, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2470; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;

  /* "pandas/src/generated.pyx":2492
 *                               ndarray[int64_t] indexer,
 *                               ndarray[float64_t] out,
 *                               fill_value=np.nan):             # <<<<<<<<<<<<<<
 *     cdef:
 *         Py_ssize_t i, n, idx
 */
  __pyx_t_16 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2492; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_16);
  __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_16, __pyx_n_s_nan); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2492; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_13);
  __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
  __pyx_k__130 = __pyx_t_13;
  __Pyx_GIVEREF(__pyx_t_13);
  __pyx_t_13 = 0;

  /* "pandas/src/generated.pyx":2489
 * 
 * @cython.wraparound(False)
 * def take_1d_int64_float64(ndarray[int64_t] values,             # <<<<<<<<<<<<<<
 *                               ndarray[int64_t] indexer,
 *                               ndarray[float64_t] out,
 */
  __pyx_t_13 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_251take_1d_int64_float64, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2489; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_13);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_take_1d_int64_float64, __pyx_t_13) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2489; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

  /* "pandas/src/generated.pyx":2511
 *                               ndarray[int64_t] indexer,
 *                               ndarray[float32_t] out,
 *                               fill_value=np.nan):             # <<<<<<<<<<<<<<
 *     cdef:
 *         Py_ssize_t i, n, idx
 */
  __pyx_t_13 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2511; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_13);
  __pyx_t_16 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_n_s_nan); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2511; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_16);
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  __pyx_k__131 = __pyx_t_16;
  __Pyx_GIVEREF(__pyx_t_16);
  __pyx_t_16 = 0;

  /* "pandas/src/generated.pyx":2508
 * 
 * @cython.wraparound(False)
 * def take_1d_float32_float32(ndarray[float32_t] values,             # <<<<<<<<<<<<<<
 *                               ndarray[int64_t] indexer,
 *                               ndarray[float32_t] out,
 */
  __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_253take_1d_float32_float32, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2508; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_16);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_take_1d_float32_float32, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2508; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;

  /* "pandas/src/generated.pyx":2530
 *                               ndarray[int64_t] indexer,
 *                               ndarray[float64_t] out,
 *                               fill_value=np.nan):             # <<<<<<<<<<<<<<
 *     cdef:
 *         Py_ssize_t i, n, idx
 */
  __pyx_t_16 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2530; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_16);
  __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_16, __pyx_n_s_nan); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2530; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_13);
  __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
  __pyx_k__132 = __pyx_t_13;
  __Pyx_GIVEREF(__pyx_t_13);
  __pyx_t_13 = 0;

  /* "pandas/src/generated.pyx":2527
 * 
 * @cython.wraparound(False)
 * def take_1d_float32_float64(ndarray[float32_t] values,             # <<<<<<<<<<<<<<
 *                               ndarray[int64_t] indexer,
 *                               ndarray[float64_t] out,
 */
  __pyx_t_13 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_255take_1d_float32_float64, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2527; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_13);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_take_1d_float32_float64, __pyx_t_13) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2527; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

  /* "pandas/src/generated.pyx":2549
 *                               ndarray[int64_t] indexer,
 *                               ndarray[float64_t] out,
 *                               fill_value=np.nan):             # <<<<<<<<<<<<<<
 *     cdef:
 *         Py_ssize_t i, n, idx
 */
  __pyx_t_13 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2549; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_13);
  __pyx_t_16 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_n_s_nan); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2549; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_16);
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  __pyx_k__133 = __pyx_t_16;
  __Pyx_GIVEREF(__pyx_t_16);
  __pyx_t_16 = 0;

  /* "pandas/src/generated.pyx":2546
 * 
 * @cython.wraparound(False)
 * def take_1d_float64_float64(ndarray[float64_t] values,             # <<<<<<<<<<<<<<
 *                               ndarray[int64_t] indexer,
 *                               ndarray[float64_t] out,
 */
  __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_257take_1d_float64_float64, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2546; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_16);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_take_1d_float64_float64, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2546; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;

  /* "pandas/src/generated.pyx":2568
 *                               ndarray[int64_t] indexer,
 *                               ndarray[object] out,
 *                               fill_value=np.nan):             # <<<<<<<<<<<<<<
 *     cdef:
 *         Py_ssize_t i, n, idx
 */
  __pyx_t_16 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2568; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_16);
  __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_16, __pyx_n_s_nan); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2568; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_13);
  __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
  __pyx_k__134 = __pyx_t_13;
  __Pyx_GIVEREF(__pyx_t_13);
  __pyx_t_13 = 0;

  /* "pandas/src/generated.pyx":2565
 * 
 * @cython.wraparound(False)
 * def take_1d_object_object(ndarray[object] values,             # <<<<<<<<<<<<<<
 *                               ndarray[int64_t] indexer,
 *                               ndarray[object] out,
 */
  __pyx_t_13 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_259take_1d_object_object, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2565; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_13);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_take_1d_object_object, __pyx_t_13) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2565; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

  /* "pandas/src/generated.pyx":2589
 *                                     ndarray[int64_t] indexer,
 *                                     uint8_t[:, :] out,
 *                                     fill_value=np.nan):             # <<<<<<<<<<<<<<
 *     cdef:
 *         Py_ssize_t i, j, k, n, idx
 */
  __pyx_t_13 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2589; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_13);
  __pyx_t_16 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_n_s_nan); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2589; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_16);
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  __pyx_k__135 = __pyx_t_16;
  __Pyx_GIVEREF(__pyx_t_16);
  __pyx_t_16 = 0;

  /* "pandas/src/generated.pyx":2586
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def take_2d_axis0_bool_bool(uint8_t[:, :] values,             # <<<<<<<<<<<<<<
 *                                     ndarray[int64_t] indexer,
 *                                     uint8_t[:, :] out,
 */
  __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_261take_2d_axis0_bool_bool, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2586; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_16);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_take_2d_axis0_bool_bool, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2586; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;

  /* "pandas/src/generated.pyx":2634
 *                                     ndarray[int64_t] indexer,
 *                                     object[:, :] out,
 *                                     fill_value=np.nan):             # <<<<<<<<<<<<<<
 *     cdef:
 *         Py_ssize_t i, j, k, n, idx
 */
  __pyx_t_16 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2634; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_16);
  __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_16, __pyx_n_s_nan); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2634; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_13);
  __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
  __pyx_k__136 = __pyx_t_13;
  __Pyx_GIVEREF(__pyx_t_13);
  __pyx_t_13 = 0;

  /* "pandas/src/generated.pyx":2631
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def take_2d_axis0_bool_object(uint8_t[:, :] values,             # <<<<<<<<<<<<<<
 *                                     ndarray[int64_t] indexer,
 *                                     object[:, :] out,
 */
  __pyx_t_13 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_263take_2d_axis0_bool_object, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2631; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_13);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_take_2d_axis0_bool_object, __pyx_t_13) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2631; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

  /* "pandas/src/generated.pyx":2679
 *                                     ndarray[int64_t] indexer,
 *                                     int8_t[:, :] out,
 *                                     fill_value=np.nan):             # <<<<<<<<<<<<<<
 *     cdef:
 *         Py_ssize_t i, j, k, n, idx
 */
  __pyx_t_13 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2679; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_13);
  __pyx_t_16 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_n_s_nan); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2679; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_16);
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  __pyx_k__137 = __pyx_t_16;
  __Pyx_GIVEREF(__pyx_t_16);
  __pyx_t_16 = 0;

  /* "pandas/src/generated.pyx":2676
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def take_2d_axis0_int8_int8(int8_t[:, :] values,             # <<<<<<<<<<<<<<
 *                                     ndarray[int64_t] indexer,
 *                                     int8_t[:, :] out,
 */
  __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_265take_2d_axis0_int8_int8, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2676; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_16);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_take_2d_axis0_int8_int8, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2676; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;

  /* "pandas/src/generated.pyx":2724
 *                                     ndarray[int64_t] indexer,
 *                                     int32_t[:, :] out,
 *                                     fill_value=np.nan):             # <<<<<<<<<<<<<<
 *     cdef:
 *         Py_ssize_t i, j, k, n, idx
 */
  __pyx_t_16 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2724; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_16);
  __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_16, __pyx_n_s_nan); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2724; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_13);
  __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
  __pyx_k__138 = __pyx_t_13;
  __Pyx_GIVEREF(__pyx_t_13);
  __pyx_t_13 = 0;

  /* "pandas/src/generated.pyx":2721
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def take_2d_axis0_int8_int32(int8_t[:, :] values,             # <<<<<<<<<<<<<<
 *                                     ndarray[int64_t] indexer,
 *                                     int32_t[:, :] out,
 */
  __pyx_t_13 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_267take_2d_axis0_int8_int32, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2721; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_13);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_take_2d_axis0_int8_int32, __pyx_t_13) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2721; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

  /* "pandas/src/generated.pyx":2769
 *                                     ndarray[int64_t] indexer,
 *                                     int64_t[:, :] out,
 *                                     fill_value=np.nan):             # <<<<<<<<<<<<<<
 *     cdef:
 *         Py_ssize_t i, j, k, n, idx
 */
  __pyx_t_13 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2769; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_13);
  __pyx_t_16 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_n_s_nan); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2769; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_16);
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  __pyx_k__139 = __pyx_t_16;
  __Pyx_GIVEREF(__pyx_t_16);
  __pyx_t_16 = 0;

  /* "pandas/src/generated.pyx":2766
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def take_2d_axis0_int8_int64(int8_t[:, :] values,             # <<<<<<<<<<<<<<
 *                                     ndarray[int64_t] indexer,
 *                                     int64_t[:, :] out,
 */
  __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_269take_2d_axis0_int8_int64, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2766; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_16);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_take_2d_axis0_int8_int64, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2766; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;

  /* "pandas/src/generated.pyx":2814
 *                                     ndarray[int64_t] indexer,
 *                                     float64_t[:, :] out,
 *                                     fill_value=np.nan):             # <<<<<<<<<<<<<<
 *     cdef:
 *         Py_ssize_t i, j, k, n, idx
 */
  __pyx_t_16 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2814; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_16);
  __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_16, __pyx_n_s_nan); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2814; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_13);
  __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
  __pyx_k__140 = __pyx_t_13;
  __Pyx_GIVEREF(__pyx_t_13);
  __pyx_t_13 = 0;

  /* "pandas/src/generated.pyx":2811
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def take_2d_axis0_int8_float64(int8_t[:, :] values,             # <<<<<<<<<<<<<<
 *                                     ndarray[int64_t] indexer,
 *                                     float64_t[:, :] out,
 */
  __pyx_t_13 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_271take_2d_axis0_int8_float64, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2811; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_13);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_take_2d_axis0_int8_float64, __pyx_t_13) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2811; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

  /* "pandas/src/generated.pyx":2859
 *                                     ndarray[int64_t] indexer,
 *                                     int16_t[:, :] out,
 *                                     fill_value=np.nan):             # <<<<<<<<<<<<<<
 *     cdef:
 *         Py_ssize_t i, j, k, n, idx
 */
  __pyx_t_13 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2859; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_13);
  __pyx_t_16 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_n_s_nan); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2859; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_16);
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  __pyx_k__141 = __pyx_t_16;
  __Pyx_GIVEREF(__pyx_t_16);
  __pyx_t_16 = 0;

  /* "pandas/src/generated.pyx":2856
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def take_2d_axis0_int16_int16(int16_t[:, :] values,             # <<<<<<<<<<<<<<
 *                                     ndarray[int64_t] indexer,
 *                                     int16_t[:, :] out,
 */
  __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_273take_2d_axis0_int16_int16, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2856; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_16);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_take_2d_axis0_int16_int16, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2856; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;

  /* "pandas/src/generated.pyx":2904
 *                                     ndarray[int64_t] indexer,
 *                                     int32_t[:, :] out,
 *                                     fill_value=np.nan):             # <<<<<<<<<<<<<<
 *     cdef:
 *         Py_ssize_t i, j, k, n, idx
 */
  __pyx_t_16 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2904; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_16);
  __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_16, __pyx_n_s_nan); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2904; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_13);
  __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
  __pyx_k__142 = __pyx_t_13;
  __Pyx_GIVEREF(__pyx_t_13);
  __pyx_t_13 = 0;

  /* "pandas/src/generated.pyx":2901
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def take_2d_axis0_int16_int32(int16_t[:, :] values,             # <<<<<<<<<<<<<<
 *                                     ndarray[int64_t] indexer,
 *                                     int32_t[:, :] out,
 */
  __pyx_t_13 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_275take_2d_axis0_int16_int32, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2901; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_13);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_take_2d_axis0_int16_int32, __pyx_t_13) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2901; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

  /* "pandas/src/generated.pyx":2949
 *                                     ndarray[int64_t] indexer,
 *                                     int64_t[:, :] out,
 *                                     fill_value=np.nan):             # <<<<<<<<<<<<<<
 *     cdef:
 *         Py_ssize_t i, j, k, n, idx
 */
  __pyx_t_13 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2949; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_13);
  __pyx_t_16 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_n_s_nan); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2949; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_16);
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  __pyx_k__143 = __pyx_t_16;
  __Pyx_GIVEREF(__pyx_t_16);
  __pyx_t_16 = 0;

  /* "pandas/src/generated.pyx":2946
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def take_2d_axis0_int16_int64(int16_t[:, :] values,             # <<<<<<<<<<<<<<
 *                                     ndarray[int64_t] indexer,
 *                                     int64_t[:, :] out,
 */
  __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_277take_2d_axis0_int16_int64, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2946; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_16);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_take_2d_axis0_int16_int64, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2946; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;

  /* "pandas/src/generated.pyx":2994
 *                                     ndarray[int64_t] indexer,
 *                                     float64_t[:, :] out,
 *                                     fill_value=np.nan):             # <<<<<<<<<<<<<<
 *     cdef:
 *         Py_ssize_t i, j, k, n, idx
 */
  __pyx_t_16 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2994; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_16);
  __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_16, __pyx_n_s_nan); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2994; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_13);
  __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
  __pyx_k__144 = __pyx_t_13;
  __Pyx_GIVEREF(__pyx_t_13);
  __pyx_t_13 = 0;

  /* "pandas/src/generated.pyx":2991
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def take_2d_axis0_int16_float64(int16_t[:, :] values,             # <<<<<<<<<<<<<<
 *                                     ndarray[int64_t] indexer,
 *                                     float64_t[:, :] out,
 */
  __pyx_t_13 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_279take_2d_axis0_int16_float64, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2991; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_13);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_take_2d_axis0_int16_float64, __pyx_t_13) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2991; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

  /* "pandas/src/generated.pyx":3039
 *                                     ndarray[int64_t] indexer,
 *                                     int32_t[:, :] out,
 *                                     fill_value=np.nan):             # <<<<<<<<<<<<<<
 *     cdef:
 *         Py_ssize_t i, j, k, n, idx
 */
  __pyx_t_13 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3039; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_13);
  __pyx_t_16 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_n_s_nan); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3039; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_16);
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  __pyx_k__145 = __pyx_t_16;
  __Pyx_GIVEREF(__pyx_t_16);
  __pyx_t_16 = 0;

  /* "pandas/src/generated.pyx":3036
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def take_2d_axis0_int32_int32(int32_t[:, :] values,             # <<<<<<<<<<<<<<
 *                                     ndarray[int64_t] indexer,
 *                                     int32_t[:, :] out,
 */
  __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_281take_2d_axis0_int32_int32, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3036; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_16);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_take_2d_axis0_int32_int32, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3036; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;

  /* "pandas/src/generated.pyx":3084
 *                                     ndarray[int64_t] indexer,
 *                                     int64_t[:, :] out,
 *                                     fill_value=np.nan):             # <<<<<<<<<<<<<<
 *     cdef:
 *         Py_ssize_t i, j, k, n, idx
 */
  __pyx_t_16 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3084; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_16);
  __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_16, __pyx_n_s_nan); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3084; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_13);
  __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
  __pyx_k__146 = __pyx_t_13;
  __Pyx_GIVEREF(__pyx_t_13);
  __pyx_t_13 = 0;

  /* "pandas/src/generated.pyx":3081
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def take_2d_axis0_int32_int64(int32_t[:, :] values,             # <<<<<<<<<<<<<<
 *                                     ndarray[int64_t] indexer,
 *                                     int64_t[:, :] out,
 */
  __pyx_t_13 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_283take_2d_axis0_int32_int64, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3081; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_13);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_take_2d_axis0_int32_int64, __pyx_t_13) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3081; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

  /* "pandas/src/generated.pyx":3129
 *                                     ndarray[int64_t] indexer,
 *                                     float64_t[:, :] out,
 *                                     fill_value=np.nan):             # <<<<<<<<<<<<<<
 *     cdef:
 *         Py_ssize_t i, j, k, n, idx
 */
  __pyx_t_13 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3129; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_13);
  __pyx_t_16 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_n_s_nan); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3129; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_16);
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  __pyx_k__147 = __pyx_t_16;
  __Pyx_GIVEREF(__pyx_t_16);
  __pyx_t_16 = 0;

  /* "pandas/src/generated.pyx":3126
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def take_2d_axis0_int32_float64(int32_t[:, :] values,             # <<<<<<<<<<<<<<
 *                                     ndarray[int64_t] indexer,
 *                                     float64_t[:, :] out,
 */
  __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_285take_2d_axis0_int32_float64, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3126; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_16);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_take_2d_axis0_int32_float64, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3126; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;

  /* "pandas/src/generated.pyx":3174
 *                                     ndarray[int64_t] indexer,
 *                                     int64_t[:, :] out,
 *                                     fill_value=np.nan):             # <<<<<<<<<<<<<<
 *     cdef:
 *         Py_ssize_t i, j, k, n, idx
 */
  __pyx_t_16 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3174; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_16);
  __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_16, __pyx_n_s_nan); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3174; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_13);
  __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
  __pyx_k__148 = __pyx_t_13;
  __Pyx_GIVEREF(__pyx_t_13);
  __pyx_t_13 = 0;

  /* "pandas/src/generated.pyx":3171
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def take_2d_axis0_int64_int64(int64_t[:, :] values,             # <<<<<<<<<<<<<<
 *                                     ndarray[int64_t] indexer,
 *                                     int64_t[:, :] out,
 */
  __pyx_t_13 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_287take_2d_axis0_int64_int64, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3171; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_13);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_take_2d_axis0_int64_int64, __pyx_t_13) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3171; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

  /* "pandas/src/generated.pyx":3219
 *                                     ndarray[int64_t] indexer,
 *                                     float64_t[:, :] out,
 *                                     fill_value=np.nan):             # <<<<<<<<<<<<<<
 *     cdef:
 *         Py_ssize_t i, j, k, n, idx
 */
  __pyx_t_13 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3219; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_13);
  __pyx_t_16 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_n_s_nan); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3219; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_16);
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  __pyx_k__149 = __pyx_t_16;
  __Pyx_GIVEREF(__pyx_t_16);
  __pyx_t_16 = 0;

  /* "pandas/src/generated.pyx":3216
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def take_2d_axis0_int64_float64(int64_t[:, :] values,             # <<<<<<<<<<<<<<
 *                                     ndarray[int64_t] indexer,
 *                                     float64_t[:, :] out,
 */
  __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_289take_2d_axis0_int64_float64, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3216; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_16);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_take_2d_axis0_int64_float64, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3216; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;

  /* "pandas/src/generated.pyx":3264
 *                                     ndarray[int64_t] indexer,
 *                                     float32_t[:, :] out,
 *                                     fill_value=np.nan):             # <<<<<<<<<<<<<<
 *     cdef:
 *         Py_ssize_t i, j, k, n, idx
 */
  __pyx_t_16 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3264; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_16);
  __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_16, __pyx_n_s_nan); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3264; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_13);
  __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
  __pyx_k__150 = __pyx_t_13;
  __Pyx_GIVEREF(__pyx_t_13);
  __pyx_t_13 = 0;

  /* "pandas/src/generated.pyx":3261
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def take_2d_axis0_float32_float32(float32_t[:, :] values,             # <<<<<<<<<<<<<<
 *                                     ndarray[int64_t] indexer,
 *                                     float32_t[:, :] out,
 */
  __pyx_t_13 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_291take_2d_axis0_float32_float32, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3261; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_13);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_take_2d_axis0_float32_float32, __pyx_t_13) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3261; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

  /* "pandas/src/generated.pyx":3309
 *                                     ndarray[int64_t] indexer,
 *                                     float64_t[:, :] out,
 *                                     fill_value=np.nan):             # <<<<<<<<<<<<<<
 *     cdef:
 *         Py_ssize_t i, j, k, n, idx
 */
  __pyx_t_13 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3309; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_13);
  __pyx_t_16 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_n_s_nan); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3309; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_16);
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  __pyx_k__151 = __pyx_t_16;
  __Pyx_GIVEREF(__pyx_t_16);
  __pyx_t_16 = 0;

  /* "pandas/src/generated.pyx":3306
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def take_2d_axis0_float32_float64(float32_t[:, :] values,             # <<<<<<<<<<<<<<
 *                                     ndarray[int64_t] indexer,
 *                                     float64_t[:, :] out,
 */
  __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_293take_2d_axis0_float32_float64, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3306; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_16);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_take_2d_axis0_float32_float64, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3306; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;

  /* "pandas/src/generated.pyx":3354
 *                                     ndarray[int64_t] indexer,
 *                                     float64_t[:, :] out,
 *                                     fill_value=np.nan):             # <<<<<<<<<<<<<<
 *     cdef:
 *         Py_ssize_t i, j, k, n, idx
 */
  __pyx_t_16 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3354; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_16);
  __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_16, __pyx_n_s_nan); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3354; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_13);
  __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
  __pyx_k__152 = __pyx_t_13;
  __Pyx_GIVEREF(__pyx_t_13);
  __pyx_t_13 = 0;

  /* "pandas/src/generated.pyx":3351
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def take_2d_axis0_float64_float64(float64_t[:, :] values,             # <<<<<<<<<<<<<<
 *                                     ndarray[int64_t] indexer,
 *                                     float64_t[:, :] out,
 */
  __pyx_t_13 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_295take_2d_axis0_float64_float64, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3351; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_13);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_take_2d_axis0_float64_float64, __pyx_t_13) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3351; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

  /* "pandas/src/generated.pyx":3399
 *                                     ndarray[int64_t] indexer,
 *                                     object[:, :] out,
 *                                     fill_value=np.nan):             # <<<<<<<<<<<<<<
 *     cdef:
 *         Py_ssize_t i, j, k, n, idx
 */
  __pyx_t_13 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3399; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_13);
  __pyx_t_16 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_n_s_nan); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3399; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_16);
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  __pyx_k__153 = __pyx_t_16;
  __Pyx_GIVEREF(__pyx_t_16);
  __pyx_t_16 = 0;

  /* "pandas/src/generated.pyx":3396
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def take_2d_axis0_object_object(object[:, :] values,             # <<<<<<<<<<<<<<
 *                                     ndarray[int64_t] indexer,
 *                                     object[:, :] out,
 */
  __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_297take_2d_axis0_object_object, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3396; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_16);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_take_2d_axis0_object_object, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3396; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;

  /* "pandas/src/generated.pyx":3445
 *                                     ndarray[int64_t] indexer,
 *                                     uint8_t[:, :] out,
 *                                     fill_value=np.nan):             # <<<<<<<<<<<<<<
 *     cdef:
 *         Py_ssize_t i, j, k, n, idx
 */
  __pyx_t_16 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3445; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_16);
  __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_16, __pyx_n_s_nan); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3445; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_13);
  __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
  __pyx_k__154 = __pyx_t_13;
  __Pyx_GIVEREF(__pyx_t_13);
  __pyx_t_13 = 0;

  /* "pandas/src/generated.pyx":3442
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def take_2d_axis1_bool_bool(uint8_t[:, :] values,             # <<<<<<<<<<<<<<
 *                                     ndarray[int64_t] indexer,
 *                                     uint8_t[:, :] out,
 */
  __pyx_t_13 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_299take_2d_axis1_bool_bool, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3442; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_13);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_take_2d_axis1_bool_bool, __pyx_t_13) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3442; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

  /* "pandas/src/generated.pyx":3471
 *                                     ndarray[int64_t] indexer,
 *                                     object[:, :] out,
 *                                     fill_value=np.nan):             # <<<<<<<<<<<<<<
 *     cdef:
 *         Py_ssize_t i, j, k, n, idx
 */
  __pyx_t_13 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3471; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_13);
  __pyx_t_16 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_n_s_nan); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3471; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_16);
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  __pyx_k__155 = __pyx_t_16;
  __Pyx_GIVEREF(__pyx_t_16);
  __pyx_t_16 = 0;

  /* "pandas/src/generated.pyx":3468
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def take_2d_axis1_bool_object(uint8_t[:, :] values,             # <<<<<<<<<<<<<<
 *                                     ndarray[int64_t] indexer,
 *                                     object[:, :] out,
 */
  __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_301take_2d_axis1_bool_object, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3468; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_16);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_take_2d_axis1_bool_object, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3468; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;

  /* "pandas/src/generated.pyx":3497
 *                                     ndarray[int64_t] indexer,
 *                                     int8_t[:, :] out,
 *                                     fill_value=np.nan):             # <<<<<<<<<<<<<<
 *     cdef:
 *         Py_ssize_t i, j, k, n, idx
 */
  __pyx_t_16 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3497; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_16);
  __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_16, __pyx_n_s_nan); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3497; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_13);
  __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
  __pyx_k__156 = __pyx_t_13;
  __Pyx_GIVEREF(__pyx_t_13);
  __pyx_t_13 = 0;

  /* "pandas/src/generated.pyx":3494
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def take_2d_axis1_int8_int8(int8_t[:, :] values,             # <<<<<<<<<<<<<<
 *                                     ndarray[int64_t] indexer,
 *                                     int8_t[:, :] out,
 */
  __pyx_t_13 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_303take_2d_axis1_int8_int8, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3494; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_13);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_take_2d_axis1_int8_int8, __pyx_t_13) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3494; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

  /* "pandas/src/generated.pyx":3523
 *                                     ndarray[int64_t] indexer,
 *                                     int32_t[:, :] out,
 *                                     fill_value=np.nan):             # <<<<<<<<<<<<<<
 *     cdef:
 *         Py_ssize_t i, j, k, n, idx
 */
  __pyx_t_13 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3523; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_13);
  __pyx_t_16 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_n_s_nan); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3523; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_16);
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  __pyx_k__157 = __pyx_t_16;
  __Pyx_GIVEREF(__pyx_t_16);
  __pyx_t_16 = 0;

  /* "pandas/src/generated.pyx":3520
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def take_2d_axis1_int8_int32(int8_t[:, :] values,             # <<<<<<<<<<<<<<
 *                                     ndarray[int64_t] indexer,
 *                                     int32_t[:, :] out,
 */
  __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_305take_2d_axis1_int8_int32, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3520; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_16);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_take_2d_axis1_int8_int32, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3520; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;

  /* "pandas/src/generated.pyx":3549
 *                                     ndarray[int64_t] indexer,
 *                                     int64_t[:, :] out,
 *                                     fill_value=np.nan):             # <<<<<<<<<<<<<<
 *     cdef:
 *         Py_ssize_t i, j, k, n, idx
 */
  __pyx_t_16 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3549; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_16);
  __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_16, __pyx_n_s_nan); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3549; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_13);
  __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
  __pyx_k__158 = __pyx_t_13;
  __Pyx_GIVEREF(__pyx_t_13);
  __pyx_t_13 = 0;

  /* "pandas/src/generated.pyx":3546
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def take_2d_axis1_int8_int64(int8_t[:, :] values,             # <<<<<<<<<<<<<<
 *                                     ndarray[int64_t] indexer,
 *                                     int64_t[:, :] out,
 */
  __pyx_t_13 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_307take_2d_axis1_int8_int64, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3546; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_13);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_take_2d_axis1_int8_int64, __pyx_t_13) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3546; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

  /* "pandas/src/generated.pyx":3575
 *                                     ndarray[int64_t] indexer,
 *                                     float64_t[:, :] out,
 *                                     fill_value=np.nan):             # <<<<<<<<<<<<<<
 *     cdef:
 *         Py_ssize_t i, j, k, n, idx
 */
  __pyx_t_13 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3575; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_13);
  __pyx_t_16 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_n_s_nan); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3575; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_16);
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  __pyx_k__159 = __pyx_t_16;
  __Pyx_GIVEREF(__pyx_t_16);
  __pyx_t_16 = 0;

  /* "pandas/src/generated.pyx":3572
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def take_2d_axis1_int8_float64(int8_t[:, :] values,             # <<<<<<<<<<<<<<
 *                                     ndarray[int64_t] indexer,
 *                                     float64_t[:, :] out,
 */
  __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_309take_2d_axis1_int8_float64, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3572; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_16);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_take_2d_axis1_int8_float64, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3572; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;

  /* "pandas/src/generated.pyx":3601
 *                                     ndarray[int64_t] indexer,
 *                                     int16_t[:, :] out,
 *                                     fill_value=np.nan):             # <<<<<<<<<<<<<<
 *     cdef:
 *         Py_ssize_t i, j, k, n, idx
 */
  __pyx_t_16 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3601; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_16);
  __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_16, __pyx_n_s_nan); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3601; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_13);
  __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
  __pyx_k__160 = __pyx_t_13;
  __Pyx_GIVEREF(__pyx_t_13);
  __pyx_t_13 = 0;

  /* "pandas/src/generated.pyx":3598
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def take_2d_axis1_int16_int16(int16_t[:, :] values,             # <<<<<<<<<<<<<<
 *                                     ndarray[int64_t] indexer,
 *                                     int16_t[:, :] out,
 */
  __pyx_t_13 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_311take_2d_axis1_int16_int16, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3598; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_13);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_take_2d_axis1_int16_int16, __pyx_t_13) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3598; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

  /* "pandas/src/generated.pyx":3627
 *                                     ndarray[int64_t] indexer,
 *                                     int32_t[:, :] out,
 *                                     fill_value=np.nan):             # <<<<<<<<<<<<<<
 *     cdef:
 *         Py_ssize_t i, j, k, n, idx
 */
  __pyx_t_13 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3627; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_13);
  __pyx_t_16 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_n_s_nan); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3627; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_16);
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  __pyx_k__161 = __pyx_t_16;
  __Pyx_GIVEREF(__pyx_t_16);
  __pyx_t_16 = 0;

  /* "pandas/src/generated.pyx":3624
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def take_2d_axis1_int16_int32(int16_t[:, :] values,             # <<<<<<<<<<<<<<
 *                                     ndarray[int64_t] indexer,
 *                                     int32_t[:, :] out,
 */
  __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_313take_2d_axis1_int16_int32, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3624; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_16);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_take_2d_axis1_int16_int32, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3624; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;

  /* "pandas/src/generated.pyx":3653
 *                                     ndarray[int64_t] indexer,
 *                                     int64_t[:, :] out,
 *                                     fill_value=np.nan):             # <<<<<<<<<<<<<<
 *     cdef:
 *         Py_ssize_t i, j, k, n, idx
 */
  __pyx_t_16 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3653; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_16);
  __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_16, __pyx_n_s_nan); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3653; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_13);
  __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
  __pyx_k__162 = __pyx_t_13;
  __Pyx_GIVEREF(__pyx_t_13);
  __pyx_t_13 = 0;

  /* "pandas/src/generated.pyx":3650
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def take_2d_axis1_int16_int64(int16_t[:, :] values,             # <<<<<<<<<<<<<<
 *                                     ndarray[int64_t] indexer,
 *                                     int64_t[:, :] out,
 */
  __pyx_t_13 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_315take_2d_axis1_int16_int64, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3650; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_13);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_take_2d_axis1_int16_int64, __pyx_t_13) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3650; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

  /* "pandas/src/generated.pyx":3679
 *                                     ndarray[int64_t] indexer,
 *                                     float64_t[:, :] out,
 *                                     fill_value=np.nan):             # <<<<<<<<<<<<<<
 *     cdef:
 *         Py_ssize_t i, j, k, n, idx
 */
  __pyx_t_13 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3679; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_13);
  __pyx_t_16 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_n_s_nan); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3679; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_16);
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  __pyx_k__163 = __pyx_t_16;
  __Pyx_GIVEREF(__pyx_t_16);
  __pyx_t_16 = 0;

  /* "pandas/src/generated.pyx":3676
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def take_2d_axis1_int16_float64(int16_t[:, :] values,             # <<<<<<<<<<<<<<
 *                                     ndarray[int64_t] indexer,
 *                                     float64_t[:, :] out,
 */
  __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_317take_2d_axis1_int16_float64, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3676; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_16);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_take_2d_axis1_int16_float64, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3676; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;

  /* "pandas/src/generated.pyx":3705
 *                                     ndarray[int64_t] indexer,
 *                                     int32_t[:, :] out,
 *                                     fill_value=np.nan):             # <<<<<<<<<<<<<<
 *     cdef:
 *         Py_ssize_t i, j, k, n, idx
 */
  __pyx_t_16 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3705; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_16);
  __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_16, __pyx_n_s_nan); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3705; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_13);
  __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
  __pyx_k__164 = __pyx_t_13;
  __Pyx_GIVEREF(__pyx_t_13);
  __pyx_t_13 = 0;

  /* "pandas/src/generated.pyx":3702
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def take_2d_axis1_int32_int32(int32_t[:, :] values,             # <<<<<<<<<<<<<<
 *                                     ndarray[int64_t] indexer,
 *                                     int32_t[:, :] out,
 */
  __pyx_t_13 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_319take_2d_axis1_int32_int32, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3702; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_13);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_take_2d_axis1_int32_int32, __pyx_t_13) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3702; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

  /* "pandas/src/generated.pyx":3731
 *                                     ndarray[int64_t] indexer,
 *                                     int64_t[:, :] out,
 *                                     fill_value=np.nan):             # <<<<<<<<<<<<<<
 *     cdef:
 *         Py_ssize_t i, j, k, n, idx
 */
  __pyx_t_13 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3731; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_13);
  __pyx_t_16 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_n_s_nan); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3731; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_16);
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  __pyx_k__165 = __pyx_t_16;
  __Pyx_GIVEREF(__pyx_t_16);
  __pyx_t_16 = 0;

  /* "pandas/src/generated.pyx":3728
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def take_2d_axis1_int32_int64(int32_t[:, :] values,             # <<<<<<<<<<<<<<
 *                                     ndarray[int64_t] indexer,
 *                                     int64_t[:, :] out,
 */
  __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_321take_2d_axis1_int32_int64, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3728; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_16);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_take_2d_axis1_int32_int64, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3728; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;

  /* "pandas/src/generated.pyx":3757
 *                                     ndarray[int64_t] indexer,
 *                                     float64_t[:, :] out,
 *                                     fill_value=np.nan):             # <<<<<<<<<<<<<<
 *     cdef:
 *         Py_ssize_t i, j, k, n, idx
 */
  __pyx_t_16 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3757; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_16);
  __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_16, __pyx_n_s_nan); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3757; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_13);
  __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
  __pyx_k__166 = __pyx_t_13;
  __Pyx_GIVEREF(__pyx_t_13);
  __pyx_t_13 = 0;

  /* "pandas/src/generated.pyx":3754
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def take_2d_axis1_int32_float64(int32_t[:, :] values,             # <<<<<<<<<<<<<<
 *                                     ndarray[int64_t] indexer,
 *                                     float64_t[:, :] out,
 */
  __pyx_t_13 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_323take_2d_axis1_int32_float64, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3754; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_13);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_take_2d_axis1_int32_float64, __pyx_t_13) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3754; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

  /* "pandas/src/generated.pyx":3783
 *                                     ndarray[int64_t] indexer,
 *                                     int64_t[:, :] out,
 *                                     fill_value=np.nan):             # <<<<<<<<<<<<<<
 *     cdef:
 *         Py_ssize_t i, j, k, n, idx
 */
  __pyx_t_13 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3783; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_13);
  __pyx_t_16 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_n_s_nan); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3783; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_16);
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  __pyx_k__167 = __pyx_t_16;
  __Pyx_GIVEREF(__pyx_t_16);
  __pyx_t_16 = 0;

  /* "pandas/src/generated.pyx":3780
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def take_2d_axis1_int64_int64(int64_t[:, :] values,             # <<<<<<<<<<<<<<
 *                                     ndarray[int64_t] indexer,
 *                                     int64_t[:, :] out,
 */
  __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_325take_2d_axis1_int64_int64, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3780; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_16);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_take_2d_axis1_int64_int64, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3780; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;

  /* "pandas/src/generated.pyx":3809
 *                                     ndarray[int64_t] indexer,
 *                                     float64_t[:, :] out,
 *                                     fill_value=np.nan):             # <<<<<<<<<<<<<<
 *     cdef:
 *         Py_ssize_t i, j, k, n, idx
 */
  __pyx_t_16 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3809; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_16);
  __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_16, __pyx_n_s_nan); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3809; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_13);
  __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
  __pyx_k__168 = __pyx_t_13;
  __Pyx_GIVEREF(__pyx_t_13);
  __pyx_t_13 = 0;

  /* "pandas/src/generated.pyx":3806
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def take_2d_axis1_int64_float64(int64_t[:, :] values,             # <<<<<<<<<<<<<<
 *                                     ndarray[int64_t] indexer,
 *                                     float64_t[:, :] out,
 */
  __pyx_t_13 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_327take_2d_axis1_int64_float64, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3806; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_13);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_take_2d_axis1_int64_float64, __pyx_t_13) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3806; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

  /* "pandas/src/generated.pyx":3835
 *                                     ndarray[int64_t] indexer,
 *                                     float32_t[:, :] out,
 *                                     fill_value=np.nan):             # <<<<<<<<<<<<<<
 *     cdef:
 *         Py_ssize_t i, j, k, n, idx
 */
  __pyx_t_13 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3835; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_13);
  __pyx_t_16 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_n_s_nan); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3835; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_16);
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  __pyx_k__169 = __pyx_t_16;
  __Pyx_GIVEREF(__pyx_t_16);
  __pyx_t_16 = 0;

  /* "pandas/src/generated.pyx":3832
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def take_2d_axis1_float32_float32(float32_t[:, :] values,             # <<<<<<<<<<<<<<
 *                                     ndarray[int64_t] indexer,
 *                                     float32_t[:, :] out,
 */
  __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_329take_2d_axis1_float32_float32, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3832; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_16);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_take_2d_axis1_float32_float32, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3832; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;

  /* "pandas/src/generated.pyx":3861
 *                                     ndarray[int64_t] indexer,
 *                                     float64_t[:, :] out,
 *                                     fill_value=np.nan):             # <<<<<<<<<<<<<<
 *     cdef:
 *         Py_ssize_t i, j, k, n, idx
 */
  __pyx_t_16 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3861; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_16);
  __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_16, __pyx_n_s_nan); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3861; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_13);
  __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
  __pyx_k__170 = __pyx_t_13;
  __Pyx_GIVEREF(__pyx_t_13);
  __pyx_t_13 = 0;

  /* "pandas/src/generated.pyx":3858
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def take_2d_axis1_float32_float64(float32_t[:, :] values,             # <<<<<<<<<<<<<<
 *                                     ndarray[int64_t] indexer,
 *                                     float64_t[:, :] out,
 */
  __pyx_t_13 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_331take_2d_axis1_float32_float64, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3858; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_13);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_take_2d_axis1_float32_float64, __pyx_t_13) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3858; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

  /* "pandas/src/generated.pyx":3887
 *                                     ndarray[int64_t] indexer,
 *                                     float64_t[:, :] out,
 *                                     fill_value=np.nan):             # <<<<<<<<<<<<<<
 *     cdef:
 *         Py_ssize_t i, j, k, n, idx
 */
  __pyx_t_13 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3887; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_13);
  __pyx_t_16 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_n_s_nan); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3887; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_16);
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  __pyx_k__171 = __pyx_t_16;
  __Pyx_GIVEREF(__pyx_t_16);
  __pyx_t_16 = 0;

  /* "pandas/src/generated.pyx":3884
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def take_2d_axis1_float64_float64(float64_t[:, :] values,             # <<<<<<<<<<<<<<
 *                                     ndarray[int64_t] indexer,
 *                                     float64_t[:, :] out,
 */
  __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_333take_2d_axis1_float64_float64, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3884; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_16);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_take_2d_axis1_float64_float64, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3884; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;

  /* "pandas/src/generated.pyx":3913
 *                                     ndarray[int64_t] indexer,
 *                                     object[:, :] out,
 *                                     fill_value=np.nan):             # <<<<<<<<<<<<<<
 *     cdef:
 *         Py_ssize_t i, j, k, n, idx
 */
  __pyx_t_16 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3913; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_16);
  __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_16, __pyx_n_s_nan); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3913; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_13);
  __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
  __pyx_k__172 = __pyx_t_13;
  __Pyx_GIVEREF(__pyx_t_13);
  __pyx_t_13 = 0;

  /* "pandas/src/generated.pyx":3910
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def take_2d_axis1_object_object(object[:, :] values,             # <<<<<<<<<<<<<<
 *                                     ndarray[int64_t] indexer,
 *                                     object[:, :] out,
 */
  __pyx_t_13 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_335take_2d_axis1_object_object, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3910; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_13);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_take_2d_axis1_object_object, __pyx_t_13) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3910; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

  /* "pandas/src/generated.pyx":3940
 *                                     indexer,
 *                                     ndarray[uint8_t, ndim=2] out,
 *                                     fill_value=np.nan):             # <<<<<<<<<<<<<<
 *     cdef:
 *         Py_ssize_t i, j, k, n, idx
 */
  __pyx_t_13 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3940; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_13);
  __pyx_t_16 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_n_s_nan); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3940; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_16);
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  __pyx_k__173 = __pyx_t_16;
  __Pyx_GIVEREF(__pyx_t_16);
  __pyx_t_16 = 0;

  /* "pandas/src/generated.pyx":3937
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def take_2d_multi_bool_bool(ndarray[uint8_t, ndim=2] values,             # <<<<<<<<<<<<<<
 *                                     indexer,
 *                                     ndarray[uint8_t, ndim=2] out,
 */
  __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_337take_2d_multi_bool_bool, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3937; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_16);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_take_2d_multi_bool_bool, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3937; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;

  /* "pandas/src/generated.pyx":3968
 *                                     indexer,
 *                                     ndarray[object, ndim=2] out,
 *                                     fill_value=np.nan):             # <<<<<<<<<<<<<<
 *     cdef:
 *         Py_ssize_t i, j, k, n, idx
 */
  __pyx_t_16 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3968; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_16);
  __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_16, __pyx_n_s_nan); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3968; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_13);
  __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
  __pyx_k__174 = __pyx_t_13;
  __Pyx_GIVEREF(__pyx_t_13);
  __pyx_t_13 = 0;

  /* "pandas/src/generated.pyx":3965
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def take_2d_multi_bool_object(ndarray[uint8_t, ndim=2] values,             # <<<<<<<<<<<<<<
 *                                     indexer,
 *                                     ndarray[object, ndim=2] out,
 */
  __pyx_t_13 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_339take_2d_multi_bool_object, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3965; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_13);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_take_2d_multi_bool_object, __pyx_t_13) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3965; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

  /* "pandas/src/generated.pyx":3996
 *                                     indexer,
 *                                     ndarray[int8_t, ndim=2] out,
 *                                     fill_value=np.nan):             # <<<<<<<<<<<<<<
 *     cdef:
 *         Py_ssize_t i, j, k, n, idx
 */
  __pyx_t_13 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3996; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_13);
  __pyx_t_16 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_n_s_nan); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3996; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_16);
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  __pyx_k__175 = __pyx_t_16;
  __Pyx_GIVEREF(__pyx_t_16);
  __pyx_t_16 = 0;

  /* "pandas/src/generated.pyx":3993
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def take_2d_multi_int8_int8(ndarray[int8_t, ndim=2] values,             # <<<<<<<<<<<<<<
 *                                     indexer,
 *                                     ndarray[int8_t, ndim=2] out,
 */
  __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_341take_2d_multi_int8_int8, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3993; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_16);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_take_2d_multi_int8_int8, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3993; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;

  /* "pandas/src/generated.pyx":4024
 *                                     indexer,
 *                                     ndarray[int32_t, ndim=2] out,
 *                                     fill_value=np.nan):             # <<<<<<<<<<<<<<
 *     cdef:
 *         Py_ssize_t i, j, k, n, idx
 */
  __pyx_t_16 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4024; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_16);
  __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_16, __pyx_n_s_nan); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4024; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_13);
  __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
  __pyx_k__176 = __pyx_t_13;
  __Pyx_GIVEREF(__pyx_t_13);
  __pyx_t_13 = 0;

  /* "pandas/src/generated.pyx":4021
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def take_2d_multi_int8_int32(ndarray[int8_t, ndim=2] values,             # <<<<<<<<<<<<<<
 *                                     indexer,
 *                                     ndarray[int32_t, ndim=2] out,
 */
  __pyx_t_13 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_343take_2d_multi_int8_int32, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4021; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_13);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_take_2d_multi_int8_int32, __pyx_t_13) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4021; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

  /* "pandas/src/generated.pyx":4052
 *                                     indexer,
 *                                     ndarray[int64_t, ndim=2] out,
 *                                     fill_value=np.nan):             # <<<<<<<<<<<<<<
 *     cdef:
 *         Py_ssize_t i, j, k, n, idx
 */
  __pyx_t_13 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4052; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_13);
  __pyx_t_16 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_n_s_nan); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4052; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_16);
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  __pyx_k__177 = __pyx_t_16;
  __Pyx_GIVEREF(__pyx_t_16);
  __pyx_t_16 = 0;

  /* "pandas/src/generated.pyx":4049
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def take_2d_multi_int8_int64(ndarray[int8_t, ndim=2] values,             # <<<<<<<<<<<<<<
 *                                     indexer,
 *                                     ndarray[int64_t, ndim=2] out,
 */
  __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_345take_2d_multi_int8_int64, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4049; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_16);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_take_2d_multi_int8_int64, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4049; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;

  /* "pandas/src/generated.pyx":4080
 *                                     indexer,
 *                                     ndarray[float64_t, ndim=2] out,
 *                                     fill_value=np.nan):             # <<<<<<<<<<<<<<
 *     cdef:
 *         Py_ssize_t i, j, k, n, idx
 */
  __pyx_t_16 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4080; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_16);
  __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_16, __pyx_n_s_nan); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4080; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_13);
  __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
  __pyx_k__178 = __pyx_t_13;
  __Pyx_GIVEREF(__pyx_t_13);
  __pyx_t_13 = 0;

  /* "pandas/src/generated.pyx":4077
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def take_2d_multi_int8_float64(ndarray[int8_t, ndim=2] values,             # <<<<<<<<<<<<<<
 *                                     indexer,
 *                                     ndarray[float64_t, ndim=2] out,
 */
  __pyx_t_13 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_347take_2d_multi_int8_float64, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4077; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_13);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_take_2d_multi_int8_float64, __pyx_t_13) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4077; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

  /* "pandas/src/generated.pyx":4108
 *                                     indexer,
 *                                     ndarray[int16_t, ndim=2] out,
 *                                     fill_value=np.nan):             # <<<<<<<<<<<<<<
 *     cdef:
 *         Py_ssize_t i, j, k, n, idx
 */
  __pyx_t_13 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4108; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_13);
  __pyx_t_16 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_n_s_nan); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4108; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_16);
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  __pyx_k__179 = __pyx_t_16;
  __Pyx_GIVEREF(__pyx_t_16);
  __pyx_t_16 = 0;

  /* "pandas/src/generated.pyx":4105
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def take_2d_multi_int16_int16(ndarray[int16_t, ndim=2] values,             # <<<<<<<<<<<<<<
 *                                     indexer,
 *                                     ndarray[int16_t, ndim=2] out,
 */
  __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_349take_2d_multi_int16_int16, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4105; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_16);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_take_2d_multi_int16_int16, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4105; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;

  /* "pandas/src/generated.pyx":4136
 *                                     indexer,
 *                                     ndarray[int32_t, ndim=2] out,
 *                                     fill_value=np.nan):             # <<<<<<<<<<<<<<
 *     cdef:
 *         Py_ssize_t i, j, k, n, idx
 */
  __pyx_t_16 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4136; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_16);
  __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_16, __pyx_n_s_nan); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4136; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_13);
  __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
  __pyx_k__180 = __pyx_t_13;
  __Pyx_GIVEREF(__pyx_t_13);
  __pyx_t_13 = 0;

  /* "pandas/src/generated.pyx":4133
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def take_2d_multi_int16_int32(ndarray[int16_t, ndim=2] values,             # <<<<<<<<<<<<<<
 *                                     indexer,
 *                                     ndarray[int32_t, ndim=2] out,
 */
  __pyx_t_13 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_351take_2d_multi_int16_int32, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4133; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_13);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_take_2d_multi_int16_int32, __pyx_t_13) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4133; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

  /* "pandas/src/generated.pyx":4164
 *                                     indexer,
 *                                     ndarray[int64_t, ndim=2] out,
 *                                     fill_value=np.nan):             # <<<<<<<<<<<<<<
 *     cdef:
 *         Py_ssize_t i, j, k, n, idx
 */
  __pyx_t_13 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4164; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_13);
  __pyx_t_16 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_n_s_nan); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4164; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_16);
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  __pyx_k__181 = __pyx_t_16;
  __Pyx_GIVEREF(__pyx_t_16);
  __pyx_t_16 = 0;

  /* "pandas/src/generated.pyx":4161
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def take_2d_multi_int16_int64(ndarray[int16_t, ndim=2] values,             # <<<<<<<<<<<<<<
 *                                     indexer,
 *                                     ndarray[int64_t, ndim=2] out,
 */
  __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_353take_2d_multi_int16_int64, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4161; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_16);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_take_2d_multi_int16_int64, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4161; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;

  /* "pandas/src/generated.pyx":4192
 *                                     indexer,
 *                                     ndarray[float64_t, ndim=2] out,
 *                                     fill_value=np.nan):             # <<<<<<<<<<<<<<
 *     cdef:
 *         Py_ssize_t i, j, k, n, idx
 */
  __pyx_t_16 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4192; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_16);
  __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_16, __pyx_n_s_nan); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4192; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_13);
  __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
  __pyx_k__182 = __pyx_t_13;
  __Pyx_GIVEREF(__pyx_t_13);
  __pyx_t_13 = 0;

  /* "pandas/src/generated.pyx":4189
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def take_2d_multi_int16_float64(ndarray[int16_t, ndim=2] values,             # <<<<<<<<<<<<<<
 *                                     indexer,
 *                                     ndarray[float64_t, ndim=2] out,
 */
  __pyx_t_13 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_355take_2d_multi_int16_float64, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4189; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_13);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_take_2d_multi_int16_float64, __pyx_t_13) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4189; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

  /* "pandas/src/generated.pyx":4220
 *                                     indexer,
 *                                     ndarray[int32_t, ndim=2] out,
 *                                     fill_value=np.nan):             # <<<<<<<<<<<<<<
 *     cdef:
 *         Py_ssize_t i, j, k, n, idx
 */
  __pyx_t_13 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4220; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_13);
  __pyx_t_16 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_n_s_nan); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4220; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_16);
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  __pyx_k__183 = __pyx_t_16;
  __Pyx_GIVEREF(__pyx_t_16);
  __pyx_t_16 = 0;

  /* "pandas/src/generated.pyx":4217
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def take_2d_multi_int32_int32(ndarray[int32_t, ndim=2] values,             # <<<<<<<<<<<<<<
 *                                     indexer,
 *                                     ndarray[int32_t, ndim=2] out,
 */
  __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_357take_2d_multi_int32_int32, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4217; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_16);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_take_2d_multi_int32_int32, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4217; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;

  /* "pandas/src/generated.pyx":4248
 *                                     indexer,
 *                                     ndarray[int64_t, ndim=2] out,
 *                                     fill_value=np.nan):             # <<<<<<<<<<<<<<
 *     cdef:
 *         Py_ssize_t i, j, k, n, idx
 */
  __pyx_t_16 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4248; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_16);
  __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_16, __pyx_n_s_nan); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4248; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_13);
  __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
  __pyx_k__184 = __pyx_t_13;
  __Pyx_GIVEREF(__pyx_t_13);
  __pyx_t_13 = 0;

  /* "pandas/src/generated.pyx":4245
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def take_2d_multi_int32_int64(ndarray[int32_t, ndim=2] values,             # <<<<<<<<<<<<<<
 *                                     indexer,
 *                                     ndarray[int64_t, ndim=2] out,
 */
  __pyx_t_13 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_359take_2d_multi_int32_int64, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4245; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_13);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_take_2d_multi_int32_int64, __pyx_t_13) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4245; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

  /* "pandas/src/generated.pyx":4276
 *                                     indexer,
 *                                     ndarray[float64_t, ndim=2] out,
 *                                     fill_value=np.nan):             # <<<<<<<<<<<<<<
 *     cdef:
 *         Py_ssize_t i, j, k, n, idx
 */
  __pyx_t_13 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4276; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_13);
  __pyx_t_16 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_n_s_nan); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4276; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_16);
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  __pyx_k__185 = __pyx_t_16;
  __Pyx_GIVEREF(__pyx_t_16);
  __pyx_t_16 = 0;

  /* "pandas/src/generated.pyx":4273
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def take_2d_multi_int32_float64(ndarray[int32_t, ndim=2] values,             # <<<<<<<<<<<<<<
 *                                     indexer,
 *                                     ndarray[float64_t, ndim=2] out,
 */
  __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_361take_2d_multi_int32_float64, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4273; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_16);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_take_2d_multi_int32_float64, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4273; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;

  /* "pandas/src/generated.pyx":4304
 *                                     indexer,
 *                                     ndarray[int64_t, ndim=2] out,
 *                                     fill_value=np.nan):             # <<<<<<<<<<<<<<
 *     cdef:
 *         Py_ssize_t i, j, k, n, idx
 */
  __pyx_t_16 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4304; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_16);
  __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_16, __pyx_n_s_nan); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4304; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_13);
  __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
  __pyx_k__186 = __pyx_t_13;
  __Pyx_GIVEREF(__pyx_t_13);
  __pyx_t_13 = 0;

  /* "pandas/src/generated.pyx":4301
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def take_2d_multi_int64_int64(ndarray[int64_t, ndim=2] values,             # <<<<<<<<<<<<<<
 *                                     indexer,
 *                                     ndarray[int64_t, ndim=2] out,
 */
  __pyx_t_13 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_363take_2d_multi_int64_int64, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4301; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_13);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_take_2d_multi_int64_int64, __pyx_t_13) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4301; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

  /* "pandas/src/generated.pyx":4332
 *                                     indexer,
 *                                     ndarray[float64_t, ndim=2] out,
 *                                     fill_value=np.nan):             # <<<<<<<<<<<<<<
 *     cdef:
 *         Py_ssize_t i, j, k, n, idx
 */
  __pyx_t_13 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4332; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_13);
  __pyx_t_16 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_n_s_nan); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4332; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_16);
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  __pyx_k__187 = __pyx_t_16;
  __Pyx_GIVEREF(__pyx_t_16);
  __pyx_t_16 = 0;

  /* "pandas/src/generated.pyx":4329
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def take_2d_multi_int64_float64(ndarray[int64_t, ndim=2] values,             # <<<<<<<<<<<<<<
 *                                     indexer,
 *                                     ndarray[float64_t, ndim=2] out,
 */
  __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_365take_2d_multi_int64_float64, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4329; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_16);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_take_2d_multi_int64_float64, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4329; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;

  /* "pandas/src/generated.pyx":4360
 *                                     indexer,
 *                                     ndarray[float32_t, ndim=2] out,
 *                                     fill_value=np.nan):             # <<<<<<<<<<<<<<
 *     cdef:
 *         Py_ssize_t i, j, k, n, idx
 */
  __pyx_t_16 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4360; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_16);
  __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_16, __pyx_n_s_nan); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4360; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_13);
  __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
  __pyx_k__188 = __pyx_t_13;
  __Pyx_GIVEREF(__pyx_t_13);
  __pyx_t_13 = 0;

  /* "pandas/src/generated.pyx":4357
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def take_2d_multi_float32_float32(ndarray[float32_t, ndim=2] values,             # <<<<<<<<<<<<<<
 *                                     indexer,
 *                                     ndarray[float32_t, ndim=2] out,
 */
  __pyx_t_13 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_367take_2d_multi_float32_float32, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4357; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_13);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_take_2d_multi_float32_float32, __pyx_t_13) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4357; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

  /* "pandas/src/generated.pyx":4388
 *                                     indexer,
 *                                     ndarray[float64_t, ndim=2] out,
 *                                     fill_value=np.nan):             # <<<<<<<<<<<<<<
 *     cdef:
 *         Py_ssize_t i, j, k, n, idx
 */
  __pyx_t_13 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4388; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_13);
  __pyx_t_16 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_n_s_nan); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4388; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_16);
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  __pyx_k__189 = __pyx_t_16;
  __Pyx_GIVEREF(__pyx_t_16);
  __pyx_t_16 = 0;

  /* "pandas/src/generated.pyx":4385
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def take_2d_multi_float32_float64(ndarray[float32_t, ndim=2] values,             # <<<<<<<<<<<<<<
 *                                     indexer,
 *                                     ndarray[float64_t, ndim=2] out,
 */
  __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_369take_2d_multi_float32_float64, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4385; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_16);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_take_2d_multi_float32_float64, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4385; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;

  /* "pandas/src/generated.pyx":4416
 *                                     indexer,
 *                                     ndarray[float64_t, ndim=2] out,
 *                                     fill_value=np.nan):             # <<<<<<<<<<<<<<
 *     cdef:
 *         Py_ssize_t i, j, k, n, idx
 */
  __pyx_t_16 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4416; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_16);
  __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_16, __pyx_n_s_nan); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4416; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_13);
  __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
  __pyx_k__190 = __pyx_t_13;
  __Pyx_GIVEREF(__pyx_t_13);
  __pyx_t_13 = 0;

  /* "pandas/src/generated.pyx":4413
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def take_2d_multi_float64_float64(ndarray[float64_t, ndim=2] values,             # <<<<<<<<<<<<<<
 *                                     indexer,
 *                                     ndarray[float64_t, ndim=2] out,
 */
  __pyx_t_13 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_371take_2d_multi_float64_float64, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4413; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_13);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_take_2d_multi_float64_float64, __pyx_t_13) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4413; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

  /* "pandas/src/generated.pyx":4444
 *                                     indexer,
 *                                     ndarray[object, ndim=2] out,
 *                                     fill_value=np.nan):             # <<<<<<<<<<<<<<
 *     cdef:
 *         Py_ssize_t i, j, k, n, idx
 */
  __pyx_t_13 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4444; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_13);
  __pyx_t_16 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_n_s_nan); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4444; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_16);
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  __pyx_k__191 = __pyx_t_16;
  __Pyx_GIVEREF(__pyx_t_16);
  __pyx_t_16 = 0;

  /* "pandas/src/generated.pyx":4441
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def take_2d_multi_object_object(ndarray[object, ndim=2] values,             # <<<<<<<<<<<<<<
 *                                     indexer,
 *                                     ndarray[object, ndim=2] out,
 */
  __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_373take_2d_multi_object_object, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4441; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_16);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_take_2d_multi_object_object, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4441; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;

  /* "pandas/src/generated.pyx":4470
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def diff_2d_float64(ndarray[float64_t, ndim=2] arr,             # <<<<<<<<<<<<<<
 *                      ndarray[float64_t, ndim=2] out,
 *                     Py_ssize_t periods, int axis):
 */
  __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_375diff_2d_float64, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4470; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_16);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_diff_2d_float64, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4470; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;

  /* "pandas/src/generated.pyx":4513
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def diff_2d_float32(ndarray[float32_t, ndim=2] arr,             # <<<<<<<<<<<<<<
 *                      ndarray[float32_t, ndim=2] out,
 *                     Py_ssize_t periods, int axis):
 */
  __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_377diff_2d_float32, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4513; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_16);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_diff_2d_float32, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4513; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;

  /* "pandas/src/generated.pyx":4556
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def diff_2d_int8(ndarray[int8_t, ndim=2] arr,             # <<<<<<<<<<<<<<
 *                      ndarray[float32_t, ndim=2] out,
 *                     Py_ssize_t periods, int axis):
 */
  __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_379diff_2d_int8, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4556; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_16);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_diff_2d_int8, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4556; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;

  /* "pandas/src/generated.pyx":4599
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def diff_2d_int16(ndarray[int16_t, ndim=2] arr,             # <<<<<<<<<<<<<<
 *                      ndarray[float32_t, ndim=2] out,
 *                     Py_ssize_t periods, int axis):
 */
  __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_381diff_2d_int16, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4599; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_16);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_diff_2d_int16, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4599; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;

  /* "pandas/src/generated.pyx":4642
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def diff_2d_int32(ndarray[int32_t, ndim=2] arr,             # <<<<<<<<<<<<<<
 *                      ndarray[float64_t, ndim=2] out,
 *                     Py_ssize_t periods, int axis):
 */
  __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_383diff_2d_int32, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4642; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_16);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_diff_2d_int32, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4642; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;

  /* "pandas/src/generated.pyx":4685
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def diff_2d_int64(ndarray[int64_t, ndim=2] arr,             # <<<<<<<<<<<<<<
 *                      ndarray[float64_t, ndim=2] out,
 *                     Py_ssize_t periods, int axis):
 */
  __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_385diff_2d_int64, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4685; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_16);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_diff_2d_int64, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4685; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;

  /* "pandas/src/generated.pyx":4729
 * @cython.wraparound(False)
 * @cython.wraparound(False)
 * def group_last_float64(ndarray[float64_t, ndim=2] out,             # <<<<<<<<<<<<<<
 *                ndarray[int64_t] counts,
 *                ndarray[float64_t, ndim=2] values,
 */
  __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_387group_last_float64, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4729; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_16);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_group_last_float64, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4729; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;

  /* "pandas/src/generated.pyx":4772
 * @cython.wraparound(False)
 * @cython.wraparound(False)
 * def group_last_float32(ndarray[float32_t, ndim=2] out,             # <<<<<<<<<<<<<<
 *                ndarray[int64_t] counts,
 *                ndarray[float32_t, ndim=2] values,
 */
  __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_389group_last_float32, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4772; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_16);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_group_last_float32, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4772; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;

  /* "pandas/src/generated.pyx":4816
 * @cython.wraparound(False)
 * @cython.wraparound(False)
 * def group_last_bin_float64(ndarray[float64_t, ndim=2] out,             # <<<<<<<<<<<<<<
 *                    ndarray[int64_t] counts,
 *                    ndarray[float64_t, ndim=2] values,
 */
  __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_391group_last_bin_float64, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4816; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_16);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_group_last_bin_float64, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4816; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;

  /* "pandas/src/generated.pyx":4860
 * @cython.wraparound(False)
 * @cython.wraparound(False)
 * def group_last_bin_float32(ndarray[float32_t, ndim=2] out,             # <<<<<<<<<<<<<<
 *                    ndarray[int64_t] counts,
 *                    ndarray[float32_t, ndim=2] values,
 */
  __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_393group_last_bin_float32, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4860; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_16);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_group_last_bin_float32, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4860; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;

  /* "pandas/src/generated.pyx":4905
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def group_nth_float64(ndarray[float64_t, ndim=2] out,             # <<<<<<<<<<<<<<
 *               ndarray[int64_t] counts,
 *               ndarray[float64_t, ndim=2] values,
 */
  __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_395group_nth_float64, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4905; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_16);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_group_nth_float64, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4905; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;

  /* "pandas/src/generated.pyx":4949
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def group_nth_float32(ndarray[float32_t, ndim=2] out,             # <<<<<<<<<<<<<<
 *               ndarray[int64_t] counts,
 *               ndarray[float32_t, ndim=2] values,
 */
  __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_397group_nth_float32, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4949; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_16);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_group_nth_float32, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4949; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;

  /* "pandas/src/generated.pyx":4994
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def group_nth_bin_float64(ndarray[float64_t, ndim=2] out,             # <<<<<<<<<<<<<<
 *                   ndarray[int64_t] counts,
 *                   ndarray[float64_t, ndim=2] values,
 */
  __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_399group_nth_bin_float64, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4994; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_16);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_group_nth_bin_float64, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4994; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;

  /* "pandas/src/generated.pyx":5039
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def group_nth_bin_float32(ndarray[float32_t, ndim=2] out,             # <<<<<<<<<<<<<<
 *                   ndarray[int64_t] counts,
 *                   ndarray[float32_t, ndim=2] values,
 */
  __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_401group_nth_bin_float32, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5039; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_16);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_group_nth_bin_float32, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5039; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;

  /* "pandas/src/generated.pyx":5085
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def group_add_float64(ndarray[float64_t, ndim=2] out,             # <<<<<<<<<<<<<<
 *               ndarray[int64_t] counts,
 *               ndarray[float64_t, ndim=2] values,
 */
  __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_403group_add_float64, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5085; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_16);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_group_add_float64, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5085; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;

  /* "pandas/src/generated.pyx":5141
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def group_add_float32(ndarray[float32_t, ndim=2] out,             # <<<<<<<<<<<<<<
 *               ndarray[int64_t] counts,
 *               ndarray[float32_t, ndim=2] values,
 */
  __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_405group_add_float32, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5141; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_16);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_group_add_float32, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5141; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;

  /* "pandas/src/generated.pyx":5198
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def group_add_bin_float64(ndarray[float64_t, ndim=2] out,             # <<<<<<<<<<<<<<
 *                   ndarray[int64_t] counts,
 *                   ndarray[float64_t, ndim=2] values,
 */
  __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_407group_add_bin_float64, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5198; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_16);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_group_add_bin_float64, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5198; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;

  /* "pandas/src/generated.pyx":5254
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def group_add_bin_float32(ndarray[float32_t, ndim=2] out,             # <<<<<<<<<<<<<<
 *                   ndarray[int64_t] counts,
 *                   ndarray[float32_t, ndim=2] values,
 */
  __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_409group_add_bin_float32, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5254; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_16);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_group_add_bin_float32, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5254; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;

  /* "pandas/src/generated.pyx":5311
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def group_prod_float64(ndarray[float64_t, ndim=2] out,             # <<<<<<<<<<<<<<
 *                ndarray[int64_t] counts,
 *                ndarray[float64_t, ndim=2] values,
 */
  __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_411group_prod_float64, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5311; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_16);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_group_prod_float64, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5311; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;

  /* "pandas/src/generated.pyx":5367
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def group_prod_float32(ndarray[float32_t, ndim=2] out,             # <<<<<<<<<<<<<<
 *                ndarray[int64_t] counts,
 *                ndarray[float32_t, ndim=2] values,
 */
  __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_413group_prod_float32, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5367; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_16);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_group_prod_float32, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5367; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;

  /* "pandas/src/generated.pyx":5424
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def group_prod_bin_float64(ndarray[float64_t, ndim=2] out,             # <<<<<<<<<<<<<<
 *                   ndarray[int64_t] counts,
 *                   ndarray[float64_t, ndim=2] values,
 */
  __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_415group_prod_bin_float64, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5424; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_16);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_group_prod_bin_float64, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5424; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;

  /* "pandas/src/generated.pyx":5480
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def group_prod_bin_float32(ndarray[float32_t, ndim=2] out,             # <<<<<<<<<<<<<<
 *                   ndarray[int64_t] counts,
 *                   ndarray[float32_t, ndim=2] values,
 */
  __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_417group_prod_bin_float32, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5480; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_16);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_group_prod_bin_float32, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5480; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;

  /* "pandas/src/generated.pyx":5537
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def group_var_float64(ndarray[float64_t, ndim=2] out,             # <<<<<<<<<<<<<<
 *               ndarray[int64_t] counts,
 *               ndarray[float64_t, ndim=2] values,
 */
  __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_419group_var_float64, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5537; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_16);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_group_var_float64, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5537; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;

  /* "pandas/src/generated.pyx":5598
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def group_var_float32(ndarray[float32_t, ndim=2] out,             # <<<<<<<<<<<<<<
 *               ndarray[int64_t] counts,
 *               ndarray[float32_t, ndim=2] values,
 */
  __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_421group_var_float32, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5598; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_16);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_group_var_float32, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5598; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;

  /* "pandas/src/generated.pyx":5660
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def group_var_bin_float64(ndarray[float64_t, ndim=2] out,             # <<<<<<<<<<<<<<
 *                   ndarray[int64_t] counts,
 *                   ndarray[float64_t, ndim=2] values,
 */
  __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_423group_var_bin_float64, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5660; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_16);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_group_var_bin_float64, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5660; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;

  /* "pandas/src/generated.pyx":5721
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def group_var_bin_float32(ndarray[float32_t, ndim=2] out,             # <<<<<<<<<<<<<<
 *                   ndarray[int64_t] counts,
 *                   ndarray[float32_t, ndim=2] values,
 */
  __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_425group_var_bin_float32, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5721; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_16);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_group_var_bin_float32, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5721; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;

  /* "pandas/src/generated.pyx":5783
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def group_mean_float64(ndarray[float64_t, ndim=2] out,             # <<<<<<<<<<<<<<
 *                ndarray[int64_t] counts,
 *                ndarray[float64_t, ndim=2] values,
 */
  __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_427group_mean_float64, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5783; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_16);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_group_mean_float64, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5783; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;

  /* "pandas/src/generated.pyx":5835
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def group_mean_float32(ndarray[float32_t, ndim=2] out,             # <<<<<<<<<<<<<<
 *                ndarray[int64_t] counts,
 *                ndarray[float32_t, ndim=2] values,
 */
  __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_429group_mean_float32, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5835; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_16);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_group_mean_float32, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5835; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;

  /* "pandas/src/generated.pyx":5887
 * 
 * 
 * def group_mean_bin_float64(ndarray[float64_t, ndim=2] out,             # <<<<<<<<<<<<<<
 *                    ndarray[int64_t] counts,
 *                    ndarray[float64_t, ndim=2] values,
 */
  __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_431group_mean_bin_float64, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5887; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_16);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_group_mean_bin_float64, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5887; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;

  /* "pandas/src/generated.pyx":5940
 *                 out[i, j] = sumx[i, j] / count
 * 
 * def group_mean_bin_float32(ndarray[float32_t, ndim=2] out,             # <<<<<<<<<<<<<<
 *                    ndarray[int64_t] counts,
 *                    ndarray[float32_t, ndim=2] values,
 */
  __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_433group_mean_bin_float32, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5940; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_16);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_group_mean_bin_float32, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5940; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;

  /* "pandas/src/generated.pyx":5995
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def group_min_float64(ndarray[float64_t, ndim=2] out,             # <<<<<<<<<<<<<<
 *               ndarray[int64_t] counts,
 *               ndarray[float64_t, ndim=2] values,
 */
  __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_435group_min_float64, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5995; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_16);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_group_min_float64, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5995; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;

  /* "pandas/src/generated.pyx":6055
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def group_min_float32(ndarray[float32_t, ndim=2] out,             # <<<<<<<<<<<<<<
 *               ndarray[int64_t] counts,
 *               ndarray[float32_t, ndim=2] values,
 */
  __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_437group_min_float32, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6055; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_16);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_group_min_float32, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6055; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;

  /* "pandas/src/generated.pyx":6116
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def group_min_bin_float64(ndarray[float64_t, ndim=2] out,             # <<<<<<<<<<<<<<
 *                    ndarray[int64_t] counts,
 *                    ndarray[float64_t, ndim=2] values,
 */
  __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_439group_min_bin_float64, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6116; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_16);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_group_min_bin_float64, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6116; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;

  /* "pandas/src/generated.pyx":6177
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def group_min_bin_float32(ndarray[float32_t, ndim=2] out,             # <<<<<<<<<<<<<<
 *                    ndarray[int64_t] counts,
 *                    ndarray[float32_t, ndim=2] values,
 */
  __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_441group_min_bin_float32, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6177; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_16);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_group_min_bin_float32, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6177; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;

  /* "pandas/src/generated.pyx":6239
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def group_max_float64(ndarray[float64_t, ndim=2] out,             # <<<<<<<<<<<<<<
 *               ndarray[int64_t] counts,
 *               ndarray[float64_t, ndim=2] values,
 */
  __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_443group_max_float64, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6239; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_16);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_group_max_float64, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6239; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;

  /* "pandas/src/generated.pyx":6299
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def group_max_float32(ndarray[float32_t, ndim=2] out,             # <<<<<<<<<<<<<<
 *               ndarray[int64_t] counts,
 *               ndarray[float32_t, ndim=2] values,
 */
  __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_445group_max_float32, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6299; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_16);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_group_max_float32, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6299; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;

  /* "pandas/src/generated.pyx":6360
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def group_max_bin_float64(ndarray[float64_t, ndim=2] out,             # <<<<<<<<<<<<<<
 *                   ndarray[int64_t] counts,
 *                   ndarray[float64_t, ndim=2] values,
 */
  __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_447group_max_bin_float64, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6360; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_16);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_group_max_bin_float64, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6360; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;

  /* "pandas/src/generated.pyx":6420
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def group_max_bin_float32(ndarray[float32_t, ndim=2] out,             # <<<<<<<<<<<<<<
 *                   ndarray[int64_t] counts,
 *                   ndarray[float32_t, ndim=2] values,
 */
  __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_449group_max_bin_float32, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6420; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_16);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_group_max_bin_float32, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6420; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;

  /* "pandas/src/generated.pyx":6481
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def group_ohlc_float64(ndarray[float64_t, ndim=2] out,             # <<<<<<<<<<<<<<
 *                   ndarray[int64_t] counts,
 *                   ndarray[float64_t, ndim=2] values,
 */
  __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_451group_ohlc_float64, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6481; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_16);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_group_ohlc_float64, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6481; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;

  /* "pandas/src/generated.pyx":6554
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def group_ohlc_float32(ndarray[float32_t, ndim=2] out,             # <<<<<<<<<<<<<<
 *                   ndarray[int64_t] counts,
 *                   ndarray[float32_t, ndim=2] values,
 */
  __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_453group_ohlc_float32, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6554; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_16);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_group_ohlc_float32, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6554; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;

  /* "pandas/src/generated.pyx":6628
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def group_count_float64(ndarray[float64_t, ndim=2] out,             # <<<<<<<<<<<<<<
 *                          ndarray[int64_t] counts,
 *                          ndarray[float64_t, ndim=2] values,
 */
  __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_455group_count_float64, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6628; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_16);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_group_count_float64, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6628; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;

  /* "pandas/src/generated.pyx":6664
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def group_count_float32(ndarray[float32_t, ndim=2] out,             # <<<<<<<<<<<<<<
 *                          ndarray[int64_t] counts,
 *                          ndarray[float32_t, ndim=2] values,
 */
  __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_457group_count_float32, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6664; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_16);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_group_count_float32, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6664; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;

  /* "pandas/src/generated.pyx":6700
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def group_count_object(ndarray[float64_t, ndim=2] out,             # <<<<<<<<<<<<<<
 *                          ndarray[int64_t] counts,
 *                          ndarray[object, ndim=2] values,
 */
  __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_459group_count_object, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6700; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_16);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_group_count_object, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6700; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;

  /* "pandas/src/generated.pyx":6736
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def group_count_int64(ndarray[float64_t, ndim=2] out,             # <<<<<<<<<<<<<<
 *                          ndarray[int64_t] counts,
 *                          ndarray[int64_t, ndim=2] values,
 */
  __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_461group_count_int64, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6736; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_16);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_group_count_int64, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6736; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;

  /* "pandas/src/generated.pyx":6773
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def group_count_bin_float64(ndarray[float64_t, ndim=2] out,             # <<<<<<<<<<<<<<
 *                              ndarray[int64_t] counts,
 *                              ndarray[float64_t, ndim=2] values,
 */
  __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_463group_count_bin_float64, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6773; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_16);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_group_count_bin_float64, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6773; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;

  /* "pandas/src/generated.pyx":6807
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def group_count_bin_float32(ndarray[float32_t, ndim=2] out,             # <<<<<<<<<<<<<<
 *                              ndarray[int64_t] counts,
 *                              ndarray[float32_t, ndim=2] values,
 */
  __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_465group_count_bin_float32, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6807; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_16);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_group_count_bin_float32, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6807; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;

  /* "pandas/src/generated.pyx":6841
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def group_count_bin_object(ndarray[float64_t, ndim=2] out,             # <<<<<<<<<<<<<<
 *                              ndarray[int64_t] counts,
 *                              ndarray[object, ndim=2] values,
 */
  __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_467group_count_bin_object, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6841; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_16);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_group_count_bin_object, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6841; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;

  /* "pandas/src/generated.pyx":6875
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def group_count_bin_int64(ndarray[float64_t, ndim=2] out,             # <<<<<<<<<<<<<<
 *                              ndarray[int64_t] counts,
 *                              ndarray[int64_t, ndim=2] values,
 */
  __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_469group_count_bin_int64, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6875; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_16);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_group_count_bin_int64, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6875; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;

  /* "pandas/src/generated.pyx":6910
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def left_join_indexer_unique_float64(ndarray[float64_t] left,             # <<<<<<<<<<<<<<
 *                                       ndarray[float64_t] right):
 *     cdef:
 */
  __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_471left_join_indexer_unique_float64, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6910; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_16);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_left_join_indexer_unique_float64, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6910; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;

  /* "pandas/src/generated.pyx":6955
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def left_join_indexer_unique_float32(ndarray[float32_t] left,             # <<<<<<<<<<<<<<
 *                                       ndarray[float32_t] right):
 *     cdef:
 */
  __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_473left_join_indexer_unique_float32, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6955; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_16);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_left_join_indexer_unique_float32, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6955; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;

  /* "pandas/src/generated.pyx":7000
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def left_join_indexer_unique_object(ndarray[object] left,             # <<<<<<<<<<<<<<
 *                                       ndarray[object] right):
 *     cdef:
 */
  __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_475left_join_indexer_unique_object, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7000; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_16);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_left_join_indexer_unique_object, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7000; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;

  /* "pandas/src/generated.pyx":7045
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def left_join_indexer_unique_int32(ndarray[int32_t] left,             # <<<<<<<<<<<<<<
 *                                       ndarray[int32_t] right):
 *     cdef:
 */
  __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_477left_join_indexer_unique_int32, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7045; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_16);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_left_join_indexer_unique_int32, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7045; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;

  /* "pandas/src/generated.pyx":7090
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def left_join_indexer_unique_int64(ndarray[int64_t] left,             # <<<<<<<<<<<<<<
 *                                       ndarray[int64_t] right):
 *     cdef:
 */
  __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_479left_join_indexer_unique_int64, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7090; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_16);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_left_join_indexer_unique_int64, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7090; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;

  /* "pandas/src/generated.pyx":7135
 * 
 * 
 * def left_join_indexer_float64(ndarray[float64_t] left,             # <<<<<<<<<<<<<<
 *                               ndarray[float64_t] right):
 *     '''
 */
  __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_481left_join_indexer_float64, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7135; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_16);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_left_join_indexer_float64, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7135; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;

  /* "pandas/src/generated.pyx":7237
 * 
 * 
 * def left_join_indexer_float32(ndarray[float32_t] left,             # <<<<<<<<<<<<<<
 *                               ndarray[float32_t] right):
 *     '''
 */
  __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_483left_join_indexer_float32, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7237; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_16);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_left_join_indexer_float32, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7237; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;

  /* "pandas/src/generated.pyx":7339
 * 
 * 
 * def left_join_indexer_object(ndarray[object] left,             # <<<<<<<<<<<<<<
 *                               ndarray[object] right):
 *     '''
 */
  __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_485left_join_indexer_object, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7339; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_16);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_left_join_indexer_object, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7339; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;

  /* "pandas/src/generated.pyx":7441
 * 
 * 
 * def left_join_indexer_int32(ndarray[int32_t] left,             # <<<<<<<<<<<<<<
 *                               ndarray[int32_t] right):
 *     '''
 */
  __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_487left_join_indexer_int32, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7441; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_16);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_left_join_indexer_int32, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7441; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;

  /* "pandas/src/generated.pyx":7543
 * 
 * 
 * def left_join_indexer_int64(ndarray[int64_t] left,             # <<<<<<<<<<<<<<
 *                               ndarray[int64_t] right):
 *     '''
 */
  __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_489left_join_indexer_int64, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7543; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_16);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_left_join_indexer_int64, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7543; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;

  /* "pandas/src/generated.pyx":7647
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def outer_join_indexer_float64(ndarray[float64_t] left,             # <<<<<<<<<<<<<<
 *                                 ndarray[float64_t] right):
 *     cdef:
 */
  __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_491outer_join_indexer_float64, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7647; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_16);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_outer_join_indexer_float64, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7647; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;

  /* "pandas/src/generated.pyx":7776
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def outer_join_indexer_float32(ndarray[float32_t] left,             # <<<<<<<<<<<<<<
 *                                 ndarray[float32_t] right):
 *     cdef:
 */
  __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_493outer_join_indexer_float32, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7776; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_16);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_outer_join_indexer_float32, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7776; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;

  /* "pandas/src/generated.pyx":7905
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def outer_join_indexer_object(ndarray[object] left,             # <<<<<<<<<<<<<<
 *                                 ndarray[object] right):
 *     cdef:
 */
  __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_495outer_join_indexer_object, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7905; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_16);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_outer_join_indexer_object, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7905; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;

  /* "pandas/src/generated.pyx":8034
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def outer_join_indexer_int32(ndarray[int32_t] left,             # <<<<<<<<<<<<<<
 *                                 ndarray[int32_t] right):
 *     cdef:
 */
  __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_497outer_join_indexer_int32, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8034; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_16);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_outer_join_indexer_int32, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8034; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;

  /* "pandas/src/generated.pyx":8163
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def outer_join_indexer_int64(ndarray[int64_t] left,             # <<<<<<<<<<<<<<
 *                                 ndarray[int64_t] right):
 *     cdef:
 */
  __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_499outer_join_indexer_int64, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8163; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_16);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_outer_join_indexer_int64, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8163; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;

  /* "pandas/src/generated.pyx":8293
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def inner_join_indexer_float64(ndarray[float64_t] left,             # <<<<<<<<<<<<<<
 *                               ndarray[float64_t] right):
 *     '''
 */
  __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_501inner_join_indexer_float64, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8293; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_16);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_inner_join_indexer_float64, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8293; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;

  /* "pandas/src/generated.pyx":8386
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def inner_join_indexer_float32(ndarray[float32_t] left,             # <<<<<<<<<<<<<<
 *                               ndarray[float32_t] right):
 *     '''
 */
  __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_503inner_join_indexer_float32, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8386; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_16);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_inner_join_indexer_float32, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8386; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;

  /* "pandas/src/generated.pyx":8479
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def inner_join_indexer_object(ndarray[object] left,             # <<<<<<<<<<<<<<
 *                               ndarray[object] right):
 *     '''
 */
  __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_505inner_join_indexer_object, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8479; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_16);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_inner_join_indexer_object, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8479; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;

  /* "pandas/src/generated.pyx":8572
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def inner_join_indexer_int32(ndarray[int32_t] left,             # <<<<<<<<<<<<<<
 *                               ndarray[int32_t] right):
 *     '''
 */
  __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_507inner_join_indexer_int32, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8572; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_16);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_inner_join_indexer_int32, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8572; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;

  /* "pandas/src/generated.pyx":8665
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def inner_join_indexer_int64(ndarray[int64_t] left,             # <<<<<<<<<<<<<<
 *                               ndarray[int64_t] right):
 *     '''
 */
  __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_509inner_join_indexer_int64, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8665; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_16);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_inner_join_indexer_int64, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8665; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;

  /* "pandas/algos.pyx":1
 * from numpy cimport *             # <<<<<<<<<<<<<<
 * cimport numpy as np
 * import numpy as np
 */
  __pyx_t_16 = PyDict_New(); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_16);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;

  /* "View.MemoryView":203
 *         info.obj = self
 * 
 *     __pyx_getbuffer = capsule(<void *> &__pyx_array_getbuffer, "getbuffer(obj, view, flags)")             # <<<<<<<<<<<<<<
 * 
 *     def __dealloc__(array self):
 */
  __pyx_t_16 = __pyx_capsule_create(((void *)(&__pyx_array_getbuffer)), __pyx_k_getbuffer_obj_view_flags); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 203; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_16);
  if (PyDict_SetItem(__pyx_array_type->tp_dict, __pyx_n_s_pyx_getbuffer, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 203; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
  PyType_Modified(__pyx_array_type);

  /* "View.MemoryView":276
 *         return self.name
 * 
 * cdef generic = Enum("<strided and direct or indirect>")             # <<<<<<<<<<<<<<
 * cdef strided = Enum("<strided and direct>") # default
 * cdef indirect = Enum("<strided and indirect>")
 */
  __pyx_t_16 = __Pyx_PyObject_Call(((PyObject *)((PyObject *)__pyx_MemviewEnum_type)), __pyx_tuple__716, NULL); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 276; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_16);
  __Pyx_XGOTREF(generic);
  __Pyx_DECREF_SET(generic, __pyx_t_16);
  __Pyx_GIVEREF(__pyx_t_16);
  __pyx_t_16 = 0;

  /* "View.MemoryView":277
 * 
 * cdef generic = Enum("<strided and direct or indirect>")
 * cdef strided = Enum("<strided and direct>") # default             # <<<<<<<<<<<<<<
 * cdef indirect = Enum("<strided and indirect>")
 * 
 */
  __pyx_t_16 = __Pyx_PyObject_Call(((PyObject *)((PyObject *)__pyx_MemviewEnum_type)), __pyx_tuple__717, NULL); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 277; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_16);
  __Pyx_XGOTREF(strided);
  __Pyx_DECREF_SET(strided, __pyx_t_16);
  __Pyx_GIVEREF(__pyx_t_16);
  __pyx_t_16 = 0;

  /* "View.MemoryView":278
 * cdef generic = Enum("<strided and direct or indirect>")
 * cdef strided = Enum("<strided and direct>") # default
 * cdef indirect = Enum("<strided and indirect>")             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_16 = __Pyx_PyObject_Call(((PyObject *)((PyObject *)__pyx_MemviewEnum_type)), __pyx_tuple__718, NULL); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 278; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_16);
  __Pyx_XGOTREF(indirect);
  __Pyx_DECREF_SET(indirect, __pyx_t_16);
  __Pyx_GIVEREF(__pyx_t_16);
  __pyx_t_16 = 0;

  /* "View.MemoryView":281
 * 
 * 
 * cdef contiguous = Enum("<contiguous and direct>")             # <<<<<<<<<<<<<<
 * cdef indirect_contiguous = Enum("<contiguous and indirect>")
 * 
 */
  __pyx_t_16 = __Pyx_PyObject_Call(((PyObject *)((PyObject *)__pyx_MemviewEnum_type)), __pyx_tuple__719, NULL); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 281; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_16);
  __Pyx_XGOTREF(contiguous);
  __Pyx_DECREF_SET(contiguous, __pyx_t_16);
  __Pyx_GIVEREF(__pyx_t_16);
  __pyx_t_16 = 0;

  /* "View.MemoryView":282
 * 
 * cdef contiguous = Enum("<contiguous and direct>")
 * cdef indirect_contiguous = Enum("<contiguous and indirect>")             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_16 = __Pyx_PyObject_Call(((PyObject *)((PyObject *)__pyx_MemviewEnum_type)), __pyx_tuple__720, NULL); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 282; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_16);
  __Pyx_XGOTREF(indirect_contiguous);
  __Pyx_DECREF_SET(indirect_contiguous, __pyx_t_16);
  __Pyx_GIVEREF(__pyx_t_16);
  __pyx_t_16 = 0;

  /* "View.MemoryView":496
 *         info.obj = self
 * 
 *     __pyx_getbuffer = capsule(<void *> &__pyx_memoryview_getbuffer, "getbuffer(obj, view, flags)")             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_16 = __pyx_capsule_create(((void *)(&__pyx_memoryview_getbuffer)), __pyx_k_getbuffer_obj_view_flags); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 496; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_16);
  if (PyDict_SetItem(__pyx_memoryview_type->tp_dict, __pyx_n_s_pyx_getbuffer, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 496; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
  PyType_Modified(__pyx_memoryview_type);

  /* "View.MemoryView":953
 *             return self.from_object
 * 
 *     __pyx_getbuffer = capsule(<void *> &__pyx_memoryview_getbuffer, "getbuffer(obj, view, flags)")             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_16 = __pyx_capsule_create(((void *)(&__pyx_memoryview_getbuffer)), __pyx_k_getbuffer_obj_view_flags); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 953; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_16);
  if (PyDict_SetItem(__pyx_memoryviewslice_type->tp_dict, __pyx_n_s_pyx_getbuffer, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 953; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
  PyType_Modified(__pyx_memoryviewslice_type);

  /* "__pyxutil":2
 * 
 * cdef extern from *:             # <<<<<<<<<<<<<<
 *     void __pyx_PyErr_Clear "PyErr_Clear" ()
 *     __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int8_t(object)
 */
  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_12);
  __Pyx_XDECREF(__pyx_t_13);
  __Pyx_XDECREF(__pyx_t_14);
  __Pyx_XDECREF(__pyx_t_15);
  __Pyx_XDECREF(__pyx_t_16);
  if (__pyx_m) {
    __Pyx_AddTraceback("init pandas.algos", __pyx_clineno, __pyx_lineno, __pyx_filename);
    Py_DECREF(__pyx_m); __pyx_m = 0;
  } else if (!PyErr_Occurred()) {
    PyErr_SetString(PyExc_ImportError, "init pandas.algos");
  }
  __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_GetBuiltinName(PyObject *name) {
    PyObject* result = __Pyx_PyObject_GetAttrStr(__pyx_b, name);
    if (unlikely(!result)) {
        PyErr_Format(PyExc_NameError,
#if PY_MAJOR_VERSION >= 3
            "name '%U' is not defined", name);
#else
            "name '%.200s' is not defined", PyString_AS_STRING(name));
#endif
    }
    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,
                 "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T "d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_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_AsString(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;
            continue;
        }
        name = first_kw_arg;
        #if PY_MAJOR_VERSION < 3
        if (likely(PyString_CheckExact(key)) || likely(PyString_Check(key))) {
            while (*name) {
                if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key))
                        && _PyString_Eq(**name, key)) {
                    values[name-argnames] = value;
                    break;
                }
                name++;
            }
            if (*name) continue;
            else {
                PyObject*** argname = argnames;
                while (argname != first_kw_arg) {
                    if ((**argname == key) || (
                            (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key))
                             && _PyString_Eq(**argname, key))) {
                        goto arg_passed_twice;
                    }
                    argname++;
                }
            }
        } else
        #endif
        if (likely(PyUnicode_Check(key))) {
            while (*name) {
                int cmp = (**name == key) ? 0 :
                #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
                    (PyUnicode_GET_SIZE(**name) != PyUnicode_GET_SIZE(key)) ? 1 :
                #endif
                    PyUnicode_Compare(**name, key);
                if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad;
                if (cmp == 0) {
                    values[name-argnames] = value;
                    break;
                }
                name++;
            }
            if (*name) continue;
            else {
                PyObject*** argname = argnames;
                while (argname != first_kw_arg) {
                    int cmp = (**argname == key) ? 0 :
                    #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
                        (PyUnicode_GET_SIZE(**argname) != PyUnicode_GET_SIZE(key)) ? 1 :
                    #endif
                        PyUnicode_Compare(**argname, key);
                    if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad;
                    if (cmp == 0) goto arg_passed_twice;
                    argname++;
                }
            }
        } else
            goto invalid_keyword_type;
        if (kwds2) {
            if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad;
        } else {
            goto invalid_keyword;
        }
    }
    return 0;
arg_passed_twice:
    __Pyx_RaiseDoubleKeywordsError(function_name, key);
    goto bad;
invalid_keyword_type:
    PyErr_Format(PyExc_TypeError,
        "%.200s() keywords must be strings", function_name);
    goto bad;
invalid_keyword:
    PyErr_Format(PyExc_TypeError,
    #if PY_MAJOR_VERSION < 3
        "%.200s() got an unexpected keyword argument '%.200s'",
        function_name, PyString_AsString(key));
    #else
        "%s() got an unexpected keyword argument '%U'",
        function_name, key);
    #endif
bad:
    return -1;
}

static CYTHON_INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb) {
#if CYTHON_COMPILING_IN_CPYTHON
    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);
#else
    PyErr_Restore(type, value, tb);
#endif
}
static CYTHON_INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyObject **tb) {
#if CYTHON_COMPILING_IN_CPYTHON
    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;
#else
    PyErr_Fetch(type, value, tb);
#endif
}

static void __Pyx_WriteUnraisable(const char *name, CYTHON_UNUSED int clineno,
                                  CYTHON_UNUSED int lineno, CYTHON_UNUSED const char *filename,
                                  int full_traceback) {
    PyObject *old_exc, *old_val, *old_tb;
    PyObject *ctx;
    __Pyx_ErrFetch(&old_exc, &old_val, &old_tb);
    if (full_traceback) {
        Py_XINCREF(old_exc);
        Py_XINCREF(old_val);
        Py_XINCREF(old_tb);
        __Pyx_ErrRestore(old_exc, old_val, old_tb);
        PyErr_PrintEx(1);
    }
    #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 void __Pyx_RaiseArgumentTypeInvalid(const char* name, PyObject *obj, PyTypeObject *type) {
    PyErr_Format(PyExc_TypeError,
        "Argument '%.200s' has incorrect type (expected %.200s, got %.200s)",
        name, type->tp_name, Py_TYPE(obj)->tp_name);
}
static CYTHON_INLINE int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed,
    const char *name, int exact)
{
    if (unlikely(!type)) {
        PyErr_SetString(PyExc_SystemError, "Missing type object");
        return 0;
    }
    if (none_allowed && obj == Py_None) return 1;
    else if (exact) {
        if (likely(Py_TYPE(obj) == type)) return 1;
        #if PY_MAJOR_VERSION == 2
        else if ((type == &PyBaseString_Type) && likely(__Pyx_PyBaseString_CheckExact(obj))) return 1;
        #endif
    }
    else {
        if (likely(PyObject_TypeCheck(obj, type))) return 1;
    }
    __Pyx_RaiseArgumentTypeInvalid(name, obj, type);
    return 0;
}

static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name) {
    PyObject *result;
#if CYTHON_COMPILING_IN_CPYTHON
    result = PyDict_GetItem(__pyx_d, name);
    if (result) {
        Py_INCREF(result);
    } else {
#else
    result = PyObject_GetItem(__pyx_d, name);
    if (!result) {
        PyErr_Clear();
#endif
        result = __Pyx_GetBuiltinName(name);
    }
    return result;
}

#if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) {
    PyObject *result;
    ternaryfunc call = func->ob_type->tp_call;
    if (unlikely(!call))
        return PyObject_Call(func, arg, kw);
#if PY_VERSION_HEX >= 0x02060000
    if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object")))
        return NULL;
#endif
    result = (*call)(func, arg, kw);
#if PY_VERSION_HEX >= 0x02060000
    Py_LeaveRecursiveCall();
#endif
    if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
        PyErr_SetString(
            PyExc_SystemError,
            "NULL result without error in PyObject_Call");
    }
    return result;
}
#endif

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;
}
static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i,
                                                              int wraparound, int boundscheck) {
#if CYTHON_COMPILING_IN_CPYTHON
    if (wraparound & unlikely(i < 0)) i += PyList_GET_SIZE(o);
    if ((!boundscheck) || likely((0 <= i) & (i < PyList_GET_SIZE(o)))) {
        PyObject *r = PyList_GET_ITEM(o, i);
        Py_INCREF(r);
        return r;
    }
    return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
#else
    return PySequence_GetItem(o, i);
#endif
}
static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i,
                                                              int wraparound, int boundscheck) {
#if CYTHON_COMPILING_IN_CPYTHON
    if (wraparound & unlikely(i < 0)) i += PyTuple_GET_SIZE(o);
    if ((!boundscheck) || likely((0 <= i) & (i < PyTuple_GET_SIZE(o)))) {
        PyObject *r = PyTuple_GET_ITEM(o, i);
        Py_INCREF(r);
        return r;
    }
    return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
#else
    return PySequence_GetItem(o, i);
#endif
}
static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i,
                                                     int is_list, int wraparound, int boundscheck) {
#if CYTHON_COMPILING_IN_CPYTHON
    if (is_list || PyList_CheckExact(o)) {
        Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyList_GET_SIZE(o);
        if ((!boundscheck) || (likely((n >= 0) & (n < PyList_GET_SIZE(o))))) {
            PyObject *r = PyList_GET_ITEM(o, n);
            Py_INCREF(r);
            return r;
        }
    }
    else if (PyTuple_CheckExact(o)) {
        Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyTuple_GET_SIZE(o);
        if ((!boundscheck) || likely((n >= 0) & (n < PyTuple_GET_SIZE(o)))) {
            PyObject *r = PyTuple_GET_ITEM(o, n);
            Py_INCREF(r);
            return r;
        }
    } else {
        PySequenceMethods *m = Py_TYPE(o)->tp_as_sequence;
        if (likely(m && m->sq_item)) {
            if (wraparound && unlikely(i < 0) && likely(m->sq_length)) {
                Py_ssize_t l = m->sq_length(o);
                if (likely(l >= 0)) {
                    i += l;
                } else {
                    if (PyErr_ExceptionMatches(PyExc_OverflowError))
                        PyErr_Clear();
                    else
                        return NULL;
                }
            }
            return m->sq_item(o, i);
        }
    }
#else
    if (is_list || PySequence_Check(o)) {
        return PySequence_GetItem(o, i);
    }
#endif
    return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
}

static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type) {
    if (unlikely(!type)) {
        PyErr_SetString(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_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,
                                               int is_list, int wraparound, int boundscheck) {
#if CYTHON_COMPILING_IN_CPYTHON
    if (is_list || PyList_CheckExact(o)) {
        Py_ssize_t n = (!wraparound) ? i : ((likely(i >= 0)) ? i : i + PyList_GET_SIZE(o));
        if ((!boundscheck) || likely((n >= 0) & (n < PyList_GET_SIZE(o)))) {
            PyObject* old = PyList_GET_ITEM(o, n);
            Py_INCREF(v);
            PyList_SET_ITEM(o, n, v);
            Py_DECREF(old);
            return 1;
        }
    } else {
        PySequenceMethods *m = Py_TYPE(o)->tp_as_sequence;
        if (likely(m && m->sq_ass_item)) {
            if (wraparound && unlikely(i < 0) && likely(m->sq_length)) {
                Py_ssize_t l = m->sq_length(o);
                if (likely(l >= 0)) {
                    i += l;
                } else {
                    if (PyErr_ExceptionMatches(PyExc_OverflowError))
                        PyErr_Clear();
                    else
                        return -1;
                }
            }
            return m->sq_ass_item(o, i, v);
        }
    }
#else
#if CYTHON_COMPILING_IN_PYPY
    if (is_list || (PySequence_Check(o) && !PyDict_Check(o))) {
#else
    if (is_list || PySequence_Check(o)) {
#endif
        return PySequence_SetItem(o, i, v);
    }
#endif
    return __Pyx_SetItemInt_Generic(o, PyInt_FromSsize_t(i), v);
}

#if PY_MAJOR_VERSION < 3
static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb,
                        CYTHON_UNUSED PyObject *cause) {
    Py_XINCREF(type);
    if (!value || value == Py_None)
        value = NULL;
    else
        Py_INCREF(value);
    if (!tb || tb == Py_None)
        tb = NULL;
    else {
        Py_INCREF(tb);
        if (!PyTraceBack_Check(tb)) {
            PyErr_SetString(PyExc_TypeError,
                "raise: arg 3 must be a traceback or None");
            goto raise_error;
        }
    }
    #if PY_VERSION_HEX < 0x02050000
    if (PyClass_Check(type)) {
    #else
    if (PyType_Check(type)) {
    #endif
#if CYTHON_COMPILING_IN_PYPY
        if (!value) {
            Py_INCREF(Py_None);
            value = Py_None;
        }
#endif
        PyErr_NormalizeException(&type, &value, &tb);
    } else {
        if (value) {
            PyErr_SetString(PyExc_TypeError,
                "instance exception may not have a separate value");
            goto raise_error;
        }
        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) {
    PyObject* owned_instance = NULL;
    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)) {
        PyObject *instance_class = NULL;
        if (value && PyExceptionInstance_Check(value)) {
            instance_class = (PyObject*) Py_TYPE(value);
            if (instance_class != type) {
                if (PyObject_IsSubclass(instance_class, type)) {
                    type = instance_class;
                } else {
                    instance_class = NULL;
                }
            }
        }
        if (!instance_class) {
            PyObject *args;
            if (!value)
                args = PyTuple_New(0);
            else if (PyTuple_Check(value)) {
                Py_INCREF(value);
                args = value;
            } else
                args = PyTuple_Pack(1, value);
            if (!args)
                goto bad;
            owned_instance = PyObject_Call(type, args, NULL);
            Py_DECREF(args);
            if (!owned_instance)
                goto bad;
            value = owned_instance;
            if (!PyExceptionInstance_Check(value)) {
                PyErr_Format(PyExc_TypeError,
                             "calling %R should have returned an instance of "
                             "BaseException, not %R",
                             type, Py_TYPE(value));
                goto bad;
            }
        }
    } else {
        PyErr_SetString(PyExc_TypeError,
            "raise: exception class must be a subclass of BaseException");
        goto bad;
    }
#if PY_VERSION_HEX >= 0x03030000
    if (cause) {
#else
    if (cause && cause != Py_None) {
#endif
        PyObject *fixed_cause;
        if (cause == Py_None) {
            fixed_cause = NULL;
        } else 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;
        }
        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:
    Py_XDECREF(owned_instance);
    return;
}
#endif

static CYTHON_INLINE int __Pyx_IsLittleEndian(void) {
  unsigned int n = 1;
  return *(unsigned char*)(&n) != 0;
}
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;
  ctx->is_valid_array = 0;
  ctx->struct_alignment = 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 int __Pyx_BufFmt_ExpectNumber(const char **ts) {
    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 number;
}
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 'c': return "'char'";
    case 'b': return "'signed 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 's': case 'p': return "a string";
    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': case 's': case 'p': 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': case 's': case 'p': 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, CYTHON_UNUSED int is_complex) {
  switch (ch) {
    case '?': case 'c': case 'b': case 'B': case 's': case 'p': 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;
    }
}
/* These are for computing the padding at the end of the struct to align
   on the first member of the struct. This will probably the same as above,
   but we don't have any guarantees.
 */
typedef struct { short x; char c; } __Pyx_pad_short;
typedef struct { int x; char c; } __Pyx_pad_int;
typedef struct { long x; char c; } __Pyx_pad_long;
typedef struct { float x; char c; } __Pyx_pad_float;
typedef struct { double x; char c; } __Pyx_pad_double;
typedef struct { long double x; char c; } __Pyx_pad_longdouble;
typedef struct { void *x; char c; } __Pyx_pad_void_p;
#ifdef HAVE_LONG_LONG
typedef struct { PY_LONG_LONG x; char c; } __Pyx_pad_longlong;
#endif
static size_t __Pyx_BufFmt_TypeCharToPadding(char ch, CYTHON_UNUSED int is_complex) {
  switch (ch) {
    case '?': case 'c': case 'b': case 'B': case 's': case 'p': return 1;
    case 'h': case 'H': return sizeof(__Pyx_pad_short) - sizeof(short);
    case 'i': case 'I': return sizeof(__Pyx_pad_int) - sizeof(int);
    case 'l': case 'L': return sizeof(__Pyx_pad_long) - sizeof(long);
#ifdef HAVE_LONG_LONG
    case 'q': case 'Q': return sizeof(__Pyx_pad_longlong) - sizeof(PY_LONG_LONG);
#endif
    case 'f': return sizeof(__Pyx_pad_float) - sizeof(float);
    case 'd': return sizeof(__Pyx_pad_double) - sizeof(double);
    case 'g': return sizeof(__Pyx_pad_longdouble) - sizeof(long double);
    case 'P': case 'O': return sizeof(__Pyx_pad_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':
        return 'H';
    case 'b': case 'h': case 'i':
    case 'l': case 'q': case 's': case 'p':
        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, arraysize = 1;
  if (ctx->enc_type == 0) return 0;
  if (ctx->head->field->type->arraysize[0]) {
    int i, ndim = 0;
    if (ctx->enc_type == 's' || ctx->enc_type == 'p') {
        ctx->is_valid_array = ctx->head->field->type->ndim == 1;
        ndim = 1;
        if (ctx->enc_count != ctx->head->field->type->arraysize[0]) {
            PyErr_Format(PyExc_ValueError,
                         "Expected a dimension of size %zu, got %zu",
                         ctx->head->field->type->arraysize[0], ctx->enc_count);
            return -1;
        }
    }
    if (!ctx->is_valid_array) {
      PyErr_Format(PyExc_ValueError, "Expected %d dimensions, got %d",
                   ctx->head->field->type->ndim, ndim);
      return -1;
    }
    for (i = 0; i < ctx->head->field->type->ndim; i++) {
      arraysize *= ctx->head->field->type->arraysize[i];
    }
    ctx->is_valid_array = 0;
    ctx->enc_count = 1;
  }
  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 (ctx->struct_alignment == 0)
          ctx->struct_alignment = __Pyx_BufFmt_TypeCharToPadding(ctx->enc_type,
                                                                 ctx->is_complex);
    }
    if (type->size != size || type->typegroup != group) {
      if (type->typegroup == 'C' && type->fields != NULL) {
        size_t parent_offset = ctx->head->parent_offset + field->offset;
        ++ctx->head;
        ctx->head->field = type->fields;
        ctx->head->parent_offset = parent_offset;
        continue;
      }
      if ((type->typegroup == 'H' || group == 'H') && type->size == size) {
      } else {
          __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 %" CYTHON_FORMAT_SSIZE_T "d but %" CYTHON_FORMAT_SSIZE_T "d expected",
                   (Py_ssize_t)ctx->fmt_offset, (Py_ssize_t)offset);
      return -1;
    }
    ctx->fmt_offset += size;
    if (arraysize)
      ctx->fmt_offset += (arraysize - 1) * size;
    --ctx->enc_count; /* Consume from buffer string */
    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 CYTHON_INLINE PyObject *
__pyx_buffmt_parse_array(__Pyx_BufFmt_Context* ctx, const char** tsp)
{
    const char *ts = *tsp;
    int i = 0, number;
    int ndim = ctx->head->field->type->ndim;
;
    ++ts;
    if (ctx->new_count != 1) {
        PyErr_SetString(PyExc_ValueError,
                        "Cannot handle repeated arrays in format string");
        return NULL;
    }
    if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
    while (*ts && *ts != ')') {
        switch (*ts) {
            case ' ': case '\f': case '\r': case '\n': case '\t': case '\v':  continue;
            default:  break;  /* not a 'break' in the loop */
        }
        number = __Pyx_BufFmt_ExpectNumber(&ts);
        if (number == -1) return NULL;
        if (i < ndim && (size_t) number != ctx->head->field->type->arraysize[i])
            return PyErr_Format(PyExc_ValueError,
                        "Expected a dimension of size %zu, got %d",
                        ctx->head->field->type->arraysize[i], number);
        if (*ts != ',' && *ts != ')')
            return PyErr_Format(PyExc_ValueError,
                                "Expected a comma in format string, got '%c'", *ts);
        if (*ts == ',') ts++;
        i++;
    }
    if (i != ndim)
        return PyErr_Format(PyExc_ValueError, "Expected %d dimension(s), got %d",
                            ctx->head->field->type->ndim, i);
    if (!*ts) {
        PyErr_SetString(PyExc_ValueError,
                        "Unexpected end of format string, expected ')'");
        return NULL;
    }
    ctx->is_valid_array = 1;
    ctx->new_count = 1;
    *tsp = ++ts;
    return Py_None;
}
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 '\r':
      case '\n':
        ++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;
          size_t struct_alignment = ctx->struct_alignment;
          ctx->new_count = 1;
          ++ts;
          if (*ts != '{') {
            PyErr_SetString(PyExc_ValueError, "Buffer acquisition: Expected '{' after 'T'");
            return NULL;
          }
          if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
          ctx->enc_type = 0; /* Erase processed last struct element */
          ctx->enc_count = 0;
          ctx->struct_alignment = 0;
          ++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;
          if (struct_alignment) ctx->struct_alignment = struct_alignment;
        }
        break;
      case '}': /* end of substruct; either repeat or move on */
        {
          size_t alignment = ctx->struct_alignment;
          ++ts;
          if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
          ctx->enc_type = 0; /* Erase processed last struct element */
          if (alignment && ctx->fmt_offset % alignment) {
            ctx->fmt_offset += alignment - (ctx->fmt_offset % alignment);
          }
        }
        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;
        }
      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': case 'p':
        if (ctx->enc_type == *ts && got_Z == ctx->is_complex &&
            ctx->enc_packmode == ctx->new_packmode) {
          ctx->enc_count += ctx->new_count;
          ctx->new_count = 1;
          got_Z = 0;
          ++ts;
          break;
        }
      case 's':
        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;
      case '(':
        if (!__pyx_buffmt_parse_array(ctx, &ts)) return NULL;
        break;
      default:
        {
          int number = __Pyx_BufFmt_ExpectNumber(&ts);
          if (number == -1) 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 (%" CYTHON_FORMAT_SSIZE_T "d byte%s) does not match size of '%s' (%" CYTHON_FORMAT_SSIZE_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 CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) {
    PyErr_Format(PyExc_ValueError,
                 "too many values to unpack (expected %" CYTHON_FORMAT_SSIZE_T "d)", expected);
}

static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) {
    PyErr_Format(PyExc_ValueError,
                 "need more than %" CYTHON_FORMAT_SSIZE_T "d value%.1s to unpack",
                 index, (index == 1) ? "" : "s");
}

static CYTHON_INLINE int __Pyx_IterFinish(void) {
#if CYTHON_COMPILING_IN_CPYTHON
    PyThreadState *tstate = PyThreadState_GET();
    PyObject* exc_type = tstate->curexc_type;
    if (unlikely(exc_type)) {
        if (likely(exc_type == PyExc_StopIteration) || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration)) {
            PyObject *exc_value, *exc_tb;
            exc_value = tstate->curexc_value;
            exc_tb = tstate->curexc_traceback;
            tstate->curexc_type = 0;
            tstate->curexc_value = 0;
            tstate->curexc_traceback = 0;
            Py_DECREF(exc_type);
            Py_XDECREF(exc_value);
            Py_XDECREF(exc_tb);
            return 0;
        } else {
            return -1;
        }
    }
    return 0;
#else
    if (unlikely(PyErr_Occurred())) {
        if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) {
            PyErr_Clear();
            return 0;
        } else {
            return -1;
        }
    }
    return 0;
#endif
}

static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected) {
    if (unlikely(retval)) {
        Py_DECREF(retval);
        __Pyx_RaiseTooManyValuesError(expected);
        return -1;
    } else {
        return __Pyx_IterFinish();
    }
    return 0;
}

static void __Pyx_RaiseBufferFallbackError(void) {
  PyErr_SetString(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_ExceptionSave(PyObject **type, PyObject **value, PyObject **tb) {
#if CYTHON_COMPILING_IN_CPYTHON
    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);
#else
    PyErr_GetExcInfo(type, value, tb);
#endif
}
static void __Pyx_ExceptionReset(PyObject *type, PyObject *value, PyObject *tb) {
#if CYTHON_COMPILING_IN_CPYTHON
    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);
#else
    PyErr_SetExcInfo(type, value, tb);
#endif
}

static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb) {
    PyObject *local_type, *local_value, *local_tb;
#if CYTHON_COMPILING_IN_CPYTHON
    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;
#else
    PyErr_Fetch(&local_type, &local_value, &local_tb);
#endif
    PyErr_NormalizeException(&local_type, &local_value, &local_tb);
#if CYTHON_COMPILING_IN_CPYTHON
    if (unlikely(tstate->curexc_type))
#else
    if (unlikely(PyErr_Occurred()))
#endif
        goto bad;
    #if PY_MAJOR_VERSION >= 3
    if (local_tb) {
        if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0))
            goto bad;
    }
    #endif
    Py_XINCREF(local_tb);
    Py_XINCREF(local_type);
    Py_XINCREF(local_value);
    *type = local_type;
    *value = local_value;
    *tb = local_tb;
#if CYTHON_COMPILING_IN_CPYTHON
    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;
    Py_XDECREF(tmp_type);
    Py_XDECREF(tmp_value);
    Py_XDECREF(tmp_tb);
#else
    PyErr_SetExcInfo(local_type, local_value, local_tb);
#endif
    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_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals) {
#if CYTHON_COMPILING_IN_PYPY
    return PyObject_RichCompareBool(s1, s2, equals);
#else
    if (s1 == s2) {
        return (equals == Py_EQ);
    } else if (PyBytes_CheckExact(s1) & PyBytes_CheckExact(s2)) {
        const char *ps1, *ps2;
        Py_ssize_t length = PyBytes_GET_SIZE(s1);
        if (length != PyBytes_GET_SIZE(s2))
            return (equals == Py_NE);
        ps1 = PyBytes_AS_STRING(s1);
        ps2 = PyBytes_AS_STRING(s2);
        if (ps1[0] != ps2[0]) {
            return (equals == Py_NE);
        } else if (length == 1) {
            return (equals == Py_EQ);
        } else {
            int result = memcmp(ps1, ps2, (size_t)length);
            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;
    }
#endif
}

static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals) {
#if CYTHON_COMPILING_IN_PYPY
    return PyObject_RichCompareBool(s1, s2, equals);
#else
#if PY_MAJOR_VERSION < 3
    PyObject* owned_ref = NULL;
#endif
    int s1_is_unicode, s2_is_unicode;
    if (s1 == s2) {
        goto return_eq;
    }
    s1_is_unicode = PyUnicode_CheckExact(s1);
    s2_is_unicode = PyUnicode_CheckExact(s2);
#if PY_MAJOR_VERSION < 3
    if ((s1_is_unicode & (!s2_is_unicode)) && PyString_CheckExact(s2)) {
        owned_ref = PyUnicode_FromObject(s2);
        if (unlikely(!owned_ref))
            return -1;
        s2 = owned_ref;
        s2_is_unicode = 1;
    } else if ((s2_is_unicode & (!s1_is_unicode)) && PyString_CheckExact(s1)) {
        owned_ref = PyUnicode_FromObject(s1);
        if (unlikely(!owned_ref))
            return -1;
        s1 = owned_ref;
        s1_is_unicode = 1;
    } else if (((!s2_is_unicode) & (!s1_is_unicode))) {
        return __Pyx_PyBytes_Equals(s1, s2, equals);
    }
#endif
    if (s1_is_unicode & s2_is_unicode) {
        Py_ssize_t length;
        int kind;
        void *data1, *data2;
        #if CYTHON_PEP393_ENABLED
        if (unlikely(PyUnicode_READY(s1) < 0) || unlikely(PyUnicode_READY(s2) < 0))
            return -1;
        #endif
        length = __Pyx_PyUnicode_GET_LENGTH(s1);
        if (length != __Pyx_PyUnicode_GET_LENGTH(s2)) {
            goto return_ne;
        }
        kind = __Pyx_PyUnicode_KIND(s1);
        if (kind != __Pyx_PyUnicode_KIND(s2)) {
            goto return_ne;
        }
        data1 = __Pyx_PyUnicode_DATA(s1);
        data2 = __Pyx_PyUnicode_DATA(s2);
        if (__Pyx_PyUnicode_READ(kind, data1, 0) != __Pyx_PyUnicode_READ(kind, data2, 0)) {
            goto return_ne;
        } else if (length == 1) {
            goto return_eq;
        } else {
            int result = memcmp(data1, data2, length * kind);
            #if PY_MAJOR_VERSION < 3
            Py_XDECREF(owned_ref);
            #endif
            return (equals == Py_EQ) ? (result == 0) : (result != 0);
        }
    } else if ((s1 == Py_None) & s2_is_unicode) {
        goto return_ne;
    } else if ((s2 == Py_None) & s1_is_unicode) {
        goto return_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;
    }
return_eq:
    #if PY_MAJOR_VERSION < 3
    Py_XDECREF(owned_ref);
    #endif
    return (equals == Py_EQ);
return_ne:
    #if PY_MAJOR_VERSION < 3
    Py_XDECREF(owned_ref);
    #endif
    return (equals == Py_NE);
#endif
}

static CYTHON_INLINE void __Pyx_RaiseUnboundLocalError(const char *varname) {
    PyErr_Format(PyExc_UnboundLocalError, "local variable '%s' referenced before assignment", varname);
}

static int
__Pyx_init_memviewslice(struct __pyx_memoryview_obj *memview,
                        int ndim,
                        __Pyx_memviewslice *memviewslice,
                        int memview_is_new_reference)
{
    __Pyx_RefNannyDeclarations
    int i, retval=-1;
    Py_buffer *buf = &memview->view;
    __Pyx_RefNannySetupContext("init_memviewslice", 0);
    if (!buf) {
        PyErr_SetString(PyExc_ValueError,
            "buf is NULL.");
        goto fail;
    } else if (memviewslice->memview || memviewslice->data) {
        PyErr_SetString(PyExc_ValueError,
            "memviewslice is already initialized!");
        goto fail;
    }
    if (buf->strides) {
        for (i = 0; i < ndim; i++) {
            memviewslice->strides[i] = buf->strides[i];
        }
    } else {
        Py_ssize_t stride = buf->itemsize;
        for (i = ndim - 1; i >= 0; i--) {
            memviewslice->strides[i] = stride;
            stride *= buf->shape[i];
        }
    }
    for (i = 0; i < ndim; i++) {
        memviewslice->shape[i]   = buf->shape[i];
        if (buf->suboffsets) {
            memviewslice->suboffsets[i] = buf->suboffsets[i];
        } else {
            memviewslice->suboffsets[i] = -1;
        }
    }
    memviewslice->memview = memview;
    memviewslice->data = (char *)buf->buf;
    if (__pyx_add_acquisition_count(memview) == 0 && !memview_is_new_reference) {
        Py_INCREF(memview);
    }
    retval = 0;
    goto no_fail;
fail:
    memviewslice->memview = 0;
    memviewslice->data = 0;
    retval = -1;
no_fail:
    __Pyx_RefNannyFinishContext();
    return retval;
}
static CYTHON_INLINE void __pyx_fatalerror(const char *fmt, ...) {
    va_list vargs;
    char msg[200];
    va_start(vargs, fmt);
#ifdef HAVE_STDARG_PROTOTYPES
    va_start(vargs, fmt);
#else
    va_start(vargs);
#endif
    vsnprintf(msg, 200, fmt, vargs);
    Py_FatalError(msg);
    va_end(vargs);
}
static CYTHON_INLINE int
__pyx_add_acquisition_count_locked(__pyx_atomic_int *acquisition_count,
                                   PyThread_type_lock lock)
{
    int result;
    PyThread_acquire_lock(lock, 1);
    result = (*acquisition_count)++;
    PyThread_release_lock(lock);
    return result;
}
static CYTHON_INLINE int
__pyx_sub_acquisition_count_locked(__pyx_atomic_int *acquisition_count,
                                   PyThread_type_lock lock)
{
    int result;
    PyThread_acquire_lock(lock, 1);
    result = (*acquisition_count)--;
    PyThread_release_lock(lock);
    return result;
}
static CYTHON_INLINE void
__Pyx_INC_MEMVIEW(__Pyx_memviewslice *memslice, int have_gil, int lineno)
{
    int first_time;
    struct __pyx_memoryview_obj *memview = memslice->memview;
    if (!memview || (PyObject *) memview == Py_None)
        return; /* allow uninitialized memoryview assignment */
    if (__pyx_get_slice_count(memview) < 0)
        __pyx_fatalerror("Acquisition count is %d (line %d)",
                         __pyx_get_slice_count(memview), lineno);
    first_time = __pyx_add_acquisition_count(memview) == 0;
    if (first_time) {
        if (have_gil) {
            Py_INCREF((PyObject *) memview);
        } else {
            PyGILState_STATE _gilstate = PyGILState_Ensure();
            Py_INCREF((PyObject *) memview);
            PyGILState_Release(_gilstate);
        }
    }
}
static CYTHON_INLINE void __Pyx_XDEC_MEMVIEW(__Pyx_memviewslice *memslice,
                                             int have_gil, int lineno) {
    int last_time;
    struct __pyx_memoryview_obj *memview = memslice->memview;
    if (!memview ) {
        return;
    } else if ((PyObject *) memview == Py_None) {
        memslice->memview = NULL;
        return;
    }
    if (__pyx_get_slice_count(memview) <= 0)
        __pyx_fatalerror("Acquisition count is %d (line %d)",
                         __pyx_get_slice_count(memview), lineno);
    last_time = __pyx_sub_acquisition_count(memview) == 1;
    memslice->data = NULL;
    if (last_time) {
        if (have_gil) {
            Py_CLEAR(memslice->memview);
        } else {
            PyGILState_STATE _gilstate = PyGILState_Ensure();
            Py_CLEAR(memslice->memview);
            PyGILState_Release(_gilstate);
        }
    } else {
        memslice->memview = NULL;
    }
}

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 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_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_div___pyx_t_5numpy_int64_t(__pyx_t_5numpy_int64_t a, __pyx_t_5numpy_int64_t b) {
    __pyx_t_5numpy_int64_t q = a / b;
    __pyx_t_5numpy_int64_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 PyObject* __Pyx_PyObject_GetSlice(
        PyObject* obj, Py_ssize_t cstart, Py_ssize_t cstop,
        PyObject** _py_start, PyObject** _py_stop, PyObject** _py_slice,
        int has_cstart, int has_cstop, CYTHON_UNUSED int wraparound) {
#if CYTHON_COMPILING_IN_CPYTHON
    PyMappingMethods* mp;
#if PY_MAJOR_VERSION < 3
    PySequenceMethods* ms = Py_TYPE(obj)->tp_as_sequence;
    if (likely(ms && ms->sq_slice)) {
        if (!has_cstart) {
            if (_py_start && (*_py_start != Py_None)) {
                cstart = __Pyx_PyIndex_AsSsize_t(*_py_start);
                if ((cstart == (Py_ssize_t)-1) && PyErr_Occurred()) goto bad;
            } else
                cstart = 0;
        }
        if (!has_cstop) {
            if (_py_stop && (*_py_stop != Py_None)) {
                cstop = __Pyx_PyIndex_AsSsize_t(*_py_stop);
                if ((cstop == (Py_ssize_t)-1) && PyErr_Occurred()) goto bad;
            } else
                cstop = PY_SSIZE_T_MAX;
        }
        if (wraparound && unlikely((cstart < 0) | (cstop < 0)) && likely(ms->sq_length)) {
            Py_ssize_t l = ms->sq_length(obj);
            if (likely(l >= 0)) {
                if (cstop < 0) {
                    cstop += l;
                    if (cstop < 0) cstop = 0;
                }
                if (cstart < 0) {
                    cstart += l;
                    if (cstart < 0) cstart = 0;
                }
            } else {
                if (PyErr_ExceptionMatches(PyExc_OverflowError))
                    PyErr_Clear();
                else
                    goto bad;
            }
        }
        return ms->sq_slice(obj, cstart, cstop);
    }
#endif
    mp = Py_TYPE(obj)->tp_as_mapping;
    if (likely(mp && mp->mp_subscript))
#endif
    {
        PyObject* result;
        PyObject *py_slice, *py_start, *py_stop;
        if (_py_slice) {
            py_slice = *_py_slice;
        } else {
            PyObject* owned_start = NULL;
            PyObject* owned_stop = NULL;
            if (_py_start) {
                py_start = *_py_start;
            } else {
                if (has_cstart) {
                    owned_start = py_start = PyInt_FromSsize_t(cstart);
                    if (unlikely(!py_start)) goto bad;
                } else
                    py_start = Py_None;
            }
            if (_py_stop) {
                py_stop = *_py_stop;
            } else {
                if (has_cstop) {
                    owned_stop = py_stop = PyInt_FromSsize_t(cstop);
                    if (unlikely(!py_stop)) {
                        Py_XDECREF(owned_start);
                        goto bad;
                    }
                } else
                    py_stop = Py_None;
            }
            py_slice = PySlice_New(py_start, py_stop, Py_None);
            Py_XDECREF(owned_start);
            Py_XDECREF(owned_stop);
            if (unlikely(!py_slice)) goto bad;
        }
#if CYTHON_COMPILING_IN_CPYTHON
        result = mp->mp_subscript(obj, py_slice);
#else
        result = PyObject_GetItem(obj, py_slice);
#endif
        if (!_py_slice) {
            Py_DECREF(py_slice);
        }
        return result;
    }
    PyErr_Format(PyExc_TypeError,
        "'%.200s' object is unsliceable", Py_TYPE(obj)->tp_name);
bad:
    return NULL;
}

static CYTHON_INLINE int __Pyx_PyObject_SetSlice(
        PyObject* obj, PyObject* value, Py_ssize_t cstart, Py_ssize_t cstop,
        PyObject** _py_start, PyObject** _py_stop, PyObject** _py_slice,
        int has_cstart, int has_cstop, CYTHON_UNUSED int wraparound) {
#if CYTHON_COMPILING_IN_CPYTHON
    PyMappingMethods* mp;
#if PY_MAJOR_VERSION < 3
    PySequenceMethods* ms = Py_TYPE(obj)->tp_as_sequence;
    if (likely(ms && ms->sq_ass_slice)) {
        if (!has_cstart) {
            if (_py_start && (*_py_start != Py_None)) {
                cstart = __Pyx_PyIndex_AsSsize_t(*_py_start);
                if ((cstart == (Py_ssize_t)-1) && PyErr_Occurred()) goto bad;
            } else
                cstart = 0;
        }
        if (!has_cstop) {
            if (_py_stop && (*_py_stop != Py_None)) {
                cstop = __Pyx_PyIndex_AsSsize_t(*_py_stop);
                if ((cstop == (Py_ssize_t)-1) && PyErr_Occurred()) goto bad;
            } else
                cstop = PY_SSIZE_T_MAX;
        }
        if (wraparound && unlikely((cstart < 0) | (cstop < 0)) && likely(ms->sq_length)) {
            Py_ssize_t l = ms->sq_length(obj);
            if (likely(l >= 0)) {
                if (cstop < 0) {
                    cstop += l;
                    if (cstop < 0) cstop = 0;
                }
                if (cstart < 0) {
                    cstart += l;
                    if (cstart < 0) cstart = 0;
                }
            } else {
                if (PyErr_ExceptionMatches(PyExc_OverflowError))
                    PyErr_Clear();
                else
                    goto bad;
            }
        }
        return ms->sq_ass_slice(obj, cstart, cstop, value);
    }
#endif
    mp = Py_TYPE(obj)->tp_as_mapping;
    if (likely(mp && mp->mp_ass_subscript))
#endif
    {
        int result;
        PyObject *py_slice, *py_start, *py_stop;
        if (_py_slice) {
            py_slice = *_py_slice;
        } else {
            PyObject* owned_start = NULL;
            PyObject* owned_stop = NULL;
            if (_py_start) {
                py_start = *_py_start;
            } else {
                if (has_cstart) {
                    owned_start = py_start = PyInt_FromSsize_t(cstart);
                    if (unlikely(!py_start)) goto bad;
                } else
                    py_start = Py_None;
            }
            if (_py_stop) {
                py_stop = *_py_stop;
            } else {
                if (has_cstop) {
                    owned_stop = py_stop = PyInt_FromSsize_t(cstop);
                    if (unlikely(!py_stop)) {
                        Py_XDECREF(owned_start);
                        goto bad;
                    }
                } else
                    py_stop = Py_None;
            }
            py_slice = PySlice_New(py_start, py_stop, Py_None);
            Py_XDECREF(owned_start);
            Py_XDECREF(owned_stop);
            if (unlikely(!py_slice)) goto bad;
        }
#if CYTHON_COMPILING_IN_CPYTHON
        result = mp->mp_ass_subscript(obj, py_slice, value);
#else
        result = value ? PyObject_SetItem(obj, py_slice, value) : PyObject_DelItem(obj, py_slice);
#endif
        if (!_py_slice) {
            Py_DECREF(py_slice);
        }
        return result;
    }
    PyErr_Format(PyExc_TypeError,
        "'%.200s' object does not support slice %.10s",
        Py_TYPE(obj)->tp_name, value ? "assignment" : "deletion");
bad:
    return -1;
}

static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) {
    PyObject* value = __Pyx_PyObject_GetAttrStr(module, name);
    if (unlikely(!value) && PyErr_ExceptionMatches(PyExc_AttributeError)) {
        PyErr_Format(PyExc_ImportError,
        #if PY_MAJOR_VERSION < 3
            "cannot import name %.230s", PyString_AS_STRING(name));
        #else
            "cannot import name %S", name);
        #endif
    }
    return value;
}

static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
}

static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *o, PyObject *n) {
#if CYTHON_COMPILING_IN_CPYTHON
#if PY_MAJOR_VERSION >= 3
    if (likely(PyUnicode_Check(n)))
#else
    if (likely(PyString_Check(n)))
#endif
        return __Pyx_PyObject_GetAttrStr(o, n);
#endif
    return PyObject_GetAttr(o, n);
}

static CYTHON_INLINE PyObject* __Pyx_decode_c_string(
         const char* cstring, Py_ssize_t start, Py_ssize_t stop,
         const char* encoding, const char* errors,
         PyObject* (*decode_func)(const char *s, Py_ssize_t size, const char *errors)) {
    Py_ssize_t length;
    if (unlikely((start < 0) | (stop < 0))) {
        length = strlen(cstring);
        if (start < 0) {
            start += length;
            if (start < 0)
                start = 0;
        }
        if (stop < 0)
            stop += length;
    }
    length = stop - start;
    if (unlikely(length <= 0))
        return PyUnicode_FromUnicode(NULL, 0);
    cstring += start;
    if (decode_func) {
        return decode_func(cstring, length, errors);
    } else {
        return PyUnicode_Decode(cstring, length, encoding, errors);
    }
}

static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb) {
    PyObject *tmp_type, *tmp_value, *tmp_tb;
#if CYTHON_COMPILING_IN_CPYTHON
    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;
#else
    PyErr_GetExcInfo(&tmp_type, &tmp_value, &tmp_tb);
    PyErr_SetExcInfo(*type, *value, *tb);
#endif
    *type = tmp_type;
    *value = tmp_value;
    *tb = tmp_tb;
}

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_SetItem(dict, __pyx_n_s_pyx_vtable, ob) < 0)
        goto bad;
    Py_DECREF(ob);
    return 0;
bad:
    Py_XDECREF(ob);
    return -1;
}

static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type) {
    PyObject* fake_module;
    PyTypeObject* cached_type = NULL;
    fake_module = PyImport_AddModule((char*) "_cython_" CYTHON_ABI);
    if (!fake_module) return NULL;
    Py_INCREF(fake_module);
    cached_type = (PyTypeObject*) PyObject_GetAttrString(fake_module, type->tp_name);
    if (cached_type) {
        if (!PyType_Check((PyObject*)cached_type)) {
            PyErr_Format(PyExc_TypeError,
                "Shared Cython type %.200s is not a type object",
                type->tp_name);
            goto bad;
        }
        if (cached_type->tp_basicsize != type->tp_basicsize) {
            PyErr_Format(PyExc_TypeError,
                "Shared Cython type %.200s has the wrong size, try recompiling",
                type->tp_name);
            goto bad;
        }
    } else {
        if (!PyErr_ExceptionMatches(PyExc_AttributeError)) goto bad;
        PyErr_Clear();
        if (PyType_Ready(type) < 0) goto bad;
        if (PyObject_SetAttrString(fake_module, type->tp_name, (PyObject*) type) < 0)
            goto bad;
        Py_INCREF(type);
        cached_type = type;
    }
done:
    Py_DECREF(fake_module);
    return cached_type;
bad:
    Py_XDECREF(cached_type);
    cached_type = NULL;
    goto done;
}

static PyObject *
__Pyx_CyFunction_get_doc(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *closure)
{
    if (unlikely(op->func_doc == NULL)) {
        if (op->func.m_ml->ml_doc) {
#if PY_MAJOR_VERSION >= 3
            op->func_doc = PyUnicode_FromString(op->func.m_ml->ml_doc);
#else
            op->func_doc = PyString_FromString(op->func.m_ml->ml_doc);
#endif
            if (unlikely(op->func_doc == NULL))
                return NULL;
        } else {
            Py_INCREF(Py_None);
            return Py_None;
        }
    }
    Py_INCREF(op->func_doc);
    return op->func_doc;
}
static int
__Pyx_CyFunction_set_doc(__pyx_CyFunctionObject *op, PyObject *value)
{
    PyObject *tmp = op->func_doc;
    if (value == NULL)
        value = Py_None; /* Mark as deleted */
    Py_INCREF(value);
    op->func_doc = value;
    Py_XDECREF(tmp);
    return 0;
}
static PyObject *
__Pyx_CyFunction_get_name(__pyx_CyFunctionObject *op)
{
    if (unlikely(op->func_name == NULL)) {
#if PY_MAJOR_VERSION >= 3
        op->func_name = PyUnicode_InternFromString(op->func.m_ml->ml_name);
#else
        op->func_name = PyString_InternFromString(op->func.m_ml->ml_name);
#endif
        if (unlikely(op->func_name == NULL))
            return NULL;
    }
    Py_INCREF(op->func_name);
    return op->func_name;
}
static int
__Pyx_CyFunction_set_name(__pyx_CyFunctionObject *op, PyObject *value)
{
    PyObject *tmp;
#if PY_MAJOR_VERSION >= 3
    if (unlikely(value == NULL || !PyUnicode_Check(value))) {
#else
    if (unlikely(value == NULL || !PyString_Check(value))) {
#endif
        PyErr_SetString(PyExc_TypeError,
                        "__name__ must be set to a string object");
        return -1;
    }
    tmp = op->func_name;
    Py_INCREF(value);
    op->func_name = value;
    Py_XDECREF(tmp);
    return 0;
}
static PyObject *
__Pyx_CyFunction_get_qualname(__pyx_CyFunctionObject *op)
{
    Py_INCREF(op->func_qualname);
    return op->func_qualname;
}
static int
__Pyx_CyFunction_set_qualname(__pyx_CyFunctionObject *op, PyObject *value)
{
    PyObject *tmp;
#if PY_MAJOR_VERSION >= 3
    if (unlikely(value == NULL || !PyUnicode_Check(value))) {
#else
    if (unlikely(value == NULL || !PyString_Check(value))) {
#endif
        PyErr_SetString(PyExc_TypeError,
                        "__qualname__ must be set to a string object");
        return -1;
    }
    tmp = op->func_qualname;
    Py_INCREF(value);
    op->func_qualname = value;
    Py_XDECREF(tmp);
    return 0;
}
static PyObject *
__Pyx_CyFunction_get_self(__pyx_CyFunctionObject *m, CYTHON_UNUSED void *closure)
{
    PyObject *self;
    self = m->func_closure;
    if (self == NULL)
        self = Py_None;
    Py_INCREF(self);
    return self;
}
static PyObject *
__Pyx_CyFunction_get_dict(__pyx_CyFunctionObject *op)
{
    if (unlikely(op->func_dict == NULL)) {
        op->func_dict = PyDict_New();
        if (unlikely(op->func_dict == NULL))
            return NULL;
    }
    Py_INCREF(op->func_dict);
    return op->func_dict;
}
static int
__Pyx_CyFunction_set_dict(__pyx_CyFunctionObject *op, PyObject *value)
{
    PyObject *tmp;
    if (unlikely(value == NULL)) {
        PyErr_SetString(PyExc_TypeError,
               "function's dictionary may not be deleted");
        return -1;
    }
    if (unlikely(!PyDict_Check(value))) {
        PyErr_SetString(PyExc_TypeError,
               "setting function's dictionary to a non-dict");
        return -1;
    }
    tmp = op->func_dict;
    Py_INCREF(value);
    op->func_dict = value;
    Py_XDECREF(tmp);
    return 0;
}
static PyObject *
__Pyx_CyFunction_get_globals(__pyx_CyFunctionObject *op)
{
    Py_INCREF(op->func_globals);
    return op->func_globals;
}
static PyObject *
__Pyx_CyFunction_get_closure(CYTHON_UNUSED __pyx_CyFunctionObject *op)
{
    Py_INCREF(Py_None);
    return Py_None;
}
static PyObject *
__Pyx_CyFunction_get_code(__pyx_CyFunctionObject *op)
{
    PyObject* result = (op->func_code) ? op->func_code : Py_None;
    Py_INCREF(result);
    return result;
}
static int
__Pyx_CyFunction_init_defaults(__pyx_CyFunctionObject *op) {
    PyObject *res = op->defaults_getter((PyObject *) op);
    if (unlikely(!res))
        return -1;
    op->defaults_tuple = PyTuple_GET_ITEM(res, 0);
    Py_INCREF(op->defaults_tuple);
    op->defaults_kwdict = PyTuple_GET_ITEM(res, 1);
    Py_INCREF(op->defaults_kwdict);
    Py_DECREF(res);
    return 0;
}
static int
__Pyx_CyFunction_set_defaults(__pyx_CyFunctionObject *op, PyObject* value) {
    PyObject* tmp;
    if (!value) {
        value = Py_None;
    } else if (value != Py_None && !PyTuple_Check(value)) {
        PyErr_SetString(PyExc_TypeError,
                        "__defaults__ must be set to a tuple object");
        return -1;
    }
    Py_INCREF(value);
    tmp = op->defaults_tuple;
    op->defaults_tuple = value;
    Py_XDECREF(tmp);
    return 0;
}
static PyObject *
__Pyx_CyFunction_get_defaults(__pyx_CyFunctionObject *op) {
    PyObject* result = op->defaults_tuple;
    if (unlikely(!result)) {
        if (op->defaults_getter) {
            if (__Pyx_CyFunction_init_defaults(op) < 0) return NULL;
            result = op->defaults_tuple;
        } else {
            result = Py_None;
        }
    }
    Py_INCREF(result);
    return result;
}
static int
__Pyx_CyFunction_set_kwdefaults(__pyx_CyFunctionObject *op, PyObject* value) {
    PyObject* tmp;
    if (!value) {
        value = Py_None;
    } else if (value != Py_None && !PyDict_Check(value)) {
        PyErr_SetString(PyExc_TypeError,
                        "__kwdefaults__ must be set to a dict object");
        return -1;
    }
    Py_INCREF(value);
    tmp = op->defaults_kwdict;
    op->defaults_kwdict = value;
    Py_XDECREF(tmp);
    return 0;
}
static PyObject *
__Pyx_CyFunction_get_kwdefaults(__pyx_CyFunctionObject *op) {
    PyObject* result = op->defaults_kwdict;
    if (unlikely(!result)) {
        if (op->defaults_getter) {
            if (__Pyx_CyFunction_init_defaults(op) < 0) return NULL;
            result = op->defaults_kwdict;
        } else {
            result = Py_None;
        }
    }
    Py_INCREF(result);
    return result;
}
static int
__Pyx_CyFunction_set_annotations(__pyx_CyFunctionObject *op, PyObject* value) {
    PyObject* tmp;
    if (!value || value == Py_None) {
        value = NULL;
    } else if (!PyDict_Check(value)) {
        PyErr_SetString(PyExc_TypeError,
                        "__annotations__ must be set to a dict object");
        return -1;
    }
    Py_XINCREF(value);
    tmp = op->func_annotations;
    op->func_annotations = value;
    Py_XDECREF(tmp);
    return 0;
}
static PyObject *
__Pyx_CyFunction_get_annotations(__pyx_CyFunctionObject *op) {
    PyObject* result = op->func_annotations;
    if (unlikely(!result)) {
        result = PyDict_New();
        if (unlikely(!result)) return NULL;
        op->func_annotations = result;
    }
    Py_INCREF(result);
    return result;
}
static PyGetSetDef __pyx_CyFunction_getsets[] = {
    {(char *) "func_doc", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0},
    {(char *) "__doc__",  (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0},
    {(char *) "func_name", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0},
    {(char *) "__name__", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0},
    {(char *) "__qualname__", (getter)__Pyx_CyFunction_get_qualname, (setter)__Pyx_CyFunction_set_qualname, 0, 0},
    {(char *) "__self__", (getter)__Pyx_CyFunction_get_self, 0, 0, 0},
    {(char *) "func_dict", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0},
    {(char *) "__dict__", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0},
    {(char *) "func_globals", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0},
    {(char *) "__globals__", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0},
    {(char *) "func_closure", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0},
    {(char *) "__closure__", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0},
    {(char *) "func_code", (getter)__Pyx_CyFunction_get_code, 0, 0, 0},
    {(char *) "__code__", (getter)__Pyx_CyFunction_get_code, 0, 0, 0},
    {(char *) "func_defaults", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0},
    {(char *) "__defaults__", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0},
    {(char *) "__kwdefaults__", (getter)__Pyx_CyFunction_get_kwdefaults, (setter)__Pyx_CyFunction_set_kwdefaults, 0, 0},
    {(char *) "__annotations__", (getter)__Pyx_CyFunction_get_annotations, (setter)__Pyx_CyFunction_set_annotations, 0, 0},
    {0, 0, 0, 0, 0}
};
#ifndef PY_WRITE_RESTRICTED /* < Py2.5 */
#define PY_WRITE_RESTRICTED WRITE_RESTRICTED
#endif
static PyMemberDef __pyx_CyFunction_members[] = {
    {(char *) "__module__", T_OBJECT, offsetof(__pyx_CyFunctionObject, func.m_module), PY_WRITE_RESTRICTED, 0},
    {0, 0, 0,  0, 0}
};
static PyObject *
__Pyx_CyFunction_reduce(__pyx_CyFunctionObject *m, CYTHON_UNUSED PyObject *args)
{
#if PY_MAJOR_VERSION >= 3
    return PyUnicode_FromString(m->func.m_ml->ml_name);
#else
    return PyString_FromString(m->func.m_ml->ml_name);
#endif
}
static PyMethodDef __pyx_CyFunction_methods[] = {
    {__Pyx_NAMESTR("__reduce__"), (PyCFunction)__Pyx_CyFunction_reduce, METH_VARARGS, 0},
    {0, 0, 0, 0}
};
static PyObject *__Pyx_CyFunction_New(PyTypeObject *type, PyMethodDef *ml, int flags, PyObject* qualname,
                                      PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) {
    __pyx_CyFunctionObject *op = PyObject_GC_New(__pyx_CyFunctionObject, type);
    if (op == NULL)
        return NULL;
    op->flags = flags;
    op->func_weakreflist = NULL;
    op->func.m_ml = ml;
    op->func.m_self = (PyObject *) op;
    Py_XINCREF(closure);
    op->func_closure = closure;
    Py_XINCREF(module);
    op->func.m_module = module;
    op->func_dict = NULL;
    op->func_name = NULL;
    Py_INCREF(qualname);
    op->func_qualname = qualname;
    op->func_doc = NULL;
    op->func_classobj = NULL;
    op->func_globals = globals;
    Py_INCREF(op->func_globals);
    Py_XINCREF(code);
    op->func_code = code;
    op->defaults_pyobjects = 0;
    op->defaults = NULL;
    op->defaults_tuple = NULL;
    op->defaults_kwdict = NULL;
    op->defaults_getter = NULL;
    op->func_annotations = NULL;
    PyObject_GC_Track(op);
    return (PyObject *) op;
}
static int
__Pyx_CyFunction_clear(__pyx_CyFunctionObject *m)
{
    Py_CLEAR(m->func_closure);
    Py_CLEAR(m->func.m_module);
    Py_CLEAR(m->func_dict);
    Py_CLEAR(m->func_name);
    Py_CLEAR(m->func_qualname);
    Py_CLEAR(m->func_doc);
    Py_CLEAR(m->func_globals);
    Py_CLEAR(m->func_code);
    Py_CLEAR(m->func_classobj);
    Py_CLEAR(m->defaults_tuple);
    Py_CLEAR(m->defaults_kwdict);
    Py_CLEAR(m->func_annotations);
    if (m->defaults) {
        PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m);
        int i;
        for (i = 0; i < m->defaults_pyobjects; i++)
            Py_XDECREF(pydefaults[i]);
        PyMem_Free(m->defaults);
        m->defaults = NULL;
    }
    return 0;
}
static void __Pyx_CyFunction_dealloc(__pyx_CyFunctionObject *m)
{
    PyObject_GC_UnTrack(m);
    if (m->func_weakreflist != NULL)
        PyObject_ClearWeakRefs((PyObject *) m);
    __Pyx_CyFunction_clear(m);
    PyObject_GC_Del(m);
}
static int __Pyx_CyFunction_traverse(__pyx_CyFunctionObject *m, visitproc visit, void *arg)
{
    Py_VISIT(m->func_closure);
    Py_VISIT(m->func.m_module);
    Py_VISIT(m->func_dict);
    Py_VISIT(m->func_name);
    Py_VISIT(m->func_qualname);
    Py_VISIT(m->func_doc);
    Py_VISIT(m->func_globals);
    Py_VISIT(m->func_code);
    Py_VISIT(m->func_classobj);
    Py_VISIT(m->defaults_tuple);
    Py_VISIT(m->defaults_kwdict);
    if (m->defaults) {
        PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m);
        int i;
        for (i = 0; i < m->defaults_pyobjects; i++)
            Py_VISIT(pydefaults[i]);
    }
    return 0;
}
static PyObject *__Pyx_CyFunction_descr_get(PyObject *func, PyObject *obj, PyObject *type)
{
    __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
    if (m->flags & __Pyx_CYFUNCTION_STATICMETHOD) {
        Py_INCREF(func);
        return func;
    }
    if (m->flags & __Pyx_CYFUNCTION_CLASSMETHOD) {
        if (type == NULL)
            type = (PyObject *)(Py_TYPE(obj));
        return PyMethod_New(func,
                            type, (PyObject *)(Py_TYPE(type)));
    }
    if (obj == Py_None)
        obj = NULL;
    return PyMethod_New(func, obj, type);
}
static PyObject*
__Pyx_CyFunction_repr(__pyx_CyFunctionObject *op)
{
#if PY_MAJOR_VERSION >= 3
    return PyUnicode_FromFormat("<cyfunction %U at %p>",
                                op->func_qualname, (void *)op);
#else
    return PyString_FromFormat("<cyfunction %s at %p>",
                               PyString_AsString(op->func_qualname), (void *)op);
#endif
}
#if CYTHON_COMPILING_IN_PYPY
static PyObject * __Pyx_CyFunction_Call(PyObject *func, PyObject *arg, PyObject *kw) {
    PyCFunctionObject* f = (PyCFunctionObject*)func;
    PyCFunction meth = PyCFunction_GET_FUNCTION(func);
    PyObject *self = PyCFunction_GET_SELF(func);
    Py_ssize_t size;
    switch (PyCFunction_GET_FLAGS(func) & ~(METH_CLASS | METH_STATIC | METH_COEXIST)) {
    case METH_VARARGS:
        if (likely(kw == NULL) || PyDict_Size(kw) == 0)
            return (*meth)(self, arg);
        break;
    case METH_VARARGS | METH_KEYWORDS:
        return (*(PyCFunctionWithKeywords)meth)(self, arg, kw);
    case METH_NOARGS:
        if (likely(kw == NULL) || PyDict_Size(kw) == 0) {
            size = PyTuple_GET_SIZE(arg);
            if (size == 0)
                return (*meth)(self, NULL);
            PyErr_Format(PyExc_TypeError,
                "%.200s() takes no arguments (%zd given)",
                f->m_ml->ml_name, size);
            return NULL;
        }
        break;
    case METH_O:
        if (likely(kw == NULL) || PyDict_Size(kw) == 0) {
            size = PyTuple_GET_SIZE(arg);
            if (size == 1)
                return (*meth)(self, PyTuple_GET_ITEM(arg, 0));
            PyErr_Format(PyExc_TypeError,
                "%.200s() takes exactly one argument (%zd given)",
                f->m_ml->ml_name, size);
            return NULL;
        }
        break;
    default:
        PyErr_SetString(PyExc_SystemError, "Bad call flags in "
                        "__Pyx_CyFunction_Call. METH_OLDARGS is no "
                        "longer supported!");
        return NULL;
    }
    PyErr_Format(PyExc_TypeError, "%.200s() takes no keyword arguments",
                 f->m_ml->ml_name);
    return NULL;
}
#else
static PyObject * __Pyx_CyFunction_Call(PyObject *func, PyObject *arg, PyObject *kw) {
	return PyCFunction_Call(func, arg, kw);
}
#endif
static PyTypeObject __pyx_CyFunctionType_type = {
    PyVarObject_HEAD_INIT(0, 0)
    __Pyx_NAMESTR("cython_function_or_method"), /*tp_name*/
    sizeof(__pyx_CyFunctionObject),   /*tp_basicsize*/
    0,                                  /*tp_itemsize*/
    (destructor) __Pyx_CyFunction_dealloc, /*tp_dealloc*/
    0,                                  /*tp_print*/
    0,                                  /*tp_getattr*/
    0,                                  /*tp_setattr*/
#if PY_MAJOR_VERSION < 3
    0,                                  /*tp_compare*/
#else
    0,                                  /*reserved*/
#endif
    (reprfunc) __Pyx_CyFunction_repr,   /*tp_repr*/
    0,                                  /*tp_as_number*/
    0,                                  /*tp_as_sequence*/
    0,                                  /*tp_as_mapping*/
    0,                                  /*tp_hash*/
    __Pyx_CyFunction_Call,              /*tp_call*/
    0,                                  /*tp_str*/
    0,                                  /*tp_getattro*/
    0,                                  /*tp_setattro*/
    0,                                  /*tp_as_buffer*/
    Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC, /* tp_flags*/
    0,                                  /*tp_doc*/
    (traverseproc) __Pyx_CyFunction_traverse,   /*tp_traverse*/
    (inquiry) __Pyx_CyFunction_clear,   /*tp_clear*/
    0,                                  /*tp_richcompare*/
    offsetof(__pyx_CyFunctionObject, func_weakreflist), /* tp_weaklistoffse */
    0,                                  /*tp_iter*/
    0,                                  /*tp_iternext*/
    __pyx_CyFunction_methods,           /*tp_methods*/
    __pyx_CyFunction_members,           /*tp_members*/
    __pyx_CyFunction_getsets,           /*tp_getset*/
    0,                                  /*tp_base*/
    0,                                  /*tp_dict*/
    __Pyx_CyFunction_descr_get,         /*tp_descr_get*/
    0,                                  /*tp_descr_set*/
    offsetof(__pyx_CyFunctionObject, func_dict),/*tp_dictoffset*/
    0,                                  /*tp_init*/
    0,                                  /*tp_alloc*/
    0,                                  /*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
#if PY_VERSION_HEX >= 0x030400a1
    0,                                  /*tp_finalize*/
#endif
};
static int __Pyx_CyFunction_init(void) {
#if !CYTHON_COMPILING_IN_PYPY
    __pyx_CyFunctionType_type.tp_call = PyCFunction_Call;
#endif
    __pyx_CyFunctionType = __Pyx_FetchCommonType(&__pyx_CyFunctionType_type);
    if (__pyx_CyFunctionType == NULL) {
        return -1;
    }
    return 0;
}
static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *func, size_t size, int pyobjects) {
    __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
    m->defaults = PyMem_Malloc(size);
    if (!m->defaults)
        return PyErr_NoMemory();
    memset(m->defaults, 0, size);
    m->defaults_pyobjects = pyobjects;
    return m->defaults;
}
static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *func, PyObject *tuple) {
    __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
    m->defaults_tuple = tuple;
    Py_INCREF(tuple);
}
static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *func, PyObject *dict) {
    __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
    m->defaults_kwdict = dict;
    Py_INCREF(dict);
}
static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *func, PyObject *dict) {
    __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
    m->func_annotations = dict;
    Py_INCREF(dict);
}

static PyObject *__Pyx_CalculateMetaclass(PyTypeObject *metaclass, PyObject *bases) {
    Py_ssize_t i, nbases = PyTuple_GET_SIZE(bases);
    for (i=0; i < nbases; i++) {
        PyTypeObject *tmptype;
        PyObject *tmp = PyTuple_GET_ITEM(bases, i);
        tmptype = Py_TYPE(tmp);
#if PY_MAJOR_VERSION < 3
        if (tmptype == &PyClass_Type)
            continue;
#endif
        if (!metaclass) {
            metaclass = tmptype;
            continue;
        }
        if (PyType_IsSubtype(metaclass, tmptype))
            continue;
        if (PyType_IsSubtype(tmptype, metaclass)) {
            metaclass = tmptype;
            continue;
        }
        PyErr_SetString(PyExc_TypeError,
                        "metaclass conflict: "
                        "the metaclass of a derived class "
                        "must be a (non-strict) subclass "
                        "of the metaclasses of all its bases");
        return NULL;
    }
    if (!metaclass) {
#if PY_MAJOR_VERSION < 3
        metaclass = &PyClass_Type;
#else
        metaclass = &PyType_Type;
#endif
    }
    Py_INCREF((PyObject*) metaclass);
    return (PyObject*) metaclass;
}

static PyObject *__Pyx_Py3MetaclassPrepare(PyObject *metaclass, PyObject *bases, PyObject *name,
                                           PyObject *qualname, PyObject *mkw, PyObject *modname, PyObject *doc) {
    PyObject *ns;
    if (metaclass) {
        PyObject *prep = __Pyx_PyObject_GetAttrStr(metaclass, __pyx_n_s_prepare);
        if (prep) {
            PyObject *pargs = PyTuple_Pack(2, name, bases);
            if (unlikely(!pargs)) {
                Py_DECREF(prep);
                return NULL;
            }
            ns = PyObject_Call(prep, pargs, mkw);
            Py_DECREF(prep);
            Py_DECREF(pargs);
        } else {
            if (unlikely(!PyErr_ExceptionMatches(PyExc_AttributeError)))
                return NULL;
            PyErr_Clear();
            ns = PyDict_New();
        }
    } else {
        ns = PyDict_New();
    }
    if (unlikely(!ns))
        return NULL;
    if (unlikely(PyObject_SetItem(ns, __pyx_n_s_module, modname) < 0)) goto bad;
    if (unlikely(PyObject_SetItem(ns, __pyx_n_s_qualname, qualname) < 0)) goto bad;
    if (unlikely(doc && PyObject_SetItem(ns, __pyx_n_s_doc, doc) < 0)) goto bad;
    return ns;
bad:
    Py_DECREF(ns);
    return NULL;
}
static PyObject *__Pyx_Py3ClassCreate(PyObject *metaclass, PyObject *name, PyObject *bases,
                                      PyObject *dict, PyObject *mkw,
                                      int calculate_metaclass, int allow_py2_metaclass) {
    PyObject *result, *margs;
    PyObject *owned_metaclass = NULL;
    if (allow_py2_metaclass) {
        owned_metaclass = PyObject_GetItem(dict, __pyx_n_s_metaclass);
        if (owned_metaclass) {
            metaclass = owned_metaclass;
        } else if (likely(PyErr_ExceptionMatches(PyExc_KeyError))) {
            PyErr_Clear();
        } else {
            return NULL;
        }
    }
    if (calculate_metaclass && (!metaclass || PyType_Check(metaclass))) {
        metaclass = __Pyx_CalculateMetaclass((PyTypeObject*) metaclass, bases);
        Py_XDECREF(owned_metaclass);
        if (unlikely(!metaclass))
            return NULL;
        owned_metaclass = metaclass;
    }
    margs = PyTuple_Pack(3, name, bases, dict);
    if (unlikely(!margs)) {
        result = NULL;
    } else {
        result = PyObject_Call(metaclass, margs, mkw);
        Py_DECREF(margs);
    }
    Py_XDECREF(owned_metaclass);
    return result;
}

static PyObject *
__pyx_FusedFunction_New(PyTypeObject *type, PyMethodDef *ml, int flags,
                        PyObject *qualname, PyObject *self,
                        PyObject *module, PyObject *globals,
                        PyObject *code)
{
    __pyx_FusedFunctionObject *fusedfunc =
        (__pyx_FusedFunctionObject *) __Pyx_CyFunction_New(type, ml, flags, qualname,
                                                           self, module, globals, code);
    if (!fusedfunc)
        return NULL;
    fusedfunc->__signatures__ = NULL;
    fusedfunc->type = NULL;
    fusedfunc->self = NULL;
    return (PyObject *) fusedfunc;
}
static void __pyx_FusedFunction_dealloc(__pyx_FusedFunctionObject *self) {
    __pyx_FusedFunction_clear(self);
    __pyx_FusedFunctionType->tp_free((PyObject *) self);
}
static int
__pyx_FusedFunction_traverse(__pyx_FusedFunctionObject *self,
                             visitproc visit,
                             void *arg)
{
    Py_VISIT(self->self);
    Py_VISIT(self->type);
    Py_VISIT(self->__signatures__);
    return __Pyx_CyFunction_traverse((__pyx_CyFunctionObject *) self, visit, arg);
}
static int
__pyx_FusedFunction_clear(__pyx_FusedFunctionObject *self)
{
    Py_CLEAR(self->self);
    Py_CLEAR(self->type);
    Py_CLEAR(self->__signatures__);
    return __Pyx_CyFunction_clear((__pyx_CyFunctionObject *) self);
}
static PyObject *
__pyx_FusedFunction_descr_get(PyObject *self, PyObject *obj, PyObject *type)
{
    __pyx_FusedFunctionObject *func, *meth;
    func = (__pyx_FusedFunctionObject *) self;
    if (func->self || func->func.flags & __Pyx_CYFUNCTION_STATICMETHOD) {
        Py_INCREF(self);
        return self;
    }
    if (obj == Py_None)
        obj = NULL;
    meth = (__pyx_FusedFunctionObject *) __pyx_FusedFunction_NewEx(
                    ((PyCFunctionObject *) func)->m_ml,
                    ((__pyx_CyFunctionObject *) func)->flags,
                    ((__pyx_CyFunctionObject *) func)->func_qualname,
                    ((__pyx_CyFunctionObject *) func)->func_closure,
                    ((PyCFunctionObject *) func)->m_module,
                    ((__pyx_CyFunctionObject *) func)->func_globals,
                    ((__pyx_CyFunctionObject *) func)->func_code);
    if (!meth)
        return NULL;
    Py_XINCREF(func->func.func_classobj);
    meth->func.func_classobj = func->func.func_classobj;
    Py_XINCREF(func->__signatures__);
    meth->__signatures__ = func->__signatures__;
    Py_XINCREF(type);
    meth->type = type;
    Py_XINCREF(func->func.defaults_tuple);
    meth->func.defaults_tuple = func->func.defaults_tuple;
    if (func->func.flags & __Pyx_CYFUNCTION_CLASSMETHOD)
        obj = type;
    Py_XINCREF(obj);
    meth->self = obj;
    return (PyObject *) meth;
}
static PyObject *
_obj_to_str(PyObject *obj)
{
    if (PyType_Check(obj))
        return PyObject_GetAttr(obj, __pyx_n_s_name_2);
    else
        return PyObject_Str(obj);
}
static PyObject *
__pyx_FusedFunction_getitem(__pyx_FusedFunctionObject *self, PyObject *idx)
{
    PyObject *signature = NULL;
    PyObject *unbound_result_func;
    PyObject *result_func = NULL;
    if (self->__signatures__ == NULL) {
        PyErr_SetString(PyExc_TypeError, "Function is not fused");
        return NULL;
    }
    if (PyTuple_Check(idx)) {
        PyObject *list = PyList_New(0);
        Py_ssize_t n = PyTuple_GET_SIZE(idx);
        PyObject *string = NULL;
        PyObject *sep = NULL;
        int i;
        if (!list)
            return NULL;
        for (i = 0; i < n; i++) {
            PyObject *item = PyTuple_GET_ITEM(idx, i);
            string = _obj_to_str(item);
            if (!string || PyList_Append(list, string) < 0)
                goto __pyx_err;
            Py_DECREF(string);
        }
        sep = PyUnicode_FromString("|");
        if (sep)
            signature = PyUnicode_Join(sep, list);
__pyx_err:
;
        Py_DECREF(list);
        Py_XDECREF(sep);
    } else {
        signature = _obj_to_str(idx);
    }
    if (!signature)
        return NULL;
    unbound_result_func = PyObject_GetItem(self->__signatures__, signature);
    if (unbound_result_func) {
        if (self->self || self->type) {
            __pyx_FusedFunctionObject *unbound = (__pyx_FusedFunctionObject *) unbound_result_func;
            Py_CLEAR(unbound->func.func_classobj);
            Py_XINCREF(self->func.func_classobj);
            unbound->func.func_classobj = self->func.func_classobj;
            result_func = __pyx_FusedFunction_descr_get(unbound_result_func,
                                                        self->self, self->type);
        } else {
            result_func = unbound_result_func;
            Py_INCREF(result_func);
        }
    }
    Py_DECREF(signature);
    Py_XDECREF(unbound_result_func);
    return result_func;
}
static PyObject *
__pyx_FusedFunction_callfunction(PyObject *func, PyObject *args, PyObject *kw)
{
     __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *) func;
    PyObject *result;
    int static_specialized = (cyfunc->flags & __Pyx_CYFUNCTION_STATICMETHOD &&
                              !((__pyx_FusedFunctionObject *) func)->__signatures__);
    if (cyfunc->flags & __Pyx_CYFUNCTION_CCLASS && !static_specialized) {
        Py_ssize_t argc;
        PyObject *new_args;
        PyObject *self;
        PyObject *m_self;
        argc = PyTuple_GET_SIZE(args);
        new_args = PyTuple_GetSlice(args, 1, argc);
        if (!new_args)
            return NULL;
        self = PyTuple_GetItem(args, 0);
        if (!self)
            return NULL;
        m_self = cyfunc->func.m_self;
        cyfunc->func.m_self = self;
        result = __Pyx_CyFunction_Call(func, new_args, kw);
        cyfunc->func.m_self = m_self;
        Py_DECREF(new_args);
    } else {
        result = __Pyx_CyFunction_Call(func, args, kw);
    }
    return result;
}
/* Note: the 'self' from method binding is passed in in the args tuple,
         whereas PyCFunctionObject's m_self is passed in as the first
         argument to the C function. For extension methods we need
         to pass 'self' as 'm_self' and not as the first element of the
         args tuple.
*/
static PyObject *
__pyx_FusedFunction_call(PyObject *func, PyObject *args, PyObject *kw)
{
    __pyx_FusedFunctionObject *binding_func = (__pyx_FusedFunctionObject *) func;
    Py_ssize_t argc = PyTuple_GET_SIZE(args);
    PyObject *new_args = NULL;
    __pyx_FusedFunctionObject *new_func = NULL;
    PyObject *result = NULL;
    PyObject *self = NULL;
    int is_staticmethod = binding_func->func.flags & __Pyx_CYFUNCTION_STATICMETHOD;
    int is_classmethod = binding_func->func.flags & __Pyx_CYFUNCTION_CLASSMETHOD;
    if (binding_func->self) {
        Py_ssize_t i;
        new_args = PyTuple_New(argc + 1);
        if (!new_args)
            return NULL;
        self = binding_func->self;
        Py_INCREF(self);
        PyTuple_SET_ITEM(new_args, 0, self);
        for (i = 0; i < argc; i++) {
            PyObject *item = PyTuple_GET_ITEM(args, i);
            Py_INCREF(item);
            PyTuple_SET_ITEM(new_args, i + 1, item);
        }
        args = new_args;
    } else if (binding_func->type) {
        if (argc < 1) {
            PyErr_SetString(PyExc_TypeError, "Need at least one argument, 0 given.");
            return NULL;
        }
        self = PyTuple_GET_ITEM(args, 0);
    }
    if (self && !is_classmethod && !is_staticmethod &&
            !PyObject_IsInstance(self, binding_func->type)) {
        PyErr_Format(PyExc_TypeError,
                     "First argument should be of type %.200s, got %.200s.",
                     ((PyTypeObject *) binding_func->type)->tp_name,
                     self->ob_type->tp_name);
        goto __pyx_err;
    }
    if (binding_func->__signatures__) {
        PyObject *tup = PyTuple_Pack(4, binding_func->__signatures__, args,
                                        kw == NULL ? Py_None : kw,
                                        binding_func->func.defaults_tuple);
        if (!tup)
            goto __pyx_err;
        new_func = (__pyx_FusedFunctionObject *) __pyx_FusedFunction_callfunction(func, tup, NULL);
        Py_DECREF(tup);
        if (!new_func)
            goto __pyx_err;
        Py_XINCREF(binding_func->func.func_classobj);
        Py_CLEAR(new_func->func.func_classobj);
        new_func->func.func_classobj = binding_func->func.func_classobj;
        func = (PyObject *) new_func;
    }
    result = __pyx_FusedFunction_callfunction(func, args, kw);
__pyx_err:
    Py_XDECREF(new_args);
    Py_XDECREF((PyObject *) new_func);
    return result;
}
static PyMemberDef __pyx_FusedFunction_members[] = {
    {(char *) "__signatures__",
     T_OBJECT,
     offsetof(__pyx_FusedFunctionObject, __signatures__),
     READONLY,
     __Pyx_DOCSTR(0)},
    {0, 0, 0, 0, 0},
};
static PyMappingMethods __pyx_FusedFunction_mapping_methods = {
    0,
    (binaryfunc) __pyx_FusedFunction_getitem,
    0,
};
static PyTypeObject __pyx_FusedFunctionType_type = {
    PyVarObject_HEAD_INIT(0, 0)
    __Pyx_NAMESTR("fused_cython_function"), /*tp_name*/
    sizeof(__pyx_FusedFunctionObject), /*tp_basicsize*/
    0,                                  /*tp_itemsize*/
    (destructor) __pyx_FusedFunction_dealloc, /*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*/
    0,                                  /*tp_as_number*/
    0,                                  /*tp_as_sequence*/
    &__pyx_FusedFunction_mapping_methods, /*tp_as_mapping*/
    0,                                  /*tp_hash*/
    (ternaryfunc) __pyx_FusedFunction_call, /*tp_call*/
    0,                                  /*tp_str*/
    0,                                  /*tp_getattro*/
    0,                                  /*tp_setattro*/
    0,                                  /*tp_as_buffer*/
    Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_BASETYPE, /* tp_flags*/
    0,                                  /*tp_doc*/
    (traverseproc) __pyx_FusedFunction_traverse,   /*tp_traverse*/
    (inquiry) __pyx_FusedFunction_clear,/*tp_clear*/
    0,                                  /*tp_richcompare*/
    0,                                  /*tp_weaklistoffset*/
    0,                                  /*tp_iter*/
    0,                                  /*tp_iternext*/
    0,                                  /*tp_methods*/
    __pyx_FusedFunction_members,        /*tp_members*/
    __pyx_CyFunction_getsets,           /*tp_getset*/
    &__pyx_CyFunctionType_type,         /*tp_base*/
    0,                                  /*tp_dict*/
    __pyx_FusedFunction_descr_get,      /*tp_descr_get*/
    0,                                  /*tp_descr_set*/
    0,                                  /*tp_dictoffset*/
    0,                                  /*tp_init*/
    0,                                  /*tp_alloc*/
    0,                                  /*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
#if PY_VERSION_HEX >= 0x030400a1
    0,                                  /*tp_finalize*/
#endif
};
static int __pyx_FusedFunction_init(void) {
    __pyx_FusedFunctionType = __Pyx_FetchCommonType(&__pyx_FusedFunctionType_type);
    if (__pyx_FusedFunctionType == NULL) {
        return -1;
    }
    return 0;
}

static int
__pyx_typeinfo_cmp(__Pyx_TypeInfo *a, __Pyx_TypeInfo *b)
{
    int i;
    if (!a || !b)
        return 0;
    if (a == b)
        return 1;
    if (a->size != b->size || a->typegroup != b->typegroup ||
            a->is_unsigned != b->is_unsigned || a->ndim != b->ndim) {
        if (a->typegroup == 'H' || b->typegroup == 'H') {
            return a->size == b->size;
        } else {
            return 0;
        }
    }
    if (a->ndim) {
        for (i = 0; i < a->ndim; i++)
            if (a->arraysize[i] != b->arraysize[i])
                return 0;
    }
    if (a->typegroup == 'S') {
        if (a->flags != b->flags)
            return 0;
        if (a->fields || b->fields) {
            if (!(a->fields && b->fields))
                return 0;
            for (i = 0; a->fields[i].type && b->fields[i].type; i++) {
                __Pyx_StructField *field_a = a->fields + i;
                __Pyx_StructField *field_b = b->fields + i;
                if (field_a->offset != field_b->offset ||
                    !__pyx_typeinfo_cmp(field_a->type, field_b->type))
                    return 0;
            }
            return !a->fields[i].type && !b->fields[i].type;
        }
    }
    return 1;
}

static int
__pyx_check_strides(Py_buffer *buf, int dim, int ndim, int spec)
{
    if (buf->shape[dim] <= 1)
        return 1;
    if (buf->strides) {
        if (spec & __Pyx_MEMVIEW_CONTIG) {
            if (spec & (__Pyx_MEMVIEW_PTR|__Pyx_MEMVIEW_FULL)) {
                if (buf->strides[dim] != sizeof(void *)) {
                    PyErr_Format(PyExc_ValueError,
                                 "Buffer is not indirectly contiguous "
                                 "in dimension %d.", dim);
                    goto fail;
                }
            } else if (buf->strides[dim] != buf->itemsize) {
                PyErr_SetString(PyExc_ValueError,
                                "Buffer and memoryview are not contiguous "
                                "in the same dimension.");
                goto fail;
            }
        }
        if (spec & __Pyx_MEMVIEW_FOLLOW) {
            Py_ssize_t stride = buf->strides[dim];
            if (stride < 0)
                stride = -stride;
            if (stride < buf->itemsize) {
                PyErr_SetString(PyExc_ValueError,
                                "Buffer and memoryview are not contiguous "
                                "in the same dimension.");
                goto fail;
            }
        }
    } else {
        if (spec & __Pyx_MEMVIEW_CONTIG && dim != ndim - 1) {
            PyErr_Format(PyExc_ValueError,
                         "C-contiguous buffer is not contiguous in "
                         "dimension %d", dim);
            goto fail;
        } else if (spec & (__Pyx_MEMVIEW_PTR)) {
            PyErr_Format(PyExc_ValueError,
                         "C-contiguous buffer is not indirect in "
                         "dimension %d", dim);
            goto fail;
        } else if (buf->suboffsets) {
            PyErr_SetString(PyExc_ValueError,
                            "Buffer exposes suboffsets but no strides");
            goto fail;
        }
    }
    return 1;
fail:
    return 0;
}
static int
__pyx_check_suboffsets(Py_buffer *buf, int dim, CYTHON_UNUSED int ndim, int spec)
{
    if (spec & __Pyx_MEMVIEW_DIRECT) {
        if (buf->suboffsets && buf->suboffsets[dim] >= 0) {
            PyErr_Format(PyExc_ValueError,
                         "Buffer not compatible with direct access "
                         "in dimension %d.", dim);
            goto fail;
        }
    }
    if (spec & __Pyx_MEMVIEW_PTR) {
        if (!buf->suboffsets || (buf->suboffsets && buf->suboffsets[dim] < 0)) {
            PyErr_Format(PyExc_ValueError,
                         "Buffer is not indirectly accessible "
                         "in dimension %d.", dim);
            goto fail;
        }
    }
    return 1;
fail:
    return 0;
}
static int
__pyx_verify_contig(Py_buffer *buf, int ndim, int c_or_f_flag)
{
    int i;
    if (c_or_f_flag & __Pyx_IS_F_CONTIG) {
        Py_ssize_t stride = 1;
        for (i = 0; i < ndim; i++) {
            if (stride * buf->itemsize != buf->strides[i] &&
                    buf->shape[i] > 1)
            {
                PyErr_SetString(PyExc_ValueError,
                    "Buffer not fortran contiguous.");
                goto fail;
            }
            stride = stride * buf->shape[i];
        }
    } else if (c_or_f_flag & __Pyx_IS_C_CONTIG) {
        Py_ssize_t stride = 1;
        for (i = ndim - 1; i >- 1; i--) {
            if (stride * buf->itemsize != buf->strides[i] &&
                    buf->shape[i] > 1) {
                PyErr_SetString(PyExc_ValueError,
                    "Buffer not C contiguous.");
                goto fail;
            }
            stride = stride * buf->shape[i];
        }
    }
    return 1;
fail:
    return 0;
}
static int __Pyx_ValidateAndInit_memviewslice(
                int *axes_specs,
                int c_or_f_flag,
                int buf_flags,
                int ndim,
                __Pyx_TypeInfo *dtype,
                __Pyx_BufFmt_StackElem stack[],
                __Pyx_memviewslice *memviewslice,
                PyObject *original_obj)
{
    struct __pyx_memoryview_obj *memview, *new_memview;
    __Pyx_RefNannyDeclarations
    Py_buffer *buf;
    int i, spec = 0, retval = -1;
    __Pyx_BufFmt_Context ctx;
    int from_memoryview = __pyx_memoryview_check(original_obj);
    __Pyx_RefNannySetupContext("ValidateAndInit_memviewslice", 0);
    if (from_memoryview && __pyx_typeinfo_cmp(dtype, ((struct __pyx_memoryview_obj *)
                                                            original_obj)->typeinfo)) {
        memview = (struct __pyx_memoryview_obj *) original_obj;
        new_memview = NULL;
    } else {
        memview = (struct __pyx_memoryview_obj *) __pyx_memoryview_new(
                                            original_obj, buf_flags, 0, dtype);
        new_memview = memview;
        if (unlikely(!memview))
            goto fail;
    }
    buf = &memview->view;
    if (buf->ndim != ndim) {
        PyErr_Format(PyExc_ValueError,
                "Buffer has wrong number of dimensions (expected %d, got %d)",
                ndim, buf->ndim);
        goto fail;
    }
    if (new_memview) {
        __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 (%" CYTHON_FORMAT_SSIZE_T "u byte%s) "
                     "does not match size of '%s' (%" CYTHON_FORMAT_SSIZE_T "u byte%s)",
                     buf->itemsize,
                     (buf->itemsize > 1) ? "s" : "",
                     dtype->name,
                     dtype->size,
                     (dtype->size > 1) ? "s" : "");
        goto fail;
    }
    for (i = 0; i < ndim; i++) {
        spec = axes_specs[i];
        if (!__pyx_check_strides(buf, i, ndim, spec))
            goto fail;
        if (!__pyx_check_suboffsets(buf, i, ndim, spec))
            goto fail;
    }
    if (buf->strides && !__pyx_verify_contig(buf, ndim, c_or_f_flag))
        goto fail;
    if (unlikely(__Pyx_init_memviewslice(memview, ndim, memviewslice,
                                         new_memview != NULL) == -1)) {
        goto fail;
    }
    retval = 0;
    goto no_fail;
fail:
    Py_XDECREF(new_memview);
    retval = -1;
no_fail:
    __Pyx_RefNannyFinishContext();
    return retval;
}

static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int8_t(PyObject *obj) {
    __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } };
    __Pyx_BufFmt_StackElem stack[1];
    int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED) };
    int retcode;
    if (obj == Py_None) {
        result.memview = (struct __pyx_memoryview_obj *) Py_None;
        return result;
    }
    retcode = __Pyx_ValidateAndInit_memviewslice(axes_specs, 0,
                                                 PyBUF_RECORDS, 1,
                                                 &__Pyx_TypeInfo_nn___pyx_t_5numpy_int8_t, stack,
                                                 &result, obj);
    if (unlikely(retcode == -1))
        goto __pyx_fail;
    return result;
__pyx_fail:
    result.memview = NULL;
    result.data = NULL;
    return result;
}

static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int16_t(PyObject *obj) {
    __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } };
    __Pyx_BufFmt_StackElem stack[1];
    int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED) };
    int retcode;
    if (obj == Py_None) {
        result.memview = (struct __pyx_memoryview_obj *) Py_None;
        return result;
    }
    retcode = __Pyx_ValidateAndInit_memviewslice(axes_specs, 0,
                                                 PyBUF_RECORDS, 1,
                                                 &__Pyx_TypeInfo_nn___pyx_t_5numpy_int16_t, stack,
                                                 &result, obj);
    if (unlikely(retcode == -1))
        goto __pyx_fail;
    return result;
__pyx_fail:
    result.memview = NULL;
    result.data = NULL;
    return result;
}

static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int32_t(PyObject *obj) {
    __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } };
    __Pyx_BufFmt_StackElem stack[1];
    int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED) };
    int retcode;
    if (obj == Py_None) {
        result.memview = (struct __pyx_memoryview_obj *) Py_None;
        return result;
    }
    retcode = __Pyx_ValidateAndInit_memviewslice(axes_specs, 0,
                                                 PyBUF_RECORDS, 1,
                                                 &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, stack,
                                                 &result, obj);
    if (unlikely(retcode == -1))
        goto __pyx_fail;
    return result;
__pyx_fail:
    result.memview = NULL;
    result.data = NULL;
    return result;
}

static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int64_t(PyObject *obj) {
    __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } };
    __Pyx_BufFmt_StackElem stack[1];
    int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED) };
    int retcode;
    if (obj == Py_None) {
        result.memview = (struct __pyx_memoryview_obj *) Py_None;
        return result;
    }
    retcode = __Pyx_ValidateAndInit_memviewslice(axes_specs, 0,
                                                 PyBUF_RECORDS, 1,
                                                 &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, stack,
                                                 &result, obj);
    if (unlikely(retcode == -1))
        goto __pyx_fail;
    return result;
__pyx_fail:
    result.memview = NULL;
    result.data = NULL;
    return result;
}

static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_uint8_t(PyObject *obj) {
    __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } };
    __Pyx_BufFmt_StackElem stack[1];
    int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED) };
    int retcode;
    if (obj == Py_None) {
        result.memview = (struct __pyx_memoryview_obj *) Py_None;
        return result;
    }
    retcode = __Pyx_ValidateAndInit_memviewslice(axes_specs, 0,
                                                 PyBUF_RECORDS, 1,
                                                 &__Pyx_TypeInfo_nn___pyx_t_5numpy_uint8_t, stack,
                                                 &result, obj);
    if (unlikely(retcode == -1))
        goto __pyx_fail;
    return result;
__pyx_fail:
    result.memview = NULL;
    result.data = NULL;
    return result;
}

static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_uint16_t(PyObject *obj) {
    __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } };
    __Pyx_BufFmt_StackElem stack[1];
    int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED) };
    int retcode;
    if (obj == Py_None) {
        result.memview = (struct __pyx_memoryview_obj *) Py_None;
        return result;
    }
    retcode = __Pyx_ValidateAndInit_memviewslice(axes_specs, 0,
                                                 PyBUF_RECORDS, 1,
                                                 &__Pyx_TypeInfo_nn___pyx_t_5numpy_uint16_t, stack,
                                                 &result, obj);
    if (unlikely(retcode == -1))
        goto __pyx_fail;
    return result;
__pyx_fail:
    result.memview = NULL;
    result.data = NULL;
    return result;
}

static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_uint32_t(PyObject *obj) {
    __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } };
    __Pyx_BufFmt_StackElem stack[1];
    int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED) };
    int retcode;
    if (obj == Py_None) {
        result.memview = (struct __pyx_memoryview_obj *) Py_None;
        return result;
    }
    retcode = __Pyx_ValidateAndInit_memviewslice(axes_specs, 0,
                                                 PyBUF_RECORDS, 1,
                                                 &__Pyx_TypeInfo_nn___pyx_t_5numpy_uint32_t, stack,
                                                 &result, obj);
    if (unlikely(retcode == -1))
        goto __pyx_fail;
    return result;
__pyx_fail:
    result.memview = NULL;
    result.data = NULL;
    return result;
}

static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_uint64_t(PyObject *obj) {
    __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } };
    __Pyx_BufFmt_StackElem stack[1];
    int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED) };
    int retcode;
    if (obj == Py_None) {
        result.memview = (struct __pyx_memoryview_obj *) Py_None;
        return result;
    }
    retcode = __Pyx_ValidateAndInit_memviewslice(axes_specs, 0,
                                                 PyBUF_RECORDS, 1,
                                                 &__Pyx_TypeInfo_nn___pyx_t_5numpy_uint64_t, stack,
                                                 &result, obj);
    if (unlikely(retcode == -1))
        goto __pyx_fail;
    return result;
__pyx_fail:
    result.memview = NULL;
    result.data = NULL;
    return result;
}

static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float32_t(PyObject *obj) {
    __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } };
    __Pyx_BufFmt_StackElem stack[1];
    int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED) };
    int retcode;
    if (obj == Py_None) {
        result.memview = (struct __pyx_memoryview_obj *) Py_None;
        return result;
    }
    retcode = __Pyx_ValidateAndInit_memviewslice(axes_specs, 0,
                                                 PyBUF_RECORDS, 1,
                                                 &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, stack,
                                                 &result, obj);
    if (unlikely(retcode == -1))
        goto __pyx_fail;
    return result;
__pyx_fail:
    result.memview = NULL;
    result.data = NULL;
    return result;
}

static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float64_t(PyObject *obj) {
    __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } };
    __Pyx_BufFmt_StackElem stack[1];
    int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED) };
    int retcode;
    if (obj == Py_None) {
        result.memview = (struct __pyx_memoryview_obj *) Py_None;
        return result;
    }
    retcode = __Pyx_ValidateAndInit_memviewslice(axes_specs, 0,
                                                 PyBUF_RECORDS, 1,
                                                 &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, stack,
                                                 &result, obj);
    if (unlikely(retcode == -1))
        goto __pyx_fail;
    return result;
__pyx_fail:
    result.memview = NULL;
    result.data = NULL;
    return result;
}

static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) {
    PyObject *empty_list = 0;
    PyObject *module = 0;
    PyObject *global_dict = 0;
    PyObject *empty_dict = 0;
    PyObject *list;
    #if PY_VERSION_HEX < 0x03030000
    PyObject *py_import;
    py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import);
    if (!py_import)
        goto bad;
    #endif
    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
    {
        #if PY_MAJOR_VERSION >= 3
        if (level == -1) {
            if (strchr(__Pyx_MODULE_NAME, '.')) {
                #if PY_VERSION_HEX < 0x03030000
                PyObject *py_level = PyInt_FromLong(1);
                if (!py_level)
                    goto bad;
                module = PyObject_CallFunctionObjArgs(py_import,
                    name, global_dict, empty_dict, list, py_level, NULL);
                Py_DECREF(py_level);
                #else
                module = PyImport_ImportModuleLevelObject(
                    name, global_dict, empty_dict, list, 1);
                #endif
                if (!module) {
                    if (!PyErr_ExceptionMatches(PyExc_ImportError))
                        goto bad;
                    PyErr_Clear();
                }
            }
            level = 0; /* try absolute import on failure */
        }
        #endif
        if (!module) {
            #if PY_VERSION_HEX < 0x03030000
            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
            module = PyImport_ImportModuleLevelObject(
                name, global_dict, empty_dict, list, level);
            #endif
        }
    }
    #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:
    #if PY_VERSION_HEX < 0x03030000
    Py_XDECREF(py_import);
    #endif
    Py_XDECREF(empty_list);
    Py_XDECREF(empty_dict);
    return module;
}

#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_pw_5numpy_7ndarray_1__getbuffer__(obj, view, flags);
        if (PyObject_TypeCheck(obj, __pyx_array_type)) return __pyx_array_getbuffer(obj, view, flags);
        if (PyObject_TypeCheck(obj, __pyx_memoryview_type)) return __pyx_memoryview_getbuffer(obj, view, flags);
  #if PY_VERSION_HEX < 0x02060000
    if (obj->ob_type->tp_dict) {
        PyObject *getbuffer_cobj = PyObject_GetItem(
            obj->ob_type->tp_dict, __pyx_n_s_pyx_getbuffer);
        if (getbuffer_cobj) {
            getbufferproc func = (getbufferproc) PyCObject_AsVoidPtr(getbuffer_cobj);
            Py_DECREF(getbuffer_cobj);
            if (!func)
                goto fail;
            return func(obj, view, flags);
        } else {
            PyErr_Clear();
        }
    }
  #endif
    PyErr_Format(PyExc_TypeError, "'%.200s' does not have the buffer interface", Py_TYPE(obj)->tp_name);
#if PY_VERSION_HEX < 0x02060000
fail:
#endif
    return -1;
}
static void __Pyx_ReleaseBuffer(Py_buffer *view) {
    PyObject *obj = view->obj;
    if (!obj) return;
  #if PY_VERSION_HEX >= 0x02060000
    if (PyObject_CheckBuffer(obj)) {
        PyBuffer_Release(view);
        return;
    }
  #endif
        if (PyObject_TypeCheck(obj, __pyx_ptype_5numpy_ndarray)) { __pyx_pw_5numpy_7ndarray_3__releasebuffer__(obj, view); return; }
  #if PY_VERSION_HEX < 0x02060000
    if (obj->ob_type->tp_dict) {
        PyObject *releasebuffer_cobj = PyObject_GetItem(
            obj->ob_type->tp_dict, __pyx_n_s_pyx_releasebuffer);
        if (releasebuffer_cobj) {
            releasebufferproc func = (releasebufferproc) PyCObject_AsVoidPtr(releasebuffer_cobj);
            Py_DECREF(releasebuffer_cobj);
            if (!func)
                goto fail;
            func(obj, view);
            return;
        } else {
            PyErr_Clear();
        }
    }
  #endif
    goto nofail;
#if PY_VERSION_HEX < 0x02060000
fail:
#endif
    PyErr_WriteUnraisable(obj);
nofail:
    Py_DECREF(obj);
    view->obj = NULL;
}
#endif /*  PY_MAJOR_VERSION < 3 */


              #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func)             \
    {                                                                     \
        func_type value = func(x);                                        \
        if (sizeof(target_type) < sizeof(func_type)) {                    \
            if (unlikely(value != (func_type) (target_type) value)) {     \
                func_type zero = 0;                                       \
                PyErr_SetString(PyExc_OverflowError,                      \
                    (is_unsigned && unlikely(value < zero)) ?             \
                    "can't convert negative value to " #target_type :     \
                    "value too large to convert to " #target_type);       \
                return (target_type) -1;                                  \
            }                                                             \
        }                                                                 \
        return (target_type) value;                                       \
    }

#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
 #if CYTHON_USE_PYLONG_INTERNALS
  #include "longintrepr.h"
 #endif
#endif
static CYTHON_INLINE npy_int8 __Pyx_PyInt_As_npy_int8(PyObject *x) {
    const npy_int8 neg_one = (npy_int8) -1, const_zero = 0;
    const int is_unsigned = neg_one > const_zero;
#if PY_MAJOR_VERSION < 3
    if (likely(PyInt_Check(x))) {
        if (sizeof(npy_int8) < sizeof(long)) {
            __PYX_VERIFY_RETURN_INT(npy_int8, long, PyInt_AS_LONG)
        } else {
            long val = PyInt_AS_LONG(x);
            if (is_unsigned && unlikely(val < 0)) {
                PyErr_SetString(PyExc_OverflowError,
                                "can't convert negative value to npy_int8");
                return (npy_int8) -1;
            }
            return (npy_int8) val;
        }
    } else
#endif
    if (likely(PyLong_Check(x))) {
        if (is_unsigned) {
#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
 #if CYTHON_USE_PYLONG_INTERNALS
            if (sizeof(digit) <= sizeof(npy_int8)) {
                switch (Py_SIZE(x)) {
                    case  0: return 0;
                    case  1: return (npy_int8) ((PyLongObject*)x)->ob_digit[0];
                }
            }
 #endif
#endif
            if (unlikely(Py_SIZE(x) < 0)) {
                PyErr_SetString(PyExc_OverflowError,
                                "can't convert negative value to npy_int8");
                return (npy_int8) -1;
            }
            if (sizeof(npy_int8) <= sizeof(unsigned long)) {
                __PYX_VERIFY_RETURN_INT(npy_int8, unsigned long, PyLong_AsUnsignedLong)
            } else if (sizeof(npy_int8) <= sizeof(unsigned long long)) {
                __PYX_VERIFY_RETURN_INT(npy_int8, unsigned long long, PyLong_AsUnsignedLongLong)
            }
        } else {
#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
 #if CYTHON_USE_PYLONG_INTERNALS
            if (sizeof(digit) <= sizeof(npy_int8)) {
                switch (Py_SIZE(x)) {
                    case  0: return 0;
                    case  1: return +(npy_int8) ((PyLongObject*)x)->ob_digit[0];
                    case -1: return -(npy_int8) ((PyLongObject*)x)->ob_digit[0];
                }
            }
 #endif
#endif
            if (sizeof(npy_int8) <= sizeof(long)) {
                __PYX_VERIFY_RETURN_INT(npy_int8, long, PyLong_AsLong)
            } else if (sizeof(npy_int8) <= sizeof(long long)) {
                __PYX_VERIFY_RETURN_INT(npy_int8, long long, PyLong_AsLongLong)
            }
        }
        {
#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
            PyErr_SetString(PyExc_RuntimeError,
                            "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
#else
            npy_int8 val;
            PyObject *v = __Pyx_PyNumber_Int(x);
 #if PY_MAJOR_VERSION < 3
            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;
            }
#endif
            return (npy_int8) -1;
        }
    } else {
        npy_int8 val;
        PyObject *tmp = __Pyx_PyNumber_Int(x);
        if (!tmp) return (npy_int8) -1;
        val = __Pyx_PyInt_As_npy_int8(tmp);
        Py_DECREF(tmp);
        return val;
    }
}

#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
 #if CYTHON_USE_PYLONG_INTERNALS
  #include "longintrepr.h"
 #endif
#endif
static CYTHON_INLINE npy_int16 __Pyx_PyInt_As_npy_int16(PyObject *x) {
    const npy_int16 neg_one = (npy_int16) -1, const_zero = 0;
    const int is_unsigned = neg_one > const_zero;
#if PY_MAJOR_VERSION < 3
    if (likely(PyInt_Check(x))) {
        if (sizeof(npy_int16) < sizeof(long)) {
            __PYX_VERIFY_RETURN_INT(npy_int16, long, PyInt_AS_LONG)
        } else {
            long val = PyInt_AS_LONG(x);
            if (is_unsigned && unlikely(val < 0)) {
                PyErr_SetString(PyExc_OverflowError,
                                "can't convert negative value to npy_int16");
                return (npy_int16) -1;
            }
            return (npy_int16) val;
        }
    } else
#endif
    if (likely(PyLong_Check(x))) {
        if (is_unsigned) {
#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
 #if CYTHON_USE_PYLONG_INTERNALS
            if (sizeof(digit) <= sizeof(npy_int16)) {
                switch (Py_SIZE(x)) {
                    case  0: return 0;
                    case  1: return (npy_int16) ((PyLongObject*)x)->ob_digit[0];
                }
            }
 #endif
#endif
            if (unlikely(Py_SIZE(x) < 0)) {
                PyErr_SetString(PyExc_OverflowError,
                                "can't convert negative value to npy_int16");
                return (npy_int16) -1;
            }
            if (sizeof(npy_int16) <= sizeof(unsigned long)) {
                __PYX_VERIFY_RETURN_INT(npy_int16, unsigned long, PyLong_AsUnsignedLong)
            } else if (sizeof(npy_int16) <= sizeof(unsigned long long)) {
                __PYX_VERIFY_RETURN_INT(npy_int16, unsigned long long, PyLong_AsUnsignedLongLong)
            }
        } else {
#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
 #if CYTHON_USE_PYLONG_INTERNALS
            if (sizeof(digit) <= sizeof(npy_int16)) {
                switch (Py_SIZE(x)) {
                    case  0: return 0;
                    case  1: return +(npy_int16) ((PyLongObject*)x)->ob_digit[0];
                    case -1: return -(npy_int16) ((PyLongObject*)x)->ob_digit[0];
                }
            }
 #endif
#endif
            if (sizeof(npy_int16) <= sizeof(long)) {
                __PYX_VERIFY_RETURN_INT(npy_int16, long, PyLong_AsLong)
            } else if (sizeof(npy_int16) <= sizeof(long long)) {
                __PYX_VERIFY_RETURN_INT(npy_int16, long long, PyLong_AsLongLong)
            }
        }
        {
#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
            PyErr_SetString(PyExc_RuntimeError,
                            "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
#else
            npy_int16 val;
            PyObject *v = __Pyx_PyNumber_Int(x);
 #if PY_MAJOR_VERSION < 3
            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;
            }
#endif
            return (npy_int16) -1;
        }
    } else {
        npy_int16 val;
        PyObject *tmp = __Pyx_PyNumber_Int(x);
        if (!tmp) return (npy_int16) -1;
        val = __Pyx_PyInt_As_npy_int16(tmp);
        Py_DECREF(tmp);
        return val;
    }
}

#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
 #if CYTHON_USE_PYLONG_INTERNALS
  #include "longintrepr.h"
 #endif
#endif
static CYTHON_INLINE npy_int32 __Pyx_PyInt_As_npy_int32(PyObject *x) {
    const npy_int32 neg_one = (npy_int32) -1, const_zero = 0;
    const int is_unsigned = neg_one > const_zero;
#if PY_MAJOR_VERSION < 3
    if (likely(PyInt_Check(x))) {
        if (sizeof(npy_int32) < sizeof(long)) {
            __PYX_VERIFY_RETURN_INT(npy_int32, long, PyInt_AS_LONG)
        } else {
            long val = PyInt_AS_LONG(x);
            if (is_unsigned && unlikely(val < 0)) {
                PyErr_SetString(PyExc_OverflowError,
                                "can't convert negative value to npy_int32");
                return (npy_int32) -1;
            }
            return (npy_int32) val;
        }
    } else
#endif
    if (likely(PyLong_Check(x))) {
        if (is_unsigned) {
#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
 #if CYTHON_USE_PYLONG_INTERNALS
            if (sizeof(digit) <= sizeof(npy_int32)) {
                switch (Py_SIZE(x)) {
                    case  0: return 0;
                    case  1: return (npy_int32) ((PyLongObject*)x)->ob_digit[0];
                }
            }
 #endif
#endif
            if (unlikely(Py_SIZE(x) < 0)) {
                PyErr_SetString(PyExc_OverflowError,
                                "can't convert negative value to npy_int32");
                return (npy_int32) -1;
            }
            if (sizeof(npy_int32) <= sizeof(unsigned long)) {
                __PYX_VERIFY_RETURN_INT(npy_int32, unsigned long, PyLong_AsUnsignedLong)
            } else if (sizeof(npy_int32) <= sizeof(unsigned long long)) {
                __PYX_VERIFY_RETURN_INT(npy_int32, unsigned long long, PyLong_AsUnsignedLongLong)
            }
        } else {
#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
 #if CYTHON_USE_PYLONG_INTERNALS
            if (sizeof(digit) <= sizeof(npy_int32)) {
                switch (Py_SIZE(x)) {
                    case  0: return 0;
                    case  1: return +(npy_int32) ((PyLongObject*)x)->ob_digit[0];
                    case -1: return -(npy_int32) ((PyLongObject*)x)->ob_digit[0];
                }
            }
 #endif
#endif
            if (sizeof(npy_int32) <= sizeof(long)) {
                __PYX_VERIFY_RETURN_INT(npy_int32, long, PyLong_AsLong)
            } else if (sizeof(npy_int32) <= sizeof(long long)) {
                __PYX_VERIFY_RETURN_INT(npy_int32, long long, PyLong_AsLongLong)
            }
        }
        {
#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
            PyErr_SetString(PyExc_RuntimeError,
                            "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
#else
            npy_int32 val;
            PyObject *v = __Pyx_PyNumber_Int(x);
 #if PY_MAJOR_VERSION < 3
            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;
            }
#endif
            return (npy_int32) -1;
        }
    } else {
        npy_int32 val;
        PyObject *tmp = __Pyx_PyNumber_Int(x);
        if (!tmp) return (npy_int32) -1;
        val = __Pyx_PyInt_As_npy_int32(tmp);
        Py_DECREF(tmp);
        return val;
    }
}

#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
 #if CYTHON_USE_PYLONG_INTERNALS
  #include "longintrepr.h"
 #endif
#endif
static CYTHON_INLINE npy_int64 __Pyx_PyInt_As_npy_int64(PyObject *x) {
    const npy_int64 neg_one = (npy_int64) -1, const_zero = 0;
    const int is_unsigned = neg_one > const_zero;
#if PY_MAJOR_VERSION < 3
    if (likely(PyInt_Check(x))) {
        if (sizeof(npy_int64) < sizeof(long)) {
            __PYX_VERIFY_RETURN_INT(npy_int64, long, PyInt_AS_LONG)
        } else {
            long val = PyInt_AS_LONG(x);
            if (is_unsigned && unlikely(val < 0)) {
                PyErr_SetString(PyExc_OverflowError,
                                "can't convert negative value to npy_int64");
                return (npy_int64) -1;
            }
            return (npy_int64) val;
        }
    } else
#endif
    if (likely(PyLong_Check(x))) {
        if (is_unsigned) {
#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
 #if CYTHON_USE_PYLONG_INTERNALS
            if (sizeof(digit) <= sizeof(npy_int64)) {
                switch (Py_SIZE(x)) {
                    case  0: return 0;
                    case  1: return (npy_int64) ((PyLongObject*)x)->ob_digit[0];
                }
            }
 #endif
#endif
            if (unlikely(Py_SIZE(x) < 0)) {
                PyErr_SetString(PyExc_OverflowError,
                                "can't convert negative value to npy_int64");
                return (npy_int64) -1;
            }
            if (sizeof(npy_int64) <= sizeof(unsigned long)) {
                __PYX_VERIFY_RETURN_INT(npy_int64, unsigned long, PyLong_AsUnsignedLong)
            } else if (sizeof(npy_int64) <= sizeof(unsigned long long)) {
                __PYX_VERIFY_RETURN_INT(npy_int64, unsigned long long, PyLong_AsUnsignedLongLong)
            }
        } else {
#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
 #if CYTHON_USE_PYLONG_INTERNALS
            if (sizeof(digit) <= sizeof(npy_int64)) {
                switch (Py_SIZE(x)) {
                    case  0: return 0;
                    case  1: return +(npy_int64) ((PyLongObject*)x)->ob_digit[0];
                    case -1: return -(npy_int64) ((PyLongObject*)x)->ob_digit[0];
                }
            }
 #endif
#endif
            if (sizeof(npy_int64) <= sizeof(long)) {
                __PYX_VERIFY_RETURN_INT(npy_int64, long, PyLong_AsLong)
            } else if (sizeof(npy_int64) <= sizeof(long long)) {
                __PYX_VERIFY_RETURN_INT(npy_int64, long long, PyLong_AsLongLong)
            }
        }
        {
#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
            PyErr_SetString(PyExc_RuntimeError,
                            "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
#else
            npy_int64 val;
            PyObject *v = __Pyx_PyNumber_Int(x);
 #if PY_MAJOR_VERSION < 3
            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;
            }
#endif
            return (npy_int64) -1;
        }
    } else {
        npy_int64 val;
        PyObject *tmp = __Pyx_PyNumber_Int(x);
        if (!tmp) return (npy_int64) -1;
        val = __Pyx_PyInt_As_npy_int64(tmp);
        Py_DECREF(tmp);
        return val;
    }
}

static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) {
    const int neg_one = (int) -1, const_zero = 0;
    const int is_unsigned = neg_one > const_zero;
    if (is_unsigned) {
        if (sizeof(int) < sizeof(long)) {
            return PyInt_FromLong((long) value);
        } else if (sizeof(int) <= sizeof(unsigned long)) {
            return PyLong_FromUnsignedLong((unsigned long) value);
        } else if (sizeof(int) <= sizeof(unsigned long long)) {
            return PyLong_FromUnsignedLongLong((unsigned long long) value);
        }
    } else {
        if (sizeof(int) <= sizeof(long)) {
            return PyInt_FromLong((long) value);
        } else if (sizeof(int) <= sizeof(long long)) {
            return PyLong_FromLongLong((long long) value);
        }
    }
    {
        int one = 1; int little = (int)*(unsigned char *)&one;
        unsigned char *bytes = (unsigned char *)&value;
        return _PyLong_FromByteArray(bytes, sizeof(int),
                                     little, !is_unsigned);
    }
}

#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
 #if CYTHON_USE_PYLONG_INTERNALS
  #include "longintrepr.h"
 #endif
#endif
static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) {
    const int neg_one = (int) -1, const_zero = 0;
    const int is_unsigned = neg_one > const_zero;
#if PY_MAJOR_VERSION < 3
    if (likely(PyInt_Check(x))) {
        if (sizeof(int) < sizeof(long)) {
            __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG)
        } else {
            long val = PyInt_AS_LONG(x);
            if (is_unsigned && unlikely(val < 0)) {
                PyErr_SetString(PyExc_OverflowError,
                                "can't convert negative value to int");
                return (int) -1;
            }
            return (int) val;
        }
    } else
#endif
    if (likely(PyLong_Check(x))) {
        if (is_unsigned) {
#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
 #if CYTHON_USE_PYLONG_INTERNALS
            if (sizeof(digit) <= sizeof(int)) {
                switch (Py_SIZE(x)) {
                    case  0: return 0;
                    case  1: return (int) ((PyLongObject*)x)->ob_digit[0];
                }
            }
 #endif
#endif
            if (unlikely(Py_SIZE(x) < 0)) {
                PyErr_SetString(PyExc_OverflowError,
                                "can't convert negative value to int");
                return (int) -1;
            }
            if (sizeof(int) <= sizeof(unsigned long)) {
                __PYX_VERIFY_RETURN_INT(int, unsigned long, PyLong_AsUnsignedLong)
            } else if (sizeof(int) <= sizeof(unsigned long long)) {
                __PYX_VERIFY_RETURN_INT(int, unsigned long long, PyLong_AsUnsignedLongLong)
            }
        } else {
#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
 #if CYTHON_USE_PYLONG_INTERNALS
            if (sizeof(digit) <= sizeof(int)) {
                switch (Py_SIZE(x)) {
                    case  0: return 0;
                    case  1: return +(int) ((PyLongObject*)x)->ob_digit[0];
                    case -1: return -(int) ((PyLongObject*)x)->ob_digit[0];
                }
            }
 #endif
#endif
            if (sizeof(int) <= sizeof(long)) {
                __PYX_VERIFY_RETURN_INT(int, long, PyLong_AsLong)
            } else if (sizeof(int) <= sizeof(long long)) {
                __PYX_VERIFY_RETURN_INT(int, long long, PyLong_AsLongLong)
            }
        }
        {
#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
            PyErr_SetString(PyExc_RuntimeError,
                            "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
#else
            int val;
            PyObject *v = __Pyx_PyNumber_Int(x);
 #if PY_MAJOR_VERSION < 3
            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;
            }
#endif
            return (int) -1;
        }
    } else {
        int val;
        PyObject *tmp = __Pyx_PyNumber_Int(x);
        if (!tmp) return (int) -1;
        val = __Pyx_PyInt_As_int(tmp);
        Py_DECREF(tmp);
        return val;
    }
}

static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_uint8_t(PyObject *obj) {
    __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } };
    __Pyx_BufFmt_StackElem stack[1];
    int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED), (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED) };
    int retcode;
    if (obj == Py_None) {
        result.memview = (struct __pyx_memoryview_obj *) Py_None;
        return result;
    }
    retcode = __Pyx_ValidateAndInit_memviewslice(axes_specs, 0,
                                                 PyBUF_RECORDS, 2,
                                                 &__Pyx_TypeInfo_nn___pyx_t_5numpy_uint8_t, stack,
                                                 &result, obj);
    if (unlikely(retcode == -1))
        goto __pyx_fail;
    return result;
__pyx_fail:
    result.memview = NULL;
    result.data = NULL;
    return result;
}

static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_dsds_object(PyObject *obj) {
    __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } };
    __Pyx_BufFmt_StackElem stack[1];
    int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED), (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED) };
    int retcode;
    if (obj == Py_None) {
        result.memview = (struct __pyx_memoryview_obj *) Py_None;
        return result;
    }
    retcode = __Pyx_ValidateAndInit_memviewslice(axes_specs, 0,
                                                 PyBUF_RECORDS, 2,
                                                 &__Pyx_TypeInfo_object, stack,
                                                 &result, obj);
    if (unlikely(retcode == -1))
        goto __pyx_fail;
    return result;
__pyx_fail:
    result.memview = NULL;
    result.data = NULL;
    return result;
}

static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_int8_t(PyObject *obj) {
    __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } };
    __Pyx_BufFmt_StackElem stack[1];
    int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED), (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED) };
    int retcode;
    if (obj == Py_None) {
        result.memview = (struct __pyx_memoryview_obj *) Py_None;
        return result;
    }
    retcode = __Pyx_ValidateAndInit_memviewslice(axes_specs, 0,
                                                 PyBUF_RECORDS, 2,
                                                 &__Pyx_TypeInfo_nn___pyx_t_5numpy_int8_t, stack,
                                                 &result, obj);
    if (unlikely(retcode == -1))
        goto __pyx_fail;
    return result;
__pyx_fail:
    result.memview = NULL;
    result.data = NULL;
    return result;
}

static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_int32_t(PyObject *obj) {
    __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } };
    __Pyx_BufFmt_StackElem stack[1];
    int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED), (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED) };
    int retcode;
    if (obj == Py_None) {
        result.memview = (struct __pyx_memoryview_obj *) Py_None;
        return result;
    }
    retcode = __Pyx_ValidateAndInit_memviewslice(axes_specs, 0,
                                                 PyBUF_RECORDS, 2,
                                                 &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, stack,
                                                 &result, obj);
    if (unlikely(retcode == -1))
        goto __pyx_fail;
    return result;
__pyx_fail:
    result.memview = NULL;
    result.data = NULL;
    return result;
}

static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_int64_t(PyObject *obj) {
    __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } };
    __Pyx_BufFmt_StackElem stack[1];
    int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED), (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED) };
    int retcode;
    if (obj == Py_None) {
        result.memview = (struct __pyx_memoryview_obj *) Py_None;
        return result;
    }
    retcode = __Pyx_ValidateAndInit_memviewslice(axes_specs, 0,
                                                 PyBUF_RECORDS, 2,
                                                 &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, stack,
                                                 &result, obj);
    if (unlikely(retcode == -1))
        goto __pyx_fail;
    return result;
__pyx_fail:
    result.memview = NULL;
    result.data = NULL;
    return result;
}

static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_float64_t(PyObject *obj) {
    __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } };
    __Pyx_BufFmt_StackElem stack[1];
    int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED), (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED) };
    int retcode;
    if (obj == Py_None) {
        result.memview = (struct __pyx_memoryview_obj *) Py_None;
        return result;
    }
    retcode = __Pyx_ValidateAndInit_memviewslice(axes_specs, 0,
                                                 PyBUF_RECORDS, 2,
                                                 &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, stack,
                                                 &result, obj);
    if (unlikely(retcode == -1))
        goto __pyx_fail;
    return result;
__pyx_fail:
    result.memview = NULL;
    result.data = NULL;
    return result;
}

static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_int16_t(PyObject *obj) {
    __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } };
    __Pyx_BufFmt_StackElem stack[1];
    int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED), (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED) };
    int retcode;
    if (obj == Py_None) {
        result.memview = (struct __pyx_memoryview_obj *) Py_None;
        return result;
    }
    retcode = __Pyx_ValidateAndInit_memviewslice(axes_specs, 0,
                                                 PyBUF_RECORDS, 2,
                                                 &__Pyx_TypeInfo_nn___pyx_t_5numpy_int16_t, stack,
                                                 &result, obj);
    if (unlikely(retcode == -1))
        goto __pyx_fail;
    return result;
__pyx_fail:
    result.memview = NULL;
    result.data = NULL;
    return result;
}

static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_float32_t(PyObject *obj) {
    __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } };
    __Pyx_BufFmt_StackElem stack[1];
    int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED), (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED) };
    int retcode;
    if (obj == Py_None) {
        result.memview = (struct __pyx_memoryview_obj *) Py_None;
        return result;
    }
    retcode = __Pyx_ValidateAndInit_memviewslice(axes_specs, 0,
                                                 PyBUF_RECORDS, 2,
                                                 &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, stack,
                                                 &result, obj);
    if (unlikely(retcode == -1))
        goto __pyx_fail;
    return result;
__pyx_fail:
    result.memview = NULL;
    result.data = NULL;
    return result;
}

static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) {
    const long neg_one = (long) -1, const_zero = 0;
    const int is_unsigned = neg_one > const_zero;
    if (is_unsigned) {
        if (sizeof(long) < sizeof(long)) {
            return PyInt_FromLong((long) value);
        } else if (sizeof(long) <= sizeof(unsigned long)) {
            return PyLong_FromUnsignedLong((unsigned long) value);
        } else if (sizeof(long) <= sizeof(unsigned long long)) {
            return PyLong_FromUnsignedLongLong((unsigned long long) value);
        }
    } else {
        if (sizeof(long) <= sizeof(long)) {
            return PyInt_FromLong((long) value);
        } else if (sizeof(long) <= sizeof(long long)) {
            return PyLong_FromLongLong((long long) value);
        }
    }
    {
        int one = 1; int little = (int)*(unsigned char *)&one;
        unsigned char *bytes = (unsigned char *)&value;
        return _PyLong_FromByteArray(bytes, sizeof(long),
                                     little, !is_unsigned);
    }
}

#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
 #if CYTHON_USE_PYLONG_INTERNALS
  #include "longintrepr.h"
 #endif
#endif
static CYTHON_INLINE char __Pyx_PyInt_As_char(PyObject *x) {
    const char neg_one = (char) -1, const_zero = 0;
    const int is_unsigned = neg_one > const_zero;
#if PY_MAJOR_VERSION < 3
    if (likely(PyInt_Check(x))) {
        if (sizeof(char) < sizeof(long)) {
            __PYX_VERIFY_RETURN_INT(char, long, PyInt_AS_LONG)
        } else {
            long val = PyInt_AS_LONG(x);
            if (is_unsigned && unlikely(val < 0)) {
                PyErr_SetString(PyExc_OverflowError,
                                "can't convert negative value to char");
                return (char) -1;
            }
            return (char) val;
        }
    } else
#endif
    if (likely(PyLong_Check(x))) {
        if (is_unsigned) {
#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
 #if CYTHON_USE_PYLONG_INTERNALS
            if (sizeof(digit) <= sizeof(char)) {
                switch (Py_SIZE(x)) {
                    case  0: return 0;
                    case  1: return (char) ((PyLongObject*)x)->ob_digit[0];
                }
            }
 #endif
#endif
            if (unlikely(Py_SIZE(x) < 0)) {
                PyErr_SetString(PyExc_OverflowError,
                                "can't convert negative value to char");
                return (char) -1;
            }
            if (sizeof(char) <= sizeof(unsigned long)) {
                __PYX_VERIFY_RETURN_INT(char, unsigned long, PyLong_AsUnsignedLong)
            } else if (sizeof(char) <= sizeof(unsigned long long)) {
                __PYX_VERIFY_RETURN_INT(char, unsigned long long, PyLong_AsUnsignedLongLong)
            }
        } else {
#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
 #if CYTHON_USE_PYLONG_INTERNALS
            if (sizeof(digit) <= sizeof(char)) {
                switch (Py_SIZE(x)) {
                    case  0: return 0;
                    case  1: return +(char) ((PyLongObject*)x)->ob_digit[0];
                    case -1: return -(char) ((PyLongObject*)x)->ob_digit[0];
                }
            }
 #endif
#endif
            if (sizeof(char) <= sizeof(long)) {
                __PYX_VERIFY_RETURN_INT(char, long, PyLong_AsLong)
            } else if (sizeof(char) <= sizeof(long long)) {
                __PYX_VERIFY_RETURN_INT(char, long long, PyLong_AsLongLong)
            }
        }
        {
#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
            PyErr_SetString(PyExc_RuntimeError,
                            "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
#else
            char val;
            PyObject *v = __Pyx_PyNumber_Int(x);
 #if PY_MAJOR_VERSION < 3
            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;
            }
#endif
            return (char) -1;
        }
    } else {
        char val;
        PyObject *tmp = __Pyx_PyNumber_Int(x);
        if (!tmp) return (char) -1;
        val = __Pyx_PyInt_As_char(tmp);
        Py_DECREF(tmp);
        return val;
    }
}

static CYTHON_INLINE PyObject* __Pyx_PyInt_From_char(char value) {
    const char neg_one = (char) -1, const_zero = 0;
    const int is_unsigned = neg_one > const_zero;
    if (is_unsigned) {
        if (sizeof(char) < sizeof(long)) {
            return PyInt_FromLong((long) value);
        } else if (sizeof(char) <= sizeof(unsigned long)) {
            return PyLong_FromUnsignedLong((unsigned long) value);
        } else if (sizeof(char) <= sizeof(unsigned long long)) {
            return PyLong_FromUnsignedLongLong((unsigned long long) value);
        }
    } else {
        if (sizeof(char) <= sizeof(long)) {
            return PyInt_FromLong((long) value);
        } else if (sizeof(char) <= sizeof(long long)) {
            return PyLong_FromLongLong((long long) value);
        }
    }
    {
        int one = 1; int little = (int)*(unsigned char *)&one;
        unsigned char *bytes = (unsigned char *)&value;
        return _PyLong_FromByteArray(bytes, sizeof(char),
                                     little, !is_unsigned);
    }
}

static CYTHON_INLINE PyObject* __Pyx_PyInt_From_npy_int8(npy_int8 value) {
    const npy_int8 neg_one = (npy_int8) -1, const_zero = 0;
    const int is_unsigned = neg_one > const_zero;
    if (is_unsigned) {
        if (sizeof(npy_int8) < sizeof(long)) {
            return PyInt_FromLong((long) value);
        } else if (sizeof(npy_int8) <= sizeof(unsigned long)) {
            return PyLong_FromUnsignedLong((unsigned long) value);
        } else if (sizeof(npy_int8) <= sizeof(unsigned long long)) {
            return PyLong_FromUnsignedLongLong((unsigned long long) value);
        }
    } else {
        if (sizeof(npy_int8) <= sizeof(long)) {
            return PyInt_FromLong((long) value);
        } else if (sizeof(npy_int8) <= sizeof(long long)) {
            return PyLong_FromLongLong((long long) value);
        }
    }
    {
        int one = 1; int little = (int)*(unsigned char *)&one;
        unsigned char *bytes = (unsigned char *)&value;
        return _PyLong_FromByteArray(bytes, sizeof(npy_int8),
                                     little, !is_unsigned);
    }
}

static PyObject *__pyx_memview_get_nn___pyx_t_5numpy_int8_t(const char *itemp) {
    return (PyObject *) __Pyx_PyInt_From_npy_int8(*(__pyx_t_5numpy_int8_t *) itemp);
}
static int __pyx_memview_set_nn___pyx_t_5numpy_int8_t(const char *itemp, PyObject *obj) {
    __pyx_t_5numpy_int8_t value = __Pyx_PyInt_As_npy_int8(obj);
    if ((value == (npy_int8)-1) && PyErr_Occurred())
        return 0;
    *(__pyx_t_5numpy_int8_t *) itemp = value;
    return 1;
}

static CYTHON_INLINE PyObject* __Pyx_PyInt_From_npy_int16(npy_int16 value) {
    const npy_int16 neg_one = (npy_int16) -1, const_zero = 0;
    const int is_unsigned = neg_one > const_zero;
    if (is_unsigned) {
        if (sizeof(npy_int16) < sizeof(long)) {
            return PyInt_FromLong((long) value);
        } else if (sizeof(npy_int16) <= sizeof(unsigned long)) {
            return PyLong_FromUnsignedLong((unsigned long) value);
        } else if (sizeof(npy_int16) <= sizeof(unsigned long long)) {
            return PyLong_FromUnsignedLongLong((unsigned long long) value);
        }
    } else {
        if (sizeof(npy_int16) <= sizeof(long)) {
            return PyInt_FromLong((long) value);
        } else if (sizeof(npy_int16) <= sizeof(long long)) {
            return PyLong_FromLongLong((long long) value);
        }
    }
    {
        int one = 1; int little = (int)*(unsigned char *)&one;
        unsigned char *bytes = (unsigned char *)&value;
        return _PyLong_FromByteArray(bytes, sizeof(npy_int16),
                                     little, !is_unsigned);
    }
}

static PyObject *__pyx_memview_get_nn___pyx_t_5numpy_int16_t(const char *itemp) {
    return (PyObject *) __Pyx_PyInt_From_npy_int16(*(__pyx_t_5numpy_int16_t *) itemp);
}
static int __pyx_memview_set_nn___pyx_t_5numpy_int16_t(const char *itemp, PyObject *obj) {
    __pyx_t_5numpy_int16_t value = __Pyx_PyInt_As_npy_int16(obj);
    if ((value == (npy_int16)-1) && PyErr_Occurred())
        return 0;
    *(__pyx_t_5numpy_int16_t *) itemp = value;
    return 1;
}

static CYTHON_INLINE PyObject* __Pyx_PyInt_From_npy_int32(npy_int32 value) {
    const npy_int32 neg_one = (npy_int32) -1, const_zero = 0;
    const int is_unsigned = neg_one > const_zero;
    if (is_unsigned) {
        if (sizeof(npy_int32) < sizeof(long)) {
            return PyInt_FromLong((long) value);
        } else if (sizeof(npy_int32) <= sizeof(unsigned long)) {
            return PyLong_FromUnsignedLong((unsigned long) value);
        } else if (sizeof(npy_int32) <= sizeof(unsigned long long)) {
            return PyLong_FromUnsignedLongLong((unsigned long long) value);
        }
    } else {
        if (sizeof(npy_int32) <= sizeof(long)) {
            return PyInt_FromLong((long) value);
        } else if (sizeof(npy_int32) <= sizeof(long long)) {
            return PyLong_FromLongLong((long long) value);
        }
    }
    {
        int one = 1; int little = (int)*(unsigned char *)&one;
        unsigned char *bytes = (unsigned char *)&value;
        return _PyLong_FromByteArray(bytes, sizeof(npy_int32),
                                     little, !is_unsigned);
    }
}

static PyObject *__pyx_memview_get_nn___pyx_t_5numpy_int32_t(const char *itemp) {
    return (PyObject *) __Pyx_PyInt_From_npy_int32(*(__pyx_t_5numpy_int32_t *) itemp);
}
static int __pyx_memview_set_nn___pyx_t_5numpy_int32_t(const char *itemp, PyObject *obj) {
    __pyx_t_5numpy_int32_t value = __Pyx_PyInt_As_npy_int32(obj);
    if ((value == (npy_int32)-1) && PyErr_Occurred())
        return 0;
    *(__pyx_t_5numpy_int32_t *) itemp = value;
    return 1;
}

static CYTHON_INLINE PyObject* __Pyx_PyInt_From_npy_int64(npy_int64 value) {
    const npy_int64 neg_one = (npy_int64) -1, const_zero = 0;
    const int is_unsigned = neg_one > const_zero;
    if (is_unsigned) {
        if (sizeof(npy_int64) < sizeof(long)) {
            return PyInt_FromLong((long) value);
        } else if (sizeof(npy_int64) <= sizeof(unsigned long)) {
            return PyLong_FromUnsignedLong((unsigned long) value);
        } else if (sizeof(npy_int64) <= sizeof(unsigned long long)) {
            return PyLong_FromUnsignedLongLong((unsigned long long) value);
        }
    } else {
        if (sizeof(npy_int64) <= sizeof(long)) {
            return PyInt_FromLong((long) value);
        } else if (sizeof(npy_int64) <= sizeof(long long)) {
            return PyLong_FromLongLong((long long) value);
        }
    }
    {
        int one = 1; int little = (int)*(unsigned char *)&one;
        unsigned char *bytes = (unsigned char *)&value;
        return _PyLong_FromByteArray(bytes, sizeof(npy_int64),
                                     little, !is_unsigned);
    }
}

static PyObject *__pyx_memview_get_nn___pyx_t_5numpy_int64_t(const char *itemp) {
    return (PyObject *) __Pyx_PyInt_From_npy_int64(*(__pyx_t_5numpy_int64_t *) itemp);
}
static int __pyx_memview_set_nn___pyx_t_5numpy_int64_t(const char *itemp, PyObject *obj) {
    __pyx_t_5numpy_int64_t value = __Pyx_PyInt_As_npy_int64(obj);
    if ((value == (npy_int64)-1) && PyErr_Occurred())
        return 0;
    *(__pyx_t_5numpy_int64_t *) itemp = value;
    return 1;
}

static CYTHON_INLINE PyObject* __Pyx_PyInt_From_npy_uint8(npy_uint8 value) {
    const npy_uint8 neg_one = (npy_uint8) -1, const_zero = 0;
    const int is_unsigned = neg_one > const_zero;
    if (is_unsigned) {
        if (sizeof(npy_uint8) < sizeof(long)) {
            return PyInt_FromLong((long) value);
        } else if (sizeof(npy_uint8) <= sizeof(unsigned long)) {
            return PyLong_FromUnsignedLong((unsigned long) value);
        } else if (sizeof(npy_uint8) <= sizeof(unsigned long long)) {
            return PyLong_FromUnsignedLongLong((unsigned long long) value);
        }
    } else {
        if (sizeof(npy_uint8) <= sizeof(long)) {
            return PyInt_FromLong((long) value);
        } else if (sizeof(npy_uint8) <= sizeof(long long)) {
            return PyLong_FromLongLong((long long) value);
        }
    }
    {
        int one = 1; int little = (int)*(unsigned char *)&one;
        unsigned char *bytes = (unsigned char *)&value;
        return _PyLong_FromByteArray(bytes, sizeof(npy_uint8),
                                     little, !is_unsigned);
    }
}

#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
 #if CYTHON_USE_PYLONG_INTERNALS
  #include "longintrepr.h"
 #endif
#endif
static CYTHON_INLINE npy_uint8 __Pyx_PyInt_As_npy_uint8(PyObject *x) {
    const npy_uint8 neg_one = (npy_uint8) -1, const_zero = 0;
    const int is_unsigned = neg_one > const_zero;
#if PY_MAJOR_VERSION < 3
    if (likely(PyInt_Check(x))) {
        if (sizeof(npy_uint8) < sizeof(long)) {
            __PYX_VERIFY_RETURN_INT(npy_uint8, long, PyInt_AS_LONG)
        } else {
            long val = PyInt_AS_LONG(x);
            if (is_unsigned && unlikely(val < 0)) {
                PyErr_SetString(PyExc_OverflowError,
                                "can't convert negative value to npy_uint8");
                return (npy_uint8) -1;
            }
            return (npy_uint8) val;
        }
    } else
#endif
    if (likely(PyLong_Check(x))) {
        if (is_unsigned) {
#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
 #if CYTHON_USE_PYLONG_INTERNALS
            if (sizeof(digit) <= sizeof(npy_uint8)) {
                switch (Py_SIZE(x)) {
                    case  0: return 0;
                    case  1: return (npy_uint8) ((PyLongObject*)x)->ob_digit[0];
                }
            }
 #endif
#endif
            if (unlikely(Py_SIZE(x) < 0)) {
                PyErr_SetString(PyExc_OverflowError,
                                "can't convert negative value to npy_uint8");
                return (npy_uint8) -1;
            }
            if (sizeof(npy_uint8) <= sizeof(unsigned long)) {
                __PYX_VERIFY_RETURN_INT(npy_uint8, unsigned long, PyLong_AsUnsignedLong)
            } else if (sizeof(npy_uint8) <= sizeof(unsigned long long)) {
                __PYX_VERIFY_RETURN_INT(npy_uint8, unsigned long long, PyLong_AsUnsignedLongLong)
            }
        } else {
#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
 #if CYTHON_USE_PYLONG_INTERNALS
            if (sizeof(digit) <= sizeof(npy_uint8)) {
                switch (Py_SIZE(x)) {
                    case  0: return 0;
                    case  1: return +(npy_uint8) ((PyLongObject*)x)->ob_digit[0];
                    case -1: return -(npy_uint8) ((PyLongObject*)x)->ob_digit[0];
                }
            }
 #endif
#endif
            if (sizeof(npy_uint8) <= sizeof(long)) {
                __PYX_VERIFY_RETURN_INT(npy_uint8, long, PyLong_AsLong)
            } else if (sizeof(npy_uint8) <= sizeof(long long)) {
                __PYX_VERIFY_RETURN_INT(npy_uint8, long long, PyLong_AsLongLong)
            }
        }
        {
#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
            PyErr_SetString(PyExc_RuntimeError,
                            "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
#else
            npy_uint8 val;
            PyObject *v = __Pyx_PyNumber_Int(x);
 #if PY_MAJOR_VERSION < 3
            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;
            }
#endif
            return (npy_uint8) -1;
        }
    } else {
        npy_uint8 val;
        PyObject *tmp = __Pyx_PyNumber_Int(x);
        if (!tmp) return (npy_uint8) -1;
        val = __Pyx_PyInt_As_npy_uint8(tmp);
        Py_DECREF(tmp);
        return val;
    }
}

static PyObject *__pyx_memview_get_nn___pyx_t_5numpy_uint8_t(const char *itemp) {
    return (PyObject *) __Pyx_PyInt_From_npy_uint8(*(__pyx_t_5numpy_uint8_t *) itemp);
}
static int __pyx_memview_set_nn___pyx_t_5numpy_uint8_t(const char *itemp, PyObject *obj) {
    __pyx_t_5numpy_uint8_t value = __Pyx_PyInt_As_npy_uint8(obj);
    if ((value == (npy_uint8)-1) && PyErr_Occurred())
        return 0;
    *(__pyx_t_5numpy_uint8_t *) itemp = value;
    return 1;
}

static CYTHON_INLINE PyObject* __Pyx_PyInt_From_npy_uint16(npy_uint16 value) {
    const npy_uint16 neg_one = (npy_uint16) -1, const_zero = 0;
    const int is_unsigned = neg_one > const_zero;
    if (is_unsigned) {
        if (sizeof(npy_uint16) < sizeof(long)) {
            return PyInt_FromLong((long) value);
        } else if (sizeof(npy_uint16) <= sizeof(unsigned long)) {
            return PyLong_FromUnsignedLong((unsigned long) value);
        } else if (sizeof(npy_uint16) <= sizeof(unsigned long long)) {
            return PyLong_FromUnsignedLongLong((unsigned long long) value);
        }
    } else {
        if (sizeof(npy_uint16) <= sizeof(long)) {
            return PyInt_FromLong((long) value);
        } else if (sizeof(npy_uint16) <= sizeof(long long)) {
            return PyLong_FromLongLong((long long) value);
        }
    }
    {
        int one = 1; int little = (int)*(unsigned char *)&one;
        unsigned char *bytes = (unsigned char *)&value;
        return _PyLong_FromByteArray(bytes, sizeof(npy_uint16),
                                     little, !is_unsigned);
    }
}

#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
 #if CYTHON_USE_PYLONG_INTERNALS
  #include "longintrepr.h"
 #endif
#endif
static CYTHON_INLINE npy_uint16 __Pyx_PyInt_As_npy_uint16(PyObject *x) {
    const npy_uint16 neg_one = (npy_uint16) -1, const_zero = 0;
    const int is_unsigned = neg_one > const_zero;
#if PY_MAJOR_VERSION < 3
    if (likely(PyInt_Check(x))) {
        if (sizeof(npy_uint16) < sizeof(long)) {
            __PYX_VERIFY_RETURN_INT(npy_uint16, long, PyInt_AS_LONG)
        } else {
            long val = PyInt_AS_LONG(x);
            if (is_unsigned && unlikely(val < 0)) {
                PyErr_SetString(PyExc_OverflowError,
                                "can't convert negative value to npy_uint16");
                return (npy_uint16) -1;
            }
            return (npy_uint16) val;
        }
    } else
#endif
    if (likely(PyLong_Check(x))) {
        if (is_unsigned) {
#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
 #if CYTHON_USE_PYLONG_INTERNALS
            if (sizeof(digit) <= sizeof(npy_uint16)) {
                switch (Py_SIZE(x)) {
                    case  0: return 0;
                    case  1: return (npy_uint16) ((PyLongObject*)x)->ob_digit[0];
                }
            }
 #endif
#endif
            if (unlikely(Py_SIZE(x) < 0)) {
                PyErr_SetString(PyExc_OverflowError,
                                "can't convert negative value to npy_uint16");
                return (npy_uint16) -1;
            }
            if (sizeof(npy_uint16) <= sizeof(unsigned long)) {
                __PYX_VERIFY_RETURN_INT(npy_uint16, unsigned long, PyLong_AsUnsignedLong)
            } else if (sizeof(npy_uint16) <= sizeof(unsigned long long)) {
                __PYX_VERIFY_RETURN_INT(npy_uint16, unsigned long long, PyLong_AsUnsignedLongLong)
            }
        } else {
#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
 #if CYTHON_USE_PYLONG_INTERNALS
            if (sizeof(digit) <= sizeof(npy_uint16)) {
                switch (Py_SIZE(x)) {
                    case  0: return 0;
                    case  1: return +(npy_uint16) ((PyLongObject*)x)->ob_digit[0];
                    case -1: return -(npy_uint16) ((PyLongObject*)x)->ob_digit[0];
                }
            }
 #endif
#endif
            if (sizeof(npy_uint16) <= sizeof(long)) {
                __PYX_VERIFY_RETURN_INT(npy_uint16, long, PyLong_AsLong)
            } else if (sizeof(npy_uint16) <= sizeof(long long)) {
                __PYX_VERIFY_RETURN_INT(npy_uint16, long long, PyLong_AsLongLong)
            }
        }
        {
#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
            PyErr_SetString(PyExc_RuntimeError,
                            "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
#else
            npy_uint16 val;
            PyObject *v = __Pyx_PyNumber_Int(x);
 #if PY_MAJOR_VERSION < 3
            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;
            }
#endif
            return (npy_uint16) -1;
        }
    } else {
        npy_uint16 val;
        PyObject *tmp = __Pyx_PyNumber_Int(x);
        if (!tmp) return (npy_uint16) -1;
        val = __Pyx_PyInt_As_npy_uint16(tmp);
        Py_DECREF(tmp);
        return val;
    }
}

static PyObject *__pyx_memview_get_nn___pyx_t_5numpy_uint16_t(const char *itemp) {
    return (PyObject *) __Pyx_PyInt_From_npy_uint16(*(__pyx_t_5numpy_uint16_t *) itemp);
}
static int __pyx_memview_set_nn___pyx_t_5numpy_uint16_t(const char *itemp, PyObject *obj) {
    __pyx_t_5numpy_uint16_t value = __Pyx_PyInt_As_npy_uint16(obj);
    if ((value == (npy_uint16)-1) && PyErr_Occurred())
        return 0;
    *(__pyx_t_5numpy_uint16_t *) itemp = value;
    return 1;
}

static CYTHON_INLINE PyObject* __Pyx_PyInt_From_npy_uint32(npy_uint32 value) {
    const npy_uint32 neg_one = (npy_uint32) -1, const_zero = 0;
    const int is_unsigned = neg_one > const_zero;
    if (is_unsigned) {
        if (sizeof(npy_uint32) < sizeof(long)) {
            return PyInt_FromLong((long) value);
        } else if (sizeof(npy_uint32) <= sizeof(unsigned long)) {
            return PyLong_FromUnsignedLong((unsigned long) value);
        } else if (sizeof(npy_uint32) <= sizeof(unsigned long long)) {
            return PyLong_FromUnsignedLongLong((unsigned long long) value);
        }
    } else {
        if (sizeof(npy_uint32) <= sizeof(long)) {
            return PyInt_FromLong((long) value);
        } else if (sizeof(npy_uint32) <= sizeof(long long)) {
            return PyLong_FromLongLong((long long) value);
        }
    }
    {
        int one = 1; int little = (int)*(unsigned char *)&one;
        unsigned char *bytes = (unsigned char *)&value;
        return _PyLong_FromByteArray(bytes, sizeof(npy_uint32),
                                     little, !is_unsigned);
    }
}

#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
 #if CYTHON_USE_PYLONG_INTERNALS
  #include "longintrepr.h"
 #endif
#endif
static CYTHON_INLINE npy_uint32 __Pyx_PyInt_As_npy_uint32(PyObject *x) {
    const npy_uint32 neg_one = (npy_uint32) -1, const_zero = 0;
    const int is_unsigned = neg_one > const_zero;
#if PY_MAJOR_VERSION < 3
    if (likely(PyInt_Check(x))) {
        if (sizeof(npy_uint32) < sizeof(long)) {
            __PYX_VERIFY_RETURN_INT(npy_uint32, long, PyInt_AS_LONG)
        } else {
            long val = PyInt_AS_LONG(x);
            if (is_unsigned && unlikely(val < 0)) {
                PyErr_SetString(PyExc_OverflowError,
                                "can't convert negative value to npy_uint32");
                return (npy_uint32) -1;
            }
            return (npy_uint32) val;
        }
    } else
#endif
    if (likely(PyLong_Check(x))) {
        if (is_unsigned) {
#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
 #if CYTHON_USE_PYLONG_INTERNALS
            if (sizeof(digit) <= sizeof(npy_uint32)) {
                switch (Py_SIZE(x)) {
                    case  0: return 0;
                    case  1: return (npy_uint32) ((PyLongObject*)x)->ob_digit[0];
                }
            }
 #endif
#endif
            if (unlikely(Py_SIZE(x) < 0)) {
                PyErr_SetString(PyExc_OverflowError,
                                "can't convert negative value to npy_uint32");
                return (npy_uint32) -1;
            }
            if (sizeof(npy_uint32) <= sizeof(unsigned long)) {
                __PYX_VERIFY_RETURN_INT(npy_uint32, unsigned long, PyLong_AsUnsignedLong)
            } else if (sizeof(npy_uint32) <= sizeof(unsigned long long)) {
                __PYX_VERIFY_RETURN_INT(npy_uint32, unsigned long long, PyLong_AsUnsignedLongLong)
            }
        } else {
#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
 #if CYTHON_USE_PYLONG_INTERNALS
            if (sizeof(digit) <= sizeof(npy_uint32)) {
                switch (Py_SIZE(x)) {
                    case  0: return 0;
                    case  1: return +(npy_uint32) ((PyLongObject*)x)->ob_digit[0];
                    case -1: return -(npy_uint32) ((PyLongObject*)x)->ob_digit[0];
                }
            }
 #endif
#endif
            if (sizeof(npy_uint32) <= sizeof(long)) {
                __PYX_VERIFY_RETURN_INT(npy_uint32, long, PyLong_AsLong)
            } else if (sizeof(npy_uint32) <= sizeof(long long)) {
                __PYX_VERIFY_RETURN_INT(npy_uint32, long long, PyLong_AsLongLong)
            }
        }
        {
#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
            PyErr_SetString(PyExc_RuntimeError,
                            "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
#else
            npy_uint32 val;
            PyObject *v = __Pyx_PyNumber_Int(x);
 #if PY_MAJOR_VERSION < 3
            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;
            }
#endif
            return (npy_uint32) -1;
        }
    } else {
        npy_uint32 val;
        PyObject *tmp = __Pyx_PyNumber_Int(x);
        if (!tmp) return (npy_uint32) -1;
        val = __Pyx_PyInt_As_npy_uint32(tmp);
        Py_DECREF(tmp);
        return val;
    }
}

static PyObject *__pyx_memview_get_nn___pyx_t_5numpy_uint32_t(const char *itemp) {
    return (PyObject *) __Pyx_PyInt_From_npy_uint32(*(__pyx_t_5numpy_uint32_t *) itemp);
}
static int __pyx_memview_set_nn___pyx_t_5numpy_uint32_t(const char *itemp, PyObject *obj) {
    __pyx_t_5numpy_uint32_t value = __Pyx_PyInt_As_npy_uint32(obj);
    if ((value == (npy_uint32)-1) && PyErr_Occurred())
        return 0;
    *(__pyx_t_5numpy_uint32_t *) itemp = value;
    return 1;
}

static CYTHON_INLINE PyObject* __Pyx_PyInt_From_npy_uint64(npy_uint64 value) {
    const npy_uint64 neg_one = (npy_uint64) -1, const_zero = 0;
    const int is_unsigned = neg_one > const_zero;
    if (is_unsigned) {
        if (sizeof(npy_uint64) < sizeof(long)) {
            return PyInt_FromLong((long) value);
        } else if (sizeof(npy_uint64) <= sizeof(unsigned long)) {
            return PyLong_FromUnsignedLong((unsigned long) value);
        } else if (sizeof(npy_uint64) <= sizeof(unsigned long long)) {
            return PyLong_FromUnsignedLongLong((unsigned long long) value);
        }
    } else {
        if (sizeof(npy_uint64) <= sizeof(long)) {
            return PyInt_FromLong((long) value);
        } else if (sizeof(npy_uint64) <= sizeof(long long)) {
            return PyLong_FromLongLong((long long) value);
        }
    }
    {
        int one = 1; int little = (int)*(unsigned char *)&one;
        unsigned char *bytes = (unsigned char *)&value;
        return _PyLong_FromByteArray(bytes, sizeof(npy_uint64),
                                     little, !is_unsigned);
    }
}

#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
 #if CYTHON_USE_PYLONG_INTERNALS
  #include "longintrepr.h"
 #endif
#endif
static CYTHON_INLINE npy_uint64 __Pyx_PyInt_As_npy_uint64(PyObject *x) {
    const npy_uint64 neg_one = (npy_uint64) -1, const_zero = 0;
    const int is_unsigned = neg_one > const_zero;
#if PY_MAJOR_VERSION < 3
    if (likely(PyInt_Check(x))) {
        if (sizeof(npy_uint64) < sizeof(long)) {
            __PYX_VERIFY_RETURN_INT(npy_uint64, long, PyInt_AS_LONG)
        } else {
            long val = PyInt_AS_LONG(x);
            if (is_unsigned && unlikely(val < 0)) {
                PyErr_SetString(PyExc_OverflowError,
                                "can't convert negative value to npy_uint64");
                return (npy_uint64) -1;
            }
            return (npy_uint64) val;
        }
    } else
#endif
    if (likely(PyLong_Check(x))) {
        if (is_unsigned) {
#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
 #if CYTHON_USE_PYLONG_INTERNALS
            if (sizeof(digit) <= sizeof(npy_uint64)) {
                switch (Py_SIZE(x)) {
                    case  0: return 0;
                    case  1: return (npy_uint64) ((PyLongObject*)x)->ob_digit[0];
                }
            }
 #endif
#endif
            if (unlikely(Py_SIZE(x) < 0)) {
                PyErr_SetString(PyExc_OverflowError,
                                "can't convert negative value to npy_uint64");
                return (npy_uint64) -1;
            }
            if (sizeof(npy_uint64) <= sizeof(unsigned long)) {
                __PYX_VERIFY_RETURN_INT(npy_uint64, unsigned long, PyLong_AsUnsignedLong)
            } else if (sizeof(npy_uint64) <= sizeof(unsigned long long)) {
                __PYX_VERIFY_RETURN_INT(npy_uint64, unsigned long long, PyLong_AsUnsignedLongLong)
            }
        } else {
#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
 #if CYTHON_USE_PYLONG_INTERNALS
            if (sizeof(digit) <= sizeof(npy_uint64)) {
                switch (Py_SIZE(x)) {
                    case  0: return 0;
                    case  1: return +(npy_uint64) ((PyLongObject*)x)->ob_digit[0];
                    case -1: return -(npy_uint64) ((PyLongObject*)x)->ob_digit[0];
                }
            }
 #endif
#endif
            if (sizeof(npy_uint64) <= sizeof(long)) {
                __PYX_VERIFY_RETURN_INT(npy_uint64, long, PyLong_AsLong)
            } else if (sizeof(npy_uint64) <= sizeof(long long)) {
                __PYX_VERIFY_RETURN_INT(npy_uint64, long long, PyLong_AsLongLong)
            }
        }
        {
#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
            PyErr_SetString(PyExc_RuntimeError,
                            "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
#else
            npy_uint64 val;
            PyObject *v = __Pyx_PyNumber_Int(x);
 #if PY_MAJOR_VERSION < 3
            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;
            }
#endif
            return (npy_uint64) -1;
        }
    } else {
        npy_uint64 val;
        PyObject *tmp = __Pyx_PyNumber_Int(x);
        if (!tmp) return (npy_uint64) -1;
        val = __Pyx_PyInt_As_npy_uint64(tmp);
        Py_DECREF(tmp);
        return val;
    }
}

static PyObject *__pyx_memview_get_nn___pyx_t_5numpy_uint64_t(const char *itemp) {
    return (PyObject *) __Pyx_PyInt_From_npy_uint64(*(__pyx_t_5numpy_uint64_t *) itemp);
}
static int __pyx_memview_set_nn___pyx_t_5numpy_uint64_t(const char *itemp, PyObject *obj) {
    __pyx_t_5numpy_uint64_t value = __Pyx_PyInt_As_npy_uint64(obj);
    if ((value == (npy_uint64)-1) && PyErr_Occurred())
        return 0;
    *(__pyx_t_5numpy_uint64_t *) itemp = value;
    return 1;
}

static PyObject *__pyx_memview_get_nn___pyx_t_5numpy_float32_t(const char *itemp) {
    return (PyObject *) PyFloat_FromDouble(*(__pyx_t_5numpy_float32_t *) itemp);
}
static int __pyx_memview_set_nn___pyx_t_5numpy_float32_t(const char *itemp, PyObject *obj) {
    __pyx_t_5numpy_float32_t value = __pyx_PyFloat_AsFloat(obj);
    if ((value == (npy_float32)-1) && PyErr_Occurred())
        return 0;
    *(__pyx_t_5numpy_float32_t *) itemp = value;
    return 1;
}

static PyObject *__pyx_memview_get_nn___pyx_t_5numpy_float64_t(const char *itemp) {
    return (PyObject *) PyFloat_FromDouble(*(__pyx_t_5numpy_float64_t *) itemp);
}
static int __pyx_memview_set_nn___pyx_t_5numpy_float64_t(const char *itemp, PyObject *obj) {
    __pyx_t_5numpy_float64_t value = __pyx_PyFloat_AsDouble(obj);
    if ((value == (npy_float64)-1) && PyErr_Occurred())
        return 0;
    *(__pyx_t_5numpy_float64_t *) itemp = value;
    return 1;
}

static __Pyx_memviewslice
__pyx_memoryview_copy_new_contig(const __Pyx_memviewslice *from_mvs,
                                 const char *mode, int ndim,
                                 size_t sizeof_dtype, int contig_flag,
                                 int dtype_is_object)
{
    __Pyx_RefNannyDeclarations
    int i;
    __Pyx_memviewslice new_mvs = { 0, 0, { 0 }, { 0 }, { 0 } };
    struct __pyx_memoryview_obj *from_memview = from_mvs->memview;
    Py_buffer *buf = &from_memview->view;
    PyObject *shape_tuple = NULL;
    PyObject *temp_int = NULL;
    struct __pyx_array_obj *array_obj = NULL;
    struct __pyx_memoryview_obj *memview_obj = NULL;
    __Pyx_RefNannySetupContext("__pyx_memoryview_copy_new_contig", 0);
    for (i = 0; i < ndim; i++) {
        if (from_mvs->suboffsets[i] >= 0) {
            PyErr_Format(PyExc_ValueError, "Cannot copy memoryview slice with "
                                           "indirect dimensions (axis %d)", i);
            goto fail;
        }
    }
    shape_tuple = PyTuple_New(ndim);
    if (unlikely(!shape_tuple)) {
        goto fail;
    }
    __Pyx_GOTREF(shape_tuple);
    for(i = 0; i < ndim; i++) {
        temp_int = PyInt_FromSsize_t(from_mvs->shape[i]);
        if(unlikely(!temp_int)) {
            goto fail;
        } else {
            PyTuple_SET_ITEM(shape_tuple, i, temp_int);
            temp_int = NULL;
        }
    }
    array_obj = __pyx_array_new(shape_tuple, sizeof_dtype, buf->format, (char *) mode, NULL);
    if (unlikely(!array_obj)) {
        goto fail;
    }
    __Pyx_GOTREF(array_obj);
    memview_obj = (struct __pyx_memoryview_obj *) __pyx_memoryview_new(
                                    (PyObject *) array_obj, contig_flag,
                                    dtype_is_object,
                                    from_mvs->memview->typeinfo);
    if (unlikely(!memview_obj))
        goto fail;
    if (unlikely(__Pyx_init_memviewslice(memview_obj, ndim, &new_mvs, 1) < 0))
        goto fail;
    if (unlikely(__pyx_memoryview_copy_contents(*from_mvs, new_mvs, ndim, ndim,
                                                dtype_is_object) < 0))
        goto fail;
    goto no_fail;
fail:
    __Pyx_XDECREF(new_mvs.memview);
    new_mvs.memview = NULL;
    new_mvs.data = NULL;
no_fail:
    __Pyx_XDECREF(shape_tuple);
    __Pyx_XDECREF(temp_int);
    __Pyx_XDECREF(array_obj);
    __Pyx_RefNannyFinishContext();
    return new_mvs;
}

static PyObject *__pyx_memview_get_object(const char *itemp) {
    PyObject *result = *(PyObject **) itemp;
    Py_INCREF(result);
    return result;
}
static int __pyx_memview_set_object(const char *itemp, PyObject *obj) {
    Py_INCREF(obj);
    Py_DECREF(*(PyObject **) itemp);
    *(PyObject **) itemp = obj;
    return 1;
}

static CYTHON_INLINE PyObject* __Pyx_PyInt_From_Py_intptr_t(Py_intptr_t value) {
    const Py_intptr_t neg_one = (Py_intptr_t) -1, const_zero = 0;
    const int is_unsigned = neg_one > const_zero;
    if (is_unsigned) {
        if (sizeof(Py_intptr_t) < sizeof(long)) {
            return PyInt_FromLong((long) value);
        } else if (sizeof(Py_intptr_t) <= sizeof(unsigned long)) {
            return PyLong_FromUnsignedLong((unsigned long) value);
        } else if (sizeof(Py_intptr_t) <= sizeof(unsigned long long)) {
            return PyLong_FromUnsignedLongLong((unsigned long long) value);
        }
    } else {
        if (sizeof(Py_intptr_t) <= sizeof(long)) {
            return PyInt_FromLong((long) value);
        } else if (sizeof(Py_intptr_t) <= sizeof(long long)) {
            return PyLong_FromLongLong((long long) value);
        }
    }
    {
        int one = 1; int little = (int)*(unsigned char *)&one;
        unsigned char *bytes = (unsigned char *)&value;
        return _PyLong_FromByteArray(bytes, sizeof(Py_intptr_t),
                                     little, !is_unsigned);
    }
}

#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

#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

#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 PyObject* __Pyx_PyInt_From_ptrdiff_t(ptrdiff_t value) {
    const ptrdiff_t neg_one = (ptrdiff_t) -1, const_zero = 0;
    const int is_unsigned = neg_one > const_zero;
    if (is_unsigned) {
        if (sizeof(ptrdiff_t) < sizeof(long)) {
            return PyInt_FromLong((long) value);
        } else if (sizeof(ptrdiff_t) <= sizeof(unsigned long)) {
            return PyLong_FromUnsignedLong((unsigned long) value);
        } else if (sizeof(ptrdiff_t) <= sizeof(unsigned long long)) {
            return PyLong_FromUnsignedLongLong((unsigned long long) value);
        }
    } else {
        if (sizeof(ptrdiff_t) <= sizeof(long)) {
            return PyInt_FromLong((long) value);
        } else if (sizeof(ptrdiff_t) <= sizeof(long long)) {
            return PyLong_FromLongLong((long long) value);
        }
    }
    {
        int one = 1; int little = (int)*(unsigned char *)&one;
        unsigned char *bytes = (unsigned char *)&value;
        return _PyLong_FromByteArray(bytes, sizeof(ptrdiff_t),
                                     little, !is_unsigned);
    }
}

static int
__pyx_memviewslice_is_contig(const __Pyx_memviewslice *mvs,
                             char order, int ndim)
{
    int i, index, step, start;
    Py_ssize_t itemsize = mvs->memview->view.itemsize;
    if (order == 'F') {
        step = 1;
        start = 0;
    } else {
        step = -1;
        start = ndim - 1;
    }
    for (i = 0; i < ndim; i++) {
        index = start + step * i;
        if (mvs->suboffsets[index] >= 0 || mvs->strides[index] != itemsize)
            return 0;
        itemsize *= mvs->shape[index];
    }
    return 1;
}

static void
__pyx_get_array_memory_extents(__Pyx_memviewslice *slice,
                               void **out_start, void **out_end,
                               int ndim, size_t itemsize)
{
    char *start, *end;
    int i;
    start = end = slice->data;
    for (i = 0; i < ndim; i++) {
        Py_ssize_t stride = slice->strides[i];
        Py_ssize_t extent = slice->shape[i];
        if (extent == 0) {
            *out_start = *out_end = start;
            return;
        } else {
            if (stride > 0)
                end += stride * (extent - 1);
            else
                start += stride * (extent - 1);
        }
    }
    *out_start = start;
    *out_end = end + itemsize;
}
static int
__pyx_slices_overlap(__Pyx_memviewslice *slice1,
                     __Pyx_memviewslice *slice2,
                     int ndim, size_t itemsize)
{
    void *start1, *end1, *start2, *end2;
    __pyx_get_array_memory_extents(slice1, &start1, &end1, ndim, itemsize);
    __pyx_get_array_memory_extents(slice2, &start2, &end2, ndim, itemsize);
    return (start1 < end2) && (start2 < end1);
}

static CYTHON_INLINE PyObject *
__pyx_capsule_create(void *p, CYTHON_UNUSED const char *sig)
{
    PyObject *cobj;
#if PY_VERSION_HEX >= 0x02070000 && !(PY_MAJOR_VERSION == 3 && PY_MINOR_VERSION == 0)
    cobj = PyCapsule_New(p, sig, NULL);
#else
    cobj = PyCObject_FromVoidPtr(p, NULL);
#endif
    return cobj;
}

#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
 #if CYTHON_USE_PYLONG_INTERNALS
  #include "longintrepr.h"
 #endif
#endif
static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) {
    const long neg_one = (long) -1, const_zero = 0;
    const int is_unsigned = neg_one > const_zero;
#if PY_MAJOR_VERSION < 3
    if (likely(PyInt_Check(x))) {
        if (sizeof(long) < sizeof(long)) {
            __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG)
        } else {
            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 CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
 #if CYTHON_USE_PYLONG_INTERNALS
            if (sizeof(digit) <= sizeof(long)) {
                switch (Py_SIZE(x)) {
                    case  0: return 0;
                    case  1: return (long) ((PyLongObject*)x)->ob_digit[0];
                }
            }
 #endif
#endif
            if (unlikely(Py_SIZE(x) < 0)) {
                PyErr_SetString(PyExc_OverflowError,
                                "can't convert negative value to long");
                return (long) -1;
            }
            if (sizeof(long) <= sizeof(unsigned long)) {
                __PYX_VERIFY_RETURN_INT(long, unsigned long, PyLong_AsUnsignedLong)
            } else if (sizeof(long) <= sizeof(unsigned long long)) {
                __PYX_VERIFY_RETURN_INT(long, unsigned long long, PyLong_AsUnsignedLongLong)
            }
        } else {
#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
 #if CYTHON_USE_PYLONG_INTERNALS
            if (sizeof(digit) <= sizeof(long)) {
                switch (Py_SIZE(x)) {
                    case  0: return 0;
                    case  1: return +(long) ((PyLongObject*)x)->ob_digit[0];
                    case -1: return -(long) ((PyLongObject*)x)->ob_digit[0];
                }
            }
 #endif
#endif
            if (sizeof(long) <= sizeof(long)) {
                __PYX_VERIFY_RETURN_INT(long, long, PyLong_AsLong)
            } else if (sizeof(long) <= sizeof(long long)) {
                __PYX_VERIFY_RETURN_INT(long, long long, PyLong_AsLongLong)
            }
        }
        {
#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
            PyErr_SetString(PyExc_RuntimeError,
                            "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
#else
            long val;
            PyObject *v = __Pyx_PyNumber_Int(x);
 #if PY_MAJOR_VERSION < 3
            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;
            }
#endif
            return (long) -1;
        }
    } else {
        long val;
        PyObject *tmp = __Pyx_PyNumber_Int(x);
        if (!tmp) return (long) -1;
        val = __Pyx_PyInt_As_long(tmp);
        Py_DECREF(tmp);
        return val;
    }
}

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;
}

#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;
    py_name = __Pyx_PyIdentifier_FromString(name);
    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

#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_ssize_t basicsize;
#ifdef Py_LIMITED_API
    PyObject *py_basicsize;
#endif
    py_module = __Pyx_ImportModule(module_name);
    if (!py_module)
        goto bad;
    py_name = __Pyx_PyIdentifier_FromString(class_name);
    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,
            "%.200s.%.200s is not a type object",
            module_name, class_name);
        goto bad;
    }
#ifndef Py_LIMITED_API
    basicsize = ((PyTypeObject *)result)->tp_basicsize;
#else
    py_basicsize = PyObject_GetAttrString(result, "__basicsize__");
    if (!py_basicsize)
        goto bad;
    basicsize = PyLong_AsSsize_t(py_basicsize);
    Py_DECREF(py_basicsize);
    py_basicsize = 0;
    if (basicsize == (Py_ssize_t)-1 && PyErr_Occurred())
        goto bad;
#endif
    if (!strict && (size_t)basicsize > 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 ((size_t)basicsize != size) {
        PyErr_Format(PyExc_ValueError,
            "%.200s.%.200s 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

static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) {
    int start = 0, mid = 0, end = count - 1;
    if (end >= 0 && code_line > entries[end].code_line) {
        return count;
    }
    while (start < end) {
        mid = (start + end) / 2;
        if (code_line < entries[mid].code_line) {
            end = mid;
        } else if (code_line > entries[mid].code_line) {
             start = mid + 1;
        } else {
            return mid;
        }
    }
    if (code_line <= entries[mid].code_line) {
        return mid;
    } else {
        return mid + 1;
    }
}
static PyCodeObject *__pyx_find_code_object(int code_line) {
    PyCodeObject* code_object;
    int pos;
    if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) {
        return NULL;
    }
    pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
    if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) {
        return NULL;
    }
    code_object = __pyx_code_cache.entries[pos].code_object;
    Py_INCREF(code_object);
    return code_object;
}
static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) {
    int pos, i;
    __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries;
    if (unlikely(!code_line)) {
        return;
    }
    if (unlikely(!entries)) {
        entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry));
        if (likely(entries)) {
            __pyx_code_cache.entries = entries;
            __pyx_code_cache.max_count = 64;
            __pyx_code_cache.count = 1;
            entries[0].code_line = code_line;
            entries[0].code_object = code_object;
            Py_INCREF(code_object);
        }
        return;
    }
    pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
    if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) {
        PyCodeObject* tmp = entries[pos].code_object;
        entries[pos].code_object = code_object;
        Py_DECREF(tmp);
        return;
    }
    if (__pyx_code_cache.count == __pyx_code_cache.max_count) {
        int new_max = __pyx_code_cache.max_count + 64;
        entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc(
            __pyx_code_cache.entries, new_max*sizeof(__Pyx_CodeObjectCacheEntry));
        if (unlikely(!entries)) {
            return;
        }
        __pyx_code_cache.entries = entries;
        __pyx_code_cache.max_count = new_max;
    }
    for (i=__pyx_code_cache.count; i>pos; i--) {
        entries[i] = entries[i-1];
    }
    entries[pos].code_line = code_line;
    entries[pos].code_object = code_object;
    __pyx_code_cache.count++;
    Py_INCREF(code_object);
}

#include "compile.h"
#include "frameobject.h"
#include "traceback.h"
static PyCodeObject* __Pyx_CreateCodeObjectForTraceback(
            const char *funcname, int c_line,
            int py_line, const char *filename) {
    PyCodeObject *py_code = 0;
    PyObject *py_srcfile = 0;
    PyObject *py_funcname = 0;
    #if PY_MAJOR_VERSION < 3
    py_srcfile = PyString_FromString(filename);
    #else
    py_srcfile = PyUnicode_FromString(filename);
    #endif
    if (!py_srcfile) goto bad;
    if (c_line) {
        #if PY_MAJOR_VERSION < 3
        py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
        #else
        py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
        #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_code = __Pyx_PyCode_New(
        0,            /*int argcount,*/
        0,            /*int kwonlyargcount,*/
        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,*/
        py_line,      /*int firstlineno,*/
        __pyx_empty_bytes  /*PyObject *lnotab*/
    );
    Py_DECREF(py_srcfile);
    Py_DECREF(py_funcname);
    return py_code;
bad:
    Py_XDECREF(py_srcfile);
    Py_XDECREF(py_funcname);
    return NULL;
}
static void __Pyx_AddTraceback(const char *funcname, int c_line,
                               int py_line, const char *filename) {
    PyCodeObject *py_code = 0;
    PyObject *py_globals = 0;
    PyFrameObject *py_frame = 0;
    py_code = __pyx_find_code_object(c_line ? c_line : py_line);
    if (!py_code) {
        py_code = __Pyx_CreateCodeObjectForTraceback(
            funcname, c_line, py_line, filename);
        if (!py_code) goto bad;
        __pyx_insert_code_object(c_line ? c_line : py_line, py_code);
    }
    py_globals = PyModule_GetDict(__pyx_m);
    if (!py_globals) 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 = py_line;
    PyTraceBack_Here(py_frame);
bad:
    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;
}

static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) {
    return __Pyx_PyUnicode_FromStringAndSize(c_str, strlen(c_str));
}
static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject* o) {
    Py_ssize_t ignore;
    return __Pyx_PyObject_AsStringAndSize(o, &ignore);
}
static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
    if (
#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
            __Pyx_sys_getdefaultencoding_not_ascii &&
#endif
            PyUnicode_Check(o)) {
#if PY_VERSION_HEX < 0x03030000
        char* defenc_c;
        PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL);
        if (!defenc) return NULL;
        defenc_c = PyBytes_AS_STRING(defenc);
#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
        {
            char* end = defenc_c + PyBytes_GET_SIZE(defenc);
            char* c;
            for (c = defenc_c; c < end; c++) {
                if ((unsigned char) (*c) >= 128) {
                    PyUnicode_AsASCIIString(o);
                    return NULL;
                }
            }
        }
#endif /*__PYX_DEFAULT_STRING_ENCODING_IS_ASCII*/
        *length = PyBytes_GET_SIZE(defenc);
        return defenc_c;
#else /* PY_VERSION_HEX < 0x03030000 */
        if (PyUnicode_READY(o) == -1) return NULL;
#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
        if (PyUnicode_IS_ASCII(o)) {
            *length = PyUnicode_GET_LENGTH(o);
            return PyUnicode_AsUTF8(o);
        } else {
            PyUnicode_AsASCIIString(o);
            return NULL;
        }
#else /* __PYX_DEFAULT_STRING_ENCODING_IS_ASCII */
        return PyUnicode_AsUTF8AndSize(o, length);
#endif /* __PYX_DEFAULT_STRING_ENCODING_IS_ASCII */
#endif /* PY_VERSION_HEX < 0x03030000 */
    } else
#endif /* __PYX_DEFAULT_STRING_ENCODING_IS_ASCII  || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT */
#if !CYTHON_COMPILING_IN_PYPY
#if PY_VERSION_HEX >= 0x02060000
    if (PyByteArray_Check(o)) {
        *length = PyByteArray_GET_SIZE(o);
        return PyByteArray_AS_STRING(o);
    } else
#endif
#endif
    {
        char* result;
        int r = PyBytes_AsStringAndSize(o, &result, length);
        if (unlikely(r < 0)) {
            return NULL;
        } else {
            return result;
        }
    }
}
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_MAJOR_VERSION < 3
  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_MAJOR_VERSION < 3
  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_MAJOR_VERSION < 3
    if (!PyInt_Check(res) && !PyLong_Check(res)) {
#else
    if (!PyLong_Check(res)) {
#endif
      PyErr_Format(PyExc_TypeError,
                   "__%.4s__ returned non-%.4s (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;
}
#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
 #if CYTHON_USE_PYLONG_INTERNALS
  #include "longintrepr.h"
 #endif
#endif
static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) {
  Py_ssize_t ival;
  PyObject *x;
#if PY_MAJOR_VERSION < 3
  if (likely(PyInt_CheckExact(b)))
      return PyInt_AS_LONG(b);
#endif
  if (likely(PyLong_CheckExact(b))) {
    #if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
     #if CYTHON_USE_PYLONG_INTERNALS
       switch (Py_SIZE(b)) {
       case -1: return -(sdigit)((PyLongObject*)b)->ob_digit[0];
       case  0: return 0;
       case  1: return ((PyLongObject*)b)->ob_digit[0];
       }
     #endif
    #endif
  #if PY_VERSION_HEX < 0x02060000
    return PyInt_AsSsize_t(b);
  #else
    return PyLong_AsSsize_t(b);
  #endif
  }
  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
}


#endif /* Py_PYTHON_H */
